@bluemarble/bi 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,10 @@
1
- import { A as modelEdges, C as VALUE_FORMATS, D as validateModel, N as referencedTables, S as AGGREGATION_LABEL, T as isAggregate, _ as canonicalJson, a as FILTER_FIELDS, b as toModelCode, c as chartOfType, d as filterReferences, g as validateLayout, i as CARD_FIELDS, j as parseColumnRef, k as measureHome, l as chartReferences, m as layoutModelWarnings, n as CANVAS_PRESETS, p as layoutFileContent, r as CARDS_FIELDS, s as chartColumns, t as BUILTIN_CHART_TYPES, x as AGGREGATIONS } from "./layout-DTR4vI-I.js";
1
+ import { A as modelEdges, C as VALUE_FORMATS, D as validateModel, N as referencedTables, S as AGGREGATION_LABEL, T as isAggregate, _ as canonicalJson, a as FILTER_FIELDS, b as toModelCode, c as chartOfType, d as filterReferences, g as validateLayout, i as CARD_FIELDS, j as parseColumnRef, k as measureHome, l as chartReferences, m as layoutModelWarnings, n as CANVAS_PRESETS, p as layoutFileContent, r as CARDS_FIELDS, s as chartColumns, t as BUILTIN_CHART_TYPES, x as AGGREGATIONS } from "./layout-676sEvvb.js";
2
2
  import { n as diffRows } from "./compare-DloZhg1T.js";
3
- import { a as useDashboard, c as layoutItemKey, l as parseLayoutItemKey, n as INSPECT_ATTRIBUTE, o as errorMessage, s as LAYOUT_ITEM_ATTRIBUTE, t as ModelDictionary } from "./ModelDictionary-CBILYbZ1.js";
3
+ import { a as useDashboard, c as layoutItemKey, l as parseLayoutItemKey, n as INSPECT_ATTRIBUTE, o as errorMessage, s as LAYOUT_ITEM_ATTRIBUTE, t as ModelDictionary } from "./ModelDictionary-Y7W9oK1J.js";
4
4
  import { Alert, Autocomplete, Box, Button, Checkbox, Chip, CircularProgress, Collapse, Dialog, DialogActions, DialogContent, DialogTitle, Divider, FormControlLabel, IconButton, List, ListItemButton, Menu, MenuItem, MenuList, Paper, Popper, Portal, Tab, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, TableSortLabel, Tabs, TextField, ThemeProvider, ToggleButton, ToggleButtonGroup, Tooltip, Typography, createTheme } from "@mui/material";
5
5
  import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
- //#region \0rolldown/runtime.js
8
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
9
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
10
- if (typeof require !== "undefined") return require.apply(this, arguments);
11
- throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
12
- });
13
- //#endregion
7
+ import { createPortal } from "react-dom";
14
8
  //#region src/devtools/sqlHighlight.tsx
15
9
  const KEYWORDS$1 = new Set(`SELECT FROM WHERE AND OR NOT IN IS NULL JOIN LEFT RIGHT INNER OUTER CROSS ON AS GROUP BY ORDER
16
10
  HAVING LIMIT OFFSET UNION ALL DISTINCT CASE WHEN THEN ELSE END WITH ASC DESC BETWEEN LIKE EXISTS
@@ -595,364 +589,7 @@ function FiltersPanel({ devtools }) {
595
589
  });
596
590
  }
597
591
  //#endregion
598
- //#region node_modules/react-dom/cjs/react-dom.production.js
599
- /**
600
- * @license React
601
- * react-dom.production.js
602
- *
603
- * Copyright (c) Meta Platforms, Inc. and affiliates.
604
- *
605
- * This source code is licensed under the MIT license found in the
606
- * LICENSE file in the root directory of this source tree.
607
- */
608
- var require_react_dom_production = /* @__PURE__ */ __commonJSMin(((exports) => {
609
- var React = __require("react");
610
- function formatProdErrorMessage(code) {
611
- var url = "https://react.dev/errors/" + code;
612
- if (1 < arguments.length) {
613
- url += "?args[]=" + encodeURIComponent(arguments[1]);
614
- for (var i = 2; i < arguments.length; i++) url += "&args[]=" + encodeURIComponent(arguments[i]);
615
- }
616
- return "Minified React error #" + code + "; visit " + url + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
617
- }
618
- function noop() {}
619
- var Internals = {
620
- d: {
621
- f: noop,
622
- r: function() {
623
- throw Error(formatProdErrorMessage(522));
624
- },
625
- D: noop,
626
- C: noop,
627
- L: noop,
628
- m: noop,
629
- X: noop,
630
- S: noop,
631
- M: noop
632
- },
633
- p: 0,
634
- findDOMNode: null
635
- };
636
- var REACT_PORTAL_TYPE = Symbol.for("react.portal");
637
- var REACT_RECOVERABLE_TYPE = Symbol.for("react.recoverable");
638
- var REACT_OPTIMISTIC_KEY = Symbol.for("react.optimistic_key");
639
- function createPortal$1(children, containerInfo, implementation) {
640
- var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
641
- return {
642
- $$typeof: REACT_PORTAL_TYPE,
643
- key: null == key ? null : key === REACT_OPTIMISTIC_KEY ? REACT_OPTIMISTIC_KEY : "" + key,
644
- children,
645
- containerInfo,
646
- implementation
647
- };
648
- }
649
- var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
650
- function getCrossOriginStringAs(as, input) {
651
- if ("font" === as) return "";
652
- if ("string" === typeof input) return "use-credentials" === input ? input : "";
653
- }
654
- exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
655
- exports.browser = function(reason) {
656
- return {
657
- $$typeof: REACT_RECOVERABLE_TYPE,
658
- _reason: reason
659
- };
660
- };
661
- exports.createPortal = function(children, container) {
662
- var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
663
- if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType) throw Error(formatProdErrorMessage(299));
664
- return createPortal$1(children, container, null, key);
665
- };
666
- exports.flushSync = function(fn) {
667
- var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
668
- try {
669
- if (ReactSharedInternals.T = null, Internals.p = 2, fn) return fn();
670
- } finally {
671
- ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f();
672
- }
673
- };
674
- exports.preconnect = function(href, options) {
675
- "string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
676
- };
677
- exports.prefetchDNS = function(href) {
678
- "string" === typeof href && Internals.d.D(href);
679
- };
680
- exports.preinit = function(href, options) {
681
- if ("string" === typeof href && options && "string" === typeof options.as) {
682
- var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
683
- "style" === as ? Internals.d.S(href, "string" === typeof options.precedence ? options.precedence : void 0, {
684
- crossOrigin,
685
- integrity,
686
- fetchPriority
687
- }) : "script" === as && Internals.d.X(href, {
688
- crossOrigin,
689
- integrity,
690
- fetchPriority,
691
- nonce: "string" === typeof options.nonce ? options.nonce : void 0
692
- });
693
- }
694
- };
695
- exports.preinitModule = function(href, options) {
696
- if ("string" === typeof href) if ("object" === typeof options && null !== options) {
697
- if (null == options.as || "script" === options.as) {
698
- var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
699
- Internals.d.M(href, {
700
- crossOrigin,
701
- integrity: "string" === typeof options.integrity ? options.integrity : void 0,
702
- nonce: "string" === typeof options.nonce ? options.nonce : void 0,
703
- fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0
704
- });
705
- }
706
- } else options ?? Internals.d.M(href);
707
- };
708
- exports.preload = function(href, options) {
709
- if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
710
- var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
711
- Internals.d.L(href, as, {
712
- crossOrigin,
713
- integrity: "string" === typeof options.integrity ? options.integrity : void 0,
714
- nonce: "string" === typeof options.nonce ? options.nonce : void 0,
715
- type: "string" === typeof options.type ? options.type : void 0,
716
- fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
717
- referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
718
- imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
719
- imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
720
- media: "string" === typeof options.media ? options.media : void 0
721
- });
722
- }
723
- };
724
- exports.preloadModule = function(href, options) {
725
- if ("string" === typeof href) if (options) {
726
- var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
727
- Internals.d.m(href, {
728
- as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
729
- crossOrigin,
730
- integrity: "string" === typeof options.integrity ? options.integrity : void 0,
731
- nonce: "string" === typeof options.nonce ? options.nonce : void 0,
732
- fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0
733
- });
734
- } else Internals.d.m(href);
735
- };
736
- exports.requestFormReset = function(form) {
737
- Internals.d.r(form);
738
- };
739
- exports.unstable_batchedUpdates = function(fn, a) {
740
- return fn(a);
741
- };
742
- exports.useFormState = function(action, initialState, permalink) {
743
- return ReactSharedInternals.H.useFormState(action, initialState, permalink);
744
- };
745
- exports.useFormStatus = function() {
746
- return ReactSharedInternals.H.useHostTransitionStatus();
747
- };
748
- exports.version = "19.3.0";
749
- }));
750
- //#endregion
751
- //#region node_modules/react-dom/cjs/react-dom.development.js
752
- /**
753
- * @license React
754
- * react-dom.development.js
755
- *
756
- * Copyright (c) Meta Platforms, Inc. and affiliates.
757
- *
758
- * This source code is licensed under the MIT license found in the
759
- * LICENSE file in the root directory of this source tree.
760
- */
761
- var require_react_dom_development = /* @__PURE__ */ __commonJSMin(((exports) => {
762
- "production" !== process.env.NODE_ENV && (function() {
763
- function noop() {}
764
- function testStringCoercion(value) {
765
- return "" + value;
766
- }
767
- function createPortal$1(children, containerInfo, implementation) {
768
- var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
769
- if (null == key) key = null;
770
- else if (key === REACT_OPTIMISTIC_KEY) key = REACT_OPTIMISTIC_KEY;
771
- else {
772
- try {
773
- testStringCoercion(key);
774
- var JSCompiler_inline_result = !1;
775
- } catch (e) {
776
- JSCompiler_inline_result = !0;
777
- }
778
- JSCompiler_inline_result && (console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", "function" === typeof Symbol && Symbol.toStringTag && key[Symbol.toStringTag] || key.constructor.name || "Object"), testStringCoercion(key));
779
- key = "" + key;
780
- }
781
- return {
782
- $$typeof: REACT_PORTAL_TYPE,
783
- key,
784
- children,
785
- containerInfo,
786
- implementation
787
- };
788
- }
789
- function getCrossOriginStringAs(as, input) {
790
- if ("font" === as) return "";
791
- if ("string" === typeof input) return "use-credentials" === input ? input : "";
792
- }
793
- function getValueDescriptorExpectingObjectForWarning(thing) {
794
- return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : "something with type \"" + typeof thing + "\"";
795
- }
796
- function getValueDescriptorExpectingEnumForWarning(thing) {
797
- return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : "string" === typeof thing ? JSON.stringify(thing) : "number" === typeof thing ? "`" + thing + "`" : "something with type \"" + typeof thing + "\"";
798
- }
799
- function resolveDispatcher() {
800
- var dispatcher = ReactSharedInternals.H;
801
- null === dispatcher && console.error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.");
802
- return dispatcher;
803
- }
804
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
805
- var React = __require("react"), Internals = {
806
- d: {
807
- f: noop,
808
- r: function() {
809
- throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.");
810
- },
811
- D: noop,
812
- C: noop,
813
- L: noop,
814
- m: noop,
815
- X: noop,
816
- S: noop,
817
- M: noop
818
- },
819
- p: 0,
820
- findDOMNode: null
821
- }, REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_RECOVERABLE_TYPE = Symbol.for("react.recoverable"), REACT_OPTIMISTIC_KEY = Symbol.for("react.optimistic_key"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
822
- "function" === typeof Map && null != Map.prototype && "function" === typeof Map.prototype.forEach && "function" === typeof Set && null != Set.prototype && "function" === typeof Set.prototype.clear && "function" === typeof Set.prototype.forEach || console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
823
- exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
824
- exports.browser = function(reason) {
825
- return {
826
- $$typeof: REACT_RECOVERABLE_TYPE,
827
- _reason: reason
828
- };
829
- };
830
- exports.createPortal = function(children, container) {
831
- var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
832
- if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType) throw Error("Target container is not a DOM element.");
833
- return createPortal$1(children, container, null, key);
834
- };
835
- exports.flushSync = function(fn) {
836
- var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
837
- try {
838
- if (ReactSharedInternals.T = null, Internals.p = 2, fn) return fn();
839
- } finally {
840
- ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f() && console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.");
841
- }
842
- };
843
- exports.preconnect = function(href, options) {
844
- "string" === typeof href && href ? null != options && "object" !== typeof options ? console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.", getValueDescriptorExpectingEnumForWarning(options)) : null != options && "string" !== typeof options.crossOrigin && console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.", getValueDescriptorExpectingObjectForWarning(options.crossOrigin)) : console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", getValueDescriptorExpectingObjectForWarning(href));
845
- "string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
846
- };
847
- exports.prefetchDNS = function(href) {
848
- if ("string" !== typeof href || !href) console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", getValueDescriptorExpectingObjectForWarning(href));
849
- else if (1 < arguments.length) {
850
- var options = arguments[1];
851
- "object" === typeof options && options.hasOwnProperty("crossOrigin") ? console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.", getValueDescriptorExpectingEnumForWarning(options)) : console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.", getValueDescriptorExpectingEnumForWarning(options));
852
- }
853
- "string" === typeof href && Internals.d.D(href);
854
- };
855
- exports.preinit = function(href, options) {
856
- "string" === typeof href && href ? null == options || "object" !== typeof options ? console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.", getValueDescriptorExpectingEnumForWarning(options)) : "style" !== options.as && "script" !== options.as && console.error("ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are \"style\" and \"script\".", getValueDescriptorExpectingEnumForWarning(options.as)) : console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", getValueDescriptorExpectingObjectForWarning(href));
857
- if ("string" === typeof href && options && "string" === typeof options.as) {
858
- var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
859
- "style" === as ? Internals.d.S(href, "string" === typeof options.precedence ? options.precedence : void 0, {
860
- crossOrigin,
861
- integrity,
862
- fetchPriority
863
- }) : "script" === as && Internals.d.X(href, {
864
- crossOrigin,
865
- integrity,
866
- fetchPriority,
867
- nonce: "string" === typeof options.nonce ? options.nonce : void 0
868
- });
869
- }
870
- };
871
- exports.preinitModule = function(href, options) {
872
- var encountered = "";
873
- "string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
874
- void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "script" !== options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingEnumForWarning(options.as) + ".");
875
- if (encountered) console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s", encountered);
876
- else switch (encountered = options && "string" === typeof options.as ? options.as : "script", encountered) {
877
- case "script": break;
878
- default: encountered = getValueDescriptorExpectingEnumForWarning(encountered), console.error("ReactDOM.preinitModule(): Currently the only supported \"as\" type for this function is \"script\" but received \"%s\" instead. This warning was generated for `href` \"%s\". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)", encountered, href);
879
- }
880
- if ("string" === typeof href) if ("object" === typeof options && null !== options) {
881
- if (null == options.as || "script" === options.as) encountered = getCrossOriginStringAs(options.as, options.crossOrigin), Internals.d.M(href, {
882
- crossOrigin: encountered,
883
- integrity: "string" === typeof options.integrity ? options.integrity : void 0,
884
- nonce: "string" === typeof options.nonce ? options.nonce : void 0,
885
- fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0
886
- });
887
- } else options ?? Internals.d.M(href);
888
- };
889
- exports.preload = function(href, options) {
890
- var encountered = "";
891
- "string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
892
- null == options || "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : "string" === typeof options.as && options.as || (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
893
- encountered && console.error("ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel=\"preload\" as=\"...\" />` tag.%s", encountered);
894
- if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
895
- encountered = options.as;
896
- var crossOrigin = getCrossOriginStringAs(encountered, options.crossOrigin);
897
- Internals.d.L(href, encountered, {
898
- crossOrigin,
899
- integrity: "string" === typeof options.integrity ? options.integrity : void 0,
900
- nonce: "string" === typeof options.nonce ? options.nonce : void 0,
901
- type: "string" === typeof options.type ? options.type : void 0,
902
- fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
903
- referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
904
- imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
905
- imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
906
- media: "string" === typeof options.media ? options.media : void 0
907
- });
908
- }
909
- };
910
- exports.preloadModule = function(href, options) {
911
- var encountered = "";
912
- "string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
913
- void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "string" !== typeof options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
914
- encountered && console.error("ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel=\"modulepreload\" as=\"...\" />` tag.%s", encountered);
915
- "string" === typeof href && (options ? (encountered = getCrossOriginStringAs(options.as, options.crossOrigin), Internals.d.m(href, {
916
- as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
917
- crossOrigin: encountered,
918
- integrity: "string" === typeof options.integrity ? options.integrity : void 0,
919
- nonce: "string" === typeof options.nonce ? options.nonce : void 0,
920
- fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0
921
- })) : Internals.d.m(href));
922
- };
923
- exports.requestFormReset = function(form) {
924
- Internals.d.r(form);
925
- };
926
- exports.unstable_batchedUpdates = function(fn, a) {
927
- return fn(a);
928
- };
929
- exports.useFormState = function(action, initialState, permalink) {
930
- return resolveDispatcher().useFormState(action, initialState, permalink);
931
- };
932
- exports.useFormStatus = function() {
933
- return resolveDispatcher().useHostTransitionStatus();
934
- };
935
- exports.version = "19.3.0";
936
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
937
- })();
938
- }));
939
- //#endregion
940
592
  //#region src/devtools/DevtoolsWindow.tsx
941
- var import_react_dom = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
942
- function checkDCE() {
943
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") return;
944
- if (process.env.NODE_ENV !== "production") throw new Error("^_^");
945
- try {
946
- __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
947
- } catch (err) {
948
- console.error(err);
949
- }
950
- }
951
- if (process.env.NODE_ENV === "production") {
952
- checkDCE();
953
- module.exports = require_react_dom_production();
954
- } else module.exports = require_react_dom_development();
955
- })))();
956
593
  /**
957
594
  * Devtools numa janela separada do navegador (popup), para usar com a página em tela cheia ou em
958
595
  * outro monitor. O painel continua sendo renderizado pela árvore React da página (mesmo contexto,
@@ -1066,7 +703,7 @@ function DevtoolsWindow({ popup, title, theme, onClosed, children }) {
1066
703
  ]);
1067
704
  const localTheme = useMemo(() => root && windowTheme(theme, root), [theme, root]);
1068
705
  if (!root || !localTheme) return null;
1069
- return (0, import_react_dom.createPortal)(/* @__PURE__ */ jsx(ThemeProvider, {
706
+ return createPortal(/* @__PURE__ */ jsx(ThemeProvider, {
1070
707
  theme: localTheme,
1071
708
  children
1072
709
  }), root);
@@ -2019,6 +1656,7 @@ function ChartForm({ chart, cards, types, model, formatters, columns, onChange }
2019
1656
  columns: chartColumns(chart, types),
2020
1657
  formColumns: columns,
2021
1658
  chosenDimensions: chartReferences(chart, types).dimensions,
1659
+ chosenMeasures: chartReferences(chart, types).measures,
2022
1660
  header: /* @__PURE__ */ jsxs(Fragment, { children: [field("Tipo", /* @__PURE__ */ jsxs(TextField, {
2023
1661
  select: true,
2024
1662
  size: "small",
@@ -2066,7 +1704,7 @@ function FilterForm({ filter, model, formatters, columns, onChange }) {
2066
1704
  });
2067
1705
  }
2068
1706
  /** Formulário gerado dos `FieldSpec` (campos do tipo de gráfico ou do filtro). */
2069
- function FieldsForm({ fields, values, onSet: set, model, formatters, columns, formColumns, chosenDimensions, header }) {
1707
+ function FieldsForm({ fields, values, onSet: set, model, formatters, columns, formColumns, chosenDimensions, chosenMeasures = [], header }) {
2070
1708
  const dimensions = Object.entries(model.dimensions).map(([name, dim]) => ({
2071
1709
  name,
2072
1710
  label: dim.label
@@ -2105,37 +1743,11 @@ function FieldsForm({ fields, values, onSet: set, model, formatters, columns, fo
2105
1743
  onChange: (e) => set(key, e.target.value),
2106
1744
  sx: inputSx$1
2107
1745
  });
2108
- case "color": {
2109
- const fallback = spec.default;
2110
- return /* @__PURE__ */ jsxs(Box, {
2111
- sx: {
2112
- display: "flex",
2113
- gap: .5,
2114
- alignItems: "center"
2115
- },
2116
- children: [/* @__PURE__ */ jsx(Box, {
2117
- component: "input",
2118
- type: "color",
2119
- value: value ?? fallback,
2120
- onChange: (e) => set(key, e.target.value),
2121
- sx: {
2122
- width: 32,
2123
- height: 30,
2124
- p: 0,
2125
- border: 0,
2126
- bgcolor: "transparent",
2127
- cursor: "pointer"
2128
- }
2129
- }), /* @__PURE__ */ jsx(TextField, {
2130
- size: "small",
2131
- fullWidth: true,
2132
- value: value ?? "",
2133
- placeholder: fallback,
2134
- onChange: (e) => set(key, e.target.value),
2135
- sx: inputSx$1
2136
- })]
2137
- });
2138
- }
1746
+ case "color": return /* @__PURE__ */ jsx(ColorInput, {
1747
+ value,
1748
+ fallback: spec.default,
1749
+ onCommit: (color) => set(key, color)
1750
+ });
2139
1751
  case "boolean": {
2140
1752
  const fallback = spec.default;
2141
1753
  return /* @__PURE__ */ jsx(FormControlLabel, {
@@ -2226,6 +1838,34 @@ function FieldsForm({ fields, values, onSet: set, model, formatters, columns, fo
2226
1838
  }, dimension))
2227
1839
  });
2228
1840
  }
1841
+ case "labels":
1842
+ if (!columns.length) return /* @__PURE__ */ jsx(Typography, {
1843
+ sx: {
1844
+ fontSize: 12,
1845
+ color: "text.disabled"
1846
+ },
1847
+ children: "sem colunas"
1848
+ });
1849
+ return /* @__PURE__ */ jsx(LabelsEditor, {
1850
+ value: value ?? {},
1851
+ columns,
1852
+ model,
1853
+ onChange: (next) => set(key, next)
1854
+ });
1855
+ case "formats":
1856
+ if (!chosenMeasures.length) return /* @__PURE__ */ jsx(Typography, {
1857
+ sx: {
1858
+ fontSize: 12,
1859
+ color: "text.disabled"
1860
+ },
1861
+ children: "sem medidas"
1862
+ });
1863
+ return /* @__PURE__ */ jsx(FormatsEditor, {
1864
+ value: value ?? {},
1865
+ measures: chosenMeasures,
1866
+ model,
1867
+ onChange: (next) => set(key, next)
1868
+ });
2229
1869
  default: return /* @__PURE__ */ jsx(NameSelect, {
2230
1870
  value: value ?? "",
2231
1871
  options: options(spec),
@@ -2236,7 +1876,7 @@ function FieldsForm({ fields, values, onSet: set, model, formatters, columns, fo
2236
1876
  }
2237
1877
  };
2238
1878
  const sections = [...new Set(entries.map(([, spec]) => spec.section))];
2239
- const wide = (spec, key) => key === "title" || spec.kind === "dimensions" || spec.kind === "measures" || spec.kind === "formatters";
1879
+ const wide = (spec, key) => key === "title" || spec.kind === "dimensions" || spec.kind === "measures" || spec.kind === "formatters" || spec.kind === "labels" || spec.kind === "formats";
2240
1880
  return /* @__PURE__ */ jsx(Fragment, { children: sections.map((section) => {
2241
1881
  const inSection = entries.filter(([, spec]) => spec.section === section);
2242
1882
  return /* @__PURE__ */ jsx(Section, {
@@ -2255,17 +1895,246 @@ function FieldsForm({ fields, values, onSet: set, model, formatters, columns, fo
2255
1895
  }, section);
2256
1896
  }) });
2257
1897
  }
1898
+ /**
1899
+ * Cor com o seletor nativo. Mexer no seletor só muda a amostra: o rascunho (e a página) muda quando
1900
+ * ele fecha — o `change` nativo; o `onChange` do React dispara a cada movimento. O texto aplica no
1901
+ * Enter ou ao sair do campo.
1902
+ */
1903
+ function ColorInput({ value, fallback, onCommit }) {
1904
+ const [picking, setPicking] = useState(null);
1905
+ const [typing, setTyping] = useState(null);
1906
+ const picker = useRef(null);
1907
+ const commit = useRef(onCommit);
1908
+ useEffect(() => {
1909
+ commit.current = onCommit;
1910
+ });
1911
+ useEffect(() => {
1912
+ const input = picker.current;
1913
+ if (!input) return;
1914
+ const listener = () => {
1915
+ commit.current(input.value);
1916
+ setPicking(null);
1917
+ };
1918
+ input.addEventListener("change", listener);
1919
+ return () => input.removeEventListener("change", listener);
1920
+ }, []);
1921
+ const commitText = () => {
1922
+ if (typing === null) return;
1923
+ const text = typing.trim();
1924
+ setTyping(null);
1925
+ if (text !== (value ?? "")) onCommit(text || void 0);
1926
+ };
1927
+ return /* @__PURE__ */ jsxs(Box, {
1928
+ sx: {
1929
+ display: "flex",
1930
+ gap: .5,
1931
+ alignItems: "center"
1932
+ },
1933
+ children: [/* @__PURE__ */ jsx(Box, {
1934
+ component: "input",
1935
+ type: "color",
1936
+ ref: picker,
1937
+ value: picking ?? value ?? fallback,
1938
+ onChange: (e) => setPicking(e.target.value),
1939
+ sx: {
1940
+ width: 32,
1941
+ height: 30,
1942
+ p: 0,
1943
+ border: 0,
1944
+ bgcolor: "transparent",
1945
+ cursor: "pointer"
1946
+ }
1947
+ }), /* @__PURE__ */ jsx(TextField, {
1948
+ size: "small",
1949
+ fullWidth: true,
1950
+ value: typing ?? picking ?? value ?? "",
1951
+ placeholder: fallback,
1952
+ onChange: (e) => setTyping(e.target.value),
1953
+ onBlur: commitText,
1954
+ onKeyDown: (e) => {
1955
+ if (e.key === "Enter") commitText();
1956
+ if (e.key === "Escape") setTyping(null);
1957
+ },
1958
+ sx: inputSx$1
1959
+ })]
1960
+ });
1961
+ }
1962
+ /** Sem as chaves de colunas que saíram do gráfico; vazio = `undefined` (sai do JSON). */
1963
+ function pruned(map, keep) {
1964
+ const next = Object.fromEntries(Object.entries(map).filter(([key]) => keep.includes(key)));
1965
+ return Object.keys(next).length ? next : void 0;
1966
+ }
1967
+ const columnNameSx = {
1968
+ fontFamily: MONO,
1969
+ fontSize: 12,
1970
+ minWidth: 90,
1971
+ maxWidth: 140,
1972
+ overflow: "hidden",
1973
+ textOverflow: "ellipsis",
1974
+ whiteSpace: "nowrap"
1975
+ };
1976
+ /** Rótulo de cada coluna do gráfico; o placeholder é o rótulo do dicionário. */
1977
+ function LabelsEditor({ value, columns, model, onChange }) {
1978
+ return /* @__PURE__ */ jsx(Box, {
1979
+ sx: {
1980
+ display: "flex",
1981
+ flexDirection: "column",
1982
+ gap: .5
1983
+ },
1984
+ children: columns.map((column) => /* @__PURE__ */ jsxs(Box, {
1985
+ sx: {
1986
+ display: "flex",
1987
+ gap: .5,
1988
+ alignItems: "center"
1989
+ },
1990
+ children: [/* @__PURE__ */ jsx(Tooltip, {
1991
+ title: model.dimensions[column] ? "dimensão" : "medida",
1992
+ placement: "left",
1993
+ children: /* @__PURE__ */ jsx(Typography, {
1994
+ sx: columnNameSx,
1995
+ children: column
1996
+ })
1997
+ }), /* @__PURE__ */ jsx(TextField, {
1998
+ size: "small",
1999
+ fullWidth: true,
2000
+ value: value[column] ?? "",
2001
+ placeholder: model.dimensions[column]?.label ?? model.measures[column]?.label ?? column,
2002
+ onChange: (e) => onChange(pruned(withField(value, column, e.target.value), columns)),
2003
+ sx: inputSx$1
2004
+ })]
2005
+ }, column))
2006
+ });
2007
+ }
2008
+ const FORMAT_LABEL = {
2009
+ number: "número",
2010
+ integer: "inteiro",
2011
+ currency: "R$",
2012
+ percent: "%"
2013
+ };
2014
+ /** Formato de cada medida do gráfico; vazio = o do dicionário (que aparece como placeholder). */
2015
+ function FormatsEditor({ value, measures, model, onChange }) {
2016
+ const setFormat = (measure, key, next) => {
2017
+ const format = withField(value[measure] ?? {}, key, next);
2018
+ const map = { ...value };
2019
+ if (Object.keys(format).length) map[measure] = format;
2020
+ else delete map[measure];
2021
+ onChange(pruned(map, measures));
2022
+ };
2023
+ const small = {
2024
+ ...inputSx$1,
2025
+ "& .MuiInputBase-input": {
2026
+ fontFamily: MONO,
2027
+ fontSize: 12,
2028
+ px: 1
2029
+ }
2030
+ };
2031
+ return /* @__PURE__ */ jsx(Box, {
2032
+ sx: {
2033
+ display: "flex",
2034
+ flexDirection: "column",
2035
+ gap: .75
2036
+ },
2037
+ children: measures.map((measure) => {
2038
+ const format = value[measure] ?? {};
2039
+ const fromModel = model.measures[measure];
2040
+ const decimals = format.decimals;
2041
+ return /* @__PURE__ */ jsxs(Box, { children: [/* @__PURE__ */ jsxs(Typography, {
2042
+ sx: {
2043
+ ...columnNameSx,
2044
+ maxWidth: "none",
2045
+ mb: .25
2046
+ },
2047
+ children: [measure, fromModel?.label && /* @__PURE__ */ jsx(Box, {
2048
+ component: "span",
2049
+ sx: {
2050
+ color: "text.secondary",
2051
+ ml: 1,
2052
+ fontFamily: "inherit"
2053
+ },
2054
+ children: fromModel.label
2055
+ })]
2056
+ }), /* @__PURE__ */ jsxs(Box, {
2057
+ sx: {
2058
+ display: "grid",
2059
+ gap: .5,
2060
+ alignItems: "center",
2061
+ gridTemplateColumns: "minmax(88px, 1.4fr) minmax(52px, .8fr) 1fr 1fr auto"
2062
+ },
2063
+ children: [
2064
+ /* @__PURE__ */ jsxs(TextField, {
2065
+ select: true,
2066
+ size: "small",
2067
+ value: format.format ?? "",
2068
+ onChange: (e) => setFormat(measure, "format", e.target.value || void 0),
2069
+ slotProps: { select: { displayEmpty: true } },
2070
+ sx: small,
2071
+ children: [/* @__PURE__ */ jsx(MenuItem, {
2072
+ value: "",
2073
+ children: /* @__PURE__ */ jsxs("em", { children: ["padrão", fromModel?.format ? ` (${FORMAT_LABEL[fromModel.format]})` : ""] })
2074
+ }), VALUE_FORMATS.map((name) => /* @__PURE__ */ jsx(MenuItem, {
2075
+ value: name,
2076
+ children: FORMAT_LABEL[name]
2077
+ }, name))]
2078
+ }),
2079
+ /* @__PURE__ */ jsx(Tooltip, {
2080
+ title: "Casas decimais (0 a 10)",
2081
+ children: /* @__PURE__ */ jsx(TextField, {
2082
+ size: "small",
2083
+ type: "number",
2084
+ value: decimals ?? "",
2085
+ placeholder: fromModel?.decimals === void 0 ? ",00" : String(fromModel.decimals),
2086
+ error: decimals !== void 0 && (!Number.isInteger(decimals) || decimals < 0 || decimals > 10),
2087
+ onChange: (e) => setFormat(measure, "decimals", e.target.value.trim() === "" ? void 0 : Number(e.target.value)),
2088
+ slotProps: { htmlInput: {
2089
+ min: 0,
2090
+ max: 10
2091
+ } },
2092
+ sx: small
2093
+ })
2094
+ }),
2095
+ /* @__PURE__ */ jsx(TextField, {
2096
+ size: "small",
2097
+ value: format.prefix ?? "",
2098
+ placeholder: "prefixo",
2099
+ onChange: (e) => setFormat(measure, "prefix", e.target.value),
2100
+ sx: small
2101
+ }),
2102
+ /* @__PURE__ */ jsx(TextField, {
2103
+ size: "small",
2104
+ value: format.suffix ?? "",
2105
+ placeholder: "sufixo",
2106
+ onChange: (e) => setFormat(measure, "suffix", e.target.value),
2107
+ sx: small
2108
+ }),
2109
+ /* @__PURE__ */ jsx(Tooltip, {
2110
+ title: "Notação curta: 1,2 mil / 3,4 mi",
2111
+ children: /* @__PURE__ */ jsx(FormControlLabel, {
2112
+ sx: { m: 0 },
2113
+ control: /* @__PURE__ */ jsx(Checkbox, {
2114
+ size: "small",
2115
+ sx: { p: .25 },
2116
+ checked: format.compact ?? false,
2117
+ onChange: (e) => setFormat(measure, "compact", e.target.checked || void 0)
2118
+ }),
2119
+ label: /* @__PURE__ */ jsx(Typography, {
2120
+ sx: { fontSize: 11 },
2121
+ children: "curto"
2122
+ })
2123
+ })
2124
+ })
2125
+ ]
2126
+ })] }, measure);
2127
+ })
2128
+ });
2129
+ }
2258
2130
  const formGrid = (columns) => ({
2259
2131
  display: "grid",
2260
2132
  gap: 1.5,
2261
2133
  gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`
2262
2134
  });
2263
- /** Rótulo padrão (do dicionário) como placeholder dos campos `*Label` do combo. */
2135
+ /** Rótulo padrão (do dicionário) como placeholder do `label` do filtro. */
2264
2136
  function labelPlaceholder(key, values, model) {
2265
2137
  if (key === "label" && typeof values.dimension === "string") return model.dimensions[values.dimension]?.label ?? values.dimension;
2266
- const measureKey = key.endsWith("Label") ? key.slice(0, -5) : null;
2267
- const measure = measureKey && values[measureKey];
2268
- return typeof measure === "string" ? model.measures[measure]?.label ?? measure : void 0;
2269
2138
  }
2270
2139
  function field(label, input, hint) {
2271
2140
  return /* @__PURE__ */ jsxs(Box, { children: [/* @__PURE__ */ jsxs(Typography, {
@@ -2397,10 +2266,7 @@ function toEditor(model) {
2397
2266
  const uidOf = (name) => tables.find((table) => table.name === name)?.uid ?? "";
2398
2267
  const positions = Object.fromEntries(Object.entries(model.diagram ?? {}).flatMap(([name, point]) => {
2399
2268
  const uid = uidOf(name);
2400
- return uid ? [[uid, {
2401
- x: point.x,
2402
- y: point.y
2403
- }]] : [];
2269
+ return uid ? [[uid, { ...point }]] : [];
2404
2270
  }));
2405
2271
  return {
2406
2272
  name: model.name,
@@ -2495,14 +2361,18 @@ function fromEditor(editor) {
2495
2361
  ...Object.keys(diagram).length && { diagram }
2496
2362
  };
2497
2363
  }
2498
- /** Posições pelo nome, na ordem dos cards; arredonda (o arquivo não precisa de frações). */
2364
+ /** Posições (e tamanhos) pelo nome, na ordem dos cards; arredonda (o arquivo não precisa de frações). */
2499
2365
  function diagramOf(editor) {
2500
2366
  return Object.fromEntries(editor.tables.flatMap(({ uid, name }) => {
2501
2367
  const point = editor.positions[uid];
2502
- return point && name ? [[name, {
2503
- x: Math.round(point.x),
2504
- y: Math.round(point.y)
2505
- }]] : [];
2368
+ if (!point || !name) return [];
2369
+ const { x, y, width, height } = point;
2370
+ return [[name, {
2371
+ x: Math.round(x),
2372
+ y: Math.round(y),
2373
+ ...width !== void 0 && { width: Math.round(width) },
2374
+ ...height !== void 0 && { height: Math.round(height) }
2375
+ }]];
2506
2376
  }));
2507
2377
  }
2508
2378
  /** O modelo sem as posições do diagrama: o que muda as consultas. */
@@ -3281,6 +3151,11 @@ const HEADER = 34;
3281
3151
  const ROW = 22;
3282
3152
  const MAX_BODY = 264;
3283
3153
  const PADDING = 4;
3154
+ /** Limites do redimensionamento do card. */
3155
+ const MIN_WIDTH = 160;
3156
+ const MAX_WIDTH = 800;
3157
+ const MIN_HEIGHT$1 = 64;
3158
+ const MAX_HEIGHT = 1600;
3284
3159
  const ROLE_STYLE = {
3285
3160
  one: {
3286
3161
  color: "#4dabf7",
@@ -3397,25 +3272,27 @@ function buildNodes(editor, columns, errors) {
3397
3272
  };
3398
3273
  });
3399
3274
  }
3400
- const cardHeight = (node, collapsed) => collapsed ? HEADER : HEADER + Math.min(node.items.length * ROW, MAX_BODY) + 8;
3275
+ /** Altura do conteúdo (sem tamanho salvo): até `MAX_BODY` de linhas, o resto rola. */
3276
+ const contentHeight = (node) => HEADER + Math.min(node.items.length * ROW, MAX_BODY) + 8;
3277
+ const clamp = (value, min, max) => Math.min(max, Math.max(min, value));
3401
3278
  /** Quem só filtra (lado 1) em cima, o resto embaixo (como costuma ficar no Power BI). */
3402
- function autoLayout(nodes, heights) {
3279
+ function autoLayout(nodes, sizes) {
3403
3280
  const top = nodes.filter((node) => node.role === "one");
3404
3281
  const bottom = nodes.filter((node) => node.role !== "one");
3405
3282
  const positions = {};
3406
- top.forEach((node, index) => {
3407
- positions[node.id] = {
3408
- x: 40 + index * 290,
3409
- y: 40
3410
- };
3411
- });
3412
- const topHeight = Math.max(0, ...top.map((node) => heights.get(node.id) ?? HEADER));
3413
- bottom.forEach((node, index) => {
3414
- positions[node.id] = {
3415
- x: 40 + index * 290,
3416
- y: 40 + topHeight + 140
3417
- };
3418
- });
3283
+ const gap = 60;
3284
+ const row = (list, y) => {
3285
+ let x = 40;
3286
+ for (const node of list) {
3287
+ positions[node.id] = {
3288
+ x,
3289
+ y
3290
+ };
3291
+ x += (sizes.get(node.id)?.width ?? CARD_WIDTH) + gap;
3292
+ }
3293
+ };
3294
+ row(top, 40);
3295
+ row(bottom, 40 + Math.max(0, ...top.map((node) => sizes.get(node.id)?.height ?? HEADER)) + 140);
3419
3296
  return positions;
3420
3297
  }
3421
3298
  function ModelDiagram({ editor, setEditor, columns, errors, warnings, loadingColumns, onLoadColumns, onTry, usage }) {
@@ -3425,6 +3302,7 @@ function ModelDiagram({ editor, setEditor, columns, errors, warnings, loadingCol
3425
3302
  errors
3426
3303
  ]);
3427
3304
  const [moving, setMoving] = useState(null);
3305
+ const [resizing, setResizing] = useState(null);
3428
3306
  const [collapsed, setCollapsed] = useState({});
3429
3307
  const [scrolls, setScrolls] = useState({});
3430
3308
  const [view, setView] = useState({
@@ -3462,9 +3340,39 @@ function ModelDiagram({ editor, setEditor, columns, errors, warnings, loadingCol
3462
3340
  requested.current = true;
3463
3341
  onLoadColumns();
3464
3342
  }, [columns, onLoadColumns]);
3465
- const heights = useMemo(() => new Map(nodes.map((node) => [node.id, cardHeight(node, !!collapsed[node.id])])), [nodes, collapsed]);
3466
- const fallback = useMemo(() => autoLayout(nodes, heights), [nodes, heights]);
3467
- const placed = (node) => (moving?.id === node.id ? moving.point : editor.positions[node.id]) ?? fallback[node.id];
3343
+ const sizes = useMemo(() => new Map(nodes.map((node) => {
3344
+ const saved = resizing?.id === node.id ? resizing : editor.positions[node.id];
3345
+ const width = saved?.width ?? CARD_WIDTH;
3346
+ if (collapsed[node.id]) return [node.id, {
3347
+ width,
3348
+ height: HEADER
3349
+ }];
3350
+ return [node.id, {
3351
+ width,
3352
+ height: saved?.height ?? contentHeight(node)
3353
+ }];
3354
+ })), [
3355
+ nodes,
3356
+ collapsed,
3357
+ editor.positions,
3358
+ resizing
3359
+ ]);
3360
+ const sizeOf = (node) => sizes.get(node.id) ?? {
3361
+ width: CARD_WIDTH,
3362
+ height: HEADER
3363
+ };
3364
+ const fallback = useMemo(() => autoLayout(nodes, sizes), [nodes, sizes]);
3365
+ const placed = (node) => {
3366
+ if (moving?.id === node.id) return moving.point;
3367
+ const saved = editor.positions[node.id];
3368
+ return saved ? {
3369
+ x: saved.x,
3370
+ y: saved.y
3371
+ } : fallback[node.id] ?? {
3372
+ x: 0,
3373
+ y: 0
3374
+ };
3375
+ };
3468
3376
  const setPositions = (update) => setEditor((current) => ({
3469
3377
  ...current,
3470
3378
  positions: update(current.positions)
@@ -3473,7 +3381,7 @@ function ModelDiagram({ editor, setEditor, columns, errors, warnings, loadingCol
3473
3381
  /** Ponto da linha na coluna do card (lado esquerdo ou direito). */
3474
3382
  const anchor = (node, column, side) => {
3475
3383
  const { x, y } = placed(node);
3476
- const height = heights.get(node.id) ?? HEADER;
3384
+ const { width, height } = sizeOf(node);
3477
3385
  const index = node.items.findIndex((item) => item.kind === "column" && item.name === column);
3478
3386
  let rowY = y + HEADER / 2;
3479
3387
  if (!collapsed[node.id] && index >= 0) {
@@ -3481,7 +3389,7 @@ function ModelDiagram({ editor, setEditor, columns, errors, warnings, loadingCol
3481
3389
  rowY = Math.min(Math.max(raw, y + HEADER + 2), y + height - 2);
3482
3390
  }
3483
3391
  return {
3484
- x: side === "left" ? x : x + CARD_WIDTH,
3392
+ x: side === "left" ? x : x + width,
3485
3393
  y: rowY
3486
3394
  };
3487
3395
  };
@@ -3661,11 +3569,56 @@ function ModelDiagram({ editor, setEditor, columns, errors, warnings, loadingCol
3661
3569
  setMoving(null);
3662
3570
  if (moved) setPositions((current) => ({
3663
3571
  ...current,
3664
- [node.id]: point
3572
+ [node.id]: {
3573
+ ...current[node.id],
3574
+ ...point
3575
+ }
3665
3576
  }));
3666
3577
  else selectNode(node);
3667
3578
  });
3668
3579
  };
3580
+ /** Arrasta a borda direita (`width`), a de baixo (`height`) ou o canto (as duas). */
3581
+ const startResize = (event, node, edges) => {
3582
+ if (event.button !== 0) return;
3583
+ const start = sizeOf(node);
3584
+ const { zoom } = view;
3585
+ let size = start;
3586
+ track(event, (dx, dy) => {
3587
+ size = {
3588
+ width: edges.width ? clamp(start.width + dx / zoom, MIN_WIDTH, MAX_WIDTH) : start.width,
3589
+ height: edges.height ? clamp(start.height + dy / zoom, MIN_HEIGHT$1, MAX_HEIGHT) : start.height
3590
+ };
3591
+ setResizing({
3592
+ id: node.id,
3593
+ ...size
3594
+ });
3595
+ }, (_, moved) => {
3596
+ setResizing(null);
3597
+ if (!moved) return;
3598
+ const point = placed(node);
3599
+ setPositions((current) => ({
3600
+ ...current,
3601
+ [node.id]: {
3602
+ ...point,
3603
+ ...current[node.id],
3604
+ ...edges.width && { width: size.width },
3605
+ ...edges.height && { height: size.height }
3606
+ }
3607
+ }));
3608
+ });
3609
+ };
3610
+ /** Duplo clique na alça: volta ao tamanho automático (largura padrão, altura do conteúdo). */
3611
+ const resetSize = (node) => setPositions((current) => {
3612
+ const saved = current[node.id];
3613
+ if (!saved) return current;
3614
+ return {
3615
+ ...current,
3616
+ [node.id]: {
3617
+ x: saved.x,
3618
+ y: saved.y
3619
+ }
3620
+ };
3621
+ });
3669
3622
  const startLink = (event, node, column) => {
3670
3623
  if (event.button !== 0) return;
3671
3624
  track(event, (_, __, moveEvent) => setLinking({
@@ -3718,11 +3671,12 @@ function ModelDiagram({ editor, setEditor, columns, errors, warnings, loadingCol
3718
3671
  if (!rect || !nodes.length) return;
3719
3672
  const boxes = nodes.map((node) => ({
3720
3673
  ...layout?.[node.id] ?? placed(node),
3721
- h: heights.get(node.id) ?? HEADER
3674
+ w: sizeOf(node).width,
3675
+ h: sizeOf(node).height
3722
3676
  }));
3723
3677
  const minX = Math.min(...boxes.map((box) => box.x));
3724
3678
  const minY = Math.min(...boxes.map((box) => box.y));
3725
- const maxX = Math.max(...boxes.map((box) => box.x + CARD_WIDTH));
3679
+ const maxX = Math.max(...boxes.map((box) => box.x + box.w));
3726
3680
  const maxY = Math.max(...boxes.map((box) => box.y + box.h));
3727
3681
  const zoom = Math.min(1.2, Math.max(.3, Math.min((rect.width - 60) / (maxX - minX), (rect.height - 60) / (maxY - minY))));
3728
3682
  setView({
@@ -3738,7 +3692,7 @@ function ModelDiagram({ editor, setEditor, columns, errors, warnings, loadingCol
3738
3692
  const isSelected = (node) => selection?.kind === "table" && selection.uid === node.uid;
3739
3693
  const lines = [];
3740
3694
  const pushLine = (id, many, manyColumn, one, oneColumn, extra) => {
3741
- const rightward = placed(many).x + CARD_WIDTH / 2 <= placed(one).x + CARD_WIDTH / 2;
3695
+ const rightward = placed(many).x + sizeOf(many).width / 2 <= placed(one).x + sizeOf(one).width / 2;
3742
3696
  lines.push({
3743
3697
  id,
3744
3698
  from: anchor(many, manyColumn, rightward ? "right" : "left"),
@@ -3825,7 +3779,7 @@ function ModelDiagram({ editor, setEditor, columns, errors, warnings, loadingCol
3825
3779
  }), nodes.map((node) => /* @__PURE__ */ jsx(TableCard, {
3826
3780
  node,
3827
3781
  position: placed(node),
3828
- height: heights.get(node.id) ?? HEADER,
3782
+ size: sizeOf(node),
3829
3783
  collapsed: !!collapsed[node.id],
3830
3784
  selected: !!isSelected(node),
3831
3785
  linking: !!linking && linking.node.id !== node.id,
@@ -3839,6 +3793,8 @@ function ModelDiagram({ editor, setEditor, columns, errors, warnings, loadingCol
3839
3793
  [node.id]: top
3840
3794
  })),
3841
3795
  onHeaderDown: (event) => startMove(event, node),
3796
+ onResizeDown: (event, edges) => startResize(event, node, edges),
3797
+ onResizeReset: () => resetSize(node),
3842
3798
  onColumnDown: (event, column) => startLink(event, node, column),
3843
3799
  onFieldClick: (item) => setSelection({
3844
3800
  kind: item.kind,
@@ -3895,8 +3851,11 @@ function ModelDiagram({ editor, setEditor, columns, errors, warnings, loadingCol
3895
3851
  /* @__PURE__ */ jsx(Button, {
3896
3852
  size: "small",
3897
3853
  onClick: () => {
3898
- const layout = autoLayout(nodes, heights);
3899
- setPositions(() => layout);
3854
+ const layout = autoLayout(nodes, sizes);
3855
+ setPositions((current) => Object.fromEntries(Object.entries(layout).map(([id, point]) => [id, {
3856
+ ...current[id],
3857
+ ...point
3858
+ }])));
3900
3859
  fitToScreen(layout);
3901
3860
  },
3902
3861
  title: "Dimensões em cima, fatos embaixo (troca as posições salvas)",
@@ -4205,7 +4164,7 @@ function RelationshipLine({ line, hovered, onHover }) {
4205
4164
  ]
4206
4165
  });
4207
4166
  }
4208
- function TableCard({ node, position, height, collapsed, selected, linking, selectedField, onToggle, onScroll, onHeaderDown, onColumnDown, onFieldClick, onAddField }) {
4167
+ function TableCard({ node, position, size, collapsed, selected, linking, selectedField, onToggle, onScroll, onHeaderDown, onResizeDown, onResizeReset, onColumnDown, onFieldClick, onAddField }) {
4209
4168
  const style = ROLE_STYLE[node.role];
4210
4169
  const columnActions = ["dimension", "measure"];
4211
4170
  return /* @__PURE__ */ jsxs(Box, {
@@ -4214,8 +4173,8 @@ function TableCard({ node, position, height, collapsed, selected, linking, selec
4214
4173
  position: "absolute",
4215
4174
  left: position.x,
4216
4175
  top: position.y,
4217
- width: CARD_WIDTH,
4218
- height,
4176
+ width: size.width,
4177
+ height: size.height,
4219
4178
  bgcolor: "#23272e",
4220
4179
  border: "1px solid",
4221
4180
  borderColor: node.error ? "error.main" : selected ? style.color : "#3a3f47",
@@ -4227,187 +4186,252 @@ function TableCard({ node, position, height, collapsed, selected, linking, selec
4227
4186
  userSelect: "none",
4228
4187
  cursor: "default"
4229
4188
  },
4230
- children: [/* @__PURE__ */ jsxs(Box, {
4231
- onMouseDown: onHeaderDown,
4232
- title: node.error,
4233
- sx: {
4234
- height: 31,
4235
- display: "flex",
4236
- alignItems: "center",
4237
- gap: .75,
4238
- px: 1,
4239
- cursor: "move",
4240
- borderBottom: collapsed ? 0 : "1px solid #3a3f47",
4241
- flexShrink: 0
4242
- },
4243
- children: [
4244
- /* @__PURE__ */ jsx(Box, {
4245
- component: "span",
4246
- sx: {
4247
- color: style.color,
4248
- fontSize: 13
4249
- },
4250
- children: "▦"
4251
- }),
4252
- /* @__PURE__ */ jsx(Typography, {
4253
- sx: {
4254
- fontWeight: 700,
4255
- fontSize: 13,
4256
- overflow: "hidden",
4257
- textOverflow: "ellipsis",
4258
- whiteSpace: "nowrap",
4259
- flex: 1
4260
- },
4261
- children: node.name || /* @__PURE__ */ jsx("em", { children: "sem nome" })
4262
- }),
4263
- /* @__PURE__ */ jsx(Box, {
4264
- component: "span",
4265
- title: style.title,
4266
- sx: {
4267
- fontSize: 10,
4268
- color: style.color
4269
- },
4270
- children: style.label
4271
- }),
4272
- node.error && /* @__PURE__ */ jsx(Box, {
4273
- component: "span",
4274
- sx: {
4275
- color: "error.main",
4276
- fontSize: 12
4277
- },
4278
- children: "⚠"
4279
- }),
4280
- /* @__PURE__ */ jsx(Box, {
4281
- component: "button",
4282
- type: "button",
4283
- "aria-label": collapsed ? "Expandir" : "Recolher",
4284
- onMouseDown: (event) => event.stopPropagation(),
4285
- onClick: onToggle,
4286
- sx: {
4287
- border: 0,
4288
- bgcolor: "transparent",
4289
- color: "text.secondary",
4290
- cursor: "pointer",
4291
- p: 0,
4292
- fontSize: 11
4293
- },
4294
- children: collapsed ? "▾" : "▴"
4295
- })
4296
- ]
4297
- }), !collapsed && /* @__PURE__ */ jsxs(Box, {
4298
- onScroll: (event) => onScroll(event.currentTarget.scrollTop),
4299
- sx: {
4300
- overflow: "auto",
4301
- flex: 1,
4302
- py: `${PADDING}px`
4303
- },
4304
- children: [!node.items.length && /* @__PURE__ */ jsx(Typography, {
4305
- sx: {
4306
- fontSize: 11,
4307
- color: "text.disabled",
4308
- px: 1,
4309
- lineHeight: `${ROW}px`
4310
- },
4311
- children: "sem colunas lidas"
4312
- }), node.items.map((item) => item.kind === "column" ? /* @__PURE__ */ jsxs(Box, {
4313
- "data-diagram-node": node.id,
4314
- "data-diagram-column": item.name,
4315
- onMouseDown: (event) => onColumnDown(event, item.name),
4316
- title: item.missing ? "Citada no modelo, mas a tabela não devolve essa coluna" : "Arraste até a coluna de outra tabela para relacionar",
4189
+ children: [
4190
+ /* @__PURE__ */ jsxs(Box, {
4191
+ onMouseDown: onHeaderDown,
4192
+ title: node.error,
4317
4193
  sx: {
4318
- height: ROW,
4194
+ height: 31,
4319
4195
  display: "flex",
4320
4196
  alignItems: "center",
4321
4197
  gap: .75,
4322
4198
  px: 1,
4323
- fontSize: 12,
4324
- cursor: "crosshair",
4325
- "& .column-actions": { display: "none" },
4326
- "&:hover .column-actions": { display: linking ? "none" : "flex" },
4327
- color: item.missing ? "error.main" : item.linked ? "text.primary" : "#adb5bd",
4328
- fontWeight: item.linked ? 700 : 400,
4329
- "&:hover": { bgcolor: linking ? "rgba(245,130,32,.25)" : "rgba(255,255,255,.06)" }
4199
+ cursor: "move",
4200
+ borderBottom: collapsed ? 0 : "1px solid #3a3f47",
4201
+ flexShrink: 0
4330
4202
  },
4331
4203
  children: [
4332
4204
  /* @__PURE__ */ jsx(Box, {
4333
4205
  component: "span",
4334
4206
  sx: {
4335
- width: 14,
4336
- textAlign: "center",
4337
- color: "text.secondary"
4207
+ color: style.color,
4208
+ fontSize: 13
4338
4209
  },
4339
- children: item.isKey ? "🔑" : item.numeric ? "Σ" : ""
4210
+ children: "▦"
4340
4211
  }),
4341
- /* @__PURE__ */ jsx(Box, {
4342
- component: "span",
4212
+ /* @__PURE__ */ jsx(Typography, {
4343
4213
  sx: {
4214
+ fontWeight: 700,
4215
+ fontSize: 13,
4344
4216
  overflow: "hidden",
4345
4217
  textOverflow: "ellipsis",
4346
- whiteSpace: "nowrap"
4218
+ whiteSpace: "nowrap",
4219
+ flex: 1
4347
4220
  },
4348
- children: item.name
4221
+ children: node.name || /* @__PURE__ */ jsx("em", { children: "sem nome" })
4349
4222
  }),
4350
4223
  /* @__PURE__ */ jsx(Box, {
4351
- className: "column-actions",
4224
+ component: "span",
4225
+ title: style.title,
4352
4226
  sx: {
4353
- ml: "auto",
4354
- gap: .25
4227
+ fontSize: 10,
4228
+ color: style.color
4355
4229
  },
4356
- children: columnActions.map((kind) => /* @__PURE__ */ jsx(Box, {
4357
- component: "button",
4358
- type: "button",
4359
- title: kind === "dimension" ? `Nova dimensão com ${node.name}.${item.name}` : `Nova medida: ${item.numeric ? "soma" : "contagem"} de ${node.name}.${item.name}`,
4360
- onMouseDown: (event) => event.stopPropagation(),
4361
- onClick: () => onAddField(kind, item),
4362
- sx: {
4363
- border: "1px solid #3a3f47",
4364
- borderRadius: .5,
4365
- bgcolor: "#1b1e23",
4366
- color: kind === "measure" ? "#ffd8a8" : "#a5d8ff",
4367
- cursor: "pointer",
4368
- fontSize: 10,
4369
- lineHeight: "14px",
4370
- px: .5
4371
- },
4372
- children: kind === "dimension" ? "+◇" : "+Σ"
4373
- }, kind))
4230
+ children: style.label
4231
+ }),
4232
+ node.error && /* @__PURE__ */ jsx(Box, {
4233
+ component: "span",
4234
+ sx: {
4235
+ color: "error.main",
4236
+ fontSize: 12
4237
+ },
4238
+ children: "⚠"
4239
+ }),
4240
+ /* @__PURE__ */ jsx(Box, {
4241
+ component: "button",
4242
+ type: "button",
4243
+ "aria-label": collapsed ? "Expandir" : "Recolher",
4244
+ onMouseDown: (event) => event.stopPropagation(),
4245
+ onClick: onToggle,
4246
+ sx: {
4247
+ border: 0,
4248
+ bgcolor: "transparent",
4249
+ color: "text.secondary",
4250
+ cursor: "pointer",
4251
+ p: 0,
4252
+ fontSize: 11
4253
+ },
4254
+ children: collapsed ? "▾" : "▴"
4374
4255
  })
4375
4256
  ]
4376
- }, `c:${item.name}`) : /* @__PURE__ */ jsxs(Box, {
4377
- onMouseDown: (event) => event.stopPropagation(),
4378
- onClick: () => onFieldClick(item),
4257
+ }),
4258
+ !collapsed && /* @__PURE__ */ jsxs(Box, {
4259
+ onScroll: (event) => onScroll(event.currentTarget.scrollTop),
4379
4260
  sx: {
4380
- height: ROW,
4381
- display: "flex",
4382
- alignItems: "center",
4383
- gap: .75,
4384
- px: 1,
4385
- fontSize: 12,
4386
- cursor: "pointer",
4387
- color: item.kind === "measure" ? "#ffd8a8" : "#a5d8ff",
4388
- bgcolor: selectedField === item.uid ? "rgba(245,130,32,.2)" : void 0,
4389
- "&:hover": { bgcolor: "rgba(255,255,255,.06)" }
4261
+ overflow: "auto",
4262
+ flex: 1,
4263
+ py: `${PADDING}px`
4390
4264
  },
4391
- children: [/* @__PURE__ */ jsx(Box, {
4392
- component: "span",
4265
+ children: [!node.items.length && /* @__PURE__ */ jsx(Typography, {
4393
4266
  sx: {
4394
- width: 14,
4395
- textAlign: "center"
4267
+ fontSize: 11,
4268
+ color: "text.disabled",
4269
+ px: 1,
4270
+ lineHeight: `${ROW}px`
4396
4271
  },
4397
- children: item.icon
4398
- }), /* @__PURE__ */ jsx(Box, {
4399
- component: "span",
4272
+ children: "sem colunas lidas"
4273
+ }), node.items.map((item) => item.kind === "column" ? /* @__PURE__ */ jsxs(Box, {
4274
+ "data-diagram-node": node.id,
4275
+ "data-diagram-column": item.name,
4276
+ onMouseDown: (event) => onColumnDown(event, item.name),
4277
+ title: item.missing ? "Citada no modelo, mas a tabela não devolve essa coluna" : "Arraste até a coluna de outra tabela para relacionar",
4400
4278
  sx: {
4401
- overflow: "hidden",
4402
- textOverflow: "ellipsis",
4403
- whiteSpace: "nowrap"
4279
+ height: ROW,
4280
+ display: "flex",
4281
+ alignItems: "center",
4282
+ gap: .75,
4283
+ px: 1,
4284
+ fontSize: 12,
4285
+ cursor: "crosshair",
4286
+ "& .column-actions": { display: "none" },
4287
+ "&:hover .column-actions": { display: linking ? "none" : "flex" },
4288
+ color: item.missing ? "error.main" : item.linked ? "text.primary" : "#adb5bd",
4289
+ fontWeight: item.linked ? 700 : 400,
4290
+ "&:hover": { bgcolor: linking ? "rgba(245,130,32,.25)" : "rgba(255,255,255,.06)" }
4404
4291
  },
4405
- children: item.name || /* @__PURE__ */ jsx("em", { children: "sem nome" })
4406
- })]
4407
- }, `f:${item.uid}`))]
4408
- })]
4292
+ children: [
4293
+ /* @__PURE__ */ jsx(Box, {
4294
+ component: "span",
4295
+ sx: {
4296
+ width: 14,
4297
+ textAlign: "center",
4298
+ color: "text.secondary"
4299
+ },
4300
+ children: item.isKey ? "🔑" : item.numeric ? "Σ" : ""
4301
+ }),
4302
+ /* @__PURE__ */ jsx(Box, {
4303
+ component: "span",
4304
+ sx: {
4305
+ overflow: "hidden",
4306
+ textOverflow: "ellipsis",
4307
+ whiteSpace: "nowrap"
4308
+ },
4309
+ children: item.name
4310
+ }),
4311
+ /* @__PURE__ */ jsx(Box, {
4312
+ className: "column-actions",
4313
+ sx: {
4314
+ ml: "auto",
4315
+ gap: .25
4316
+ },
4317
+ children: columnActions.map((kind) => /* @__PURE__ */ jsx(Box, {
4318
+ component: "button",
4319
+ type: "button",
4320
+ title: kind === "dimension" ? `Nova dimensão com ${node.name}.${item.name}` : `Nova medida: ${item.numeric ? "soma" : "contagem"} de ${node.name}.${item.name}`,
4321
+ onMouseDown: (event) => event.stopPropagation(),
4322
+ onClick: () => onAddField(kind, item),
4323
+ sx: {
4324
+ border: "1px solid #3a3f47",
4325
+ borderRadius: .5,
4326
+ bgcolor: "#1b1e23",
4327
+ color: kind === "measure" ? "#ffd8a8" : "#a5d8ff",
4328
+ cursor: "pointer",
4329
+ fontSize: 10,
4330
+ lineHeight: "14px",
4331
+ px: .5
4332
+ },
4333
+ children: kind === "dimension" ? "+◇" : "+Σ"
4334
+ }, kind))
4335
+ })
4336
+ ]
4337
+ }, `c:${item.name}`) : /* @__PURE__ */ jsxs(Box, {
4338
+ onMouseDown: (event) => event.stopPropagation(),
4339
+ onClick: () => onFieldClick(item),
4340
+ sx: {
4341
+ height: ROW,
4342
+ display: "flex",
4343
+ alignItems: "center",
4344
+ gap: .75,
4345
+ px: 1,
4346
+ fontSize: 12,
4347
+ cursor: "pointer",
4348
+ color: item.kind === "measure" ? "#ffd8a8" : "#a5d8ff",
4349
+ bgcolor: selectedField === item.uid ? "rgba(245,130,32,.2)" : void 0,
4350
+ "&:hover": { bgcolor: "rgba(255,255,255,.06)" }
4351
+ },
4352
+ children: [/* @__PURE__ */ jsx(Box, {
4353
+ component: "span",
4354
+ sx: {
4355
+ width: 14,
4356
+ textAlign: "center"
4357
+ },
4358
+ children: item.icon
4359
+ }), /* @__PURE__ */ jsx(Box, {
4360
+ component: "span",
4361
+ sx: {
4362
+ overflow: "hidden",
4363
+ textOverflow: "ellipsis",
4364
+ whiteSpace: "nowrap"
4365
+ },
4366
+ children: item.name || /* @__PURE__ */ jsx("em", { children: "sem nome" })
4367
+ })]
4368
+ }, `f:${item.uid}`))]
4369
+ }),
4370
+ /* @__PURE__ */ jsx(Box, {
4371
+ onMouseDown: (event) => onResizeDown(event, {
4372
+ width: true,
4373
+ height: false
4374
+ }),
4375
+ onDoubleClick: onResizeReset,
4376
+ title: "Arraste para mudar a largura (duplo clique: tamanho automático)",
4377
+ sx: {
4378
+ ...resizeHandleSx,
4379
+ top: 0,
4380
+ right: -4,
4381
+ bottom: 8,
4382
+ width: 8,
4383
+ cursor: "ew-resize"
4384
+ }
4385
+ }),
4386
+ !collapsed && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Box, {
4387
+ onMouseDown: (event) => onResizeDown(event, {
4388
+ width: false,
4389
+ height: true
4390
+ }),
4391
+ onDoubleClick: onResizeReset,
4392
+ title: "Arraste para mudar a altura (duplo clique: tamanho automático)",
4393
+ sx: {
4394
+ ...resizeHandleSx,
4395
+ left: 0,
4396
+ right: 8,
4397
+ bottom: -4,
4398
+ height: 8,
4399
+ cursor: "ns-resize"
4400
+ }
4401
+ }), /* @__PURE__ */ jsx(Box, {
4402
+ onMouseDown: (event) => onResizeDown(event, {
4403
+ width: true,
4404
+ height: true
4405
+ }),
4406
+ onDoubleClick: onResizeReset,
4407
+ title: "Arraste para redimensionar (duplo clique: tamanho automático)",
4408
+ sx: {
4409
+ ...resizeHandleSx,
4410
+ right: -4,
4411
+ bottom: -4,
4412
+ width: 14,
4413
+ height: 14,
4414
+ cursor: "nwse-resize",
4415
+ "&::after": {
4416
+ content: "\"\"",
4417
+ position: "absolute",
4418
+ right: 6,
4419
+ bottom: 6,
4420
+ width: 6,
4421
+ height: 6,
4422
+ borderRight: "2px solid #5c636e",
4423
+ borderBottom: "2px solid #5c636e"
4424
+ },
4425
+ "&:hover::after": { borderColor: ROLE_STYLE[node.role].color }
4426
+ }
4427
+ })] })
4428
+ ]
4409
4429
  });
4410
4430
  }
4431
+ const resizeHandleSx = {
4432
+ position: "absolute",
4433
+ zIndex: 1
4434
+ };
4411
4435
  function PropertyBlock({ title, children }) {
4412
4436
  return /* @__PURE__ */ jsxs(Box, {
4413
4437
  sx: {
@@ -7246,4 +7270,4 @@ function ToggleButton$1({ draft, loading, problems, inspecting, onOpen }) {
7246
7270
  //#endregion
7247
7271
  export { DashboardDevtools as default };
7248
7272
 
7249
- //# sourceMappingURL=DashboardDevtools-C8AXaFgw.js.map
7273
+ //# sourceMappingURL=DashboardDevtools-7L93aV1-.js.map