@lax-wp/design-system 0.8.24 → 0.8.26

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,10 +1,6 @@
1
1
  import { type FC } from "react";
2
2
  import { type ReactCodeMirrorRef } from "@uiw/react-codemirror";
3
- declare const TABS: ("JSON" | "Grid")[];
4
- export type TTabKey = (typeof TABS)[number];
5
- /**
6
- * Toolbar context passed to the `renderToolbarActions` callback.
7
- */
3
+ import type { CodeBlockInfo } from "../../../types";
8
4
  export interface CodeEditorBetaToolbarContext {
9
5
  /** The CodeMirror editor view ref */
10
6
  editorRef: ReactCodeMirrorRef | null;
@@ -19,9 +15,6 @@ export interface CodeEditorBetaToolbarContext {
19
15
  /** Current active tab (JSON or Grid) */
20
16
  activeTab: "JSON" | "Grid";
21
17
  }
22
- /**
23
- * Props for the experimental CodeMirror-based CodeEditor.
24
- */
25
18
  export interface CodeEditorBetaProps {
26
19
  /** The code content to display in the editor */
27
20
  value: string;
@@ -49,9 +42,9 @@ export interface CodeEditorBetaProps {
49
42
  className?: string;
50
43
  /** Auto-format JSON on mount */
51
44
  enableAutoFormatting?: boolean;
52
- /** Disables parent save button during Python validation (mirrors original CodeEditor) */
45
+ /** Disables parent save button during Python validation */
53
46
  setIsDisableSave?: (flag: boolean) => void;
54
- /** API to check Python syntax — returns an error object if invalid */
47
+ /** API to check Python syntax */
55
48
  checkSyntaxAPI?: (code: string) => Promise<{
56
49
  data: {
57
50
  error?: {
@@ -61,7 +54,7 @@ export interface CodeEditorBetaProps {
61
54
  };
62
55
  };
63
56
  }>;
64
- /** API to format Python code — returns formatted_code string */
57
+ /** API to format Python code */
65
58
  formatCodeAPI?: (code: string) => Promise<{
66
59
  data: {
67
60
  formatted_code?: string;
@@ -69,12 +62,14 @@ export interface CodeEditorBetaProps {
69
62
  }>;
70
63
  /** Custom toolbar actions render function */
71
64
  renderToolbarActions?: (context: CodeEditorBetaToolbarContext) => React.ReactNode;
65
+ /** Callback fired when the user clicks inside a code block. Receives the innermost block. */
66
+ onBlockClick?: (block: CodeBlockInfo) => void;
67
+ /** When set, the editor searches for this text, scrolls to the match, and highlights the enclosing block. */
68
+ focusBlock?: string;
72
69
  }
73
70
  /**
74
71
  * CodeEditorBeta — experimental CodeMirror 6 replacement for the Monaco-based CodeEditor.
75
72
  *
76
- * Smaller bundle, no web workers, same toolbar UX. Drops Codeium AI completions.
77
- *
78
73
  * @example
79
74
  * ```tsx
80
75
  * <CodeEditorBeta
@@ -82,8 +77,9 @@ export interface CodeEditorBetaProps {
82
77
  * onChange={setJsonString}
83
78
  * language="json"
84
79
  * height="400px"
80
+ * onBlockClick={(block) => console.log(block)}
81
+ * focusBlock="customer"
85
82
  * />
86
83
  * ```
87
84
  */
88
85
  export declare const CodeEditorBeta: FC<CodeEditorBetaProps>;
89
- export {};
@@ -1,3 +1,4 @@
1
+ import { type PopoverProps } from "antd";
1
2
  import "./styles.css";
2
3
  /**
3
4
  * Available placement options for the Popper
@@ -37,6 +38,8 @@ export interface PopperProps {
37
38
  "aria-label"?: string;
38
39
  /** Whether trigger is disabled */
39
40
  disabled?: boolean;
41
+ /** Trigger type */
42
+ trigger?: PopoverProps['trigger'];
40
43
  }
41
44
  /**
42
45
  * Popper component provides positioned floating content relative to a trigger element
@@ -1,6 +1,6 @@
1
1
  import CreatableSelect from "react-select/creatable";
2
2
  import type { LabelType } from "../../data-display/label/Label";
3
- import type { ComponentProps } from "react";
3
+ import { type ComponentProps } from "react";
4
4
  /**
5
5
  * Option type for the CreatableSelect component
6
6
  */