@gsc-basic/components 1.0.1 → 1.0.3
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 +59 -0
- package/dist/es/index.js +48 -30
- package/dist/es/node_modules/@codemirror/autocomplete/dist/index.js +15 -15
- package/dist/es/node_modules/@codemirror/commands/dist/index.js +31 -25
- package/dist/es/node_modules/@codemirror/lang-java/dist/index.js +3 -3
- package/dist/es/node_modules/@codemirror/lang-javascript/dist/index.js +8 -8
- package/dist/es/node_modules/@codemirror/lang-json/dist/index.js +1 -1
- package/dist/es/node_modules/@codemirror/lang-python/dist/index.js +1 -1
- package/dist/es/node_modules/@codemirror/lang-sql/dist/index.js +6 -6
- package/dist/es/node_modules/@codemirror/lang-xml/dist/index.js +3 -3
- package/dist/es/node_modules/@codemirror/lang-yaml/dist/index.js +1 -1
- package/dist/es/node_modules/@codemirror/language/dist/index.js +77 -77
- package/dist/es/node_modules/@codemirror/lint/dist/index.js +7 -7
- package/dist/es/node_modules/@codemirror/search/dist/index.js +432 -465
- package/dist/es/node_modules/@codemirror/state/dist/index.js +272 -268
- package/dist/es/node_modules/@codemirror/view/dist/index.js +1732 -1647
- package/dist/es/node_modules/@lezer/common/dist/index.js +191 -190
- package/dist/es/node_modules/@lezer/lr/dist/index.js +5 -3
- package/dist/es/node_modules/@tanstack/devtools-event-client/dist/esm/plugin.js +178 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/EventClient.js +13 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/FieldApi.js +406 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/FormApi.js +772 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/ValidationLogic.js +55 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/metaHelper.js +109 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/standardSchemaValidator.js +45 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/utils.js +213 -0
- package/dist/es/node_modules/@tanstack/pacer-lite/dist/lite-throttler.js +29 -0
- package/dist/es/node_modules/@tanstack/store/dist/esm/derived.js +74 -0
- package/dist/es/node_modules/@tanstack/store/dist/esm/scheduler.js +79 -0
- package/dist/es/node_modules/@tanstack/store/dist/esm/store.js +21 -0
- package/dist/es/node_modules/@tanstack/store/dist/esm/types.js +6 -0
- package/dist/es/node_modules/@tanstack/table-core/build/lib/index.js +1885 -0
- package/dist/es/node_modules/@tanstack/vue-form/dist/esm/useField.js +38 -0
- package/dist/es/node_modules/@tanstack/vue-form/dist/esm/useForm.js +33 -0
- package/dist/es/node_modules/@tanstack/vue-store/dist/esm/index.js +48 -0
- package/dist/es/node_modules/@tanstack/vue-table/build/lib/index.js +159 -0
- package/dist/es/node_modules/@vueuse/core/dist/index.js +1 -1
- package/dist/es/node_modules/codemirror/dist/index.js +3 -3
- package/dist/es/src/Button/index.js +6 -0
- package/dist/es/src/Button/src/Button.css +1 -0
- package/dist/es/src/Button/src/Button.vue.js +41 -0
- package/dist/es/src/Button/src/Button2.css +1 -0
- package/dist/es/src/CodeEditor/src/index.css +1 -1
- package/dist/es/src/CodeEditor/src/index.vue.js +54 -51
- package/dist/es/src/CodeEditor/src/index2.css +1 -1
- package/dist/es/src/ConfigProvider/index.js +1 -2
- package/dist/es/src/ConfigProvider/src/useGlobalConfig.js +9 -9
- package/dist/es/src/Form/index.js +6 -0
- package/dist/es/src/Form/src/Form.css +1 -0
- package/dist/es/src/Form/src/Form.vue.js +208 -0
- package/dist/es/src/Form/src/styles/form.css +1 -0
- package/dist/es/src/Grid/index.js +6 -0
- package/dist/es/src/Grid/src/Grid.css +1 -0
- package/dist/es/src/Grid/src/Grid.vue.js +180 -0
- package/dist/es/src/Grid/src/components/ActionBar.css +1 -0
- package/dist/es/src/Grid/src/components/ActionBar.vue.js +65 -0
- package/dist/es/src/Grid/src/components/CellEditor.css +1 -0
- package/dist/es/src/Grid/src/components/CellEditor.vue.js +132 -0
- package/dist/es/src/Grid/src/components/CellEditor2.css +1 -0
- package/dist/es/src/Grid/src/components/ColumnFilter.css +1 -0
- package/dist/es/src/Grid/src/components/ColumnFilter.vue.js +72 -0
- package/dist/es/src/Grid/src/components/ColumnSettings.css +1 -0
- package/dist/es/src/Grid/src/components/ColumnSettings.vue.js +109 -0
- package/dist/es/src/Grid/src/components/DataTable.css +1 -0
- package/dist/es/src/Grid/src/components/DataTable.vue.js +556 -0
- package/dist/es/src/Grid/src/components/Pager.css +1 -0
- package/dist/es/src/Grid/src/components/Pager.vue.js +64 -0
- package/dist/es/src/Grid/src/components/QueryBar.css +1 -0
- package/dist/es/src/Grid/src/components/QueryBar.vue.js +156 -0
- package/dist/es/src/Grid/src/composables/useCellEditor.js +20 -0
- package/dist/es/src/Grid/src/composables/useGridTable.js +213 -0
- package/dist/es/src/Grid/src/styles/table.css +1 -0
- package/dist/es/src/Overlay/index.js +61 -0
- package/dist/es/src/Overlay/src/Message.css +1 -0
- package/dist/es/src/Overlay/src/Message.vue.js +36 -0
- package/dist/es/src/Overlay/src/Message2.css +1 -0
- package/dist/es/src/Overlay/src/Modal.css +1 -0
- package/dist/es/src/Overlay/src/Modal.vue.js +67 -0
- package/dist/es/src/Overlay/src/Modal2.css +1 -0
- package/dist/es/src/Overlay/src/Notice.css +1 -0
- package/dist/es/src/Overlay/src/Notice.vue.js +37 -0
- package/dist/es/src/Overlay/src/Notice2.css +1 -0
- package/dist/es/src/ScaleScreen/src/index.vue.js +2 -2
- package/dist/es/src/VideoBackground/src/index.vue.js +8 -8
- package/dist/es/src/index.js +35 -19
- package/dist/es/src/locale/lang/en-US.js +40 -0
- package/dist/es/src/locale/lang/ja-JP.js +42 -2
- package/dist/es/src/locale/lang/zh-CN.js +42 -2
- package/dist/es/src/styles/tokens.css +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/lib/node_modules/@codemirror/commands/dist/index.js +1 -1
- package/dist/lib/node_modules/@codemirror/language/dist/index.js +1 -1
- package/dist/lib/node_modules/@codemirror/search/dist/index.js +2 -2
- package/dist/lib/node_modules/@codemirror/state/dist/index.js +4 -4
- package/dist/lib/node_modules/@codemirror/view/dist/index.js +5 -5
- package/dist/lib/node_modules/@lezer/common/dist/index.js +1 -1
- package/dist/lib/node_modules/@lezer/lr/dist/index.js +1 -1
- package/dist/lib/node_modules/@tanstack/devtools-event-client/dist/esm/plugin.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/EventClient.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/FieldApi.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/FormApi.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/ValidationLogic.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/metaHelper.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/standardSchemaValidator.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/utils.js +1 -0
- package/dist/lib/node_modules/@tanstack/pacer-lite/dist/lite-throttler.js +1 -0
- package/dist/lib/node_modules/@tanstack/store/dist/esm/derived.js +1 -0
- package/dist/lib/node_modules/@tanstack/store/dist/esm/scheduler.js +1 -0
- package/dist/lib/node_modules/@tanstack/store/dist/esm/store.js +1 -0
- package/dist/lib/node_modules/@tanstack/store/dist/esm/types.js +1 -0
- package/dist/lib/node_modules/@tanstack/table-core/build/lib/index.js +4 -0
- package/dist/lib/node_modules/@tanstack/vue-form/dist/esm/useField.js +1 -0
- package/dist/lib/node_modules/@tanstack/vue-form/dist/esm/useForm.js +1 -0
- package/dist/lib/node_modules/@tanstack/vue-store/dist/esm/index.js +1 -0
- package/dist/lib/node_modules/@tanstack/vue-table/build/lib/index.js +1 -0
- package/dist/lib/src/Button/index.js +1 -0
- package/dist/lib/src/Button/src/Button.css +1 -0
- package/dist/lib/src/Button/src/Button.vue.js +1 -0
- package/dist/lib/src/Button/src/Button2.css +1 -0
- package/dist/lib/src/CodeEditor/src/index.css +1 -1
- package/dist/lib/src/CodeEditor/src/index.vue.js +1 -1
- package/dist/lib/src/CodeEditor/src/index2.css +1 -1
- package/dist/lib/src/ConfigProvider/index.js +1 -1
- package/dist/lib/src/Form/index.js +1 -0
- package/dist/lib/src/Form/src/Form.css +1 -0
- package/dist/lib/src/Form/src/Form.vue.js +1 -0
- package/dist/lib/src/Form/src/styles/form.css +1 -0
- package/dist/lib/src/Grid/index.js +1 -0
- package/dist/lib/src/Grid/src/Grid.css +1 -0
- package/dist/lib/src/Grid/src/Grid.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/ActionBar.css +1 -0
- package/dist/lib/src/Grid/src/components/ActionBar.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/CellEditor.css +1 -0
- package/dist/lib/src/Grid/src/components/CellEditor.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/CellEditor2.css +1 -0
- package/dist/lib/src/Grid/src/components/ColumnFilter.css +1 -0
- package/dist/lib/src/Grid/src/components/ColumnFilter.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/ColumnSettings.css +1 -0
- package/dist/lib/src/Grid/src/components/ColumnSettings.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/DataTable.css +1 -0
- package/dist/lib/src/Grid/src/components/DataTable.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/Pager.css +1 -0
- package/dist/lib/src/Grid/src/components/Pager.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/QueryBar.css +1 -0
- package/dist/lib/src/Grid/src/components/QueryBar.vue.js +1 -0
- package/dist/lib/src/Grid/src/composables/useCellEditor.js +1 -0
- package/dist/lib/src/Grid/src/composables/useGridTable.js +1 -0
- package/dist/lib/src/Grid/src/styles/table.css +1 -0
- package/dist/lib/src/Overlay/index.js +1 -0
- package/dist/lib/src/Overlay/src/Message.css +1 -0
- package/dist/lib/src/Overlay/src/Message.vue.js +1 -0
- package/dist/lib/src/Overlay/src/Message2.css +1 -0
- package/dist/lib/src/Overlay/src/Modal.css +1 -0
- package/dist/lib/src/Overlay/src/Modal.vue.js +1 -0
- package/dist/lib/src/Overlay/src/Modal2.css +1 -0
- package/dist/lib/src/Overlay/src/Notice.css +1 -0
- package/dist/lib/src/Overlay/src/Notice.vue.js +1 -0
- package/dist/lib/src/Overlay/src/Notice2.css +1 -0
- package/dist/lib/src/index.js +1 -1
- package/dist/lib/src/locale/lang/en-US.js +1 -1
- package/dist/lib/src/locale/lang/ja-JP.js +1 -1
- package/dist/lib/src/locale/lang/zh-CN.js +1 -1
- package/dist/lib/src/styles/tokens.css +1 -1
- package/package.json +11 -8
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# @gsc-basic/components 开发说明
|
|
2
|
+
|
|
3
|
+
使用 Vite 以 library mode 构建,默认样式体系为 UnoCSS。
|
|
4
|
+
|
|
5
|
+
## 目录结构(核心)
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
packages/components
|
|
9
|
+
index.js # 包入口(默认导出 install + re-export src/index.js)
|
|
10
|
+
package.json
|
|
11
|
+
vite.config.mjs # library build 配置(含 @ 别名)
|
|
12
|
+
uno.config.mjs # 本包 UnoCSS 配置(含 shadcn preset)
|
|
13
|
+
tsconfig.json # TS 项目编辑器别名:@/* -> src/*(shadcn 组件使用 TS)
|
|
14
|
+
|
|
15
|
+
components.json # shadcn-vue CLI 配置(本仓库 shadcn 部分使用 TS:typescript=true)
|
|
16
|
+
tailwind.config.js # 仅用于满足 shadcn-vue CLI 的占位文件(真实样式用 UnoCSS)
|
|
17
|
+
|
|
18
|
+
src/
|
|
19
|
+
index.js # 组件库对外导出入口(仅导出业务组件)
|
|
20
|
+
styles/tokens.css # 设计变量(含 shadcn tokens + dark 覆盖)
|
|
21
|
+
|
|
22
|
+
<ComponentName>/ # 对外组件(示例:Grid/、ConfigProvider/ 等)
|
|
23
|
+
index.js # withInstall 包装导出
|
|
24
|
+
src/*.vue # 组件实现
|
|
25
|
+
|
|
26
|
+
components/ui/** # shadcn-vue 生成/维护的内部 UI 组件(不要从 src/index.js 导出)
|
|
27
|
+
lib/** # 内部工具(例如 cn class 合并)
|
|
28
|
+
|
|
29
|
+
stories/**/*.stories.js # Storybook stories
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 新增“对外组件”的推荐流程
|
|
33
|
+
|
|
34
|
+
1. 建目录:`packages/components/src/<ComponentName>/src/<ComponentName>.vue`
|
|
35
|
+
|
|
36
|
+
2. 写导出文件:`packages/components/src/<ComponentName>/index.js`
|
|
37
|
+
|
|
38
|
+
推荐模板:
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
import { withInstall } from '@gsc-basic/utils';
|
|
42
|
+
import Comp from './src/<ComponentName>.vue';
|
|
43
|
+
|
|
44
|
+
export const GscComponentName = withInstall(Comp);
|
|
45
|
+
export default GscComponentName;
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
3. 在 `packages/components/src/index.js` 里 re-export:
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
export * from './<ComponentName>';
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
4. 增加 Storybook:`packages/components/stories/<ComponentName>.stories.js`
|
|
55
|
+
|
|
56
|
+
## Storybook / stories 编写规范
|
|
57
|
+
|
|
58
|
+
- stories 目录:`packages/components/stories/**/*.stories.js`
|
|
59
|
+
- 组件库对外组件:推荐从 `@gsc-basic/components` 引入(走真实导出路径)
|
package/dist/es/index.js
CHANGED
|
@@ -1,35 +1,53 @@
|
|
|
1
1
|
import * as e from "./src/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { GscConfigProvider as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
import { GscButton as s } from "./src/Button/index.js";
|
|
3
|
+
import { GscCodeEditor as l } from "./src/CodeEditor/index.js";
|
|
4
|
+
import { GscConfigProvider as x } from "./src/ConfigProvider/index.js";
|
|
5
|
+
import { GscForm as c } from "./src/Form/index.js";
|
|
6
|
+
import { GscGrid as u } from "./src/Grid/index.js";
|
|
7
|
+
import { GscScaleScreen as g } from "./src/ScaleScreen/index.js";
|
|
8
|
+
import { GscVideoBackground as y } from "./src/VideoBackground/index.js";
|
|
9
|
+
import { default as I } from "./src/Overlay/src/Message.vue.js";
|
|
10
|
+
import { default as M } from "./src/Overlay/src/Modal.vue.js";
|
|
11
|
+
import { default as P } from "./src/Overlay/src/Notice.vue.js";
|
|
12
|
+
import { configProviderContextKey as h, defaultInitialZIndex as j, defaultNamespace as v, localeContextKey as z, sizeInjectionKey as w, zIndexContextKey as B } from "./src/ConfigProvider/src/constants.js";
|
|
13
|
+
import { default as E } from "./src/locale/lang/en-US.js";
|
|
14
|
+
import { default as J } from "./src/locale/lang/ja-JP.js";
|
|
15
|
+
import { openModal as V, showMessage as Z, showNotice as $ } from "./src/Overlay/index.js";
|
|
16
|
+
import { provideGlobalConfig as A, useGlobalComponentSettings as D, useGlobalConfig as H } from "./src/ConfigProvider/src/useGlobalConfig.js";
|
|
17
|
+
import { default as O } from "./src/locale/lang/zh-CN.js";
|
|
18
|
+
const f = {
|
|
19
|
+
install: (t) => {
|
|
20
|
+
for (const r in e) {
|
|
21
|
+
const o = e[r];
|
|
22
|
+
o && (typeof o == "function" || typeof o == "object") && "install" in o && t.use(o);
|
|
23
|
+
}
|
|
15
24
|
}
|
|
16
25
|
};
|
|
17
26
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
z as
|
|
27
|
+
s as GscButton,
|
|
28
|
+
l as GscCodeEditor,
|
|
29
|
+
x as GscConfigProvider,
|
|
30
|
+
c as GscForm,
|
|
31
|
+
u as GscGrid,
|
|
32
|
+
g as GscScaleScreen,
|
|
33
|
+
y as GscVideoBackground,
|
|
34
|
+
I as Message,
|
|
35
|
+
M as Modal,
|
|
36
|
+
P as Notice,
|
|
37
|
+
h as configProviderContextKey,
|
|
38
|
+
f as default,
|
|
39
|
+
j as defaultInitialZIndex,
|
|
40
|
+
v as defaultNamespace,
|
|
41
|
+
E as enUS,
|
|
42
|
+
J as jaJP,
|
|
43
|
+
z as localeContextKey,
|
|
44
|
+
V as openModal,
|
|
45
|
+
A as provideGlobalConfig,
|
|
46
|
+
Z as showMessage,
|
|
47
|
+
$ as showNotice,
|
|
48
|
+
w as sizeInjectionKey,
|
|
49
|
+
D as useGlobalComponentSettings,
|
|
50
|
+
H as useGlobalConfig,
|
|
51
|
+
B as zIndexContextKey,
|
|
52
|
+
O as zhCN
|
|
35
53
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EditorView as M,
|
|
1
|
+
import { codePointAt as v, EditorSelection as w, Transaction as Re, Text as Me, StateEffect as O, codePointSize as T, StateField as _, RangeSet as Le, Prec as ee, Facet as ye, combineConfig as ke, fromCodePoint as be, Annotation as Be, MapMode as G, RangeValue as Fe, CharCategory as J } from "../../state/dist/index.js";
|
|
2
|
+
import { EditorView as M, showTooltip as $e, ViewPlugin as Ne, logException as Z, getTooltip as xe, keymap as we, Decoration as V, Direction as Ue, WidgetType as We } from "../../view/dist/index.js";
|
|
3
3
|
import { syntaxTree as q, indentUnit as je } from "../../language/dist/index.js";
|
|
4
4
|
class Ce {
|
|
5
5
|
/**
|
|
@@ -102,7 +102,7 @@ function ve(i, e) {
|
|
|
102
102
|
let { source: n } = i, o = e && n[0] != "^", s = n[n.length - 1] != "$";
|
|
103
103
|
return !o && !s ? i : new RegExp(`${o ? "^" : ""}(?:${n})${s ? "$" : ""}`, (t = i.flags) !== null && t !== void 0 ? t : i.ignoreCase ? "i" : "");
|
|
104
104
|
}
|
|
105
|
-
const te = /* @__PURE__ */
|
|
105
|
+
const te = /* @__PURE__ */ Be.define();
|
|
106
106
|
function qe(i, e, t, n) {
|
|
107
107
|
let { main: o } = i.selection, s = t - o.from, l = n - o.from;
|
|
108
108
|
return {
|
|
@@ -205,7 +205,7 @@ class Qe {
|
|
|
205
205
|
}
|
|
206
206
|
const g = /* @__PURE__ */ ye.define({
|
|
207
207
|
combine(i) {
|
|
208
|
-
return
|
|
208
|
+
return ke(i, {
|
|
209
209
|
activateOnTyping: !0,
|
|
210
210
|
activateOnCompletion: () => !1,
|
|
211
211
|
activateOnTypingDelay: 100,
|
|
@@ -239,7 +239,7 @@ function he(i, e) {
|
|
|
239
239
|
return i ? e ? i + " " + e : i : e;
|
|
240
240
|
}
|
|
241
241
|
function Xe(i, e, t, n, o, s) {
|
|
242
|
-
let l = i.textDirection ==
|
|
242
|
+
let l = i.textDirection == Ue.RTL, a = l, r = !1, h = "top", c, f, p = e.left - o.left, u = o.right - e.right, m = n.right - n.left, y = n.bottom - n.top;
|
|
243
243
|
if (a && p < Math.min(m, u) ? a = !1 : !a && u < Math.min(m, p) && (a = !0), m <= (a ? p : u))
|
|
244
244
|
c = Math.max(o.top, Math.min(t.top, o.bottom - y)) - e.top, f = Math.min(400, a ? p : u);
|
|
245
245
|
else {
|
|
@@ -688,7 +688,7 @@ const ie = /* @__PURE__ */ O.define({
|
|
|
688
688
|
return i.update(e);
|
|
689
689
|
},
|
|
690
690
|
provide: (i) => [
|
|
691
|
-
|
|
691
|
+
$e.from(i, (e) => e.tooltip),
|
|
692
692
|
M.contentAttributes.from(i, (e) => e.attrs)
|
|
693
693
|
]
|
|
694
694
|
});
|
|
@@ -707,7 +707,7 @@ function W(i, e = "option") {
|
|
|
707
707
|
if (!n || !n.open || n.open.disabled || Date.now() - n.open.timestamp < t.state.facet(g).interactionDelay)
|
|
708
708
|
return !1;
|
|
709
709
|
let o = 1, s;
|
|
710
|
-
e == "page" && (s =
|
|
710
|
+
e == "page" && (s = xe(t, n.open.tooltip)) && (o = Math.max(2, Math.floor(s.dom.offsetHeight / s.dom.querySelector("li").offsetHeight) - 1));
|
|
711
711
|
let { length: l } = n.open.options, a = n.open.selected > -1 ? n.open.selected + o * (i ? 1 : -1) : i ? 0 : l - 1;
|
|
712
712
|
return a < 0 ? a = e == "page" ? 0 : l - 1 : a >= l && (a = e == "page" ? l - 1 : 0), t.dispatch({ effects: Ie.of(a) }), !0;
|
|
713
713
|
};
|
|
@@ -727,7 +727,7 @@ class at {
|
|
|
727
727
|
this.active = e, this.context = t, this.time = Date.now(), this.updates = [], this.done = void 0;
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
|
-
const ct = 50, ft = 1e3, ht = /* @__PURE__ */
|
|
730
|
+
const ct = 50, ft = 1e3, ht = /* @__PURE__ */ Ne.fromClass(class {
|
|
731
731
|
constructor(i) {
|
|
732
732
|
this.view = i, this.debounceUpdate = -1, this.running = [], this.debounceAccept = -1, this.pendingStart = !1, this.composing = 0;
|
|
733
733
|
for (let e of i.state.field(x).active)
|
|
@@ -818,7 +818,7 @@ const ct = 50, ft = 1e3, ht = /* @__PURE__ */ $e.fromClass(class {
|
|
|
818
818
|
blur(i) {
|
|
819
819
|
let e = this.view.state.field(x, !1);
|
|
820
820
|
if (e && e.tooltip && this.view.state.facet(g).closeOnBlur) {
|
|
821
|
-
let t = e.open &&
|
|
821
|
+
let t = e.open && xe(this.view, e.open.tooltip);
|
|
822
822
|
(!t || !t.dom.contains(i.relatedTarget)) && setTimeout(() => this.view.dispatch({ effects: B.of(null) }), 10);
|
|
823
823
|
}
|
|
824
824
|
},
|
|
@@ -1024,7 +1024,7 @@ class se {
|
|
|
1024
1024
|
return new se(n, o);
|
|
1025
1025
|
}
|
|
1026
1026
|
}
|
|
1027
|
-
let mt = /* @__PURE__ */ V.widget({ widget: /* @__PURE__ */ new class extends
|
|
1027
|
+
let mt = /* @__PURE__ */ V.widget({ widget: /* @__PURE__ */ new class extends We {
|
|
1028
1028
|
toDOM() {
|
|
1029
1029
|
let i = document.createElement("span");
|
|
1030
1030
|
return i.className = "cm-snippetFieldPosition", i;
|
|
@@ -1077,9 +1077,9 @@ function bt(i) {
|
|
|
1077
1077
|
let e = se.parse(i);
|
|
1078
1078
|
return (t, n, o, s) => {
|
|
1079
1079
|
let { text: l, ranges: a } = e.instantiate(t.state, o), { main: r } = t.state.selection, h = {
|
|
1080
|
-
changes: { from: o, to: s == r.from ? r.to : s, insert:
|
|
1080
|
+
changes: { from: o, to: s == r.from ? r.to : s, insert: Me.of(l) },
|
|
1081
1081
|
scrollIntoView: !0,
|
|
1082
|
-
annotations: n ? [te.of(n),
|
|
1082
|
+
annotations: n ? [te.of(n), Re.userEvent.of("input.complete")] : void 0
|
|
1083
1083
|
};
|
|
1084
1084
|
if (a.length && (h.selection = le(a, 0)), a.some((c) => c.field > 0)) {
|
|
1085
1085
|
let c = new L(a, 0), f = h.effects = [N.of(c)];
|
|
@@ -1108,7 +1108,7 @@ const xt = ({ state: i, dispatch: e }) => i.field(F, !1) ? (e(i.update({ effects
|
|
|
1108
1108
|
combine(i) {
|
|
1109
1109
|
return i.length ? i[0] : vt;
|
|
1110
1110
|
}
|
|
1111
|
-
}), St = /* @__PURE__ */ ee.highest(/* @__PURE__ */
|
|
1111
|
+
}), St = /* @__PURE__ */ ee.highest(/* @__PURE__ */ we.compute([de], (i) => i.facet(de)));
|
|
1112
1112
|
function Wt(i, e) {
|
|
1113
1113
|
return { ...e, apply: bt(i) };
|
|
1114
1114
|
}
|
|
@@ -1139,7 +1139,7 @@ re.startSide = 1;
|
|
|
1139
1139
|
re.endSide = -1;
|
|
1140
1140
|
const Ae = /* @__PURE__ */ _.define({
|
|
1141
1141
|
create() {
|
|
1142
|
-
return
|
|
1142
|
+
return Le.empty;
|
|
1143
1143
|
},
|
|
1144
1144
|
update(i, e) {
|
|
1145
1145
|
if (i = i.map(e.changes), e.selection) {
|
|
@@ -1345,7 +1345,7 @@ const kt = [
|
|
|
1345
1345
|
{ key: "PageDown", run: /* @__PURE__ */ W(!0, "page") },
|
|
1346
1346
|
{ key: "PageUp", run: /* @__PURE__ */ W(!1, "page") },
|
|
1347
1347
|
{ key: "Enter", run: lt }
|
|
1348
|
-
], Bt = /* @__PURE__ */ ee.highest(/* @__PURE__ */
|
|
1348
|
+
], Bt = /* @__PURE__ */ ee.highest(/* @__PURE__ */ we.computeN([g], (i) => i.facet(g).defaultKeymap ? [kt] : []));
|
|
1349
1349
|
export {
|
|
1350
1350
|
Ce as CompletionContext,
|
|
1351
1351
|
lt as acceptCompletion,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EditorSelection as a, StateField as qe, Transaction as P, Facet as oe, combineConfig as Ke, StateEffect as le, ChangeSet as $e, ChangeDesc as We, Annotation as ce, countColumn as $, Text as se, findClusterBreak as E } from "../../state/dist/index.js";
|
|
2
2
|
import { EditorView as x, Direction as Qe } from "../../view/dist/index.js";
|
|
3
3
|
import { IndentContext as ie, getIndentation as ue, indentString as R, syntaxTree as W, matchBrackets as D, getIndentUnit as G, indentUnit as Xe } from "../../language/dist/index.js";
|
|
4
4
|
import { NodeProp as F } from "../../../@lezer/common/dist/index.js";
|
|
5
5
|
const Ye = (e) => {
|
|
6
6
|
let { state: t } = e, r = t.doc.lineAt(t.selection.main.from), n = X(e.state, r.from);
|
|
7
|
-
return n.line ? Ze(e) : n.block ?
|
|
7
|
+
return n.line ? Ze(e) : n.block ? _e(e) : !1;
|
|
8
8
|
};
|
|
9
9
|
function Q(e, t) {
|
|
10
10
|
return ({ state: r, dispatch: n }) => {
|
|
@@ -22,7 +22,7 @@ const Ze = /* @__PURE__ */ Q(
|
|
|
22
22
|
fe,
|
|
23
23
|
0
|
|
24
24
|
/* CommentOption.Toggle */
|
|
25
|
-
),
|
|
25
|
+
), _e = /* @__PURE__ */ Q(
|
|
26
26
|
(e, t) => fe(e, t, et(t)),
|
|
27
27
|
0
|
|
28
28
|
/* CommentOption.Toggle */
|
|
@@ -32,7 +32,7 @@ function X(e, t) {
|
|
|
32
32
|
return r.length ? r[0] : {};
|
|
33
33
|
}
|
|
34
34
|
const M = 50;
|
|
35
|
-
function
|
|
35
|
+
function we(e, { open: t, close: r }, n, l) {
|
|
36
36
|
let o = e.sliceDoc(n - M, n), c = e.sliceDoc(l, l + M), s = /\s*$/.exec(o)[0].length, i = /^\s*/.exec(c)[0].length, f = o.length - s;
|
|
37
37
|
if (o.slice(f - t.length, f) == t && c.slice(i, i + r.length) == r)
|
|
38
38
|
return {
|
|
@@ -67,7 +67,7 @@ function fe(e, t, r = t.selection.ranges) {
|
|
|
67
67
|
let n = r.map((o) => X(t, o.from).block);
|
|
68
68
|
if (!n.every((o) => o))
|
|
69
69
|
return null;
|
|
70
|
-
let l = r.map((o, c) =>
|
|
70
|
+
let l = r.map((o, c) => we(t, n[c], o.from, o.to));
|
|
71
71
|
if (e != 2 && !l.every((o) => o))
|
|
72
72
|
return { changes: t.changes(r.map((o, c) => l[c] ? [] : [{ from: o.from, insert: n[c].open + " " }, { from: o.to, insert: " " + n[c].close }])) };
|
|
73
73
|
if (e != 1 && l.some((o) => o)) {
|
|
@@ -261,7 +261,7 @@ function ft(e, t, r) {
|
|
|
261
261
|
if (!e.changes)
|
|
262
262
|
return m.selection(n);
|
|
263
263
|
let l = e.changes.map(t), o = t.mapDesc(e.changes, !0), c = e.mapped ? e.mapped.composeDesc(o) : o;
|
|
264
|
-
return new m(l,
|
|
264
|
+
return new m(l, le.mapEffects(e.effects, t), c, e.startSelection.map(o), n);
|
|
265
265
|
}
|
|
266
266
|
const at = /^(input\.type|delete)($|\.)/;
|
|
267
267
|
class B {
|
|
@@ -274,7 +274,7 @@ class B {
|
|
|
274
274
|
addChanges(t, r, n, l, o) {
|
|
275
275
|
let c = this.done, s = c[c.length - 1];
|
|
276
276
|
return s && s.changes && !s.changes.empty && t.changes && (!n || at.test(n)) && (!s.selectionsAfter.length && r - this.prevTime < l.newGroupDelay && l.joinToEvent(o, ct(s.changes, t.changes)) || // For compose (but not compose.start) events, always join with previous event
|
|
277
|
-
n == "input.type.compose") ? c = v(c, c.length - 1, l.minDepth, new m(t.changes.compose(s.changes), me(
|
|
277
|
+
n == "input.type.compose") ? c = v(c, c.length - 1, l.minDepth, new m(t.changes.compose(s.changes), me(le.mapEffects(t.effects, s.changes), s.effects), s.mapped, s.startSelection, g)) : c = v(c, c.length, l.minDepth, t), new B(c, g, r, n);
|
|
278
278
|
}
|
|
279
279
|
addSelection(t, r, n, l) {
|
|
280
280
|
let o = this.done.length ? this.done[this.done.length - 1].selectionsAfter : g;
|
|
@@ -441,7 +441,7 @@ const be = (e) => Te(e, !1), Re = (e) => Te(e, !0);
|
|
|
441
441
|
function ve(e, t) {
|
|
442
442
|
return y(e, (r) => e.moveVertically(r, t, xe(e).height));
|
|
443
443
|
}
|
|
444
|
-
const j = (e) => ve(e, !1),
|
|
444
|
+
const j = (e) => ve(e, !1), _ = (e) => ve(e, !0), Tt = (e) => y(e, (t) => S(e, t, !0)), bt = (e) => y(e, (t) => S(e, t, !1)), Rt = (e) => y(e, (t) => S(e, t, !d(e))), vt = (e) => y(e, (t) => S(e, t, d(e))), It = (e) => y(e, (t) => a.cursor(e.lineBlockAt(t.head).from)), Ut = (e) => y(e, (t) => a.cursor(e.lineBlockAt(t.head).to)), w = ({ state: e, dispatch: t }) => (t(k(e, { anchor: 0 })), !0), ee = ({ state: e, dispatch: t }) => (t(k(e, { anchor: e.doc.length })), !0), te = ({ state: e, dispatch: t }) => (t(k(e, { anchor: e.selection.main.anchor, head: 0 })), !0), ne = ({ state: e, dispatch: t }) => (t(k(e, { anchor: e.selection.main.anchor, head: e.doc.length })), !0), Vt = ({ state: e, dispatch: t }) => (t(e.update({ selection: { anchor: 0, head: e.doc.length }, userEvent: "select" })), !0), Nt = ({ state: e, dispatch: t }) => {
|
|
445
445
|
let r = N(e).map(({ from: n, to: l }) => a.range(n, Math.min(l + 1, e.doc.length)));
|
|
446
446
|
return t(e.update({ selection: a.create(r), userEvent: "select" })), !0;
|
|
447
447
|
}, Pt = ({ state: e, dispatch: t }) => {
|
|
@@ -547,7 +547,7 @@ const Ue = (e, t, r) => O(e, (n) => {
|
|
|
547
547
|
if (e.readOnly)
|
|
548
548
|
return !1;
|
|
549
549
|
let r = e.changeByRange((n) => ({
|
|
550
|
-
changes: { from: n.from, to: n.to, insert:
|
|
550
|
+
changes: { from: n.from, to: n.to, insert: se.of(["", ""]) },
|
|
551
551
|
range: a.cursor(n.from)
|
|
552
552
|
}));
|
|
553
553
|
return t(e.update(r, { scrollIntoView: !0, userEvent: "input" })), !0;
|
|
@@ -608,9 +608,15 @@ function Ge(e, t, r) {
|
|
|
608
608
|
if (e.readOnly)
|
|
609
609
|
return !1;
|
|
610
610
|
let n = [];
|
|
611
|
-
for (let
|
|
612
|
-
r ? n.push({ from:
|
|
613
|
-
|
|
611
|
+
for (let o of N(e))
|
|
612
|
+
r ? n.push({ from: o.from, insert: e.doc.slice(o.from, o.to) + e.lineBreak }) : n.push({ from: o.to, insert: e.lineBreak + e.doc.slice(o.from, o.to) });
|
|
613
|
+
let l = e.changes(n);
|
|
614
|
+
return t(e.update({
|
|
615
|
+
changes: l,
|
|
616
|
+
selection: e.selection.map(l, r ? 1 : -1),
|
|
617
|
+
scrollIntoView: !0,
|
|
618
|
+
userEvent: "input.copyline"
|
|
619
|
+
})), !0;
|
|
614
620
|
}
|
|
615
621
|
const Yt = ({ state: e, dispatch: t }) => Ge(e, t, !1), Zt = ({ state: e, dispatch: t }) => Ge(e, t, !0), jt = (e) => {
|
|
616
622
|
if (e.state.readOnly)
|
|
@@ -625,19 +631,19 @@ const Yt = ({ state: e, dispatch: t }) => Ge(e, t, !1), Zt = ({ state: e, dispat
|
|
|
625
631
|
}).map(r);
|
|
626
632
|
return e.dispatch({ changes: r, selection: n, scrollIntoView: !0, userEvent: "delete.line" }), !0;
|
|
627
633
|
};
|
|
628
|
-
function
|
|
634
|
+
function _t(e, t) {
|
|
629
635
|
if (/\(\)|\[\]|\{\}/.test(e.sliceDoc(t - 1, t + 1)))
|
|
630
636
|
return { from: t, to: t };
|
|
631
637
|
let r = W(e).resolveInner(t), n = r.childBefore(t), l = r.childAfter(t), o;
|
|
632
638
|
return n && l && n.to <= t && l.from >= t && (o = n.type.prop(F.closedBy)) && o.indexOf(l.name) > -1 && e.doc.lineAt(n.to).from == e.doc.lineAt(l.from).from && !/\S/.test(e.sliceDoc(n.to, l.from)) ? { from: n.to, to: l.from } : null;
|
|
633
639
|
}
|
|
634
|
-
const re = /* @__PURE__ */ Fe(!1),
|
|
640
|
+
const re = /* @__PURE__ */ Fe(!1), wt = /* @__PURE__ */ Fe(!0);
|
|
635
641
|
function Fe(e) {
|
|
636
642
|
return ({ state: t, dispatch: r }) => {
|
|
637
643
|
if (t.readOnly)
|
|
638
644
|
return !1;
|
|
639
645
|
let n = t.changeByRange((l) => {
|
|
640
|
-
let { from: o, to: c } = l, s = t.doc.lineAt(o), i = !e && o == c &&
|
|
646
|
+
let { from: o, to: c } = l, s = t.doc.lineAt(o), i = !e && o == c && _t(t, o);
|
|
641
647
|
e && (o = c = (c <= s.to ? s : t.doc.lineAt(c)).to);
|
|
642
648
|
let f = new ie(t, { simulateBreak: o, simulateDoubleBreak: !!i }), u = ue(f, o);
|
|
643
649
|
for (u == null && (u = $(/^\s*/.exec(t.doc.lineAt(o).text)[0], t.tabSize)); c < s.to && /\s/.test(s.text[c - s.from]); )
|
|
@@ -645,7 +651,7 @@ function Fe(e) {
|
|
|
645
651
|
i ? { from: o, to: c } = i : o > s.from && o < s.from + 100 && !/\S/.test(s.text.slice(0, o)) && (o = s.from);
|
|
646
652
|
let h = ["", R(t, u)];
|
|
647
653
|
return i && h.push(R(t, f.lineIndent(s.from, -1))), {
|
|
648
|
-
changes: { from: o, to: c, insert:
|
|
654
|
+
changes: { from: o, to: c, insert: se.of(h) },
|
|
649
655
|
range: a.cursor(o + 1 + h[1].length)
|
|
650
656
|
};
|
|
651
657
|
});
|
|
@@ -714,15 +720,15 @@ const en = ({ state: e, dispatch: t }) => {
|
|
|
714
720
|
{ key: "Mod-ArrowRight", mac: "Alt-ArrowRight", run: dt, shift: Mt, preventDefault: !0 },
|
|
715
721
|
{ mac: "Cmd-ArrowRight", run: Bt, shift: vt, preventDefault: !0 },
|
|
716
722
|
{ key: "ArrowUp", run: Se, shift: be, preventDefault: !0 },
|
|
717
|
-
{ mac: "Cmd-ArrowUp", run:
|
|
723
|
+
{ mac: "Cmd-ArrowUp", run: w, shift: te },
|
|
718
724
|
{ mac: "Ctrl-ArrowUp", run: Z, shift: j },
|
|
719
725
|
{ key: "ArrowDown", run: De, shift: Re, preventDefault: !0 },
|
|
720
726
|
{ mac: "Cmd-ArrowDown", run: ee, shift: ne },
|
|
721
|
-
{ mac: "Ctrl-ArrowDown", run: q, shift:
|
|
727
|
+
{ mac: "Ctrl-ArrowDown", run: q, shift: _ },
|
|
722
728
|
{ key: "PageUp", run: Z, shift: j },
|
|
723
|
-
{ key: "PageDown", run: q, shift:
|
|
729
|
+
{ key: "PageDown", run: q, shift: _ },
|
|
724
730
|
{ key: "Home", run: kt, shift: bt, preventDefault: !0 },
|
|
725
|
-
{ key: "Mod-Home", run:
|
|
731
|
+
{ key: "Mod-Home", run: w, shift: te },
|
|
726
732
|
{ key: "End", run: yt, shift: Tt, preventDefault: !0 },
|
|
727
733
|
{ key: "Mod-End", run: ee, shift: ne },
|
|
728
734
|
{ key: "Enter", run: re, shift: re },
|
|
@@ -743,7 +749,7 @@ const en = ({ state: e, dispatch: t }) => {
|
|
|
743
749
|
{ key: "Mod-Alt-ArrowUp", run: Jt },
|
|
744
750
|
{ key: "Mod-Alt-ArrowDown", run: Gt },
|
|
745
751
|
{ key: "Escape", run: Ft },
|
|
746
|
-
{ key: "Mod-Enter", run:
|
|
752
|
+
{ key: "Mod-Enter", run: wt },
|
|
747
753
|
{ key: "Alt-l", mac: "Ctrl-l", run: Nt },
|
|
748
754
|
{ key: "Mod-i", run: Pt, preventDefault: !0 },
|
|
749
755
|
{ key: "Mod-[", run: He },
|
|
@@ -763,7 +769,7 @@ export {
|
|
|
763
769
|
ye as cursorCharLeft,
|
|
764
770
|
ke as cursorCharRight,
|
|
765
771
|
ee as cursorDocEnd,
|
|
766
|
-
|
|
772
|
+
w as cursorDocStart,
|
|
767
773
|
ht as cursorGroupLeft,
|
|
768
774
|
dt as cursorGroupRight,
|
|
769
775
|
kt as cursorLineBoundaryBackward,
|
|
@@ -795,7 +801,7 @@ export {
|
|
|
795
801
|
ze as indentMore,
|
|
796
802
|
en as indentSelection,
|
|
797
803
|
hn as indentWithTab,
|
|
798
|
-
|
|
804
|
+
wt as insertBlankLine,
|
|
799
805
|
re as insertNewlineAndIndent,
|
|
800
806
|
rt as invertedEffects,
|
|
801
807
|
nt as isolateHistory,
|
|
@@ -819,7 +825,7 @@ export {
|
|
|
819
825
|
Ut as selectLineEnd,
|
|
820
826
|
It as selectLineStart,
|
|
821
827
|
be as selectLineUp,
|
|
822
|
-
|
|
828
|
+
_ as selectPageDown,
|
|
823
829
|
j as selectPageUp,
|
|
824
830
|
Pt as selectParentSyntax,
|
|
825
831
|
Et as selectSyntaxLeft,
|
|
@@ -828,7 +834,7 @@ export {
|
|
|
828
834
|
$t as splitLine,
|
|
829
835
|
rn as standardKeymap,
|
|
830
836
|
je as toggleBlockComment,
|
|
831
|
-
|
|
837
|
+
_e as toggleBlockCommentByLine,
|
|
832
838
|
Ye as toggleComment,
|
|
833
839
|
Ze as toggleLineComment,
|
|
834
840
|
tn as toggleTabFocusMode,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parser as r } from "../../../@lezer/java/dist/index.js";
|
|
2
|
-
import { LanguageSupport as l, LRLanguage as d, indentNodeProp as s,
|
|
2
|
+
import { LanguageSupport as l, LRLanguage as d, indentNodeProp as s, flatIndent as c, continuedIndent as t, delimitedIndent as i, foldNodeProp as m, foldInside as u } from "../../language/dist/index.js";
|
|
3
3
|
const f = /* @__PURE__ */ d.define({
|
|
4
4
|
name: "java",
|
|
5
5
|
parser: /* @__PURE__ */ r.configure({
|
|
@@ -7,7 +7,7 @@ const f = /* @__PURE__ */ d.define({
|
|
|
7
7
|
/* @__PURE__ */ s.add({
|
|
8
8
|
IfStatement: /* @__PURE__ */ t({ except: /^\s*({|else\b)/ }),
|
|
9
9
|
TryStatement: /* @__PURE__ */ t({ except: /^\s*({|catch|finally)\b/ }),
|
|
10
|
-
LabeledStatement:
|
|
10
|
+
LabeledStatement: c,
|
|
11
11
|
SwitchBlock: (e) => {
|
|
12
12
|
let n = e.textAfter, a = /^\s*\}/.test(n), o = /^\s*(case|default)\b/.test(n);
|
|
13
13
|
return e.baseIndent + (a ? 0 : o ? 1 : 2) * e.unit;
|
|
@@ -16,7 +16,7 @@ const f = /* @__PURE__ */ d.define({
|
|
|
16
16
|
BlockComment: () => null,
|
|
17
17
|
Statement: /* @__PURE__ */ t({ except: /^{/ })
|
|
18
18
|
}),
|
|
19
|
-
/* @__PURE__ */
|
|
19
|
+
/* @__PURE__ */ m.add({
|
|
20
20
|
"Block SwitchBlock ClassBody ElementValueArrayInitializer ModuleBody EnumBody ConstructorBody InterfaceBody ArrayInitializer": u,
|
|
21
21
|
BlockComment(e) {
|
|
22
22
|
return { from: e.from + 2, to: e.to - 2 };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { parser as x } from "../../../@lezer/javascript/dist/index.js";
|
|
2
|
-
import { LanguageSupport as B,
|
|
2
|
+
import { LanguageSupport as B, sublanguageProp as T, LRLanguage as F, indentNodeProp as j, flatIndent as L, continuedIndent as b, delimitedIndent as N, foldNodeProp as O, foldInside as P, syntaxTree as C, defineLanguageFacet as V } from "../../language/dist/index.js";
|
|
3
3
|
import { EditorSelection as M } from "../../state/dist/index.js";
|
|
4
4
|
import { EditorView as _ } from "../../view/dist/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { ifNotIn as R, completeFromList as W, snippetCompletion as r } from "../../autocomplete/dist/index.js";
|
|
6
6
|
import { NodeWeakMap as H, IterMode as K } from "../../../@lezer/common/dist/index.js";
|
|
7
7
|
const J = [
|
|
8
8
|
/* @__PURE__ */ r("function ${name}(${params}) {\n ${}\n}", {
|
|
@@ -182,15 +182,15 @@ const c = /* @__PURE__ */ F.define({
|
|
|
182
182
|
name: "javascript",
|
|
183
183
|
parser: /* @__PURE__ */ x.configure({
|
|
184
184
|
props: [
|
|
185
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ j.add({
|
|
186
186
|
IfStatement: /* @__PURE__ */ b({ except: /^\s*({|else\b)/ }),
|
|
187
187
|
TryStatement: /* @__PURE__ */ b({ except: /^\s*({|catch\b|finally\b)/ }),
|
|
188
|
-
LabeledStatement:
|
|
188
|
+
LabeledStatement: L,
|
|
189
189
|
SwitchBody: (e) => {
|
|
190
190
|
let t = e.textAfter, o = /^\s*\}/.test(t), n = /^\s*(case|default)\b/.test(t);
|
|
191
191
|
return e.baseIndent + (o ? 0 : n ? 1 : 2) * e.unit;
|
|
192
192
|
},
|
|
193
|
-
Block: /* @__PURE__ */
|
|
193
|
+
Block: /* @__PURE__ */ N({ closing: "}" }),
|
|
194
194
|
ArrowFunction: (e) => e.baseIndent + e.unit,
|
|
195
195
|
"TemplateString BlockComment": () => null,
|
|
196
196
|
"Statement Property": /* @__PURE__ */ b({ except: /^\s*{/ }),
|
|
@@ -206,8 +206,8 @@ const c = /* @__PURE__ */ F.define({
|
|
|
206
206
|
return e.column(e.node.from) + e.unit;
|
|
207
207
|
}
|
|
208
208
|
}),
|
|
209
|
-
/* @__PURE__ */
|
|
210
|
-
"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":
|
|
209
|
+
/* @__PURE__ */ O.add({
|
|
210
|
+
"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType": P,
|
|
211
211
|
BlockComment(e) {
|
|
212
212
|
return { from: e.from + 2, to: e.to - 2 };
|
|
213
213
|
}
|
|
@@ -222,7 +222,7 @@ const c = /* @__PURE__ */ F.define({
|
|
|
222
222
|
}
|
|
223
223
|
}), v = {
|
|
224
224
|
test: (e) => /^JSX/.test(e.name),
|
|
225
|
-
facet: /* @__PURE__ */
|
|
225
|
+
facet: /* @__PURE__ */ V({ commentTokens: { block: { open: "{/*", close: "*/}" } } })
|
|
226
226
|
}, U = /* @__PURE__ */ c.configure({ dialect: "ts" }, "typescript"), Y = /* @__PURE__ */ c.configure({
|
|
227
227
|
dialect: "jsx",
|
|
228
228
|
props: [/* @__PURE__ */ T.add((e) => e.isTop ? [v] : void 0)]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parser as o } from "../../../@lezer/json/dist/index.js";
|
|
2
|
-
import { LanguageSupport as a, LRLanguage as s, indentNodeProp as i,
|
|
2
|
+
import { LanguageSupport as a, LRLanguage as s, indentNodeProp as i, continuedIndent as r, foldNodeProp as c, foldInside as d } from "../../language/dist/index.js";
|
|
3
3
|
const f = () => (n) => {
|
|
4
4
|
try {
|
|
5
5
|
JSON.parse(n.state.doc.toString());
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parser as h } from "../../../@lezer/python/dist/index.js";
|
|
2
|
-
import { LanguageSupport as S, LRLanguage as I, indentNodeProp as v,
|
|
2
|
+
import { LanguageSupport as S, LRLanguage as I, indentNodeProp as v, delimitedIndent as m, foldNodeProp as C, foldInside as k, syntaxTree as $ } from "../../language/dist/index.js";
|
|
3
3
|
import { NodeWeakMap as A, IterMode as F } from "../../../@lezer/common/dist/index.js";
|
|
4
4
|
import { ifNotIn as w, completeFromList as N, snippetCompletion as l } from "../../autocomplete/dist/index.js";
|
|
5
5
|
const c = /* @__PURE__ */ new A(), E = /* @__PURE__ */ new Set([
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LanguageSupport as M, LRLanguage as H, indentNodeProp as J,
|
|
1
|
+
import { LanguageSupport as M, LRLanguage as H, indentNodeProp as J, continuedIndent as ee, foldNodeProp as te, syntaxTree as ae } from "../../language/dist/index.js";
|
|
2
2
|
import { styleTags as re, tags as o } from "../../../@lezer/highlight/dist/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { ExternalTokenizer as ne, LRParser as oe } from "../../../@lezer/lr/dist/index.js";
|
|
4
4
|
import { ifNotIn as le, completeFromList as se } from "../../autocomplete/dist/index.js";
|
|
5
5
|
const ie = 36, R = 1, ce = 2, k = 3, S = 4, fe = 5, de = 6, Oe = 7, me = 8, ue = 9, he = 10, ke = 11, Qe = 12, ge = 13, ve = 14, xe = 15, be = 16, pe = 17, q = 18, Ce = 19, E = 20, A = 21, L = 22, Se = 23, Pe = 24;
|
|
6
6
|
function y(t) {
|
|
@@ -129,7 +129,7 @@ function Ie(t, e, r, a) {
|
|
|
129
129
|
return e && (n.words = V(e, r || "", a)), n;
|
|
130
130
|
}
|
|
131
131
|
function W(t) {
|
|
132
|
-
return new
|
|
132
|
+
return new ne((e) => {
|
|
133
133
|
var r;
|
|
134
134
|
let { next: a } = e;
|
|
135
135
|
if (e.advance(), u(a, P)) {
|
|
@@ -221,7 +221,7 @@ function W(t) {
|
|
|
221
221
|
}
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
|
-
const F = /* @__PURE__ */ W(T), _e = /* @__PURE__ */
|
|
224
|
+
const F = /* @__PURE__ */ W(T), _e = /* @__PURE__ */ oe.deserialize({
|
|
225
225
|
version: 14,
|
|
226
226
|
states: "%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",
|
|
227
227
|
stateData: ",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",
|
|
@@ -397,9 +397,9 @@ function Ee(t, e, r) {
|
|
|
397
397
|
let Ae = /* @__PURE__ */ _e.configure({
|
|
398
398
|
props: [
|
|
399
399
|
/* @__PURE__ */ J.add({
|
|
400
|
-
Statement: /* @__PURE__ */
|
|
400
|
+
Statement: /* @__PURE__ */ ee()
|
|
401
401
|
}),
|
|
402
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ te.add({
|
|
403
403
|
Statement(t, e) {
|
|
404
404
|
return { from: Math.min(t.from + 100, e.doc.lineAt(t.from).to), to: t.to };
|
|
405
405
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parser as I } from "../../../@lezer/xml/dist/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { LanguageSupport as F, LRLanguage as L, indentNodeProp as _, foldNodeProp as w, bracketMatchingHandle as x, syntaxTree as $ } from "../../language/dist/index.js";
|
|
3
3
|
import { EditorSelection as M } from "../../state/dist/index.js";
|
|
4
4
|
import { EditorView as k } from "../../view/dist/index.js";
|
|
5
5
|
function v(e, t) {
|
|
@@ -135,7 +135,7 @@ function H(e, t) {
|
|
|
135
135
|
return null;
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
-
const j = /* @__PURE__ */
|
|
138
|
+
const j = /* @__PURE__ */ L.define({
|
|
139
139
|
name: "xml",
|
|
140
140
|
parser: /* @__PURE__ */ I.configure({
|
|
141
141
|
props: [
|
|
@@ -168,7 +168,7 @@ function K(e = {}) {
|
|
|
168
168
|
let t = [j.data.of({
|
|
169
169
|
autocomplete: H(e.elements || [], e.attributes || [])
|
|
170
170
|
})];
|
|
171
|
-
return e.autoCloseTags !== !1 && t.push(R), new
|
|
171
|
+
return e.autoCloseTags !== !1 && t.push(R), new F(j, t);
|
|
172
172
|
}
|
|
173
173
|
function V(e, t, i = e.length) {
|
|
174
174
|
if (!t)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parser as t } from "../../../@lezer/yaml/dist/index.js";
|
|
2
|
-
import { LanguageSupport as l, LRLanguage as a, indentNodeProp as i,
|
|
2
|
+
import { LanguageSupport as l, LRLanguage as a, indentNodeProp as i, delimitedIndent as r, foldNodeProp as m, foldInside as u } from "../../language/dist/index.js";
|
|
3
3
|
import "../../../@lezer/common/dist/index.js";
|
|
4
4
|
import "../../../@lezer/highlight/dist/index.js";
|
|
5
5
|
import "../../../@lezer/lr/dist/index.js";
|