@revisium/schema-toolkit-ui 0.6.9 → 0.6.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -39,7 +39,6 @@ let _uiw_codemirror_theme_github = require("@uiw/codemirror-theme-github");
39
39
  let _uiw_react_codemirror = require("@uiw/react-codemirror");
40
40
  _uiw_react_codemirror = __toESM(_uiw_react_codemirror);
41
41
  let _codemirror_lang_json = require("@codemirror/lang-json");
42
- let _chakra_ui_react_breadcrumb = require("@chakra-ui/react/breadcrumb");
43
42
  let react_icons_md = require("react-icons/md");
44
43
  let _chakra_ui_react_menu = require("@chakra-ui/react/menu");
45
44
  let react_icons_lu = require("react-icons/lu");
@@ -2784,29 +2783,40 @@ const EditableSegment = ({ value, onChange, onBlur, tooltip, placeholder, dataTe
2784
2783
 
2785
2784
  //#endregion
2786
2785
  //#region src/components/Breadcrumbs/SegmentContent.tsx
2786
+ const StyledButton = (0, _chakra_ui_react.chakra)("button");
2787
+ const SHARED_STYLES = {
2788
+ display: "inline-block",
2789
+ borderRadius: BREADCRUMB_BORDER_RADIUS,
2790
+ px: BREADCRUMB_PADDING,
2791
+ py: BREADCRUMB_PADDING,
2792
+ lineHeight: "inherit",
2793
+ fontSize: "inherit",
2794
+ fontFamily: "inherit"
2795
+ };
2787
2796
  const SegmentContent = ({ segment, isHighlighted, onClick }) => {
2788
- if (isHighlighted) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react_breadcrumb.Breadcrumb.CurrentLink, {
2789
- color: CURRENT_COLOR,
2790
- fontWeight: "600",
2791
- "data-testid": segment.dataTestId,
2792
- children: segment.label
2793
- });
2794
- if (onClick) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react_breadcrumb.Breadcrumb.Link, {
2795
- as: "button",
2796
- color: SEGMENT_COLOR,
2797
- borderRadius: BREADCRUMB_BORDER_RADIUS,
2798
- px: BREADCRUMB_PADDING,
2799
- py: BREADCRUMB_PADDING,
2800
- focusRing: "none",
2797
+ if (onClick) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledButton, {
2798
+ type: "button",
2799
+ ...SHARED_STYLES,
2800
+ color: isHighlighted ? CURRENT_COLOR : SEGMENT_COLOR,
2801
+ fontWeight: isHighlighted ? "600" : void 0,
2801
2802
  cursor: "pointer",
2803
+ border: "none",
2804
+ background: "none",
2805
+ outline: "none",
2802
2806
  _hover: { bg: HOVER_BG },
2803
2807
  _focusVisible: { bg: HOVER_BG },
2804
2808
  onClick,
2809
+ "aria-current": isHighlighted ? "page" : void 0,
2805
2810
  "data-testid": segment.dataTestId,
2806
2811
  children: segment.label
2807
2812
  });
2808
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Text, {
2809
- color: SEGMENT_COLOR,
2813
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Box, {
2814
+ as: "span",
2815
+ ...SHARED_STYLES,
2816
+ color: isHighlighted ? CURRENT_COLOR : SEGMENT_COLOR,
2817
+ fontWeight: isHighlighted ? "600" : void 0,
2818
+ cursor: isHighlighted ? "text" : "default",
2819
+ "aria-current": isHighlighted ? "page" : void 0,
2810
2820
  "data-testid": segment.dataTestId,
2811
2821
  children: segment.label
2812
2822
  });
@@ -2816,35 +2826,53 @@ const SegmentContent = ({ segment, isHighlighted, onClick }) => {
2816
2826
  //#region src/components/Breadcrumbs/Breadcrumbs.tsx
2817
2827
  const Breadcrumbs = ({ segments, separator = "/", dataTestId, highlightLast = true, onSegmentClick, editable, action }) => {
2818
2828
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_chakra_ui_react.Flex, {
2829
+ as: "nav",
2830
+ "aria-label": "breadcrumb",
2819
2831
  alignItems: "center",
2820
2832
  gap: BREADCRUMB_PADDING,
2821
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react_breadcrumb.Breadcrumb.Root, {
2833
+ "data-testid": dataTestId,
2834
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_chakra_ui_react.Flex, {
2835
+ as: "ol",
2836
+ alignItems: "center",
2837
+ listStyleType: "none",
2838
+ margin: 0,
2839
+ padding: 0,
2822
2840
  fontWeight: "400",
2823
2841
  fontSize: BREADCRUMB_FONT_SIZE,
2824
- "data-testid": dataTestId,
2825
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_chakra_ui_react_breadcrumb.Breadcrumb.List, {
2826
- fontSize: BREADCRUMB_FONT_SIZE,
2827
- children: [segments.map((segment, index) => {
2828
- const isLast = index === segments.length - 1 && !editable;
2829
- const isHighlighted = isLast && highlightLast;
2830
- const handleClick = onSegmentClick ? () => onSegmentClick(segment, index) : void 0;
2831
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react_breadcrumb.Breadcrumb.Item, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SegmentContent, {
2842
+ gap: BREADCRUMB_PADDING,
2843
+ children: [segments.map((segment, index) => {
2844
+ const isLast = index === segments.length - 1 && !editable;
2845
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Flex, {
2846
+ as: "li",
2847
+ alignItems: "center",
2848
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SegmentContent, {
2832
2849
  segment,
2833
- isHighlighted,
2834
- onClick: isLast ? void 0 : handleClick
2835
- }) }), (!isLast || editable) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react_breadcrumb.Breadcrumb.Separator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Text, {
2850
+ isHighlighted: isLast && highlightLast,
2851
+ onClick: isLast ? void 0 : onSegmentClick ? () => onSegmentClick(segment, index) : void 0
2852
+ })
2853
+ }), (!isLast || editable) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Flex, {
2854
+ as: "li",
2855
+ "aria-hidden": true,
2856
+ alignItems: "center",
2857
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Text, {
2836
2858
  color: SEPARATOR_COLOR,
2859
+ px: BREADCRUMB_PADDING,
2860
+ lineHeight: 1,
2837
2861
  children: separator
2838
- }) })] }, `${segment.label}-${index}`);
2839
- }), editable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react_breadcrumb.Breadcrumb.Item, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EditableSegment, {
2862
+ })
2863
+ })] }, `${segment.label}-${index}`);
2864
+ }), editable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Flex, {
2865
+ as: "li",
2866
+ alignItems: "center",
2867
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EditableSegment, {
2840
2868
  value: editable.value,
2841
2869
  onChange: editable.onChange,
2842
2870
  onBlur: editable.onBlur,
2843
2871
  tooltip: editable.tooltip,
2844
2872
  placeholder: editable.placeholder,
2845
2873
  dataTestId: editable.dataTestId
2846
- }) })]
2847
- })
2874
+ })
2875
+ })]
2848
2876
  }), action]
2849
2877
  });
2850
2878
  };
@@ -5515,6 +5543,7 @@ var RowEditorVM = class {
5515
5543
  }
5516
5544
  revert() {
5517
5545
  this._rowModel.revert();
5546
+ this._rowId = this._initialRowId;
5518
5547
  this._prevPatchCount = 0;
5519
5548
  }
5520
5549
  dispose() {
@@ -14368,7 +14397,7 @@ const TableEditor = (0, mobx_react_lite.observer)(({ viewModel, useWindowScroll
14368
14397
  px: 3,
14369
14398
  pt: "32px",
14370
14399
  pb: "48px",
14371
- alignItems: "center",
14400
+ alignItems: "flex-start",
14372
14401
  justifyContent: "space-between",
14373
14402
  ...useWindowScroll && {
14374
14403
  position: "sticky",