@malloydata/malloy-explorer 0.0.285-dev250611150446 → 0.0.295-dev250710213205

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.
Files changed (32) hide show
  1. package/.gitmodules +3 -0
  2. package/@flowtypes/components/MalloyExplorerProvider.flow.js +2 -5
  3. package/README.md +7 -0
  4. package/dist/cjs/index.cjs +1985 -1317
  5. package/dist/cjs/index.cjs.map +1 -1
  6. package/dist/esm/index.js +1988 -1320
  7. package/dist/esm/index.js.map +1 -1
  8. package/dist/malloy-explorer.css +18 -1
  9. package/dist/types/components/MalloyExplorerProvider.d.ts +2 -4
  10. package/dist/types/components/QueryPanel/AddMenu/ValueList.d.ts +3 -1
  11. package/dist/types/components/QueryPanel/VizEditor/ArrayEditor.d.ts +3 -0
  12. package/dist/types/components/QueryPanel/VizEditor/BooleanEditor.d.ts +3 -0
  13. package/dist/types/components/QueryPanel/VizEditor/FieldEditor.d.ts +3 -0
  14. package/dist/types/components/QueryPanel/VizEditor/InfoHover.d.ts +4 -0
  15. package/dist/types/components/QueryPanel/VizEditor/NumberEditor.d.ts +3 -0
  16. package/dist/types/components/QueryPanel/VizEditor/ObjectEditor.d.ts +3 -0
  17. package/dist/types/components/QueryPanel/VizEditor/OneOfEditor.d.ts +3 -0
  18. package/dist/types/components/QueryPanel/VizEditor/StringEditor.d.ts +3 -0
  19. package/dist/types/components/QueryPanel/VizEditor/VizEditor.d.ts +11 -0
  20. package/dist/types/components/QueryPanel/VizEditor/VizEditorDialog.d.ts +12 -0
  21. package/dist/types/components/QueryPanel/VizEditor/VizEditorPopover.d.ts +10 -0
  22. package/dist/types/components/QueryPanel/VizEditor/styles.d.ts +72 -0
  23. package/dist/types/components/QueryPanel/VizEditor/types.d.ts +11 -0
  24. package/dist/types/components/QueryPanel/dialogStyles.d.ts +60 -0
  25. package/dist/types/components/ResultPanel/ResultDisplay.d.ts +0 -4
  26. package/dist/types/components/filters/DateTimeFilterCore.d.ts +1 -1
  27. package/dist/types/components/primitives/ScrollableArea.d.ts +3 -0
  28. package/dist/types/components/utils/renderer.d.ts +0 -24
  29. package/dist/types/contexts/QueryEditorContext.d.ts +2 -4
  30. package/package.json +10 -8
  31. package/vite.config.mts +5 -0
  32. package/dist/types/components/QueryPanel/RendererPopover.d.ts +0 -20
@@ -19,8 +19,8 @@ const jsxRuntime = require("react/jsx-runtime");
19
19
  const React = require("react");
20
20
  const QB = require("@malloydata/malloy-query-builder");
21
21
  const malloyTag = require("@malloydata/malloy-tag");
22
- const malloyFilter = require("@malloydata/malloy-filter");
23
22
  const render = require("@malloydata/render");
23
+ const malloyFilter = require("@malloydata/malloy-filter");
24
24
  const ReactDOM = require("react-dom");
25
25
  function _interopNamespaceDefault(e) {
26
26
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -3763,6 +3763,15 @@ const fontStyles = {
3763
3763
  lineHeight: "mly1d3mw78",
3764
3764
  letterSpacing: "mly1gu5id8",
3765
3765
  $$css: true
3766
+ },
3767
+ tooltipText: {
3768
+ fontFamily: "mly1rj5sg5",
3769
+ color: "mly1rs82da",
3770
+ fontSize: "mlyif65rj",
3771
+ fontStyle: "mly1j61x8r",
3772
+ fontWeight: "mlyo1l8bm",
3773
+ lineHeight: "mly1fc57z9",
3774
+ $$css: true
3766
3775
  }
3767
3776
  };
3768
3777
  const SvgChevronDown = (props2) => /* @__PURE__ */ React__namespace.createElement("svg", { width: 110, height: 110, viewBox: "15 15 80 80", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", ...props2 }, /* @__PURE__ */ React__namespace.createElement("g", { id: "cahevron_down", stroke: "none", strokeWidth: 1, fill: "none", fillRule: "evenodd" }, /* @__PURE__ */ React__namespace.createElement("path", { d: "M52.9466923,41.3127809 C54.0529774,40.2742275 55.7502198,40.2309545 56.9057514,41.1829617 L57.0533077,41.3127809 L81.5533077,64.3127809 C82.7612755,65.4467914 82.8212296,67.34534 81.6872191,68.5533077 C80.5968243,69.7148152 78.7995712,69.8149195 77.5890551,68.8127704 L77.4466923,68.6872191 L54.9999906,47.615 L32.5533077,68.6872191 C31.3918003,69.7776139 29.5918121,69.7641211 28.4469384,68.6875913 L28.3127809,68.5533077 C27.2223861,67.3918003 27.2358789,65.5918121 28.3124087,64.4469384 L28.4466923,64.3127809 L52.9466923,41.3127809 Z", id: "Path", fill: "currentColor", fillRule: "nonzero", transform: "translate(55.000000, 55.000005) rotate(-180.000000) translate(-55.000000, -55.000005) " })));
@@ -3913,11 +3922,11 @@ function Icon({
3913
3922
  return null;
3914
3923
  }
3915
3924
  return /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {
3916
- ..._stylex.props(styles$O.main, colorVariants$3[color], customStyle),
3925
+ ..._stylex.props(styles$Q.main, colorVariants$3[color], customStyle),
3917
3926
  "data-testid": `icon-${color}-${name}`
3918
3927
  });
3919
3928
  }
3920
- const styles$O = {
3929
+ const styles$Q = {
3921
3930
  main: {
3922
3931
  display: "mly1rg5ohu",
3923
3932
  width: "mly1kky2od",
@@ -3986,18 +3995,18 @@ function Badge({
3986
3995
  customStyle
3987
3996
  }) {
3988
3997
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
3989
- ..._stylex.props(styles$N.main, colorVariants$2[color], customStyle),
3998
+ ..._stylex.props(styles$P.main, colorVariants$2[color], customStyle),
3990
3999
  children: [icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, {
3991
4000
  color,
3992
4001
  name: icon
3993
4002
  }), /* @__PURE__ */ jsxRuntime.jsx("div", {
3994
4003
  "data-testid": "badge-label",
3995
- ..._stylex.props(fontStyles.badge, styles$N.label),
4004
+ ..._stylex.props(fontStyles.badge, styles$P.label),
3996
4005
  children: label
3997
4006
  })]
3998
4007
  });
3999
4008
  }
4000
- const styles$N = {
4009
+ const styles$P = {
4001
4010
  main: {
4002
4011
  display: "mly3nfvp2",
4003
4012
  height: "mly1qx5ct2",
@@ -4079,10 +4088,10 @@ function Divider({
4079
4088
  customStyle
4080
4089
  }) {
4081
4090
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
4082
- ..._stylex.props(styles$M.main, orientationVariants[orientation], customStyle)
4091
+ ..._stylex.props(styles$O.main, orientationVariants[orientation], customStyle)
4083
4092
  });
4084
4093
  }
4085
- const styles$M = {
4094
+ const styles$O = {
4086
4095
  main: {
4087
4096
  background: "mly1xnbgy5",
4088
4097
  backgroundAttachment: null,
@@ -4888,7 +4897,7 @@ function Button({
4888
4897
  ...props2
4889
4898
  }) {
4890
4899
  const button = /* @__PURE__ */ jsxRuntime.jsxs("button", {
4891
- ..._stylex.props(styles$L.main, colorVariants$1[variant], sizeVariants$1[size2], customStyle),
4900
+ ..._stylex.props(styles$N.main, colorVariants$1[variant], sizeVariants$1[size2], customStyle),
4892
4901
  type: "button",
4893
4902
  disabled: isDisabled,
4894
4903
  ...props2,
@@ -4898,9 +4907,9 @@ function Button({
4898
4907
  },
4899
4908
  children: [icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, {
4900
4909
  name: icon,
4901
- customStyle: styles$L.icon
4910
+ customStyle: styles$N.icon
4902
4911
  }), label && /* @__PURE__ */ jsxRuntime.jsx("div", {
4903
- ..._stylex.props(variant === "primary" ? fontStyles.emphasized : fontStyles.body, styles$L.label),
4912
+ ..._stylex.props(variant === "primary" ? fontStyles.emphasized : fontStyles.body, styles$N.label),
4904
4913
  children: label
4905
4914
  })]
4906
4915
  }), isDisabled && /* @__PURE__ */ jsxRuntime.jsx("div", {
@@ -4927,7 +4936,7 @@ function Button({
4927
4936
  return button;
4928
4937
  }
4929
4938
  }
4930
- const styles$L = {
4939
+ const styles$N = {
4931
4940
  main: {
4932
4941
  display: "mly3nfvp2",
4933
4942
  flexDirection: "mlydt5ytf",
@@ -5178,7 +5187,7 @@ function Token({
5178
5187
  }) {
5179
5188
  const isInteractive = onClick !== void 0 || asButtonTrigger;
5180
5189
  const token2 = /* @__PURE__ */ jsxRuntime.jsxs("div", {
5181
- ..._stylex.props(tokenStyles.main, tokenColorVariants[color], tokenSizeVariants[size2], !isInteractive && styles$K.nonInteractive, customStyle),
5190
+ ..._stylex.props(tokenStyles.main, tokenColorVariants[color], tokenSizeVariants[size2], !isInteractive && styles$M.nonInteractive, customStyle),
5182
5191
  ...dragProps == null ? void 0 : dragProps.attributes,
5183
5192
  ...dragProps == null ? void 0 : dragProps.listeners,
5184
5193
  children: [icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, {
@@ -5209,13 +5218,13 @@ function Token({
5209
5218
  }), /* @__PURE__ */ jsxRuntime.jsx(Portal$4, {
5210
5219
  children: /* @__PURE__ */ jsxRuntime.jsx(Content2$4, {
5211
5220
  ...tooltipProps,
5212
- ..._stylex.props(typeof tooltip === "string" ? tooltipStyles.default : tooltipStyles.card),
5221
+ ..._stylex.props(fontStyles.tooltipText, typeof tooltip === "string" ? tooltipStyles.default : tooltipStyles.card),
5213
5222
  children: tooltip
5214
5223
  })
5215
5224
  })]
5216
5225
  }) : token2;
5217
5226
  }
5218
- const styles$K = {
5227
+ const styles$M = {
5219
5228
  nonInteractive: {
5220
5229
  cursor: "mlyt0e3qv",
5221
5230
  background: "mly1np9qvj",
@@ -5239,7 +5248,7 @@ function TokenGroup({
5239
5248
  }) {
5240
5249
  const count2 = React__namespace.Children.count(children);
5241
5250
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
5242
- ..._stylex.props(styles$J.main, customStyle),
5251
+ ..._stylex.props(styles$L.main, customStyle),
5243
5252
  children: React__namespace.Children.map(children, (child, index2) => /* @__PURE__ */ React__namespace.cloneElement(child, {
5244
5253
  customStyle: {
5245
5254
  ...child.props.customStyle,
@@ -5250,16 +5259,16 @@ function TokenGroup({
5250
5259
  });
5251
5260
  }
5252
5261
  const getChildStyle = (index2, count2) => {
5253
- if (count2 === 1) return styles$J.onlyChild;
5254
- if (index2 === 0) return styles$J.firstChild;
5255
- if (index2 === count2 - 1) return styles$J.lastChild;
5256
- return styles$J.innerChild;
5262
+ if (count2 === 1) return styles$L.onlyChild;
5263
+ if (index2 === 0) return styles$L.firstChild;
5264
+ if (index2 === count2 - 1) return styles$L.lastChild;
5265
+ return styles$L.innerChild;
5257
5266
  };
5258
5267
  const getTokenColor = (child, groupColor) => {
5259
5268
  const childColor = child.props.color;
5260
5269
  return childColor === void 0 ? groupColor : childColor;
5261
5270
  };
5262
- const styles$J = {
5271
+ const styles$L = {
5263
5272
  main: {
5264
5273
  display: "mlyrvj5dj",
5265
5274
  gridAutoFlow: "mly1mt1orb",
@@ -5331,7 +5340,7 @@ function ErrorIcon({
5331
5340
  },
5332
5341
  children: /* @__PURE__ */ jsxRuntime.jsx(Icon, {
5333
5342
  name: "warning",
5334
- customStyle: styles$I.errorIcon
5343
+ customStyle: styles$K.errorIcon
5335
5344
  })
5336
5345
  })
5337
5346
  }), /* @__PURE__ */ jsxRuntime.jsx(TooltipPortal, {
@@ -5344,7 +5353,7 @@ function ErrorIcon({
5344
5353
  })]
5345
5354
  });
5346
5355
  }
5347
- const styles$I = {
5356
+ const styles$K = {
5348
5357
  errorIcon: {
5349
5358
  color: "mly1e2nbdu",
5350
5359
  $$css: true
@@ -5389,22 +5398,22 @@ function EditableToken({
5389
5398
  className: "mly78zum5 mly6s0dn4"
5390
5399
  },
5391
5400
  children: [/* @__PURE__ */ jsxRuntime.jsxs("div", {
5392
- ..._stylex.props(tokenStyles.main, tokenColorVariants[color], tokenSizeVariants[size2], isFocused && styles$H.focused, !!errorMessage && styles$H.hasError, customStyle),
5401
+ ..._stylex.props(tokenStyles.main, tokenColorVariants[color], tokenSizeVariants[size2], isFocused && styles$J.focused, !!errorMessage && styles$J.hasError, customStyle),
5393
5402
  children: [icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, {
5394
5403
  name: icon,
5395
- customStyle: styles$H.icon
5404
+ customStyle: styles$J.icon
5396
5405
  }), /* @__PURE__ */ jsxRuntime.jsxs("span", {
5397
5406
  ...{
5398
5407
  className: "mlywz0xwf"
5399
5408
  },
5400
5409
  children: [/* @__PURE__ */ jsxRuntime.jsx("span", {
5401
- ..._stylex.props(fontStyles.body, styles$H.placeholder),
5410
+ ..._stylex.props(fontStyles.body, styles$J.placeholder),
5402
5411
  style: {
5403
5412
  whiteSpaceCollapse: "preserve"
5404
5413
  },
5405
5414
  children: value
5406
5415
  }), /* @__PURE__ */ jsxRuntime.jsx("input", {
5407
- ..._stylex.props(styles$H.input, fontStyles.body),
5416
+ ..._stylex.props(styles$J.input, fontStyles.body),
5408
5417
  ref: inputRef,
5409
5418
  pattern: type === "number" ? "^-?[0-9.]*$" : void 0,
5410
5419
  value,
@@ -5429,7 +5438,7 @@ function EditableToken({
5429
5438
  })]
5430
5439
  });
5431
5440
  }
5432
- const styles$H = {
5441
+ const styles$J = {
5433
5442
  focused: {
5434
5443
  background: "mlyotlr4g",
5435
5444
  backgroundAttachment: null,
@@ -7771,12 +7780,12 @@ function TextInput({
7771
7780
  }
7772
7781
  };
7773
7782
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
7774
- ..._stylex.props(styles$G.main, isFocused && styles$G.focused, sizeVariants[size2], customStyle),
7783
+ ..._stylex.props(styles$I.main, isFocused && styles$I.focused, sizeVariants[size2], customStyle),
7775
7784
  children: [icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, {
7776
7785
  name: icon,
7777
7786
  color: "secondary"
7778
7787
  }), /* @__PURE__ */ jsxRuntime.jsx("input", {
7779
- ..._stylex.props(fontStyles.body, styles$G.input),
7788
+ ..._stylex.props(fontStyles.body, styles$I.input),
7780
7789
  value,
7781
7790
  placeholder,
7782
7791
  onChange: handleChange,
@@ -7784,7 +7793,7 @@ function TextInput({
7784
7793
  onBlur: handleBlur,
7785
7794
  onKeyDown
7786
7795
  }), hasClear && /* @__PURE__ */ jsxRuntime.jsx("button", {
7787
- ..._stylex.props(fontStyles.supporting, styles$G.actionButton, value === "" && styles$G.hidden),
7796
+ ..._stylex.props(fontStyles.supporting, styles$I.actionButton, value === "" && styles$I.hidden),
7788
7797
  ref: buttonRef,
7789
7798
  onClick: () => onChange(""),
7790
7799
  tabIndex: 0,
@@ -7792,7 +7801,7 @@ function TextInput({
7792
7801
  })]
7793
7802
  });
7794
7803
  }
7795
- const styles$G = {
7804
+ const styles$I = {
7796
7805
  main: {
7797
7806
  display: "mly78zum5",
7798
7807
  alignItems: "mly6s0dn4",
@@ -8001,16 +8010,14 @@ function SelectorToken({
8001
8010
  onValueChange: handleValueChange,
8002
8011
  required: true,
8003
8012
  children: [/* @__PURE__ */ jsxRuntime.jsxs(Trigger$3, {
8004
- ..._stylex.props(tokenStyles.main, styles$F.selectTrigger, tokenColorVariants[color], tokenSizeVariants[size2], fontStyles.body, tokenStyles.label, customStyle),
8013
+ ..._stylex.props(tokenStyles.main, styles$H.selectTrigger, tokenColorVariants[color], tokenSizeVariants[size2], customStyle),
8005
8014
  children: [icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, {
8006
8015
  name: icon,
8007
8016
  customStyle: tokenStyles.icon
8008
8017
  }), /* @__PURE__ */ jsxRuntime.jsx(Value$1, {
8009
8018
  asChild: true,
8010
8019
  children: /* @__PURE__ */ jsxRuntime.jsx("div", {
8011
- ...{
8012
- className: "mlyb3r6kr mlylyipyv"
8013
- },
8020
+ ..._stylex.props(fontStyles.body, tokenStyles.label),
8014
8021
  children: label
8015
8022
  })
8016
8023
  })]
@@ -8030,7 +8037,7 @@ function SelectorToken({
8030
8037
  size: "compact",
8031
8038
  icon: "search",
8032
8039
  hasClear: true,
8033
- customStyle: styles$F.searchInput,
8040
+ customStyle: styles$H.searchInput,
8034
8041
  onKeyDown: (event) => {
8035
8042
  const excludedKeys = ["ArrowUp", "ArrowDown"];
8036
8043
  if (!excludedKeys.includes(event.key)) {
@@ -8039,17 +8046,15 @@ function SelectorToken({
8039
8046
  }, 10);
8040
8047
  }
8041
8048
  }
8042
- }), /* @__PURE__ */ jsxRuntime.jsx(ScrollableArea, {
8043
- children: /* @__PURE__ */ jsxRuntime.jsx(Group$1, {
8044
- ...{
8045
- className: "mly78zum5 mlydt5ytf mlyuyqlj2 mlyfawy5m mly195vfkc"
8046
- },
8047
- children: filteredItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, {
8048
- value: item.value,
8049
- selectedValue: value,
8050
- children: item.label
8051
- }, item.value))
8052
- })
8049
+ }), /* @__PURE__ */ jsxRuntime.jsx(Group$1, {
8050
+ ...{
8051
+ className: "mly78zum5 mlydt5ytf mlyuyqlj2 mlyfawy5m mly195vfkc mlyysyzu8"
8052
+ },
8053
+ children: filteredItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, {
8054
+ value: item.value,
8055
+ selectedValue: value,
8056
+ children: item.label
8057
+ }, item.value))
8053
8058
  })]
8054
8059
  })
8055
8060
  })
@@ -8063,21 +8068,21 @@ function SelectItem({
8063
8068
  ...props2
8064
8069
  }) {
8065
8070
  return /* @__PURE__ */ jsxRuntime.jsxs(Item$1, {
8066
- ..._stylex.props(fontStyles.body, styles$F.selectItem),
8071
+ ..._stylex.props(fontStyles.body, styles$H.selectItem),
8067
8072
  value,
8068
8073
  ...props2,
8069
8074
  children: [value === selectedValue ? /* @__PURE__ */ jsxRuntime.jsx(Icon, {
8070
8075
  name: "radioChecked",
8071
- customStyle: styles$F.radioChecked
8076
+ customStyle: styles$H.radioChecked
8072
8077
  }) : /* @__PURE__ */ jsxRuntime.jsx(Icon, {
8073
8078
  name: "radioUnchecked",
8074
- customStyle: styles$F.radioUnchecked
8079
+ customStyle: styles$H.radioUnchecked
8075
8080
  }), /* @__PURE__ */ jsxRuntime.jsx(ItemText, {
8076
8081
  children
8077
8082
  })]
8078
8083
  });
8079
8084
  }
8080
- const styles$F = {
8085
+ const styles$H = {
8081
8086
  selectTrigger: {
8082
8087
  whiteSpace: "mlyuxw1ft",
8083
8088
  overflow: "mlyb3r6kr",
@@ -8167,7 +8172,7 @@ function Card({
8167
8172
  customStyle
8168
8173
  }) {
8169
8174
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
8170
- ..._stylex.props(styles$E.container, customStyle),
8175
+ ..._stylex.props(styles$G.container, customStyle),
8171
8176
  children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
8172
8177
  ...{
8173
8178
  className: "mly1717udv"
@@ -8181,7 +8186,7 @@ function Card({
8181
8186
  })]
8182
8187
  });
8183
8188
  }
8184
- const styles$E = {
8189
+ const styles$G = {
8185
8190
  container: {
8186
8191
  display: "mly78zum5",
8187
8192
  flexDirection: "mlydt5ytf",
@@ -8274,7 +8279,7 @@ function CollapsiblePanel({
8274
8279
  },
8275
8280
  children: [icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, {
8276
8281
  name: icon,
8277
- customStyle: styles$D.icon
8282
+ customStyle: styles$F.icon
8278
8283
  }), /* @__PURE__ */ jsxRuntime.jsx("div", {
8279
8284
  ...{
8280
8285
  className: "mlyuxw1ft mlyb3r6kr mlylyipyv mlyehqz9p mly1ghz6dp mly117nqv4"
@@ -8316,7 +8321,7 @@ function CollapsiblePanel({
8316
8321
  })]
8317
8322
  });
8318
8323
  }
8319
- const styles$D = {
8324
+ const styles$F = {
8320
8325
  icon: {
8321
8326
  $$css: true
8322
8327
  }
@@ -8348,10 +8353,10 @@ function CollapsibleListItem({
8348
8353
  className: "mly78zum5 mlydt5ytf mly1iyjqo2 mlyb3r6kr"
8349
8354
  },
8350
8355
  children: [/* @__PURE__ */ jsxRuntime.jsx("span", {
8351
- ..._stylex.props(fontStyles.body, styles$C.label),
8356
+ ..._stylex.props(fontStyles.body, styles$E.label),
8352
8357
  children: label
8353
8358
  }), sublabel && /* @__PURE__ */ jsxRuntime.jsx("span", {
8354
- ..._stylex.props(fontStyles.supporting, styles$C.sublabel),
8359
+ ..._stylex.props(fontStyles.supporting, styles$E.sublabel),
8355
8360
  children: sublabel
8356
8361
  })]
8357
8362
  })]
@@ -8363,7 +8368,7 @@ function CollapsibleListItem({
8363
8368
  })]
8364
8369
  });
8365
8370
  }
8366
- const styles$C = {
8371
+ const styles$E = {
8367
8372
  label: {
8368
8373
  flexGrow: "mly1iyjqo2",
8369
8374
  fontWeight: "mly1xlr1w8",
@@ -19177,7 +19182,7 @@ function Spinner({
19177
19182
  } = SIZES[size2];
19178
19183
  const frameSize = diameter + border * 2;
19179
19184
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
19180
- ..._stylex.props(styles$B.root, customStyle),
19185
+ ..._stylex.props(styles$D.root, customStyle),
19181
19186
  children: /* @__PURE__ */ jsxRuntime.jsx("span", {
19182
19187
  "aria-valuetext": "Loading",
19183
19188
  ...{
@@ -19197,7 +19202,7 @@ function Spinner({
19197
19202
  })
19198
19203
  });
19199
19204
  }
19200
- const styles$B = {
19205
+ const styles$D = {
19201
19206
  root: {
19202
19207
  alignItems: "mly6s0dn4",
19203
19208
  display: "mly3nfvp2",
@@ -23595,7 +23600,7 @@ const Popover = ({
23595
23600
  })
23596
23601
  });
23597
23602
  };
23598
- const styles$A = {
23603
+ const styles$C = {
23599
23604
  wrapper: {
23600
23605
  position: "mly1n2onr6",
23601
23606
  $$css: true
@@ -23647,7 +23652,7 @@ const SelectDropdown = ({
23647
23652
  setOpen(false);
23648
23653
  };
23649
23654
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
23650
- ..._stylex.props(styles$A.wrapper, customStyle),
23655
+ ..._stylex.props(styles$C.wrapper, customStyle),
23651
23656
  children: [/* @__PURE__ */ jsxRuntime.jsxs("button", {
23652
23657
  type: "button",
23653
23658
  autoFocus,
@@ -23715,7 +23720,7 @@ function SelectList({
23715
23720
  const [hoveredIndex, setHoveredIndex] = React.useState(null);
23716
23721
  return /* @__PURE__ */ jsxRuntime.jsx(ScrollableArea, {
23717
23722
  children: /* @__PURE__ */ jsxRuntime.jsx("div", {
23718
- ..._stylex.props(styles$A.selectListDiv, customStyle),
23723
+ ..._stylex.props(styles$C.selectListDiv, customStyle),
23719
23724
  children: options.reduce((result, option2, index2) => {
23720
23725
  const isSelected = value !== void 0 && valueEqual(value, option2.value);
23721
23726
  if (option2.divider) {
@@ -23747,8 +23752,8 @@ function SelectList({
23747
23752
  }), /* @__PURE__ */ jsxRuntime.jsx(Icon, {
23748
23753
  name: "checkmark",
23749
23754
  customStyle: {
23750
- ...styles$A.checkIcon,
23751
- ...isSelected ? styles$A.checkIconSelected : void 0
23755
+ ...styles$C.checkIcon,
23756
+ ...isSelected ? styles$C.checkIconSelected : void 0
23752
23757
  }
23753
23758
  }), /* @__PURE__ */ jsxRuntime.jsx("span", {
23754
23759
  ...{
@@ -23800,7 +23805,7 @@ const DateInput = ({
23800
23805
  setTempValue(hooks.utc(value).format(format2));
23801
23806
  }, [value, format2]);
23802
23807
  return /* @__PURE__ */ jsxRuntime.jsx("input", {
23803
- ..._stylex.props(customStyle, isActive ? styles$z.active : null),
23808
+ ..._stylex.props(customStyle, isActive ? styles$B.active : null),
23804
23809
  type: "text",
23805
23810
  placeholder: placeholder || format2,
23806
23811
  value: tempValue,
@@ -23835,7 +23840,7 @@ function guessUnits(moment2, isDateTime) {
23835
23840
  }
23836
23841
  return isDateTime ? "second" : "day";
23837
23842
  }
23838
- const styles$z = {
23843
+ const styles$B = {
23839
23844
  active: {
23840
23845
  backgroundColor: "mly1vzefiq",
23841
23846
  $$css: true
@@ -23947,7 +23952,7 @@ function DatePicker({
23947
23952
  });
23948
23953
  };
23949
23954
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
23950
- ..._stylex.props(styles$y.outer, customStyle),
23955
+ ..._stylex.props(styles$A.outer, customStyle),
23951
23956
  ref: forwardRef,
23952
23957
  children: [/* @__PURE__ */ jsxRuntime.jsxs("div", {
23953
23958
  ...{
@@ -24263,7 +24268,7 @@ function DatePicker({
24263
24268
  })]
24264
24269
  });
24265
24270
  }
24266
- const styles$y = {
24271
+ const styles$A = {
24267
24272
  outer: {
24268
24273
  userSelect: "mly87ps6o",
24269
24274
  fontSize: "mlymhiqyu",
@@ -24349,7 +24354,7 @@ function Banner({
24349
24354
  className: "mly1q4ynmn mlyh8yej3 mly5yr21d mly78zum5 mlydt5ytf mly1kmqopl mly16zck5j"
24350
24355
  },
24351
24356
  children: [/* @__PURE__ */ jsxRuntime.jsxs("div", {
24352
- ..._stylex.props(styles$x.header, variantColors[variant], children ? styles$x.headerWithContent : null),
24357
+ ..._stylex.props(styles$z.header, variantColors[variant], children ? styles$z.headerWithContent : null),
24353
24358
  children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
24354
24359
  ...{
24355
24360
  className: "mly1qx5ct2 mly78zum5 mlyl56j7k mly6s0dn4"
@@ -24362,22 +24367,22 @@ function Banner({
24362
24367
  className: "mly78zum5 mlydt5ytf mlyb3r6kr"
24363
24368
  },
24364
24369
  children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
24365
- ..._stylex.props(styles$x.title, fontStyles.emphasized),
24370
+ ..._stylex.props(styles$z.title, fontStyles.emphasized),
24366
24371
  children: title
24367
24372
  }), /* @__PURE__ */ jsxRuntime.jsx("div", {
24368
- ..._stylex.props(styles$x.description, fontStyles.supporting),
24373
+ ..._stylex.props(styles$z.description, fontStyles.supporting),
24369
24374
  children: description
24370
24375
  })]
24371
24376
  })]
24372
24377
  }), children && /* @__PURE__ */ jsxRuntime.jsx("div", {
24373
- ..._stylex.props(styles$x.content, fontStyles.body),
24378
+ ..._stylex.props(styles$z.content, fontStyles.body),
24374
24379
  children: /* @__PURE__ */ jsxRuntime.jsx(ScrollableArea, {
24375
24380
  children
24376
24381
  })
24377
24382
  })]
24378
24383
  });
24379
24384
  }
24380
- const styles$x = {
24385
+ const styles$z = {
24381
24386
  header: {
24382
24387
  borderRadius: "mly1q4ynmn",
24383
24388
  borderStartStartRadius: null,
@@ -24519,14 +24524,14 @@ function AccordionList({
24519
24524
  onExpandedItemChange: handleExpandedItemChange
24520
24525
  },
24521
24526
  children: /* @__PURE__ */ jsxRuntime.jsx("div", {
24522
- ..._stylex.props(styles$w.main, customStyle),
24527
+ ..._stylex.props(styles$y.main, customStyle),
24523
24528
  children: React__namespace.Children.map(children, (child) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
24524
24529
  children: [child, /* @__PURE__ */ jsxRuntime.jsx(Divider, {})]
24525
24530
  }))
24526
24531
  })
24527
24532
  });
24528
24533
  }
24529
- const styles$w = {
24534
+ const styles$y = {
24530
24535
  main: {
24531
24536
  display: "mly78zum5",
24532
24537
  flexDirection: "mlydt5ytf",
@@ -24563,10 +24568,10 @@ function AccordionListItem({
24563
24568
  className: "mly78zum5 mlydt5ytf mlyb3r6kr mly1iyjqo2"
24564
24569
  },
24565
24570
  children: [/* @__PURE__ */ jsxRuntime.jsx("span", {
24566
- ..._stylex.props(fontStyles.body, styles$v.label),
24571
+ ..._stylex.props(fontStyles.body, styles$x.label),
24567
24572
  children: label
24568
24573
  }), sublabel && /* @__PURE__ */ jsxRuntime.jsx("span", {
24569
- ..._stylex.props(fontStyles.supporting, styles$v.sublabel),
24574
+ ..._stylex.props(fontStyles.supporting, styles$x.sublabel),
24570
24575
  children: sublabel
24571
24576
  })]
24572
24577
  }), badge && badge, endIcon && endIcon]
@@ -24578,7 +24583,7 @@ function AccordionListItem({
24578
24583
  })]
24579
24584
  });
24580
24585
  }
24581
- const styles$v = {
24586
+ const styles$x = {
24582
24587
  label: {
24583
24588
  flexGrow: "mly1iyjqo2",
24584
24589
  fontWeight: "mly1xlr1w8",
@@ -25863,7 +25868,7 @@ function DropdownMenu({
25863
25868
  children: trigger
25864
25869
  }), /* @__PURE__ */ jsxRuntime.jsx(Portal2, {
25865
25870
  children: /* @__PURE__ */ jsxRuntime.jsx(Content2, {
25866
- ..._stylex.props(fontStyles.body, styles$u.content),
25871
+ ..._stylex.props(fontStyles.body, styles$w.content),
25867
25872
  side: "bottom",
25868
25873
  align: "start",
25869
25874
  sideOffset: 4,
@@ -25890,22 +25895,22 @@ function DropdownMenuItem({
25890
25895
  disabled,
25891
25896
  children: [icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, {
25892
25897
  name: icon,
25893
- customStyle: styles$u.icon
25898
+ customStyle: styles$w.icon
25894
25899
  }), /* @__PURE__ */ jsxRuntime.jsxs("div", {
25895
25900
  ...{
25896
25901
  className: "mly78zum5 mlydt5ytf mly1iyjqo2"
25897
25902
  },
25898
25903
  children: [/* @__PURE__ */ jsxRuntime.jsx("span", {
25899
- ..._stylex.props(fontStyles.body, styles$u.label),
25904
+ ..._stylex.props(fontStyles.body, styles$w.label),
25900
25905
  children: label
25901
25906
  }), sublabel && /* @__PURE__ */ jsxRuntime.jsx("span", {
25902
- ..._stylex.props(fontStyles.supporting, styles$u.sublabel),
25907
+ ..._stylex.props(fontStyles.supporting, styles$w.sublabel),
25903
25908
  children: sublabel
25904
25909
  })]
25905
25910
  })]
25906
25911
  });
25907
25912
  }
25908
- const styles$u = {
25913
+ const styles$w = {
25909
25914
  content: {
25910
25915
  display: "mly78zum5",
25911
25916
  flexDirection: "mlydt5ytf",
@@ -25989,7 +25994,7 @@ function QueryActionBar({
25989
25994
  children: [/* @__PURE__ */ jsxRuntime.jsx(Icon, {
25990
25995
  name: "filterSliders"
25991
25996
  }), /* @__PURE__ */ jsxRuntime.jsx("div", {
25992
- ..._stylex.props(fontStyles.largeBody, styles$t.title),
25997
+ ..._stylex.props(fontStyles.largeBody, styles$v.title),
25993
25998
  children: "Query"
25994
25999
  })]
25995
26000
  }), /* @__PURE__ */ jsxRuntime.jsxs("div", {
@@ -26034,13 +26039,13 @@ function QueryActionBar({
26034
26039
  })]
26035
26040
  });
26036
26041
  }
26037
- const styles$t = {
26042
+ const styles$v = {
26038
26043
  title: {
26039
26044
  fontWeight: "mly1xlr1w8",
26040
26045
  $$css: true
26041
26046
  }
26042
26047
  };
26043
- const styles$s = {
26048
+ const styles$u = {
26044
26049
  labelWithIcon: {
26045
26050
  display: "mly78zum5",
26046
26051
  alignItems: "mly6s0dn4",
@@ -26197,109 +26202,6 @@ function legacyToViz(name) {
26197
26202
  return name;
26198
26203
  }
26199
26204
  }
26200
- const VISUALIZATION_OPTIONS = {
26201
- table: null,
26202
- bar: [{
26203
- name: "title",
26204
- label: "Title",
26205
- type: "string",
26206
- default: ""
26207
- }, {
26208
- name: "sub_title",
26209
- label: "Subtitle",
26210
- type: "string",
26211
- default: ""
26212
- }, {
26213
- name: "stack",
26214
- label: "Stack",
26215
- type: "boolean",
26216
- default: false
26217
- }, {
26218
- name: "size",
26219
- label: "Size",
26220
- type: "select",
26221
- default: "fill",
26222
- options: [{
26223
- label: "Fill",
26224
- value: "fill"
26225
- }, {
26226
- label: "Sparkline",
26227
- value: "spark"
26228
- }, {
26229
- label: "X-Small",
26230
- value: "xs"
26231
- }, {
26232
- label: "Small",
26233
- value: "sm"
26234
- }, {
26235
- label: "Medium",
26236
- value: "md"
26237
- }, {
26238
- label: "Large",
26239
- value: "lg"
26240
- }, {
26241
- label: "X-Large",
26242
- value: "xl"
26243
- }, {
26244
- label: "XX-Large",
26245
- value: "2xl"
26246
- }]
26247
- }],
26248
- dashboard: null,
26249
- json: null,
26250
- line: [{
26251
- name: "title",
26252
- label: "Title",
26253
- type: "string",
26254
- default: ""
26255
- }, {
26256
- name: "sub_title",
26257
- label: "Subtitle",
26258
- type: "string",
26259
- default: ""
26260
- }, {
26261
- name: "zero_baseline",
26262
- label: "Zero Baseline",
26263
- type: "boolean",
26264
- default: false
26265
- }, {
26266
- name: "size",
26267
- label: "Size",
26268
- type: "select",
26269
- default: "md",
26270
- options: [{
26271
- label: "Fill",
26272
- value: "fill"
26273
- }, {
26274
- label: "Sparkline",
26275
- value: "spark"
26276
- }, {
26277
- label: "X-Small",
26278
- value: "xs"
26279
- }, {
26280
- label: "Small",
26281
- value: "sm"
26282
- }, {
26283
- label: "Medium",
26284
- value: "md"
26285
- }, {
26286
- label: "Large",
26287
- value: "lg"
26288
- }, {
26289
- label: "X-Large",
26290
- value: "xl"
26291
- }, {
26292
- label: "XX-Large",
26293
- value: "2xl"
26294
- }]
26295
- }],
26296
- list: null,
26297
- list_detail: null,
26298
- point_map: null,
26299
- scatter_chart: null,
26300
- segment_map: null,
26301
- shape_map: null
26302
- };
26303
26205
  function atomicTypeToIcon(type) {
26304
26206
  return atomicTypeMap[type];
26305
26207
  }
@@ -26395,25 +26297,28 @@ function DrillOperations({
26395
26297
  }
26396
26298
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
26397
26299
  children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
26398
- ..._stylex.props(styles$s.title),
26300
+ ..._stylex.props(styles$u.title),
26399
26301
  children: "drills"
26400
26302
  }), /* @__PURE__ */ jsxRuntime.jsx("div", {
26401
26303
  ...{
26402
26304
  className: "mly78zum5 mlydt5ytf mly1jnr06f"
26403
26305
  },
26404
- children: drills.map((drill, key2) => /* @__PURE__ */ jsxRuntime.jsxs(TokenGroup, {
26405
- color: "cyan",
26406
- customStyle: localStyles.tokenGroup,
26407
- children: [/* @__PURE__ */ jsxRuntime.jsx(FieldToken, {
26408
- field: drill.filter.fieldReference.getFieldInfo()
26409
- }), /* @__PURE__ */ jsxRuntime.jsx(Token, {
26410
- label: "="
26411
- }), drill.filter instanceof QB.ASTFilterWithLiteralEquality ? /* @__PURE__ */ jsxRuntime.jsx(LiteralValue, {
26412
- value: drill.filter.value.node
26413
- }) : /* @__PURE__ */ jsxRuntime.jsx(Token, {
26414
- label: drill.filter.filterString
26415
- })]
26416
- }, key2))
26306
+ children: drills.map((drill, key2) => {
26307
+ const field = drill.filter.expression.getFieldInfo();
26308
+ return field ? /* @__PURE__ */ jsxRuntime.jsxs(TokenGroup, {
26309
+ color: "cyan",
26310
+ customStyle: localStyles.tokenGroup,
26311
+ children: [/* @__PURE__ */ jsxRuntime.jsx(FieldToken, {
26312
+ field
26313
+ }), /* @__PURE__ */ jsxRuntime.jsx(Token, {
26314
+ label: "="
26315
+ }), drill.filter instanceof QB.ASTFilterWithLiteralEquality ? /* @__PURE__ */ jsxRuntime.jsx(LiteralValue, {
26316
+ value: drill.filter.value.node
26317
+ }) : /* @__PURE__ */ jsxRuntime.jsx(Token, {
26318
+ label: drill.filter.filterString
26319
+ })]
26320
+ }, key2) : null;
26321
+ })
26417
26322
  })]
26418
26323
  });
26419
26324
  }
@@ -30367,288 +30272,1767 @@ function BadgeForField({
30367
30272
  label: "view",
30368
30273
  icon: "view_filled",
30369
30274
  color: "purple",
30370
- customStyle: styles$r.noBackground
30275
+ customStyle: styles$t.noBackground
30371
30276
  });
30372
30277
  } else if (field.kind === "dimension") {
30373
30278
  return /* @__PURE__ */ jsxRuntime.jsx(Badge, {
30374
30279
  label: "dimension",
30375
30280
  icon: fieldToIcon(field),
30376
30281
  color: "cyan",
30377
- customStyle: styles$r.noBackground
30282
+ customStyle: styles$t.noBackground
30378
30283
  });
30379
30284
  } else if (field.kind === "measure") {
30380
30285
  return /* @__PURE__ */ jsxRuntime.jsx(Badge, {
30381
30286
  label: "measure",
30382
30287
  icon: fieldToIcon(field),
30383
30288
  color: "green",
30384
- customStyle: styles$r.noBackground
30289
+ customStyle: styles$t.noBackground
30385
30290
  });
30386
30291
  } else if (field.kind === "join") {
30387
30292
  return /* @__PURE__ */ jsxRuntime.jsx(Badge, {
30388
30293
  label: "join",
30389
30294
  icon: fieldToIcon(field),
30390
30295
  color: "gray",
30391
- customStyle: styles$r.noBackground
30296
+ customStyle: styles$t.noBackground
30392
30297
  });
30393
30298
  }
30394
30299
  }
30395
- const styles$r = {
30300
+ const styles$t = {
30396
30301
  noBackground: {
30397
30302
  backgroundColor: "mlyjbqb8w",
30398
30303
  $$css: true
30399
30304
  }
30400
30305
  };
30401
- function RendererPopover({
30402
- rootQuery,
30403
- viz,
30404
- options,
30405
- view,
30406
- customStyle
30407
- }) {
30408
- const [open, setOpen] = React.useState(false);
30409
- return /* @__PURE__ */ jsxRuntime.jsxs(Root2$2, {
30410
- onOpenChange: (open2) => setOpen(open2),
30411
- open,
30412
- children: [/* @__PURE__ */ jsxRuntime.jsx(Trigger$2, {
30413
- asChild: true,
30414
- children: /* @__PURE__ */ jsxRuntime.jsx(Token, {
30415
- icon: "gear",
30416
- customStyle: {
30417
- ...customStyle,
30418
- ...dialogStyles$1.trigger
30419
- }
30420
- })
30421
- }), /* @__PURE__ */ jsxRuntime.jsx(Portal$2, {
30422
- children: /* @__PURE__ */ jsxRuntime.jsx(Content2$2, {
30423
- align: "end",
30424
- children: /* @__PURE__ */ jsxRuntime.jsx(RendererEditor, {
30425
- rootQuery,
30426
- view,
30427
- viz,
30428
- options,
30429
- setOpen
30430
- })
30431
- })
30432
- })]
30433
- });
30434
- }
30435
- function RendererEditor({
30436
- rootQuery,
30437
- view,
30438
- viz,
30439
- options,
30440
- setOpen
30441
- }) {
30306
+ var DIALOG_NAME = "Dialog";
30307
+ var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
30308
+ var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
30309
+ var Dialog = (props2) => {
30442
30310
  const {
30443
- setQuery
30444
- } = React.useContext(QueryEditorContext);
30445
- const [current, setCurrent] = React.useState();
30446
- React.useEffect(() => {
30447
- const current2 = {};
30448
- const currentTag = view.getTag(RENDERER_PREFIX);
30449
- for (const option2 of options) {
30450
- current2[option2.name] = currentTag.text("viz", option2.name) ?? option2.default.toString();
30451
- }
30452
- setCurrent(current2);
30453
- }, [options, view, viz]);
30454
- if (!current) {
30455
- return null;
30311
+ __scopeDialog,
30312
+ children,
30313
+ open: openProp,
30314
+ defaultOpen,
30315
+ onOpenChange,
30316
+ modal = true
30317
+ } = props2;
30318
+ const triggerRef = React__namespace.useRef(null);
30319
+ const contentRef = React__namespace.useRef(null);
30320
+ const [open = false, setOpen] = useControllableState({
30321
+ prop: openProp,
30322
+ defaultProp: defaultOpen,
30323
+ onChange: onOpenChange
30324
+ });
30325
+ return /* @__PURE__ */ jsxRuntime.jsx(
30326
+ DialogProvider,
30327
+ {
30328
+ scope: __scopeDialog,
30329
+ triggerRef,
30330
+ contentRef,
30331
+ contentId: useId(),
30332
+ titleId: useId(),
30333
+ descriptionId: useId(),
30334
+ open,
30335
+ onOpenChange: setOpen,
30336
+ onOpenToggle: React__namespace.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
30337
+ modal,
30338
+ children
30339
+ }
30340
+ );
30341
+ };
30342
+ Dialog.displayName = DIALOG_NAME;
30343
+ var TRIGGER_NAME$1 = "DialogTrigger";
30344
+ var DialogTrigger = React__namespace.forwardRef(
30345
+ (props2, forwardedRef) => {
30346
+ const { __scopeDialog, ...triggerProps } = props2;
30347
+ const context = useDialogContext(TRIGGER_NAME$1, __scopeDialog);
30348
+ const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
30349
+ return /* @__PURE__ */ jsxRuntime.jsx(
30350
+ Primitive.button,
30351
+ {
30352
+ type: "button",
30353
+ "aria-haspopup": "dialog",
30354
+ "aria-expanded": context.open,
30355
+ "aria-controls": context.contentId,
30356
+ "data-state": getState(context.open),
30357
+ ...triggerProps,
30358
+ ref: composedTriggerRef,
30359
+ onClick: composeEventHandlers(props2.onClick, context.onOpenToggle)
30360
+ }
30361
+ );
30456
30362
  }
30457
- return /* @__PURE__ */ jsxRuntime.jsx("div", {
30458
- ..._stylex.props(dialogStyles$1.content, fontStyles.body),
30459
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
30460
- ...{
30461
- className: "mlyqyf9gi mly78zum5 mlydt5ytf mly167g77z"
30462
- },
30463
- children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
30464
- ...{
30465
- className: "mlyrvj5dj mly17bnpya mly167g77z"
30466
- },
30467
- children: options.map((option2) => option2.type === "boolean" ? /* @__PURE__ */ jsxRuntime.jsx(BooleanEditor, {
30468
- option: option2,
30469
- current,
30470
- setCurrent
30471
- }, option2.name) : option2.type === "string" ? /* @__PURE__ */ jsxRuntime.jsx(StringEditor$1, {
30472
- option: option2,
30473
- current,
30474
- setCurrent
30475
- }, option2.name) : (
30476
- // option.type === 'select
30477
- /* @__PURE__ */ jsxRuntime.jsx(SelectEditor, {
30478
- option: option2,
30479
- current,
30480
- setCurrent
30481
- }, option2.name)
30482
- ))
30483
- }), /* @__PURE__ */ jsxRuntime.jsxs("div", {
30484
- ...{
30485
- className: "mly78zum5 mly167g77z"
30363
+ );
30364
+ DialogTrigger.displayName = TRIGGER_NAME$1;
30365
+ var PORTAL_NAME = "DialogPortal";
30366
+ var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {
30367
+ forceMount: void 0
30368
+ });
30369
+ var DialogPortal = (props2) => {
30370
+ const { __scopeDialog, forceMount, children, container } = props2;
30371
+ const context = useDialogContext(PORTAL_NAME, __scopeDialog);
30372
+ return /* @__PURE__ */ jsxRuntime.jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React__namespace.Children.map(children, (child) => /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Portal$5, { asChild: true, container, children: child }) })) });
30373
+ };
30374
+ DialogPortal.displayName = PORTAL_NAME;
30375
+ var OVERLAY_NAME = "DialogOverlay";
30376
+ var DialogOverlay = React__namespace.forwardRef(
30377
+ (props2, forwardedRef) => {
30378
+ const portalContext = usePortalContext(OVERLAY_NAME, props2.__scopeDialog);
30379
+ const { forceMount = portalContext.forceMount, ...overlayProps } = props2;
30380
+ const context = useDialogContext(OVERLAY_NAME, props2.__scopeDialog);
30381
+ return context.modal ? /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
30382
+ }
30383
+ );
30384
+ DialogOverlay.displayName = OVERLAY_NAME;
30385
+ var DialogOverlayImpl = React__namespace.forwardRef(
30386
+ (props2, forwardedRef) => {
30387
+ const { __scopeDialog, ...overlayProps } = props2;
30388
+ const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
30389
+ return (
30390
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
30391
+ // ie. when `Overlay` and `Content` are siblings
30392
+ /* @__PURE__ */ jsxRuntime.jsx(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsxRuntime.jsx(
30393
+ Primitive.div,
30394
+ {
30395
+ "data-state": getState(context.open),
30396
+ ...overlayProps,
30397
+ ref: forwardedRef,
30398
+ style: { pointerEvents: "auto", ...overlayProps.style }
30399
+ }
30400
+ ) })
30401
+ );
30402
+ }
30403
+ );
30404
+ var CONTENT_NAME$1 = "DialogContent";
30405
+ var DialogContent = React__namespace.forwardRef(
30406
+ (props2, forwardedRef) => {
30407
+ const portalContext = usePortalContext(CONTENT_NAME$1, props2.__scopeDialog);
30408
+ const { forceMount = portalContext.forceMount, ...contentProps } = props2;
30409
+ const context = useDialogContext(CONTENT_NAME$1, props2.__scopeDialog);
30410
+ return /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsxRuntime.jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsxRuntime.jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
30411
+ }
30412
+ );
30413
+ DialogContent.displayName = CONTENT_NAME$1;
30414
+ var DialogContentModal = React__namespace.forwardRef(
30415
+ (props2, forwardedRef) => {
30416
+ const context = useDialogContext(CONTENT_NAME$1, props2.__scopeDialog);
30417
+ const contentRef = React__namespace.useRef(null);
30418
+ const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
30419
+ React__namespace.useEffect(() => {
30420
+ const content = contentRef.current;
30421
+ if (content) return hideOthers(content);
30422
+ }, []);
30423
+ return /* @__PURE__ */ jsxRuntime.jsx(
30424
+ DialogContentImpl,
30425
+ {
30426
+ ...props2,
30427
+ ref: composedRefs,
30428
+ trapFocus: context.open,
30429
+ disableOutsidePointerEvents: true,
30430
+ onCloseAutoFocus: composeEventHandlers(props2.onCloseAutoFocus, (event) => {
30431
+ var _a2;
30432
+ event.preventDefault();
30433
+ (_a2 = context.triggerRef.current) == null ? void 0 : _a2.focus();
30434
+ }),
30435
+ onPointerDownOutside: composeEventHandlers(props2.onPointerDownOutside, (event) => {
30436
+ const originalEvent = event.detail.originalEvent;
30437
+ const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
30438
+ const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
30439
+ if (isRightClick) event.preventDefault();
30440
+ }),
30441
+ onFocusOutside: composeEventHandlers(
30442
+ props2.onFocusOutside,
30443
+ (event) => event.preventDefault()
30444
+ )
30445
+ }
30446
+ );
30447
+ }
30448
+ );
30449
+ var DialogContentNonModal = React__namespace.forwardRef(
30450
+ (props2, forwardedRef) => {
30451
+ const context = useDialogContext(CONTENT_NAME$1, props2.__scopeDialog);
30452
+ const hasInteractedOutsideRef = React__namespace.useRef(false);
30453
+ const hasPointerDownOutsideRef = React__namespace.useRef(false);
30454
+ return /* @__PURE__ */ jsxRuntime.jsx(
30455
+ DialogContentImpl,
30456
+ {
30457
+ ...props2,
30458
+ ref: forwardedRef,
30459
+ trapFocus: false,
30460
+ disableOutsidePointerEvents: false,
30461
+ onCloseAutoFocus: (event) => {
30462
+ var _a2, _b2;
30463
+ (_a2 = props2.onCloseAutoFocus) == null ? void 0 : _a2.call(props2, event);
30464
+ if (!event.defaultPrevented) {
30465
+ if (!hasInteractedOutsideRef.current) (_b2 = context.triggerRef.current) == null ? void 0 : _b2.focus();
30466
+ event.preventDefault();
30467
+ }
30468
+ hasInteractedOutsideRef.current = false;
30469
+ hasPointerDownOutsideRef.current = false;
30486
30470
  },
30487
- children: [/* @__PURE__ */ jsxRuntime.jsx(Button, {
30488
- label: "Cancel",
30489
- onClick: () => {
30490
- setOpen(false);
30491
- },
30492
- customStyle: dialogStyles$1.editorCell
30493
- }), /* @__PURE__ */ jsxRuntime.jsx(Button, {
30494
- variant: "primary",
30495
- label: "Apply",
30496
- onClick: () => {
30497
- if (!view.getTag(RENDERER_PREFIX).has("viz", viz)) {
30498
- view.setTagProperty(["viz"], viz, RENDERER_PREFIX);
30499
- }
30500
- for (const option2 of options) {
30501
- if (current[option2.name] !== option2.default.toString()) {
30502
- view.setTagProperty(["viz", option2.name], current[option2.name], RENDERER_PREFIX);
30503
- } else {
30504
- view.removeTagProperty(["viz", option2.name], RENDERER_PREFIX);
30505
- }
30471
+ onInteractOutside: (event) => {
30472
+ var _a2, _b2;
30473
+ (_a2 = props2.onInteractOutside) == null ? void 0 : _a2.call(props2, event);
30474
+ if (!event.defaultPrevented) {
30475
+ hasInteractedOutsideRef.current = true;
30476
+ if (event.detail.originalEvent.type === "pointerdown") {
30477
+ hasPointerDownOutsideRef.current = true;
30506
30478
  }
30507
- setQuery == null ? void 0 : setQuery(rootQuery.build());
30508
- setOpen(false);
30509
- },
30510
- customStyle: dialogStyles$1.editorCell
30511
- })]
30512
- })]
30513
- })
30514
- });
30515
- }
30516
- function BooleanEditor({
30517
- current,
30518
- option: option2,
30519
- setCurrent
30520
- }) {
30521
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
30522
- children: [/* @__PURE__ */ React.createElement("div", {
30523
- ...{
30524
- className: "mly78zum5 mly1lvf691 mly117nqv4"
30525
- },
30526
- key: option2.name
30527
- }, /* @__PURE__ */ jsxRuntime.jsx("input", {
30528
- type: "checkbox",
30529
- checked: current[option2.name] === "true",
30530
- onChange: ({
30531
- target: {
30532
- checked
30479
+ }
30480
+ const target = event.target;
30481
+ const targetIsTrigger = (_b2 = context.triggerRef.current) == null ? void 0 : _b2.contains(target);
30482
+ if (targetIsTrigger) event.preventDefault();
30483
+ if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
30484
+ event.preventDefault();
30485
+ }
30533
30486
  }
30534
- }) => {
30535
- setCurrent({
30536
- ...current,
30537
- [option2.name]: checked.toString()
30538
- });
30539
30487
  }
30540
- })), /* @__PURE__ */ jsxRuntime.jsx("label", {
30541
- title: option2.description,
30542
- children: option2.label
30543
- }, `${option2.name}-label`)]
30544
- });
30545
- }
30546
- function StringEditor$1({
30547
- current,
30548
- option: option2,
30549
- setCurrent
30550
- }) {
30551
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
30552
- children: [/* @__PURE__ */ React.createElement("div", {
30553
- ...{
30554
- className: "mly78zum5 mly1lvf691 mly117nqv4"
30555
- },
30556
- key: `${option2.name}-label`
30557
- }, /* @__PURE__ */ jsxRuntime.jsxs("label", {
30558
- children: [option2.label, ":"]
30559
- })), /* @__PURE__ */ jsxRuntime.jsx("input", {
30560
- value: current[option2.name],
30561
- onChange: ({
30562
- target: {
30563
- value
30488
+ );
30489
+ }
30490
+ );
30491
+ var DialogContentImpl = React__namespace.forwardRef(
30492
+ (props2, forwardedRef) => {
30493
+ const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props2;
30494
+ const context = useDialogContext(CONTENT_NAME$1, __scopeDialog);
30495
+ const contentRef = React__namespace.useRef(null);
30496
+ const composedRefs = useComposedRefs(forwardedRef, contentRef);
30497
+ useFocusGuards();
30498
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
30499
+ /* @__PURE__ */ jsxRuntime.jsx(
30500
+ FocusScope,
30501
+ {
30502
+ asChild: true,
30503
+ loop: true,
30504
+ trapped: trapFocus,
30505
+ onMountAutoFocus: onOpenAutoFocus,
30506
+ onUnmountAutoFocus: onCloseAutoFocus,
30507
+ children: /* @__PURE__ */ jsxRuntime.jsx(
30508
+ DismissableLayer,
30509
+ {
30510
+ role: "dialog",
30511
+ id: context.contentId,
30512
+ "aria-describedby": context.descriptionId,
30513
+ "aria-labelledby": context.titleId,
30514
+ "data-state": getState(context.open),
30515
+ ...contentProps,
30516
+ ref: composedRefs,
30517
+ onDismiss: () => context.onOpenChange(false)
30518
+ }
30519
+ )
30564
30520
  }
30565
- }) => {
30566
- setCurrent({
30567
- ...current,
30568
- [option2.name]: value
30569
- });
30570
- }
30571
- }, option2.name)]
30572
- });
30573
- }
30574
- function SelectEditor({
30575
- current,
30576
- option: option2,
30577
- setCurrent
30578
- }) {
30579
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
30580
- children: [/* @__PURE__ */ React.createElement("div", {
30581
- ...{
30582
- className: "mly78zum5 mly1lvf691 mly117nqv4"
30583
- },
30584
- key: `${option2.name}-label`
30585
- }, /* @__PURE__ */ jsxRuntime.jsxs("label", {
30586
- children: [option2.label, ":"]
30587
- })), /* @__PURE__ */ jsxRuntime.jsx(SelectDropdown, {
30588
- value: current[option2.name],
30589
- options: option2.options,
30590
- onChange: (value) => {
30591
- setCurrent({
30592
- ...current,
30593
- [option2.name]: value
30594
- });
30521
+ ),
30522
+ /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
30523
+ /* @__PURE__ */ jsxRuntime.jsx(TitleWarning, { titleId: context.titleId }),
30524
+ /* @__PURE__ */ jsxRuntime.jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
30525
+ ] })
30526
+ ] });
30527
+ }
30528
+ );
30529
+ var TITLE_NAME = "DialogTitle";
30530
+ var DialogTitle = React__namespace.forwardRef(
30531
+ (props2, forwardedRef) => {
30532
+ const { __scopeDialog, ...titleProps } = props2;
30533
+ const context = useDialogContext(TITLE_NAME, __scopeDialog);
30534
+ return /* @__PURE__ */ jsxRuntime.jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
30535
+ }
30536
+ );
30537
+ DialogTitle.displayName = TITLE_NAME;
30538
+ var DESCRIPTION_NAME = "DialogDescription";
30539
+ var DialogDescription = React__namespace.forwardRef(
30540
+ (props2, forwardedRef) => {
30541
+ const { __scopeDialog, ...descriptionProps } = props2;
30542
+ const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
30543
+ return /* @__PURE__ */ jsxRuntime.jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
30544
+ }
30545
+ );
30546
+ DialogDescription.displayName = DESCRIPTION_NAME;
30547
+ var CLOSE_NAME = "DialogClose";
30548
+ var DialogClose = React__namespace.forwardRef(
30549
+ (props2, forwardedRef) => {
30550
+ const { __scopeDialog, ...closeProps } = props2;
30551
+ const context = useDialogContext(CLOSE_NAME, __scopeDialog);
30552
+ return /* @__PURE__ */ jsxRuntime.jsx(
30553
+ Primitive.button,
30554
+ {
30555
+ type: "button",
30556
+ ...closeProps,
30557
+ ref: forwardedRef,
30558
+ onClick: composeEventHandlers(props2.onClick, () => context.onOpenChange(false))
30595
30559
  }
30596
- }, option2.name)]
30597
- });
30560
+ );
30561
+ }
30562
+ );
30563
+ DialogClose.displayName = CLOSE_NAME;
30564
+ function getState(open) {
30565
+ return open ? "open" : "closed";
30598
30566
  }
30599
- const dialogStyles$1 = {
30600
- trigger: {
30601
- height: "mly1ktj5wk",
30567
+ var TITLE_WARNING_NAME = "DialogTitleWarning";
30568
+ var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
30569
+ contentName: CONTENT_NAME$1,
30570
+ titleName: TITLE_NAME,
30571
+ docsSlug: "dialog"
30572
+ });
30573
+ var TitleWarning = ({ titleId }) => {
30574
+ const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
30575
+ const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
30576
+
30577
+ If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
30578
+
30579
+ For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
30580
+ React__namespace.useEffect(() => {
30581
+ if (titleId) {
30582
+ const hasTitle = document.getElementById(titleId);
30583
+ if (!hasTitle) console.error(MESSAGE);
30584
+ }
30585
+ }, [MESSAGE, titleId]);
30586
+ return null;
30587
+ };
30588
+ var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
30589
+ var DescriptionWarning = ({ contentRef, descriptionId }) => {
30590
+ const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
30591
+ const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
30592
+ React__namespace.useEffect(() => {
30593
+ var _a2;
30594
+ const describedById = (_a2 = contentRef.current) == null ? void 0 : _a2.getAttribute("aria-describedby");
30595
+ if (descriptionId && describedById) {
30596
+ const hasDescription = document.getElementById(descriptionId);
30597
+ if (!hasDescription) console.warn(MESSAGE);
30598
+ }
30599
+ }, [MESSAGE, contentRef, descriptionId]);
30600
+ return null;
30601
+ };
30602
+ var Root = Dialog;
30603
+ var Portal = DialogPortal;
30604
+ var Overlay = DialogOverlay;
30605
+ var Content$1 = DialogContent;
30606
+ var Title = DialogTitle;
30607
+ var Description = DialogDescription;
30608
+ var Close = DialogClose;
30609
+ const styles$s = {
30610
+ left: {
30611
+ display: "mly78zum5",
30612
+ justifyContent: "mly1lvf691",
30602
30613
  $$css: true
30603
30614
  },
30604
- content: {
30615
+ right: {
30605
30616
  display: "mly78zum5",
30606
- flexDirection: "mlydt5ytf",
30607
- boxShadow: "mly5n1uv4",
30608
- backgroundColor: "mly12peec7",
30609
- borderRadius: "mlyur7f20",
30610
- borderStartStartRadius: null,
30611
- borderStartEndRadius: null,
30612
- borderEndStartRadius: null,
30613
- borderEndEndRadius: null,
30614
- borderTopLeftRadius: null,
30615
- borderTopRightRadius: null,
30616
- borderBottomLeftRadius: null,
30617
- borderBottomRightRadius: null,
30618
- padding: "mlye8ttls",
30619
- paddingInline: null,
30620
- paddingStart: null,
30621
- paddingLeft: null,
30622
- paddingEnd: null,
30623
- paddingRight: null,
30624
- paddingBlock: null,
30625
- paddingTop: null,
30626
- paddingBottom: null,
30627
- minWidth: "mlylm99nl",
30628
- maxWidth: "mly1jkqq1h",
30629
- gap: "mly167g77z",
30630
- rowGap: null,
30631
- columnGap: null,
30617
+ justifyContent: "mly1rfj78v",
30632
30618
  $$css: true
30633
30619
  },
30634
- editorCell: {
30635
- flexGrow: "mly1iyjqo2",
30620
+ heading: {
30621
+ gridColumn: "mly623te4",
30622
+ gridColumnStart: null,
30623
+ gridColumnEnd: null,
30624
+ fontWeight: "mly117nqv4",
30636
30625
  $$css: true
30637
- }
30638
- };
30639
- function Visualization$1({
30640
- rootQuery,
30626
+ },
30627
+ label: {
30628
+ whiteSpace: "mlyuxw1ft",
30629
+ $$css: true
30630
+ },
30631
+ divider: {
30632
+ gridColumn: "mly1a80n4u",
30633
+ gridColumnStart: null,
30634
+ gridColumnEnd: null,
30635
+ borderTop: "mlye536se",
30636
+ borderTopWidth: null,
30637
+ borderTopStyle: null,
30638
+ borderTopColor: null,
30639
+ $$css: true
30640
+ },
30641
+ editor: {
30642
+ display: "mly78zum5",
30643
+ flexDirection: "mlydt5ytf",
30644
+ gap: "mly167g77z",
30645
+ rowGap: null,
30646
+ columnGap: null,
30647
+ overflow: "mlyb3r6kr",
30648
+ overflowX: null,
30649
+ overflowY: null,
30650
+ $$css: true
30651
+ },
30652
+ editorGrid: {
30653
+ display: "mlyrvj5dj",
30654
+ gridTemplateColumns: "mly16kridx",
30655
+ gridAutoRows: "mlysd5ean",
30656
+ gap: "mly167g77z",
30657
+ rowGap: null,
30658
+ columnGap: null,
30659
+ overflowY: "mly1odjw0f",
30660
+ $$css: true
30661
+ },
30662
+ editorRow: {
30663
+ display: "mly78zum5",
30664
+ gap: "mly167g77z",
30665
+ rowGap: null,
30666
+ columnGap: null,
30667
+ $$css: true
30668
+ },
30669
+ editorCell: {
30670
+ flexGrow: "mly1iyjqo2",
30671
+ $$css: true
30672
+ },
30673
+ input: {
30674
+ border: "mly27xtdb",
30675
+ borderWidth: null,
30676
+ borderInlineWidth: null,
30677
+ borderInlineStartWidth: null,
30678
+ borderLeftWidth: null,
30679
+ borderInlineEndWidth: null,
30680
+ borderRightWidth: null,
30681
+ borderBlockWidth: null,
30682
+ borderTopWidth: null,
30683
+ borderBottomWidth: null,
30684
+ borderStyle: null,
30685
+ borderInlineStyle: null,
30686
+ borderInlineStartStyle: null,
30687
+ borderLeftStyle: null,
30688
+ borderInlineEndStyle: null,
30689
+ borderRightStyle: null,
30690
+ borderBlockStyle: null,
30691
+ borderTopStyle: null,
30692
+ borderBottomStyle: null,
30693
+ borderColor: null,
30694
+ borderInlineColor: null,
30695
+ borderInlineStartColor: null,
30696
+ borderLeftColor: null,
30697
+ borderInlineEndColor: null,
30698
+ borderRightColor: null,
30699
+ borderBlockColor: null,
30700
+ borderTopColor: null,
30701
+ borderBottomColor: null,
30702
+ borderRadius: "mly12oqio5",
30703
+ borderStartStartRadius: null,
30704
+ borderStartEndRadius: null,
30705
+ borderEndStartRadius: null,
30706
+ borderEndEndRadius: null,
30707
+ borderTopLeftRadius: null,
30708
+ borderTopRightRadius: null,
30709
+ borderBottomLeftRadius: null,
30710
+ borderBottomRightRadius: null,
30711
+ color: "mlyizdh9v",
30712
+ padding: "mly34lxi1",
30713
+ paddingInline: null,
30714
+ paddingStart: null,
30715
+ paddingLeft: null,
30716
+ paddingEnd: null,
30717
+ paddingRight: null,
30718
+ paddingBlock: null,
30719
+ paddingTop: null,
30720
+ paddingBottom: null,
30721
+ $$css: true
30722
+ },
30723
+ card: {
30724
+ maxWidth: "mly1dc814f",
30725
+ $$css: true
30726
+ },
30727
+ infoTrigger: {
30728
+ display: "mly3nfvp2",
30729
+ alignItems: "mly1071x5a",
30730
+ justifyContent: "mlyl56j7k",
30731
+ paddingRight: "mlyy13l1i",
30732
+ paddingInlineStart: null,
30733
+ paddingInlineEnd: null,
30734
+ paddingTop: "mly1iorvi4",
30735
+ $$css: true
30736
+ }
30737
+ };
30738
+ function HoverCard({
30739
+ children,
30740
+ customStyle
30741
+ }) {
30742
+ return /* @__PURE__ */ jsxRuntime.jsx("div", {
30743
+ ..._stylex.props(styles$r.container, fontStyles.body, customStyle),
30744
+ children
30745
+ });
30746
+ }
30747
+ const styles$r = {
30748
+ container: {
30749
+ boxShadow: "mly5n1uv4",
30750
+ backgroundColor: "mly12peec7",
30751
+ borderRadius: "mly4pepcl",
30752
+ borderStartStartRadius: null,
30753
+ borderStartEndRadius: null,
30754
+ borderEndStartRadius: null,
30755
+ borderEndEndRadius: null,
30756
+ borderTopLeftRadius: null,
30757
+ borderTopRightRadius: null,
30758
+ borderBottomLeftRadius: null,
30759
+ borderBottomRightRadius: null,
30760
+ padding: "mlyc7ga6q",
30761
+ paddingInline: null,
30762
+ paddingStart: null,
30763
+ paddingLeft: null,
30764
+ paddingEnd: null,
30765
+ paddingRight: null,
30766
+ paddingBlock: null,
30767
+ paddingTop: null,
30768
+ paddingBottom: null,
30769
+ display: "mly78zum5",
30770
+ flexDirection: "mlydt5ytf",
30771
+ gap: "mly167g77z",
30772
+ rowGap: null,
30773
+ columnGap: null,
30774
+ $$css: true
30775
+ }
30776
+ };
30777
+ function InfoHover({
30778
+ info
30779
+ }) {
30780
+ return /* @__PURE__ */ jsxRuntime.jsxs(Root3$1, {
30781
+ children: [/* @__PURE__ */ jsxRuntime.jsx(Trigger$4, {
30782
+ asChild: true,
30783
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", {
30784
+ ..._stylex.props(styles$s.infoTrigger, fontStyles.body),
30785
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icon, {
30786
+ name: "info",
30787
+ color: "disabled"
30788
+ })
30789
+ })
30790
+ }), /* @__PURE__ */ jsxRuntime.jsx(Portal$4, {
30791
+ children: /* @__PURE__ */ jsxRuntime.jsx(Content2$4, {
30792
+ side: "right",
30793
+ align: "start",
30794
+ children: /* @__PURE__ */ jsxRuntime.jsx(HoverCard, {
30795
+ customStyle: styles$s.card,
30796
+ children: info
30797
+ })
30798
+ })
30799
+ })]
30800
+ });
30801
+ }
30802
+ function useClickOutside(refOrRefs, handler) {
30803
+ React.useEffect(() => {
30804
+ const refs = Array.isArray(refOrRefs) ? refOrRefs : [refOrRefs];
30805
+ let down = false;
30806
+ const isInOneElement = (ref, event) => {
30807
+ return !ref.current || event.target instanceof Element && ref.current.contains(event.target);
30808
+ };
30809
+ const isInElement = (event) => {
30810
+ return refs.some((ref) => isInOneElement(ref, event));
30811
+ };
30812
+ const onMouseUp = (event) => {
30813
+ if (!down || isInElement(event)) return;
30814
+ handler(event);
30815
+ down = false;
30816
+ };
30817
+ const onMouseDown = (event) => {
30818
+ if (isInElement(event)) return;
30819
+ down = true;
30820
+ };
30821
+ document.addEventListener("mouseup", onMouseUp);
30822
+ document.addEventListener("mousedown", onMouseDown);
30823
+ return () => {
30824
+ document.removeEventListener("mouseup", onMouseUp);
30825
+ document.removeEventListener("mousedown", onMouseDown);
30826
+ };
30827
+ }, [refOrRefs, handler]);
30828
+ }
30829
+ const PillInput = ({
30830
+ values,
30831
+ setValues,
30832
+ autoFocus,
30833
+ placeholder,
30834
+ type = "text",
30835
+ value: controlledValue,
30836
+ setValue: setControlledValue,
30837
+ focusElement,
30838
+ color = DEFAULT_TOKEN_COLOR,
30839
+ customStyle
30840
+ }) => {
30841
+ const [uncontrolledValue, setUncontrolledValue] = React.useState("");
30842
+ const [_focused, setFocused] = React.useState(false);
30843
+ const inp = React.useRef(null);
30844
+ const ref = React.useRef(null);
30845
+ const [selectedPill, setSelectedPill] = React.useState(void 0);
30846
+ const pillRefs = React.useRef([]);
30847
+ const value = controlledValue || uncontrolledValue;
30848
+ const setValue = setControlledValue || setUncontrolledValue;
30849
+ const deletePill = React.useCallback((idx) => {
30850
+ var _a2;
30851
+ const newValues = [...values];
30852
+ newValues.splice(idx, 1);
30853
+ setValues(newValues);
30854
+ if (selectedPill === 0) {
30855
+ if (values.length === 1) {
30856
+ setSelectedPill(void 0);
30857
+ (_a2 = inp.current) == null ? void 0 : _a2.focus();
30858
+ } else {
30859
+ setSelectedPill(0);
30860
+ }
30861
+ } else {
30862
+ setSelectedPill(idx - 1);
30863
+ }
30864
+ }, [selectedPill, setValues, values]);
30865
+ const pills = React.useMemo(() => {
30866
+ pillRefs.current = new Array(values.length);
30867
+ return values.map((value2, index2) => /* @__PURE__ */ jsxRuntime.jsx(Pill, {
30868
+ color,
30869
+ onClick: () => {
30870
+ setSelectedPill(index2);
30871
+ },
30872
+ onDelete: () => deletePill(index2),
30873
+ forwardRef: (ref2) => {
30874
+ pillRefs.current[index2] = ref2;
30875
+ },
30876
+ children: value2
30877
+ }, value2));
30878
+ }, [color, deletePill, values]);
30879
+ React.useEffect(() => {
30880
+ var _a2;
30881
+ if (selectedPill !== void 0) {
30882
+ (_a2 = pillRefs.current[selectedPill]) == null ? void 0 : _a2.focus();
30883
+ }
30884
+ }, [pills, selectedPill]);
30885
+ const onKeyUp = (event) => {
30886
+ var _a2, _b2;
30887
+ if (event.key === "Backspace") {
30888
+ if (selectedPill !== void 0) {
30889
+ deletePill(selectedPill);
30890
+ }
30891
+ } else if (event.key === "ArrowRight") {
30892
+ if (selectedPill === values.length - 1) {
30893
+ setSelectedPill(void 0);
30894
+ (_a2 = inp.current) == null ? void 0 : _a2.focus();
30895
+ } else if (selectedPill !== void 0) {
30896
+ setSelectedPill(selectedPill + 1);
30897
+ }
30898
+ } else if (event.key === "ArrowLeft") {
30899
+ if (selectedPill !== void 0 && selectedPill > 0) {
30900
+ setSelectedPill(selectedPill - 1);
30901
+ }
30902
+ } else {
30903
+ (_b2 = inp.current) == null ? void 0 : _b2.focus();
30904
+ }
30905
+ };
30906
+ const commitValue = () => {
30907
+ if (value.length > 0 && !values.includes(value)) {
30908
+ setValues([...values, value]);
30909
+ setValue("");
30910
+ }
30911
+ };
30912
+ useClickOutside(focusElement ? [ref, focusElement] : ref, () => {
30913
+ setFocused(false);
30914
+ commitValue();
30915
+ });
30916
+ return /* @__PURE__ */ jsxRuntime.jsx("div", {
30917
+ ..._stylex.props(fontStyles.body, styles$q.main),
30918
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
30919
+ ..._stylex.props(styles$q.content, customStyle),
30920
+ onKeyUp,
30921
+ onClick: () => {
30922
+ var _a2;
30923
+ return (_a2 = inp.current) == null ? void 0 : _a2.focus();
30924
+ },
30925
+ ref,
30926
+ children: [pills, /* @__PURE__ */ jsxRuntime.jsx("input", {
30927
+ ...{
30928
+ className: "mly1gs6z28 mly1a2a7pz mly6icuqf mlyif65rj mlyayvuls mly83z2og mly1onzeue mly195ery5 mly1iyjqo2"
30929
+ },
30930
+ ref: inp,
30931
+ type,
30932
+ placeholder: values.length === 0 ? placeholder : "",
30933
+ value,
30934
+ size: 1,
30935
+ onChange: (event) => {
30936
+ setValue(event.target.value);
30937
+ },
30938
+ onKeyDown: (event) => {
30939
+ if (event.key === "Enter") {
30940
+ if (value !== "") {
30941
+ commitValue();
30942
+ event.stopPropagation();
30943
+ event.preventDefault();
30944
+ }
30945
+ }
30946
+ },
30947
+ onKeyUp: (event) => {
30948
+ var _a2, _b2, _c2, _d;
30949
+ if (event.key === "Backspace") {
30950
+ if (value === "" && values.length > 0) {
30951
+ commitValue();
30952
+ (_a2 = inp.current) == null ? void 0 : _a2.blur();
30953
+ setSelectedPill(values.length - 1);
30954
+ }
30955
+ } else if (event.key === "ArrowLeft") {
30956
+ if (((_b2 = inp.current) == null ? void 0 : _b2.selectionStart) === 0 || ((_c2 = inp.current) == null ? void 0 : _c2.selectionStart) === null) {
30957
+ commitValue();
30958
+ (_d = inp.current) == null ? void 0 : _d.blur();
30959
+ setSelectedPill(values.length - 1);
30960
+ event.preventDefault();
30961
+ event.stopPropagation();
30962
+ }
30963
+ }
30964
+ },
30965
+ onFocus: () => {
30966
+ setFocused(true);
30967
+ setSelectedPill(void 0);
30968
+ },
30969
+ autoFocus
30970
+ })]
30971
+ })
30972
+ });
30973
+ };
30974
+ const Pill = ({
30975
+ children,
30976
+ color = DEFAULT_TOKEN_COLOR,
30977
+ forwardRef,
30978
+ onClick,
30979
+ onDelete
30980
+ }) => {
30981
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", {
30982
+ onClick,
30983
+ tabIndex: 0,
30984
+ ref: forwardRef,
30985
+ ..._stylex.props(styles$q.pill, colorVariants[color]),
30986
+ children: [children, /* @__PURE__ */ jsxRuntime.jsx("div", {
30987
+ title: "Remove",
30988
+ ...{
30989
+ className: "mly3nfvp2"
30990
+ },
30991
+ children: /* @__PURE__ */ jsxRuntime.jsx(SvgClear, {
30992
+ onClick: () => onDelete(),
30993
+ ...{
30994
+ className: "mly6jxa94 mly1v9usgg"
30995
+ }
30996
+ })
30997
+ })]
30998
+ });
30999
+ };
31000
+ const styles$q = {
31001
+ main: {
31002
+ borderRadius: "mly12oqio5",
31003
+ borderStartStartRadius: null,
31004
+ borderStartEndRadius: null,
31005
+ borderEndStartRadius: null,
31006
+ borderEndEndRadius: null,
31007
+ borderTopLeftRadius: null,
31008
+ borderTopRightRadius: null,
31009
+ borderBottomLeftRadius: null,
31010
+ borderBottomRightRadius: null,
31011
+ border: "mlyvckdp7",
31012
+ borderWidth: null,
31013
+ borderInlineWidth: null,
31014
+ borderInlineStartWidth: null,
31015
+ borderLeftWidth: null,
31016
+ borderInlineEndWidth: null,
31017
+ borderRightWidth: null,
31018
+ borderBlockWidth: null,
31019
+ borderTopWidth: null,
31020
+ borderBottomWidth: null,
31021
+ borderStyle: null,
31022
+ borderInlineStyle: null,
31023
+ borderInlineStartStyle: null,
31024
+ borderLeftStyle: null,
31025
+ borderInlineEndStyle: null,
31026
+ borderRightStyle: null,
31027
+ borderBlockStyle: null,
31028
+ borderTopStyle: null,
31029
+ borderBottomStyle: null,
31030
+ borderColor: null,
31031
+ borderInlineColor: null,
31032
+ borderInlineStartColor: null,
31033
+ borderLeftColor: null,
31034
+ borderInlineEndColor: null,
31035
+ borderRightColor: null,
31036
+ borderBlockColor: null,
31037
+ borderTopColor: null,
31038
+ borderBottomColor: null,
31039
+ padding: "mlybsehbd",
31040
+ paddingInline: null,
31041
+ paddingStart: null,
31042
+ paddingLeft: null,
31043
+ paddingEnd: null,
31044
+ paddingRight: null,
31045
+ paddingBlock: null,
31046
+ paddingTop: null,
31047
+ paddingBottom: null,
31048
+ display: "mlyrvj5dj",
31049
+ minHeight: "mly2lwn1j",
31050
+ overflow: "mlyysyzu8",
31051
+ overflowX: null,
31052
+ overflowY: null,
31053
+ $$css: true
31054
+ },
31055
+ content: {
31056
+ outline: "mly1a2a7pz",
31057
+ outlineColor: null,
31058
+ outlineOffset: null,
31059
+ outlineStyle: null,
31060
+ outlineWidth: null,
31061
+ display: "mly78zum5",
31062
+ flexWrap: "mly1a02dak",
31063
+ gap: "mly1ed6fcf",
31064
+ rowGap: null,
31065
+ columnGap: null,
31066
+ borderColor: "mly1akygb0 mlyetl2wx",
31067
+ borderInlineColor: null,
31068
+ borderInlineStartColor: null,
31069
+ borderLeftColor: null,
31070
+ borderInlineEndColor: null,
31071
+ borderRightColor: null,
31072
+ borderBlockColor: null,
31073
+ borderTopColor: null,
31074
+ borderBottomColor: null,
31075
+ $$css: true
31076
+ },
31077
+ pill: {
31078
+ backgroundColor: "mlyy9rfsq",
31079
+ borderRadius: "mly1sxf85j",
31080
+ borderStartStartRadius: null,
31081
+ borderStartEndRadius: null,
31082
+ borderEndStartRadius: null,
31083
+ borderEndEndRadius: null,
31084
+ borderTopLeftRadius: null,
31085
+ borderTopRightRadius: null,
31086
+ borderBottomLeftRadius: null,
31087
+ borderBottomRightRadius: null,
31088
+ color: "mly1xre2ib",
31089
+ display: "mly78zum5",
31090
+ alignItems: "mly6s0dn4",
31091
+ gap: "mly1nejdyq",
31092
+ rowGap: null,
31093
+ columnGap: null,
31094
+ padding: "mly1e41zw8",
31095
+ paddingInline: null,
31096
+ paddingStart: null,
31097
+ paddingLeft: null,
31098
+ paddingEnd: null,
31099
+ paddingRight: null,
31100
+ paddingBlock: null,
31101
+ paddingTop: null,
31102
+ paddingBottom: null,
31103
+ textTransform: "mly6mezaz",
31104
+ cursor: "mly1ypdohk",
31105
+ height: "mly1qx5ct2",
31106
+ whiteSpace: "mlyuxw1ft",
31107
+ $$css: true
31108
+ }
31109
+ };
31110
+ const colorVariants = {
31111
+ default: {
31112
+ "--mlyvygx4q": "mly1izbou4",
31113
+ "--mly13n7235": "mly8bgh0r",
31114
+ $$css: true
31115
+ },
31116
+ purple: {
31117
+ "--mlyvygx4q": "mly1f8soc4",
31118
+ "--mly13n7235": "mly1r5zvhd",
31119
+ $$css: true
31120
+ },
31121
+ green: {
31122
+ "--mlyvygx4q": "mlyf8wvcd",
31123
+ "--mly13n7235": "mly1u6t2w6",
31124
+ $$css: true
31125
+ },
31126
+ cyan: {
31127
+ "--mlyvygx4q": "mlyrtwgpv",
31128
+ "--mly13n7235": "mlys5r2en",
31129
+ $$css: true
31130
+ }
31131
+ };
31132
+ function OneOfEditor({
31133
+ view,
31134
+ name,
31135
+ path,
31136
+ current,
31137
+ option: option2,
31138
+ updateCurrent
31139
+ }) {
31140
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
31141
+ children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
31142
+ ..._stylex.props(styles$s.label, styles$s.left),
31143
+ children: /* @__PURE__ */ jsxRuntime.jsxs("label", {
31144
+ children: [option2.title ?? name, ":"]
31145
+ })
31146
+ }), /* @__PURE__ */ jsxRuntime.jsx("div", {}), option2.description ? /* @__PURE__ */ jsxRuntime.jsx(InfoHover, {
31147
+ info: option2.description
31148
+ }) : /* @__PURE__ */ jsxRuntime.jsx("div", {}), option2.oneOf.map((subOption, key2) => {
31149
+ switch (subOption.type) {
31150
+ case "string":
31151
+ return /* @__PURE__ */ jsxRuntime.jsx(OneOfStringEditor, {
31152
+ view,
31153
+ name,
31154
+ path,
31155
+ updateCurrent,
31156
+ current,
31157
+ option: subOption
31158
+ }, key2);
31159
+ case "number":
31160
+ return /* @__PURE__ */ jsxRuntime.jsx(OneOfNumberEditor, {
31161
+ view,
31162
+ name,
31163
+ path,
31164
+ updateCurrent,
31165
+ current,
31166
+ option: subOption
31167
+ }, key2);
31168
+ case "array":
31169
+ return /* @__PURE__ */ jsxRuntime.jsx(OneOfArrayEditor, {
31170
+ view,
31171
+ name,
31172
+ path,
31173
+ updateCurrent,
31174
+ current,
31175
+ option: subOption
31176
+ }, key2);
31177
+ }
31178
+ return null;
31179
+ })]
31180
+ });
31181
+ }
31182
+ function OneOfStringEditor({
31183
+ path,
31184
+ current,
31185
+ updateCurrent,
31186
+ option: option2
31187
+ }) {
31188
+ const isString2 = typeof current === "string";
31189
+ const [value, setValue] = React.useState(isString2 ? current : "");
31190
+ if (option2.enum) {
31191
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
31192
+ children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
31193
+ ..._stylex.props(styles$s.left),
31194
+ children: /* @__PURE__ */ jsxRuntime.jsx("input", {
31195
+ type: "radio",
31196
+ checked: isString2 && option2.enum.includes(current),
31197
+ onChange: ({
31198
+ target: {
31199
+ checked
31200
+ }
31201
+ }) => {
31202
+ if (checked) {
31203
+ updateCurrent(path, value);
31204
+ }
31205
+ }
31206
+ })
31207
+ }), option2.enum.length > 1 ? /* @__PURE__ */ jsxRuntime.jsx(SelectDropdown, {
31208
+ value,
31209
+ options: option2.enum.map((value2) => ({
31210
+ label: value2,
31211
+ value: value2
31212
+ })),
31213
+ onChange: (value2) => {
31214
+ setValue(value2);
31215
+ updateCurrent(path, value2);
31216
+ }
31217
+ }) : /* @__PURE__ */ jsxRuntime.jsx("div", {
31218
+ children: option2.enum[0]
31219
+ }), /* @__PURE__ */ jsxRuntime.jsx("div", {})]
31220
+ });
31221
+ } else {
31222
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
31223
+ children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
31224
+ ..._stylex.props(styles$s.left),
31225
+ children: /* @__PURE__ */ jsxRuntime.jsx("input", {
31226
+ type: "radio",
31227
+ checked: isString2,
31228
+ onChange: ({
31229
+ target: {
31230
+ checked
31231
+ }
31232
+ }) => {
31233
+ if (checked) {
31234
+ updateCurrent(path, value);
31235
+ }
31236
+ }
31237
+ })
31238
+ }), /* @__PURE__ */ jsxRuntime.jsx("input", {
31239
+ value,
31240
+ onChange: ({
31241
+ target: {
31242
+ value: value2
31243
+ }
31244
+ }) => {
31245
+ setValue(value2);
31246
+ updateCurrent(path, value2);
31247
+ }
31248
+ }), /* @__PURE__ */ jsxRuntime.jsx("div", {})]
31249
+ });
31250
+ }
31251
+ }
31252
+ function OneOfNumberEditor({
31253
+ path,
31254
+ current,
31255
+ updateCurrent,
31256
+ option: option2
31257
+ }) {
31258
+ const isNumber2 = typeof current === "number";
31259
+ const [value, setValue] = React.useState(isNumber2 ? current : option2.minimum ?? 0);
31260
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
31261
+ children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
31262
+ ..._stylex.props(styles$s.left),
31263
+ children: /* @__PURE__ */ jsxRuntime.jsx("input", {
31264
+ type: "radio",
31265
+ checked: isNumber2,
31266
+ onChange: ({
31267
+ target: {
31268
+ checked
31269
+ }
31270
+ }) => {
31271
+ if (checked) {
31272
+ updateCurrent(path, value);
31273
+ }
31274
+ }
31275
+ })
31276
+ }), /* @__PURE__ */ jsxRuntime.jsx("input", {
31277
+ type: "number",
31278
+ min: option2.minimum,
31279
+ max: option2.maximum,
31280
+ value,
31281
+ onChange: ({
31282
+ target: {
31283
+ valueAsNumber
31284
+ }
31285
+ }) => {
31286
+ setValue(value);
31287
+ updateCurrent(path, valueAsNumber);
31288
+ },
31289
+ ..._stylex.props(styles$s.input)
31290
+ }), /* @__PURE__ */ jsxRuntime.jsx("div", {})]
31291
+ });
31292
+ }
31293
+ function OneOfArrayEditor({
31294
+ path,
31295
+ current,
31296
+ updateCurrent
31297
+ }) {
31298
+ const isArray2 = Array.isArray(current);
31299
+ const [value, setValue] = React.useState(isArray2 ? current : []);
31300
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
31301
+ children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
31302
+ ..._stylex.props(styles$s.left),
31303
+ children: /* @__PURE__ */ jsxRuntime.jsx("input", {
31304
+ type: "radio",
31305
+ checked: isArray2,
31306
+ onChange: ({
31307
+ target: {
31308
+ checked
31309
+ }
31310
+ }) => {
31311
+ if (checked) {
31312
+ updateCurrent(path, value);
31313
+ }
31314
+ }
31315
+ })
31316
+ }), /* @__PURE__ */ jsxRuntime.jsx(PillInput, {
31317
+ values: value,
31318
+ setValues: (values) => {
31319
+ setValue(values);
31320
+ updateCurrent(path, values);
31321
+ }
31322
+ }), /* @__PURE__ */ jsxRuntime.jsx("div", {})]
31323
+ });
31324
+ }
31325
+ function ArrayEditor({
31326
+ name,
31327
+ path,
31328
+ current,
31329
+ option: option2,
31330
+ updateCurrent
31331
+ }) {
31332
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
31333
+ children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
31334
+ ..._stylex.props(styles$s.left, styles$s.label),
31335
+ children: /* @__PURE__ */ jsxRuntime.jsxs("label", {
31336
+ children: [option2.title ?? name, ":"]
31337
+ })
31338
+ }), /* @__PURE__ */ jsxRuntime.jsx(PillInput, {
31339
+ values: current,
31340
+ setValues: (values) => {
31341
+ updateCurrent(path, values);
31342
+ }
31343
+ }), option2.description ? /* @__PURE__ */ jsxRuntime.jsx(InfoHover, {
31344
+ info: option2.description
31345
+ }) : /* @__PURE__ */ jsxRuntime.jsx("div", {})]
31346
+ });
31347
+ }
31348
+ function NumberEditor$1({
31349
+ name,
31350
+ path,
31351
+ current,
31352
+ option: option2,
31353
+ updateCurrent
31354
+ }) {
31355
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
31356
+ children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
31357
+ ..._stylex.props(styles$s.left, styles$s.label),
31358
+ children: /* @__PURE__ */ jsxRuntime.jsxs("label", {
31359
+ children: [option2.title ?? name, ":"]
31360
+ })
31361
+ }), /* @__PURE__ */ jsxRuntime.jsx("input", {
31362
+ value: current,
31363
+ type: "number",
31364
+ min: option2.minimum,
31365
+ max: option2.maximum,
31366
+ onChange: ({
31367
+ target: {
31368
+ valueAsNumber
31369
+ }
31370
+ }) => {
31371
+ updateCurrent(path, valueAsNumber);
31372
+ },
31373
+ ..._stylex.props(styles$s.input)
31374
+ }, name), option2.description ? /* @__PURE__ */ jsxRuntime.jsx(InfoHover, {
31375
+ info: option2.description
31376
+ }) : /* @__PURE__ */ jsxRuntime.jsx("div", {})]
31377
+ });
31378
+ }
31379
+ function StringEditor$1({
31380
+ name,
31381
+ path,
31382
+ current,
31383
+ option: option2,
31384
+ updateCurrent
31385
+ }) {
31386
+ if (option2.enum) {
31387
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
31388
+ children: [/* @__PURE__ */ React.createElement("div", {
31389
+ ..._stylex.props(styles$s.left, styles$s.label),
31390
+ key: `${name}-label`
31391
+ }, /* @__PURE__ */ jsxRuntime.jsxs("label", {
31392
+ children: [option2.title ?? name, ":"]
31393
+ })), /* @__PURE__ */ jsxRuntime.jsx(SelectDropdown, {
31394
+ value: current,
31395
+ options: option2.enum.map((value) => ({
31396
+ label: value,
31397
+ value
31398
+ })),
31399
+ onChange: (value) => {
31400
+ updateCurrent(path, value);
31401
+ }
31402
+ }, name), option2.description ? /* @__PURE__ */ jsxRuntime.jsx(InfoHover, {
31403
+ info: option2.description
31404
+ }) : /* @__PURE__ */ jsxRuntime.jsx("div", {})]
31405
+ });
31406
+ } else {
31407
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
31408
+ children: [/* @__PURE__ */ React.createElement("div", {
31409
+ ..._stylex.props(styles$s.left, styles$s.label),
31410
+ key: `${name}-label`
31411
+ }, /* @__PURE__ */ jsxRuntime.jsxs("label", {
31412
+ children: [option2.title ?? name, ":"]
31413
+ })), /* @__PURE__ */ jsxRuntime.jsx("input", {
31414
+ value: current,
31415
+ onChange: ({
31416
+ target: {
31417
+ value
31418
+ }
31419
+ }) => {
31420
+ updateCurrent(path, value);
31421
+ }
31422
+ }, name), option2.description ? /* @__PURE__ */ jsxRuntime.jsx(InfoHover, {
31423
+ info: option2.description
31424
+ }) : /* @__PURE__ */ jsxRuntime.jsx("div", {})]
31425
+ });
31426
+ }
31427
+ }
31428
+ function BooleanEditor({
31429
+ name,
31430
+ path,
31431
+ current,
31432
+ option: option2,
31433
+ updateCurrent
31434
+ }) {
31435
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
31436
+ children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
31437
+ ..._stylex.props(styles$s.left),
31438
+ children: /* @__PURE__ */ jsxRuntime.jsxs("label", {
31439
+ ..._stylex.props(styles$s.label),
31440
+ htmlFor: `${name}-checkbox`,
31441
+ children: [option2.title ?? name, ":"]
31442
+ }, `${name}-label`)
31443
+ }), /* @__PURE__ */ jsxRuntime.jsx("div", {
31444
+ ..._stylex.props(styles$s.right),
31445
+ children: /* @__PURE__ */ jsxRuntime.jsx("input", {
31446
+ type: "checkbox",
31447
+ checked: current,
31448
+ onChange: ({
31449
+ target: {
31450
+ checked
31451
+ }
31452
+ }) => {
31453
+ updateCurrent(path, checked);
31454
+ },
31455
+ id: `${name}-checkbox`
31456
+ })
31457
+ }), option2.description ? /* @__PURE__ */ jsxRuntime.jsx(InfoHover, {
31458
+ info: option2.description
31459
+ }) : /* @__PURE__ */ jsxRuntime.jsx("div", {})]
31460
+ });
31461
+ }
31462
+ function FieldEditor({
31463
+ view,
31464
+ name,
31465
+ path,
31466
+ current,
31467
+ option: option2,
31468
+ updateCurrent
31469
+ }) {
31470
+ const [searchValue, setSearchValue] = React.useState("");
31471
+ const valueListRef = React.useRef(null);
31472
+ const jsonFields = current ?? [];
31473
+ const fields = jsonFields.map((field) => {
31474
+ try {
31475
+ return JSON.parse(field)[0];
31476
+ } catch (e) {
31477
+ console.warn("Failed to parse field", field, e);
31478
+ return "";
31479
+ }
31480
+ });
31481
+ const updateFields = (path2, value) => {
31482
+ const jsonFields2 = value.map((field) => JSON.stringify([field]));
31483
+ updateCurrent(path2, jsonFields2);
31484
+ };
31485
+ const lcSearch = searchValue.toLocaleLowerCase();
31486
+ const dimensions = view.definition.getOutputSchema().fields;
31487
+ const filteredFields = dimensions.filter((field) => field.name.toLocaleLowerCase().includes(lcSearch)).filter((field) => !fields.includes(field.name)).filter((field) => {
31488
+ var _a2;
31489
+ return !("fieldTypes" in option2.items) || ((_a2 = option2.items.fieldTypes) == null ? void 0 : _a2.includes(field.type.kind));
31490
+ });
31491
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
31492
+ children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
31493
+ ..._stylex.props(styles$s.left, styles$s.label),
31494
+ children: /* @__PURE__ */ jsxRuntime.jsxs("label", {
31495
+ children: [option2.title ?? name, ":"]
31496
+ })
31497
+ }), /* @__PURE__ */ jsxRuntime.jsxs("div", {
31498
+ style: {
31499
+ minHeight: 0,
31500
+ display: "grid",
31501
+ gap: 4
31502
+ },
31503
+ children: [/* @__PURE__ */ jsxRuntime.jsx(PillInput, {
31504
+ values: fields,
31505
+ setValues: (values) => {
31506
+ updateFields(path, values);
31507
+ },
31508
+ value: searchValue,
31509
+ setValue: setSearchValue,
31510
+ focusElement: valueListRef
31511
+ }), /* @__PURE__ */ jsxRuntime.jsx(FieldList$1, {
31512
+ ref: valueListRef,
31513
+ fields: filteredFields,
31514
+ search: searchValue,
31515
+ onClick: (value) => {
31516
+ updateFields(path, [...fields, value]);
31517
+ }
31518
+ })]
31519
+ }), option2.description ? /* @__PURE__ */ jsxRuntime.jsx(InfoHover, {
31520
+ info: option2.description
31521
+ }) : /* @__PURE__ */ jsxRuntime.jsx("div", {})]
31522
+ });
31523
+ }
31524
+ function FieldList$1({
31525
+ ref,
31526
+ fields,
31527
+ search,
31528
+ onClick
31529
+ }) {
31530
+ if (fields.length) {
31531
+ return /* @__PURE__ */ jsxRuntime.jsx("div", {
31532
+ ref,
31533
+ ...{
31534
+ className: "mly78zum5 mly1a02dak mly1jnr06f"
31535
+ },
31536
+ children: fields.map((field) => /* @__PURE__ */ jsxRuntime.jsx(FieldToken, {
31537
+ field,
31538
+ onClick: () => onClick(field.name),
31539
+ tooltip: /* @__PURE__ */ jsxRuntime.jsx(FieldHoverCard, {
31540
+ field,
31541
+ path: []
31542
+ }),
31543
+ tooltipProps: {
31544
+ side: "right",
31545
+ align: "start",
31546
+ sideOffset: 4,
31547
+ alignOffset: 24
31548
+ }
31549
+ }, field.name))
31550
+ });
31551
+ } else {
31552
+ if (search) {
31553
+ return /* @__PURE__ */ jsxRuntime.jsx("div", {
31554
+ ...{},
31555
+ "data-disabled": "true",
31556
+ children: "No matching fields"
31557
+ });
31558
+ }
31559
+ }
31560
+ }
31561
+ function ObjectEditor({
31562
+ view,
31563
+ name,
31564
+ path,
31565
+ current,
31566
+ option: option2,
31567
+ updateCurrent
31568
+ }) {
31569
+ const [isExpanded, setIsExpanded] = React.useState(path.length === 0);
31570
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
31571
+ children: [name ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
31572
+ children: [/* @__PURE__ */ jsxRuntime.jsxs("div", {
31573
+ ..._stylex.props(styles$s.label, styles$s.heading),
31574
+ children: [/* @__PURE__ */ jsxRuntime.jsx("label", {
31575
+ children: option2.title ?? name
31576
+ }), option2.description ? /* @__PURE__ */ jsxRuntime.jsx(InfoHover, {
31577
+ info: option2.description
31578
+ }) : null]
31579
+ }), /* @__PURE__ */ jsxRuntime.jsx(Button, {
31580
+ variant: "flat",
31581
+ size: "compact",
31582
+ onClick: () => setIsExpanded(!isExpanded),
31583
+ icon: isExpanded ? "chevronDown" : "chevronRight",
31584
+ tooltip: isExpanded ? "Collapse" : "Expand"
31585
+ })]
31586
+ }) : null, isExpanded ? Object.entries(option2.properties).map(([subName, subOption]) => {
31587
+ const key2 = [...path, name, subName].join(".");
31588
+ if (subOption.type === "boolean") {
31589
+ return /* @__PURE__ */ jsxRuntime.jsx(BooleanEditor, {
31590
+ view,
31591
+ name: subName,
31592
+ path: [...path, subName],
31593
+ option: subOption,
31594
+ current: current[subName],
31595
+ updateCurrent
31596
+ }, key2);
31597
+ } else if (subOption.type === "string") {
31598
+ return /* @__PURE__ */ jsxRuntime.jsx(StringEditor$1, {
31599
+ view,
31600
+ name: subName,
31601
+ path: [...path, subName],
31602
+ option: subOption,
31603
+ current: current[subName],
31604
+ updateCurrent
31605
+ }, key2);
31606
+ } else if (subOption.type === "number") {
31607
+ return /* @__PURE__ */ jsxRuntime.jsx(NumberEditor$1, {
31608
+ view,
31609
+ name: subName,
31610
+ path: [...path, subName],
31611
+ option: subOption,
31612
+ current: current[subName],
31613
+ updateCurrent
31614
+ }, key2);
31615
+ } else if (subOption.type === "object") {
31616
+ return /* @__PURE__ */ jsxRuntime.jsx(ObjectEditor, {
31617
+ view,
31618
+ name: subName,
31619
+ path: [...path, subName],
31620
+ option: subOption,
31621
+ current: current[subName] ?? {},
31622
+ updateCurrent
31623
+ }, key2);
31624
+ } else if (subOption.type === "array") {
31625
+ if (subOption.items.type === "string") {
31626
+ if ("subtype" in subOption.items && subOption.items.subtype === "field") {
31627
+ return /* @__PURE__ */ jsxRuntime.jsx(FieldEditor, {
31628
+ view,
31629
+ name: subName,
31630
+ path: [...path, subName],
31631
+ option: subOption,
31632
+ current: current[subName] ?? [],
31633
+ updateCurrent
31634
+ }, key2);
31635
+ } else {
31636
+ return /* @__PURE__ */ jsxRuntime.jsx(ArrayEditor, {
31637
+ view,
31638
+ name: subName,
31639
+ path: [...path, subName],
31640
+ option: subOption,
31641
+ current: current[subName] ?? [],
31642
+ updateCurrent
31643
+ }, key2);
31644
+ }
31645
+ } else {
31646
+ console.warn("Unsupported array type", subOption.items.type);
31647
+ }
31648
+ } else if (subOption.type === "oneOf") {
31649
+ return /* @__PURE__ */ jsxRuntime.jsx(OneOfEditor, {
31650
+ view,
31651
+ name: subName,
31652
+ path: [...path, subName],
31653
+ option: subOption,
31654
+ current: current[subName],
31655
+ updateCurrent
31656
+ }, key2);
31657
+ }
31658
+ return null;
31659
+ }) : null, /* @__PURE__ */ jsxRuntime.jsx("div", {
31660
+ ..._stylex.props(styles$s.divider)
31661
+ })]
31662
+ });
31663
+ }
31664
+ function VizEditor({
31665
+ rootQuery,
31666
+ view,
31667
+ plugin,
31668
+ setOpen
31669
+ }) {
31670
+ const {
31671
+ setQuery
31672
+ } = React.useContext(QueryEditorContext);
31673
+ const [current, setCurrent] = React.useState(plugin.getSettings());
31674
+ console.info("RendererEditor current settings:", current);
31675
+ const schema = plugin.getSchema();
31676
+ const updateCurrent = (path, value) => {
31677
+ const newCurrent = {
31678
+ ...current
31679
+ };
31680
+ let target = newCurrent;
31681
+ for (let i2 = 0; i2 < path.length - 1; i2++) {
31682
+ if (!(path[i2] in target)) {
31683
+ target[path[i2]] = {};
31684
+ }
31685
+ target = target[path[i2]];
31686
+ }
31687
+ target[path[path.length - 1]] = value;
31688
+ setCurrent(newCurrent);
31689
+ };
31690
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", {
31691
+ ..._stylex.props(styles$s.editor),
31692
+ children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
31693
+ ..._stylex.props(styles$s.editorGrid),
31694
+ children: /* @__PURE__ */ jsxRuntime.jsx(ObjectEditor, {
31695
+ view,
31696
+ name: "",
31697
+ path: [],
31698
+ option: schema,
31699
+ current,
31700
+ updateCurrent
31701
+ })
31702
+ }), /* @__PURE__ */ jsxRuntime.jsxs("div", {
31703
+ ..._stylex.props(styles$s.editorRow),
31704
+ children: [/* @__PURE__ */ jsxRuntime.jsx(Button, {
31705
+ label: "Cancel",
31706
+ onClick: () => {
31707
+ setOpen(false);
31708
+ },
31709
+ customStyle: styles$s.editorCell
31710
+ }), /* @__PURE__ */ jsxRuntime.jsx(Button, {
31711
+ variant: "primary",
31712
+ label: "Apply",
31713
+ onClick: () => {
31714
+ const tag = plugin.settingsToTag(current);
31715
+ const value = tag.toString();
31716
+ const annotations = view.getOrAddAnnotations();
31717
+ const old = annotations.items.find((annotation) => annotation.value.startsWith(RENDERER_PREFIX + "viz"));
31718
+ if (old) {
31719
+ annotations.remove(old);
31720
+ }
31721
+ view.getOrAddAnnotations().add(new QB.ASTAnnotation({
31722
+ value
31723
+ }));
31724
+ setQuery == null ? void 0 : setQuery(rootQuery.build());
31725
+ setOpen(false);
31726
+ },
31727
+ customStyle: styles$s.editorCell
31728
+ })]
31729
+ })]
31730
+ });
31731
+ }
31732
+ const dialogStyles = {
31733
+ displayNone: {
31734
+ display: "mly1s85apg",
31735
+ $$css: true
31736
+ },
31737
+ overlay: {
31738
+ background: "mly5uxqc1",
31739
+ backgroundAttachment: null,
31740
+ backgroundClip: null,
31741
+ backgroundColor: null,
31742
+ backgroundImage: null,
31743
+ backgroundOrigin: null,
31744
+ backgroundPosition: null,
31745
+ backgroundPositionX: null,
31746
+ backgroundPositionY: null,
31747
+ backgroundRepeat: null,
31748
+ backgroundSize: null,
31749
+ position: "mlyixxii4",
31750
+ top: "mly13vifvy",
31751
+ left: "mlyu96u03",
31752
+ right: "mly3m8u43",
31753
+ insetInlineStart: null,
31754
+ insetInlineEnd: null,
31755
+ bottom: "mly1ey2m1c",
31756
+ display: "mlyrvj5dj",
31757
+ placeItems: "mly1ku5rj1",
31758
+ alignItems: null,
31759
+ justifyItems: null,
31760
+ zIndex: "mly11uqc5h",
31761
+ $$css: true
31762
+ },
31763
+ title: {
31764
+ fontSize: "mly1j61zf2",
31765
+ margin: "mly1ghz6dp",
31766
+ marginInline: null,
31767
+ marginInlineStart: null,
31768
+ marginLeft: null,
31769
+ marginInlineEnd: null,
31770
+ marginRight: null,
31771
+ marginBlock: null,
31772
+ marginTop: null,
31773
+ marginBottom: null,
31774
+ display: "mly78zum5",
31775
+ justifyContent: "mly1qughib",
31776
+ alignItems: "mly6s0dn4",
31777
+ borderBottom: "mlyllpv0l",
31778
+ borderBottomWidth: null,
31779
+ borderBottomStyle: null,
31780
+ borderBottomColor: null,
31781
+ lineHeight: "mly1rl49lg",
31782
+ $$css: true
31783
+ },
31784
+ close: {
31785
+ border: "mly1gs6z28",
31786
+ borderWidth: null,
31787
+ borderInlineWidth: null,
31788
+ borderInlineStartWidth: null,
31789
+ borderLeftWidth: null,
31790
+ borderInlineEndWidth: null,
31791
+ borderRightWidth: null,
31792
+ borderBlockWidth: null,
31793
+ borderTopWidth: null,
31794
+ borderBottomWidth: null,
31795
+ borderStyle: null,
31796
+ borderInlineStyle: null,
31797
+ borderInlineStartStyle: null,
31798
+ borderLeftStyle: null,
31799
+ borderInlineEndStyle: null,
31800
+ borderRightStyle: null,
31801
+ borderBlockStyle: null,
31802
+ borderTopStyle: null,
31803
+ borderBottomStyle: null,
31804
+ borderColor: null,
31805
+ borderInlineColor: null,
31806
+ borderInlineStartColor: null,
31807
+ borderLeftColor: null,
31808
+ borderInlineEndColor: null,
31809
+ borderRightColor: null,
31810
+ borderBlockColor: null,
31811
+ borderTopColor: null,
31812
+ borderBottomColor: null,
31813
+ background: "mly1md70p1 mly14hn1a8 mlywghvya",
31814
+ backgroundAttachment: null,
31815
+ backgroundClip: null,
31816
+ backgroundColor: null,
31817
+ backgroundImage: null,
31818
+ backgroundOrigin: null,
31819
+ backgroundPosition: null,
31820
+ backgroundPositionX: null,
31821
+ backgroundPositionY: null,
31822
+ backgroundRepeat: null,
31823
+ backgroundSize: null,
31824
+ borderRadius: "mly12oqio5",
31825
+ borderStartStartRadius: null,
31826
+ borderStartEndRadius: null,
31827
+ borderEndStartRadius: null,
31828
+ borderEndEndRadius: null,
31829
+ borderTopLeftRadius: null,
31830
+ borderTopRightRadius: null,
31831
+ borderBottomLeftRadius: null,
31832
+ borderBottomRightRadius: null,
31833
+ $$css: true
31834
+ },
31835
+ content: {
31836
+ display: "mly78zum5",
31837
+ flexDirection: "mlydt5ytf",
31838
+ boxShadow: "mly5n1uv4",
31839
+ backgroundColor: "mly12peec7",
31840
+ borderRadius: "mlyur7f20",
31841
+ borderStartStartRadius: null,
31842
+ borderStartEndRadius: null,
31843
+ borderEndStartRadius: null,
31844
+ borderEndEndRadius: null,
31845
+ borderTopLeftRadius: null,
31846
+ borderTopRightRadius: null,
31847
+ borderBottomLeftRadius: null,
31848
+ borderBottomRightRadius: null,
31849
+ padding: "mlye8ttls",
31850
+ paddingInline: null,
31851
+ paddingStart: null,
31852
+ paddingLeft: null,
31853
+ paddingEnd: null,
31854
+ paddingRight: null,
31855
+ paddingBlock: null,
31856
+ paddingTop: null,
31857
+ paddingBottom: null,
31858
+ minWidth: "mlylm99nl",
31859
+ maxWidth: "mly1jkqq1h",
31860
+ gap: "mly167g77z",
31861
+ rowGap: null,
31862
+ columnGap: null,
31863
+ $$css: true
31864
+ },
31865
+ editor: {
31866
+ width: "mlyqyf9gi",
31867
+ display: "mly78zum5",
31868
+ flexDirection: "mlydt5ytf",
31869
+ gap: "mly167g77z",
31870
+ rowGap: null,
31871
+ columnGap: null,
31872
+ $$css: true
31873
+ },
31874
+ editorRow: {
31875
+ display: "mly78zum5",
31876
+ gap: "mly167g77z",
31877
+ rowGap: null,
31878
+ columnGap: null,
31879
+ $$css: true
31880
+ },
31881
+ editorCell: {
31882
+ flexGrow: "mly1iyjqo2",
31883
+ $$css: true
31884
+ },
31885
+ input: {
31886
+ border: "mly2yh2zd",
31887
+ borderWidth: null,
31888
+ borderInlineWidth: null,
31889
+ borderInlineStartWidth: null,
31890
+ borderLeftWidth: null,
31891
+ borderInlineEndWidth: null,
31892
+ borderRightWidth: null,
31893
+ borderBlockWidth: null,
31894
+ borderTopWidth: null,
31895
+ borderBottomWidth: null,
31896
+ borderStyle: null,
31897
+ borderInlineStyle: null,
31898
+ borderInlineStartStyle: null,
31899
+ borderLeftStyle: null,
31900
+ borderInlineEndStyle: null,
31901
+ borderRightStyle: null,
31902
+ borderBlockStyle: null,
31903
+ borderTopStyle: null,
31904
+ borderBottomStyle: null,
31905
+ borderColor: null,
31906
+ borderInlineColor: null,
31907
+ borderInlineStartColor: null,
31908
+ borderLeftColor: null,
31909
+ borderInlineEndColor: null,
31910
+ borderRightColor: null,
31911
+ borderBlockColor: null,
31912
+ borderTopColor: null,
31913
+ borderBottomColor: null,
31914
+ color: "mlyizdh9v",
31915
+ padding: "mly9cpjcd",
31916
+ paddingInline: null,
31917
+ paddingStart: null,
31918
+ paddingLeft: null,
31919
+ paddingEnd: null,
31920
+ paddingRight: null,
31921
+ paddingBlock: null,
31922
+ paddingTop: null,
31923
+ paddingBottom: null,
31924
+ borderRadius: "mly1sxf85j",
31925
+ borderStartStartRadius: null,
31926
+ borderStartEndRadius: null,
31927
+ borderEndStartRadius: null,
31928
+ borderEndEndRadius: null,
31929
+ borderTopLeftRadius: null,
31930
+ borderTopRightRadius: null,
31931
+ borderBottomLeftRadius: null,
31932
+ borderBottomRightRadius: null,
31933
+ $$css: true
31934
+ }
31935
+ };
31936
+ function VizEditorDialog({
31937
+ rootQuery,
31938
+ plugin,
31939
+ view,
31940
+ customStyle,
31941
+ open,
31942
+ setOpen
31943
+ }) {
31944
+ if (!plugin || !open) {
31945
+ return null;
31946
+ }
31947
+ return /* @__PURE__ */ jsxRuntime.jsx(Root, {
31948
+ onOpenChange: (open2) => setOpen(open2),
31949
+ open,
31950
+ children: /* @__PURE__ */ jsxRuntime.jsx(Portal, {
31951
+ children: /* @__PURE__ */ jsxRuntime.jsx(Overlay, {
31952
+ ..._stylex.props(dialogStyles.overlay),
31953
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Content$1, {
31954
+ ..._stylex.props(fontStyles.body, dialogStyles.content, styles$p.content, customStyle),
31955
+ children: [/* @__PURE__ */ jsxRuntime.jsxs(Title, {
31956
+ ..._stylex.props(dialogStyles.title),
31957
+ children: ["Visualization Settings", /* @__PURE__ */ jsxRuntime.jsx(Close, {
31958
+ ..._stylex.props(dialogStyles.close),
31959
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icon, {
31960
+ name: "clear"
31961
+ })
31962
+ })]
31963
+ }), /* @__PURE__ */ jsxRuntime.jsx(Description, {
31964
+ ..._stylex.props(dialogStyles.displayNone),
31965
+ children: "Edit visualization parameters"
31966
+ }), /* @__PURE__ */ jsxRuntime.jsx(VizEditor, {
31967
+ rootQuery,
31968
+ view,
31969
+ plugin,
31970
+ setOpen
31971
+ })]
31972
+ })
31973
+ })
31974
+ })
31975
+ });
31976
+ }
31977
+ const styles$p = {
31978
+ content: {
31979
+ maxWidth: "mly14zcgw3",
31980
+ width: "mly14rvwrp",
31981
+ maxHeight: "mly1l4ul0t",
31982
+ $$css: true
31983
+ }
31984
+ };
31985
+ function Visualization$1({
31986
+ rootQuery,
30641
31987
  view
30642
31988
  }) {
30643
- var _a2;
30644
31989
  const {
30645
31990
  setQuery
30646
31991
  } = React.useContext(QueryEditorContext);
30647
- const currentTag = view.getTag();
30648
- const rendererTag = view.getTag(RENDERER_PREFIX);
30649
- const currentRenderer = ((_a2 = rendererTag.tag("viz")) == null ? void 0 : _a2.text()) ?? legacyToViz(tagToRenderer(currentTag) ?? "table");
30650
- const setRenderer = (renderer) => {
30651
- view.setTagProperty(["viz"], renderer, RENDERER_PREFIX);
31992
+ const renderer = React.useMemo(() => new render.MalloyRenderer(), []);
31993
+ const [currentRenderer, setCurrentRenderer] = React.useState("table");
31994
+ const [plugin, setPlugin] = React.useState();
31995
+ const [error, setError] = React.useState("");
31996
+ const [open, setOpen] = React.useState(false);
31997
+ const tag = view.getTag().toString();
31998
+ React.useEffect(() => {
31999
+ var _a2;
32000
+ setError("");
32001
+ const viz = renderer.createViz({
32002
+ onError: (error2) => {
32003
+ console.error("Malloy render error", error2);
32004
+ setError(error2.message);
32005
+ }
32006
+ });
32007
+ viz.setResult({
32008
+ schema: view.definition.getOutputSchema(),
32009
+ annotations: tag.split("\n").map((value) => ({
32010
+ value
32011
+ })),
32012
+ connection_name: ""
32013
+ });
32014
+ const metadata = viz.getMetadata();
32015
+ if (metadata) {
32016
+ const plugin2 = viz.getActivePlugin(metadata.getRootField().key);
32017
+ if (plugin2) {
32018
+ if (render.isCoreVizPluginInstance(plugin2)) {
32019
+ setCurrentRenderer(plugin2.name);
32020
+ setPlugin(plugin2);
32021
+ return;
32022
+ }
32023
+ if (plugin2.name === "error") {
32024
+ setError(plugin2.getMetadata().message);
32025
+ }
32026
+ }
32027
+ }
32028
+ const currentTag = view.getTag();
32029
+ const rendererTag = view.getTag(RENDERER_PREFIX);
32030
+ const currentRenderer2 = ((_a2 = rendererTag.tag("viz")) == null ? void 0 : _a2.text()) ?? legacyToViz(tagToRenderer(currentTag) ?? "table");
32031
+ setCurrentRenderer(currentRenderer2);
32032
+ setPlugin(void 0);
32033
+ }, [renderer, view, tag]);
32034
+ const updateViz = (renderer2) => {
32035
+ view.setTagProperty(["viz"], renderer2, RENDERER_PREFIX);
30652
32036
  setQuery == null ? void 0 : setQuery(rootQuery.build());
30653
32037
  };
30654
32038
  const items = VIZ_RENDERERS.map((viz) => ({
@@ -30657,30 +32041,48 @@ function Visualization$1({
30657
32041
  }),
30658
32042
  label: snakeToTitle(viz),
30659
32043
  value: viz,
30660
- onClick: () => setRenderer(viz)
32044
+ onClick: () => updateViz(viz)
30661
32045
  }));
30662
32046
  const tokens2 = [/* @__PURE__ */ jsxRuntime.jsx(SelectorToken, {
30663
- customStyle: styles$q.first,
32047
+ customStyle: styles$o.first,
30664
32048
  icon: `viz_${currentRenderer}`,
30665
32049
  value: currentRenderer,
30666
32050
  items,
30667
- onChange: (viz) => setRenderer(viz)
32051
+ onChange: (viz) => updateViz(viz)
30668
32052
  }, "first")];
30669
- const options = VISUALIZATION_OPTIONS[currentRenderer];
30670
- if (options) {
30671
- tokens2.push(/* @__PURE__ */ jsxRuntime.jsx(RendererPopover, {
30672
- viz: currentRenderer,
30673
- options,
30674
- view,
30675
- rootQuery
30676
- }, "menu"));
32053
+ if (plugin) {
32054
+ tokens2.push(/* @__PURE__ */ jsxRuntime.jsx(Token, {
32055
+ icon: "gear",
32056
+ onClick: () => setOpen(true),
32057
+ customStyle: styles$o.trigger,
32058
+ tooltip: "Edit Settings..."
32059
+ }, "gear"));
32060
+ }
32061
+ if (error) {
32062
+ tokens2.push(/* @__PURE__ */ jsxRuntime.jsx(Token, {
32063
+ icon: "warning",
32064
+ tooltip: error,
32065
+ customStyle: styles$o.trigger
32066
+ }));
30677
32067
  }
30678
- return /* @__PURE__ */ jsxRuntime.jsx(TokenGroup, {
30679
- customStyle: styles$q.group,
30680
- children: tokens2
32068
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
32069
+ children: [/* @__PURE__ */ jsxRuntime.jsx(TokenGroup, {
32070
+ customStyle: styles$o.group,
32071
+ children: tokens2
32072
+ }), /* @__PURE__ */ jsxRuntime.jsx(VizEditorDialog, {
32073
+ open,
32074
+ setOpen,
32075
+ rootQuery,
32076
+ plugin,
32077
+ view
32078
+ })]
30681
32079
  });
30682
32080
  }
30683
- const styles$q = {
32081
+ const styles$o = {
32082
+ trigger: {
32083
+ height: "mly1ktj5wk",
32084
+ $$css: true
32085
+ },
30684
32086
  group: {
30685
32087
  width: "mlyh8yej3",
30686
32088
  gridTemplateColumns: "mly52fmzj",
@@ -30713,7 +32115,7 @@ function ViewAttributeTable({
30713
32115
  }) {
30714
32116
  const dimensions = viewInfo.schema.fields.filter((f2) => f2.kind === "dimension");
30715
32117
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
30716
- ..._stylex.props(styles$p.attributeTableContainer, style),
32118
+ ..._stylex.props(styles$n.attributeTableContainer, style),
30717
32119
  children: /* @__PURE__ */ jsxRuntime.jsx("table", {
30718
32120
  ...{
30719
32121
  className: "mly1mwwwfo mly9f619 mlyh8yej3 mly5yr21d"
@@ -30751,9 +32153,9 @@ function ViewAttributeTableRow({
30751
32153
  className: "mlydpxx8g"
30752
32154
  },
30753
32155
  children: [/* @__PURE__ */ jsxRuntime.jsx("td", {
30754
- ..._stylex.props(styles$p.attributeTableKeyCell, fontStyles.supporting),
32156
+ ..._stylex.props(styles$n.attributeTableKeyCell, fontStyles.supporting),
30755
32157
  children: /* @__PURE__ */ jsxRuntime.jsx("div", {
30756
- ..._stylex.props(styles$p.attributeTableKeyCellContent, fontStyles.supporting),
32158
+ ..._stylex.props(styles$n.attributeTableKeyCellContent, fontStyles.supporting),
30757
32159
  children: attribute
30758
32160
  })
30759
32161
  }), /* @__PURE__ */ jsxRuntime.jsx("td", {
@@ -30764,7 +32166,7 @@ function ViewAttributeTableRow({
30764
32166
  })]
30765
32167
  });
30766
32168
  }
30767
- const styles$p = {
32169
+ const styles$n = {
30768
32170
  attributeTableContainer: {
30769
32171
  padding: "mlye8ttls",
30770
32172
  paddingInline: null,
@@ -30896,12 +32298,12 @@ function RichText({
30896
32298
  });
30897
32299
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
30898
32300
  ref,
30899
- ..._stylex.props(multiLine && styles$o.preWrap, multiLine && styles$o.breakWord, customStyle),
32301
+ ..._stylex.props(multiLine && styles$m.preWrap, multiLine && styles$m.breakWord, customStyle),
30900
32302
  ...props2,
30901
32303
  children: formatted
30902
32304
  });
30903
32305
  }
30904
- const styles$o = {
32306
+ const styles$m = {
30905
32307
  preWrap: {
30906
32308
  whiteSpace: "mly126k92a",
30907
32309
  $$css: true
@@ -30930,7 +32332,7 @@ function HoverText({
30930
32332
  onMouseEnter: () => setIsTriggerHovered(true),
30931
32333
  onMouseLeave: () => setIsTriggerHovered(false),
30932
32334
  onPointerMove: (e) => e.preventDefault(),
30933
- customStyle: [fontStyles.supporting, styles$n.text],
32335
+ customStyle: [fontStyles.supporting, styles$l.text],
30934
32336
  children: text2
30935
32337
  })
30936
32338
  }), /* @__PURE__ */ jsxRuntime.jsx(Portal$4, {
@@ -30949,7 +32351,7 @@ function HoverText({
30949
32351
  })]
30950
32352
  });
30951
32353
  }
30952
- const styles$n = {
32354
+ const styles$l = {
30953
32355
  text: {
30954
32356
  overflow: "mlyb3r6kr",
30955
32357
  overflowX: null,
@@ -30960,45 +32362,6 @@ const styles$n = {
30960
32362
  $$css: true
30961
32363
  }
30962
32364
  };
30963
- function HoverCard({
30964
- children,
30965
- customStyle
30966
- }) {
30967
- return /* @__PURE__ */ jsxRuntime.jsx("div", {
30968
- ..._stylex.props(styles$m.container, fontStyles.body, customStyle),
30969
- children
30970
- });
30971
- }
30972
- const styles$m = {
30973
- container: {
30974
- boxShadow: "mly5n1uv4",
30975
- backgroundColor: "mly12peec7",
30976
- borderRadius: "mly4pepcl",
30977
- borderStartStartRadius: null,
30978
- borderStartEndRadius: null,
30979
- borderEndStartRadius: null,
30980
- borderEndEndRadius: null,
30981
- borderTopLeftRadius: null,
30982
- borderTopRightRadius: null,
30983
- borderBottomLeftRadius: null,
30984
- borderBottomRightRadius: null,
30985
- padding: "mlyc7ga6q",
30986
- paddingInline: null,
30987
- paddingStart: null,
30988
- paddingLeft: null,
30989
- paddingEnd: null,
30990
- paddingRight: null,
30991
- paddingBlock: null,
30992
- paddingTop: null,
30993
- paddingBottom: null,
30994
- display: "mly78zum5",
30995
- flexDirection: "mlydt5ytf",
30996
- gap: "mly167g77z",
30997
- rowGap: null,
30998
- columnGap: null,
30999
- $$css: true
31000
- }
31001
- };
31002
32365
  function FieldHoverCard({
31003
32366
  field,
31004
32367
  path
@@ -31015,7 +32378,7 @@ function FieldHoverCard({
31015
32378
  details = /* @__PURE__ */ jsxRuntime.jsx(ViewAttributeTable, {
31016
32379
  viewInfo: field,
31017
32380
  isCompact: true,
31018
- style: styles$l.viewAttributeTable
32381
+ style: styles$k.viewAttributeTable
31019
32382
  });
31020
32383
  } else if (field.kind === "dimension") {
31021
32384
  details = /* @__PURE__ */ jsxRuntime.jsx(TopValuesTable, {
@@ -31024,7 +32387,7 @@ function FieldHoverCard({
31024
32387
  });
31025
32388
  }
31026
32389
  return /* @__PURE__ */ jsxRuntime.jsxs(HoverCard, {
31027
- customStyle: styles$l.container,
32390
+ customStyle: styles$k.container,
31028
32391
  children: [/* @__PURE__ */ jsxRuntime.jsxs("div", {
31029
32392
  ref,
31030
32393
  children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
@@ -31035,10 +32398,10 @@ function FieldHoverCard({
31035
32398
  field
31036
32399
  })
31037
32400
  }), /* @__PURE__ */ jsxRuntime.jsx("div", {
31038
- ..._stylex.props(fontStyles.supporting, styles$l.path),
32401
+ ..._stylex.props(fontStyles.supporting, styles$k.path),
31039
32402
  children: pathString
31040
32403
  }), /* @__PURE__ */ jsxRuntime.jsx("div", {
31041
- ..._stylex.props(fontStyles.emphasized, styles$l.title),
32404
+ ..._stylex.props(fontStyles.emphasized, styles$k.title),
31042
32405
  children: field.name
31043
32406
  }), description && /* @__PURE__ */ jsxRuntime.jsx(HoverText, {
31044
32407
  text: description,
@@ -31049,7 +32412,7 @@ function FieldHoverCard({
31049
32412
  })]
31050
32413
  });
31051
32414
  }
31052
- const styles$l = {
32415
+ const styles$k = {
31053
32416
  container: {
31054
32417
  width: "mlybl57os",
31055
32418
  maxHeight: "mlyq3t0pi",
@@ -31226,335 +32589,6 @@ function BooleanFilterCore({
31226
32589
  })
31227
32590
  });
31228
32591
  }
31229
- function useClickOutside(refOrRefs, handler) {
31230
- React.useEffect(() => {
31231
- const refs = Array.isArray(refOrRefs) ? refOrRefs : [refOrRefs];
31232
- let down = false;
31233
- const isInOneElement = (ref, event) => {
31234
- return !ref.current || event.target instanceof Element && ref.current.contains(event.target);
31235
- };
31236
- const isInElement = (event) => {
31237
- return refs.some((ref) => isInOneElement(ref, event));
31238
- };
31239
- const onMouseUp = (event) => {
31240
- if (!down || isInElement(event)) return;
31241
- handler(event);
31242
- down = false;
31243
- };
31244
- const onMouseDown = (event) => {
31245
- if (isInElement(event)) return;
31246
- down = true;
31247
- };
31248
- document.addEventListener("mouseup", onMouseUp);
31249
- document.addEventListener("mousedown", onMouseDown);
31250
- return () => {
31251
- document.removeEventListener("mouseup", onMouseUp);
31252
- document.removeEventListener("mousedown", onMouseDown);
31253
- };
31254
- }, [refOrRefs, handler]);
31255
- }
31256
- const PillInput = ({
31257
- values,
31258
- setValues,
31259
- autoFocus,
31260
- placeholder,
31261
- type = "text",
31262
- value: controlledValue,
31263
- setValue: setControlledValue,
31264
- focusElement,
31265
- color = DEFAULT_TOKEN_COLOR,
31266
- customStyle
31267
- }) => {
31268
- const [uncontrolledValue, setUncontrolledValue] = React.useState("");
31269
- const [_focused, setFocused] = React.useState(false);
31270
- const inp = React.useRef(null);
31271
- const ref = React.useRef(null);
31272
- const [selectedPill, setSelectedPill] = React.useState(void 0);
31273
- const pillRefs = React.useRef([]);
31274
- const value = controlledValue || uncontrolledValue;
31275
- const setValue = setControlledValue || setUncontrolledValue;
31276
- const deletePill = React.useCallback((idx) => {
31277
- var _a2;
31278
- const newValues = [...values];
31279
- newValues.splice(idx, 1);
31280
- setValues(newValues);
31281
- if (selectedPill === 0) {
31282
- if (values.length === 1) {
31283
- setSelectedPill(void 0);
31284
- (_a2 = inp.current) == null ? void 0 : _a2.focus();
31285
- } else {
31286
- setSelectedPill(0);
31287
- }
31288
- } else {
31289
- setSelectedPill(idx - 1);
31290
- }
31291
- }, [selectedPill, setValues, values]);
31292
- const pills = React.useMemo(() => {
31293
- pillRefs.current = new Array(values.length);
31294
- return values.map((value2, index2) => /* @__PURE__ */ jsxRuntime.jsx(Pill, {
31295
- color,
31296
- onClick: () => {
31297
- setSelectedPill(index2);
31298
- },
31299
- onDelete: () => deletePill(index2),
31300
- forwardRef: (ref2) => {
31301
- pillRefs.current[index2] = ref2;
31302
- },
31303
- children: value2
31304
- }, value2));
31305
- }, [color, deletePill, values]);
31306
- React.useEffect(() => {
31307
- var _a2;
31308
- if (selectedPill !== void 0) {
31309
- (_a2 = pillRefs.current[selectedPill]) == null ? void 0 : _a2.focus();
31310
- }
31311
- }, [pills, selectedPill]);
31312
- const onKeyUp = (event) => {
31313
- var _a2, _b2;
31314
- if (event.key === "Backspace") {
31315
- if (selectedPill !== void 0) {
31316
- deletePill(selectedPill);
31317
- }
31318
- } else if (event.key === "ArrowRight") {
31319
- if (selectedPill === values.length - 1) {
31320
- setSelectedPill(void 0);
31321
- (_a2 = inp.current) == null ? void 0 : _a2.focus();
31322
- } else if (selectedPill !== void 0) {
31323
- setSelectedPill(selectedPill + 1);
31324
- }
31325
- } else if (event.key === "ArrowLeft") {
31326
- if (selectedPill !== void 0 && selectedPill > 0) {
31327
- setSelectedPill(selectedPill - 1);
31328
- }
31329
- } else {
31330
- (_b2 = inp.current) == null ? void 0 : _b2.focus();
31331
- }
31332
- };
31333
- const commitValue = () => {
31334
- if (value.length > 0 && !values.includes(value)) {
31335
- setValues([...values, value]);
31336
- setValue("");
31337
- }
31338
- };
31339
- useClickOutside(focusElement ? [ref, focusElement] : ref, () => {
31340
- setFocused(false);
31341
- commitValue();
31342
- });
31343
- return /* @__PURE__ */ jsxRuntime.jsx("div", {
31344
- ..._stylex.props(fontStyles.body, styles$k.main),
31345
- children: /* @__PURE__ */ jsxRuntime.jsx(ScrollableArea, {
31346
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
31347
- ..._stylex.props(styles$k.content, customStyle),
31348
- onKeyUp,
31349
- onClick: () => {
31350
- var _a2;
31351
- return (_a2 = inp.current) == null ? void 0 : _a2.focus();
31352
- },
31353
- ref,
31354
- children: [pills, /* @__PURE__ */ jsxRuntime.jsx("input", {
31355
- ...{
31356
- className: "mly1gs6z28 mly1a2a7pz mly6icuqf mlyif65rj mlyayvuls mly83z2og mly1onzeue mly195ery5 mly1iyjqo2"
31357
- },
31358
- ref: inp,
31359
- type,
31360
- placeholder: values.length === 0 ? placeholder : "",
31361
- value,
31362
- size: 1,
31363
- onChange: (event) => {
31364
- setValue(event.target.value);
31365
- },
31366
- onKeyDown: (event) => {
31367
- if (event.key === "Enter") {
31368
- if (value !== "") {
31369
- commitValue();
31370
- event.stopPropagation();
31371
- event.preventDefault();
31372
- }
31373
- }
31374
- },
31375
- onKeyUp: (event) => {
31376
- var _a2, _b2, _c2, _d;
31377
- if (event.key === "Backspace") {
31378
- if (value === "" && values.length > 0) {
31379
- commitValue();
31380
- (_a2 = inp.current) == null ? void 0 : _a2.blur();
31381
- setSelectedPill(values.length - 1);
31382
- }
31383
- } else if (event.key === "ArrowLeft") {
31384
- if (((_b2 = inp.current) == null ? void 0 : _b2.selectionStart) === 0 || ((_c2 = inp.current) == null ? void 0 : _c2.selectionStart) === null) {
31385
- commitValue();
31386
- (_d = inp.current) == null ? void 0 : _d.blur();
31387
- setSelectedPill(values.length - 1);
31388
- event.preventDefault();
31389
- event.stopPropagation();
31390
- }
31391
- }
31392
- },
31393
- onFocus: () => {
31394
- setFocused(true);
31395
- setSelectedPill(void 0);
31396
- },
31397
- autoFocus
31398
- })]
31399
- })
31400
- })
31401
- });
31402
- };
31403
- const Pill = ({
31404
- children,
31405
- color = DEFAULT_TOKEN_COLOR,
31406
- forwardRef,
31407
- onClick,
31408
- onDelete
31409
- }) => {
31410
- return /* @__PURE__ */ jsxRuntime.jsxs("div", {
31411
- onClick,
31412
- tabIndex: 0,
31413
- ref: forwardRef,
31414
- ..._stylex.props(styles$k.pill, colorVariants[color]),
31415
- children: [children, /* @__PURE__ */ jsxRuntime.jsx("div", {
31416
- title: "Remove",
31417
- ...{
31418
- className: "mly3nfvp2"
31419
- },
31420
- children: /* @__PURE__ */ jsxRuntime.jsx(SvgClear, {
31421
- onClick: () => onDelete(),
31422
- ...{
31423
- className: "mly6jxa94 mly1v9usgg"
31424
- }
31425
- })
31426
- })]
31427
- });
31428
- };
31429
- const styles$k = {
31430
- main: {
31431
- borderRadius: "mly12oqio5",
31432
- borderStartStartRadius: null,
31433
- borderStartEndRadius: null,
31434
- borderEndStartRadius: null,
31435
- borderEndEndRadius: null,
31436
- borderTopLeftRadius: null,
31437
- borderTopRightRadius: null,
31438
- borderBottomLeftRadius: null,
31439
- borderBottomRightRadius: null,
31440
- border: "mlyvckdp7",
31441
- borderWidth: null,
31442
- borderInlineWidth: null,
31443
- borderInlineStartWidth: null,
31444
- borderLeftWidth: null,
31445
- borderInlineEndWidth: null,
31446
- borderRightWidth: null,
31447
- borderBlockWidth: null,
31448
- borderTopWidth: null,
31449
- borderBottomWidth: null,
31450
- borderStyle: null,
31451
- borderInlineStyle: null,
31452
- borderInlineStartStyle: null,
31453
- borderLeftStyle: null,
31454
- borderInlineEndStyle: null,
31455
- borderRightStyle: null,
31456
- borderBlockStyle: null,
31457
- borderTopStyle: null,
31458
- borderBottomStyle: null,
31459
- borderColor: null,
31460
- borderInlineColor: null,
31461
- borderInlineStartColor: null,
31462
- borderLeftColor: null,
31463
- borderInlineEndColor: null,
31464
- borderRightColor: null,
31465
- borderBlockColor: null,
31466
- borderTopColor: null,
31467
- borderBottomColor: null,
31468
- padding: "mlybsehbd",
31469
- paddingInline: null,
31470
- paddingStart: null,
31471
- paddingLeft: null,
31472
- paddingEnd: null,
31473
- paddingRight: null,
31474
- paddingBlock: null,
31475
- paddingTop: null,
31476
- paddingBottom: null,
31477
- display: "mlyrvj5dj",
31478
- minHeight: "mly2lwn1j",
31479
- $$css: true
31480
- },
31481
- content: {
31482
- outline: "mly1a2a7pz",
31483
- outlineColor: null,
31484
- outlineOffset: null,
31485
- outlineStyle: null,
31486
- outlineWidth: null,
31487
- display: "mly78zum5",
31488
- flexWrap: "mly1a02dak",
31489
- gap: "mly1ed6fcf",
31490
- rowGap: null,
31491
- columnGap: null,
31492
- borderColor: "mly1akygb0 mlyetl2wx",
31493
- borderInlineColor: null,
31494
- borderInlineStartColor: null,
31495
- borderLeftColor: null,
31496
- borderInlineEndColor: null,
31497
- borderRightColor: null,
31498
- borderBlockColor: null,
31499
- borderTopColor: null,
31500
- borderBottomColor: null,
31501
- $$css: true
31502
- },
31503
- pill: {
31504
- backgroundColor: "mlyy9rfsq",
31505
- borderRadius: "mly1sxf85j",
31506
- borderStartStartRadius: null,
31507
- borderStartEndRadius: null,
31508
- borderEndStartRadius: null,
31509
- borderEndEndRadius: null,
31510
- borderTopLeftRadius: null,
31511
- borderTopRightRadius: null,
31512
- borderBottomLeftRadius: null,
31513
- borderBottomRightRadius: null,
31514
- color: "mly1xre2ib",
31515
- display: "mly78zum5",
31516
- alignItems: "mly6s0dn4",
31517
- gap: "mly1nejdyq",
31518
- rowGap: null,
31519
- columnGap: null,
31520
- padding: "mly1e41zw8",
31521
- paddingInline: null,
31522
- paddingStart: null,
31523
- paddingLeft: null,
31524
- paddingEnd: null,
31525
- paddingRight: null,
31526
- paddingBlock: null,
31527
- paddingTop: null,
31528
- paddingBottom: null,
31529
- textTransform: "mly6mezaz",
31530
- cursor: "mly1ypdohk",
31531
- height: "mly1qx5ct2",
31532
- whiteSpace: "mlyuxw1ft",
31533
- $$css: true
31534
- }
31535
- };
31536
- const colorVariants = {
31537
- default: {
31538
- "--mlyvygx4q": "mly1izbou4",
31539
- "--mly13n7235": "mly8bgh0r",
31540
- $$css: true
31541
- },
31542
- purple: {
31543
- "--mlyvygx4q": "mly1f8soc4",
31544
- "--mly13n7235": "mly1r5zvhd",
31545
- $$css: true
31546
- },
31547
- green: {
31548
- "--mlyvygx4q": "mlyf8wvcd",
31549
- "--mly13n7235": "mly1u6t2w6",
31550
- $$css: true
31551
- },
31552
- cyan: {
31553
- "--mlyvygx4q": "mlyrtwgpv",
31554
- "--mly13n7235": "mlys5r2en",
31555
- $$css: true
31556
- }
31557
- };
31558
32592
  function useSearch(searchTerm, fieldPath) {
31559
32593
  const {
31560
32594
  topValues
@@ -31596,15 +32630,17 @@ function useSearch(searchTerm, fieldPath) {
31596
32630
  function ValueList({
31597
32631
  onClick,
31598
32632
  search,
32633
+ filter,
31599
32634
  fieldPath,
31600
32635
  ref,
31601
32636
  customStyle,
31602
- showPath = true
32637
+ showPath = true,
32638
+ hideNoMatchMessage = false
31603
32639
  }) {
31604
32640
  const {
31605
32641
  searchResults
31606
32642
  } = useSearch(search, fieldPath);
31607
- const stringSearchResults = React.useMemo(() => searchResults && searchResults.filter((r2) => r2.fieldType === "string" && r2.fieldValue !== null).sort((a, b2) => b2.weight - a.weight).slice(0, 100), [searchResults]);
32643
+ const stringSearchResults = React.useMemo(() => searchResults && searchResults.filter((r2) => r2.fieldType === "string" && r2.fieldValue !== null).filter((r2) => filter ? filter(r2.fieldValue ?? "") : true).sort((a, b2) => b2.weight - a.weight).slice(0, 100), [searchResults, filter]);
31608
32644
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
31609
32645
  ref,
31610
32646
  ..._stylex.props(customStyle),
@@ -31621,7 +32657,7 @@ function ValueList({
31621
32657
  },
31622
32658
  children: value.fieldName
31623
32659
  }) : null]
31624
- }, value.fieldName + ":" + value.fieldValue)) : search ? /* @__PURE__ */ jsxRuntime.jsx("div", {
32660
+ }, value.fieldName + ":" + value.fieldValue)) : search && !hideNoMatchMessage ? /* @__PURE__ */ jsxRuntime.jsx("div", {
31625
32661
  ..._stylex.props(addMenuStyles.item),
31626
32662
  "data-disabled": "true",
31627
32663
  children: "No matching values"
@@ -31815,7 +32851,9 @@ const StringFilterCore = ({
31815
32851
  }
31816
32852
  },
31817
32853
  customStyle: styles$i.valueList,
31818
- showPath: false
32854
+ showPath: false,
32855
+ filter: (value) => !currentFilter.values.includes(value),
32856
+ hideNoMatchMessage: true
31819
32857
  })
31820
32858
  })]
31821
32859
  }) : currentFilter.operator === "~" ? /* @__PURE__ */ jsxRuntime.jsx(StringEditor, {
@@ -32139,11 +33177,8 @@ function makeFilterWithNewType(filter, type) {
32139
33177
  }
32140
33178
  }
32141
33179
  function typeFromFilter(filter) {
32142
- if (filter.operator === "null" && filter.not) {
32143
- return "-null";
32144
- }
32145
- if (filter.operator === "before" && filter.not) {
32146
- return "not_before";
33180
+ if ((filter.operator === "null" || filter.operator === "after" || filter.operator === "before") && filter.not) {
33181
+ return `-${filter.operator}`;
32147
33182
  }
32148
33183
  return filter.operator;
32149
33184
  }
@@ -32152,7 +33187,7 @@ function unitsFromFilter(filter, isDateTime) {
32152
33187
  return filter.units;
32153
33188
  } else if (filter.operator === "to") {
32154
33189
  return guessUnits(filter.fromMoment, isDateTime);
32155
- } else if (filter.operator === "before" && filter.before.moment === "literal") {
33190
+ } else if (filter.operator === "before") {
32156
33191
  return guessUnits(filter.before, isDateTime);
32157
33192
  } else if (filter.operator === "after") {
32158
33193
  return guessUnits(filter.after, isDateTime);
@@ -32199,14 +33234,17 @@ const DateTimeFilterCore = ({
32199
33234
  value: "next",
32200
33235
  label: "next complete"
32201
33236
  }, {
32202
- value: "not_before",
32203
- label: "on or after"
33237
+ value: "-before",
33238
+ label: "starting"
32204
33239
  }, {
32205
33240
  value: "after",
32206
33241
  label: "after"
32207
33242
  }, {
32208
33243
  value: "before",
32209
33244
  label: "before"
33245
+ }, {
33246
+ value: "-after",
33247
+ label: "through"
32210
33248
  }, {
32211
33249
  value: "in",
32212
33250
  label: "is"
@@ -32523,6 +33561,11 @@ function dateTimeFilterChangeType(filter, type, units) {
32523
33561
  let n = "7";
32524
33562
  let fromMoment = createTemporalLiteral(/* @__PURE__ */ new Date(), units);
32525
33563
  let toMoment = createTemporalLiteral(/* @__PURE__ */ new Date(), units);
33564
+ let not = false;
33565
+ if (type.startsWith("-")) {
33566
+ type = type.slice(1);
33567
+ not = true;
33568
+ }
32526
33569
  switch (filter.operator) {
32527
33570
  case "in_last":
32528
33571
  case "last":
@@ -32555,18 +33598,14 @@ function dateTimeFilterChangeType(filter, type, units) {
32555
33598
  case "after":
32556
33599
  return {
32557
33600
  operator: type,
32558
- after: fromMoment
33601
+ after: fromMoment,
33602
+ not
32559
33603
  };
32560
33604
  case "before":
32561
33605
  return {
32562
33606
  operator: type,
32563
- before: fromMoment
32564
- };
32565
- case "not_before":
32566
- return {
32567
- operator: "before",
32568
33607
  before: fromMoment,
32569
- not: true
33608
+ not
32570
33609
  };
32571
33610
  case "in":
32572
33611
  return {
@@ -32581,12 +33620,8 @@ function dateTimeFilterChangeType(filter, type, units) {
32581
33620
  };
32582
33621
  case "null":
32583
33622
  return {
32584
- operator: "null"
32585
- };
32586
- case "-null":
32587
- return {
32588
- operator: "null",
32589
- not: true
33623
+ operator: type,
33624
+ not
32590
33625
  };
32591
33626
  }
32592
33627
  return filter;
@@ -32838,7 +33873,7 @@ function FieldList({
32838
33873
  ..._stylex.props(customStyle),
32839
33874
  children: groups.length ? groups.map((group) => /* @__PURE__ */ jsxRuntime.jsxs("div", {
32840
33875
  children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
32841
- ..._stylex.props(addMenuStyles.item, styles$h.fieldItem),
33876
+ ..._stylex.props(addMenuStyles.item, styles$h.fieldItem, styles$h.sticky),
32842
33877
  "data-disabled": "true",
32843
33878
  children: group.name
32844
33879
  }), group.fields.map((field) => isFilterOperation && (field.kind === "dimension" || field.kind === "measure") ? /* @__PURE__ */ jsxRuntime.jsx(FilterPopover, {
@@ -32904,6 +33939,17 @@ const styles$h = {
32904
33939
  paddingTop: "mly1y1aw1k",
32905
33940
  paddingBottom: "mlywib8y2",
32906
33941
  $$css: true
33942
+ },
33943
+ sticky: {
33944
+ position: "mly7wzq59",
33945
+ top: "mly13vifvy",
33946
+ zIndex: "mly1vjfegm",
33947
+ backgroundColor: "mly9nb4jr",
33948
+ borderBottom: "mlyv3yj8d",
33949
+ borderBottomWidth: null,
33950
+ borderBottomStyle: null,
33951
+ borderBottomColor: null,
33952
+ $$css: true
32907
33953
  }
32908
33954
  };
32909
33955
  function FieldMenu({
@@ -33103,7 +34149,7 @@ function OperationActionTitle({
33103
34149
  return !(segment == null ? void 0 : segment.hasField(field.name, path)) && isNotAnnotatedFilteredField(field);
33104
34150
  };
33105
34151
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
33106
- ..._stylex.props(styles$s.title, hoverStyles.main),
34152
+ ..._stylex.props(styles$u.title, hoverStyles.main),
33107
34153
  children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
33108
34154
  children: title
33109
34155
  }), /* @__PURE__ */ jsxRuntime.jsx("div", {
@@ -33136,308 +34182,6 @@ function OperationActionTitle({
33136
34182
  })]
33137
34183
  });
33138
34184
  }
33139
- var DIALOG_NAME = "Dialog";
33140
- var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
33141
- var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
33142
- var Dialog = (props2) => {
33143
- const {
33144
- __scopeDialog,
33145
- children,
33146
- open: openProp,
33147
- defaultOpen,
33148
- onOpenChange,
33149
- modal = true
33150
- } = props2;
33151
- const triggerRef = React__namespace.useRef(null);
33152
- const contentRef = React__namespace.useRef(null);
33153
- const [open = false, setOpen] = useControllableState({
33154
- prop: openProp,
33155
- defaultProp: defaultOpen,
33156
- onChange: onOpenChange
33157
- });
33158
- return /* @__PURE__ */ jsxRuntime.jsx(
33159
- DialogProvider,
33160
- {
33161
- scope: __scopeDialog,
33162
- triggerRef,
33163
- contentRef,
33164
- contentId: useId(),
33165
- titleId: useId(),
33166
- descriptionId: useId(),
33167
- open,
33168
- onOpenChange: setOpen,
33169
- onOpenToggle: React__namespace.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
33170
- modal,
33171
- children
33172
- }
33173
- );
33174
- };
33175
- Dialog.displayName = DIALOG_NAME;
33176
- var TRIGGER_NAME$1 = "DialogTrigger";
33177
- var DialogTrigger = React__namespace.forwardRef(
33178
- (props2, forwardedRef) => {
33179
- const { __scopeDialog, ...triggerProps } = props2;
33180
- const context = useDialogContext(TRIGGER_NAME$1, __scopeDialog);
33181
- const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
33182
- return /* @__PURE__ */ jsxRuntime.jsx(
33183
- Primitive.button,
33184
- {
33185
- type: "button",
33186
- "aria-haspopup": "dialog",
33187
- "aria-expanded": context.open,
33188
- "aria-controls": context.contentId,
33189
- "data-state": getState(context.open),
33190
- ...triggerProps,
33191
- ref: composedTriggerRef,
33192
- onClick: composeEventHandlers(props2.onClick, context.onOpenToggle)
33193
- }
33194
- );
33195
- }
33196
- );
33197
- DialogTrigger.displayName = TRIGGER_NAME$1;
33198
- var PORTAL_NAME = "DialogPortal";
33199
- var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {
33200
- forceMount: void 0
33201
- });
33202
- var DialogPortal = (props2) => {
33203
- const { __scopeDialog, forceMount, children, container } = props2;
33204
- const context = useDialogContext(PORTAL_NAME, __scopeDialog);
33205
- return /* @__PURE__ */ jsxRuntime.jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React__namespace.Children.map(children, (child) => /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Portal$5, { asChild: true, container, children: child }) })) });
33206
- };
33207
- DialogPortal.displayName = PORTAL_NAME;
33208
- var OVERLAY_NAME = "DialogOverlay";
33209
- var DialogOverlay = React__namespace.forwardRef(
33210
- (props2, forwardedRef) => {
33211
- const portalContext = usePortalContext(OVERLAY_NAME, props2.__scopeDialog);
33212
- const { forceMount = portalContext.forceMount, ...overlayProps } = props2;
33213
- const context = useDialogContext(OVERLAY_NAME, props2.__scopeDialog);
33214
- return context.modal ? /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
33215
- }
33216
- );
33217
- DialogOverlay.displayName = OVERLAY_NAME;
33218
- var DialogOverlayImpl = React__namespace.forwardRef(
33219
- (props2, forwardedRef) => {
33220
- const { __scopeDialog, ...overlayProps } = props2;
33221
- const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
33222
- return (
33223
- // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
33224
- // ie. when `Overlay` and `Content` are siblings
33225
- /* @__PURE__ */ jsxRuntime.jsx(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsxRuntime.jsx(
33226
- Primitive.div,
33227
- {
33228
- "data-state": getState(context.open),
33229
- ...overlayProps,
33230
- ref: forwardedRef,
33231
- style: { pointerEvents: "auto", ...overlayProps.style }
33232
- }
33233
- ) })
33234
- );
33235
- }
33236
- );
33237
- var CONTENT_NAME$1 = "DialogContent";
33238
- var DialogContent = React__namespace.forwardRef(
33239
- (props2, forwardedRef) => {
33240
- const portalContext = usePortalContext(CONTENT_NAME$1, props2.__scopeDialog);
33241
- const { forceMount = portalContext.forceMount, ...contentProps } = props2;
33242
- const context = useDialogContext(CONTENT_NAME$1, props2.__scopeDialog);
33243
- return /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsxRuntime.jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsxRuntime.jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
33244
- }
33245
- );
33246
- DialogContent.displayName = CONTENT_NAME$1;
33247
- var DialogContentModal = React__namespace.forwardRef(
33248
- (props2, forwardedRef) => {
33249
- const context = useDialogContext(CONTENT_NAME$1, props2.__scopeDialog);
33250
- const contentRef = React__namespace.useRef(null);
33251
- const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
33252
- React__namespace.useEffect(() => {
33253
- const content = contentRef.current;
33254
- if (content) return hideOthers(content);
33255
- }, []);
33256
- return /* @__PURE__ */ jsxRuntime.jsx(
33257
- DialogContentImpl,
33258
- {
33259
- ...props2,
33260
- ref: composedRefs,
33261
- trapFocus: context.open,
33262
- disableOutsidePointerEvents: true,
33263
- onCloseAutoFocus: composeEventHandlers(props2.onCloseAutoFocus, (event) => {
33264
- var _a2;
33265
- event.preventDefault();
33266
- (_a2 = context.triggerRef.current) == null ? void 0 : _a2.focus();
33267
- }),
33268
- onPointerDownOutside: composeEventHandlers(props2.onPointerDownOutside, (event) => {
33269
- const originalEvent = event.detail.originalEvent;
33270
- const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
33271
- const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
33272
- if (isRightClick) event.preventDefault();
33273
- }),
33274
- onFocusOutside: composeEventHandlers(
33275
- props2.onFocusOutside,
33276
- (event) => event.preventDefault()
33277
- )
33278
- }
33279
- );
33280
- }
33281
- );
33282
- var DialogContentNonModal = React__namespace.forwardRef(
33283
- (props2, forwardedRef) => {
33284
- const context = useDialogContext(CONTENT_NAME$1, props2.__scopeDialog);
33285
- const hasInteractedOutsideRef = React__namespace.useRef(false);
33286
- const hasPointerDownOutsideRef = React__namespace.useRef(false);
33287
- return /* @__PURE__ */ jsxRuntime.jsx(
33288
- DialogContentImpl,
33289
- {
33290
- ...props2,
33291
- ref: forwardedRef,
33292
- trapFocus: false,
33293
- disableOutsidePointerEvents: false,
33294
- onCloseAutoFocus: (event) => {
33295
- var _a2, _b2;
33296
- (_a2 = props2.onCloseAutoFocus) == null ? void 0 : _a2.call(props2, event);
33297
- if (!event.defaultPrevented) {
33298
- if (!hasInteractedOutsideRef.current) (_b2 = context.triggerRef.current) == null ? void 0 : _b2.focus();
33299
- event.preventDefault();
33300
- }
33301
- hasInteractedOutsideRef.current = false;
33302
- hasPointerDownOutsideRef.current = false;
33303
- },
33304
- onInteractOutside: (event) => {
33305
- var _a2, _b2;
33306
- (_a2 = props2.onInteractOutside) == null ? void 0 : _a2.call(props2, event);
33307
- if (!event.defaultPrevented) {
33308
- hasInteractedOutsideRef.current = true;
33309
- if (event.detail.originalEvent.type === "pointerdown") {
33310
- hasPointerDownOutsideRef.current = true;
33311
- }
33312
- }
33313
- const target = event.target;
33314
- const targetIsTrigger = (_b2 = context.triggerRef.current) == null ? void 0 : _b2.contains(target);
33315
- if (targetIsTrigger) event.preventDefault();
33316
- if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
33317
- event.preventDefault();
33318
- }
33319
- }
33320
- }
33321
- );
33322
- }
33323
- );
33324
- var DialogContentImpl = React__namespace.forwardRef(
33325
- (props2, forwardedRef) => {
33326
- const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props2;
33327
- const context = useDialogContext(CONTENT_NAME$1, __scopeDialog);
33328
- const contentRef = React__namespace.useRef(null);
33329
- const composedRefs = useComposedRefs(forwardedRef, contentRef);
33330
- useFocusGuards();
33331
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
33332
- /* @__PURE__ */ jsxRuntime.jsx(
33333
- FocusScope,
33334
- {
33335
- asChild: true,
33336
- loop: true,
33337
- trapped: trapFocus,
33338
- onMountAutoFocus: onOpenAutoFocus,
33339
- onUnmountAutoFocus: onCloseAutoFocus,
33340
- children: /* @__PURE__ */ jsxRuntime.jsx(
33341
- DismissableLayer,
33342
- {
33343
- role: "dialog",
33344
- id: context.contentId,
33345
- "aria-describedby": context.descriptionId,
33346
- "aria-labelledby": context.titleId,
33347
- "data-state": getState(context.open),
33348
- ...contentProps,
33349
- ref: composedRefs,
33350
- onDismiss: () => context.onOpenChange(false)
33351
- }
33352
- )
33353
- }
33354
- ),
33355
- /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
33356
- /* @__PURE__ */ jsxRuntime.jsx(TitleWarning, { titleId: context.titleId }),
33357
- /* @__PURE__ */ jsxRuntime.jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
33358
- ] })
33359
- ] });
33360
- }
33361
- );
33362
- var TITLE_NAME = "DialogTitle";
33363
- var DialogTitle = React__namespace.forwardRef(
33364
- (props2, forwardedRef) => {
33365
- const { __scopeDialog, ...titleProps } = props2;
33366
- const context = useDialogContext(TITLE_NAME, __scopeDialog);
33367
- return /* @__PURE__ */ jsxRuntime.jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
33368
- }
33369
- );
33370
- DialogTitle.displayName = TITLE_NAME;
33371
- var DESCRIPTION_NAME = "DialogDescription";
33372
- var DialogDescription = React__namespace.forwardRef(
33373
- (props2, forwardedRef) => {
33374
- const { __scopeDialog, ...descriptionProps } = props2;
33375
- const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
33376
- return /* @__PURE__ */ jsxRuntime.jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
33377
- }
33378
- );
33379
- DialogDescription.displayName = DESCRIPTION_NAME;
33380
- var CLOSE_NAME = "DialogClose";
33381
- var DialogClose = React__namespace.forwardRef(
33382
- (props2, forwardedRef) => {
33383
- const { __scopeDialog, ...closeProps } = props2;
33384
- const context = useDialogContext(CLOSE_NAME, __scopeDialog);
33385
- return /* @__PURE__ */ jsxRuntime.jsx(
33386
- Primitive.button,
33387
- {
33388
- type: "button",
33389
- ...closeProps,
33390
- ref: forwardedRef,
33391
- onClick: composeEventHandlers(props2.onClick, () => context.onOpenChange(false))
33392
- }
33393
- );
33394
- }
33395
- );
33396
- DialogClose.displayName = CLOSE_NAME;
33397
- function getState(open) {
33398
- return open ? "open" : "closed";
33399
- }
33400
- var TITLE_WARNING_NAME = "DialogTitleWarning";
33401
- var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
33402
- contentName: CONTENT_NAME$1,
33403
- titleName: TITLE_NAME,
33404
- docsSlug: "dialog"
33405
- });
33406
- var TitleWarning = ({ titleId }) => {
33407
- const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
33408
- const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
33409
-
33410
- If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
33411
-
33412
- For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
33413
- React__namespace.useEffect(() => {
33414
- if (titleId) {
33415
- const hasTitle = document.getElementById(titleId);
33416
- if (!hasTitle) console.error(MESSAGE);
33417
- }
33418
- }, [MESSAGE, titleId]);
33419
- return null;
33420
- };
33421
- var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
33422
- var DescriptionWarning = ({ contentRef, descriptionId }) => {
33423
- const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
33424
- const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
33425
- React__namespace.useEffect(() => {
33426
- var _a2;
33427
- const describedById = (_a2 = contentRef.current) == null ? void 0 : _a2.getAttribute("aria-describedby");
33428
- if (descriptionId && describedById) {
33429
- const hasDescription = document.getElementById(descriptionId);
33430
- if (!hasDescription) console.warn(MESSAGE);
33431
- }
33432
- }, [MESSAGE, contentRef, descriptionId]);
33433
- return null;
33434
- };
33435
- var Root = Dialog;
33436
- var Portal = DialogPortal;
33437
- var Overlay = DialogOverlay;
33438
- var Content$1 = DialogContent;
33439
- var Title = DialogTitle;
33440
- var Description = DialogDescription;
33441
34185
  function RenameDialog({
33442
34186
  rootQuery,
33443
34187
  view,
@@ -33471,29 +34215,19 @@ function RenameDialog({
33471
34215
  onOpenChange: setOpen,
33472
34216
  children: /* @__PURE__ */ jsxRuntime.jsx(Portal, {
33473
34217
  children: /* @__PURE__ */ jsxRuntime.jsx(Overlay, {
33474
- ...{
33475
- className: "mly5uxqc1 mlyixxii4 mly13vifvy mlyu96u03 mly3m8u43 mly1ey2m1c mlyrvj5dj mly1ku5rj1 mly11uqc5h"
33476
- },
34218
+ ..._stylex.props(dialogStyles.overlay),
33477
34219
  children: /* @__PURE__ */ jsxRuntime.jsxs(Content$1, {
33478
34220
  ..._stylex.props(dialogStyles.content, fontStyles.body),
33479
34221
  children: [/* @__PURE__ */ jsxRuntime.jsxs(Description, {
33480
- ...{
33481
- className: "mly1s85apg"
33482
- },
34222
+ ..._stylex.props(dialogStyles.displayNone),
33483
34223
  children: ["Rename ", target.name]
33484
34224
  }), /* @__PURE__ */ jsxRuntime.jsxs(Title, {
33485
- ...{
33486
- className: "mly1j61zf2 mly1ghz6dp"
33487
- },
34225
+ ..._stylex.props(dialogStyles.title),
33488
34226
  children: ["Rename ", target.name]
33489
34227
  }), /* @__PURE__ */ jsxRuntime.jsxs("div", {
33490
- ...{
33491
- className: "mlyqyf9gi mly78zum5 mlydt5ytf mly167g77z"
33492
- },
34228
+ ..._stylex.props(dialogStyles.editor),
33493
34229
  children: [/* @__PURE__ */ jsxRuntime.jsxs("div", {
33494
- ...{
33495
- className: "mly78zum5 mly167g77z"
33496
- },
34230
+ ..._stylex.props(dialogStyles.editorRow),
33497
34231
  children: [/* @__PURE__ */ jsxRuntime.jsx("input", {
33498
34232
  value: name,
33499
34233
  onChange: (event) => setName(event.target.value),
@@ -33512,9 +34246,7 @@ function RenameDialog({
33512
34246
  errorMessage: "Name already in use"
33513
34247
  })]
33514
34248
  }), /* @__PURE__ */ jsxRuntime.jsxs("div", {
33515
- ...{
33516
- className: "mly78zum5 mly167g77z"
33517
- },
34249
+ ..._stylex.props(dialogStyles.editorRow),
33518
34250
  children: [/* @__PURE__ */ jsxRuntime.jsx(Button, {
33519
34251
  label: "Cancel",
33520
34252
  onClick: () => setOpen(false),
@@ -33533,92 +34265,6 @@ function RenameDialog({
33533
34265
  })
33534
34266
  });
33535
34267
  }
33536
- const dialogStyles = {
33537
- content: {
33538
- display: "mly78zum5",
33539
- flexDirection: "mlydt5ytf",
33540
- boxShadow: "mly5n1uv4",
33541
- backgroundColor: "mly12peec7",
33542
- borderRadius: "mlyur7f20",
33543
- borderStartStartRadius: null,
33544
- borderStartEndRadius: null,
33545
- borderEndStartRadius: null,
33546
- borderEndEndRadius: null,
33547
- borderTopLeftRadius: null,
33548
- borderTopRightRadius: null,
33549
- borderBottomLeftRadius: null,
33550
- borderBottomRightRadius: null,
33551
- padding: "mlye8ttls",
33552
- paddingInline: null,
33553
- paddingStart: null,
33554
- paddingLeft: null,
33555
- paddingEnd: null,
33556
- paddingRight: null,
33557
- paddingBlock: null,
33558
- paddingTop: null,
33559
- paddingBottom: null,
33560
- minWidth: "mlylm99nl",
33561
- maxWidth: "mly1jkqq1h",
33562
- gap: "mly167g77z",
33563
- rowGap: null,
33564
- columnGap: null,
33565
- $$css: true
33566
- },
33567
- editorCell: {
33568
- flexGrow: "mly1iyjqo2",
33569
- $$css: true
33570
- },
33571
- input: {
33572
- border: "mly2yh2zd",
33573
- borderWidth: null,
33574
- borderInlineWidth: null,
33575
- borderInlineStartWidth: null,
33576
- borderLeftWidth: null,
33577
- borderInlineEndWidth: null,
33578
- borderRightWidth: null,
33579
- borderBlockWidth: null,
33580
- borderTopWidth: null,
33581
- borderBottomWidth: null,
33582
- borderStyle: null,
33583
- borderInlineStyle: null,
33584
- borderInlineStartStyle: null,
33585
- borderLeftStyle: null,
33586
- borderInlineEndStyle: null,
33587
- borderRightStyle: null,
33588
- borderBlockStyle: null,
33589
- borderTopStyle: null,
33590
- borderBottomStyle: null,
33591
- borderColor: null,
33592
- borderInlineColor: null,
33593
- borderInlineStartColor: null,
33594
- borderLeftColor: null,
33595
- borderInlineEndColor: null,
33596
- borderRightColor: null,
33597
- borderBlockColor: null,
33598
- borderTopColor: null,
33599
- borderBottomColor: null,
33600
- color: "mlyizdh9v",
33601
- padding: "mly9cpjcd",
33602
- paddingInline: null,
33603
- paddingStart: null,
33604
- paddingLeft: null,
33605
- paddingEnd: null,
33606
- paddingRight: null,
33607
- paddingBlock: null,
33608
- paddingTop: null,
33609
- paddingBottom: null,
33610
- borderRadius: "mly1sxf85j",
33611
- borderStartStartRadius: null,
33612
- borderStartEndRadius: null,
33613
- borderEndStartRadius: null,
33614
- borderEndEndRadius: null,
33615
- borderTopLeftRadius: null,
33616
- borderTopRightRadius: null,
33617
- borderBottomLeftRadius: null,
33618
- borderBottomRightRadius: null,
33619
- $$css: true
33620
- }
33621
- };
33622
34268
  function SortableOperations({
33623
34269
  rootQuery,
33624
34270
  segment,
@@ -33680,7 +34326,7 @@ function SortableOperations({
33680
34326
  fields,
33681
34327
  ...props2
33682
34328
  }), /* @__PURE__ */ jsxRuntime.jsx("div", {
33683
- ..._stylex.props(styles$s.tokenContainer),
34329
+ ..._stylex.props(styles$u.tokenContainer),
33684
34330
  children: /* @__PURE__ */ jsxRuntime.jsx(DndContext, {
33685
34331
  sensors,
33686
34332
  collisionDetection: closestCenter,
@@ -33766,24 +34412,39 @@ function SortableOperation({
33766
34412
  id,
33767
34413
  ref: setNodeRef,
33768
34414
  style,
33769
- children: [granular ? /* @__PURE__ */ jsxRuntime.jsxs(TokenGroup, {
33770
- customStyle: customStyles.tokenGroup,
33771
- children: [/* @__PURE__ */ jsxRuntime.jsx(Token, {
33772
- color,
33773
- icon,
33774
- label: fieldInfo.name,
33775
- dragProps: {
33776
- attributes,
33777
- listeners
34415
+ children: [granular ? /* @__PURE__ */ jsxRuntime.jsxs("div", {
34416
+ ...{
34417
+ 0: {
34418
+ className: "mly78zum5 mly6s0dn4 mly1nhvcw1 mly1jnr06f mly11ogjb6 mly1g9of4s"
34419
+ },
34420
+ 1: {
34421
+ className: "mly78zum5 mly6s0dn4 mly1nhvcw1 mly1jnr06f mly1ae5hkt"
33778
34422
  }
33779
- }), /* @__PURE__ */ jsxRuntime.jsx(SelectorToken, {
33780
- color,
33781
- value: granular.value,
33782
- onChange: (granulation) => {
33783
- if (operation.field.expression instanceof QB.ASTTimeTruncationExpression) operation.field.expression.truncation = granulation;
33784
- setQuery == null ? void 0 : setQuery(rootQuery.build());
34423
+ }[!!hoverActionsVisible << 0],
34424
+ children: [/* @__PURE__ */ jsxRuntime.jsxs(TokenGroup, {
34425
+ customStyle: customStyles.tokenGroup,
34426
+ children: [/* @__PURE__ */ jsxRuntime.jsx(Token, {
34427
+ color,
34428
+ icon,
34429
+ label: fieldInfo.name,
34430
+ dragProps: {
34431
+ attributes,
34432
+ listeners
34433
+ }
34434
+ }), /* @__PURE__ */ jsxRuntime.jsx(SelectorToken, {
34435
+ color,
34436
+ value: granular.value,
34437
+ onChange: (granulation) => {
34438
+ if (operation.field.expression instanceof QB.ASTTimeTruncationExpression) operation.field.expression.truncation = granulation;
34439
+ setQuery == null ? void 0 : setQuery(rootQuery.build());
34440
+ },
34441
+ items: granular.options
34442
+ })]
34443
+ }), hoverActions && /* @__PURE__ */ jsxRuntime.jsx("div", {
34444
+ ...{
34445
+ className: "mly2b4tyj mly2lah0s"
33785
34446
  },
33786
- items: granular.options
34447
+ children: hoverActions
33787
34448
  })]
33788
34449
  }) : /* @__PURE__ */ jsxRuntime.jsx(FieldToken, {
33789
34450
  field: fieldInfo,
@@ -34012,7 +34673,7 @@ const parsedToLabels = (parsed, filterString) => {
34012
34673
  const {
34013
34674
  not
34014
34675
  } = temporalClause;
34015
- op = `is${not ? " not" : ""} after`;
34676
+ op = not ? "through" : "is after";
34016
34677
  value = displayTimeFromMoment(temporalClause.after);
34017
34678
  }
34018
34679
  break;
@@ -34021,7 +34682,7 @@ const parsedToLabels = (parsed, filterString) => {
34021
34682
  const {
34022
34683
  not
34023
34684
  } = temporalClause;
34024
- op = not ? "is on or after" : "is before";
34685
+ op = not ? "starting" : "is before";
34025
34686
  value = displayTimeFromMoment(temporalClause.before);
34026
34687
  }
34027
34688
  break;
@@ -34105,10 +34766,10 @@ function FilterOperations({
34105
34766
  }
34106
34767
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
34107
34768
  children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
34108
- ..._stylex.props(styles$s.title),
34769
+ ..._stylex.props(styles$u.title),
34109
34770
  children: "filter by"
34110
34771
  }), /* @__PURE__ */ jsxRuntime.jsx("div", {
34111
- ..._stylex.props(styles$s.tokenContainer),
34772
+ ..._stylex.props(styles$u.tokenContainer),
34112
34773
  children: filters.map((filterOperation, key2) => {
34113
34774
  return /* @__PURE__ */ jsxRuntime.jsx(ErrorElement, {
34114
34775
  fallback: /* @__PURE__ */ jsxRuntime.jsxs("div", {
@@ -34141,29 +34802,33 @@ function SingleFilterOperation({
34141
34802
  }
34142
34803
  setQuery == null ? void 0 : setQuery(rootQuery.build());
34143
34804
  }, [filterOperation.filter, rootQuery, setQuery]);
34144
- if (!(filterOperation.filter instanceof QB.ASTFilterWithFilterString)) {
34805
+ const {
34806
+ filter
34807
+ } = filterOperation;
34808
+ if (!(filter instanceof QB.ASTFilterWithFilterString)) {
34145
34809
  return null;
34146
34810
  }
34147
34811
  const {
34148
- fieldReference,
34812
+ expression,
34149
34813
  filterString
34150
- } = filterOperation.filter;
34151
- const filter = filterOperation.filter.getFilter();
34152
- const fieldInfo = fieldReference.getFieldInfo();
34153
- if (fieldInfo.kind !== "dimension" && fieldInfo.kind !== "measure") {
34154
- throw new Error(`Invalid filter field kind: ${fieldInfo.kind}`);
34814
+ } = filter;
34815
+ if (!(expression instanceof QB.ASTReferenceExpression)) {
34816
+ return null;
34155
34817
  }
34818
+ const fieldInfo = filter.getFieldInfo();
34819
+ const parsedFilter = filter.getFilter();
34820
+ const path = expression.path ?? [];
34156
34821
  const {
34157
34822
  op,
34158
34823
  value
34159
- } = parsedToLabels(filter, filterString);
34824
+ } = parsedToLabels(parsedFilter, filterString);
34160
34825
  const label = `${fieldInfo.name} ${op} ${value}`;
34161
34826
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
34162
34827
  ..._stylex.props(hoverStyles.main),
34163
34828
  children: [/* @__PURE__ */ jsxRuntime.jsx(FilterPopover, {
34164
34829
  fieldInfo,
34165
- path: fieldReference.path ?? [],
34166
- filter,
34830
+ path,
34831
+ filter: parsedFilter,
34167
34832
  setFilter,
34168
34833
  trigger: /* @__PURE__ */ jsxRuntime.jsx(Token, {
34169
34834
  icon: "filter",
@@ -34198,7 +34863,7 @@ function LimitOperation({
34198
34863
  }
34199
34864
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
34200
34865
  children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
34201
- ..._stylex.props(styles$s.title),
34866
+ ..._stylex.props(styles$u.title),
34202
34867
  children: "limit"
34203
34868
  }), /* @__PURE__ */ jsxRuntime.jsxs("div", {
34204
34869
  ..._stylex.props(hoverStyles.main),
@@ -34248,10 +34913,10 @@ function OrderByOperations({
34248
34913
  }
34249
34914
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
34250
34915
  children: [/* @__PURE__ */ jsxRuntime.jsx("div", {
34251
- ..._stylex.props(styles$s.title),
34916
+ ..._stylex.props(styles$u.title),
34252
34917
  children: "order by"
34253
34918
  }), /* @__PURE__ */ jsxRuntime.jsx("div", {
34254
- ..._stylex.props(styles$s.tokenContainer),
34919
+ ..._stylex.props(styles$u.tokenContainer),
34255
34920
  children: orderBys.map((orderBy) => {
34256
34921
  const {
34257
34922
  fieldReference
@@ -34801,7 +35466,7 @@ function NestOperations({
34801
35466
  return null;
34802
35467
  }
34803
35468
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
34804
- ..._stylex.props(styles$s.tokenContainer),
35469
+ ..._stylex.props(styles$u.tokenContainer),
34805
35470
  children: nests.map((nest) => /* @__PURE__ */ jsxRuntime.jsx(NestOperation, {
34806
35471
  rootQuery,
34807
35472
  view,
@@ -35134,9 +35799,9 @@ function Source({
35134
35799
  }) {
35135
35800
  if (rootQuery.definition instanceof QB.ASTArrowQueryDefinition) {
35136
35801
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
35137
- ..._stylex.props(styles$s.queryCard, styles$b.content),
35802
+ ..._stylex.props(styles$u.queryCard, styles$b.content),
35138
35803
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
35139
- ..._stylex.props(styles$s.labelWithIcon),
35804
+ ..._stylex.props(styles$u.labelWithIcon),
35140
35805
  children: [/* @__PURE__ */ jsxRuntime.jsx(Icon, {
35141
35806
  name: "database"
35142
35807
  }), /* @__PURE__ */ jsxRuntime.jsx("div", {
@@ -36074,17 +36739,14 @@ function RenderedResult({
36074
36739
  const viz = React.useMemo(() => {
36075
36740
  const renderer = new render.MalloyRenderer();
36076
36741
  const viz2 = renderer.createViz({
36077
- onDrill: ({
36078
- stableQuery,
36079
- stableDrillClauses
36080
- }) => {
36742
+ onDrill: (drillData) => {
36081
36743
  if (onDrill) {
36082
- onDrill({
36083
- stableQuery,
36084
- stableDrillClauses
36085
- });
36744
+ onDrill(drillData);
36086
36745
  return;
36087
36746
  }
36747
+ const {
36748
+ stableQuery
36749
+ } = drillData;
36088
36750
  const rootQuery = new QB.ASTQuery({
36089
36751
  query: stableQuery,
36090
36752
  source
@@ -36761,7 +37423,10 @@ function FieldTokenWithActions({
36761
37423
  disabled: !!filterDisabledReason,
36762
37424
  onTooltipOpenChange: setIsTooltipOpen
36763
37425
  }),
36764
- onOpenChange: setIsFilterPopoverOpen
37426
+ onOpenChange: setIsFilterPopoverOpen,
37427
+ layoutProps: {
37428
+ align: "start"
37429
+ }
36765
37430
  }), /* @__PURE__ */ jsxRuntime.jsx(ActionButton, {
36766
37431
  icon: "orderBy",
36767
37432
  tooltip: orderByDisabledReason || "Add as order by",
@@ -36786,7 +37451,10 @@ function FieldTokenWithActions({
36786
37451
  disabled: !!filterDisabledReason,
36787
37452
  onTooltipOpenChange: setIsTooltipOpen
36788
37453
  }),
36789
- onOpenChange: setIsFilterPopoverOpen
37454
+ onOpenChange: setIsFilterPopoverOpen,
37455
+ layoutProps: {
37456
+ align: "start"
37457
+ }
36790
37458
  }), /* @__PURE__ */ jsxRuntime.jsx(ActionButton, {
36791
37459
  icon: "orderBy",
36792
37460
  tooltip: orderByDisabledReason || "Add as order by",