@pgcorp/ui-kit 0.10.1 → 0.10.2
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/README.md +40 -0
- package/dist/assets/src/components/shared/containers/SDrawer.css_vue_type_style_index_0_src_d0cace23_scoped_d0cace23_lang.css +2 -0
- package/dist/assets/src/components/shared/containers/{SModal.css_vue_type_style_index_0_src_64c62e90_scoped_64c62e90_lang.css → SModal.css_vue_type_style_index_0_src_dc3c799e_scoped_dc3c799e_lang.css} +1 -1
- package/dist/assets/src/components/shared/controls/{SButton.css_vue_type_style_index_0_src_49f356bb_scoped_49f356bb_lang.css → SButton.css_vue_type_style_index_0_src_52ad38b1_scoped_52ad38b1_lang.css} +1 -1
- package/dist/assets/src/components/shared/controls/{SLink.css_vue_type_style_index_0_src_fc6fdfb3_scoped_fc6fdfb3_lang.css → SLink.css_vue_type_style_index_0_src_c7ae14e1_scoped_c7ae14e1_lang.css} +1 -1
- package/dist/assets/src/components/shared/data-display/SCodeBlock.css_vue_type_style_index_0_src_78557968_scoped_78557968_lang.css +2 -0
- package/dist/assets/src/components/shared/data-display/{SCodeEditor.css_vue_type_style_index_0_src_cad79088_scoped_cad79088_lang.css → SCodeEditor.css_vue_type_style_index_0_src_124ca461_scoped_124ca461_lang.css} +1 -1
- package/dist/assets/src/components/shared/data-display/SCodeWorkspaceEditor.css_vue_type_style_index_0_src_b200dc8e_scoped_b200dc8e_lang.css +2 -0
- package/dist/assets/src/components/shared/data-display/_internal/SRichBlockNode.css_vue_type_style_index_0_src_195d5c06_scoped_195d5c06_lang.css +2 -0
- package/dist/assets/src/components/shared/navigation/{SBottomNav.vue_vue_type_style_index_0_scoped_a0d16ca3_lang.css → SBottomNav.vue_vue_type_style_index_0_scoped_b3963080_lang.css} +1 -1
- package/dist/assets/src/components/shared/navigation/{SBreadcrumbs.css_vue_type_style_index_0_src_e2c5851e_scoped_e2c5851e_lang.css → SBreadcrumbs.css_vue_type_style_index_0_src_f836963c_scoped_f836963c_lang.css} +1 -1
- package/dist/assets/src/components/shared/persona/_internal/SPersonaRunConsole.css_vue_type_style_index_0_src_21bf807e_scoped_21bf807e_lang.css +2 -0
- package/dist/index.js +4 -2
- package/dist/src/components/icons/_internal/generatedSputnigUiIconComponents.d.ts +243 -0
- package/dist/src/components/icons/_internal/generatedSputnigUiIconComponents.js +7 -0
- package/dist/src/components/icons/_internal/generatedSputnigUiIconMarkup.d.ts +721 -239
- package/dist/src/components/icons/_internal/generatedSputnigUiIconMarkup.js +244 -4
- package/dist/src/components/icons/_internal/sputnigUiIconRuntime.d.ts +18 -0
- package/dist/src/components/icons/_internal/sputnigUiIconRuntime.js +99 -0
- package/dist/src/components/icons/sputnigUiIcons.d.ts +5 -81
- package/dist/src/components/icons/sputnigUiIcons.js +238 -394
- package/dist/src/components/layout/SAppShell.vue.d.ts +2 -2
- package/dist/src/components/layout/_internal/SAppBrand.vue.d.ts +3 -3
- package/dist/src/components/layout/types.d.ts +2 -2
- package/dist/src/components/shared/_internal/SDialogSurface.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/src/components/shared/_internal/SMenuItem.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/src/components/shared/_internal/SToastItem.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/src/components/shared/_internal/STreeNode.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/src/components/shared/containers/SCloudChromeRow.vue_vue_type_script_setup_true_lang.js +44 -44
- package/dist/src/components/shared/containers/SDrawer.vue.d.ts +2 -0
- package/dist/src/components/shared/containers/SDrawer.vue.js +2 -2
- package/dist/src/components/shared/containers/SDrawer.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/src/components/shared/containers/SModal.vue.d.ts +2 -0
- package/dist/src/components/shared/containers/SModal.vue.js +2 -2
- package/dist/src/components/shared/containers/SModal.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/src/components/shared/controls/SButton.vue.d.ts +32 -2
- package/dist/src/components/shared/controls/SButton.vue.js +2 -2
- package/dist/src/components/shared/controls/SButton.vue_vue_type_script_setup_true_lang.js +77 -79
- package/dist/src/components/shared/controls/SCheckbox.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/src/components/shared/controls/SComboboxTrigger.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/src/components/shared/controls/SContextToggleButton.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/src/components/shared/controls/SDragHandle.vue_vue_type_script_setup_true_lang.js +21 -21
- package/dist/src/components/shared/controls/SLink.vue.d.ts +17 -1
- package/dist/src/components/shared/controls/SLink.vue.js +2 -2
- package/dist/src/components/shared/controls/SLink.vue_vue_type_script_setup_true_lang.js +22 -22
- package/dist/src/components/shared/controls/SListboxOption.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/src/components/shared/controls/STextarea.d.ts +1 -1
- package/dist/src/components/shared/controls/STextarea.vue.d.ts +12 -18
- package/dist/src/components/shared/controls/_internal/SInlineTokenSurface.vue_vue_type_script_lang.js +1 -1
- package/dist/src/components/shared/data-display/SActionListItem.vue.d.ts +1 -1
- package/dist/src/components/shared/data-display/SChip.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/src/components/shared/data-display/SCodeBlock.vue.d.ts +33 -11
- package/dist/src/components/shared/data-display/SCodeBlock.vue.js +2 -2
- package/dist/src/components/shared/data-display/SCodeBlock.vue_vue_type_script_setup_true_lang.js +77 -75
- package/dist/src/components/shared/data-display/SCodeEditor.vue.d.ts +22 -10
- package/dist/src/components/shared/data-display/SCodeEditor.vue.js +2 -2
- package/dist/src/components/shared/data-display/SCodeEditor.vue_vue_type_script_setup_true_lang.js +44 -44
- package/dist/src/components/shared/data-display/SCodeSearchPanel.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/src/components/shared/data-display/SCodeWorkspaceEditor.vue.js +2 -2
- package/dist/src/components/shared/data-display/SCodeWorkspaceEditor.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/src/components/shared/data-display/SCopyField.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/src/components/shared/data-display/SDocBlock.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/src/components/shared/data-display/SExpandableText.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/src/components/shared/data-display/SMessage.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/src/components/shared/data-display/STable.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/src/components/shared/data-display/_internal/SRichBlockNode.vue.js +2 -2
- package/dist/src/components/shared/data-display/_internal/SRichBlockNode.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/src/components/shared/database/SSqlEditor.vue_vue_type_script_setup_true_lang.js +7 -10
- package/dist/src/components/shared/navigation/SBottomNav.vue.js +2 -2
- package/dist/src/components/shared/navigation/SBottomNav.vue_vue_type_script_setup_true_lang.js +70 -68
- package/dist/src/components/shared/navigation/SBreadcrumbs.vue.js +2 -2
- package/dist/src/components/shared/navigation/SBreadcrumbs.vue_vue_type_script_setup_true_lang.js +20 -21
- package/dist/src/components/shared/persona/SPersonaProjectPicker.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/src/components/shared/persona/_internal/SPersonaRunConsole.vue.js +2 -2
- package/dist/src/components/shared/persona/_internal/SPersonaRunConsole.vue_vue_type_script_setup_true_lang.js +6 -3
- package/dist/src/composables/useDialogOverlay.d.ts +2 -0
- package/dist/src/composables/useDialogOverlay.js +14 -7
- package/dist/src/internal/feedbackPresentation.js +1 -1
- package/docs/versioning.md +38 -10
- package/package.json +1 -1
- package/dist/assets/src/components/shared/containers/SDrawer.css_vue_type_style_index_0_src_1226da98_scoped_1226da98_lang.css +0 -2
- package/dist/assets/src/components/shared/data-display/SCodeBlock.css_vue_type_style_index_0_src_aad45526_scoped_aad45526_lang.css +0 -2
- package/dist/assets/src/components/shared/data-display/SCodeWorkspaceEditor.css_vue_type_style_index_0_src_864bce1d_scoped_864bce1d_lang.css +0 -2
- package/dist/assets/src/components/shared/data-display/_internal/SRichBlockNode.css_vue_type_style_index_0_src_63180598_scoped_63180598_lang.css +0 -2
- package/dist/assets/src/components/shared/persona/_internal/SPersonaRunConsole.css_vue_type_style_index_0_src_c71f59d4_scoped_c71f59d4_lang.css +0 -2
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { SCodeEditorCapabilities, SCodeEditorLanguage, SCodeEditorViewport } from './SCodeEditor.vue';
|
|
2
|
-
type AccessibleName = {
|
|
3
|
-
ariaLabel: string;
|
|
4
|
-
ariaLabelledby?: never;
|
|
5
|
-
} | {
|
|
6
|
-
ariaLabel?: never;
|
|
7
|
-
ariaLabelledby: string;
|
|
8
|
-
};
|
|
1
|
+
import { SCodeEditorCapabilities, SCodeEditorLanguage, SCodeEditorReadyPayload, SCodeEditorSelectionAppliedPayload, SCodeEditorViewport } from './SCodeEditor.vue';
|
|
9
2
|
/** Public adapter contract над canonical SCodeEditor leaf. / Public adapter contract over the canonical SCodeEditor leaf. */
|
|
10
|
-
export
|
|
3
|
+
export interface Props {
|
|
11
4
|
code: string;
|
|
12
5
|
language: SCodeEditorLanguage;
|
|
6
|
+
ariaLabel?: string;
|
|
7
|
+
ariaLabelledby?: string;
|
|
13
8
|
presentation?: 'editor' | 'plain' | 'highlighted';
|
|
14
9
|
showHeader?: boolean;
|
|
15
10
|
showLineNumbers?: boolean;
|
|
@@ -22,7 +17,34 @@ export type Props = AccessibleName & {
|
|
|
22
17
|
viewport?: SCodeEditorViewport;
|
|
23
18
|
placeholder?: string;
|
|
24
19
|
errorMessage?: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
20
|
+
}
|
|
21
|
+
/** Public imperative surface shared by editor and read-only presentations. */
|
|
22
|
+
export interface SCodeBlockApi {
|
|
23
|
+
applySelection(position: number): void;
|
|
24
|
+
focus(): void;
|
|
25
|
+
}
|
|
26
|
+
declare const __VLS_export: import('vue').DefineComponent<Props, SCodeBlockApi, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
27
|
+
ready: (payload: SCodeEditorReadyPayload) => any;
|
|
28
|
+
"cursor-activity": (payload: {
|
|
29
|
+
pos: number;
|
|
30
|
+
lineFrom: number;
|
|
31
|
+
lineTo: number;
|
|
32
|
+
lineText: string;
|
|
33
|
+
cursorCol: number;
|
|
34
|
+
}) => any;
|
|
35
|
+
"selection-applied": (payload: SCodeEditorSelectionAppliedPayload) => any;
|
|
36
|
+
"update:code": (value: string) => any;
|
|
37
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
38
|
+
onReady?: ((payload: SCodeEditorReadyPayload) => any) | undefined;
|
|
39
|
+
"onCursor-activity"?: ((payload: {
|
|
40
|
+
pos: number;
|
|
41
|
+
lineFrom: number;
|
|
42
|
+
lineTo: number;
|
|
43
|
+
lineText: string;
|
|
44
|
+
cursorCol: number;
|
|
45
|
+
}) => any) | undefined;
|
|
46
|
+
"onSelection-applied"?: ((payload: SCodeEditorSelectionAppliedPayload) => any) | undefined;
|
|
47
|
+
"onUpdate:code"?: ((value: string) => any) | undefined;
|
|
48
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
27
49
|
declare const _default: typeof __VLS_export;
|
|
28
50
|
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../../../../assets/src/components/shared/data-display/SCodeBlock.
|
|
1
|
+
import "../../../../assets/src/components/shared/data-display/SCodeBlock.css_vue_type_style_index_0_src_78557968_scoped_78557968_lang.css";
|
|
2
2
|
import e from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
3
|
import t from "./SCodeBlock.vue_vue_type_script_setup_true_lang.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
//#region src/components/shared/data-display/SCodeBlock.vue
|
|
6
|
-
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-
|
|
6
|
+
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-78557968"]]);
|
|
7
7
|
//#endregion
|
|
8
8
|
export { n as default };
|
package/dist/src/components/shared/data-display/SCodeBlock.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { Copy as e } from "../../icons/
|
|
1
|
+
import { Copy as e } from "../../icons/_internal/generatedSputnigUiIconComponents.js";
|
|
2
2
|
import { useClipboard as t } from "../../../composables/useClipboard.js";
|
|
3
3
|
import { useUiKitLocale as n } from "../../../composables/useUiKitLocale.js";
|
|
4
4
|
import { useNotifier as ee } from "../../../composables/useNotifier.js";
|
|
5
5
|
import { useOwnedAttrs as te } from "../../../internal/ownedAttrs.js";
|
|
6
|
-
import { validateBoolean as r, validateBoundedInteger as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { validateCodeEditorLanguage as
|
|
6
|
+
import { validateBoolean as r, validateBoundedInteger as ne, validateDomId as re, validateExactString as i, validateNonEmptyString as a } from "../../../internal/runtimeContract.js";
|
|
7
|
+
import ie from "../controls/SButton.vue.js";
|
|
8
|
+
import ae from "../feedback/SAsyncState.vue.js";
|
|
9
|
+
import { validateCodeEditorLanguage as oe, validateCodeEditorViewport as o } from "../../../internal/codeEditorContract.js";
|
|
10
10
|
import { resolveCodeLanguageKey as s } from "../../../internal/codeLanguageIdentity.js";
|
|
11
|
-
import
|
|
12
|
-
import { Fragment as
|
|
11
|
+
import se from "./_internal/SCodeTokenLine.vue.js";
|
|
12
|
+
import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createVNode as m, defineAsyncComponent as h, defineComponent as g, mergeProps as _, normalizeStyle as v, onMounted as ce, openBlock as y, ref as b, renderList as x, toDisplayString as S, unref as C, watch as w } from "vue";
|
|
13
13
|
//#region src/components/shared/data-display/SCodeBlock.vue?vue&type=script&setup=true&lang.ts
|
|
14
|
-
var
|
|
14
|
+
var le = ["data-presentation"], ue = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "s-code-block-header"
|
|
17
|
-
},
|
|
17
|
+
}, de = { class: "s-code-block-info" }, fe = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "s-code-block-filename"
|
|
20
|
-
},
|
|
20
|
+
}, pe = { class: "s-code-block-language" }, me = { class: "s-code-block-actions" }, he = { class: "s-code-block-editor-region" }, ge = [
|
|
21
21
|
"data-viewport",
|
|
22
22
|
"data-line-numbers",
|
|
23
23
|
"aria-label",
|
|
24
24
|
"aria-labelledby"
|
|
25
|
-
],
|
|
25
|
+
], _e = { key: 0 }, ve = {
|
|
26
26
|
key: 1,
|
|
27
27
|
class: "s-code-block-plain__lines"
|
|
28
|
-
},
|
|
28
|
+
}, T = {
|
|
29
29
|
class: "s-code-block-plain__line-number",
|
|
30
30
|
"aria-hidden": "true"
|
|
31
31
|
}, E = { class: "s-code-block-plain__line-content" }, D = [
|
|
@@ -40,10 +40,10 @@ var se = ["data-presentation"], ce = {
|
|
|
40
40
|
inheritAttrs: !1,
|
|
41
41
|
__name: "SCodeBlock",
|
|
42
42
|
props: {
|
|
43
|
-
ariaLabel: {},
|
|
44
|
-
ariaLabelledby: {},
|
|
45
43
|
code: {},
|
|
46
44
|
language: {},
|
|
45
|
+
ariaLabel: {},
|
|
46
|
+
ariaLabelledby: {},
|
|
47
47
|
presentation: { default: "editor" },
|
|
48
48
|
showHeader: {
|
|
49
49
|
type: Boolean,
|
|
@@ -57,17 +57,14 @@ var se = ["data-presentation"], ce = {
|
|
|
57
57
|
type: Boolean,
|
|
58
58
|
default: !0
|
|
59
59
|
},
|
|
60
|
-
interceptKeys: {
|
|
61
|
-
type: Function,
|
|
62
|
-
default: void 0
|
|
63
|
-
},
|
|
60
|
+
interceptKeys: { type: Function },
|
|
64
61
|
tabSize: { default: 2 },
|
|
65
62
|
tabKeyBehavior: { default: "focus-next" },
|
|
66
63
|
nextSelectionPos: { default: null },
|
|
67
64
|
surfaceRadius: { default: "default" },
|
|
68
65
|
viewport: { default: "content" },
|
|
69
|
-
placeholder: {
|
|
70
|
-
errorMessage: {
|
|
66
|
+
placeholder: {},
|
|
67
|
+
errorMessage: {}
|
|
71
68
|
},
|
|
72
69
|
emits: [
|
|
73
70
|
"cursor-activity",
|
|
@@ -76,88 +73,93 @@ var se = ["data-presentation"], ce = {
|
|
|
76
73
|
"ready"
|
|
77
74
|
],
|
|
78
75
|
setup(g, { expose: M, emit: N }) {
|
|
79
|
-
let P =
|
|
76
|
+
let P = b(!1), F = b(null), I = b(null), ye = h(() => import("../../../internal/lazyCodeEditor.js")), be = te({
|
|
80
77
|
component: "SCodeBlock",
|
|
81
78
|
owner: "code block root"
|
|
82
|
-
}),
|
|
79
|
+
}), L = l(() => {
|
|
80
|
+
if (g.ariaLabel !== void 0 && g.ariaLabelledby !== void 0) throw TypeError("SCodeBlock: задайте только ariaLabel или ariaLabelledby. / SCodeBlock: provide only ariaLabel or ariaLabelledby.");
|
|
81
|
+
if (g.ariaLabel !== void 0) return { ariaLabel: a("SCodeBlock", "ariaLabel", g.ariaLabel) };
|
|
82
|
+
if (g.ariaLabelledby !== void 0) return { ariaLabelledby: re("SCodeBlock", "ariaLabelledby", g.ariaLabelledby) };
|
|
83
|
+
throw TypeError("SCodeBlock: требуется ariaLabel или ariaLabelledby. / SCodeBlock: ariaLabel or ariaLabelledby is required.");
|
|
84
|
+
}), xe = l(() => L.value), R = N, Se = l(() => r("SCodeBlock", "showHeader", g.showHeader)), z = l(() => r("SCodeBlock", "showLineNumbers", g.showLineNumbers)), B = l(() => r("SCodeBlock", "readOnly", g.readOnly)), V = l(() => i("SCodeBlock", "presentation", g.presentation, [
|
|
83
85
|
"editor",
|
|
84
86
|
"plain",
|
|
85
87
|
"highlighted"
|
|
86
|
-
])), H =
|
|
88
|
+
])), H = l(() => i("SCodeBlock", "surfaceRadius", g.surfaceRadius, [
|
|
87
89
|
"default",
|
|
88
90
|
"none",
|
|
89
91
|
"xl"
|
|
90
|
-
])), U =
|
|
91
|
-
if (typeof
|
|
92
|
-
return
|
|
93
|
-
}), K =
|
|
92
|
+
])), U = l(() => o("SCodeBlock", g.viewport)), W = l(() => oe("SCodeBlock", g.language)), G = l(() => {
|
|
93
|
+
if (typeof g.code != "string") throw TypeError("SCodeBlock: code должен быть string. / SCodeBlock: code must be a string.");
|
|
94
|
+
return g.code;
|
|
95
|
+
}), K = l(() => ne("SCodeBlock", "tabSize", g.tabSize, {
|
|
94
96
|
minimum: 1,
|
|
95
97
|
maximum: 16
|
|
96
|
-
})),
|
|
98
|
+
})), Ce = l(() => s(W.value)), q = l(() => G.value.split("\n")), J = l(() => g.errorMessage === void 0 ? void 0 : a("SCodeBlock", "errorMessage", g.errorMessage)), we = l(() => ({
|
|
97
99
|
lineNumbers: z.value,
|
|
98
100
|
indentation: {
|
|
99
101
|
tabSize: K.value,
|
|
100
|
-
keyBehavior:
|
|
102
|
+
keyBehavior: g.tabKeyBehavior
|
|
101
103
|
},
|
|
102
|
-
...
|
|
104
|
+
...g.interceptKeys === void 0 ? {} : { keyInterceptor: g.interceptKeys },
|
|
103
105
|
cursorActivity: "always"
|
|
104
|
-
})),
|
|
106
|
+
})), Te = (e) => R("cursor-activity", {
|
|
105
107
|
pos: e.pos,
|
|
106
108
|
lineFrom: e.lineFrom,
|
|
107
109
|
lineTo: e.lineTo,
|
|
108
110
|
lineText: e.lineText,
|
|
109
111
|
cursorCol: e.pos - e.lineFrom
|
|
110
|
-
}),
|
|
111
|
-
|
|
112
|
-
}, Y = !1,
|
|
113
|
-
|
|
112
|
+
}), Ee = (e) => {
|
|
113
|
+
P.value = !0, R("ready", e);
|
|
114
|
+
}, Y = !1, De = () => {
|
|
115
|
+
P.value = !0, R("ready", {
|
|
114
116
|
documentLength: G.value.length,
|
|
115
117
|
viewport: U.value,
|
|
116
118
|
variant: "code",
|
|
117
119
|
locked: !0
|
|
118
120
|
});
|
|
119
121
|
}, X = () => {
|
|
120
|
-
Y && (V.value === "editor" ?
|
|
122
|
+
Y && (V.value === "editor" ? P.value = !1 : De());
|
|
121
123
|
};
|
|
122
|
-
|
|
124
|
+
ce(() => {
|
|
123
125
|
Y = !0, X();
|
|
124
|
-
}),
|
|
126
|
+
}), w(V, X), w([V, B], ([e, t]) => {
|
|
125
127
|
if (e !== "editor" && !t) throw TypeError(`SCodeBlock: presentation=${JSON.stringify(e)} поддерживает только readOnly=true. / SCodeBlock: presentation=${JSON.stringify(e)} supports readOnly=true only.`);
|
|
126
|
-
if (e !== "editor" &&
|
|
127
|
-
if (e !== "editor" &&
|
|
128
|
+
if (e !== "editor" && g.interceptKeys !== void 0) throw TypeError(`SCodeBlock: presentation=${JSON.stringify(e)} не принимает interceptKeys. / SCodeBlock: presentation=${JSON.stringify(e)} does not accept interceptKeys.`);
|
|
129
|
+
if (e !== "editor" && g.nextSelectionPos !== null) throw TypeError(`SCodeBlock: presentation=${JSON.stringify(e)} не принимает nextSelectionPos. / SCodeBlock: presentation=${JSON.stringify(e)} does not accept nextSelectionPos.`);
|
|
128
130
|
}, { immediate: !0 });
|
|
129
131
|
let Z = (e) => {
|
|
130
132
|
if (e !== null && !(e instanceof HTMLElement)) throw TypeError("SCodeBlock: plain surface ref должен быть HTMLElement. / SCodeBlock: plain surface ref must be an HTMLElement.");
|
|
131
|
-
|
|
133
|
+
I.value = e;
|
|
132
134
|
};
|
|
133
135
|
M({
|
|
134
136
|
applySelection: (e) => {
|
|
135
137
|
if (V.value !== "editor") throw Error(`SCodeBlock: applySelection недоступен в presentation=${JSON.stringify(V.value)}. / SCodeBlock: applySelection is unavailable in presentation=${JSON.stringify(V.value)}.`);
|
|
136
|
-
let t =
|
|
138
|
+
let t = F.value;
|
|
137
139
|
if (!t) throw Error("SCodeBlock: editor не готов; дождитесь ready. / SCodeBlock: editor is not ready; wait for ready.");
|
|
138
140
|
t.applySelection(e);
|
|
139
141
|
},
|
|
140
142
|
focus: () => {
|
|
141
143
|
if (V.value !== "editor") {
|
|
142
|
-
let e =
|
|
144
|
+
let e = I.value;
|
|
143
145
|
if (!e) throw Error("SCodeBlock: plain surface не готов; дождитесь ready. / SCodeBlock: plain surface is not ready; wait for ready.");
|
|
144
146
|
e.focus();
|
|
145
147
|
return;
|
|
146
148
|
}
|
|
147
|
-
let e =
|
|
149
|
+
let e = F.value;
|
|
148
150
|
if (!e) throw Error("SCodeBlock: editor не готов; дождитесь ready. / SCodeBlock: editor is not ready; wait for ready.");
|
|
149
151
|
e.focus();
|
|
150
152
|
}
|
|
151
153
|
});
|
|
152
|
-
let Q = ee(), { t: $ } = n(), { copyText:
|
|
153
|
-
let e = await
|
|
154
|
+
let Q = ee(), { t: $ } = n(), { copyText: Oe } = t(), ke = async () => {
|
|
155
|
+
let e = await Oe(g.code);
|
|
154
156
|
if (e.status === "copied") {
|
|
155
157
|
Q.success({ message: $("clipboard.codeCopied") });
|
|
156
158
|
return;
|
|
157
159
|
}
|
|
158
160
|
Q.danger({ message: e.status === "unavailable" ? $("clipboard.codeCopyUnavailable") : e.status === "empty" ? $("clipboard.emptyCode") : `${$("clipboard.codeCopyFailed")} ${e.error.message}` });
|
|
159
161
|
};
|
|
160
|
-
return (t, n) => (
|
|
162
|
+
return (t, n) => (y(), f("div", _(C(be).bindings(), {
|
|
161
163
|
class: ["s-code-block", {
|
|
162
164
|
"s-code-block--radius-none": H.value === "none",
|
|
163
165
|
"s-code-block--radius-xl": H.value === "xl",
|
|
@@ -166,37 +168,37 @@ var se = ["data-presentation"], ce = {
|
|
|
166
168
|
}],
|
|
167
169
|
"data-presentation": V.value
|
|
168
170
|
}), [
|
|
169
|
-
|
|
171
|
+
Se.value ? (y(), f("div", ue, [p("div", de, [W.value.mode === "detect" ? (y(), f("span", fe, S(W.value.filePath), 1)) : d("", !0), p("span", pe, S(Ce.value), 1)]), p("div", me, [m(ie, {
|
|
170
172
|
appearance: "text",
|
|
171
173
|
severity: "secondary",
|
|
172
174
|
size: "xs",
|
|
173
|
-
"leading-icon":
|
|
175
|
+
"leading-icon": C(e),
|
|
174
176
|
"icon-only": "",
|
|
175
|
-
title:
|
|
176
|
-
"aria-label":
|
|
177
|
+
title: C($)("clipboard.copyCode"),
|
|
178
|
+
"aria-label": C($)("clipboard.copyCode"),
|
|
177
179
|
label: "",
|
|
178
|
-
onClick:
|
|
180
|
+
onClick: ke
|
|
179
181
|
}, null, 8, [
|
|
180
182
|
"leading-icon",
|
|
181
183
|
"title",
|
|
182
184
|
"aria-label"
|
|
183
|
-
])])])) :
|
|
184
|
-
|
|
185
|
+
])])])) : d("", !0),
|
|
186
|
+
p("div", he, [V.value === "editor" ? (y(), u(C(ye), _({
|
|
185
187
|
key: 0,
|
|
186
188
|
ref_key: "codeEditor",
|
|
187
|
-
ref:
|
|
188
|
-
"model-value":
|
|
189
|
+
ref: F,
|
|
190
|
+
"model-value": g.code,
|
|
189
191
|
language: W.value,
|
|
190
|
-
capabilities:
|
|
192
|
+
capabilities: we.value,
|
|
191
193
|
"read-only": B.value,
|
|
192
194
|
viewport: U.value
|
|
193
|
-
},
|
|
194
|
-
placeholder:
|
|
195
|
-
"next-selection-pos":
|
|
195
|
+
}, xe.value, {
|
|
196
|
+
placeholder: g.placeholder,
|
|
197
|
+
"next-selection-pos": g.nextSelectionPos,
|
|
196
198
|
"onUpdate:modelValue": n[0] ||= (e) => R("update:code", e),
|
|
197
|
-
onCursorActivity:
|
|
199
|
+
onCursorActivity: Te,
|
|
198
200
|
onSelectionApplied: n[1] ||= (e) => R("selection-applied", e),
|
|
199
|
-
onReady:
|
|
201
|
+
onReady: Ee
|
|
200
202
|
}), null, 16, [
|
|
201
203
|
"model-value",
|
|
202
204
|
"language",
|
|
@@ -205,49 +207,49 @@ var se = ["data-presentation"], ce = {
|
|
|
205
207
|
"viewport",
|
|
206
208
|
"placeholder",
|
|
207
209
|
"next-selection-pos"
|
|
208
|
-
])) : V.value === "plain" ? (
|
|
210
|
+
])) : V.value === "plain" ? (y(), f("pre", {
|
|
209
211
|
key: 1,
|
|
210
212
|
ref: Z,
|
|
211
213
|
class: "s-code-block-plain",
|
|
212
214
|
"data-viewport": U.value,
|
|
213
215
|
"data-line-numbers": z.value ? "visible" : "hidden",
|
|
214
|
-
"aria-label":
|
|
215
|
-
"aria-labelledby":
|
|
216
|
+
"aria-label": L.value.ariaLabel,
|
|
217
|
+
"aria-labelledby": L.value.ariaLabelledby,
|
|
216
218
|
style: v({ tabSize: K.value }),
|
|
217
219
|
tabindex: "0"
|
|
218
|
-
}, [z.value ? (
|
|
220
|
+
}, [z.value ? (y(), f("code", ve, [(y(!0), f(c, null, x(q.value, (e, t) => (y(), f("span", {
|
|
219
221
|
key: t,
|
|
220
222
|
class: "s-code-block-plain__line"
|
|
221
|
-
}, [
|
|
223
|
+
}, [p("span", T, S(t + 1), 1), p("span", E, S(e || ""), 1)]))), 128))])) : (y(), f("code", _e, S(G.value), 1))], 12, ge)) : (y(), f("pre", {
|
|
222
224
|
key: 2,
|
|
223
225
|
ref: Z,
|
|
224
226
|
class: "s-code-block-plain",
|
|
225
227
|
"data-viewport": U.value,
|
|
226
|
-
"aria-label":
|
|
227
|
-
"aria-labelledby":
|
|
228
|
+
"aria-label": L.value.ariaLabel,
|
|
229
|
+
"aria-labelledby": L.value.ariaLabelledby,
|
|
228
230
|
style: v({ tabSize: K.value }),
|
|
229
231
|
tabindex: "0"
|
|
230
|
-
}, [
|
|
232
|
+
}, [p("span", O, [(y(!0), f(c, null, x(q.value, (e, t) => (y(), f("span", {
|
|
231
233
|
key: t,
|
|
232
234
|
class: "s-code-block-plain__line",
|
|
233
235
|
"data-line-numbers": z.value ? "visible" : "hidden"
|
|
234
|
-
}, [z.value ? (
|
|
236
|
+
}, [z.value ? (y(), f("span", A, S(t + 1), 1)) : d("", !0), p("span", j, [m(se, {
|
|
235
237
|
text: e || "",
|
|
236
238
|
language: W.value,
|
|
237
239
|
variant: "code-block"
|
|
238
240
|
}, null, 8, ["text", "language"])])], 8, k))), 128))])], 12, D))]),
|
|
239
|
-
J.value !== void 0 || V.value === "editor" && !
|
|
241
|
+
J.value !== void 0 || V.value === "editor" && !P.value ? (y(), u(ae, {
|
|
240
242
|
key: 1,
|
|
241
243
|
state: J.value === void 0 ? {
|
|
242
244
|
status: "loading",
|
|
243
|
-
message:
|
|
245
|
+
message: C($)("editor.loading")
|
|
244
246
|
} : {
|
|
245
247
|
status: "error",
|
|
246
248
|
message: J.value
|
|
247
249
|
},
|
|
248
250
|
presentation: "overlay"
|
|
249
|
-
}, null, 8, ["state"])) :
|
|
250
|
-
], 16,
|
|
251
|
+
}, null, 8, ["state"])) : d("", !0)
|
|
252
|
+
], 16, le));
|
|
251
253
|
}
|
|
252
254
|
});
|
|
253
255
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CODE_EDITOR_VARIANTS, CODE_EDITOR_VIEWPORTS, CodeEditorCapabilitiesContract, CodeEditorLanguageContract } from '../../../internal/codeEditorContract';
|
|
2
|
-
import { SCodeEditorDiagnostic, SCodeEditorDiagnosticId } from './codeEditor';
|
|
2
|
+
import { SCodeEditorDiagnostic, SCodeEditorDiagnosticId, SCodeEditorApi, SCodeEditorSelectionRange, SCodeEditorViewState } from './codeEditor';
|
|
3
3
|
export type SCodeEditorViewport = typeof CODE_EDITOR_VIEWPORTS[number];
|
|
4
4
|
export type SCodeEditorVariant = typeof CODE_EDITOR_VARIANTS[number];
|
|
5
5
|
/** Явный язык либо детектирование из обязательного filePath. / Explicit language or detection from a required filePath. */
|
|
@@ -27,15 +27,13 @@ export interface SCodeEditorSelectionAppliedPayload {
|
|
|
27
27
|
position: number;
|
|
28
28
|
source: 'controlled' | 'imperative';
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
ariaLabelledby: string;
|
|
36
|
-
};
|
|
30
|
+
/** Accessible-name props; runtime validation requires exactly one owner. */
|
|
31
|
+
export interface SCodeEditorAccessibleName {
|
|
32
|
+
ariaLabel?: string;
|
|
33
|
+
ariaLabelledby?: string;
|
|
34
|
+
}
|
|
37
35
|
/** Public SCodeEditor contract; размер задаёт только semantic viewport. / Public SCodeEditor contract; sizing is expressed only by semantic viewport. */
|
|
38
|
-
export type Props =
|
|
36
|
+
export type Props = SCodeEditorAccessibleName & {
|
|
39
37
|
modelValue: string;
|
|
40
38
|
language: SCodeEditorLanguage;
|
|
41
39
|
capabilities: SCodeEditorCapabilities;
|
|
@@ -53,6 +51,20 @@ export type Props = AccessibleName & {
|
|
|
53
51
|
/** Помечает editor content невалидным без владения presentation диагностики. / Marks the editor content as invalid without owning diagnostic presentation. */
|
|
54
52
|
invalid?: boolean;
|
|
55
53
|
};
|
|
56
|
-
declare const __VLS_export: import('vue').
|
|
54
|
+
declare const __VLS_export: import('vue').DefineComponent<Props, SCodeEditorApi, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
55
|
+
"update:modelValue": (value: string) => any;
|
|
56
|
+
ready: (payload: SCodeEditorReadyPayload) => any;
|
|
57
|
+
"selection-change": (payload: SCodeEditorSelectionRange) => any;
|
|
58
|
+
"cursor-activity": (payload: SCodeEditorCursorActivity) => any;
|
|
59
|
+
"view-state-change": (payload: SCodeEditorViewState) => any;
|
|
60
|
+
"selection-applied": (payload: SCodeEditorSelectionAppliedPayload) => any;
|
|
61
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
62
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
63
|
+
onReady?: ((payload: SCodeEditorReadyPayload) => any) | undefined;
|
|
64
|
+
"onSelection-change"?: ((payload: SCodeEditorSelectionRange) => any) | undefined;
|
|
65
|
+
"onCursor-activity"?: ((payload: SCodeEditorCursorActivity) => any) | undefined;
|
|
66
|
+
"onView-state-change"?: ((payload: SCodeEditorViewState) => any) | undefined;
|
|
67
|
+
"onSelection-applied"?: ((payload: SCodeEditorSelectionAppliedPayload) => any) | undefined;
|
|
68
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
57
69
|
declare const _default: typeof __VLS_export;
|
|
58
70
|
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../../../../assets/src/components/shared/data-display/SCodeEditor.
|
|
1
|
+
import "../../../../assets/src/components/shared/data-display/SCodeEditor.css_vue_type_style_index_0_src_124ca461_scoped_124ca461_lang.css";
|
|
2
2
|
import e from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
3
|
import t from "./SCodeEditor.vue_vue_type_script_setup_true_lang.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
//#region src/components/shared/data-display/SCodeEditor.vue
|
|
6
|
-
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-
|
|
6
|
+
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-124ca461"]]);
|
|
7
7
|
//#endregion
|
|
8
8
|
export { n as default };
|