@pgcorp/ui-kit 0.10.1 → 0.11.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/README.md +89 -0
- package/dist/assets/src/components/shared/_internal/{SDialogSurface.css_vue_type_style_index_0_src_979bf586_scoped_979bf586_lang.css → SDialogSurface.css_vue_type_style_index_0_src_d1b65adf_scoped_d1b65adf_lang.css} +1 -1
- package/dist/assets/src/components/shared/containers/SDrawer.css_vue_type_style_index_0_src_091d7325_scoped_091d7325_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_23373daf_scoped_23373daf_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/{SInputText.css_vue_type_style_index_0_src_6d42d245_scoped_6d42d245_lang.css → SInputText.css_vue_type_style_index_0_src_a9c5f1aa_scoped_a9c5f1aa_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/SSideMenuButton.vue.d.ts +1 -1
- 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.d.ts +2 -1
- package/dist/src/components/shared/_internal/SDialogSurface.vue.js +2 -2
- package/dist/src/components/shared/_internal/SDialogSurface.vue_vue_type_script_setup_true_lang.js +38 -37
- 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/_internal/dialogSurface.d.ts +3 -0
- package/dist/src/components/shared/_internal/dialogSurface.js +23 -19
- 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 +7 -1
- 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 +49 -44
- package/dist/src/components/shared/containers/SModal.vue.d.ts +7 -1
- 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 +48 -41
- 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/SInputText.vue.d.ts +6 -0
- package/dist/src/components/shared/controls/SInputText.vue.js +2 -2
- package/dist/src/components/shared/controls/SInputText.vue_vue_type_script_setup_true_lang.js +117 -97
- 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/accessibility.md +10 -0
- package/docs/public-api.md +12 -0
- 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
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 };
|
package/dist/src/components/shared/data-display/SCodeEditor.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -9,12 +9,12 @@ import { getCodeMirrorLanguageExtension as s } from "../codeLanguages.js";
|
|
|
9
9
|
import { validateCodeEditorDiagnostics as c, validateCodeEditorRange as l, validateCodeEditorViewState as u } from "./codeEditor.js";
|
|
10
10
|
import { Fragment as d, computed as f, createCommentVNode as oe, createElementBlock as p, createElementVNode as m, createVNode as se, defineComponent as h, mergeProps as ce, onBeforeUnmount as le, openBlock as g, ref as ue, renderList as de, shallowRef as fe, toDisplayString as _, unref as v, useId as y, watch as b } from "vue";
|
|
11
11
|
import { Codemirror as x } from "vue-codemirror";
|
|
12
|
-
import { oneDark as
|
|
13
|
-
import { EditorSelection as
|
|
14
|
-
import { lintGutter as
|
|
15
|
-
import { EditorView as
|
|
12
|
+
import { oneDark as S } from "@codemirror/theme-one-dark";
|
|
13
|
+
import { EditorSelection as C, EditorState as pe } from "@codemirror/state";
|
|
14
|
+
import { lintGutter as me, setDiagnostics as he } from "@codemirror/lint";
|
|
15
|
+
import { EditorView as w, lineNumbers as ge, placeholder as _e } from "@codemirror/view";
|
|
16
16
|
//#region src/components/shared/data-display/SCodeEditor.vue?vue&type=script&setup=true&lang.ts
|
|
17
|
-
var
|
|
17
|
+
var T = /*@__PURE__*/ h({
|
|
18
18
|
inheritAttrs: !1,
|
|
19
19
|
__name: "SCodeEditor",
|
|
20
20
|
props: {
|
|
@@ -35,12 +35,12 @@ var w = /*@__PURE__*/ h({
|
|
|
35
35
|
type: Boolean,
|
|
36
36
|
default: !1
|
|
37
37
|
},
|
|
38
|
-
placeholder: {
|
|
38
|
+
placeholder: {},
|
|
39
39
|
viewport: { default: "content" },
|
|
40
40
|
variant: { default: "code" },
|
|
41
41
|
nextSelectionPos: { default: null },
|
|
42
42
|
diagnostics: { default: () => [] },
|
|
43
|
-
ariaDescribedby: {
|
|
43
|
+
ariaDescribedby: {},
|
|
44
44
|
invalid: {
|
|
45
45
|
type: Boolean,
|
|
46
46
|
default: !1
|
|
@@ -54,34 +54,34 @@ var w = /*@__PURE__*/ h({
|
|
|
54
54
|
"selection-applied",
|
|
55
55
|
"ready"
|
|
56
56
|
],
|
|
57
|
-
setup(h, { expose:
|
|
58
|
-
let
|
|
57
|
+
setup(h, { expose: T, emit: ve }) {
|
|
58
|
+
let E = ve, D = e({
|
|
59
59
|
component: "SCodeEditor",
|
|
60
60
|
owner: "CodeMirror root adapter"
|
|
61
61
|
});
|
|
62
62
|
a({ owner: "SCodeEditor" });
|
|
63
63
|
let O = ae(), k = o(), A = fe(null), j = ue(null), M = `s-code-editor-diagnostics-${y()}`, N = null, P = null, F = null, I = f(() => {
|
|
64
|
-
if (typeof
|
|
64
|
+
if (typeof h.modelValue == "string") return h.modelValue;
|
|
65
65
|
throw TypeError("SCodeEditor: modelValue должен быть строкой. / SCodeEditor: modelValue must be a string.");
|
|
66
|
-
}), L = f(() => re("SCodeEditor",
|
|
67
|
-
let e = te("SCodeEditor",
|
|
66
|
+
}), L = f(() => re("SCodeEditor", h.viewport)), R = f(() => ne("SCodeEditor", h.variant)), ye = f(() => t("SCodeEditor", "autofocus", h.autofocus)), z = f(() => t("SCodeEditor", "readOnly", h.readOnly)), B = f(() => t("SCodeEditor", "disabled", h.disabled)), be = f(() => t("SCodeEditor", "invalid", h.invalid)), V = f(() => z.value || B.value), H = f(() => c("SCodeEditor", h.diagnostics, I.value.length)), xe = f(() => {
|
|
67
|
+
let e = te("SCodeEditor", h.language), t = s(e), n = ie(e);
|
|
68
68
|
if (!t && n !== "plaintext" && n !== "text") {
|
|
69
69
|
let t = e.mode === "explicit" ? `language.id ${JSON.stringify(e.id)}` : `language.filePath ${JSON.stringify(e.filePath)}`;
|
|
70
70
|
throw RangeError(`SCodeEditor: ${t} не поддерживается. / SCodeEditor: ${t} is not supported.`);
|
|
71
71
|
}
|
|
72
72
|
return e;
|
|
73
|
-
}), U = f(() => ee("SCodeEditor",
|
|
74
|
-
if (
|
|
73
|
+
}), U = f(() => ee("SCodeEditor", h.capabilities)), Se = f(() => {
|
|
74
|
+
if (h.ariaLabel !== void 0 && h.ariaLabelledby !== void 0) throw TypeError("SCodeEditor: задайте только ariaLabel или ariaLabelledby. / SCodeEditor: provide only ariaLabel or ariaLabelledby.");
|
|
75
75
|
let e = {};
|
|
76
|
-
if (
|
|
77
|
-
else if (
|
|
76
|
+
if (h.ariaLabel !== void 0) e["aria-label"] = i("SCodeEditor", "ariaLabel", h.ariaLabel);
|
|
77
|
+
else if (h.ariaLabelledby !== void 0) e["aria-labelledby"] = r("SCodeEditor", "ariaLabelledby", h.ariaLabelledby);
|
|
78
78
|
else throw TypeError("SCodeEditor: требуется ariaLabel или ariaLabelledby. / SCodeEditor: ariaLabel or ariaLabelledby is required.");
|
|
79
79
|
e.tabindex = B.value ? "-1" : "0";
|
|
80
|
-
let t =
|
|
81
|
-
return H.value.length > 0 && t.push(M), t.length > 0 && (e["aria-describedby"] = t.join(" ")),
|
|
82
|
-
}),
|
|
83
|
-
let e = U.value, n =
|
|
84
|
-
L.value === "document" && (r.push(
|
|
80
|
+
let t = h.ariaDescribedby === void 0 ? [] : [r("SCodeEditor", "ariaDescribedby", h.ariaDescribedby)];
|
|
81
|
+
return H.value.length > 0 && t.push(M), t.length > 0 && (e["aria-describedby"] = t.join(" ")), be.value && (e["aria-invalid"] = "true"), z.value && (e["aria-readonly"] = "true"), B.value && (e["aria-disabled"] = "true"), e;
|
|
82
|
+
}), Ce = f(() => {
|
|
83
|
+
let e = U.value, n = xe.value, r = [...k?.extensions.value ?? []];
|
|
84
|
+
L.value === "document" && (r.push(w.theme({
|
|
85
85
|
"&.cm-editor": {
|
|
86
86
|
height: "auto",
|
|
87
87
|
maxHeight: "none",
|
|
@@ -91,12 +91,12 @@ var w = /*@__PURE__*/ h({
|
|
|
91
91
|
height: "auto",
|
|
92
92
|
overflow: "visible"
|
|
93
93
|
}
|
|
94
|
-
})), r.push(
|
|
94
|
+
})), r.push(w.lineWrapping));
|
|
95
95
|
let a = s(n);
|
|
96
|
-
return a && r.push(a), O.value.mode === "dark" && r.push(
|
|
96
|
+
return a && r.push(a), O.value.mode === "dark" && r.push(S), e.lineNumbers && r.push(ge()), H.value.length > 0 && r.push(me()), h.placeholder !== void 0 && r.push(_e(i("SCodeEditor", "placeholder", h.placeholder))), r.push(pe.readOnly.of(V.value)), r.push(w.editable.of(!V.value)), r.push(w.contentAttributes.of(Se.value)), e.keyInterceptor && !V.value && r.push(w.domEventHandlers({ keydown: (n) => {
|
|
97
97
|
let r = e.keyInterceptor?.(n);
|
|
98
98
|
return t("SCodeEditor", "capabilities.keyInterceptor return value", r) ? (n.preventDefault(), !0) : !1;
|
|
99
|
-
} })), r.push(
|
|
99
|
+
} })), r.push(w.updateListener.of((t) => {
|
|
100
100
|
if (A.value = t.view, (t.selectionSet || t.docChanged) && X(t.view), V.value && e.cursorActivity !== "always" || !t.selectionSet && !t.docChanged) return;
|
|
101
101
|
let n = t.state.selection.main.head, r = t.state.doc.lineAt(n);
|
|
102
102
|
E("cursor-activity", {
|
|
@@ -108,15 +108,15 @@ var w = /*@__PURE__*/ h({
|
|
|
108
108
|
lineText: t.state.doc.sliceString(r.from, r.to)
|
|
109
109
|
});
|
|
110
110
|
})), r;
|
|
111
|
-
}),
|
|
111
|
+
}), we = (e, t, r) => n("SCodeEditor", r, e, {
|
|
112
112
|
minimum: 0,
|
|
113
113
|
maximum: t
|
|
114
114
|
}), W = (e, t) => {
|
|
115
115
|
let n = A.value;
|
|
116
116
|
if (!n) throw Error("SCodeEditor: editor не готов; дождитесь ready. / SCodeEditor: editor is not ready; wait for ready.");
|
|
117
|
-
let r =
|
|
117
|
+
let r = we(e, n.state.doc.length, `${t} selection position`);
|
|
118
118
|
n.dispatch({
|
|
119
|
-
selection:
|
|
119
|
+
selection: C.single(r),
|
|
120
120
|
scrollIntoView: !0
|
|
121
121
|
}), n.focus(), E("selection-applied", {
|
|
122
122
|
position: r,
|
|
@@ -151,23 +151,23 @@ var w = /*@__PURE__*/ h({
|
|
|
151
151
|
Y(F, t) || (F = t, E("view-state-change", t));
|
|
152
152
|
}, Q = () => {
|
|
153
153
|
N?.removeEventListener("scroll", Z), N = null;
|
|
154
|
-
},
|
|
154
|
+
}, Te = (e) => {
|
|
155
155
|
Q(), N = e.scrollDOM, N.addEventListener("scroll", Z, { passive: !0 });
|
|
156
|
-
},
|
|
156
|
+
}, Ee = (e) => e.map((e) => ({
|
|
157
157
|
from: e.from,
|
|
158
158
|
to: e.to,
|
|
159
159
|
severity: e.severity,
|
|
160
160
|
message: e.message,
|
|
161
161
|
...e.source === void 0 ? {} : { source: e.source }
|
|
162
162
|
})), $ = (e) => {
|
|
163
|
-
let t = c("SCodeEditor",
|
|
164
|
-
e.dispatch(
|
|
165
|
-
},
|
|
163
|
+
let t = c("SCodeEditor", h.diagnostics, e.state.doc.length);
|
|
164
|
+
e.dispatch(he(e.state, Ee(t)));
|
|
165
|
+
}, De = (e) => {
|
|
166
166
|
if (typeof e != "string") throw TypeError("SCodeEditor: CodeMirror update payload должен быть строкой. / SCodeEditor: CodeMirror update payload must be a string.");
|
|
167
167
|
V.value || E("update:modelValue", e);
|
|
168
|
-
},
|
|
169
|
-
if (typeof e != "object" || !e || !("view" in e) || !(e.view instanceof
|
|
170
|
-
A.value = e.view,
|
|
168
|
+
}, Oe = (e) => {
|
|
169
|
+
if (typeof e != "object" || !e || !("view" in e) || !(e.view instanceof w)) throw TypeError("SCodeEditor: CodeMirror ready payload должен содержать EditorView. / SCodeEditor: CodeMirror ready payload must contain EditorView.");
|
|
170
|
+
A.value = e.view, Te(A.value), $(A.value);
|
|
171
171
|
let t = {
|
|
172
172
|
documentLength: A.value.state.doc.length,
|
|
173
173
|
viewport: L.value,
|
|
@@ -179,7 +179,7 @@ var w = /*@__PURE__*/ h({
|
|
|
179
179
|
j.value = null, W(e, "controlled");
|
|
180
180
|
}
|
|
181
181
|
};
|
|
182
|
-
return b(() =>
|
|
182
|
+
return b(() => h.nextSelectionPos, (e) => {
|
|
183
183
|
if (e != null) {
|
|
184
184
|
if (!Number.isInteger(e)) throw TypeError(`SCodeEditor: nextSelectionPos должен быть целым числом; получено ${String(e)}. / SCodeEditor: nextSelectionPos must be an integer; received ${String(e)}.`);
|
|
185
185
|
if (!A.value) {
|
|
@@ -192,10 +192,10 @@ var w = /*@__PURE__*/ h({
|
|
|
192
192
|
A.value && $(A.value);
|
|
193
193
|
}), le(() => {
|
|
194
194
|
Q(), A.value = null, P = null, F = null;
|
|
195
|
-
}),
|
|
195
|
+
}), T({
|
|
196
196
|
applySelection: (e) => W(e, "imperative"),
|
|
197
197
|
revealRange: (e) => {
|
|
198
|
-
let t = G(), n = l("SCodeEditor", "revealRange", e, t.state.doc.length), r =
|
|
198
|
+
let t = G(), n = l("SCodeEditor", "revealRange", e, t.state.doc.length), r = w.scrollIntoView(C.range(n.from, n.to), { y: "nearest" });
|
|
199
199
|
t.dispatch({ effects: r });
|
|
200
200
|
},
|
|
201
201
|
getSelection: () => {
|
|
@@ -208,7 +208,7 @@ var w = /*@__PURE__*/ h({
|
|
|
208
208
|
captureViewState: () => q(G()),
|
|
209
209
|
applyViewState: (e) => {
|
|
210
210
|
let t = G(), n = u("SCodeEditor", e, t.state.doc.length);
|
|
211
|
-
t.dispatch({ selection:
|
|
211
|
+
t.dispatch({ selection: C.range(n.selection.anchor, n.selection.head) }), t.scrollDOM.scrollTop = n.scrollTop, t.scrollDOM.scrollLeft = n.scrollLeft, X(t);
|
|
212
212
|
},
|
|
213
213
|
focus: () => {
|
|
214
214
|
G().focus();
|
|
@@ -219,12 +219,12 @@ var w = /*@__PURE__*/ h({
|
|
|
219
219
|
"data-viewport": L.value,
|
|
220
220
|
"data-line-numbers": U.value.lineNumbers ? "visible" : "hidden",
|
|
221
221
|
"model-value": I.value,
|
|
222
|
-
autofocus:
|
|
222
|
+
autofocus: ye.value,
|
|
223
223
|
"indent-with-tab": U.value.indentation.keyBehavior === "indent",
|
|
224
224
|
"tab-size": U.value.indentation.tabSize,
|
|
225
|
-
extensions:
|
|
226
|
-
onReady:
|
|
227
|
-
"onUpdate:modelValue":
|
|
225
|
+
extensions: Ce.value,
|
|
226
|
+
onReady: Oe,
|
|
227
|
+
"onUpdate:modelValue": De
|
|
228
228
|
}), null, 16, [
|
|
229
229
|
"data-variant",
|
|
230
230
|
"data-viewport",
|
|
@@ -245,4 +245,4 @@ var w = /*@__PURE__*/ h({
|
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
247
|
//#endregion
|
|
248
|
-
export {
|
|
248
|
+
export { T as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CaseSensitive as e, ChevronDown as t, ChevronUp as n, Regex as r, Replace as i, ReplaceAll as a, ScanSearch as o, WholeWord as s, X as c } from "../../icons/
|
|
1
|
+
import { CaseSensitive as e, ChevronDown as t, ChevronUp as n, Regex as r, Replace as i, ReplaceAll as a, ScanSearch as o, WholeWord as s, X as c } from "../../icons/_internal/generatedSputnigUiIconComponents.js";
|
|
2
2
|
import { useUiKitLocale as l } from "../../../composables/useUiKitLocale.js";
|
|
3
3
|
import { useOwnedAttrs as u } from "../../../internal/ownedAttrs.js";
|
|
4
4
|
import { validateNonEmptyString as d } from "../../../internal/runtimeContract.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../../../../assets/src/components/shared/data-display/SCodeWorkspaceEditor.
|
|
1
|
+
import "../../../../assets/src/components/shared/data-display/SCodeWorkspaceEditor.css_vue_type_style_index_0_src_b200dc8e_scoped_b200dc8e_lang.css";
|
|
2
2
|
import e from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
3
|
import t from "./SCodeWorkspaceEditor.vue_vue_type_script_setup_true_lang.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
//#region src/components/shared/data-display/SCodeWorkspaceEditor.vue
|
|
6
|
-
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-
|
|
6
|
+
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-b200dc8e"]]);
|
|
7
7
|
//#endregion
|
|
8
8
|
export { n as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { X as e } from "../../icons/
|
|
1
|
+
import { X as e } from "../../icons/_internal/generatedSputnigUiIconComponents.js";
|
|
2
2
|
import { useUiKitLocale as t } from "../../../composables/useUiKitLocale.js";
|
|
3
3
|
import { useOwnedAttrs as n } from "../../../internal/ownedAttrs.js";
|
|
4
4
|
import { validateNonEmptyString as r } from "../../../internal/runtimeContract.js";
|
|
@@ -183,7 +183,7 @@ var k = ["data-empty"], A = /*@__PURE__*/ y({
|
|
|
183
183
|
invalid: e.document.invalid,
|
|
184
184
|
placeholder: e.document.placeholder,
|
|
185
185
|
variant: e.document.variant,
|
|
186
|
-
|
|
186
|
+
ariaLabel: e.document.label,
|
|
187
187
|
viewport: "fill",
|
|
188
188
|
"onUpdate:modelValue": (t) => te(e, t),
|
|
189
189
|
onSelectionChange: (t) => ne(e, t),
|
|
@@ -198,7 +198,7 @@ var k = ["data-empty"], A = /*@__PURE__*/ y({
|
|
|
198
198
|
"invalid",
|
|
199
199
|
"placeholder",
|
|
200
200
|
"variant",
|
|
201
|
-
"
|
|
201
|
+
"ariaLabel",
|
|
202
202
|
"onUpdate:modelValue",
|
|
203
203
|
"onSelectionChange",
|
|
204
204
|
"onViewStateChange"
|