capsule-editor
Advanced tools
Comparing version 2.0.0-beta.28 to 2.0.0-beta.29
@@ -1,22 +0,21 @@ | ||
var Q = Object.defineProperty; | ||
var X = (e, t, o) => t in e ? Q(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o; | ||
var M = (e, t, o) => (X(e, typeof t != "symbol" ? t + "" : t, o), o); | ||
import { indentWithTab as Y } from "@codemirror/commands"; | ||
import { html as Z } from "@codemirror/lang-html"; | ||
import { search as ee, searchKeymap as te } from "@codemirror/search"; | ||
import { StateEffect as oe, RangeSet as ne, StateField as se, Compartment as re, EditorState as ae, EditorSelection as I } from "@codemirror/state"; | ||
import { GutterMarker as ie, gutter as le, Decoration as T, EditorView as R, showPanel as ue, WidgetType as ce, ViewPlugin as de, lineNumbers as fe, keymap as G } from "@codemirror/view"; | ||
var z = Object.defineProperty; | ||
var Q = (e, t, o) => t in e ? z(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o; | ||
var M = (e, t, o) => (Q(e, typeof t != "symbol" ? t + "" : t, o), o); | ||
import { indentWithTab as X } from "@codemirror/commands"; | ||
import { html as Y } from "@codemirror/lang-html"; | ||
import { search as Z, searchKeymap as ee } from "@codemirror/search"; | ||
import { StateEffect as te, RangeSet as oe, StateField as ne, Compartment as se, EditorState as re, EditorSelection as I } from "@codemirror/state"; | ||
import { GutterMarker as ae, gutter as ie, Decoration as T, EditorView as R, showPanel as le, WidgetType as ce, ViewPlugin as ue, lineNumbers as de, keymap as G } from "@codemirror/view"; | ||
import { materialDark as me } from "cm6-theme-material-dark"; | ||
import { EditorView as S, basicSetup as pe } from "codemirror"; | ||
import { defineComponent as O, resolveComponent as A, openBlock as c, createElementBlock as m, createElementVNode as h, toDisplayString as y, createVNode as $, ref as L, computed as he, unref as b, withCtx as f, createCommentVNode as w, createBlock as E, renderSlot as p, Fragment as j, createTextVNode as P, renderList as ge, withDirectives as ve, vModelText as be } from "vue"; | ||
import { forceLinting as $e, linter as ye } from "@codemirror/lint"; | ||
import { ArrowTopRightOnSquareIcon as we, ChevronLeftIcon as ke, ChevronRightIcon as Ce, ExclamationTriangleIcon as Se } from "@heroicons/vue/24/outline"; | ||
import { AnimateCss as U } from "@vue-interface/animate-css"; | ||
import { EditorView as S, basicSetup as fe } from "codemirror"; | ||
import { defineComponent as O, resolveComponent as x, openBlock as u, createElementBlock as m, createElementVNode as p, toDisplayString as b, createVNode as w, ref as L, computed as pe, unref as $, withCtx as v, createCommentVNode as y, createBlock as E, renderSlot as f, Fragment as j, createTextVNode as P, renderList as he, withDirectives as ge, vModelText as ve } from "vue"; | ||
import { forceLinting as be, linter as $e } from "@codemirror/lint"; | ||
import { ArrowTopRightOnSquareIcon as ye, ChevronLeftIcon as we, ChevronRightIcon as ke, ExclamationTriangleIcon as Ce } from "@heroicons/vue/24/outline"; | ||
import { Btn as F } from "@vue-interface/btn"; | ||
import { BtnDropdown as Ee } from "@vue-interface/btn-dropdown"; | ||
import { lint as Ve } from "capsule-lint"; | ||
import { syntaxTree as N } from "@codemirror/language"; | ||
const Be = O({ | ||
import { BtnDropdown as Se } from "@vue-interface/btn-dropdown"; | ||
import { lint as Ee } from "capsule-lint"; | ||
import { syntaxTree as A } from "@codemirror/language"; | ||
const Ve = O({ | ||
components: { | ||
ArrowTopRightOnSquareIcon: we | ||
ArrowTopRightOnSquareIcon: ye | ||
}, | ||
@@ -34,3 +33,3 @@ props: { | ||
} | ||
}), _ = (e, t) => { | ||
}), N = (e, t) => { | ||
const o = e.__vccOpts || e; | ||
@@ -40,8 +39,8 @@ for (const [n, s] of t) | ||
return o; | ||
}, Fe = { class: "flex items-center text-sm" }, Te = ["href"]; | ||
}, Be = { class: "flex items-center text-sm" }, Fe = { class: "leading-tight text-[.8rem]" }, Te = ["href"]; | ||
function Oe(e, t, o, n, s, r) { | ||
const a = A("ArrowTopRightOnSquareIcon"); | ||
return c(), m("code", Fe, [ | ||
h("span", null, y(e.error.line) + "," + y(e.error.col) + " :: (" + y(e.error.rule.id) + ") " + y(e.error.message), 1), | ||
h("a", { | ||
const a = x("ArrowTopRightOnSquareIcon"); | ||
return u(), m("code", Be, [ | ||
p("span", Fe, b(e.error.line) + "," + b(e.error.col) + " :: (" + b(e.error.rule.id) + ") " + b(e.error.message), 1), | ||
p("a", { | ||
href: e.url, | ||
@@ -51,13 +50,13 @@ target: "_blank", | ||
}, [ | ||
$(a, { class: "w-4 h-4" }) | ||
w(a, { class: "w-4 h-4" }) | ||
], 8, Te) | ||
]); | ||
} | ||
const De = /* @__PURE__ */ _(Be, [["render", Oe]]), Me = { class: "transition-all relative flex items-center text-stone-800 bg-stone-200 dark:text-stone-200 dark:bg-stone-800" }, Ie = { | ||
const De = /* @__PURE__ */ N(Ve, [["render", Oe]]), Me = { class: "transition-all relative flex items-center text-stone-800 bg-stone-200 dark:text-stone-200 dark:bg-stone-800" }, Ie = { | ||
key: 0, | ||
class: "flex justify-between items-center w-full px-2 py-[.33rem]" | ||
}, Le = { class: "flex items-center w-full overflow-hidden no-scrollbars relative gap-4" }, Re = { class: "flex-shrink-0" }, Ae = { | ||
}, Le = { class: "flex items-center w-full overflow-hidden no-scrollbars relative gap-4" }, Re = { class: "flex-shrink-0" }, xe = { | ||
key: 0, | ||
class: "flex items-center justify-center gap-2" | ||
}, xe = { class: "editor-footer-action flex-shrink-0" }, Ne = { key: 1 }, _e = ["onClick"], qe = /* @__PURE__ */ O({ | ||
}, _e = { class: "font-mono text-center min-w-[6rem]" }, Ae = { class: "editor-footer-action flex-shrink-0" }, Ne = { key: 1 }, qe = ["onClick"], Ge = /* @__PURE__ */ O({ | ||
__name: "EditorFooter", | ||
@@ -71,3 +70,3 @@ props: { | ||
setup(e, { expose: t, emit: o }) { | ||
const n = e, s = o, r = L(), a = L([]), u = L(!1), d = he(() => Math.max(0, r.value ? a.value.indexOf(r.value) : 0)); | ||
const n = e, s = o, r = L(), a = L([]), c = L(!1), d = pe(() => Math.max(0, r.value ? a.value.indexOf(r.value) : 0)); | ||
function D(i) { | ||
@@ -78,13 +77,13 @@ i < 0 ? i = a.value.length - 1 : i > a.value.length - 1 && (i = 0); | ||
} | ||
function J(i, l) { | ||
function H(i, l) { | ||
return !!i && !!l && i.from === l.from && i.to === l.to && i.rule.id === l.rule.id; | ||
} | ||
function J(i) { | ||
a.value = i, c.value = !0, r.value || (r.value = a.value[d.value]), s("update:modelValue", a); | ||
} | ||
function K(i) { | ||
a.value = i, u.value = !0, r.value || (r.value = a.value[d.value]), s("update:modelValue", a); | ||
} | ||
function z(i) { | ||
const { from: l, to: k } = i.state.selection.main, g = a.value.filter((v) => l === k ? v.from <= l && v.to >= k : v.from >= l && v.to <= k), C = a.value.find((v) => J(v, r.value)); | ||
if (g.length) { | ||
const v = Math.max(0, r.value ? g.indexOf(r.value) : 0); | ||
r.value = g[v]; | ||
const { from: l, to: k } = i.state.selection.main, h = a.value.filter((g) => l === k ? g.from <= l && g.to >= k : g.from >= l && g.to <= k), C = a.value.find((g) => H(g, r.value)); | ||
if (h.length) { | ||
const g = Math.max(0, r.value ? h.indexOf(r.value) : 0); | ||
r.value = h[g]; | ||
} else | ||
@@ -94,121 +93,104 @@ r.value = C || a.value[d.value]; | ||
function q(i, l) { | ||
n.view && (l.apply(n.view, i.from, i.to), $e(n.view)); | ||
n.view && (l.apply(n.view, i.from, i.to), be(n.view)); | ||
} | ||
return t({ | ||
activate: z, | ||
update: K | ||
}), (i, l) => (c(), m("footer", Me, [ | ||
$(b(U), { | ||
name: "fade", | ||
duration: 200 | ||
}, { | ||
default: f(() => { | ||
var k; | ||
return [ | ||
u.value ? (c(), m("div", Ie, [ | ||
h("div", Le, [ | ||
h("div", Re, [ | ||
(k = a.value) != null && k.length ? (c(), m("div", Ae, [ | ||
$(b(F), { | ||
class: "btn-sm btn-secondary", | ||
onClick: l[0] || (l[0] = (g) => D(d.value - 1)) | ||
}, { | ||
default: f(() => [ | ||
$(b(ke), { class: "w-4 h-4" }) | ||
]), | ||
_: 1 | ||
}), | ||
h("span", null, y(d.value + 1) + " of " + y(a.value.length), 1), | ||
$(b(F), { | ||
class: "btn-sm btn-secondary", | ||
onClick: l[1] || (l[1] = (g) => D(d.value + 1)) | ||
}, { | ||
default: f(() => [ | ||
$(b(Ce), { class: "w-4 h-4" }) | ||
]), | ||
_: 1 | ||
}) | ||
])) : w("", !0) | ||
]), | ||
r.value ? (c(), m("button", { | ||
key: 0, | ||
type: "button", | ||
onClick: l[2] || (l[2] = (g) => D(d.value)) | ||
}, [ | ||
$(b(Se), { class: "w-6 h-6" }) | ||
])) : w("", !0), | ||
$(b(U), { | ||
name: "fade", | ||
duration: 200, | ||
"leave-active-class": "absolute" | ||
activate: K, | ||
update: J | ||
}), (i, l) => { | ||
var k; | ||
return u(), m("footer", Me, [ | ||
c.value ? (u(), m("div", Ie, [ | ||
p("div", Le, [ | ||
p("div", Re, [ | ||
(k = a.value) != null && k.length ? (u(), m("div", xe, [ | ||
w($(F), { | ||
class: "btn-sm btn-secondary", | ||
onClick: l[0] || (l[0] = (h) => D(d.value - 1)) | ||
}, { | ||
default: f(() => [ | ||
r.value ? (c(), E(De, { | ||
key: d.value, | ||
error: r.value | ||
}, null, 8, ["error"])) : w("", !0) | ||
default: v(() => [ | ||
w($(we), { class: "w-4 h-4" }) | ||
]), | ||
_: 1 | ||
}), | ||
p("span", _e, b(d.value + 1) + " of " + b(a.value.length), 1), | ||
w($(F), { | ||
class: "btn-sm btn-secondary", | ||
onClick: l[1] || (l[1] = (h) => D(d.value + 1)) | ||
}, { | ||
default: v(() => [ | ||
w($(ke), { class: "w-4 h-4" }) | ||
]), | ||
_: 1 | ||
}) | ||
]), | ||
h("div", xe, [ | ||
p(i.$slots, "before-save-button"), | ||
p(i.$slots, "action-button", {}, () => { | ||
var g; | ||
return [ | ||
r.value && ((g = r.value.actions) != null && g.length) ? (c(), m(j, { key: 0 }, [ | ||
r.value.actions.length === 1 ? (c(), E(b(F), { | ||
key: 0, | ||
class: "btn-secondary btn-sm flex items-center gap-2", | ||
onClick: l[3] || (l[3] = (C) => q(r.value, r.value.actions[0])) | ||
}, { | ||
default: f(() => [ | ||
P(y(r.value.actions[0].name), 1) | ||
]), | ||
_: 1 | ||
})) : (c(), m("div", Ne, [ | ||
$(b(Ee), { | ||
label: "Fix Errors", | ||
"button-class": "btn-sm btn-primary", | ||
dropup: "" | ||
}, { | ||
default: f(() => [ | ||
(c(!0), m(j, null, ge(r.value.actions, (C, v) => (c(), m("button", { | ||
key: `${r.value.rule.id}-${v}`, | ||
type: "button", | ||
variant: "light", | ||
onClick: (lt) => q(r.value, C) | ||
}, y(C.name), 9, _e))), 128)) | ||
]), | ||
_: 1 | ||
}) | ||
])) | ||
], 64)) : w("", !0) | ||
]; | ||
}), | ||
p(i.$slots, "save-button", { | ||
diagnostics: a.value, | ||
saveButtonLabel: a.value | ||
}, () => [ | ||
i.saveButton && !a.value.length ? (c(), E(b(F), { | ||
])) : y("", !0) | ||
]), | ||
r.value ? (u(), m("button", { | ||
key: 0, | ||
type: "button", | ||
onClick: l[2] || (l[2] = (h) => D(d.value)) | ||
}, [ | ||
w($(Ce), { class: "w-6 h-6" }) | ||
])) : y("", !0), | ||
r.value ? (u(), E(De, { | ||
key: d.value, | ||
error: r.value | ||
}, null, 8, ["error"])) : y("", !0) | ||
]), | ||
p("div", Ae, [ | ||
f(i.$slots, "before-save-button"), | ||
f(i.$slots, "action-button", {}, () => { | ||
var h; | ||
return [ | ||
r.value && ((h = r.value.actions) != null && h.length) ? (u(), m(j, { key: 0 }, [ | ||
r.value.actions.length === 1 ? (u(), E($(F), { | ||
key: 0, | ||
class: "btn-primary", | ||
onClick: l[4] || (l[4] = (g) => s("save")) | ||
class: "btn-secondary btn-sm flex items-center gap-2", | ||
onClick: l[3] || (l[3] = (C) => q(r.value, r.value.actions[0])) | ||
}, { | ||
default: f(() => [ | ||
P(y(i.saveButtonLabel), 1) | ||
default: v(() => [ | ||
P(b(r.value.actions[0].name), 1) | ||
]), | ||
_: 1 | ||
})) : w("", !0) | ||
})) : (u(), m("div", Ne, [ | ||
w($(Se), { | ||
label: "Fix Errors", | ||
"button-class": "btn-sm btn-primary", | ||
dropup: "" | ||
}, { | ||
default: v(() => [ | ||
(u(!0), m(j, null, he(r.value.actions, (C, g) => (u(), m("button", { | ||
key: `${r.value.rule.id}-${g}`, | ||
type: "button", | ||
variant: "light", | ||
onClick: (ct) => q(r.value, C) | ||
}, b(C.name), 9, qe))), 128)) | ||
]), | ||
_: 1 | ||
}) | ||
])) | ||
], 64)) : y("", !0) | ||
]; | ||
}), | ||
f(i.$slots, "save-button", { | ||
diagnostics: a.value, | ||
saveButtonLabel: a.value | ||
}, () => [ | ||
i.saveButton && !a.value.length ? (u(), E($(F), { | ||
key: 0, | ||
class: "btn-primary", | ||
onClick: l[4] || (l[4] = (h) => s("save")) | ||
}, { | ||
default: v(() => [ | ||
P(b(i.saveButtonLabel), 1) | ||
]), | ||
p(i.$slots, "after-save-button", { diagnostics: a.value }) | ||
]) | ||
])) : w("", !0) | ||
]; | ||
}), | ||
_: 3 | ||
}) | ||
])); | ||
_: 1 | ||
})) : y("", !0) | ||
]), | ||
f(i.$slots, "after-save-button", { diagnostics: a.value }) | ||
]) | ||
])) : y("", !0) | ||
]); | ||
}; | ||
} | ||
}), Ge = O({ | ||
}), je = O({ | ||
model: { | ||
@@ -232,10 +214,10 @@ prop: "currentValue" | ||
} | ||
}), je = { class: "flex justify-between px-2 py-1 text-stone-800 bg-stone-200 dark:text-stone-200 dark:bg-stone-800" }, Pe = { class: "flex-1" }, Ue = ["disabled"]; | ||
function We(e, t, o, n, s, r) { | ||
return c(), m("div", je, [ | ||
h("div", null, [ | ||
p(e.$slots, "left") | ||
}), Pe = { class: "flex justify-between px-2 py-1 text-stone-800 bg-stone-200 dark:text-stone-200 dark:bg-stone-800" }, Ue = { class: "flex-1" }, We = ["disabled"]; | ||
function He(e, t, o, n, s, r) { | ||
return u(), m("div", Pe, [ | ||
p("div", null, [ | ||
f(e.$slots, "left") | ||
]), | ||
h("div", Pe, [ | ||
ve(h("input", { | ||
p("div", Ue, [ | ||
ge(p("input", { | ||
"onUpdate:modelValue": t[0] || (t[0] = (a) => e.currentValue = a), | ||
@@ -247,12 +229,12 @@ type: "text", | ||
onInput: t[1] || (t[1] = (a) => e.$emit("update:filename", e.currentValue)) | ||
}, null, 40, Ue), [ | ||
[be, e.currentValue] | ||
}, null, 40, We), [ | ||
[ve, e.currentValue] | ||
]) | ||
]), | ||
h("div", null, [ | ||
p(e.$slots, "right") | ||
p("div", null, [ | ||
f(e.$slots, "right") | ||
]) | ||
]); | ||
} | ||
const He = /* @__PURE__ */ _(Ge, [["render", We]]), Je = [{ | ||
const Je = /* @__PURE__ */ N(je, [["render", He]]), Ke = [{ | ||
name: "Remove Attribute", | ||
@@ -270,3 +252,3 @@ apply(e, t, o) { | ||
return; | ||
const [s, r] = n, a = t + s.indexOf(r), u = e.state.update({ | ||
const [s, r] = n, a = t + s.indexOf(r), c = e.state.update({ | ||
selection: { | ||
@@ -278,5 +260,5 @@ anchor: a, | ||
}); | ||
e.dispatch(u), e.focus(); | ||
e.dispatch(c), e.focus(); | ||
} | ||
}], Ke = [{ | ||
}], ze = [{ | ||
name: "Remove", | ||
@@ -288,3 +270,3 @@ apply(e, t, o) { | ||
} | ||
}], ze = [{ | ||
}], Qe = [{ | ||
name: "Fix Error", | ||
@@ -296,3 +278,3 @@ apply(e, t, o) { | ||
} | ||
}], Qe = [{ | ||
}], Xe = [{ | ||
name: "Remove Entity", | ||
@@ -320,3 +302,3 @@ apply(e, t, o) { | ||
} | ||
}], Xe = [{ | ||
}], Ye = [{ | ||
name: "Fix Error", | ||
@@ -331,11 +313,11 @@ apply(e, t, o) { | ||
"&": "&" | ||
}, [r, a] = n, u = r.indexOf(a); | ||
}, [r, a] = n, c = r.indexOf(a); | ||
e.dispatch({ | ||
changes: { from: t + u, to: t + u + 1, insert: s[a] } | ||
changes: { from: t + c, to: t + c + 1, insert: s[a] } | ||
}); | ||
} | ||
}], Ye = [{ | ||
}], Ze = [{ | ||
name: "Remove Img", | ||
apply(e, t) { | ||
const o = N(e.state).cursor(t); | ||
const o = A(e.state).cursor(t); | ||
e.dispatch({ | ||
@@ -345,11 +327,11 @@ changes: { from: o.from, to: o.to, insert: "" } | ||
} | ||
}], Ze = [ | ||
}], et = [ | ||
{ | ||
name: "Close Tag", | ||
apply(e, t, o) { | ||
var u; | ||
let s = N(e.state).resolveInner(o, -1); | ||
var c; | ||
let s = A(e.state).resolveInner(o, -1); | ||
for (; s != null && s.parent && !(s.name === "Element" && !s.getChild("CloseTag")); ) | ||
s = s.parent; | ||
const r = (u = s.firstChild) == null ? void 0 : u.getChild("TagName"); | ||
const r = (c = s.firstChild) == null ? void 0 : c.getChild("TagName"); | ||
if (!r) | ||
@@ -370,3 +352,3 @@ return; | ||
} | ||
], et = [{ | ||
], tt = [{ | ||
name: "Fix Path", | ||
@@ -377,6 +359,6 @@ apply(e, t, o) { | ||
return; | ||
const [s, r, a] = n, u = t + r.length + (n.index ?? 0), d = e.state.update({ | ||
const [s, r, a] = n, c = t + r.length + (n.index ?? 0), d = e.state.update({ | ||
selection: { | ||
anchor: u, | ||
head: u + (a ? a.length : 0) | ||
anchor: c, | ||
head: c + (a ? a.length : 0) | ||
}, | ||
@@ -397,3 +379,3 @@ scrollIntoView: !0 | ||
apply(e, t) { | ||
const o = N(e.state).cursor(t); | ||
const o = A(e.state).cursor(t); | ||
o.moveTo(o.to), e.dispatch({ | ||
@@ -403,13 +385,13 @@ changes: { from: o.from, to: o.to, insert: "" } | ||
} | ||
}], W = { | ||
"attr-no-duplication": Je, | ||
"html-valid-children": Ke, | ||
"invalid-attribute-char": ze, | ||
"no-enties-in-attributes": Qe, | ||
"spec-char-escape": Xe, | ||
"src-not-empty": Ye, | ||
"tag-pair": Ze, | ||
"valid-path-format": et | ||
}], U = { | ||
"attr-no-duplication": Ke, | ||
"html-valid-children": ze, | ||
"invalid-attribute-char": Qe, | ||
"no-enties-in-attributes": Xe, | ||
"spec-char-escape": Ye, | ||
"src-not-empty": Ze, | ||
"tag-pair": et, | ||
"valid-path-format": tt | ||
}; | ||
class H extends ce { | ||
class W extends ce { | ||
constructor(t) { | ||
@@ -476,7 +458,7 @@ super(), this.diagnostic = t, this.diagnostic = t; | ||
const s = T.widget({ | ||
widget: new H(n), | ||
widget: new W(n), | ||
diagnostic: n, | ||
side: 0 | ||
}).range(n.from), r = T.widget({ | ||
widget: new H(n), | ||
widget: new W(n), | ||
diagnostic: n, | ||
@@ -496,3 +478,3 @@ side: 1, | ||
} | ||
const x = oe.define(), tt = new class extends ie { | ||
const _ = te.define(), ot = new class extends ae { | ||
toDOM() { | ||
@@ -502,6 +484,6 @@ const e = document.createElement("div"); | ||
} | ||
}(), ot = le({ | ||
}(), nt = ie({ | ||
markers(e) { | ||
const t = e.state.field(B).diagnostics.reduce((o, n) => (o.find(({ line: s }) => n.line === s) || o.push(n), o), []); | ||
return ne.of(t.map(({ from: o }) => { | ||
return oe.of(t.map(({ from: o }) => { | ||
const n = e.state.doc.lineAt(Math.min(e.state.doc.length, o)); | ||
@@ -511,7 +493,7 @@ return { | ||
to: n.to, | ||
value: tt | ||
value: ot | ||
}; | ||
})); | ||
} | ||
}), B = se.define({ | ||
}), B = ne.define({ | ||
create() { | ||
@@ -524,3 +506,3 @@ return new V(T.none); | ||
for (const o of t.effects) | ||
if (o.is(x)) | ||
if (o.is(_)) | ||
return V.init(o.value); | ||
@@ -531,8 +513,8 @@ return e; | ||
return [ | ||
ye((t) => { | ||
const { doc: o } = t.state.toJSON(), n = Ve(o).map((s) => { | ||
const r = t.state.doc.line(s.line), a = Math.min(o.length, r.from - 1 + s.col), u = Math.min(o.length, a + s.raw.length); | ||
$e((t) => { | ||
const { doc: o } = t.state.toJSON(), n = Ee(o).map((s) => { | ||
const r = t.state.doc.line(s.line), a = Math.min(o.length, r.from - 1 + s.col), c = Math.min(o.length, a + s.raw.length); | ||
return { | ||
from: a, | ||
to: u, | ||
to: c, | ||
col: s.col, | ||
@@ -544,7 +526,7 @@ line: s.line, | ||
source: s.rule.id, | ||
actions: s.rule.id in W && W[s.rule.id] | ||
actions: s.rule.id in U && U[s.rule.id] | ||
}; | ||
}); | ||
return t.dispatch({ | ||
effects: x.of(n) | ||
effects: _.of(n) | ||
}), n; | ||
@@ -561,7 +543,7 @@ }, { | ||
}); | ||
function nt(e) { | ||
function st(e) { | ||
return [ | ||
B, | ||
ot, | ||
ue.of(() => ({ | ||
nt, | ||
le.of(() => ({ | ||
bottom: !0, | ||
@@ -577,3 +559,3 @@ dom: e.$refs.footer.$el | ||
for (const n of o.effects) | ||
n.is(x) && e.$refs.footer.update( | ||
n.is(_) && e.$refs.footer.update( | ||
t.state.field(B).diagnostics | ||
@@ -586,6 +568,6 @@ ); | ||
} | ||
const st = O({ | ||
const rt = O({ | ||
components: { | ||
EditorFooter: qe, | ||
EditorToolbar: He | ||
EditorFooter: Ge, | ||
EditorToolbar: Je | ||
}, | ||
@@ -637,3 +619,3 @@ props: { | ||
return { | ||
themeConfig: new re(), | ||
themeConfig: new se(), | ||
errors: [], | ||
@@ -658,5 +640,5 @@ hasDismissedFinishPopup: !1, | ||
extensions: [ | ||
pe | ||
fe | ||
], | ||
state: ae.create({ | ||
state: re.create({ | ||
doc: this.content, | ||
@@ -670,3 +652,3 @@ extensions: this.extensions() | ||
extensions() { | ||
const e = this, t = de.fromClass(class { | ||
const e = this, t = ue.fromClass(class { | ||
constructor() { | ||
@@ -690,9 +672,9 @@ M(this, "height", "0px"); | ||
}), | ||
fe(), | ||
ee(), | ||
de(), | ||
Z(), | ||
// highlightSelectionMatches(), | ||
G.of(te), | ||
G.of([Y]), | ||
Z(), | ||
this.footer && nt(this), | ||
G.of(ee), | ||
G.of([X]), | ||
Y(), | ||
this.footer && st(this), | ||
S.lineWrapping, | ||
@@ -743,10 +725,10 @@ S.updateListener.of((o) => { | ||
} | ||
}), rt = { class: "capsule-editor" }, at = { | ||
}), at = { class: "capsule-editor" }, it = { | ||
ref: "wrapper", | ||
class: "cm-wrapper h-full w-full" | ||
}; | ||
function it(e, t, o, n, s, r) { | ||
const a = A("editor-toolbar"), u = A("editor-footer"); | ||
return c(), m("div", rt, [ | ||
e.toolbar ? (c(), E(a, { | ||
function lt(e, t, o, n, s, r) { | ||
const a = x("editor-toolbar"), c = x("editor-footer"); | ||
return u(), m("div", at, [ | ||
e.toolbar ? (u(), E(a, { | ||
key: 0, | ||
@@ -758,4 +740,4 @@ ref: "toolbar", | ||
}, { | ||
left: f(() => [ | ||
p(e.$slots, "toolbar-left", { | ||
left: v(() => [ | ||
f(e.$slots, "toolbar-left", { | ||
errors: e.errors, | ||
@@ -766,4 +748,4 @@ filename: e.filename, | ||
]), | ||
right: f(() => [ | ||
p(e.$slots, "toolbar-right", { | ||
right: v(() => [ | ||
f(e.$slots, "toolbar-right", { | ||
errors: e.errors, | ||
@@ -775,5 +757,5 @@ filename: e.filename, | ||
_: 3 | ||
}, 8, ["disable-filename", "filename"])) : w("", !0), | ||
h("div", at, null, 512), | ||
e.footer ? (c(), E(u, { | ||
}, 8, ["disable-filename", "filename"])) : y("", !0), | ||
p("div", it, null, 512), | ||
e.footer ? (u(), E(c, { | ||
key: 1, | ||
@@ -788,4 +770,4 @@ ref: "footer", | ||
}, { | ||
"before-save-button": f(() => [ | ||
p(e.$slots, "before-save-button", { | ||
"before-save-button": v(() => [ | ||
f(e.$slots, "before-save-button", { | ||
errors: e.errors, | ||
@@ -796,4 +778,4 @@ filename: e.filename, | ||
]), | ||
"save-button": f(() => [ | ||
p(e.$slots, "save-button", { | ||
"save-button": v(() => [ | ||
f(e.$slots, "save-button", { | ||
errors: e.errors, | ||
@@ -804,4 +786,4 @@ filename: e.filename, | ||
]), | ||
"after-save-button": f(() => [ | ||
p(e.$slots, "after-save-button", { | ||
"after-save-button": v(() => [ | ||
f(e.$slots, "after-save-button", { | ||
errors: e.errors, | ||
@@ -813,6 +795,6 @@ filename: e.filename, | ||
_: 3 | ||
}, 8, ["modelValue", "save-button", "view", "onSave", "onGoto"])) : w("", !0) | ||
}, 8, ["modelValue", "save-button", "view", "onSave", "onGoto"])) : y("", !0) | ||
]); | ||
} | ||
const Et = /* @__PURE__ */ _(st, [["render", it]]); | ||
const Et = /* @__PURE__ */ N(rt, [["render", lt]]); | ||
export { | ||
@@ -819,0 +801,0 @@ Et as Editor |
@@ -50,3 +50,3 @@ import { Compartment, Extension } from '@codemirror/state'; | ||
onSave(): void; | ||
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("save" | "update:filename" | "fixed-errors" | "update:content")[], "save" | "update:filename" | "fixed-errors" | "update:content", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ | ||
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("save" | "update:filename" | "fixed-errors" | "update:content")[], "save" | "update:filename" | "fixed-errors" | "update:content", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{ | ||
content: { | ||
@@ -53,0 +53,0 @@ type: StringConstructor; |
@@ -8,3 +8,3 @@ declare const _default: import("vue").DefineComponent<{ | ||
url(): any; | ||
}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ | ||
}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{ | ||
error: { | ||
@@ -11,0 +11,0 @@ type: ObjectConstructor; |
@@ -21,3 +21,3 @@ import { Diagnostic } from '@codemirror/lint'; | ||
save: () => void; | ||
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{ | ||
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{ | ||
saveButton?: boolean | undefined; | ||
@@ -24,0 +24,0 @@ saveButtonLabel?: string | undefined; |
@@ -9,3 +9,3 @@ declare const _default: import("vue").DefineComponent<{ | ||
currentValue: string | undefined; | ||
}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:filename"[], "update:filename", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ | ||
}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:filename"[], "update:filename", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{ | ||
disableFilename: BooleanConstructor; | ||
@@ -12,0 +12,0 @@ filename: { |
{ | ||
"name": "capsule-editor", | ||
"version": "2.0.0-beta.28", | ||
"version": "2.0.0-beta.29", | ||
"files": [ | ||
@@ -39,3 +39,2 @@ "src", | ||
"@lezer/common": "^1.1.2", | ||
"@vue-interface/animate-css": "^2.0.0-beta.0", | ||
"@vue-interface/btn": "^3.0.0-beta.19", | ||
@@ -54,6 +53,6 @@ "@vue-interface/btn-dropdown": "^2.0.0-beta.0", | ||
"@semantic-release/npm": "^10.0.6", | ||
"@vitejs/plugin-vue": "^4.5.2", | ||
"@vue/compiler-sfc": "^3.3.13", | ||
"@vitejs/plugin-vue": "^4.6.2", | ||
"@vue/compiler-sfc": "^3.4.15", | ||
"@vue/eslint-config-typescript": "^11.0.3", | ||
"autoprefixer": "^10.4.16", | ||
"autoprefixer": "^10.4.17", | ||
"change-case": "^4.1.2", | ||
@@ -63,15 +62,15 @@ "cm6-theme-basic-dark": "^0.2.0", | ||
"commitlint": "^17.8.1", | ||
"dotenv": "^16.3.1", | ||
"dotenv": "^16.4.1", | ||
"eslint": "^8.56.0", | ||
"eslint-plugin-vue": "^9.19.2", | ||
"eslint-plugin-vue": "^9.20.1", | ||
"husky": "^8.0.3", | ||
"pascalcase": "^2.0.0", | ||
"postcss": "^8.4.32", | ||
"postcss": "^8.4.33", | ||
"semantic-release": "^21.1.2", | ||
"tailwindcss": "^3.4.0", | ||
"tailwindcss": "^3.4.1", | ||
"typescript": "^5.3.3", | ||
"vite": "^4.5.1", | ||
"vite-plugin-dts": "^3.6.4", | ||
"vue": "^3.3.13" | ||
"vite": "^4.5.2", | ||
"vite-plugin-dts": "^3.7.2", | ||
"vue": "^3.4.15" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
19
0
173598
1528