@cere/cere-design-system 0.0.31 → 0.0.32
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.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2688,6 +2688,8 @@ interface CodeEditorStatusBarProps {
|
|
|
2688
2688
|
* When provided, default rendering is skipped entirely.
|
|
2689
2689
|
*/
|
|
2690
2690
|
renderStatusBar?: (props: CodeEditorStatusBarRenderProps) => React__default.ReactNode;
|
|
2691
|
+
/** Called when the user clicks the branch name in the status bar */
|
|
2692
|
+
onBranchClick?: () => void;
|
|
2691
2693
|
/** Props for the outer container */
|
|
2692
2694
|
containerProps?: BoxProps;
|
|
2693
2695
|
}
|
|
@@ -2749,6 +2751,8 @@ interface CodeEditorWorkspaceProps extends Pick<UseCodeEditorWorkspaceOptions, '
|
|
|
2749
2751
|
onWorkspaceReady?: (workspace: UseCodeEditorWorkspaceReturn) => void;
|
|
2750
2752
|
/** Called when the user presses Ctrl+S / Cmd+S. Receives all dirty files. */
|
|
2751
2753
|
onSave?: (dirtyFiles: CodeEditorFile[]) => void;
|
|
2754
|
+
/** Called when the user clicks the branch name in the status bar */
|
|
2755
|
+
onBranchClick?: () => void;
|
|
2752
2756
|
}
|
|
2753
2757
|
/**
|
|
2754
2758
|
* Convenience composed workspace that combines `CodeEditorFileTree`,
|
package/dist/index.d.ts
CHANGED
|
@@ -2688,6 +2688,8 @@ interface CodeEditorStatusBarProps {
|
|
|
2688
2688
|
* When provided, default rendering is skipped entirely.
|
|
2689
2689
|
*/
|
|
2690
2690
|
renderStatusBar?: (props: CodeEditorStatusBarRenderProps) => React__default.ReactNode;
|
|
2691
|
+
/** Called when the user clicks the branch name in the status bar */
|
|
2692
|
+
onBranchClick?: () => void;
|
|
2691
2693
|
/** Props for the outer container */
|
|
2692
2694
|
containerProps?: BoxProps;
|
|
2693
2695
|
}
|
|
@@ -2749,6 +2751,8 @@ interface CodeEditorWorkspaceProps extends Pick<UseCodeEditorWorkspaceOptions, '
|
|
|
2749
2751
|
onWorkspaceReady?: (workspace: UseCodeEditorWorkspaceReturn) => void;
|
|
2750
2752
|
/** Called when the user presses Ctrl+S / Cmd+S. Receives all dirty files. */
|
|
2751
2753
|
onSave?: (dirtyFiles: CodeEditorFile[]) => void;
|
|
2754
|
+
/** Called when the user clicks the branch name in the status bar */
|
|
2755
|
+
onBranchClick?: () => void;
|
|
2752
2756
|
}
|
|
2753
2757
|
/**
|
|
2754
2758
|
* Convenience composed workspace that combines `CodeEditorFileTree`,
|
package/dist/index.js
CHANGED
|
@@ -9672,6 +9672,7 @@ var CodeEditorStatusBar = ({
|
|
|
9672
9672
|
cursorPosition,
|
|
9673
9673
|
items,
|
|
9674
9674
|
renderStatusBar,
|
|
9675
|
+
onBranchClick,
|
|
9675
9676
|
containerProps
|
|
9676
9677
|
}) => {
|
|
9677
9678
|
if (renderStatusBar) {
|
|
@@ -9714,12 +9715,14 @@ var CodeEditorStatusBar = ({
|
|
|
9714
9715
|
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
9715
9716
|
import_material76.Box,
|
|
9716
9717
|
{
|
|
9718
|
+
onClick: onBranchClick,
|
|
9717
9719
|
sx: {
|
|
9718
9720
|
display: "flex",
|
|
9719
9721
|
alignItems: "center",
|
|
9720
9722
|
gap: 0.5,
|
|
9721
|
-
cursor: "default",
|
|
9722
|
-
overflow: "hidden"
|
|
9723
|
+
cursor: onBranchClick ? "pointer" : "default",
|
|
9724
|
+
overflow: "hidden",
|
|
9725
|
+
"&:hover": onBranchClick ? { opacity: 0.8 } : void 0
|
|
9723
9726
|
},
|
|
9724
9727
|
children: [
|
|
9725
9728
|
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
@@ -9866,7 +9869,8 @@ var CodeEditorWorkspace = ({
|
|
|
9866
9869
|
showStatusBar = true,
|
|
9867
9870
|
statusBarItems,
|
|
9868
9871
|
onWorkspaceReady,
|
|
9869
|
-
onSave
|
|
9872
|
+
onSave,
|
|
9873
|
+
onBranchClick
|
|
9870
9874
|
}) => {
|
|
9871
9875
|
const workspace = useCodeEditorWorkspace({
|
|
9872
9876
|
files,
|
|
@@ -9918,7 +9922,8 @@ var CodeEditorWorkspace = ({
|
|
|
9918
9922
|
gitInfo,
|
|
9919
9923
|
language: workspace.activeFile?.language,
|
|
9920
9924
|
cursorPosition: workspace.cursorPosition ?? void 0,
|
|
9921
|
-
items: statusBarItems
|
|
9925
|
+
items: statusBarItems,
|
|
9926
|
+
onBranchClick
|
|
9922
9927
|
};
|
|
9923
9928
|
const statusBarElement = showStatusBar ? renderStatusBar ? renderStatusBar({ ...statusBarProps, workspace }) : /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(CodeEditorStatusBar, { ...statusBarProps }) : null;
|
|
9924
9929
|
const editorElement = renderEditor ? renderEditor(workspace) : workspace.activeFile ? /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|