@lax-wp/design-system 0.8.3 → 0.8.5-beta.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.
- package/dist/components/data-display/code-editor-beta/CodeEditorBeta.d.ts +89 -0
- package/dist/components/data-display/code-editor-beta/index.d.ts +4 -0
- package/dist/components/data-display/code-editor-beta/usePythonSyntaxCM.d.ts +56 -0
- package/dist/components/navigation/tabs/Tabs.d.ts +1 -1
- package/dist/components/navigation/tabs/types.d.ts +2 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.es.js +30859 -10666
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +54 -36
- package/dist/index.umd.js.map +1 -1
- package/dist/types/index.d.ts +24 -0
- package/package.json +6 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -19,6 +19,21 @@ export interface CodeEditorToolbarContext {
|
|
|
19
19
|
isEditMode: boolean;
|
|
20
20
|
activeTab: 'JSON' | 'Grid';
|
|
21
21
|
}
|
|
22
|
+
/** Information about a folding range (code block) at the cursor position. */
|
|
23
|
+
export interface CodeBlockInfo {
|
|
24
|
+
/** 1-based start line of the folding range */
|
|
25
|
+
startLine: number;
|
|
26
|
+
/** 1-based end line of the folding range */
|
|
27
|
+
endLine: number;
|
|
28
|
+
/** The raw text content of the block */
|
|
29
|
+
text: string;
|
|
30
|
+
/** The folding kind if available ('comment' | 'imports' | 'region' | undefined) */
|
|
31
|
+
kind?: string;
|
|
32
|
+
/** 1-based line where the cursor was when clicked */
|
|
33
|
+
cursorLine: number;
|
|
34
|
+
/** 1-based column where the cursor was when clicked */
|
|
35
|
+
cursorColumn: number;
|
|
36
|
+
}
|
|
22
37
|
export interface CodeEditorProps {
|
|
23
38
|
value: string;
|
|
24
39
|
onChange?: (value: string) => void;
|
|
@@ -38,6 +53,15 @@ export interface CodeEditorProps {
|
|
|
38
53
|
className?: string;
|
|
39
54
|
enableAutoFormatting?: boolean;
|
|
40
55
|
renderToolbarActions?: (context: CodeEditorToolbarContext) => React.ReactNode;
|
|
56
|
+
/** Callback fired when the user clicks inside a code block (folding range). Receives the innermost block. */
|
|
57
|
+
onBlockClick?: (block: CodeBlockInfo) => void;
|
|
58
|
+
/**
|
|
59
|
+
* When set, the editor searches for this text, scrolls to the match,
|
|
60
|
+
* and highlights the enclosing code block (folding range / bracket pair).
|
|
61
|
+
* For JSON, passing `"customer"` navigates to the `"customer": { ... }` block.
|
|
62
|
+
* Change the value to trigger navigation; set to `undefined` to clear.
|
|
63
|
+
*/
|
|
64
|
+
focusBlock?: string;
|
|
41
65
|
}
|
|
42
66
|
export interface ThemeContextType {
|
|
43
67
|
theme: 'light' | 'dark';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lax-wp/design-system",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.5-beta.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.umd.js",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
@@ -38,6 +38,11 @@
|
|
|
38
38
|
"format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,md}\""
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
+
"@codemirror/autocomplete": "^6.20.0",
|
|
42
|
+
"@codemirror/lang-json": "^6.0.2",
|
|
43
|
+
"@codemirror/lang-python": "^6.2.1",
|
|
44
|
+
"@codemirror/language": "^6.12.2",
|
|
45
|
+
"@uiw/react-codemirror": "^4.25.5",
|
|
41
46
|
"array-move": "2.2.2",
|
|
42
47
|
"classnames": "^2.5.1",
|
|
43
48
|
"clsx": "^2.1.1",
|