@webx-ui/core 0.16.0 → 0.18.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/CodeEditor/CodeEditor.d.ts +44 -0
- package/dist/components/CodeEditor/highlight.d.ts +7 -0
- package/dist/components/CodeEditor/index.d.ts +2 -0
- package/dist/components/CodeEditor/languages.d.ts +14 -0
- package/dist/components/CodeEditor/types.d.ts +56 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/dist/components/Countdown/Countdown.d.ts +1 -1
- package/dist/components/Dialog/Dialog.d.ts +1 -1
- package/dist/components/Icon/icons.d.ts +1 -0
- package/dist/components/ImageEditor/ImageEditor.d.ts +2 -2
- package/dist/components/InputNumber/InputNumber.d.ts +1 -1
- package/dist/components/Scrollbar/Scrollbar.d.ts +1 -1
- package/dist/components/Text/Text.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Upload/Upload.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/index.js +5483 -5208
- package/dist/index.js.map +1 -1
- package/dist/internal/ImageEditorDialog.d.ts +4 -4
- package/dist/style.css +1 -1
- package/package.json +16 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Extension } from '@codemirror/state';
|
|
2
|
+
import { EditorView } from '@codemirror/view';
|
|
3
|
+
import { CodeEditorDiagnostic, CodeEditorProps } from './types';
|
|
4
|
+
type __VLS_Props = CodeEditorProps;
|
|
5
|
+
declare function format(): boolean;
|
|
6
|
+
type __VLS_PublicProps = {
|
|
7
|
+
modelValue?: string;
|
|
8
|
+
} & __VLS_Props;
|
|
9
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
10
|
+
view: import('vue').ShallowRef<EditorView | null, EditorView | null>;
|
|
11
|
+
focus: () => void | undefined;
|
|
12
|
+
format: typeof format;
|
|
13
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
14
|
+
change: (value: string) => any;
|
|
15
|
+
"update:modelValue": (value: string) => any;
|
|
16
|
+
blur: () => any;
|
|
17
|
+
focus: () => any;
|
|
18
|
+
lint: (diagnostics: CodeEditorDiagnostic[]) => any;
|
|
19
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
|
+
onChange?: ((value: string) => any) | undefined;
|
|
21
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
22
|
+
onBlur?: (() => any) | undefined;
|
|
23
|
+
onFocus?: (() => any) | undefined;
|
|
24
|
+
onLint?: ((diagnostics: CodeEditorDiagnostic[]) => any) | undefined;
|
|
25
|
+
}>, {
|
|
26
|
+
size: import('../..').ControlSize;
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
placeholder: string;
|
|
29
|
+
ariaLabel: string;
|
|
30
|
+
status: import('../..').ControlStatus;
|
|
31
|
+
id: string;
|
|
32
|
+
language: import('./types').CodeEditorLanguage;
|
|
33
|
+
readonly: boolean;
|
|
34
|
+
minHeight: string;
|
|
35
|
+
maxHeight: string;
|
|
36
|
+
lineNumbers: boolean;
|
|
37
|
+
lineWrapping: boolean;
|
|
38
|
+
tabSize: number;
|
|
39
|
+
lint: boolean;
|
|
40
|
+
extensions: Extension[];
|
|
41
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
42
|
+
host: HTMLDivElement;
|
|
43
|
+
}, any>;
|
|
44
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HighlightStyle } from '@codemirror/language';
|
|
2
|
+
/**
|
|
3
|
+
* Syntax colours come from the semantic tokens, so both themes are covered by the
|
|
4
|
+
* same style and a project that re-tints its primary colour re-tints its code too.
|
|
5
|
+
* The palette is deliberately small: five roles, not a rainbow.
|
|
6
|
+
*/
|
|
7
|
+
export declare const highlightStyle: HighlightStyle;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Extension } from '@codemirror/state';
|
|
2
|
+
import { LintSource } from '@codemirror/lint';
|
|
3
|
+
import { CodeEditorLanguage } from './types';
|
|
4
|
+
interface LanguageSupport {
|
|
5
|
+
extension: () => Extension;
|
|
6
|
+
/** Only JSON has a parser cheap enough to run on every keystroke. */
|
|
7
|
+
linter?: () => LintSource;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Each entry is a factory rather than an instance: language support carries
|
|
11
|
+
* state fields, and CodeMirror expects a fresh one per editor.
|
|
12
|
+
*/
|
|
13
|
+
export declare const LANGUAGES: Record<CodeEditorLanguage, LanguageSupport>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Extension } from '@codemirror/state';
|
|
2
|
+
import { EditorView } from '@codemirror/view';
|
|
3
|
+
import { ControlSize, ControlStatus } from '../../composables/useFormField';
|
|
4
|
+
/** The languages the editor highlights out of the box. `plain` highlights nothing. */
|
|
5
|
+
export type CodeEditorLanguage = 'json' | 'javascript' | 'typescript' | 'html' | 'css' | 'markdown' | 'yaml' | 'php' | 'plain';
|
|
6
|
+
export interface CodeEditorDiagnostic {
|
|
7
|
+
/** Offset of the first character the problem covers. */
|
|
8
|
+
from: number;
|
|
9
|
+
/** Offset just past the last character it covers. */
|
|
10
|
+
to: number;
|
|
11
|
+
severity: 'error' | 'warning' | 'info' | 'hint';
|
|
12
|
+
message: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CodeEditorProps {
|
|
15
|
+
language?: CodeEditorLanguage;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
readonly?: boolean;
|
|
19
|
+
size?: ControlSize;
|
|
20
|
+
status?: ControlStatus;
|
|
21
|
+
id?: string;
|
|
22
|
+
/** Accessible label used when there is no visible `<label>`. */
|
|
23
|
+
ariaLabel?: string;
|
|
24
|
+
/** Height of the editing area before it starts growing. */
|
|
25
|
+
minHeight?: string;
|
|
26
|
+
/** Height at which the editor stops growing and scrolls instead. */
|
|
27
|
+
maxHeight?: string;
|
|
28
|
+
lineNumbers?: boolean;
|
|
29
|
+
/** Wrap long lines instead of scrolling horizontally. */
|
|
30
|
+
lineWrapping?: boolean;
|
|
31
|
+
/** Width of one indentation step, in spaces; Tab inserts this many. */
|
|
32
|
+
tabSize?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Check the document with the language's own linter and underline what it finds.
|
|
35
|
+
* Only JSON ships with one; the flag is ignored elsewhere.
|
|
36
|
+
*/
|
|
37
|
+
lint?: boolean;
|
|
38
|
+
/** Extra CodeMirror extensions, for anything this component does not wrap. */
|
|
39
|
+
extensions?: Extension[];
|
|
40
|
+
}
|
|
41
|
+
export interface CodeEditorEmits {
|
|
42
|
+
change: [value: string];
|
|
43
|
+
focus: [];
|
|
44
|
+
blur: [];
|
|
45
|
+
/** The linter ran; an empty list means the document is valid. */
|
|
46
|
+
lint: [diagnostics: CodeEditorDiagnostic[]];
|
|
47
|
+
}
|
|
48
|
+
export interface CodeEditorExposed {
|
|
49
|
+
view: EditorView | null;
|
|
50
|
+
focus: () => void;
|
|
51
|
+
/**
|
|
52
|
+
* Re-indents a JSON document with `tabSize` spaces. Returns `false` and leaves the
|
|
53
|
+
* text alone when it does not parse or the language is not JSON.
|
|
54
|
+
*/
|
|
55
|
+
format: () => boolean;
|
|
56
|
+
}
|
|
@@ -19,7 +19,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
|
|
|
19
19
|
clearable: boolean;
|
|
20
20
|
status: import('../..').ControlStatus;
|
|
21
21
|
id: string;
|
|
22
|
-
presets: string[];
|
|
23
22
|
readonly: boolean;
|
|
23
|
+
presets: string[];
|
|
24
24
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
25
25
|
export default _default;
|
|
@@ -28,9 +28,9 @@ declare const __VLS_component: import('vue').DefineComponent<CountdownProps, {
|
|
|
28
28
|
title: string;
|
|
29
29
|
tone: import('..').TextTone;
|
|
30
30
|
align: import('..').TextAlign;
|
|
31
|
+
format: string;
|
|
31
32
|
prefix: string;
|
|
32
33
|
suffix: string;
|
|
33
|
-
format: string;
|
|
34
34
|
interval: number;
|
|
35
35
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
36
36
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -82,10 +82,10 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
82
82
|
closeLabel: string;
|
|
83
83
|
width: number | string;
|
|
84
84
|
scroll: import('./types').DialogScroll;
|
|
85
|
+
minHeight: number;
|
|
85
86
|
height: number | string;
|
|
86
87
|
stickyFooter: boolean;
|
|
87
88
|
minWidth: number;
|
|
88
|
-
minHeight: number;
|
|
89
89
|
sidebarWidth: number | string;
|
|
90
90
|
closeOnOverlay: boolean;
|
|
91
91
|
closeOnEscape: boolean;
|
|
@@ -43,6 +43,7 @@ export declare const builtinIcons: {
|
|
|
43
43
|
readonly user: "<circle cx=\"12\" cy=\"8\" r=\"3.75\"/><path d=\"M4.5 20a7.5 7.5 0 0 1 15 0\"/>";
|
|
44
44
|
readonly users: "<circle cx=\"9.5\" cy=\"8.5\" r=\"3.4\"/><path d=\"M2.5 20a7 7 0 0 1 14 0\"/><path d=\"M16 5.5a3.4 3.4 0 0 1 0 6.6M17.5 14.2A6.3 6.3 0 0 1 21.5 20\"/>";
|
|
45
45
|
readonly settings: "<circle cx=\"12\" cy=\"12\" r=\"3\"/><path d=\"M12 4v2.5M12 17.5V20M4 12h2.5M17.5 12H20M6.34 6.34l1.77 1.77M15.89 15.89l1.77 1.77M17.66 6.34l-1.77 1.77M6.34 17.66l1.77-1.77\"/>";
|
|
46
|
+
readonly gear: "<path stroke-linejoin=\"round\" d=\"M10.6 4.7L10.7 2.5L13.3 2.5L13.4 4.7L16.1 5.8L17.8 4.4L19.6 6.2L18.2 7.9L19.3 10.6L21.5 10.7L21.5 13.3L19.3 13.4L18.2 16.1L19.6 17.8L17.8 19.6L16.1 18.2L13.4 19.3L13.3 21.5L10.7 21.5L10.6 19.3L7.9 18.2L6.2 19.6L4.4 17.8L5.8 16.1L4.7 13.4L2.5 13.3L2.5 10.7L4.7 10.6L5.8 7.9L4.4 6.2L6.2 4.4L7.9 5.8Z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/>";
|
|
46
47
|
readonly sliders: "<path d=\"M4 7h9M17 7h3M4 17h3M11 17h9\"/><circle cx=\"15\" cy=\"7\" r=\"2\"/><circle cx=\"9\" cy=\"17\" r=\"2\"/>";
|
|
47
48
|
readonly home: "<path d=\"M4 10.5 12 4l8 6.5V19a1.5 1.5 0 0 1-1.5 1.5H15V14H9v6.5H5.5A1.5 1.5 0 0 1 4 19Z\"/>";
|
|
48
49
|
readonly file: "<path d=\"M13.5 3.5H7a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9zm0 0V9H19\"/>";
|
|
@@ -31,8 +31,9 @@ declare const _default: import('vue').DefineComponent<ImageEditorProps, {
|
|
|
31
31
|
}>, {
|
|
32
32
|
disabled: boolean;
|
|
33
33
|
footer: boolean;
|
|
34
|
-
|
|
34
|
+
maxHeight: number;
|
|
35
35
|
format: "auto" | "image/jpeg" | "image/png" | "image/webp";
|
|
36
|
+
background: string;
|
|
36
37
|
filters: boolean;
|
|
37
38
|
resizable: boolean;
|
|
38
39
|
minSize: number;
|
|
@@ -45,7 +46,6 @@ declare const _default: import('vue').DefineComponent<ImageEditorProps, {
|
|
|
45
46
|
ratios: (ImageEditorRatio | ImageEditorRatioOption)[];
|
|
46
47
|
rotatable: boolean;
|
|
47
48
|
flippable: boolean;
|
|
48
|
-
maxHeight: number;
|
|
49
49
|
quality: number;
|
|
50
50
|
crossOrigin: "anonymous" | "use-credentials" | "";
|
|
51
51
|
resetLabel: string;
|
|
@@ -23,8 +23,8 @@ declare const __VLS_component: import('vue').DefineComponent<ScrollbarProps, {
|
|
|
23
23
|
}>, {
|
|
24
24
|
size: import('./types').ScrollbarSize;
|
|
25
25
|
always: boolean;
|
|
26
|
-
height: number | string;
|
|
27
26
|
maxHeight: number | string;
|
|
27
|
+
height: number | string;
|
|
28
28
|
axis: import('./types').ScrollbarAxis;
|
|
29
29
|
chainScroll: boolean;
|
|
30
30
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
@@ -13,10 +13,10 @@ declare const __VLS_component: import('vue').DefineComponent<TextProps, {}, {},
|
|
|
13
13
|
as: string;
|
|
14
14
|
tone: import('./types').TextTone;
|
|
15
15
|
align: import('./types').TextAlign;
|
|
16
|
+
italic: boolean;
|
|
16
17
|
truncate: boolean | number;
|
|
17
18
|
mono: boolean;
|
|
18
19
|
weight: import('./types').TextWeight;
|
|
19
|
-
italic: boolean;
|
|
20
20
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
21
21
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
22
22
|
export default _default;
|
|
@@ -31,8 +31,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
31
31
|
align: import('./types').TooltipAlign;
|
|
32
32
|
offset: number;
|
|
33
33
|
teleport: boolean;
|
|
34
|
-
arrow: boolean;
|
|
35
34
|
delay: number;
|
|
35
|
+
arrow: boolean;
|
|
36
36
|
maxWidth: number | string;
|
|
37
37
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
38
38
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -54,12 +54,12 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
54
54
|
multiple: boolean;
|
|
55
55
|
disabled: boolean;
|
|
56
56
|
max: number;
|
|
57
|
+
hint: string;
|
|
57
58
|
removable: boolean;
|
|
58
59
|
accept: string;
|
|
59
60
|
maxSize: number;
|
|
60
61
|
buttonOnly: boolean;
|
|
61
62
|
buttonText: string;
|
|
62
|
-
hint: string;
|
|
63
63
|
gallery: boolean;
|
|
64
64
|
beforeAdd: (file: File) => boolean | Promise<boolean>;
|
|
65
65
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|