@keboola/design 6.5.0 → 9.0.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.
Files changed (49) hide show
  1. package/AGENTS.md +7 -7
  2. package/COMPONENT-API.md +3 -9
  3. package/README.md +1 -1
  4. package/dist/charts.cjs +22 -22
  5. package/dist/charts.cjs.map +1 -1
  6. package/dist/charts.d.cts +5 -5
  7. package/dist/charts.d.ts +5 -5
  8. package/dist/charts.js +22 -22
  9. package/dist/charts.js.map +1 -1
  10. package/dist/editors.cjs +904 -550
  11. package/dist/editors.cjs.map +1 -1
  12. package/dist/editors.d.cts +35 -5
  13. package/dist/editors.d.ts +35 -5
  14. package/dist/editors.js +908 -537
  15. package/dist/editors.js.map +1 -1
  16. package/dist/icons.cjs +23817 -45
  17. package/dist/icons.cjs.map +1 -1
  18. package/dist/icons.d.cts +12 -3
  19. package/dist/icons.d.ts +12 -3
  20. package/dist/icons.js +297 -40
  21. package/dist/icons.js.map +1 -1
  22. package/dist/index.cjs +4702 -4755
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +183 -169
  25. package/dist/index.d.ts +183 -169
  26. package/dist/index.js +4700 -4754
  27. package/dist/index.js.map +1 -1
  28. package/dist/markdown-editor.cjs +817 -923
  29. package/dist/markdown-editor.cjs.map +1 -1
  30. package/dist/markdown-editor.js +818 -923
  31. package/dist/markdown-editor.js.map +1 -1
  32. package/dist/mermaid.cjs +308 -425
  33. package/dist/mermaid.cjs.map +1 -1
  34. package/dist/mermaid.d.cts +5 -1
  35. package/dist/mermaid.d.ts +5 -1
  36. package/dist/mermaid.js +310 -408
  37. package/dist/mermaid.js.map +1 -1
  38. package/dist/rjsf.cjs +1704 -1234
  39. package/dist/rjsf.cjs.map +1 -1
  40. package/dist/rjsf.js +1708 -1237
  41. package/dist/rjsf.js.map +1 -1
  42. package/dist/styles.css +2 -5
  43. package/dist/testing.cjs +86 -82
  44. package/dist/testing.cjs.map +1 -1
  45. package/dist/testing.js +86 -82
  46. package/dist/testing.js.map +1 -1
  47. package/package.json +26 -19
  48. package/src/styles.css +125 -105
  49. package/src/theme.css +264 -0
@@ -1,20 +1,50 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
+ import { CompletionSource } from '@codemirror/autocomplete';
3
4
  import { SQLNamespace } from '@codemirror/lang-sql';
4
5
  import { EditorView, EditorState, KeyBinding } from '@uiw/react-codemirror';
5
6
  import { SqlDialectName } from '@keboola/codemirror-lang-sql';
6
7
  export { SqlDialectName } from '@keboola/codemirror-lang-sql';
7
8
  import { M as MergeConflict, C as ChangeClassification } from './constants-D3gaMY-W.cjs';
8
9
 
9
- type LANGUAGE_MODE = 'application/json' | 'text/x-python' | 'text/x-sql' | 'text/x-sfsql' | 'text/x-plsql' | 'text/x-rsrc' | 'text/x-sh' | 'text/javascript' | 'text/typescript';
10
+ declare const LANGUAGE_MODES: readonly ["application/json", "text/plain", "text/x-python", "text/x-sql", "text/x-mysql", "text/x-pgsql", "text/x-mssql", "text/x-sfsql", "text/x-plsql", "text/x-rsrc", "text/x-sh", "text/x-toml", "text/jsonnet", "text/x-dbt", "text/javascript", "text/typescript"];
11
+ type LANGUAGE_MODE = (typeof LANGUAGE_MODES)[number];
12
+ declare const isLanguageMode: (mode: string) => mode is LANGUAGE_MODE;
13
+
14
+ type EditorVariable = {
15
+ name: string;
16
+ value?: string;
17
+ };
10
18
 
11
19
  type Props$2 = {
12
20
  value: string;
13
21
  previousValue?: string;
14
22
  mode?: LANGUAGE_MODE;
15
23
  placeholder?: string;
24
+ /** Names the editable region for screen readers — the editor has no visible label of its own. */
25
+ ariaLabel?: string;
26
+ /**
27
+ * Highlights every occurrence and scrolls the selected one into view. The find
28
+ * UI is the caller's — pass the query it holds, and omit both props entirely to
29
+ * leave the search extension uninstalled.
30
+ */
31
+ searchQuery?: string;
32
+ searchMatchIndex?: number;
16
33
  readOnly?: boolean;
17
34
  autocompletions?: string[];
35
+ /**
36
+ * Completions that depend on where the cursor is — a column list offered only
37
+ * after its table, say. Wins over both `autocompletions` and `completeAny`,
38
+ * which stay the right props for a list that is the same everywhere in the
39
+ * document and for having no list at all. Like them, it opens on typing.
40
+ */
41
+ completionSource?: CompletionSource;
42
+ /**
43
+ * Configuration variables, completed into `{{name}}`. Independent of
44
+ * `completionSource`: both are offered, so a caller keeps its own completions and
45
+ * gets variables spelled the way the rest of the platform writes them.
46
+ */
47
+ variables?: EditorVariable[];
18
48
  extraKeys?: Record<string, () => void>;
19
49
  withToggleCommentHint?: boolean;
20
50
  withAutofocus?: boolean;
@@ -31,10 +61,10 @@ type Props$2 = {
31
61
  readOnly: true;
32
62
  onChange?: never;
33
63
  } | {
34
- readOnly?: false;
64
+ readOnly?: boolean;
35
65
  onChange: (value: string) => void;
36
66
  });
37
- declare const CodeEditor: ({ value, previousValue, onChange, mode, placeholder, readOnly, autocompletions, extraKeys, withToggleCommentHint, withAutofocus, withLineNumbers, withLineWrapping, withCollapseUnchanged, withCopyButton, completeAny, help, helpPostfix, renderAdditionalButtons, className, }: Props$2) => react_jsx_runtime.JSX.Element;
67
+ declare const CodeEditor: ({ value, previousValue, onChange, mode, placeholder, ariaLabel, searchQuery, searchMatchIndex, readOnly, autocompletions, completionSource, variables, extraKeys, withToggleCommentHint, withAutofocus, withLineNumbers, withLineWrapping, withCollapseUnchanged, withCopyButton, completeAny, help, helpPostfix, renderAdditionalButtons, className, }: Props$2) => react_jsx_runtime.JSX.Element;
38
68
 
39
69
  type HighlightedLines = {
40
70
  from: number;
@@ -67,7 +97,7 @@ type Props$1 = {
67
97
  lineNumbers?: boolean;
68
98
  className?: string;
69
99
  schema?: SQLNamespace;
70
- variables?: string[];
100
+ variables?: EditorVariable[];
71
101
  defaultSchema?: string;
72
102
  defaultDatabase?: string;
73
103
  highlightLines?: HighlightedLines;
@@ -108,4 +138,4 @@ type Props = {
108
138
  };
109
139
  declare const MergeEditor: ({ mergeValue, handleMergeChange, leftText, rightText, leftConflicts, rightConflicts, leftHighlightedLines, rightHighlightedLines, leftClassification, rightClassification, mergeHighlightedLines, mergeClassification, acceptLeft, acceptRight, dismissLeft, dismissRight, leftHeader, middleHeader, middleHeaderClassName, middleClassName, rightHeader, className, leftDeleted, rightDeleted, }: Props) => react_jsx_runtime.JSX.Element;
110
140
 
111
- export { CodeEditor, MergeEditor, SqlEditor };
141
+ export { CodeEditor, type EditorVariable, type LANGUAGE_MODE, LANGUAGE_MODES, MergeEditor, SqlEditor, isLanguageMode };
package/dist/editors.d.ts CHANGED
@@ -1,20 +1,50 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
+ import { CompletionSource } from '@codemirror/autocomplete';
3
4
  import { SQLNamespace } from '@codemirror/lang-sql';
4
5
  import { EditorView, EditorState, KeyBinding } from '@uiw/react-codemirror';
5
6
  import { SqlDialectName } from '@keboola/codemirror-lang-sql';
6
7
  export { SqlDialectName } from '@keboola/codemirror-lang-sql';
7
8
  import { M as MergeConflict, C as ChangeClassification } from './constants-D3gaMY-W.js';
8
9
 
9
- type LANGUAGE_MODE = 'application/json' | 'text/x-python' | 'text/x-sql' | 'text/x-sfsql' | 'text/x-plsql' | 'text/x-rsrc' | 'text/x-sh' | 'text/javascript' | 'text/typescript';
10
+ declare const LANGUAGE_MODES: readonly ["application/json", "text/plain", "text/x-python", "text/x-sql", "text/x-mysql", "text/x-pgsql", "text/x-mssql", "text/x-sfsql", "text/x-plsql", "text/x-rsrc", "text/x-sh", "text/x-toml", "text/jsonnet", "text/x-dbt", "text/javascript", "text/typescript"];
11
+ type LANGUAGE_MODE = (typeof LANGUAGE_MODES)[number];
12
+ declare const isLanguageMode: (mode: string) => mode is LANGUAGE_MODE;
13
+
14
+ type EditorVariable = {
15
+ name: string;
16
+ value?: string;
17
+ };
10
18
 
11
19
  type Props$2 = {
12
20
  value: string;
13
21
  previousValue?: string;
14
22
  mode?: LANGUAGE_MODE;
15
23
  placeholder?: string;
24
+ /** Names the editable region for screen readers — the editor has no visible label of its own. */
25
+ ariaLabel?: string;
26
+ /**
27
+ * Highlights every occurrence and scrolls the selected one into view. The find
28
+ * UI is the caller's — pass the query it holds, and omit both props entirely to
29
+ * leave the search extension uninstalled.
30
+ */
31
+ searchQuery?: string;
32
+ searchMatchIndex?: number;
16
33
  readOnly?: boolean;
17
34
  autocompletions?: string[];
35
+ /**
36
+ * Completions that depend on where the cursor is — a column list offered only
37
+ * after its table, say. Wins over both `autocompletions` and `completeAny`,
38
+ * which stay the right props for a list that is the same everywhere in the
39
+ * document and for having no list at all. Like them, it opens on typing.
40
+ */
41
+ completionSource?: CompletionSource;
42
+ /**
43
+ * Configuration variables, completed into `{{name}}`. Independent of
44
+ * `completionSource`: both are offered, so a caller keeps its own completions and
45
+ * gets variables spelled the way the rest of the platform writes them.
46
+ */
47
+ variables?: EditorVariable[];
18
48
  extraKeys?: Record<string, () => void>;
19
49
  withToggleCommentHint?: boolean;
20
50
  withAutofocus?: boolean;
@@ -31,10 +61,10 @@ type Props$2 = {
31
61
  readOnly: true;
32
62
  onChange?: never;
33
63
  } | {
34
- readOnly?: false;
64
+ readOnly?: boolean;
35
65
  onChange: (value: string) => void;
36
66
  });
37
- declare const CodeEditor: ({ value, previousValue, onChange, mode, placeholder, readOnly, autocompletions, extraKeys, withToggleCommentHint, withAutofocus, withLineNumbers, withLineWrapping, withCollapseUnchanged, withCopyButton, completeAny, help, helpPostfix, renderAdditionalButtons, className, }: Props$2) => react_jsx_runtime.JSX.Element;
67
+ declare const CodeEditor: ({ value, previousValue, onChange, mode, placeholder, ariaLabel, searchQuery, searchMatchIndex, readOnly, autocompletions, completionSource, variables, extraKeys, withToggleCommentHint, withAutofocus, withLineNumbers, withLineWrapping, withCollapseUnchanged, withCopyButton, completeAny, help, helpPostfix, renderAdditionalButtons, className, }: Props$2) => react_jsx_runtime.JSX.Element;
38
68
 
39
69
  type HighlightedLines = {
40
70
  from: number;
@@ -67,7 +97,7 @@ type Props$1 = {
67
97
  lineNumbers?: boolean;
68
98
  className?: string;
69
99
  schema?: SQLNamespace;
70
- variables?: string[];
100
+ variables?: EditorVariable[];
71
101
  defaultSchema?: string;
72
102
  defaultDatabase?: string;
73
103
  highlightLines?: HighlightedLines;
@@ -108,4 +138,4 @@ type Props = {
108
138
  };
109
139
  declare const MergeEditor: ({ mergeValue, handleMergeChange, leftText, rightText, leftConflicts, rightConflicts, leftHighlightedLines, rightHighlightedLines, leftClassification, rightClassification, mergeHighlightedLines, mergeClassification, acceptLeft, acceptRight, dismissLeft, dismissRight, leftHeader, middleHeader, middleHeaderClassName, middleClassName, rightHeader, className, leftDeleted, rightDeleted, }: Props) => react_jsx_runtime.JSX.Element;
110
140
 
111
- export { CodeEditor, MergeEditor, SqlEditor };
141
+ export { CodeEditor, type EditorVariable, type LANGUAGE_MODE, LANGUAGE_MODES, MergeEditor, SqlEditor, isLanguageMode };