ghost 5.68.0 → 5.69.1
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.69.1.tgz +0 -0
- package/components/tryghost-adapter-cache-redis-5.69.1.tgz +0 -0
- package/components/tryghost-adapter-manager-5.69.1.tgz +0 -0
- package/components/tryghost-announcement-bar-settings-5.69.1.tgz +0 -0
- package/components/{tryghost-api-framework-5.68.0.tgz → tryghost-api-framework-5.69.1.tgz} +0 -0
- package/components/tryghost-api-version-compatibility-service-5.69.1.tgz +0 -0
- package/components/tryghost-audience-feedback-5.69.1.tgz +0 -0
- package/components/tryghost-bookshelf-repository-5.69.1.tgz +0 -0
- package/components/tryghost-bootstrap-socket-5.69.1.tgz +0 -0
- package/components/tryghost-collections-5.69.1.tgz +0 -0
- package/components/tryghost-constants-5.69.1.tgz +0 -0
- package/components/tryghost-custom-theme-settings-service-5.69.1.tgz +0 -0
- package/components/{tryghost-data-generator-5.68.0.tgz → tryghost-data-generator-5.69.1.tgz} +0 -0
- package/components/tryghost-domain-events-5.69.1.tgz +0 -0
- package/components/tryghost-donations-5.69.1.tgz +0 -0
- package/components/tryghost-dynamic-routing-events-5.69.1.tgz +0 -0
- package/components/tryghost-email-analytics-provider-mailgun-5.69.1.tgz +0 -0
- package/components/tryghost-email-analytics-service-5.69.1.tgz +0 -0
- package/components/tryghost-email-content-generator-5.69.1.tgz +0 -0
- package/components/tryghost-email-events-5.69.1.tgz +0 -0
- package/components/{tryghost-email-service-5.68.0.tgz → tryghost-email-service-5.69.1.tgz} +0 -0
- package/components/tryghost-email-suppression-list-5.69.1.tgz +0 -0
- package/components/tryghost-event-aware-cache-wrapper-5.69.1.tgz +0 -0
- package/components/tryghost-express-dynamic-redirects-5.69.1.tgz +0 -0
- package/components/tryghost-external-media-inliner-5.69.1.tgz +0 -0
- package/components/tryghost-extract-api-key-5.69.1.tgz +0 -0
- package/components/tryghost-html-to-plaintext-5.69.1.tgz +0 -0
- package/components/tryghost-i18n-5.69.1.tgz +0 -0
- package/components/tryghost-importer-handler-content-files-5.69.1.tgz +0 -0
- package/components/tryghost-importer-revue-5.69.1.tgz +0 -0
- package/components/tryghost-in-memory-repository-5.69.1.tgz +0 -0
- package/components/tryghost-job-manager-5.69.1.tgz +0 -0
- package/components/tryghost-link-redirects-5.69.1.tgz +0 -0
- package/components/tryghost-link-replacer-5.69.1.tgz +0 -0
- package/components/tryghost-link-tracking-5.69.1.tgz +0 -0
- package/components/tryghost-magic-link-5.69.1.tgz +0 -0
- package/components/tryghost-mail-events-5.69.1.tgz +0 -0
- package/components/tryghost-mailgun-client-5.69.1.tgz +0 -0
- package/components/tryghost-member-attribution-5.69.1.tgz +0 -0
- package/components/tryghost-member-events-5.69.1.tgz +0 -0
- package/components/{tryghost-members-api-5.68.0.tgz → tryghost-members-api-5.69.1.tgz} +0 -0
- package/components/tryghost-members-csv-5.69.1.tgz +0 -0
- package/components/tryghost-members-events-service-5.69.1.tgz +0 -0
- package/components/{tryghost-members-importer-5.68.0.tgz → tryghost-members-importer-5.69.1.tgz} +0 -0
- package/components/tryghost-members-offers-5.69.1.tgz +0 -0
- package/components/tryghost-members-payments-5.69.1.tgz +0 -0
- package/components/tryghost-members-ssr-5.69.1.tgz +0 -0
- package/components/tryghost-members-stripe-service-5.69.1.tgz +0 -0
- package/components/tryghost-mentions-email-report-5.69.1.tgz +0 -0
- package/components/{tryghost-milestones-5.68.0.tgz → tryghost-milestones-5.69.1.tgz} +0 -0
- package/components/tryghost-minifier-5.69.1.tgz +0 -0
- package/components/tryghost-model-to-domain-event-interceptor-5.69.1.tgz +0 -0
- package/components/tryghost-mw-api-version-mismatch-5.69.1.tgz +0 -0
- package/components/tryghost-mw-cache-control-5.69.1.tgz +0 -0
- package/components/tryghost-mw-error-handler-5.69.1.tgz +0 -0
- package/components/tryghost-mw-session-from-token-5.69.1.tgz +0 -0
- package/components/tryghost-mw-update-user-last-seen-5.69.1.tgz +0 -0
- package/components/tryghost-mw-version-match-5.69.1.tgz +0 -0
- package/components/tryghost-mw-vhost-5.69.1.tgz +0 -0
- package/components/tryghost-nql-filter-expansions-5.69.1.tgz +0 -0
- package/components/tryghost-oembed-service-5.69.1.tgz +0 -0
- package/components/tryghost-package-json-5.69.1.tgz +0 -0
- package/components/tryghost-post-events-5.69.1.tgz +0 -0
- package/components/tryghost-post-revisions-5.69.1.tgz +0 -0
- package/components/tryghost-posts-service-5.69.1.tgz +0 -0
- package/components/tryghost-recommendations-5.69.1.tgz +0 -0
- package/components/tryghost-referrers-5.69.1.tgz +0 -0
- package/components/tryghost-security-5.69.1.tgz +0 -0
- package/components/tryghost-session-service-5.69.1.tgz +0 -0
- package/components/tryghost-settings-path-manager-5.69.1.tgz +0 -0
- package/components/tryghost-slack-notifications-5.69.1.tgz +0 -0
- package/components/tryghost-staff-service-5.69.1.tgz +0 -0
- package/components/tryghost-stats-service-5.69.1.tgz +0 -0
- package/components/{tryghost-tiers-5.68.0.tgz → tryghost-tiers-5.69.1.tgz} +0 -0
- package/components/tryghost-update-check-service-5.69.1.tgz +0 -0
- package/components/tryghost-verification-trigger-5.69.1.tgz +0 -0
- package/components/tryghost-version-notifications-data-service-5.69.1.tgz +0 -0
- package/components/tryghost-webmentions-5.69.1.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-73bd35b1.mjs → CodeEditorView-79c17af2.mjs} +156 -156
- package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-b8520e93.mjs → index-e3c2bcd4.mjs} +5065 -4969
- package/core/built/admin/assets/admin-x-settings/{limit-service-cc4a15e2.mjs → limit-service-d41dd8a7.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{modals-fc330da9.mjs → modals-e8170b93.mjs} +10591 -10266
- package/core/built/admin/assets/{chunk.143.5770521695d411ee098e.js → chunk.143.5515dcb02de04c657261.js} +11 -11
- package/core/built/admin/assets/{chunk.178.717d4af1747380378833.js → chunk.178.f75e8567214e853052de.js} +4 -4
- package/core/built/admin/assets/{chunk.940.f55d8073f4fd2738aa11.js → chunk.649.1ce887e24e7688045296.js} +7529 -8877
- package/core/built/admin/assets/{chunk.940.f55d8073f4fd2738aa11.js.LICENSE.txt → chunk.649.1ce887e24e7688045296.js.LICENSE.txt} +0 -23
- package/core/built/admin/assets/{ghost-fb0f793a8d8d9df304bc501fbcad01e4.js → ghost-831787c0c608f25507fb45807b60374c.js} +344 -575
- package/core/built/admin/assets/ghost-dark-074a63e61346f3533e60ceff7253f07d.css +1 -0
- package/core/built/admin/assets/ghost-de20b1dc1f76d9dd196738a479610681.css +1 -0
- package/core/built/admin/assets/koenig-lexical/koenig-lexical.js +14440 -14288
- package/core/built/admin/assets/koenig-lexical/koenig-lexical.umd.js +118 -118
- package/core/built/admin/assets/{vendor-3e6947aa681f0fb82b193090e520dc73.css → vendor-0ede59da8efb5e28fa929557f7ff7154.css} +0 -7
- package/core/built/admin/assets/{vendor-71d23939faaa5d1478ead73d917111b9.js → vendor-d4aa86641c6080ce3bc58e6d54252774.js} +3865 -6979
- package/core/built/admin/index.html +7 -7
- package/core/frontend/helpers/img_url.js +6 -6
- package/core/frontend/helpers/readable_url.js +32 -0
- package/core/frontend/helpers/tpl/recommendations.hbs +3 -2
- package/core/server/api/endpoints/utils/serializers/input/pages.js +1 -1
- package/core/server/api/endpoints/utils/serializers/input/posts.js +1 -1
- package/core/server/data/migrations/utils/schema.js +31 -2
- package/core/server/data/migrations/versions/5.69/2023-10-06-15-06-00-rename-recommendations-reason-to-description.js +3 -0
- package/core/server/data/schema/commands.js +20 -0
- package/core/server/data/schema/schema.js +1 -1
- package/core/server/models/member.js +4 -2
- package/core/server/services/lexical-multiplayer/service.js +1 -1
- package/core/server/services/newsletters/NewslettersService.js +2 -2
- package/core/server/services/oembed/TwitterOEmbedProvider.js +5 -1
- package/core/server/services/settings/SettingsBREADService.js +1 -5
- package/core/shared/labs.js +0 -1
- package/package.json +158 -160
- package/yarn.lock +330 -450
- package/components/tryghost-adapter-cache-memory-ttl-5.68.0.tgz +0 -0
- package/components/tryghost-adapter-cache-redis-5.68.0.tgz +0 -0
- package/components/tryghost-adapter-manager-5.68.0.tgz +0 -0
- package/components/tryghost-announcement-bar-settings-5.68.0.tgz +0 -0
- package/components/tryghost-api-version-compatibility-service-5.68.0.tgz +0 -0
- package/components/tryghost-audience-feedback-5.68.0.tgz +0 -0
- package/components/tryghost-bookshelf-repository-5.68.0.tgz +0 -0
- package/components/tryghost-bootstrap-socket-5.68.0.tgz +0 -0
- package/components/tryghost-collections-5.68.0.tgz +0 -0
- package/components/tryghost-constants-5.68.0.tgz +0 -0
- package/components/tryghost-custom-theme-settings-service-5.68.0.tgz +0 -0
- package/components/tryghost-domain-events-5.68.0.tgz +0 -0
- package/components/tryghost-donations-5.68.0.tgz +0 -0
- package/components/tryghost-dynamic-routing-events-5.68.0.tgz +0 -0
- package/components/tryghost-email-analytics-provider-mailgun-5.68.0.tgz +0 -0
- package/components/tryghost-email-analytics-service-5.68.0.tgz +0 -0
- package/components/tryghost-email-content-generator-5.68.0.tgz +0 -0
- package/components/tryghost-email-events-5.68.0.tgz +0 -0
- package/components/tryghost-email-suppression-list-5.68.0.tgz +0 -0
- package/components/tryghost-event-aware-cache-wrapper-5.68.0.tgz +0 -0
- package/components/tryghost-express-dynamic-redirects-5.68.0.tgz +0 -0
- package/components/tryghost-external-media-inliner-5.68.0.tgz +0 -0
- package/components/tryghost-extract-api-key-5.68.0.tgz +0 -0
- package/components/tryghost-html-to-plaintext-5.68.0.tgz +0 -0
- package/components/tryghost-i18n-5.68.0.tgz +0 -0
- package/components/tryghost-importer-handler-content-files-5.68.0.tgz +0 -0
- package/components/tryghost-importer-revue-5.68.0.tgz +0 -0
- package/components/tryghost-in-memory-repository-5.68.0.tgz +0 -0
- package/components/tryghost-job-manager-5.68.0.tgz +0 -0
- package/components/tryghost-link-redirects-5.68.0.tgz +0 -0
- package/components/tryghost-link-replacer-5.68.0.tgz +0 -0
- package/components/tryghost-link-tracking-5.68.0.tgz +0 -0
- package/components/tryghost-magic-link-5.68.0.tgz +0 -0
- package/components/tryghost-mail-events-5.68.0.tgz +0 -0
- package/components/tryghost-mailgun-client-5.68.0.tgz +0 -0
- package/components/tryghost-member-attribution-5.68.0.tgz +0 -0
- package/components/tryghost-member-events-5.68.0.tgz +0 -0
- package/components/tryghost-members-csv-5.68.0.tgz +0 -0
- package/components/tryghost-members-events-service-5.68.0.tgz +0 -0
- package/components/tryghost-members-offers-5.68.0.tgz +0 -0
- package/components/tryghost-members-payments-5.68.0.tgz +0 -0
- package/components/tryghost-members-ssr-5.68.0.tgz +0 -0
- package/components/tryghost-members-stripe-service-5.68.0.tgz +0 -0
- package/components/tryghost-mentions-email-report-5.68.0.tgz +0 -0
- package/components/tryghost-minifier-5.68.0.tgz +0 -0
- package/components/tryghost-model-to-domain-event-interceptor-5.68.0.tgz +0 -0
- package/components/tryghost-mw-api-version-mismatch-5.68.0.tgz +0 -0
- package/components/tryghost-mw-cache-control-5.68.0.tgz +0 -0
- package/components/tryghost-mw-error-handler-5.68.0.tgz +0 -0
- package/components/tryghost-mw-session-from-token-5.68.0.tgz +0 -0
- package/components/tryghost-mw-update-user-last-seen-5.68.0.tgz +0 -0
- package/components/tryghost-mw-version-match-5.68.0.tgz +0 -0
- package/components/tryghost-mw-vhost-5.68.0.tgz +0 -0
- package/components/tryghost-nql-filter-expansions-5.68.0.tgz +0 -0
- package/components/tryghost-oembed-service-5.68.0.tgz +0 -0
- package/components/tryghost-package-json-5.68.0.tgz +0 -0
- package/components/tryghost-post-events-5.68.0.tgz +0 -0
- package/components/tryghost-post-revisions-5.68.0.tgz +0 -0
- package/components/tryghost-posts-service-5.68.0.tgz +0 -0
- package/components/tryghost-recommendations-5.68.0.tgz +0 -0
- package/components/tryghost-referrers-5.68.0.tgz +0 -0
- package/components/tryghost-security-5.68.0.tgz +0 -0
- package/components/tryghost-session-service-5.68.0.tgz +0 -0
- package/components/tryghost-settings-path-manager-5.68.0.tgz +0 -0
- package/components/tryghost-slack-notifications-5.68.0.tgz +0 -0
- package/components/tryghost-staff-service-5.68.0.tgz +0 -0
- package/components/tryghost-stats-service-5.68.0.tgz +0 -0
- package/components/tryghost-update-check-service-5.68.0.tgz +0 -0
- package/components/tryghost-verification-trigger-5.68.0.tgz +0 -0
- package/components/tryghost-version-notifications-data-service-5.68.0.tgz +0 -0
- package/components/tryghost-webmentions-5.68.0.tgz +0 -0
- package/core/built/admin/assets/ghost-04f331b095bb184b7ee00f43f65466e4.css +0 -1
- package/core/built/admin/assets/ghost-dark-9744221e76ff089f6176ad97379c9599.css +0 -1
- package/core/built/admin/assets/simplemde/simplemde-8f638be9b49c6c5fc95902d6e470c1a3.js +0 -1874
- package/core/cli/record-test.js +0 -30
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { E as p, F as fe, v as Ee, S as we, o as d, w as qe, C as _n, x as jn, y as Tt, z as
|
|
1
|
+
import { e as ke, f as F, b3 as wt, bL as qn, J as Rt, bM as Vn, j as W, bN as Hn, O as Un, C as zn, _ as $n, U as Gn, P as Kn, Q as Jn } from "./index-e3c2bcd4.mjs";
|
|
2
|
+
import { E as p, F as fe, v as Ee, S as we, o as d, w as qe, C as _n, x as jn, y as Tt, z as Ot, A as Se, B as It, G as Pt, H as Wt, J as $e, K as Xe, M as w, O as Z, g as et, b as Ge, Q as Qn, R as ee, V as Ft, U as y, W as Yn, X as Zn, Y as ce, Z as L, _ 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
|
+
Vt,
|
|
21
21
|
0
|
|
22
22
|
/* CommentOption.Toggle */
|
|
23
23
|
), Dr = /* @__PURE__ */ nt(
|
|
24
|
-
(t, e) =>
|
|
24
|
+
(t, e) => Vt(t, e, Er(e)),
|
|
25
25
|
0
|
|
26
26
|
/* CommentOption.Toggle */
|
|
27
27
|
);
|
|
@@ -59,7 +59,7 @@ function Er(t) {
|
|
|
59
59
|
}
|
|
60
60
|
return e;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Vt(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;
|
|
@@ -114,7 +114,7 @@ function wr(t, e, r = e.selection.ranges) {
|
|
|
114
114
|
}
|
|
115
115
|
return null;
|
|
116
116
|
}
|
|
117
|
-
const Ke = /* @__PURE__ */
|
|
117
|
+
const Ke = /* @__PURE__ */ Xe.define(), Rr = /* @__PURE__ */ Xe.define(), Tr = /* @__PURE__ */ fe.define(), Ht = /* @__PURE__ */ fe.define({
|
|
118
118
|
combine(t) {
|
|
119
119
|
return Ee(t, {
|
|
120
120
|
minDepth: 100,
|
|
@@ -127,19 +127,19 @@ const Ke = /* @__PURE__ */ Ze.define(), Rr = /* @__PURE__ */ Ze.define(), Tr = /
|
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
|
-
function
|
|
130
|
+
function Or(t) {
|
|
131
131
|
let e = 0;
|
|
132
132
|
return t.iterChangedRanges((r, n) => e = n), e;
|
|
133
133
|
}
|
|
134
|
-
const
|
|
134
|
+
const Ut = /* @__PURE__ */ we.define({
|
|
135
135
|
create() {
|
|
136
|
-
return
|
|
136
|
+
return O.empty;
|
|
137
137
|
},
|
|
138
138
|
update(t, e) {
|
|
139
|
-
let r = e.state.facet(
|
|
139
|
+
let r = e.state.facet(Ht), n = e.annotation(Ke);
|
|
140
140
|
if (n) {
|
|
141
|
-
let a = e.docChanged ? d.single(
|
|
142
|
-
return c ? u = Ce(u, u.length, r.minDepth, c) : u = Gt(u, e.startState.selection), new
|
|
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 = Gt(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)
|
|
@@ -151,16 +151,16 @@ const zt = /* @__PURE__ */ we.define({
|
|
|
151
151
|
return { done: t.done.map((e) => e.toJSON()), undone: t.undone.map((e) => e.toJSON()) };
|
|
152
152
|
},
|
|
153
153
|
fromJSON(t) {
|
|
154
|
-
return new
|
|
154
|
+
return new O(t.done.map(C.fromJSON), t.undone.map(C.fromJSON));
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
|
-
function
|
|
157
|
+
function Ir(t = {}) {
|
|
158
158
|
return [
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
Ut,
|
|
160
|
+
Ht.of(t),
|
|
161
161
|
p.domEventHandlers({
|
|
162
162
|
beforeinput(e, r) {
|
|
163
|
-
let n = e.inputType == "historyUndo" ?
|
|
163
|
+
let n = e.inputType == "historyUndo" ? zt : e.inputType == "historyRedo" ? Je : 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(Ut, !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 zt = /* @__PURE__ */ Re(0, !1), Je = /* @__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;
|
|
@@ -239,16 +239,16 @@ function Gt(t, e) {
|
|
|
239
239
|
} else
|
|
240
240
|
return [C.selection([e])];
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function Vr(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 Ve(t, e) {
|
|
247
247
|
if (!t.length)
|
|
248
248
|
return t;
|
|
249
249
|
let r = t.length, n = D;
|
|
250
250
|
for (; r; ) {
|
|
251
|
-
let o =
|
|
251
|
+
let o = Hr(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;
|
|
@@ -257,32 +257,32 @@ function He(t, e) {
|
|
|
257
257
|
}
|
|
258
258
|
return n.length ? [C.selection(n)] : D;
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function Hr(t, e, r) {
|
|
261
261
|
let n = $t(t.selectionsAfter.length ? t.selectionsAfter.map((l) => l.map(e)) : D, 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
265
|
return new C(o, w.mapEffects(t.effects, e), s, t.startSelection.map(i), n);
|
|
266
266
|
}
|
|
267
|
-
const
|
|
268
|
-
class
|
|
267
|
+
const Ur = /^(input\.type|delete)($|\.)/;
|
|
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;
|
|
271
271
|
}
|
|
272
272
|
isolate() {
|
|
273
|
-
return this.prevTime ? new
|
|
273
|
+
return this.prevTime ? new O(this.done, this.undone) : this;
|
|
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), $t(e.effects, l.effects), l.mapped, l.startSelection, D)) : s = Ce(s, s.length, o.minDepth, e), new
|
|
277
|
+
return l && l.changes && !l.changes.empty && e.changes && (!n || Ur.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), $t(e.effects, l.effects), l.mapped, l.startSelection, D)) : s = Ce(s, s.length, o.minDepth, e), new O(s, D, r, n);
|
|
279
279
|
}
|
|
280
280
|
addSelection(e, r, n, o) {
|
|
281
281
|
let i = this.done.length ? this.done[this.done.length - 1].selectionsAfter : D;
|
|
282
|
-
return i.length > 0 && r - this.prevTime < o && n == this.prevUserEvent && n && /^select($|\.)/.test(n) && Nr(i[i.length - 1], e) ? this : new
|
|
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(Gt(this.done, e), this.undone, r, n);
|
|
283
283
|
}
|
|
284
284
|
addMapping(e) {
|
|
285
|
-
return new
|
|
285
|
+
return new O(Ve(this.done, e), Ve(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,13 +292,13 @@ class I {
|
|
|
292
292
|
if (n && i.selectionsAfter.length)
|
|
293
293
|
return r.update({
|
|
294
294
|
selection: i.selectionsAfter[i.selectionsAfter.length - 1],
|
|
295
|
-
annotations: Ke.of({ side: e, rest:
|
|
295
|
+
annotations: Ke.of({ side: e, rest: Vr(o) }),
|
|
296
296
|
userEvent: e == 0 ? "select.undo" : "select.redo",
|
|
297
297
|
scrollIntoView: !0
|
|
298
298
|
});
|
|
299
299
|
if (i.changes) {
|
|
300
300
|
let s = o.length == 1 ? D : o.slice(0, o.length - 1);
|
|
301
|
-
return i.mapped && (s =
|
|
301
|
+
return i.mapped && (s = Ve(s, i.mapped)), r.update({
|
|
302
302
|
changes: i.changes,
|
|
303
303
|
selection: i.startSelection,
|
|
304
304
|
effects: i.effects,
|
|
@@ -311,9 +311,9 @@ class I {
|
|
|
311
311
|
return null;
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
-
|
|
315
|
-
const
|
|
316
|
-
{ key: "Mod-z", run:
|
|
314
|
+
O.empty = /* @__PURE__ */ new O(D, D);
|
|
315
|
+
const zr = [
|
|
316
|
+
{ key: "Mod-z", run: zt, preventDefault: !0 },
|
|
317
317
|
{ key: "Mod-y", mac: "Mod-Shift-z", run: Je, preventDefault: !0 },
|
|
318
318
|
{ linux: "Ctrl-Shift-z", run: Je, preventDefault: !0 },
|
|
319
319
|
{ key: "Mod-u", run: Pr, preventDefault: !0 },
|
|
@@ -322,12 +322,12 @@ const Ur = [
|
|
|
322
322
|
function re(t, e) {
|
|
323
323
|
return d.create(t.ranges.map(e), t.mainIndex);
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function I(t, e) {
|
|
326
326
|
return t.update({ selection: e, scrollIntoView: !0, userEvent: "select" });
|
|
327
327
|
}
|
|
328
328
|
function R({ state: t, dispatch: e }, r) {
|
|
329
329
|
let n = re(t.selection, r);
|
|
330
|
-
return n.eq(t.selection) ? !1 : (e(
|
|
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);
|
|
@@ -349,7 +349,7 @@ function Kr(t, e, r) {
|
|
|
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
|
-
function
|
|
352
|
+
function Oe(t, e, r) {
|
|
353
353
|
let n = et(t).resolveInner(e.head), o = r ? Ge.closedBy : Ge.openedBy;
|
|
354
354
|
for (let a = e.head; ; ) {
|
|
355
355
|
let c = r ? n.childAfter(a) : n.childBefore(a);
|
|
@@ -358,9 +358,9 @@ function Ie(t, e, r) {
|
|
|
358
358
|
Kr(t, c, o) ? n = c : a = r ? c.to : c.from;
|
|
359
359
|
}
|
|
360
360
|
let i = n.type.prop(o), s, l;
|
|
361
|
-
return i && (s = r ?
|
|
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 Jr = (t) => R(t, (e) =>
|
|
363
|
+
const Jr = (t) => R(t, (e) => Oe(t.state, e, !S(t))), _r = (t) => R(t, (e) => Oe(t.state, e, S(t)));
|
|
364
364
|
function Qt(t, e) {
|
|
365
365
|
return R(t, (r) => {
|
|
366
366
|
if (!r.empty)
|
|
@@ -369,8 +369,8 @@ function Qt(t, e) {
|
|
|
369
369
|
return n.head != r.head ? n : t.moveToLineBoundary(r, e);
|
|
370
370
|
});
|
|
371
371
|
}
|
|
372
|
-
const
|
|
373
|
-
function
|
|
372
|
+
const Yt = (t) => Qt(t, !1), Zt = (t) => Qt(t, !0);
|
|
373
|
+
function Xt(t) {
|
|
374
374
|
let e = t.scrollDOM.clientHeight < t.scrollDOM.scrollHeight - 2, r = 0, n = 0, o;
|
|
375
375
|
if (e) {
|
|
376
376
|
for (let i of t.state.facet(p.scrollMargins)) {
|
|
@@ -388,7 +388,7 @@ function Zt(t) {
|
|
|
388
388
|
};
|
|
389
389
|
}
|
|
390
390
|
function en(t, e) {
|
|
391
|
-
let r =
|
|
391
|
+
let r = Xt(t), { state: n } = t, o = re(n.selection, (s) => s.empty ? t.moveVertically(s, e, r.height) : Te(s, e));
|
|
392
392
|
if (o.eq(n.selection))
|
|
393
393
|
return !1;
|
|
394
394
|
let i;
|
|
@@ -396,7 +396,7 @@ function en(t, e) {
|
|
|
396
396
|
let s = t.coordsAtPos(n.selection.main.head), l = t.scrollDOM.getBoundingClientRect(), a = l.top + r.marginTop, c = l.bottom - r.marginBottom;
|
|
397
397
|
s && s.top > a && s.bottom < c && (i = p.scrollIntoView(o.main.head, { y: "start", yMargin: s.top - a }));
|
|
398
398
|
}
|
|
399
|
-
return t.dispatch(
|
|
399
|
+
return t.dispatch(I(n, o), { effects: i }), !0;
|
|
400
400
|
}
|
|
401
401
|
const ht = (t) => en(t, !1), _e = (t) => en(t, !0);
|
|
402
402
|
function q(t, e, r) {
|
|
@@ -407,17 +407,17 @@ function q(t, e, r) {
|
|
|
407
407
|
}
|
|
408
408
|
return o;
|
|
409
409
|
}
|
|
410
|
-
const jr = (t) => R(t, (e) => q(t, e, !0)), Qr = (t) => R(t, (e) => q(t, e, !1)),
|
|
410
|
+
const jr = (t) => R(t, (e) => q(t, e, !0)), Qr = (t) => R(t, (e) => q(t, e, !1)), Yr = (t) => R(t, (e) => q(t, e, !S(t))), Zr = (t) => R(t, (e) => q(t, e, S(t))), Xr = (t) => R(t, (e) => d.cursor(t.lineBlockAt(e.head).from, 1)), eo = (t) => R(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
|
-
let s =
|
|
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);
|
|
414
414
|
if (!s || !s.end)
|
|
415
415
|
return i;
|
|
416
416
|
n = !0;
|
|
417
417
|
let l = s.start.from == i.head ? s.end.to : s.end.from;
|
|
418
418
|
return r ? d.range(i.anchor, l) : d.cursor(l);
|
|
419
419
|
});
|
|
420
|
-
return n ? (e(
|
|
420
|
+
return n ? (e(I(t, o)), !0) : !1;
|
|
421
421
|
}
|
|
422
422
|
const no = ({ state: t, dispatch: e }) => to(t, e, !1);
|
|
423
423
|
function B(t, e) {
|
|
@@ -425,7 +425,7 @@ function B(t, e) {
|
|
|
425
425
|
let o = e(n);
|
|
426
426
|
return d.range(n.anchor, o.head, o.goalColumn, o.bidiLevel || void 0);
|
|
427
427
|
});
|
|
428
|
-
return r.eq(t.state.selection) ? !1 : (t.dispatch(
|
|
428
|
+
return r.eq(t.state.selection) ? !1 : (t.dispatch(I(t.state, r)), !0);
|
|
429
429
|
}
|
|
430
430
|
function tn(t, e) {
|
|
431
431
|
return B(t, (r) => t.moveByChar(r, e));
|
|
@@ -434,15 +434,15 @@ const nn = (t) => tn(t, !S(t)), rn = (t) => tn(t, S(t));
|
|
|
434
434
|
function on(t, e) {
|
|
435
435
|
return B(t, (r) => t.moveByGroup(r, e));
|
|
436
436
|
}
|
|
437
|
-
const ro = (t) => on(t, !S(t)), oo = (t) => on(t, S(t)), io = (t) => B(t, (e) =>
|
|
437
|
+
const ro = (t) => on(t, !S(t)), oo = (t) => on(t, S(t)), io = (t) => B(t, (e) => Oe(t.state, e, !S(t))), so = (t) => B(t, (e) => Oe(t.state, e, S(t)));
|
|
438
438
|
function sn(t, e) {
|
|
439
439
|
return B(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 B(t, (r) => t.moveVertically(r, e,
|
|
443
|
+
return B(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) => B(t, (e) => q(t, e, !0)), ao = (t) => B(t, (e) => q(t, e, !1)), co = (t) => B(t, (e) => q(t, e, !S(t))), ho = (t) => B(t, (e) => q(t, e, S(t))), uo = (t) => B(t, (e) => d.cursor(t.lineBlockAt(e.head).from)), fo = (t) => B(t, (e) => d.cursor(t.lineBlockAt(e.head).to)), dt = ({ state: t, dispatch: e }) => (e(
|
|
445
|
+
const ut = (t) => cn(t, !1), ft = (t) => cn(t, !0), lo = (t) => B(t, (e) => q(t, e, !0)), ao = (t) => B(t, (e) => q(t, e, !1)), co = (t) => B(t, (e) => q(t, e, !S(t))), ho = (t) => B(t, (e) => q(t, e, S(t))), uo = (t) => B(t, (e) => d.cursor(t.lineBlockAt(e.head).from)), fo = (t) => B(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 }) => {
|
|
@@ -453,12 +453,12 @@ const ut = (t) => cn(t, !1), ft = (t) => cn(t, !0), lo = (t) => B(t, (e) => q(t,
|
|
|
453
453
|
i = i.parent;
|
|
454
454
|
return d.range(i.to, i.from);
|
|
455
455
|
});
|
|
456
|
-
return e(
|
|
456
|
+
return e(I(t, r)), !0;
|
|
457
457
|
}, yo = ({ state: t, dispatch: e }) => {
|
|
458
458
|
let r = t.selection, n = null;
|
|
459
|
-
return r.ranges.length > 1 ? n = d.create([r.main]) : r.main.empty || (n = d.create([d.cursor(r.main.head)])), n ? (e(
|
|
459
|
+
return r.ranges.length > 1 ? n = d.create([r.main]) : r.main.empty || (n = d.create([d.cursor(r.main.head)])), n ? (e(I(t, n)), !0) : !1;
|
|
460
460
|
};
|
|
461
|
-
function
|
|
461
|
+
function Ie(t, e) {
|
|
462
462
|
if (t.state.readOnly)
|
|
463
463
|
return !1;
|
|
464
464
|
let r = "delete.selection", { state: n } = t, o = n.changeByRange((i) => {
|
|
@@ -484,7 +484,7 @@ function ge(t, e, r) {
|
|
|
484
484
|
});
|
|
485
485
|
return e;
|
|
486
486
|
}
|
|
487
|
-
const hn = (t, e) =>
|
|
487
|
+
const hn = (t, e) => Ie(t, (r) => {
|
|
488
488
|
let { state: n } = t, o = n.doc.lineAt(r), i, s;
|
|
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] == " ")
|
|
@@ -496,7 +496,7 @@ const hn = (t, e) => Oe(t, (r) => {
|
|
|
496
496
|
} else
|
|
497
497
|
s = ee(o.text, r - o.from, e, e) + o.from, s == r && o.number != (e ? n.doc.lines : 1) && (s += e ? 1 : -1);
|
|
498
498
|
return s;
|
|
499
|
-
}), je = (t) => hn(t, !1), un = (t) => hn(t, !0), fn = (t, e) =>
|
|
499
|
+
}), je = (t) => hn(t, !1), un = (t) => hn(t, !0), fn = (t, e) => Ie(t, (r) => {
|
|
500
500
|
let n = r, { state: o } = t, i = o.doc.lineAt(n), s = o.charCategorizer(n);
|
|
501
501
|
for (let l = null; ; ) {
|
|
502
502
|
if (n == (e ? i.to : i.from)) {
|
|
@@ -509,17 +509,17 @@ const hn = (t, e) => Oe(t, (r) => {
|
|
|
509
509
|
(c != " " || n != r) && (l = h), n = a;
|
|
510
510
|
}
|
|
511
511
|
return n;
|
|
512
|
-
}), dn = (t) => fn(t, !1), xo = (t) => fn(t, !0), mn = (t) =>
|
|
512
|
+
}), dn = (t) => fn(t, !1), xo = (t) => fn(t, !0), mn = (t) => Ie(t, (e) => {
|
|
513
513
|
let r = t.lineBlockAt(e).to;
|
|
514
514
|
return e < r ? r : Math.min(t.state.doc.length, e + 1);
|
|
515
|
-
}), ko = (t) =>
|
|
515
|
+
}), ko = (t) => Ie(t, (e) => {
|
|
516
516
|
let r = t.lineBlockAt(e).from;
|
|
517
517
|
return e > r ? r : Math.max(0, e - 1);
|
|
518
518
|
}), bo = ({ state: t, dispatch: e }) => {
|
|
519
519
|
if (t.readOnly)
|
|
520
520
|
return !1;
|
|
521
521
|
let r = t.changeByRange((n) => ({
|
|
522
|
-
changes: { from: n.from, to: n.to, insert:
|
|
522
|
+
changes: { from: n.from, to: n.to, insert: It.of(["", ""]) },
|
|
523
523
|
range: d.cursor(n.from)
|
|
524
524
|
}));
|
|
525
525
|
return e(t.update(r, { scrollIntoView: !0, userEvent: "input" })), !0;
|
|
@@ -604,13 +604,13 @@ function yn(t) {
|
|
|
604
604
|
let n = e.changeByRange((o) => {
|
|
605
605
|
let { from: i, to: s } = o, l = e.doc.lineAt(i), a = !t && i == s && Do(e, i);
|
|
606
606
|
t && (i = s = (s <= l.to ? l : e.doc.lineAt(s)).to);
|
|
607
|
-
let c = new Tt(e, { simulateBreak: i, simulateDoubleBreak: !!a }), h =
|
|
607
|
+
let c = new Tt(e, { simulateBreak: i, simulateDoubleBreak: !!a }), h = Ot(c, i);
|
|
608
608
|
for (h == null && (h = /^\s*/.exec(e.doc.lineAt(i).text)[0].length); s < l.to && /\s/.test(l.text[s - l.from]); )
|
|
609
609
|
s++;
|
|
610
610
|
a ? { from: i, to: s } = a : i > l.from && i < l.from + 100 && !/\S/.test(l.text.slice(0, i)) && (i = l.from);
|
|
611
611
|
let u = ["", Se(e, h)];
|
|
612
612
|
return a && u.push(Se(e, c.lineIndent(l.from, -1))), {
|
|
613
|
-
changes: { from: i, to: s, insert:
|
|
613
|
+
changes: { from: i, to: s, insert: It.of(u) },
|
|
614
614
|
range: d.cursor(i + 1 + u[1].length)
|
|
615
615
|
};
|
|
616
616
|
});
|
|
@@ -639,7 +639,7 @@ const wo = ({ state: t, dispatch: e }) => {
|
|
|
639
639
|
let s = r[i];
|
|
640
640
|
return s ?? -1;
|
|
641
641
|
} }), o = ot(t, (i, s, l) => {
|
|
642
|
-
let a =
|
|
642
|
+
let a = Ot(n, i.from);
|
|
643
643
|
if (a == null)
|
|
644
644
|
return;
|
|
645
645
|
/\S/.test(i.text) || (a = 0);
|
|
@@ -660,9 +660,9 @@ const wo = ({ state: t, dispatch: e }) => {
|
|
|
660
660
|
}), { userEvent: "delete.dedent" })), !0), Ro = [
|
|
661
661
|
{ key: "Ctrl-b", run: Jt, shift: nn, preventDefault: !0 },
|
|
662
662
|
{ key: "Ctrl-f", run: _t, shift: rn },
|
|
663
|
-
{ key: "Ctrl-p", run:
|
|
664
|
-
{ key: "Ctrl-n", run:
|
|
665
|
-
{ key: "Ctrl-a", run:
|
|
663
|
+
{ key: "Ctrl-p", run: Yt, shift: ln },
|
|
664
|
+
{ key: "Ctrl-n", run: Zt, shift: an },
|
|
665
|
+
{ key: "Ctrl-a", run: Xr, shift: uo },
|
|
666
666
|
{ key: "Ctrl-e", run: eo, shift: fo },
|
|
667
667
|
{ key: "Ctrl-d", run: un },
|
|
668
668
|
{ key: "Ctrl-h", run: je },
|
|
@@ -674,14 +674,14 @@ const wo = ({ state: t, dispatch: e }) => {
|
|
|
674
674
|
], To = /* @__PURE__ */ [
|
|
675
675
|
{ key: "ArrowLeft", run: Jt, shift: nn, preventDefault: !0 },
|
|
676
676
|
{ key: "Mod-ArrowLeft", mac: "Alt-ArrowLeft", run: $r, shift: ro, preventDefault: !0 },
|
|
677
|
-
{ mac: "Cmd-ArrowLeft", run:
|
|
677
|
+
{ mac: "Cmd-ArrowLeft", run: Yr, shift: co, preventDefault: !0 },
|
|
678
678
|
{ key: "ArrowRight", run: _t, shift: rn, preventDefault: !0 },
|
|
679
679
|
{ key: "Mod-ArrowRight", mac: "Alt-ArrowRight", run: Gr, shift: oo, preventDefault: !0 },
|
|
680
|
-
{ mac: "Cmd-ArrowRight", run:
|
|
681
|
-
{ key: "ArrowUp", run:
|
|
680
|
+
{ mac: "Cmd-ArrowRight", run: Zr, shift: ho, preventDefault: !0 },
|
|
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
|
-
{ key: "ArrowDown", run:
|
|
684
|
+
{ key: "ArrowDown", run: Zt, shift: an, preventDefault: !0 },
|
|
685
685
|
{ mac: "Cmd-ArrowDown", run: mt, shift: pt },
|
|
686
686
|
{ mac: "Ctrl-ArrowDown", run: _e, shift: ft },
|
|
687
687
|
{ key: "PageUp", run: ht, shift: ut },
|
|
@@ -698,7 +698,7 @@ const wo = ({ state: t, dispatch: e }) => {
|
|
|
698
698
|
{ key: "Mod-Delete", mac: "Alt-Delete", run: xo },
|
|
699
699
|
{ mac: "Mod-Backspace", run: ko },
|
|
700
700
|
{ mac: "Mod-Delete", run: mn }
|
|
701
|
-
].concat(/* @__PURE__ */ Ro.map((t) => ({ mac: t.key, run: t.run, shift: t.shift }))),
|
|
701
|
+
].concat(/* @__PURE__ */ Ro.map((t) => ({ mac: t.key, run: t.run, shift: t.shift }))), Oo = /* @__PURE__ */ [
|
|
702
702
|
{ key: "Alt-ArrowLeft", mac: "Ctrl-ArrowLeft", run: Jr, shift: io },
|
|
703
703
|
{ key: "Alt-ArrowRight", mac: "Ctrl-ArrowRight", run: _r, shift: so },
|
|
704
704
|
{ key: "Alt-ArrowUp", run: Co },
|
|
@@ -716,7 +716,7 @@ const wo = ({ state: t, dispatch: e }) => {
|
|
|
716
716
|
{ key: "Shift-Mod-\\", run: no },
|
|
717
717
|
{ key: "Mod-/", run: Ar },
|
|
718
718
|
{ key: "Alt-A", run: Lr }
|
|
719
|
-
].concat(To),
|
|
719
|
+
].concat(To), Io = { key: "Tab", run: xn, shift: kn };
|
|
720
720
|
function g() {
|
|
721
721
|
var t = arguments[0];
|
|
722
722
|
typeof t == "string" && (t = document.createElement(t));
|
|
@@ -769,7 +769,7 @@ class te {
|
|
|
769
769
|
return -1;
|
|
770
770
|
this.bufferPos = 0, this.buffer = this.iter.value;
|
|
771
771
|
}
|
|
772
|
-
return
|
|
772
|
+
return Yn(this.buffer, this.bufferPos);
|
|
773
773
|
}
|
|
774
774
|
/**
|
|
775
775
|
Look for the next match. Updates the iterator's
|
|
@@ -793,7 +793,7 @@ class te {
|
|
|
793
793
|
if (e < 0)
|
|
794
794
|
return this.done = !0, this;
|
|
795
795
|
let r = er(e), n = this.bufferStart + this.bufferPos;
|
|
796
|
-
this.bufferPos +=
|
|
796
|
+
this.bufferPos += Zn(e);
|
|
797
797
|
let o = this.normalize(r);
|
|
798
798
|
for (let i = 0, s = n; ; i++) {
|
|
799
799
|
let l = o.charCodeAt(i), a = this.match(l, s);
|
|
@@ -857,8 +857,8 @@ class Cn {
|
|
|
857
857
|
}
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
|
-
const
|
|
861
|
-
class
|
|
860
|
+
const He = /* @__PURE__ */ new WeakMap();
|
|
861
|
+
class X {
|
|
862
862
|
constructor(e, r) {
|
|
863
863
|
this.from = e, this.text = r;
|
|
864
864
|
}
|
|
@@ -866,20 +866,20 @@ class Z {
|
|
|
866
866
|
return this.from + this.text.length;
|
|
867
867
|
}
|
|
868
868
|
static get(e, r, n) {
|
|
869
|
-
let o =
|
|
869
|
+
let o = He.get(e);
|
|
870
870
|
if (!o || o.from >= n || o.to <= r) {
|
|
871
|
-
let l = new
|
|
872
|
-
return
|
|
871
|
+
let l = new X(r, e.sliceString(r, n));
|
|
872
|
+
return He.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)), He.set(e, new X(s, i)), new X(r, i.slice(r - s, n - s));
|
|
878
878
|
}
|
|
879
879
|
}
|
|
880
880
|
class vn {
|
|
881
881
|
constructor(e, r, n, o, i) {
|
|
882
|
-
this.text = e, this.to = i, this.done = !1, this.value = Sn, this.matchPos = ve(e, o), this.re = new RegExp(r, it + (n != null && n.ignoreCase ? "i" : "")), this.test = n == null ? void 0 : n.test, this.flat =
|
|
882
|
+
this.text = e, this.to = i, this.done = !1, this.value = Sn, this.matchPos = ve(e, o), this.re = new RegExp(r, it + (n != null && n.ignoreCase ? "i" : "")), this.test = n == null ? void 0 : n.test, this.flat = X.get(e, o, this.chunkEnd(
|
|
883
883
|
o + 5e3
|
|
884
884
|
/* Base */
|
|
885
885
|
));
|
|
@@ -897,7 +897,7 @@ class vn {
|
|
|
897
897
|
}
|
|
898
898
|
if (this.flat.to == this.to)
|
|
899
899
|
return this.done = !0, this;
|
|
900
|
-
this.flat =
|
|
900
|
+
this.flat = X.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));
|
|
901
901
|
}
|
|
902
902
|
}
|
|
903
903
|
}
|
|
@@ -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 = [$o,
|
|
987
|
+
let e = [$o, zo];
|
|
988
988
|
return t && e.push(An.of(t)), e;
|
|
989
989
|
}
|
|
990
|
-
const
|
|
990
|
+
const Vo = /* @__PURE__ */ y.mark({ class: "cm-selectionMatch" }), Ho = /* @__PURE__ */ y.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
|
|
991
991
|
function kt(t, e, r, n) {
|
|
992
992
|
return (r == 0 || t(e.sliceDoc(r - 1, r)) != L.Word) && (n == e.doc.length || t(e.sliceDoc(n, n + 1)) != L.Word);
|
|
993
993
|
}
|
|
994
|
-
function
|
|
994
|
+
function Uo(t, e, r, n) {
|
|
995
995
|
return t(e.sliceDoc(r, r + 1)) == L.Word && t(e.sliceDoc(n - 1, n)) == L.Word;
|
|
996
996
|
}
|
|
997
|
-
const
|
|
997
|
+
const zo = /* @__PURE__ */ Ft.fromClass(class {
|
|
998
998
|
constructor(t) {
|
|
999
999
|
this.decorations = this.getDeco(t);
|
|
1000
1000
|
}
|
|
@@ -1018,7 +1018,7 @@ const Uo = /* @__PURE__ */ Ft.fromClass(class {
|
|
|
1018
1018
|
if (a < e.minSelectionLength || a > 200)
|
|
1019
1019
|
return y.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) &&
|
|
1021
|
+
if (i = r.sliceDoc(o.from, o.to), s = r.charCategorizer(o.head), !(kt(s, r, o.from, o.to) && Uo(s, r, o.from, o.to)))
|
|
1022
1022
|
return y.none;
|
|
1023
1023
|
} else if (i = r.sliceDoc(o.from, o.to).trim(), !i)
|
|
1024
1024
|
return y.none;
|
|
@@ -1028,7 +1028,7 @@ const Uo = /* @__PURE__ */ Ft.fromClass(class {
|
|
|
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(
|
|
1031
|
+
if ((!s || kt(s, r, h, u)) && (o.empty && h <= o.from && u >= o.to ? l.push(Ho.range(h, u)) : (h >= o.to || u <= o.from) && l.push(Vo.range(h, u)), l.length > e.maxMatches))
|
|
1032
1032
|
return y.none;
|
|
1033
1033
|
}
|
|
1034
1034
|
}
|
|
@@ -1110,7 +1110,7 @@ class Mn {
|
|
|
1110
1110
|
@internal
|
|
1111
1111
|
*/
|
|
1112
1112
|
create() {
|
|
1113
|
-
return this.regexp ? new
|
|
1113
|
+
return this.regexp ? new Yo(this) : new jo(this);
|
|
1114
1114
|
}
|
|
1115
1115
|
/**
|
|
1116
1116
|
Get a search cursor for this query, searching through the given
|
|
@@ -1118,7 +1118,7 @@ class Mn {
|
|
|
1118
1118
|
*/
|
|
1119
1119
|
getCursor(e, r = 0, n) {
|
|
1120
1120
|
let o = e.doc ? e : he.create({ doc: e });
|
|
1121
|
-
return n == null && (n = o.doc.length), this.regexp ?
|
|
1121
|
+
return n == null && (n = o.doc.length), this.regexp ? Y(this, o, r, n) : Q(this, o, r, n);
|
|
1122
1122
|
}
|
|
1123
1123
|
}
|
|
1124
1124
|
class Ln {
|
|
@@ -1175,7 +1175,7 @@ class jo extends Ln {
|
|
|
1175
1175
|
o(i.value.from, i.value.to);
|
|
1176
1176
|
}
|
|
1177
1177
|
}
|
|
1178
|
-
function
|
|
1178
|
+
function Y(t, e, r, n) {
|
|
1179
1179
|
return new Cn(e.doc, t.search, {
|
|
1180
1180
|
ignoreCase: !t.caseSensitive,
|
|
1181
1181
|
test: t.wholeWord ? Qo(e.charCategorizer(e.selection.main.head)) : void 0
|
|
@@ -1190,10 +1190,10 @@ function Le(t, e) {
|
|
|
1190
1190
|
function Qo(t) {
|
|
1191
1191
|
return (e, r, n) => !n[0].length || (t(Me(n.input, n.index)) != L.Word || t(Le(n.input, n.index)) != L.Word) && (t(Le(n.input, n.index + n[0].length)) != L.Word || t(Me(n.input, n.index + n[0].length)) != L.Word);
|
|
1192
1192
|
}
|
|
1193
|
-
class
|
|
1193
|
+
class Yo extends Ln {
|
|
1194
1194
|
nextMatch(e, r, n) {
|
|
1195
|
-
let o =
|
|
1196
|
-
return o.done && (o =
|
|
1195
|
+
let o = Y(this.spec, e, n, e.doc.length).next();
|
|
1196
|
+
return o.done && (o = Y(this.spec, e, 0, r).next()), o.done ? null : o.value;
|
|
1197
1197
|
}
|
|
1198
1198
|
prevMatchInRange(e, r, n) {
|
|
1199
1199
|
for (let o = 1; ; o++) {
|
|
@@ -1201,7 +1201,7 @@ class Xo extends Ln {
|
|
|
1201
1201
|
r,
|
|
1202
1202
|
n - o * 1e4
|
|
1203
1203
|
/* ChunkSize */
|
|
1204
|
-
), s =
|
|
1204
|
+
), s = Y(this.spec, e, i, n), l = null;
|
|
1205
1205
|
for (; !s.next().done; )
|
|
1206
1206
|
l = s.value;
|
|
1207
1207
|
if (l && (i == r || l.from > i + 10))
|
|
@@ -1217,7 +1217,7 @@ class Xo extends Ln {
|
|
|
1217
1217
|
return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g, (r, n) => n == "$" ? "$" : n == "&" ? e.match[0] : n != "0" && +n < e.match.length ? e.match[n] : r));
|
|
1218
1218
|
}
|
|
1219
1219
|
matchAll(e, r) {
|
|
1220
|
-
let n =
|
|
1220
|
+
let n = Y(this.spec, e, 0, e.doc.length), o = [];
|
|
1221
1221
|
for (; !n.next().done; ) {
|
|
1222
1222
|
if (o.length >= r)
|
|
1223
1223
|
return null;
|
|
@@ -1226,7 +1226,7 @@ class Xo extends Ln {
|
|
|
1226
1226
|
return o;
|
|
1227
1227
|
}
|
|
1228
1228
|
highlight(e, r, n, o) {
|
|
1229
|
-
let i =
|
|
1229
|
+
let i = Y(this.spec, e, Math.max(
|
|
1230
1230
|
0,
|
|
1231
1231
|
r - 250
|
|
1232
1232
|
/* HighlightMargin */
|
|
@@ -1237,21 +1237,21 @@ class Xo extends Ln {
|
|
|
1237
1237
|
}
|
|
1238
1238
|
const ue = /* @__PURE__ */ w.define(), st = /* @__PURE__ */ w.define(), N = /* @__PURE__ */ we.define({
|
|
1239
1239
|
create(t) {
|
|
1240
|
-
return new
|
|
1240
|
+
return new Ue(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 Ue(r.value.create(), t.panel) : r.is(st) && (t = new Ue(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 Ue {
|
|
1250
1250
|
constructor(e, r) {
|
|
1251
1251
|
this.query = e, this.panel = r;
|
|
1252
1252
|
}
|
|
1253
1253
|
}
|
|
1254
|
-
const
|
|
1254
|
+
const Zo = /* @__PURE__ */ y.mark({ class: "cm-searchMatch" }), Xo = /* @__PURE__ */ y.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), ei = /* @__PURE__ */ Ft.fromClass(class {
|
|
1255
1255
|
constructor(t) {
|
|
1256
1256
|
this.view = t, this.decorations = this.highlight(t.state.field(N));
|
|
1257
1257
|
}
|
|
@@ -1269,7 +1269,7 @@ const Yo = /* @__PURE__ */ y.mark({ class: "cm-searchMatch" }), Zo = /* @__PURE_
|
|
|
1269
1269
|
a = i[++o].to;
|
|
1270
1270
|
t.highlight(r.state, l, a, (c, h) => {
|
|
1271
1271
|
let u = r.state.selection.ranges.some((m) => m.from == c && m.to == h);
|
|
1272
|
-
n.add(c, h, u ?
|
|
1272
|
+
n.add(c, h, u ? Xo : Zo);
|
|
1273
1273
|
});
|
|
1274
1274
|
}
|
|
1275
1275
|
return n.finish();
|
|
@@ -1360,7 +1360,7 @@ const De = /* @__PURE__ */ de((t, { query: e }) => {
|
|
|
1360
1360
|
function lt(t) {
|
|
1361
1361
|
return t.state.facet(oe).createPanel(t);
|
|
1362
1362
|
}
|
|
1363
|
-
function
|
|
1363
|
+
function Ye(t, e) {
|
|
1364
1364
|
var r, n, o, i, s;
|
|
1365
1365
|
let l = t.selection.main, a = l.empty || l.to > l.from + 100 ? "" : t.sliceDoc(l.from, l.to);
|
|
1366
1366
|
if (e && !a)
|
|
@@ -1387,13 +1387,13 @@ const En = (t) => {
|
|
|
1387
1387
|
if (e && e.panel) {
|
|
1388
1388
|
let r = Dn(t);
|
|
1389
1389
|
if (r && r != t.root.activeElement) {
|
|
1390
|
-
let n =
|
|
1390
|
+
let n = Ye(t.state, e.query.spec);
|
|
1391
1391
|
n.valid && t.dispatch({ effects: ue.of(n) }), r.focus(), r.select();
|
|
1392
1392
|
}
|
|
1393
1393
|
} else
|
|
1394
1394
|
t.dispatch({ effects: [
|
|
1395
1395
|
st.of(!0),
|
|
1396
|
-
e ? ue.of(
|
|
1396
|
+
e ? ue.of(Ye(t.state, e.query.spec)) : w.appendConfig.of(li)
|
|
1397
1397
|
] });
|
|
1398
1398
|
return !0;
|
|
1399
1399
|
}, wn = (t) => {
|
|
@@ -1562,7 +1562,7 @@ const si = /* @__PURE__ */ p.baseTheme({
|
|
|
1562
1562
|
"&dark .cm-searchMatch-selected": { backgroundColor: "#ff00ff8a" }
|
|
1563
1563
|
}), li = [
|
|
1564
1564
|
N,
|
|
1565
|
-
/* @__PURE__ */
|
|
1565
|
+
/* @__PURE__ */ Xn.lowest(ei),
|
|
1566
1566
|
si
|
|
1567
1567
|
];
|
|
1568
1568
|
class ai {
|
|
@@ -1570,12 +1570,12 @@ class ai {
|
|
|
1570
1570
|
this.from = e, this.to = r, this.diagnostic = n;
|
|
1571
1571
|
}
|
|
1572
1572
|
}
|
|
1573
|
-
class
|
|
1573
|
+
class z {
|
|
1574
1574
|
constructor(e, r, n) {
|
|
1575
1575
|
this.diagnostics = e, this.panel = r, this.selected = n;
|
|
1576
1576
|
}
|
|
1577
1577
|
static init(e, r, n) {
|
|
1578
|
-
let o = e, i = n.facet(
|
|
1578
|
+
let o = e, i = n.facet(On).markerFilter;
|
|
1579
1579
|
i && (o = i(o));
|
|
1580
1580
|
let s = y.set(o.map((l) => l.from == l.to || l.from == l.to - 1 && n.doc.lineAt(l.from).to == l.from ? y.widget({
|
|
1581
1581
|
widget: new yi(l),
|
|
@@ -1584,7 +1584,7 @@ class U {
|
|
|
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);
|
|
1587
|
-
return new
|
|
1587
|
+
return new z(s, r, ne(s));
|
|
1588
1588
|
}
|
|
1589
1589
|
}
|
|
1590
1590
|
function ne(t, e = null, r = 0) {
|
|
@@ -1603,7 +1603,7 @@ function hi(t, e) {
|
|
|
1603
1603
|
}
|
|
1604
1604
|
const Rn = /* @__PURE__ */ w.define(), ct = /* @__PURE__ */ w.define(), Tn = /* @__PURE__ */ w.define(), M = /* @__PURE__ */ we.define({
|
|
1605
1605
|
create() {
|
|
1606
|
-
return new
|
|
1606
|
+
return new z(y.none, null, null);
|
|
1607
1607
|
},
|
|
1608
1608
|
update(t, e) {
|
|
1609
1609
|
if (e.docChanged) {
|
|
@@ -1612,10 +1612,10 @@ const Rn = /* @__PURE__ */ w.define(), ct = /* @__PURE__ */ w.define(), Tn = /*
|
|
|
1612
1612
|
let o = e.changes.mapPos(t.selected.from, 1);
|
|
1613
1613
|
n = ne(r, t.selected.diagnostic, o) || ne(r, null, o);
|
|
1614
1614
|
}
|
|
1615
|
-
t = new
|
|
1615
|
+
t = new z(r, t.panel, n);
|
|
1616
1616
|
}
|
|
1617
1617
|
for (let r of e.effects)
|
|
1618
|
-
r.is(Rn) ? t =
|
|
1618
|
+
r.is(Rn) ? t = z.init(r.value, t.panel, e.state) : r.is(ct) ? t = new z(t.diagnostics, r.value ? We.open : null, t.selected) : r.is(Tn) && (t = new z(t.diagnostics, t.panel, r.value));
|
|
1619
1619
|
return t;
|
|
1620
1620
|
},
|
|
1621
1621
|
provide: (t) => [
|
|
@@ -1628,7 +1628,7 @@ function fi(t, e, r) {
|
|
|
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
|
});
|
|
1631
|
-
let l = t.state.facet(
|
|
1631
|
+
let l = t.state.facet(On).tooltipFilter;
|
|
1632
1632
|
return l && (o = l(o)), o.length ? {
|
|
1633
1633
|
pos: i,
|
|
1634
1634
|
end: s,
|
|
@@ -1658,7 +1658,7 @@ const mi = (t) => {
|
|
|
1658
1658
|
}, pi = [
|
|
1659
1659
|
{ key: "Mod-Shift-m", run: mi, preventDefault: !0 },
|
|
1660
1660
|
{ key: "F8", run: gi }
|
|
1661
|
-
],
|
|
1661
|
+
], On = /* @__PURE__ */ fe.define({
|
|
1662
1662
|
combine(t) {
|
|
1663
1663
|
return Object.assign({ sources: t.map((e) => e.source) }, Ee(t.map((e) => e.config), {
|
|
1664
1664
|
delay: 750,
|
|
@@ -1670,7 +1670,7 @@ const mi = (t) => {
|
|
|
1670
1670
|
}));
|
|
1671
1671
|
}
|
|
1672
1672
|
});
|
|
1673
|
-
function
|
|
1673
|
+
function In(t) {
|
|
1674
1674
|
let e = [];
|
|
1675
1675
|
if (t)
|
|
1676
1676
|
e:
|
|
@@ -1688,7 +1688,7 @@ function On(t) {
|
|
|
1688
1688
|
}
|
|
1689
1689
|
function Pn(t, e, r) {
|
|
1690
1690
|
var n;
|
|
1691
|
-
let o = r ?
|
|
1691
|
+
let o = r ? In(e.actions) : [];
|
|
1692
1692
|
return g("li", { class: "cm-diagnostic cm-diagnostic-" + e.severity }, g("span", { class: "cm-diagnosticText" }, e.renderMessage ? e.renderMessage() : e.message), (n = e.actions) === null || n === void 0 ? void 0 : n.map((i, s) => {
|
|
1693
1693
|
let l = !1, a = (m) => {
|
|
1694
1694
|
if (m.preventDefault(), l)
|
|
@@ -1743,7 +1743,7 @@ class We {
|
|
|
1743
1743
|
else if (o.keyCode == 13)
|
|
1744
1744
|
this.view.focus();
|
|
1745
1745
|
else if (o.keyCode >= 65 && o.keyCode <= 90 && this.selectedIndex >= 0) {
|
|
1746
|
-
let { diagnostic: i } = this.items[this.selectedIndex], s =
|
|
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
1749
|
let a = ne(this.view.state.field(M).diagnostics, i);
|
|
@@ -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(
|
|
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(zr)), 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
|
-
return e.lineNumbers !== !1 && o.push(ar()), e.highlightActiveLineGutter !== !1 && o.push(cr()), e.highlightSpecialChars !== !1 && o.push(hr()), e.history !== !1 && o.push(
|
|
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",
|
|
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", ze = "#353a42", Bi = "#3E4451", Bt = "#528bff", Ei = /* @__PURE__ */ p.theme({
|
|
1955
1955
|
"&": {
|
|
1956
1956
|
color: be,
|
|
1957
1957
|
backgroundColor: Dt
|
|
@@ -1978,7 +1978,7 @@ const Si = "#e5c07b", At = "#e06c75", Ci = "#56b6c2", vi = "#ffffff", be = "#abb
|
|
|
1978
1978
|
},
|
|
1979
1979
|
".cm-gutters": {
|
|
1980
1980
|
backgroundColor: Dt,
|
|
1981
|
-
color:
|
|
1981
|
+
color: Ze,
|
|
1982
1982
|
border: "none"
|
|
1983
1983
|
},
|
|
1984
1984
|
".cm-activeLineGutter": {
|
|
@@ -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: ze
|
|
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: ze,
|
|
2002
|
+
borderBottomColor: ze
|
|
2003
2003
|
},
|
|
2004
2004
|
".cm-tooltip-autocomplete": {
|
|
2005
2005
|
"& > ul > li[aria-selected]": {
|
|
@@ -2038,7 +2038,7 @@ const Si = "#e5c07b", At = "#e06c75", Ci = "#56b6c2", vi = "#ffffff", be = "#abb
|
|
|
2038
2038
|
},
|
|
2039
2039
|
{
|
|
2040
2040
|
tag: [f.meta, f.comment],
|
|
2041
|
-
color:
|
|
2041
|
+
color: Ze
|
|
2042
2042
|
},
|
|
2043
2043
|
{
|
|
2044
2044
|
tag: f.strong,
|
|
@@ -2054,7 +2054,7 @@ const Si = "#e5c07b", At = "#e06c75", Ci = "#56b6c2", vi = "#ffffff", be = "#abb
|
|
|
2054
2054
|
},
|
|
2055
2055
|
{
|
|
2056
2056
|
tag: f.link,
|
|
2057
|
-
color:
|
|
2057
|
+
color: Ze,
|
|
2058
2058
|
textDecoration: "underline"
|
|
2059
2059
|
},
|
|
2060
2060
|
{
|
|
@@ -2081,7 +2081,7 @@ var Ti = p.theme({
|
|
|
2081
2081
|
}
|
|
2082
2082
|
}, {
|
|
2083
2083
|
dark: !1
|
|
2084
|
-
}),
|
|
2084
|
+
}), Oi = function(e) {
|
|
2085
2085
|
e === void 0 && (e = {});
|
|
2086
2086
|
var {
|
|
2087
2087
|
indentWithTab: r = !0,
|
|
@@ -2091,7 +2091,7 @@ var Ti = p.theme({
|
|
|
2091
2091
|
placeholder: s = "",
|
|
2092
2092
|
basicSetup: l = !0
|
|
2093
2093
|
} = e, a = [];
|
|
2094
|
-
switch (r && a.unshift(qt.of([
|
|
2094
|
+
switch (r && a.unshift(qt.of([Io])), l && (typeof l == "boolean" ? a.unshift(vt()) : a.unshift(vt(l))), s && a.unshift(vr(s)), i) {
|
|
2095
2095
|
case "light":
|
|
2096
2096
|
a.push(Ti);
|
|
2097
2097
|
break;
|
|
@@ -2105,7 +2105,7 @@ var Ti = p.theme({
|
|
|
2105
2105
|
break;
|
|
2106
2106
|
}
|
|
2107
2107
|
return n === !1 && a.push(p.editable.of(!1)), o && a.push(he.readOnly.of(!0)), [...a];
|
|
2108
|
-
},
|
|
2108
|
+
}, Ii = (t) => ({
|
|
2109
2109
|
line: t.state.doc.lineAt(t.state.selection.main.from),
|
|
2110
2110
|
lineCount: t.state.doc.lines,
|
|
2111
2111
|
lineBreak: t.state.lineBreak,
|
|
@@ -2118,7 +2118,7 @@ var Ti = p.theme({
|
|
|
2118
2118
|
selectionCode: t.state.sliceDoc(t.state.selection.main.from, t.state.selection.main.to),
|
|
2119
2119
|
selections: t.state.selection.ranges.map((e) => t.state.sliceDoc(e.from, e.to)),
|
|
2120
2120
|
selectedText: t.state.selection.ranges.some((e) => !e.empty)
|
|
2121
|
-
}), Et =
|
|
2121
|
+
}), Et = Xe.define(), Pi = [];
|
|
2122
2122
|
function Wi(t) {
|
|
2123
2123
|
var {
|
|
2124
2124
|
value: e,
|
|
@@ -2137,12 +2137,12 @@ function Wi(t) {
|
|
|
2137
2137
|
minWidth: b = null,
|
|
2138
2138
|
maxWidth: T = null,
|
|
2139
2139
|
placeholder: $ = "",
|
|
2140
|
-
editable:
|
|
2140
|
+
editable: V = !0,
|
|
2141
2141
|
readOnly: G = !1,
|
|
2142
|
-
indentWithTab:
|
|
2142
|
+
indentWithTab: H = !0,
|
|
2143
2143
|
basicSetup: K = !0,
|
|
2144
2144
|
root: ie,
|
|
2145
|
-
initialState:
|
|
2145
|
+
initialState: U
|
|
2146
2146
|
} = t, [v, J] = ke(), [k, P] = ke(), [_, j] = ke(), Fe = p.theme({
|
|
2147
2147
|
"&": {
|
|
2148
2148
|
height: h,
|
|
@@ -2162,13 +2162,13 @@ function Wi(t) {
|
|
|
2162
2162
|
var le = E.state.doc, me = le.toString();
|
|
2163
2163
|
n(me, E);
|
|
2164
2164
|
}
|
|
2165
|
-
o && o(
|
|
2166
|
-
}), Fn =
|
|
2165
|
+
o && o(Ii(E));
|
|
2166
|
+
}), Fn = Oi({
|
|
2167
2167
|
theme: c,
|
|
2168
|
-
editable:
|
|
2168
|
+
editable: V,
|
|
2169
2169
|
readOnly: G,
|
|
2170
2170
|
placeholder: $,
|
|
2171
|
-
indentWithTab:
|
|
2171
|
+
indentWithTab: H,
|
|
2172
2172
|
basicSetup: K
|
|
2173
2173
|
}), se = [Ne, Fe, ...Fn];
|
|
2174
2174
|
return s && typeof s == "function" && se.push(p.updateListener.of(s)), se = se.concat(l), F(() => {
|
|
@@ -2177,7 +2177,7 @@ function Wi(t) {
|
|
|
2177
2177
|
doc: e,
|
|
2178
2178
|
selection: r,
|
|
2179
2179
|
extensions: se
|
|
2180
|
-
}, le =
|
|
2180
|
+
}, le = U ? he.fromJSON(U.json, E, U.fields) : he.create(E);
|
|
2181
2181
|
if (j(le), !k) {
|
|
2182
2182
|
var me = new p({
|
|
2183
2183
|
state: le,
|
|
@@ -2198,7 +2198,7 @@ function Wi(t) {
|
|
|
2198
2198
|
k && k.dispatch({
|
|
2199
2199
|
effects: w.reconfigure.of(se)
|
|
2200
2200
|
});
|
|
2201
|
-
}, [c, l, h, u, m, x, b, T, $,
|
|
2201
|
+
}, [c, l, h, u, m, x, b, T, $, V, G, H, K, n, s]), F(() => {
|
|
2202
2202
|
if (e !== void 0) {
|
|
2203
2203
|
var E = k ? k.state.doc.toString() : "";
|
|
2204
2204
|
k && e !== E && k.dispatch({
|
|
@@ -2236,12 +2236,12 @@ var Fi = ["className", "value", "selection", "extensions", "onChange", "onStatis
|
|
|
2236
2236
|
maxHeight: b,
|
|
2237
2237
|
width: T,
|
|
2238
2238
|
minWidth: $,
|
|
2239
|
-
maxWidth:
|
|
2239
|
+
maxWidth: V,
|
|
2240
2240
|
basicSetup: G,
|
|
2241
|
-
placeholder:
|
|
2241
|
+
placeholder: H,
|
|
2242
2242
|
indentWithTab: K,
|
|
2243
2243
|
editable: ie,
|
|
2244
|
-
readOnly:
|
|
2244
|
+
readOnly: U,
|
|
2245
2245
|
root: v,
|
|
2246
2246
|
initialState: J
|
|
2247
2247
|
} = t, k = qn(t, Fi), P = Rt(null), {
|
|
@@ -2259,12 +2259,12 @@ var Fi = ["className", "value", "selection", "extensions", "onChange", "onStatis
|
|
|
2259
2259
|
maxHeight: b,
|
|
2260
2260
|
width: T,
|
|
2261
2261
|
minWidth: $,
|
|
2262
|
-
maxWidth:
|
|
2262
|
+
maxWidth: V,
|
|
2263
2263
|
basicSetup: G,
|
|
2264
|
-
placeholder:
|
|
2264
|
+
placeholder: H,
|
|
2265
2265
|
indentWithTab: K,
|
|
2266
2266
|
editable: ie,
|
|
2267
|
-
readOnly:
|
|
2267
|
+
readOnly: U,
|
|
2268
2268
|
selection: o,
|
|
2269
2269
|
onChange: s,
|
|
2270
2270
|
onStatistics: l,
|
|
@@ -2273,14 +2273,14 @@ var Fi = ["className", "value", "selection", "extensions", "onChange", "onStatis
|
|
|
2273
2273
|
extensions: i,
|
|
2274
2274
|
initialState: J
|
|
2275
2275
|
});
|
|
2276
|
-
if (
|
|
2276
|
+
if (Vn(e, () => ({
|
|
2277
2277
|
editor: P.current,
|
|
2278
2278
|
state: _,
|
|
2279
2279
|
view: j
|
|
2280
2280
|
}), [P, Fe, _, 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__ */ W.jsx("div",
|
|
2283
|
+
return /* @__PURE__ */ W.jsx("div", Hn({
|
|
2284
2284
|
ref: P,
|
|
2285
2285
|
className: "" + Ne + (r ? " " + r : "")
|
|
2286
2286
|
}, k));
|
|
@@ -2293,7 +2293,7 @@ const Ni = p.theme({
|
|
|
2293
2293
|
"& .cm-activeLine, & .cm-activeLineGutter": {
|
|
2294
2294
|
backgroundColor: "transparent"
|
|
2295
2295
|
}
|
|
2296
|
-
}),
|
|
2296
|
+
}), Hi = wt(function({
|
|
2297
2297
|
title: e,
|
|
2298
2298
|
value: r,
|
|
2299
2299
|
height: n = "200px",
|
|
@@ -2306,10 +2306,10 @@ const Ni = p.theme({
|
|
|
2306
2306
|
onBlur: h,
|
|
2307
2307
|
...u
|
|
2308
2308
|
}, m) {
|
|
2309
|
-
const x =
|
|
2310
|
-
c == null || c(v),
|
|
2309
|
+
const x = Un(), b = Rt(null), [T, $] = ke(100), [V, G] = zn.useState(null), { setFocusState: H } = $n(), K = (v) => {
|
|
2310
|
+
c == null || c(v), H(!0);
|
|
2311
2311
|
}, ie = (v) => {
|
|
2312
|
-
h == null || h(v),
|
|
2312
|
+
h == null || h(v), H(!1);
|
|
2313
2313
|
};
|
|
2314
2314
|
F(() => {
|
|
2315
2315
|
Promise.all(l).then(G);
|
|
@@ -2319,7 +2319,7 @@ const Ni = p.theme({
|
|
|
2319
2319
|
});
|
|
2320
2320
|
return v.observe(b.current), () => v.disconnect();
|
|
2321
2321
|
}, []);
|
|
2322
|
-
let
|
|
2322
|
+
let U = Gn(
|
|
2323
2323
|
"peer order-2 w-full max-w-full overflow-hidden rounded-sm border",
|
|
2324
2324
|
s ? "bg-transparent" : "bg-grey-75",
|
|
2325
2325
|
o ? "border-red" : "border-grey-500 hover:border-grey-700 focus:border-grey-800",
|
|
@@ -2328,13 +2328,13 @@ const Ni = p.theme({
|
|
|
2328
2328
|
);
|
|
2329
2329
|
return /* @__PURE__ */ W.jsxs(W.Fragment, { children: [
|
|
2330
2330
|
/* @__PURE__ */ W.jsx("div", { ref: b }),
|
|
2331
|
-
|
|
2331
|
+
V && /* @__PURE__ */ W.jsxs("div", { className: n === "full" ? "h-full" : "", style: { width: T }, children: [
|
|
2332
2332
|
/* @__PURE__ */ W.jsx(
|
|
2333
2333
|
Wn,
|
|
2334
2334
|
{
|
|
2335
2335
|
ref: m,
|
|
2336
|
-
className:
|
|
2337
|
-
extensions:
|
|
2336
|
+
className: U,
|
|
2337
|
+
extensions: V,
|
|
2338
2338
|
height: n === "full" ? "100%" : n,
|
|
2339
2339
|
theme: Ni,
|
|
2340
2340
|
value: r,
|
|
@@ -2350,6 +2350,6 @@ const Ni = p.theme({
|
|
|
2350
2350
|
] });
|
|
2351
2351
|
});
|
|
2352
2352
|
export {
|
|
2353
|
-
|
|
2353
|
+
Hi as default
|
|
2354
2354
|
};
|
|
2355
|
-
//# sourceMappingURL=CodeEditorView-
|
|
2355
|
+
//# sourceMappingURL=CodeEditorView-79c17af2.mjs.map
|