ghost 5.69.3 → 5.70.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/components/tryghost-adapter-cache-memory-ttl-5.70.0.tgz +0 -0
- package/components/tryghost-adapter-cache-redis-5.70.0.tgz +0 -0
- package/components/tryghost-adapter-manager-5.70.0.tgz +0 -0
- package/components/tryghost-announcement-bar-settings-5.70.0.tgz +0 -0
- package/components/{tryghost-api-framework-5.69.3.tgz → tryghost-api-framework-5.70.0.tgz} +0 -0
- package/components/tryghost-api-version-compatibility-service-5.70.0.tgz +0 -0
- package/components/tryghost-audience-feedback-5.70.0.tgz +0 -0
- package/components/tryghost-bookshelf-repository-5.70.0.tgz +0 -0
- package/components/tryghost-bootstrap-socket-5.70.0.tgz +0 -0
- package/components/tryghost-collections-5.70.0.tgz +0 -0
- package/components/tryghost-constants-5.70.0.tgz +0 -0
- package/components/tryghost-custom-theme-settings-service-5.70.0.tgz +0 -0
- package/components/tryghost-data-generator-5.70.0.tgz +0 -0
- package/components/tryghost-domain-events-5.70.0.tgz +0 -0
- package/components/tryghost-donations-5.70.0.tgz +0 -0
- package/components/tryghost-dynamic-routing-events-5.70.0.tgz +0 -0
- package/components/tryghost-email-analytics-provider-mailgun-5.70.0.tgz +0 -0
- package/components/tryghost-email-analytics-service-5.70.0.tgz +0 -0
- package/components/tryghost-email-content-generator-5.70.0.tgz +0 -0
- package/components/tryghost-email-events-5.70.0.tgz +0 -0
- package/components/{tryghost-email-service-5.69.3.tgz → tryghost-email-service-5.70.0.tgz} +0 -0
- package/components/tryghost-email-suppression-list-5.70.0.tgz +0 -0
- package/components/tryghost-event-aware-cache-wrapper-5.70.0.tgz +0 -0
- package/components/tryghost-express-dynamic-redirects-5.70.0.tgz +0 -0
- package/components/tryghost-external-media-inliner-5.70.0.tgz +0 -0
- package/components/tryghost-extract-api-key-5.70.0.tgz +0 -0
- package/components/tryghost-html-to-plaintext-5.70.0.tgz +0 -0
- package/components/tryghost-i18n-5.70.0.tgz +0 -0
- package/components/tryghost-importer-handler-content-files-5.70.0.tgz +0 -0
- package/components/{tryghost-importer-revue-5.69.3.tgz → tryghost-importer-revue-5.70.0.tgz} +0 -0
- package/components/tryghost-in-memory-repository-5.70.0.tgz +0 -0
- package/components/tryghost-job-manager-5.70.0.tgz +0 -0
- package/components/tryghost-link-redirects-5.70.0.tgz +0 -0
- package/components/tryghost-link-replacer-5.70.0.tgz +0 -0
- package/components/tryghost-link-tracking-5.70.0.tgz +0 -0
- package/components/tryghost-magic-link-5.70.0.tgz +0 -0
- package/components/tryghost-mail-events-5.70.0.tgz +0 -0
- package/components/tryghost-mailgun-client-5.70.0.tgz +0 -0
- package/components/tryghost-member-attribution-5.70.0.tgz +0 -0
- package/components/tryghost-member-events-5.70.0.tgz +0 -0
- package/components/tryghost-members-api-5.70.0.tgz +0 -0
- package/components/tryghost-members-csv-5.70.0.tgz +0 -0
- package/components/tryghost-members-events-service-5.70.0.tgz +0 -0
- package/components/{tryghost-members-importer-5.69.3.tgz → tryghost-members-importer-5.70.0.tgz} +0 -0
- package/components/tryghost-members-offers-5.70.0.tgz +0 -0
- package/components/tryghost-members-payments-5.70.0.tgz +0 -0
- package/components/tryghost-members-ssr-5.70.0.tgz +0 -0
- package/components/tryghost-members-stripe-service-5.70.0.tgz +0 -0
- package/components/tryghost-mentions-email-report-5.70.0.tgz +0 -0
- package/components/tryghost-milestones-5.70.0.tgz +0 -0
- package/components/tryghost-minifier-5.70.0.tgz +0 -0
- package/components/tryghost-model-to-domain-event-interceptor-5.70.0.tgz +0 -0
- package/components/tryghost-mw-api-version-mismatch-5.70.0.tgz +0 -0
- package/components/tryghost-mw-cache-control-5.70.0.tgz +0 -0
- package/components/tryghost-mw-error-handler-5.70.0.tgz +0 -0
- package/components/tryghost-mw-session-from-token-5.70.0.tgz +0 -0
- package/components/tryghost-mw-update-user-last-seen-5.70.0.tgz +0 -0
- package/components/tryghost-mw-version-match-5.70.0.tgz +0 -0
- package/components/tryghost-mw-vhost-5.70.0.tgz +0 -0
- package/components/tryghost-nql-filter-expansions-5.70.0.tgz +0 -0
- package/components/tryghost-oembed-service-5.70.0.tgz +0 -0
- package/components/tryghost-package-json-5.70.0.tgz +0 -0
- package/components/tryghost-post-events-5.70.0.tgz +0 -0
- package/components/tryghost-post-revisions-5.70.0.tgz +0 -0
- package/components/tryghost-posts-service-5.70.0.tgz +0 -0
- package/components/tryghost-recommendations-5.70.0.tgz +0 -0
- package/components/tryghost-referrers-5.70.0.tgz +0 -0
- package/components/tryghost-security-5.70.0.tgz +0 -0
- package/components/tryghost-session-service-5.70.0.tgz +0 -0
- package/components/tryghost-settings-path-manager-5.70.0.tgz +0 -0
- package/components/tryghost-slack-notifications-5.70.0.tgz +0 -0
- package/components/tryghost-staff-service-5.70.0.tgz +0 -0
- package/components/tryghost-stats-service-5.70.0.tgz +0 -0
- package/components/{tryghost-tiers-5.69.3.tgz → tryghost-tiers-5.70.0.tgz} +0 -0
- package/components/tryghost-update-check-service-5.70.0.tgz +0 -0
- package/components/tryghost-verification-trigger-5.70.0.tgz +0 -0
- package/components/tryghost-version-notifications-data-service-5.70.0.tgz +0 -0
- package/components/tryghost-webmentions-5.70.0.tgz +0 -0
- package/content/themes/source/assets/built/source.js +1 -1
- package/content/themes/source/assets/built/source.js.map +1 -1
- package/content/themes/source/assets/js/casper.js +1 -1
- package/content/themes/source/package.json +1 -1
- package/core/built/admin/assets/admin-x-settings/{CodeEditorView-e32bebf3.mjs → CodeEditorView-0b0348c8.mjs} +291 -285
- package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-77509591.mjs → index-c0ec330d.mjs} +4200 -4174
- package/core/built/admin/assets/admin-x-settings/{limit-service-95f04656.mjs → limit-service-57764392.mjs} +5021 -4862
- package/core/built/admin/assets/admin-x-settings/{modals-ec963422.mjs → modals-073c681a.mjs} +15894 -15866
- package/core/built/admin/assets/{chunk.143.360ea59b1e3d7bf99d60.js → chunk.143.9a1f52ae55bbff8440e7.js} +5 -5
- package/core/built/admin/assets/{chunk.178.4c4e285ec8c8902f9167.js → chunk.178.f4436bcb49bd5416c591.js} +4 -4
- package/core/built/admin/assets/{chunk.649.1ce887e24e7688045296.js → chunk.334.3498cc12ebd02c179e3a.js} +939 -873
- package/core/built/admin/assets/ghost-33715d7968b8a38396450f28623b7a94.css +1 -0
- package/core/built/admin/assets/{ghost-831787c0c608f25507fb45807b60374c.js → ghost-71766888f233d8996c2171e03257c940.js} +5 -5
- package/core/built/admin/assets/ghost-dark-114b1812a92f63449e10acf799cd2664.css +1 -0
- package/core/built/admin/assets/koenig-lexical/koenig-lexical.js +21192 -20951
- package/core/built/admin/assets/koenig-lexical/koenig-lexical.umd.js +155 -151
- package/core/built/admin/index.html +5 -5
- package/core/frontend/apps/private-blogging/lib/middleware.js +2 -1
- package/core/frontend/src/admin-auth/index.html +1 -0
- package/core/server/models/post.js +6 -3
- package/core/shared/settings-cache/CacheManager.js +12 -7
- package/package.json +154 -154
- package/yarn.lock +351 -370
- package/components/tryghost-adapter-cache-memory-ttl-5.69.3.tgz +0 -0
- package/components/tryghost-adapter-cache-redis-5.69.3.tgz +0 -0
- package/components/tryghost-adapter-manager-5.69.3.tgz +0 -0
- package/components/tryghost-announcement-bar-settings-5.69.3.tgz +0 -0
- package/components/tryghost-api-version-compatibility-service-5.69.3.tgz +0 -0
- package/components/tryghost-audience-feedback-5.69.3.tgz +0 -0
- package/components/tryghost-bookshelf-repository-5.69.3.tgz +0 -0
- package/components/tryghost-bootstrap-socket-5.69.3.tgz +0 -0
- package/components/tryghost-collections-5.69.3.tgz +0 -0
- package/components/tryghost-constants-5.69.3.tgz +0 -0
- package/components/tryghost-custom-theme-settings-service-5.69.3.tgz +0 -0
- package/components/tryghost-data-generator-5.69.3.tgz +0 -0
- package/components/tryghost-domain-events-5.69.3.tgz +0 -0
- package/components/tryghost-donations-5.69.3.tgz +0 -0
- package/components/tryghost-dynamic-routing-events-5.69.3.tgz +0 -0
- package/components/tryghost-email-analytics-provider-mailgun-5.69.3.tgz +0 -0
- package/components/tryghost-email-analytics-service-5.69.3.tgz +0 -0
- package/components/tryghost-email-content-generator-5.69.3.tgz +0 -0
- package/components/tryghost-email-events-5.69.3.tgz +0 -0
- package/components/tryghost-email-suppression-list-5.69.3.tgz +0 -0
- package/components/tryghost-event-aware-cache-wrapper-5.69.3.tgz +0 -0
- package/components/tryghost-express-dynamic-redirects-5.69.3.tgz +0 -0
- package/components/tryghost-external-media-inliner-5.69.3.tgz +0 -0
- package/components/tryghost-extract-api-key-5.69.3.tgz +0 -0
- package/components/tryghost-html-to-plaintext-5.69.3.tgz +0 -0
- package/components/tryghost-i18n-5.69.3.tgz +0 -0
- package/components/tryghost-importer-handler-content-files-5.69.3.tgz +0 -0
- package/components/tryghost-in-memory-repository-5.69.3.tgz +0 -0
- package/components/tryghost-job-manager-5.69.3.tgz +0 -0
- package/components/tryghost-link-redirects-5.69.3.tgz +0 -0
- package/components/tryghost-link-replacer-5.69.3.tgz +0 -0
- package/components/tryghost-link-tracking-5.69.3.tgz +0 -0
- package/components/tryghost-magic-link-5.69.3.tgz +0 -0
- package/components/tryghost-mail-events-5.69.3.tgz +0 -0
- package/components/tryghost-mailgun-client-5.69.3.tgz +0 -0
- package/components/tryghost-member-attribution-5.69.3.tgz +0 -0
- package/components/tryghost-member-events-5.69.3.tgz +0 -0
- package/components/tryghost-members-api-5.69.3.tgz +0 -0
- package/components/tryghost-members-csv-5.69.3.tgz +0 -0
- package/components/tryghost-members-events-service-5.69.3.tgz +0 -0
- package/components/tryghost-members-offers-5.69.3.tgz +0 -0
- package/components/tryghost-members-payments-5.69.3.tgz +0 -0
- package/components/tryghost-members-ssr-5.69.3.tgz +0 -0
- package/components/tryghost-members-stripe-service-5.69.3.tgz +0 -0
- package/components/tryghost-mentions-email-report-5.69.3.tgz +0 -0
- package/components/tryghost-milestones-5.69.3.tgz +0 -0
- package/components/tryghost-minifier-5.69.3.tgz +0 -0
- package/components/tryghost-model-to-domain-event-interceptor-5.69.3.tgz +0 -0
- package/components/tryghost-mw-api-version-mismatch-5.69.3.tgz +0 -0
- package/components/tryghost-mw-cache-control-5.69.3.tgz +0 -0
- package/components/tryghost-mw-error-handler-5.69.3.tgz +0 -0
- package/components/tryghost-mw-session-from-token-5.69.3.tgz +0 -0
- package/components/tryghost-mw-update-user-last-seen-5.69.3.tgz +0 -0
- package/components/tryghost-mw-version-match-5.69.3.tgz +0 -0
- package/components/tryghost-mw-vhost-5.69.3.tgz +0 -0
- package/components/tryghost-nql-filter-expansions-5.69.3.tgz +0 -0
- package/components/tryghost-oembed-service-5.69.3.tgz +0 -0
- package/components/tryghost-package-json-5.69.3.tgz +0 -0
- package/components/tryghost-post-events-5.69.3.tgz +0 -0
- package/components/tryghost-post-revisions-5.69.3.tgz +0 -0
- package/components/tryghost-posts-service-5.69.3.tgz +0 -0
- package/components/tryghost-recommendations-5.69.3.tgz +0 -0
- package/components/tryghost-referrers-5.69.3.tgz +0 -0
- package/components/tryghost-security-5.69.3.tgz +0 -0
- package/components/tryghost-session-service-5.69.3.tgz +0 -0
- package/components/tryghost-settings-path-manager-5.69.3.tgz +0 -0
- package/components/tryghost-slack-notifications-5.69.3.tgz +0 -0
- package/components/tryghost-staff-service-5.69.3.tgz +0 -0
- package/components/tryghost-stats-service-5.69.3.tgz +0 -0
- package/components/tryghost-update-check-service-5.69.3.tgz +0 -0
- package/components/tryghost-verification-trigger-5.69.3.tgz +0 -0
- package/components/tryghost-version-notifications-data-service-5.69.3.tgz +0 -0
- package/components/tryghost-webmentions-5.69.3.tgz +0 -0
- package/core/built/admin/assets/ghost-dark-074a63e61346f3533e60ceff7253f07d.css +0 -1
- package/core/built/admin/assets/ghost-de20b1dc1f76d9dd196738a479610681.css +0 -1
- /package/core/built/admin/assets/{chunk.649.1ce887e24e7688045296.js.LICENSE.txt → chunk.334.3498cc12ebd02c179e3a.js.LICENSE.txt} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { e as ke, f as
|
|
2
|
-
import { E as p, F as fe, v as Ee, S as we, o as d, w as qe, C as
|
|
1
|
+
import { e as ke, f as N, b2 as wt, bK as qn, J as Rt, bL as _n, j as F, bM as Vn, O as Hn, C as Un, _ as zn, U as $n, P as Gn, Q as Kn } from "./index-c0ec330d.mjs";
|
|
2
|
+
import { E as p, F as fe, v as Ee, S as we, o as d, w as qe, C as Jn, x as jn, y as Tt, z as Ot, A as Se, B as It, G as Pt, H as Wt, J as ze, K as Xe, M as R, O as Z, g as et, b as $e, Q as Qn, R as ee, V as Ft, U as x, W as Yn, X as Zn, Y as ce, Z as M, _ as Xn, $ as er, a0 as tt, a1 as he, a2 as tr, a3 as nr, a4 as rr, a5 as or, a6 as ir, a7 as sr, a8 as lr, a9 as ar, aa as cr, ab as hr, ac as ur, ad as fr, ae as dr, af as mr, ag as Nt, ah as gr, ai as pr, aj as yr, ak as xr, al as kr, am as br, an as qt, ao as Sr, ap as Cr, t as f, aq as vr } from "./index-9cc1df42.mjs";
|
|
3
3
|
const Ar = (t) => {
|
|
4
4
|
let { state: e } = t, r = e.doc.lineAt(e.selection.main.from), n = rt(t.state, r.from);
|
|
5
5
|
return n.line ? Mr(t) : n.block ? Dr(t) : !1;
|
|
@@ -17,11 +17,11 @@ const Mr = /* @__PURE__ */ nt(
|
|
|
17
17
|
0
|
|
18
18
|
/* CommentOption.Toggle */
|
|
19
19
|
), Lr = /* @__PURE__ */ nt(
|
|
20
|
-
|
|
20
|
+
_t,
|
|
21
21
|
0
|
|
22
22
|
/* CommentOption.Toggle */
|
|
23
23
|
), Dr = /* @__PURE__ */ nt(
|
|
24
|
-
(t, e) =>
|
|
24
|
+
(t, e) => _t(t, e, Er(e)),
|
|
25
25
|
0
|
|
26
26
|
/* CommentOption.Toggle */
|
|
27
27
|
);
|
|
@@ -39,15 +39,15 @@ function Br(t, { open: e, close: r }, n, o) {
|
|
|
39
39
|
};
|
|
40
40
|
let h, u;
|
|
41
41
|
o - n <= 2 * ae ? h = u = t.sliceDoc(n, o) : (h = t.sliceDoc(n, n + ae), u = t.sliceDoc(o - ae, o));
|
|
42
|
-
let m = /^\s*/.exec(h)[0].length,
|
|
43
|
-
return h.slice(m, m + e.length) == e && u.slice(
|
|
42
|
+
let m = /^\s*/.exec(h)[0].length, k = /\s*$/.exec(u)[0].length, S = u.length - k - r.length;
|
|
43
|
+
return h.slice(m, m + e.length) == e && u.slice(S, S + r.length) == r ? {
|
|
44
44
|
open: {
|
|
45
45
|
pos: n + m + e.length,
|
|
46
46
|
margin: /\s/.test(h.charAt(m + e.length)) ? 1 : 0
|
|
47
47
|
},
|
|
48
48
|
close: {
|
|
49
|
-
pos: o -
|
|
50
|
-
margin: /\s/.test(u.charAt(
|
|
49
|
+
pos: o - k - r.length,
|
|
50
|
+
margin: /\s/.test(u.charAt(S - 1)) ? 1 : 0
|
|
51
51
|
}
|
|
52
52
|
} : null;
|
|
53
53
|
}
|
|
@@ -59,7 +59,7 @@ function Er(t) {
|
|
|
59
59
|
}
|
|
60
60
|
return e;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function _t(t, e, r = e.selection.ranges) {
|
|
63
63
|
let n = r.map((i) => rt(e, i.from).block);
|
|
64
64
|
if (!n.every((i) => i))
|
|
65
65
|
return null;
|
|
@@ -86,8 +86,8 @@ function wr(t, e, r = e.selection.ranges) {
|
|
|
86
86
|
let u = e.doc.lineAt(h);
|
|
87
87
|
if (u.from > o && (i == s || s > u.from)) {
|
|
88
88
|
o = u.from;
|
|
89
|
-
let m = /^\s*/.exec(u.text)[0].length,
|
|
90
|
-
m < u.text.length && m < a && (a = m), n.push({ line: u, comment:
|
|
89
|
+
let m = /^\s*/.exec(u.text)[0].length, k = m == u.length, S = u.text.slice(m, m + c.length) == c ? m : -1;
|
|
90
|
+
m < u.text.length && m < a && (a = m), n.push({ line: u, comment: S, token: c, indent: m, empty: k, single: !1 });
|
|
91
91
|
}
|
|
92
92
|
h = u.to + 1;
|
|
93
93
|
}
|
|
@@ -114,7 +114,7 @@ function wr(t, e, r = e.selection.ranges) {
|
|
|
114
114
|
}
|
|
115
115
|
return null;
|
|
116
116
|
}
|
|
117
|
-
const
|
|
117
|
+
const Ge = /* @__PURE__ */ Xe.define(), Rr = /* @__PURE__ */ Xe.define(), Tr = /* @__PURE__ */ fe.define(), Vt = /* @__PURE__ */ fe.define({
|
|
118
118
|
combine(t) {
|
|
119
119
|
return Ee(t, {
|
|
120
120
|
minDepth: 100,
|
|
@@ -131,15 +131,15 @@ function Or(t) {
|
|
|
131
131
|
let e = 0;
|
|
132
132
|
return t.iterChangedRanges((r, n) => e = n), e;
|
|
133
133
|
}
|
|
134
|
-
const
|
|
134
|
+
const Ht = /* @__PURE__ */ we.define({
|
|
135
135
|
create() {
|
|
136
136
|
return O.empty;
|
|
137
137
|
},
|
|
138
138
|
update(t, e) {
|
|
139
|
-
let r = e.state.facet(
|
|
139
|
+
let r = e.state.facet(Vt), n = e.annotation(Ge);
|
|
140
140
|
if (n) {
|
|
141
141
|
let a = e.docChanged ? d.single(Or(e.changes)) : void 0, c = C.fromTransaction(e, a), h = n.side, u = h == 0 ? t.undone : t.done;
|
|
142
|
-
return c ? u = Ce(u, u.length, r.minDepth, c) : u =
|
|
142
|
+
return c ? u = Ce(u, u.length, r.minDepth, c) : u = $t(u, e.startState.selection), new O(h == 0 ? n.rest : u, h == 0 ? u : n.rest);
|
|
143
143
|
}
|
|
144
144
|
let o = e.annotation(Rr);
|
|
145
145
|
if ((o == "full" || o == "before") && (t = t.isolate()), e.annotation(qe.addToHistory) === !1)
|
|
@@ -156,11 +156,11 @@ const Ut = /* @__PURE__ */ we.define({
|
|
|
156
156
|
});
|
|
157
157
|
function Ir(t = {}) {
|
|
158
158
|
return [
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
Ht,
|
|
160
|
+
Vt.of(t),
|
|
161
161
|
p.domEventHandlers({
|
|
162
162
|
beforeinput(e, r) {
|
|
163
|
-
let n = e.inputType == "historyUndo" ?
|
|
163
|
+
let n = e.inputType == "historyUndo" ? Ut : e.inputType == "historyRedo" ? Ke : null;
|
|
164
164
|
return n ? (e.preventDefault(), n(r)) : !1;
|
|
165
165
|
}
|
|
166
166
|
})
|
|
@@ -170,14 +170,14 @@ function Re(t, e) {
|
|
|
170
170
|
return function({ state: r, dispatch: n }) {
|
|
171
171
|
if (!e && r.readOnly)
|
|
172
172
|
return !1;
|
|
173
|
-
let o = r.field(
|
|
173
|
+
let o = r.field(Ht, !1);
|
|
174
174
|
if (!o)
|
|
175
175
|
return !1;
|
|
176
176
|
let i = o.pop(t, r, e);
|
|
177
177
|
return i ? (n(i), !0) : !1;
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
|
-
const
|
|
180
|
+
const Ut = /* @__PURE__ */ Re(0, !1), Ke = /* @__PURE__ */ Re(1, !1), Pr = /* @__PURE__ */ Re(0, !0), Wr = /* @__PURE__ */ Re(1, !0);
|
|
181
181
|
class C {
|
|
182
182
|
constructor(e, r, n, o, i) {
|
|
183
183
|
this.changes = e, this.effects = r, this.mapped = n, this.startSelection = o, this.selectionsAfter = i;
|
|
@@ -195,21 +195,21 @@ class C {
|
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
197
|
static fromJSON(e) {
|
|
198
|
-
return new C(e.changes &&
|
|
198
|
+
return new C(e.changes && Jn.fromJSON(e.changes), [], e.mapped && jn.fromJSON(e.mapped), e.startSelection && d.fromJSON(e.startSelection), e.selectionsAfter.map(d.fromJSON));
|
|
199
199
|
}
|
|
200
200
|
// This does not check `addToHistory` and such, it assumes the
|
|
201
201
|
// transaction needs to be converted to an item. Returns null when
|
|
202
202
|
// there are no changes or effects in the transaction.
|
|
203
203
|
static fromTransaction(e, r) {
|
|
204
|
-
let n =
|
|
204
|
+
let n = L;
|
|
205
205
|
for (let o of e.startState.facet(Tr)) {
|
|
206
206
|
let i = o(e);
|
|
207
207
|
i.length && (n = n.concat(i));
|
|
208
208
|
}
|
|
209
|
-
return !n.length && e.changes.empty ? null : new C(e.changes.invert(e.startState.doc), n, void 0, r || e.startState.selection,
|
|
209
|
+
return !n.length && e.changes.empty ? null : new C(e.changes.invert(e.startState.doc), n, void 0, r || e.startState.selection, L);
|
|
210
210
|
}
|
|
211
211
|
static selection(e) {
|
|
212
|
-
return new C(void 0,
|
|
212
|
+
return new C(void 0, L, void 0, void 0, e);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
function Ce(t, e, r, n) {
|
|
@@ -228,43 +228,43 @@ function Fr(t, e) {
|
|
|
228
228
|
function Nr(t, e) {
|
|
229
229
|
return t.ranges.length == e.ranges.length && t.ranges.filter((r, n) => r.empty != e.ranges[n].empty).length === 0;
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function zt(t, e) {
|
|
232
232
|
return t.length ? e.length ? t.concat(e) : t : e;
|
|
233
233
|
}
|
|
234
|
-
const
|
|
235
|
-
function
|
|
234
|
+
const L = [], qr = 200;
|
|
235
|
+
function $t(t, e) {
|
|
236
236
|
if (t.length) {
|
|
237
237
|
let r = t[t.length - 1], n = r.selectionsAfter.slice(Math.max(0, r.selectionsAfter.length - qr));
|
|
238
238
|
return n.length && n[n.length - 1].eq(e) ? t : (n.push(e), Ce(t, t.length - 1, 1e9, r.setSelAfter(n)));
|
|
239
239
|
} else
|
|
240
240
|
return [C.selection([e])];
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function _r(t) {
|
|
243
243
|
let e = t[t.length - 1], r = t.slice();
|
|
244
244
|
return r[t.length - 1] = e.setSelAfter(e.selectionsAfter.slice(0, e.selectionsAfter.length - 1)), r;
|
|
245
245
|
}
|
|
246
|
-
function
|
|
246
|
+
function _e(t, e) {
|
|
247
247
|
if (!t.length)
|
|
248
248
|
return t;
|
|
249
|
-
let r = t.length, n =
|
|
249
|
+
let r = t.length, n = L;
|
|
250
250
|
for (; r; ) {
|
|
251
|
-
let o =
|
|
251
|
+
let o = Vr(t[r - 1], e, n);
|
|
252
252
|
if (o.changes && !o.changes.empty || o.effects.length) {
|
|
253
253
|
let i = t.slice(0, r);
|
|
254
254
|
return i[r - 1] = o, i;
|
|
255
255
|
} else
|
|
256
256
|
e = o.mapped, r--, n = o.selectionsAfter;
|
|
257
257
|
}
|
|
258
|
-
return n.length ? [C.selection(n)] :
|
|
258
|
+
return n.length ? [C.selection(n)] : L;
|
|
259
259
|
}
|
|
260
|
-
function
|
|
261
|
-
let n =
|
|
260
|
+
function Vr(t, e, r) {
|
|
261
|
+
let n = zt(t.selectionsAfter.length ? t.selectionsAfter.map((l) => l.map(e)) : L, r);
|
|
262
262
|
if (!t.changes)
|
|
263
263
|
return C.selection(n);
|
|
264
264
|
let o = t.changes.map(e), i = e.mapDesc(t.changes, !0), s = t.mapped ? t.mapped.composeDesc(i) : i;
|
|
265
|
-
return new C(o,
|
|
265
|
+
return new C(o, R.mapEffects(t.effects, e), s, t.startSelection.map(i), n);
|
|
266
266
|
}
|
|
267
|
-
const
|
|
267
|
+
const Hr = /^(input\.type|delete)($|\.)/;
|
|
268
268
|
class O {
|
|
269
269
|
constructor(e, r, n = 0, o = void 0) {
|
|
270
270
|
this.done = e, this.undone = r, this.prevTime = n, this.prevUserEvent = o;
|
|
@@ -274,15 +274,15 @@ class O {
|
|
|
274
274
|
}
|
|
275
275
|
addChanges(e, r, n, o, i) {
|
|
276
276
|
let s = this.done, l = s[s.length - 1];
|
|
277
|
-
return l && l.changes && !l.changes.empty && e.changes && (!n ||
|
|
278
|
-
n == "input.type.compose") ? s = Ce(s, s.length - 1, o.minDepth, new C(e.changes.compose(l.changes),
|
|
277
|
+
return l && l.changes && !l.changes.empty && e.changes && (!n || Hr.test(n)) && (!l.selectionsAfter.length && r - this.prevTime < o.newGroupDelay && o.joinToEvent(i, Fr(l.changes, e.changes)) || // For compose (but not compose.start) events, always join with previous event
|
|
278
|
+
n == "input.type.compose") ? s = Ce(s, s.length - 1, o.minDepth, new C(e.changes.compose(l.changes), zt(e.effects, l.effects), l.mapped, l.startSelection, L)) : s = Ce(s, s.length, o.minDepth, e), new O(s, L, r, n);
|
|
279
279
|
}
|
|
280
280
|
addSelection(e, r, n, o) {
|
|
281
|
-
let i = this.done.length ? this.done[this.done.length - 1].selectionsAfter :
|
|
282
|
-
return i.length > 0 && r - this.prevTime < o && n == this.prevUserEvent && n && /^select($|\.)/.test(n) && Nr(i[i.length - 1], e) ? this : new O(
|
|
281
|
+
let i = this.done.length ? this.done[this.done.length - 1].selectionsAfter : L;
|
|
282
|
+
return i.length > 0 && r - this.prevTime < o && n == this.prevUserEvent && n && /^select($|\.)/.test(n) && Nr(i[i.length - 1], e) ? this : new O($t(this.done, e), this.undone, r, n);
|
|
283
283
|
}
|
|
284
284
|
addMapping(e) {
|
|
285
|
-
return new O(
|
|
285
|
+
return new O(_e(this.done, e), _e(this.undone, e), this.prevTime, this.prevUserEvent);
|
|
286
286
|
}
|
|
287
287
|
pop(e, r, n) {
|
|
288
288
|
let o = e == 0 ? this.done : this.undone;
|
|
@@ -292,17 +292,17 @@ class O {
|
|
|
292
292
|
if (n && i.selectionsAfter.length)
|
|
293
293
|
return r.update({
|
|
294
294
|
selection: i.selectionsAfter[i.selectionsAfter.length - 1],
|
|
295
|
-
annotations:
|
|
295
|
+
annotations: Ge.of({ side: e, rest: _r(o) }),
|
|
296
296
|
userEvent: e == 0 ? "select.undo" : "select.redo",
|
|
297
297
|
scrollIntoView: !0
|
|
298
298
|
});
|
|
299
299
|
if (i.changes) {
|
|
300
|
-
let s = o.length == 1 ?
|
|
301
|
-
return i.mapped && (s =
|
|
300
|
+
let s = o.length == 1 ? L : o.slice(0, o.length - 1);
|
|
301
|
+
return i.mapped && (s = _e(s, i.mapped)), r.update({
|
|
302
302
|
changes: i.changes,
|
|
303
303
|
selection: i.startSelection,
|
|
304
304
|
effects: i.effects,
|
|
305
|
-
annotations:
|
|
305
|
+
annotations: Ge.of({ side: e, rest: s }),
|
|
306
306
|
filter: !1,
|
|
307
307
|
userEvent: e == 0 ? "undo" : "redo",
|
|
308
308
|
scrollIntoView: !0
|
|
@@ -311,11 +311,11 @@ class O {
|
|
|
311
311
|
return null;
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
-
O.empty = /* @__PURE__ */ new O(
|
|
315
|
-
const
|
|
316
|
-
{ key: "Mod-z", run:
|
|
317
|
-
{ key: "Mod-y", mac: "Mod-Shift-z", run:
|
|
318
|
-
{ linux: "Ctrl-Shift-z", run:
|
|
314
|
+
O.empty = /* @__PURE__ */ new O(L, L);
|
|
315
|
+
const Ur = [
|
|
316
|
+
{ key: "Mod-z", run: Ut, preventDefault: !0 },
|
|
317
|
+
{ key: "Mod-y", mac: "Mod-Shift-z", run: Ke, preventDefault: !0 },
|
|
318
|
+
{ linux: "Ctrl-Shift-z", run: Ke, preventDefault: !0 },
|
|
319
319
|
{ key: "Mod-u", run: Pr, preventDefault: !0 },
|
|
320
320
|
{ key: "Alt-u", mac: "Mod-Shift-u", run: Wr, preventDefault: !0 }
|
|
321
321
|
];
|
|
@@ -325,44 +325,44 @@ function re(t, e) {
|
|
|
325
325
|
function I(t, e) {
|
|
326
326
|
return t.update({ selection: e, scrollIntoView: !0, userEvent: "select" });
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function T({ state: t, dispatch: e }, r) {
|
|
329
329
|
let n = re(t.selection, r);
|
|
330
330
|
return n.eq(t.selection) ? !1 : (e(I(t, n)), !0);
|
|
331
331
|
}
|
|
332
332
|
function Te(t, e) {
|
|
333
333
|
return d.cursor(e ? t.to : t.from);
|
|
334
334
|
}
|
|
335
|
-
function
|
|
336
|
-
return
|
|
335
|
+
function Gt(t, e) {
|
|
336
|
+
return T(t, (r) => r.empty ? t.moveByChar(r, e) : Te(r, e));
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function b(t) {
|
|
339
339
|
return t.textDirectionAt(t.state.selection.main.head) == Qn.LTR;
|
|
340
340
|
}
|
|
341
|
-
const
|
|
341
|
+
const Kt = (t) => Gt(t, !b(t)), Jt = (t) => Gt(t, b(t));
|
|
342
342
|
function jt(t, e) {
|
|
343
|
-
return
|
|
343
|
+
return T(t, (r) => r.empty ? t.moveByGroup(r, e) : Te(r, e));
|
|
344
344
|
}
|
|
345
|
-
const
|
|
346
|
-
function
|
|
345
|
+
const zr = (t) => jt(t, !b(t)), $r = (t) => jt(t, b(t));
|
|
346
|
+
function Gr(t, e, r) {
|
|
347
347
|
if (e.type.prop(r))
|
|
348
348
|
return !0;
|
|
349
349
|
let n = e.to - e.from;
|
|
350
350
|
return n && (n > 2 || /[^\s,.;:]/.test(t.sliceDoc(e.from, e.to))) || e.firstChild;
|
|
351
351
|
}
|
|
352
352
|
function Oe(t, e, r) {
|
|
353
|
-
let n = et(t).resolveInner(e.head), o = r ?
|
|
353
|
+
let n = et(t).resolveInner(e.head), o = r ? $e.closedBy : $e.openedBy;
|
|
354
354
|
for (let a = e.head; ; ) {
|
|
355
355
|
let c = r ? n.childAfter(a) : n.childBefore(a);
|
|
356
356
|
if (!c)
|
|
357
357
|
break;
|
|
358
|
-
|
|
358
|
+
Gr(t, c, o) ? n = c : a = r ? c.to : c.from;
|
|
359
359
|
}
|
|
360
360
|
let i = n.type.prop(o), s, l;
|
|
361
361
|
return i && (s = r ? Z(t, n.from, 1) : Z(t, n.to, -1)) && s.matched ? l = r ? s.end.to : s.end.from : l = r ? n.to : n.from, d.cursor(l, r ? -1 : 1);
|
|
362
362
|
}
|
|
363
|
-
const
|
|
363
|
+
const Kr = (t) => T(t, (e) => Oe(t.state, e, !b(t))), Jr = (t) => T(t, (e) => Oe(t.state, e, b(t)));
|
|
364
364
|
function Qt(t, e) {
|
|
365
|
-
return
|
|
365
|
+
return T(t, (r) => {
|
|
366
366
|
if (!r.empty)
|
|
367
367
|
return Te(r, e);
|
|
368
368
|
let n = t.moveVertically(r, e);
|
|
@@ -398,8 +398,8 @@ function en(t, e) {
|
|
|
398
398
|
}
|
|
399
399
|
return t.dispatch(I(n, o), { effects: i }), !0;
|
|
400
400
|
}
|
|
401
|
-
const ht = (t) => en(t, !1),
|
|
402
|
-
function
|
|
401
|
+
const ht = (t) => en(t, !1), Je = (t) => en(t, !0);
|
|
402
|
+
function _(t, e, r) {
|
|
403
403
|
let n = t.lineBlockAt(e.head), o = t.moveToLineBoundary(e, r);
|
|
404
404
|
if (o.head == e.head && o.head != (r ? n.to : n.from) && (o = t.moveToLineBoundary(e, r, !1)), !r && o.head == n.from && n.length) {
|
|
405
405
|
let i = /^\s*/.exec(t.state.sliceDoc(n.from, Math.min(n.from + 100, n.to)))[0].length;
|
|
@@ -407,7 +407,7 @@ function q(t, e, r) {
|
|
|
407
407
|
}
|
|
408
408
|
return o;
|
|
409
409
|
}
|
|
410
|
-
const jr = (t) =>
|
|
410
|
+
const jr = (t) => T(t, (e) => _(t, e, !0)), Qr = (t) => T(t, (e) => _(t, e, !1)), Yr = (t) => T(t, (e) => _(t, e, !b(t))), Zr = (t) => T(t, (e) => _(t, e, b(t))), Xr = (t) => T(t, (e) => d.cursor(t.lineBlockAt(e.head).from, 1)), eo = (t) => T(t, (e) => d.cursor(t.lineBlockAt(e.head).to, -1));
|
|
411
411
|
function to(t, e, r) {
|
|
412
412
|
let n = !1, o = re(t.selection, (i) => {
|
|
413
413
|
let s = Z(t, i.head, -1) || Z(t, i.head, 1) || i.head > 0 && Z(t, i.head - 1, 1) || i.head < t.doc.length && Z(t, i.head + 1, -1);
|
|
@@ -420,7 +420,7 @@ function to(t, e, r) {
|
|
|
420
420
|
return n ? (e(I(t, o)), !0) : !1;
|
|
421
421
|
}
|
|
422
422
|
const no = ({ state: t, dispatch: e }) => to(t, e, !1);
|
|
423
|
-
function
|
|
423
|
+
function D(t, e) {
|
|
424
424
|
let r = re(t.state.selection, (n) => {
|
|
425
425
|
let o = e(n);
|
|
426
426
|
return d.range(n.anchor, o.head, o.goalColumn, o.bidiLevel || void 0);
|
|
@@ -428,21 +428,21 @@ function B(t, e) {
|
|
|
428
428
|
return r.eq(t.state.selection) ? !1 : (t.dispatch(I(t.state, r)), !0);
|
|
429
429
|
}
|
|
430
430
|
function tn(t, e) {
|
|
431
|
-
return
|
|
431
|
+
return D(t, (r) => t.moveByChar(r, e));
|
|
432
432
|
}
|
|
433
|
-
const nn = (t) => tn(t, !
|
|
433
|
+
const nn = (t) => tn(t, !b(t)), rn = (t) => tn(t, b(t));
|
|
434
434
|
function on(t, e) {
|
|
435
|
-
return
|
|
435
|
+
return D(t, (r) => t.moveByGroup(r, e));
|
|
436
436
|
}
|
|
437
|
-
const ro = (t) => on(t, !
|
|
437
|
+
const ro = (t) => on(t, !b(t)), oo = (t) => on(t, b(t)), io = (t) => D(t, (e) => Oe(t.state, e, !b(t))), so = (t) => D(t, (e) => Oe(t.state, e, b(t)));
|
|
438
438
|
function sn(t, e) {
|
|
439
|
-
return
|
|
439
|
+
return D(t, (r) => t.moveVertically(r, e));
|
|
440
440
|
}
|
|
441
441
|
const ln = (t) => sn(t, !1), an = (t) => sn(t, !0);
|
|
442
442
|
function cn(t, e) {
|
|
443
|
-
return
|
|
443
|
+
return D(t, (r) => t.moveVertically(r, e, Xt(t).height));
|
|
444
444
|
}
|
|
445
|
-
const ut = (t) => cn(t, !1), ft = (t) => cn(t, !0), lo = (t) =>
|
|
445
|
+
const ut = (t) => cn(t, !1), ft = (t) => cn(t, !0), lo = (t) => D(t, (e) => _(t, e, !0)), ao = (t) => D(t, (e) => _(t, e, !1)), co = (t) => D(t, (e) => _(t, e, !b(t))), ho = (t) => D(t, (e) => _(t, e, b(t))), uo = (t) => D(t, (e) => d.cursor(t.lineBlockAt(e.head).from)), fo = (t) => D(t, (e) => d.cursor(t.lineBlockAt(e.head).to)), dt = ({ state: t, dispatch: e }) => (e(I(t, { anchor: 0 })), !0), mt = ({ state: t, dispatch: e }) => (e(I(t, { anchor: t.doc.length })), !0), gt = ({ state: t, dispatch: e }) => (e(I(t, { anchor: t.selection.main.anchor, head: 0 })), !0), pt = ({ state: t, dispatch: e }) => (e(I(t, { anchor: t.selection.main.anchor, head: t.doc.length })), !0), mo = ({ state: t, dispatch: e }) => (e(t.update({ selection: { anchor: 0, head: t.doc.length }, userEvent: "select" })), !0), go = ({ state: t, dispatch: e }) => {
|
|
446
446
|
let r = Pe(t).map(({ from: n, to: o }) => d.range(n, Math.min(o + 1, t.doc.length)));
|
|
447
447
|
return e(t.update({ selection: d.create(r), userEvent: "select" })), !0;
|
|
448
448
|
}, po = ({ state: t, dispatch: e }) => {
|
|
@@ -489,7 +489,7 @@ const hn = (t, e) => Ie(t, (r) => {
|
|
|
489
489
|
if (!e && r > o.from && r < o.from + 200 && !/[^ \t]/.test(i = o.text.slice(0, r - o.from))) {
|
|
490
490
|
if (i[i.length - 1] == " ")
|
|
491
491
|
return r - 1;
|
|
492
|
-
let l = Wt(i, n.tabSize), a = l %
|
|
492
|
+
let l = Wt(i, n.tabSize), a = l % ze(n) || ze(n);
|
|
493
493
|
for (let c = 0; c < a && i[i.length - 1 - c] == " "; c++)
|
|
494
494
|
r--;
|
|
495
495
|
s = r;
|
|
@@ -594,7 +594,7 @@ function Do(t, e) {
|
|
|
594
594
|
if (/\(\)|\[\]|\{\}/.test(t.sliceDoc(e - 1, e + 1)))
|
|
595
595
|
return { from: e, to: e };
|
|
596
596
|
let r = et(t).resolveInner(e), n = r.childBefore(e), o = r.childAfter(e), i;
|
|
597
|
-
return n && o && n.to <= e && o.from >= e && (i = n.type.prop(
|
|
597
|
+
return n && o && n.to <= e && o.from >= e && (i = n.type.prop($e.closedBy)) && i.indexOf(o.name) > -1 && t.doc.lineAt(n.to).from == t.doc.lineAt(o.from).from ? { from: n.to, to: o.from } : null;
|
|
598
598
|
}
|
|
599
599
|
const Bo = /* @__PURE__ */ yn(!1), Eo = /* @__PURE__ */ yn(!0);
|
|
600
600
|
function yn(t) {
|
|
@@ -653,13 +653,13 @@ const wo = ({ state: t, dispatch: e }) => {
|
|
|
653
653
|
let o = /^\s*/.exec(r.text)[0];
|
|
654
654
|
if (!o)
|
|
655
655
|
return;
|
|
656
|
-
let i = Wt(o, t.tabSize), s = 0, l = Se(t, Math.max(0, i -
|
|
656
|
+
let i = Wt(o, t.tabSize), s = 0, l = Se(t, Math.max(0, i - ze(t)));
|
|
657
657
|
for (; s < o.length && s < l.length && o.charCodeAt(s) == l.charCodeAt(s); )
|
|
658
658
|
s++;
|
|
659
659
|
n.push({ from: r.from + s, to: r.from + o.length, insert: l.slice(s) });
|
|
660
660
|
}), { userEvent: "delete.dedent" })), !0), Ro = [
|
|
661
|
-
{ key: "Ctrl-b", run:
|
|
662
|
-
{ key: "Ctrl-f", run:
|
|
661
|
+
{ key: "Ctrl-b", run: Kt, shift: nn, preventDefault: !0 },
|
|
662
|
+
{ key: "Ctrl-f", run: Jt, shift: rn },
|
|
663
663
|
{ key: "Ctrl-p", run: Yt, shift: ln },
|
|
664
664
|
{ key: "Ctrl-n", run: Zt, shift: an },
|
|
665
665
|
{ key: "Ctrl-a", run: Xr, shift: uo },
|
|
@@ -670,22 +670,22 @@ const wo = ({ state: t, dispatch: e }) => {
|
|
|
670
670
|
{ key: "Ctrl-Alt-h", run: dn },
|
|
671
671
|
{ key: "Ctrl-o", run: bo },
|
|
672
672
|
{ key: "Ctrl-t", run: So },
|
|
673
|
-
{ key: "Ctrl-v", run:
|
|
673
|
+
{ key: "Ctrl-v", run: Je }
|
|
674
674
|
], To = /* @__PURE__ */ [
|
|
675
|
-
{ key: "ArrowLeft", run:
|
|
676
|
-
{ key: "Mod-ArrowLeft", mac: "Alt-ArrowLeft", run:
|
|
675
|
+
{ key: "ArrowLeft", run: Kt, shift: nn, preventDefault: !0 },
|
|
676
|
+
{ key: "Mod-ArrowLeft", mac: "Alt-ArrowLeft", run: zr, shift: ro, preventDefault: !0 },
|
|
677
677
|
{ mac: "Cmd-ArrowLeft", run: Yr, shift: co, preventDefault: !0 },
|
|
678
|
-
{ key: "ArrowRight", run:
|
|
679
|
-
{ key: "Mod-ArrowRight", mac: "Alt-ArrowRight", run:
|
|
678
|
+
{ key: "ArrowRight", run: Jt, shift: rn, preventDefault: !0 },
|
|
679
|
+
{ key: "Mod-ArrowRight", mac: "Alt-ArrowRight", run: $r, shift: oo, preventDefault: !0 },
|
|
680
680
|
{ mac: "Cmd-ArrowRight", run: Zr, shift: ho, preventDefault: !0 },
|
|
681
681
|
{ key: "ArrowUp", run: Yt, shift: ln, preventDefault: !0 },
|
|
682
682
|
{ mac: "Cmd-ArrowUp", run: dt, shift: gt },
|
|
683
683
|
{ mac: "Ctrl-ArrowUp", run: ht, shift: ut },
|
|
684
684
|
{ key: "ArrowDown", run: Zt, shift: an, preventDefault: !0 },
|
|
685
685
|
{ mac: "Cmd-ArrowDown", run: mt, shift: pt },
|
|
686
|
-
{ mac: "Ctrl-ArrowDown", run:
|
|
686
|
+
{ mac: "Ctrl-ArrowDown", run: Je, shift: ft },
|
|
687
687
|
{ key: "PageUp", run: ht, shift: ut },
|
|
688
|
-
{ key: "PageDown", run:
|
|
688
|
+
{ key: "PageDown", run: Je, shift: ft },
|
|
689
689
|
{ key: "Home", run: Qr, shift: ao, preventDefault: !0 },
|
|
690
690
|
{ key: "Mod-Home", run: dt, shift: gt },
|
|
691
691
|
{ key: "End", run: jr, shift: lo, preventDefault: !0 },
|
|
@@ -699,8 +699,8 @@ const wo = ({ state: t, dispatch: e }) => {
|
|
|
699
699
|
{ mac: "Mod-Backspace", run: ko },
|
|
700
700
|
{ mac: "Mod-Delete", run: mn }
|
|
701
701
|
].concat(/* @__PURE__ */ Ro.map((t) => ({ mac: t.key, run: t.run, shift: t.shift }))), Oo = /* @__PURE__ */ [
|
|
702
|
-
{ key: "Alt-ArrowLeft", mac: "Ctrl-ArrowLeft", run:
|
|
703
|
-
{ key: "Alt-ArrowRight", mac: "Ctrl-ArrowRight", run:
|
|
702
|
+
{ key: "Alt-ArrowLeft", mac: "Ctrl-ArrowLeft", run: Kr, shift: io },
|
|
703
|
+
{ key: "Alt-ArrowRight", mac: "Ctrl-ArrowRight", run: Jr, shift: so },
|
|
704
704
|
{ key: "Alt-ArrowUp", run: Co },
|
|
705
705
|
{ key: "Shift-Alt-ArrowUp", run: Ao },
|
|
706
706
|
{ key: "Alt-ArrowDown", run: vo },
|
|
@@ -857,7 +857,7 @@ class Cn {
|
|
|
857
857
|
}
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
|
-
const
|
|
860
|
+
const Ve = /* @__PURE__ */ new WeakMap();
|
|
861
861
|
class X {
|
|
862
862
|
constructor(e, r) {
|
|
863
863
|
this.from = e, this.text = r;
|
|
@@ -866,15 +866,15 @@ class X {
|
|
|
866
866
|
return this.from + this.text.length;
|
|
867
867
|
}
|
|
868
868
|
static get(e, r, n) {
|
|
869
|
-
let o =
|
|
869
|
+
let o = Ve.get(e);
|
|
870
870
|
if (!o || o.from >= n || o.to <= r) {
|
|
871
871
|
let l = new X(r, e.sliceString(r, n));
|
|
872
|
-
return
|
|
872
|
+
return Ve.set(e, l), l;
|
|
873
873
|
}
|
|
874
874
|
if (o.from == r && o.to == n)
|
|
875
875
|
return o;
|
|
876
876
|
let { text: i, from: s } = o;
|
|
877
|
-
return s > r && (i = e.sliceString(r, s) + i, s = r), o.to < n && (i += e.sliceString(o.to, n)),
|
|
877
|
+
return s > r && (i = e.sliceString(r, s) + i, s = r), o.to < n && (i += e.sliceString(o.to, n)), Ve.set(e, new X(s, i)), new X(r, i.slice(r - s, n - s));
|
|
878
878
|
}
|
|
879
879
|
}
|
|
880
880
|
class vn {
|
|
@@ -935,19 +935,19 @@ function Qe(t) {
|
|
|
935
935
|
return;
|
|
936
936
|
let { state: i } = t, s = i.doc.lineAt(i.selection.main.head), [, l, a, c, h] = o, u = c ? +c.slice(1) : 0, m = a ? +a : s.number;
|
|
937
937
|
if (a && h) {
|
|
938
|
-
let
|
|
939
|
-
l && (
|
|
938
|
+
let B = m / 100;
|
|
939
|
+
l && (B = B * (l == "-" ? -1 : 1) + s.number / i.doc.lines), m = Math.round(i.doc.lines * B);
|
|
940
940
|
} else
|
|
941
941
|
a && l && (m = m * (l == "-" ? -1 : 1) + s.number);
|
|
942
|
-
let
|
|
942
|
+
let k = i.doc.line(Math.max(1, Math.min(i.doc.lines, m))), S = d.cursor(k.from + Math.max(0, Math.min(u, k.length)));
|
|
943
943
|
t.dispatch({
|
|
944
|
-
effects: [Ae.of(!1), p.scrollIntoView(
|
|
945
|
-
selection:
|
|
944
|
+
effects: [Ae.of(!1), p.scrollIntoView(S.from, { y: "center" })],
|
|
945
|
+
selection: S
|
|
946
946
|
}), t.focus();
|
|
947
947
|
}
|
|
948
948
|
return { dom: r };
|
|
949
949
|
}
|
|
950
|
-
const Ae = /* @__PURE__ */
|
|
950
|
+
const Ae = /* @__PURE__ */ R.define(), xt = /* @__PURE__ */ we.define({
|
|
951
951
|
create() {
|
|
952
952
|
return !0;
|
|
953
953
|
},
|
|
@@ -961,7 +961,7 @@ const Ae = /* @__PURE__ */ w.define(), xt = /* @__PURE__ */ we.define({
|
|
|
961
961
|
let e = ce(t, Qe);
|
|
962
962
|
if (!e) {
|
|
963
963
|
let r = [Ae.of(!0)];
|
|
964
|
-
t.state.field(xt, !1) == null && r.push(
|
|
964
|
+
t.state.field(xt, !1) == null && r.push(R.appendConfig.of([xt, Fo])), t.dispatch({ effects: r }), e = ce(t, Qe);
|
|
965
965
|
}
|
|
966
966
|
return e && e.dom.querySelector("input").focus(), !0;
|
|
967
967
|
}, Fo = /* @__PURE__ */ p.baseTheme({
|
|
@@ -984,17 +984,17 @@ const Ae = /* @__PURE__ */ w.define(), xt = /* @__PURE__ */ we.define({
|
|
|
984
984
|
}
|
|
985
985
|
});
|
|
986
986
|
function qo(t) {
|
|
987
|
-
let e = [
|
|
987
|
+
let e = [zo, Uo];
|
|
988
988
|
return t && e.push(An.of(t)), e;
|
|
989
989
|
}
|
|
990
|
-
const
|
|
990
|
+
const _o = /* @__PURE__ */ x.mark({ class: "cm-selectionMatch" }), Vo = /* @__PURE__ */ x.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
|
|
991
991
|
function kt(t, e, r, n) {
|
|
992
|
-
return (r == 0 || t(e.sliceDoc(r - 1, r)) !=
|
|
992
|
+
return (r == 0 || t(e.sliceDoc(r - 1, r)) != M.Word) && (n == e.doc.length || t(e.sliceDoc(n, n + 1)) != M.Word);
|
|
993
993
|
}
|
|
994
|
-
function
|
|
995
|
-
return t(e.sliceDoc(r, r + 1)) ==
|
|
994
|
+
function Ho(t, e, r, n) {
|
|
995
|
+
return t(e.sliceDoc(r, r + 1)) == M.Word && t(e.sliceDoc(n - 1, n)) == M.Word;
|
|
996
996
|
}
|
|
997
|
-
const
|
|
997
|
+
const Uo = /* @__PURE__ */ Ft.fromClass(class {
|
|
998
998
|
constructor(t) {
|
|
999
999
|
this.decorations = this.getDeco(t);
|
|
1000
1000
|
}
|
|
@@ -1004,46 +1004,46 @@ const zo = /* @__PURE__ */ Ft.fromClass(class {
|
|
|
1004
1004
|
getDeco(t) {
|
|
1005
1005
|
let e = t.state.facet(An), { state: r } = t, n = r.selection;
|
|
1006
1006
|
if (n.ranges.length > 1)
|
|
1007
|
-
return
|
|
1007
|
+
return x.none;
|
|
1008
1008
|
let o = n.main, i, s = null;
|
|
1009
1009
|
if (o.empty) {
|
|
1010
1010
|
if (!e.highlightWordAroundCursor)
|
|
1011
|
-
return
|
|
1011
|
+
return x.none;
|
|
1012
1012
|
let a = r.wordAt(o.head);
|
|
1013
1013
|
if (!a)
|
|
1014
|
-
return
|
|
1014
|
+
return x.none;
|
|
1015
1015
|
s = r.charCategorizer(o.head), i = r.sliceDoc(a.from, a.to);
|
|
1016
1016
|
} else {
|
|
1017
1017
|
let a = o.to - o.from;
|
|
1018
1018
|
if (a < e.minSelectionLength || a > 200)
|
|
1019
|
-
return
|
|
1019
|
+
return x.none;
|
|
1020
1020
|
if (e.wholeWords) {
|
|
1021
|
-
if (i = r.sliceDoc(o.from, o.to), s = r.charCategorizer(o.head), !(kt(s, r, o.from, o.to) &&
|
|
1022
|
-
return
|
|
1021
|
+
if (i = r.sliceDoc(o.from, o.to), s = r.charCategorizer(o.head), !(kt(s, r, o.from, o.to) && Ho(s, r, o.from, o.to)))
|
|
1022
|
+
return x.none;
|
|
1023
1023
|
} else if (i = r.sliceDoc(o.from, o.to).trim(), !i)
|
|
1024
|
-
return
|
|
1024
|
+
return x.none;
|
|
1025
1025
|
}
|
|
1026
1026
|
let l = [];
|
|
1027
1027
|
for (let a of t.visibleRanges) {
|
|
1028
1028
|
let c = new te(r.doc, i, a.from, a.to);
|
|
1029
1029
|
for (; !c.next().done; ) {
|
|
1030
1030
|
let { from: h, to: u } = c.value;
|
|
1031
|
-
if ((!s || kt(s, r, h, u)) && (o.empty && h <= o.from && u >= o.to ? l.push(
|
|
1032
|
-
return
|
|
1031
|
+
if ((!s || kt(s, r, h, u)) && (o.empty && h <= o.from && u >= o.to ? l.push(Vo.range(h, u)) : (h >= o.to || u <= o.from) && l.push(_o.range(h, u)), l.length > e.maxMatches))
|
|
1032
|
+
return x.none;
|
|
1033
1033
|
}
|
|
1034
1034
|
}
|
|
1035
|
-
return
|
|
1035
|
+
return x.set(l);
|
|
1036
1036
|
}
|
|
1037
1037
|
}, {
|
|
1038
1038
|
decorations: (t) => t.decorations
|
|
1039
|
-
}),
|
|
1039
|
+
}), zo = /* @__PURE__ */ p.baseTheme({
|
|
1040
1040
|
".cm-selectionMatch": { backgroundColor: "#99ff7780" },
|
|
1041
1041
|
".cm-searchMatch .cm-selectionMatch": { backgroundColor: "transparent" }
|
|
1042
|
-
}),
|
|
1042
|
+
}), $o = ({ state: t, dispatch: e }) => {
|
|
1043
1043
|
let { selection: r } = t, n = d.create(r.ranges.map((o) => t.wordAt(o.head) || d.cursor(o.head)), r.mainIndex);
|
|
1044
1044
|
return n.eq(r) ? !1 : (e(t.update({ selection: n })), !0);
|
|
1045
1045
|
};
|
|
1046
|
-
function
|
|
1046
|
+
function Go(t, e) {
|
|
1047
1047
|
let { main: r, ranges: n } = t.selection, o = t.wordAt(r.head), i = o && o.from == r.from && o.to == r.to;
|
|
1048
1048
|
for (let s = !1, l = new te(t.doc, e, n[n.length - 1].to); ; )
|
|
1049
1049
|
if (l.next(), l.done) {
|
|
@@ -1061,14 +1061,14 @@ function Ko(t, e) {
|
|
|
1061
1061
|
return l.value;
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
|
-
const
|
|
1064
|
+
const Ko = ({ state: t, dispatch: e }) => {
|
|
1065
1065
|
let { ranges: r } = t.selection;
|
|
1066
1066
|
if (r.some((i) => i.from === i.to))
|
|
1067
|
-
return
|
|
1067
|
+
return $o({ state: t, dispatch: e });
|
|
1068
1068
|
let n = t.sliceDoc(r[0].from, r[0].to);
|
|
1069
1069
|
if (t.selection.ranges.some((i) => t.sliceDoc(i.from, i.to) != n))
|
|
1070
1070
|
return !1;
|
|
1071
|
-
let o =
|
|
1071
|
+
let o = Go(t, n);
|
|
1072
1072
|
return o ? (e(t.update({
|
|
1073
1073
|
selection: t.selection.addRange(d.range(o.from, o.to), !1),
|
|
1074
1074
|
effects: p.scrollIntoView(o.to)
|
|
@@ -1127,10 +1127,10 @@ class Ln {
|
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
1129
|
function Q(t, e, r, n) {
|
|
1130
|
-
return new te(e.doc, t.unquoted, r, n, t.caseSensitive ? void 0 : (o) => o.toLowerCase(), t.wholeWord ?
|
|
1130
|
+
return new te(e.doc, t.unquoted, r, n, t.caseSensitive ? void 0 : (o) => o.toLowerCase(), t.wholeWord ? Jo(e.doc, e.charCategorizer(e.selection.main.head)) : void 0);
|
|
1131
1131
|
}
|
|
1132
|
-
function
|
|
1133
|
-
return (r, n, o, i) => ((i > r || i + o.length < n) && (i = Math.max(0, r - 2), o = t.sliceString(i, Math.min(t.length, n + 2))), (e(Me(o, r - i)) !=
|
|
1132
|
+
function Jo(t, e) {
|
|
1133
|
+
return (r, n, o, i) => ((i > r || i + o.length < n) && (i = Math.max(0, r - 2), o = t.sliceString(i, Math.min(t.length, n + 2))), (e(Me(o, r - i)) != M.Word || e(Le(o, r - i)) != M.Word) && (e(Le(o, n - i)) != M.Word || e(Me(o, n - i)) != M.Word));
|
|
1134
1134
|
}
|
|
1135
1135
|
class jo extends Ln {
|
|
1136
1136
|
constructor(e) {
|
|
@@ -1188,7 +1188,7 @@ function Le(t, e) {
|
|
|
1188
1188
|
return t.slice(e, ee(t, e));
|
|
1189
1189
|
}
|
|
1190
1190
|
function Qo(t) {
|
|
1191
|
-
return (e, r, n) => !n[0].length || (t(Me(n.input, n.index)) !=
|
|
1191
|
+
return (e, r, n) => !n[0].length || (t(Me(n.input, n.index)) != M.Word || t(Le(n.input, n.index)) != M.Word) && (t(Le(n.input, n.index + n[0].length)) != M.Word || t(Me(n.input, n.index + n[0].length)) != M.Word);
|
|
1192
1192
|
}
|
|
1193
1193
|
class Yo extends Ln {
|
|
1194
1194
|
nextMatch(e, r, n) {
|
|
@@ -1235,33 +1235,33 @@ class Yo extends Ln {
|
|
|
1235
1235
|
o(i.value.from, i.value.to);
|
|
1236
1236
|
}
|
|
1237
1237
|
}
|
|
1238
|
-
const ue = /* @__PURE__ */
|
|
1238
|
+
const ue = /* @__PURE__ */ R.define(), st = /* @__PURE__ */ R.define(), q = /* @__PURE__ */ we.define({
|
|
1239
1239
|
create(t) {
|
|
1240
|
-
return new
|
|
1240
|
+
return new He(Ye(t).create(), null);
|
|
1241
1241
|
},
|
|
1242
1242
|
update(t, e) {
|
|
1243
1243
|
for (let r of e.effects)
|
|
1244
|
-
r.is(ue) ? t = new
|
|
1244
|
+
r.is(ue) ? t = new He(r.value.create(), t.panel) : r.is(st) && (t = new He(t.query, r.value ? lt : null));
|
|
1245
1245
|
return t;
|
|
1246
1246
|
},
|
|
1247
1247
|
provide: (t) => tt.from(t, (e) => e.panel)
|
|
1248
1248
|
});
|
|
1249
|
-
class
|
|
1249
|
+
class He {
|
|
1250
1250
|
constructor(e, r) {
|
|
1251
1251
|
this.query = e, this.panel = r;
|
|
1252
1252
|
}
|
|
1253
1253
|
}
|
|
1254
|
-
const Zo = /* @__PURE__ */
|
|
1254
|
+
const Zo = /* @__PURE__ */ x.mark({ class: "cm-searchMatch" }), Xo = /* @__PURE__ */ x.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), ei = /* @__PURE__ */ Ft.fromClass(class {
|
|
1255
1255
|
constructor(t) {
|
|
1256
|
-
this.view = t, this.decorations = this.highlight(t.state.field(
|
|
1256
|
+
this.view = t, this.decorations = this.highlight(t.state.field(q));
|
|
1257
1257
|
}
|
|
1258
1258
|
update(t) {
|
|
1259
|
-
let e = t.state.field(
|
|
1260
|
-
(e != t.startState.field(
|
|
1259
|
+
let e = t.state.field(q);
|
|
1260
|
+
(e != t.startState.field(q) || t.docChanged || t.selectionSet || t.viewportChanged) && (this.decorations = this.highlight(e));
|
|
1261
1261
|
}
|
|
1262
1262
|
highlight({ query: t, panel: e }) {
|
|
1263
1263
|
if (!e || !t.spec.valid)
|
|
1264
|
-
return
|
|
1264
|
+
return x.none;
|
|
1265
1265
|
let { view: r } = this, n = new tr();
|
|
1266
1266
|
for (let o = 0, i = r.visibleRanges, s = i.length; o < s; o++) {
|
|
1267
1267
|
let { from: l, to: a } = i[o];
|
|
@@ -1279,7 +1279,7 @@ const Zo = /* @__PURE__ */ y.mark({ class: "cm-searchMatch" }), Xo = /* @__PURE_
|
|
|
1279
1279
|
});
|
|
1280
1280
|
function de(t) {
|
|
1281
1281
|
return (e) => {
|
|
1282
|
-
let r = e.state.field(
|
|
1282
|
+
let r = e.state.field(q, !1);
|
|
1283
1283
|
return r && r.query.spec.valid ? t(e, r) : En(e);
|
|
1284
1284
|
};
|
|
1285
1285
|
}
|
|
@@ -1383,7 +1383,7 @@ function Bn(t) {
|
|
|
1383
1383
|
e && e == t.root.activeElement && e.select();
|
|
1384
1384
|
}
|
|
1385
1385
|
const En = (t) => {
|
|
1386
|
-
let e = t.state.field(
|
|
1386
|
+
let e = t.state.field(q, !1);
|
|
1387
1387
|
if (e && e.panel) {
|
|
1388
1388
|
let r = Dn(t);
|
|
1389
1389
|
if (r && r != t.root.activeElement) {
|
|
@@ -1393,11 +1393,11 @@ const En = (t) => {
|
|
|
1393
1393
|
} else
|
|
1394
1394
|
t.dispatch({ effects: [
|
|
1395
1395
|
st.of(!0),
|
|
1396
|
-
e ? ue.of(Ye(t.state, e.query.spec)) :
|
|
1396
|
+
e ? ue.of(Ye(t.state, e.query.spec)) : R.appendConfig.of(li)
|
|
1397
1397
|
] });
|
|
1398
1398
|
return !0;
|
|
1399
1399
|
}, wn = (t) => {
|
|
1400
|
-
let e = t.state.field(
|
|
1400
|
+
let e = t.state.field(q, !1);
|
|
1401
1401
|
if (!e || !e.panel)
|
|
1402
1402
|
return !1;
|
|
1403
1403
|
let r = ce(t, lt);
|
|
@@ -1409,16 +1409,16 @@ const En = (t) => {
|
|
|
1409
1409
|
{ key: "Escape", run: wn, scope: "editor search-panel" },
|
|
1410
1410
|
{ key: "Mod-Shift-l", run: ni },
|
|
1411
1411
|
{ key: "Alt-g", run: Wo },
|
|
1412
|
-
{ key: "Mod-d", run:
|
|
1412
|
+
{ key: "Mod-d", run: Ko, preventDefault: !0 }
|
|
1413
1413
|
];
|
|
1414
1414
|
class ii {
|
|
1415
1415
|
constructor(e) {
|
|
1416
1416
|
this.view = e;
|
|
1417
|
-
let r = this.query = e.state.field(
|
|
1417
|
+
let r = this.query = e.state.field(q).query.spec;
|
|
1418
1418
|
this.commit = this.commit.bind(this), this.searchField = g("input", {
|
|
1419
1419
|
value: r.search,
|
|
1420
|
-
placeholder:
|
|
1421
|
-
"aria-label":
|
|
1420
|
+
placeholder: v(e, "Find"),
|
|
1421
|
+
"aria-label": v(e, "Find"),
|
|
1422
1422
|
class: "cm-textfield",
|
|
1423
1423
|
name: "search",
|
|
1424
1424
|
form: "",
|
|
@@ -1427,8 +1427,8 @@ class ii {
|
|
|
1427
1427
|
onkeyup: this.commit
|
|
1428
1428
|
}), this.replaceField = g("input", {
|
|
1429
1429
|
value: r.replace,
|
|
1430
|
-
placeholder:
|
|
1431
|
-
"aria-label":
|
|
1430
|
+
placeholder: v(e, "Replace"),
|
|
1431
|
+
"aria-label": v(e, "Replace"),
|
|
1432
1432
|
class: "cm-textfield",
|
|
1433
1433
|
name: "replace",
|
|
1434
1434
|
form: "",
|
|
@@ -1458,22 +1458,22 @@ class ii {
|
|
|
1458
1458
|
}
|
|
1459
1459
|
this.dom = g("div", { onkeydown: (o) => this.keydown(o), class: "cm-search" }, [
|
|
1460
1460
|
this.searchField,
|
|
1461
|
-
n("next", () => De(e), [
|
|
1462
|
-
n("prev", () => Be(e), [
|
|
1463
|
-
n("select", () => ti(e), [
|
|
1464
|
-
g("label", null, [this.caseField,
|
|
1465
|
-
g("label", null, [this.reField,
|
|
1466
|
-
g("label", null, [this.wordField,
|
|
1461
|
+
n("next", () => De(e), [v(e, "next")]),
|
|
1462
|
+
n("prev", () => Be(e), [v(e, "previous")]),
|
|
1463
|
+
n("select", () => ti(e), [v(e, "all")]),
|
|
1464
|
+
g("label", null, [this.caseField, v(e, "match case")]),
|
|
1465
|
+
g("label", null, [this.reField, v(e, "regexp")]),
|
|
1466
|
+
g("label", null, [this.wordField, v(e, "by word")]),
|
|
1467
1467
|
...e.state.readOnly ? [] : [
|
|
1468
1468
|
g("br"),
|
|
1469
1469
|
this.replaceField,
|
|
1470
|
-
n("replace", () => bt(e), [
|
|
1471
|
-
n("replaceAll", () => ri(e), [
|
|
1470
|
+
n("replace", () => bt(e), [v(e, "replace")]),
|
|
1471
|
+
n("replaceAll", () => ri(e), [v(e, "replace all")])
|
|
1472
1472
|
],
|
|
1473
1473
|
g("button", {
|
|
1474
1474
|
name: "close",
|
|
1475
1475
|
onclick: () => wn(e),
|
|
1476
|
-
"aria-label":
|
|
1476
|
+
"aria-label": v(e, "close"),
|
|
1477
1477
|
type: "button"
|
|
1478
1478
|
}, ["×"])
|
|
1479
1479
|
]);
|
|
@@ -1509,7 +1509,7 @@ class ii {
|
|
|
1509
1509
|
return this.view.state.facet(oe).top;
|
|
1510
1510
|
}
|
|
1511
1511
|
}
|
|
1512
|
-
function
|
|
1512
|
+
function v(t, e) {
|
|
1513
1513
|
return t.state.phrase(e);
|
|
1514
1514
|
}
|
|
1515
1515
|
const pe = 30, ye = /[\s\.,:;?!]/;
|
|
@@ -1561,7 +1561,7 @@ const si = /* @__PURE__ */ p.baseTheme({
|
|
|
1561
1561
|
"&light .cm-searchMatch-selected": { backgroundColor: "#ff6a0054" },
|
|
1562
1562
|
"&dark .cm-searchMatch-selected": { backgroundColor: "#ff00ff8a" }
|
|
1563
1563
|
}), li = [
|
|
1564
|
-
|
|
1564
|
+
q,
|
|
1565
1565
|
/* @__PURE__ */ Xn.lowest(ei),
|
|
1566
1566
|
si
|
|
1567
1567
|
];
|
|
@@ -1577,10 +1577,10 @@ class z {
|
|
|
1577
1577
|
static init(e, r, n) {
|
|
1578
1578
|
let o = e, i = n.facet(On).markerFilter;
|
|
1579
1579
|
i && (o = i(o));
|
|
1580
|
-
let s =
|
|
1580
|
+
let s = x.set(o.map((l) => l.from == l.to || l.from == l.to - 1 && n.doc.lineAt(l.from).to == l.from ? x.widget({
|
|
1581
1581
|
widget: new yi(l),
|
|
1582
1582
|
diagnostic: l
|
|
1583
|
-
}).range(l.from) :
|
|
1583
|
+
}).range(l.from) : x.mark({
|
|
1584
1584
|
attributes: { class: "cm-lintRange cm-lintRange-" + l.severity + (l.markClass ? " " + l.markClass : "") },
|
|
1585
1585
|
diagnostic: l
|
|
1586
1586
|
}).range(l.from, l.to)), !0);
|
|
@@ -1599,11 +1599,11 @@ function ci(t, e) {
|
|
|
1599
1599
|
return !!(t.effects.some((n) => n.is(Rn)) || t.changes.touchesRange(r.from, r.to));
|
|
1600
1600
|
}
|
|
1601
1601
|
function hi(t, e) {
|
|
1602
|
-
return t.field(
|
|
1602
|
+
return t.field(A, !1) ? e : e.concat(R.appendConfig.of(bi));
|
|
1603
1603
|
}
|
|
1604
|
-
const Rn = /* @__PURE__ */
|
|
1604
|
+
const Rn = /* @__PURE__ */ R.define(), ct = /* @__PURE__ */ R.define(), Tn = /* @__PURE__ */ R.define(), A = /* @__PURE__ */ we.define({
|
|
1605
1605
|
create() {
|
|
1606
|
-
return new z(
|
|
1606
|
+
return new z(x.none, null, null);
|
|
1607
1607
|
},
|
|
1608
1608
|
update(t, e) {
|
|
1609
1609
|
if (e.docChanged) {
|
|
@@ -1622,9 +1622,9 @@ const Rn = /* @__PURE__ */ w.define(), ct = /* @__PURE__ */ w.define(), Tn = /*
|
|
|
1622
1622
|
tt.from(t, (e) => e.panel),
|
|
1623
1623
|
p.decorations.from(t, (e) => e.diagnostics)
|
|
1624
1624
|
]
|
|
1625
|
-
}), ui = /* @__PURE__ */
|
|
1625
|
+
}), ui = /* @__PURE__ */ x.mark({ class: "cm-lintRange cm-lintRange-active" });
|
|
1626
1626
|
function fi(t, e, r) {
|
|
1627
|
-
let { diagnostics: n } = t.state.field(
|
|
1627
|
+
let { diagnostics: n } = t.state.field(A), o = [], i = 2e8, s = 0;
|
|
1628
1628
|
n.between(e - (r < 0 ? 1 : 0), e + (r > 0 ? 1 : 0), (a, c, { spec: h }) => {
|
|
1629
1629
|
e >= a && e <= c && (a == c || (e > a || r > 0) && (e < c || r < 0)) && (o.push(h.diagnostic), i = Math.min(a, i), s = Math.max(c, s));
|
|
1630
1630
|
});
|
|
@@ -1642,15 +1642,15 @@ function di(t, e) {
|
|
|
1642
1642
|
return g("ul", { class: "cm-tooltip-lint" }, e.map((r) => Pn(t, r, !1)));
|
|
1643
1643
|
}
|
|
1644
1644
|
const mi = (t) => {
|
|
1645
|
-
let e = t.state.field(
|
|
1645
|
+
let e = t.state.field(A, !1);
|
|
1646
1646
|
(!e || !e.panel) && t.dispatch({ effects: hi(t.state, [ct.of(!0)]) });
|
|
1647
1647
|
let r = ce(t, We.open);
|
|
1648
1648
|
return r && r.dom.querySelector(".cm-panel-lint ul").focus(), !0;
|
|
1649
1649
|
}, St = (t) => {
|
|
1650
|
-
let e = t.state.field(
|
|
1650
|
+
let e = t.state.field(A, !1);
|
|
1651
1651
|
return !e || !e.panel ? !1 : (t.dispatch({ effects: ct.of(!1) }), !0);
|
|
1652
1652
|
}, gi = (t) => {
|
|
1653
|
-
let e = t.state.field(
|
|
1653
|
+
let e = t.state.field(A, !1);
|
|
1654
1654
|
if (!e)
|
|
1655
1655
|
return !1;
|
|
1656
1656
|
let r = t.state.selection.main, n = e.diagnostics.iter(r.to + 1);
|
|
@@ -1694,8 +1694,8 @@ function Pn(t, e, r) {
|
|
|
1694
1694
|
if (m.preventDefault(), l)
|
|
1695
1695
|
return;
|
|
1696
1696
|
l = !0;
|
|
1697
|
-
let
|
|
1698
|
-
|
|
1697
|
+
let k = ne(t.state.field(A).diagnostics, e);
|
|
1698
|
+
k && i.apply(t, k.from, k.to);
|
|
1699
1699
|
}, { name: c } = i, h = o[s] ? c.indexOf(o[s]) : -1, u = h < 0 ? c : [
|
|
1700
1700
|
c.slice(0, h),
|
|
1701
1701
|
g("u", c.slice(h, h + 1)),
|
|
@@ -1746,7 +1746,7 @@ class We {
|
|
|
1746
1746
|
let { diagnostic: i } = this.items[this.selectedIndex], s = In(i.actions);
|
|
1747
1747
|
for (let l = 0; l < s.length; l++)
|
|
1748
1748
|
if (s[l].toUpperCase().charCodeAt(0) == o.keyCode) {
|
|
1749
|
-
let a = ne(this.view.state.field(
|
|
1749
|
+
let a = ne(this.view.state.field(A).diagnostics, i);
|
|
1750
1750
|
a && i.actions[l].apply(e, a.from, a.to);
|
|
1751
1751
|
}
|
|
1752
1752
|
} else
|
|
@@ -1770,7 +1770,7 @@ class We {
|
|
|
1770
1770
|
}, "×")), this.update();
|
|
1771
1771
|
}
|
|
1772
1772
|
get selectedIndex() {
|
|
1773
|
-
let e = this.view.state.field(
|
|
1773
|
+
let e = this.view.state.field(A).selected;
|
|
1774
1774
|
if (!e)
|
|
1775
1775
|
return -1;
|
|
1776
1776
|
for (let r = 0; r < this.items.length; r++)
|
|
@@ -1779,7 +1779,7 @@ class We {
|
|
|
1779
1779
|
return -1;
|
|
1780
1780
|
}
|
|
1781
1781
|
update() {
|
|
1782
|
-
let { diagnostics: e, selected: r } = this.view.state.field(
|
|
1782
|
+
let { diagnostics: e, selected: r } = this.view.state.field(A), n = 0, o = !1, i = null;
|
|
1783
1783
|
for (e.between(0, this.view.state.doc.length, (s, l, { spec: a }) => {
|
|
1784
1784
|
let c = -1, h;
|
|
1785
1785
|
for (let u = n; u < this.items.length; u++)
|
|
@@ -1822,7 +1822,7 @@ class We {
|
|
|
1822
1822
|
moveSelection(e) {
|
|
1823
1823
|
if (this.selectedIndex < 0)
|
|
1824
1824
|
return;
|
|
1825
|
-
let r = this.view.state.field(
|
|
1825
|
+
let r = this.view.state.field(A), n = ne(r.diagnostics, this.items[e].diagnostic);
|
|
1826
1826
|
n && this.view.dispatch({
|
|
1827
1827
|
selection: { anchor: n.from, head: n.to },
|
|
1828
1828
|
scrollIntoView: !0,
|
|
@@ -1930,10 +1930,10 @@ const ki = /* @__PURE__ */ p.baseTheme({
|
|
|
1930
1930
|
}
|
|
1931
1931
|
}
|
|
1932
1932
|
}), bi = [
|
|
1933
|
-
|
|
1934
|
-
/* @__PURE__ */ p.decorations.compute([
|
|
1935
|
-
let { selected: e, panel: r } = t.field(
|
|
1936
|
-
return !e || !r || e.from == e.to ?
|
|
1933
|
+
A,
|
|
1934
|
+
/* @__PURE__ */ p.decorations.compute([A], (t) => {
|
|
1935
|
+
let { selected: e, panel: r } = t.field(A);
|
|
1936
|
+
return !e || !r || e.from == e.to ? x.none : x.set([
|
|
1937
1937
|
ui.range(e.from, e.to)
|
|
1938
1938
|
]);
|
|
1939
1939
|
}),
|
|
@@ -1945,13 +1945,13 @@ var vt = function(e) {
|
|
|
1945
1945
|
var {
|
|
1946
1946
|
crosshairCursor: r = !1
|
|
1947
1947
|
} = e, n = [];
|
|
1948
|
-
e.closeBracketsKeymap !== !1 && (n = n.concat(ir)), e.defaultKeymap !== !1 && (n = n.concat(Oo)), e.searchKeymap !== !1 && (n = n.concat(oi)), e.historyKeymap !== !1 && (n = n.concat(
|
|
1948
|
+
e.closeBracketsKeymap !== !1 && (n = n.concat(ir)), e.defaultKeymap !== !1 && (n = n.concat(Oo)), e.searchKeymap !== !1 && (n = n.concat(oi)), e.historyKeymap !== !1 && (n = n.concat(Ur)), e.foldKeymap !== !1 && (n = n.concat(sr)), e.completionKeymap !== !1 && (n = n.concat(lr)), e.lintKeymap !== !1 && (n = n.concat(pi));
|
|
1949
1949
|
var o = [];
|
|
1950
1950
|
return e.lineNumbers !== !1 && o.push(ar()), e.highlightActiveLineGutter !== !1 && o.push(cr()), e.highlightSpecialChars !== !1 && o.push(hr()), e.history !== !1 && o.push(Ir()), e.foldGutter !== !1 && o.push(ur()), e.drawSelection !== !1 && o.push(fr()), e.dropCursor !== !1 && o.push(dr()), e.allowMultipleSelections !== !1 && o.push(he.allowMultipleSelections.of(!0)), e.indentOnInput !== !1 && o.push(mr()), e.syntaxHighlighting !== !1 && o.push(Nt(Sr, {
|
|
1951
1951
|
fallback: !0
|
|
1952
1952
|
})), e.bracketMatching !== !1 && o.push(gr()), e.closeBrackets !== !1 && o.push(pr()), e.autocompletion !== !1 && o.push(yr()), e.rectangularSelection !== !1 && o.push(xr()), r !== !1 && o.push(kr()), e.highlightActiveLine !== !1 && o.push(br()), e.highlightSelectionMatches !== !1 && o.push(qo()), e.tabSize && typeof e.tabSize == "number" && o.push(Pt.of(" ".repeat(e.tabSize))), o.concat([qt.of(n.flat())]).filter(Boolean);
|
|
1953
1953
|
};
|
|
1954
|
-
const Si = "#e5c07b", At = "#e06c75", Ci = "#56b6c2", vi = "#ffffff", be = "#abb2bf", Ze = "#7d8799", Ai = "#61afef", Mi = "#98c379", Mt = "#d19a66", Li = "#c678dd", Di = "#21252b", Lt = "#2c313a", Dt = "#282c34",
|
|
1954
|
+
const Si = "#e5c07b", At = "#e06c75", Ci = "#56b6c2", vi = "#ffffff", be = "#abb2bf", Ze = "#7d8799", Ai = "#61afef", Mi = "#98c379", Mt = "#d19a66", Li = "#c678dd", Di = "#21252b", Lt = "#2c313a", Dt = "#282c34", Ue = "#353a42", Bi = "#3E4451", Bt = "#528bff", Ei = /* @__PURE__ */ p.theme({
|
|
1955
1955
|
"&": {
|
|
1956
1956
|
color: be,
|
|
1957
1957
|
backgroundColor: Dt
|
|
@@ -1991,15 +1991,15 @@ const Si = "#e5c07b", At = "#e06c75", Ci = "#56b6c2", vi = "#ffffff", be = "#abb
|
|
|
1991
1991
|
},
|
|
1992
1992
|
".cm-tooltip": {
|
|
1993
1993
|
border: "none",
|
|
1994
|
-
backgroundColor:
|
|
1994
|
+
backgroundColor: Ue
|
|
1995
1995
|
},
|
|
1996
1996
|
".cm-tooltip .cm-tooltip-arrow:before": {
|
|
1997
1997
|
borderTopColor: "transparent",
|
|
1998
1998
|
borderBottomColor: "transparent"
|
|
1999
1999
|
},
|
|
2000
2000
|
".cm-tooltip .cm-tooltip-arrow:after": {
|
|
2001
|
-
borderTopColor:
|
|
2002
|
-
borderBottomColor:
|
|
2001
|
+
borderTopColor: Ue,
|
|
2002
|
+
borderBottomColor: Ue
|
|
2003
2003
|
},
|
|
2004
2004
|
".cm-tooltip-autocomplete": {
|
|
2005
2005
|
"& > ul > li[aria-selected]": {
|
|
@@ -2133,90 +2133,90 @@ function Wi(t) {
|
|
|
2133
2133
|
height: h = null,
|
|
2134
2134
|
minHeight: u = null,
|
|
2135
2135
|
maxHeight: m = null,
|
|
2136
|
-
width:
|
|
2137
|
-
minWidth:
|
|
2138
|
-
maxWidth:
|
|
2136
|
+
width: k = null,
|
|
2137
|
+
minWidth: S = null,
|
|
2138
|
+
maxWidth: B = null,
|
|
2139
2139
|
placeholder: $ = "",
|
|
2140
|
-
editable:
|
|
2141
|
-
readOnly:
|
|
2142
|
-
indentWithTab:
|
|
2143
|
-
basicSetup:
|
|
2140
|
+
editable: G = !0,
|
|
2141
|
+
readOnly: V = !1,
|
|
2142
|
+
indentWithTab: K = !0,
|
|
2143
|
+
basicSetup: H = !0,
|
|
2144
2144
|
root: ie,
|
|
2145
2145
|
initialState: U
|
|
2146
|
-
} = t, [
|
|
2146
|
+
} = t, [W, E] = ke(), [y, P] = ke(), [J, j] = ke(), Fe = p.theme({
|
|
2147
2147
|
"&": {
|
|
2148
2148
|
height: h,
|
|
2149
2149
|
minHeight: u,
|
|
2150
2150
|
maxHeight: m,
|
|
2151
|
-
width:
|
|
2152
|
-
minWidth:
|
|
2153
|
-
maxWidth:
|
|
2151
|
+
width: k,
|
|
2152
|
+
minWidth: S,
|
|
2153
|
+
maxWidth: B
|
|
2154
2154
|
},
|
|
2155
2155
|
"& .cm-scroller": {
|
|
2156
2156
|
height: "100% !important"
|
|
2157
2157
|
}
|
|
2158
|
-
}), Ne = p.updateListener.of((
|
|
2159
|
-
if (
|
|
2158
|
+
}), Ne = p.updateListener.of((w) => {
|
|
2159
|
+
if (w.docChanged && typeof n == "function" && // Fix echoing of the remote changes:
|
|
2160
2160
|
// If transaction is market as remote we don't have to call `onChange` handler again
|
|
2161
|
-
!
|
|
2162
|
-
var le =
|
|
2163
|
-
n(me,
|
|
2161
|
+
!w.transactions.some((Nn) => Nn.annotation(Et))) {
|
|
2162
|
+
var le = w.state.doc, me = le.toString();
|
|
2163
|
+
n(me, w);
|
|
2164
2164
|
}
|
|
2165
|
-
o && o(Ii(
|
|
2165
|
+
o && o(Ii(w));
|
|
2166
2166
|
}), Fn = Oi({
|
|
2167
2167
|
theme: c,
|
|
2168
|
-
editable:
|
|
2169
|
-
readOnly:
|
|
2168
|
+
editable: G,
|
|
2169
|
+
readOnly: V,
|
|
2170
2170
|
placeholder: $,
|
|
2171
|
-
indentWithTab:
|
|
2172
|
-
basicSetup:
|
|
2171
|
+
indentWithTab: K,
|
|
2172
|
+
basicSetup: H
|
|
2173
2173
|
}), se = [Ne, Fe, ...Fn];
|
|
2174
|
-
return s && typeof s == "function" && se.push(p.updateListener.of(s)), se = se.concat(l),
|
|
2175
|
-
if (
|
|
2176
|
-
var
|
|
2174
|
+
return s && typeof s == "function" && se.push(p.updateListener.of(s)), se = se.concat(l), N(() => {
|
|
2175
|
+
if (W && !J) {
|
|
2176
|
+
var w = {
|
|
2177
2177
|
doc: e,
|
|
2178
2178
|
selection: r,
|
|
2179
2179
|
extensions: se
|
|
2180
|
-
}, le = U ? he.fromJSON(U.json,
|
|
2181
|
-
if (j(le), !
|
|
2180
|
+
}, le = U ? he.fromJSON(U.json, w, U.fields) : he.create(w);
|
|
2181
|
+
if (j(le), !y) {
|
|
2182
2182
|
var me = new p({
|
|
2183
2183
|
state: le,
|
|
2184
|
-
parent:
|
|
2184
|
+
parent: W,
|
|
2185
2185
|
root: ie
|
|
2186
2186
|
});
|
|
2187
2187
|
P(me), i && i(me, le);
|
|
2188
2188
|
}
|
|
2189
2189
|
}
|
|
2190
2190
|
return () => {
|
|
2191
|
-
|
|
2191
|
+
y && (j(void 0), P(void 0));
|
|
2192
2192
|
};
|
|
2193
|
-
}, [
|
|
2194
|
-
|
|
2195
|
-
}, [
|
|
2196
|
-
a &&
|
|
2197
|
-
}, [a,
|
|
2198
|
-
|
|
2199
|
-
effects:
|
|
2193
|
+
}, [W, J]), N(() => E(t.container), [t.container]), N(() => () => {
|
|
2194
|
+
y && (y.destroy(), P(void 0));
|
|
2195
|
+
}, [y]), N(() => {
|
|
2196
|
+
a && y && y.focus();
|
|
2197
|
+
}, [a, y]), N(() => {
|
|
2198
|
+
y && y.dispatch({
|
|
2199
|
+
effects: R.reconfigure.of(se)
|
|
2200
2200
|
});
|
|
2201
|
-
}, [c, l, h, u, m,
|
|
2201
|
+
}, [c, l, h, u, m, k, S, B, $, G, V, K, H, n, s]), N(() => {
|
|
2202
2202
|
if (e !== void 0) {
|
|
2203
|
-
var
|
|
2204
|
-
|
|
2203
|
+
var w = y ? y.state.doc.toString() : "";
|
|
2204
|
+
y && e !== w && y.dispatch({
|
|
2205
2205
|
changes: {
|
|
2206
2206
|
from: 0,
|
|
2207
|
-
to:
|
|
2207
|
+
to: w.length,
|
|
2208
2208
|
insert: e || ""
|
|
2209
2209
|
},
|
|
2210
2210
|
annotations: [Et.of(!0)]
|
|
2211
2211
|
});
|
|
2212
2212
|
}
|
|
2213
|
-
}, [e,
|
|
2214
|
-
state:
|
|
2213
|
+
}, [e, y]), {
|
|
2214
|
+
state: J,
|
|
2215
2215
|
setState: j,
|
|
2216
|
-
view:
|
|
2216
|
+
view: y,
|
|
2217
2217
|
setView: P,
|
|
2218
|
-
container:
|
|
2219
|
-
setContainer:
|
|
2218
|
+
container: W,
|
|
2219
|
+
setContainer: E
|
|
2220
2220
|
};
|
|
2221
2221
|
}
|
|
2222
2222
|
var Fi = ["className", "value", "selection", "extensions", "onChange", "onStatistics", "onCreateEditor", "onUpdate", "autoFocus", "theme", "height", "minHeight", "maxHeight", "width", "minWidth", "maxWidth", "basicSetup", "placeholder", "indentWithTab", "editable", "readOnly", "root", "initialState"], Wn = /* @__PURE__ */ wt((t, e) => {
|
|
@@ -2232,37 +2232,37 @@ var Fi = ["className", "value", "selection", "extensions", "onChange", "onStatis
|
|
|
2232
2232
|
autoFocus: h,
|
|
2233
2233
|
theme: u = "light",
|
|
2234
2234
|
height: m,
|
|
2235
|
-
minHeight:
|
|
2236
|
-
maxHeight:
|
|
2237
|
-
width:
|
|
2235
|
+
minHeight: k,
|
|
2236
|
+
maxHeight: S,
|
|
2237
|
+
width: B,
|
|
2238
2238
|
minWidth: $,
|
|
2239
|
-
maxWidth:
|
|
2240
|
-
basicSetup:
|
|
2241
|
-
placeholder:
|
|
2242
|
-
indentWithTab:
|
|
2239
|
+
maxWidth: G,
|
|
2240
|
+
basicSetup: V,
|
|
2241
|
+
placeholder: K,
|
|
2242
|
+
indentWithTab: H,
|
|
2243
2243
|
editable: ie,
|
|
2244
2244
|
readOnly: U,
|
|
2245
|
-
root:
|
|
2246
|
-
initialState:
|
|
2247
|
-
} = t,
|
|
2248
|
-
state:
|
|
2245
|
+
root: W,
|
|
2246
|
+
initialState: E
|
|
2247
|
+
} = t, y = qn(t, Fi), P = Rt(null), {
|
|
2248
|
+
state: J,
|
|
2249
2249
|
view: j,
|
|
2250
2250
|
container: Fe
|
|
2251
2251
|
} = Wi({
|
|
2252
2252
|
container: P.current,
|
|
2253
|
-
root:
|
|
2253
|
+
root: W,
|
|
2254
2254
|
value: n,
|
|
2255
2255
|
autoFocus: h,
|
|
2256
2256
|
theme: u,
|
|
2257
2257
|
height: m,
|
|
2258
|
-
minHeight:
|
|
2259
|
-
maxHeight:
|
|
2260
|
-
width:
|
|
2258
|
+
minHeight: k,
|
|
2259
|
+
maxHeight: S,
|
|
2260
|
+
width: B,
|
|
2261
2261
|
minWidth: $,
|
|
2262
|
-
maxWidth:
|
|
2263
|
-
basicSetup:
|
|
2264
|
-
placeholder:
|
|
2265
|
-
indentWithTab:
|
|
2262
|
+
maxWidth: G,
|
|
2263
|
+
basicSetup: V,
|
|
2264
|
+
placeholder: K,
|
|
2265
|
+
indentWithTab: H,
|
|
2266
2266
|
editable: ie,
|
|
2267
2267
|
readOnly: U,
|
|
2268
2268
|
selection: o,
|
|
@@ -2271,29 +2271,33 @@ var Fi = ["className", "value", "selection", "extensions", "onChange", "onStatis
|
|
|
2271
2271
|
onCreateEditor: a,
|
|
2272
2272
|
onUpdate: c,
|
|
2273
2273
|
extensions: i,
|
|
2274
|
-
initialState:
|
|
2274
|
+
initialState: E
|
|
2275
2275
|
});
|
|
2276
|
-
if (
|
|
2276
|
+
if (_n(e, () => ({
|
|
2277
2277
|
editor: P.current,
|
|
2278
|
-
state:
|
|
2278
|
+
state: J,
|
|
2279
2279
|
view: j
|
|
2280
|
-
}), [P, Fe,
|
|
2280
|
+
}), [P, Fe, J, j]), typeof n != "string")
|
|
2281
2281
|
throw new Error("value must be typeof string but got " + typeof n);
|
|
2282
2282
|
var Ne = typeof u == "string" ? "cm-theme-" + u : "cm-theme";
|
|
2283
|
-
return /* @__PURE__ */
|
|
2283
|
+
return /* @__PURE__ */ F.jsx("div", Vn({
|
|
2284
2284
|
ref: P,
|
|
2285
2285
|
className: "" + Ne + (r ? " " + r : "")
|
|
2286
|
-
},
|
|
2286
|
+
}, y));
|
|
2287
2287
|
});
|
|
2288
2288
|
Wn.displayName = "CodeMirror";
|
|
2289
|
-
const Ni =
|
|
2290
|
-
"&
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
"&
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2289
|
+
const Ni = [
|
|
2290
|
+
"[&_.cm-editor]:bg-transparent",
|
|
2291
|
+
"[&_.cm-editor]:border-transparent",
|
|
2292
|
+
"[&_.cm-scroller]:font-mono",
|
|
2293
|
+
"[&_.cm-scroller]:border-transparent",
|
|
2294
|
+
"[&_.cm-activeLine]:bg-transparent",
|
|
2295
|
+
"[&_.cm-activeLineGutter]:bg-transparent",
|
|
2296
|
+
"[&_.cm-gutters]:bg-grey-75 dark:[&_.cm-gutters]:bg-grey-950",
|
|
2297
|
+
"[&_.cm-gutters]:text-grey-600 dark:[&_.cm-gutters]:text-grey-500",
|
|
2298
|
+
"[&_.cm-gutters]:border-grey-500 dark:[&_.cm-gutters]:border-grey-800",
|
|
2299
|
+
"[&_.cm-cursor]:border-grey-900 dark:[&_.cm-cursor]:border-grey-75"
|
|
2300
|
+
].join(" "), Vi = wt(function({
|
|
2297
2301
|
title: e,
|
|
2298
2302
|
value: r,
|
|
2299
2303
|
height: n = "200px",
|
|
@@ -2304,52 +2308,54 @@ const Ni = p.theme({
|
|
|
2304
2308
|
onChange: a,
|
|
2305
2309
|
onFocus: c,
|
|
2306
2310
|
onBlur: h,
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2311
|
+
className: u,
|
|
2312
|
+
...m
|
|
2313
|
+
}, k) {
|
|
2314
|
+
const S = Hn(), B = Rt(null), [$, G] = ke(100), [V, K] = Un.useState(null), { setFocusState: H } = zn(), ie = (E) => {
|
|
2315
|
+
c == null || c(E), H(!0);
|
|
2316
|
+
}, U = (E) => {
|
|
2317
|
+
h == null || h(E), H(!1);
|
|
2313
2318
|
};
|
|
2314
|
-
|
|
2315
|
-
Promise.all(l).then(
|
|
2316
|
-
}, [l]),
|
|
2317
|
-
const
|
|
2318
|
-
|
|
2319
|
+
N(() => {
|
|
2320
|
+
Promise.all(l).then(K);
|
|
2321
|
+
}, [l]), N(() => {
|
|
2322
|
+
const E = new ResizeObserver(([y]) => {
|
|
2323
|
+
G(y.contentRect.width);
|
|
2319
2324
|
});
|
|
2320
|
-
return
|
|
2325
|
+
return E.observe(B.current), () => E.disconnect();
|
|
2321
2326
|
}, []);
|
|
2322
|
-
let
|
|
2327
|
+
let W = $n(
|
|
2323
2328
|
"peer order-2 w-full max-w-full overflow-hidden rounded-sm border",
|
|
2324
2329
|
s ? "bg-transparent" : "bg-grey-75",
|
|
2325
|
-
o ? "border-red" : "border-grey-500
|
|
2330
|
+
o ? "border-red" : "border-grey-500 dark:border-grey-800",
|
|
2326
2331
|
e && "mt-2",
|
|
2327
|
-
n === "full" && "h-full"
|
|
2332
|
+
n === "full" && "h-full",
|
|
2333
|
+
Ni,
|
|
2334
|
+
u
|
|
2328
2335
|
);
|
|
2329
|
-
return /* @__PURE__ */
|
|
2330
|
-
/* @__PURE__ */
|
|
2331
|
-
V && /* @__PURE__ */
|
|
2332
|
-
/* @__PURE__ */
|
|
2336
|
+
return /* @__PURE__ */ F.jsxs(F.Fragment, { children: [
|
|
2337
|
+
/* @__PURE__ */ F.jsx("div", { ref: B }),
|
|
2338
|
+
V && /* @__PURE__ */ F.jsxs("div", { className: n === "full" ? "h-full" : "", style: { width: $ }, children: [
|
|
2339
|
+
/* @__PURE__ */ F.jsx(
|
|
2333
2340
|
Wn,
|
|
2334
2341
|
{
|
|
2335
|
-
ref:
|
|
2336
|
-
className:
|
|
2342
|
+
ref: k,
|
|
2343
|
+
className: W,
|
|
2337
2344
|
extensions: V,
|
|
2338
2345
|
height: n === "full" ? "100%" : n,
|
|
2339
|
-
theme: Ni,
|
|
2340
2346
|
value: r,
|
|
2341
|
-
onBlur:
|
|
2347
|
+
onBlur: U,
|
|
2342
2348
|
onChange: a,
|
|
2343
|
-
onFocus:
|
|
2344
|
-
...
|
|
2349
|
+
onFocus: ie,
|
|
2350
|
+
...m
|
|
2345
2351
|
}
|
|
2346
2352
|
),
|
|
2347
|
-
e && /* @__PURE__ */
|
|
2348
|
-
i && /* @__PURE__ */
|
|
2353
|
+
e && /* @__PURE__ */ F.jsx(Gn, { className: "order-1 !text-grey-700 peer-focus:!text-black", htmlFor: S, useLabelTag: !0, children: e }),
|
|
2354
|
+
i && /* @__PURE__ */ F.jsx(Kn, { className: "order-3", color: o ? "red" : "", children: i })
|
|
2349
2355
|
] })
|
|
2350
2356
|
] });
|
|
2351
2357
|
});
|
|
2352
2358
|
export {
|
|
2353
|
-
|
|
2359
|
+
Vi as default
|
|
2354
2360
|
};
|
|
2355
|
-
//# sourceMappingURL=CodeEditorView-
|
|
2361
|
+
//# sourceMappingURL=CodeEditorView-0b0348c8.mjs.map
|