codemirror-editor-vue3
Advanced tools
Comparing version 2.5.0-beta.5 to 2.5.0-beta.6
@@ -0,1 +1,16 @@ | ||
# [2.5.0-beta.6](https://github.com/rennzhang/codemirror-editor-vue3/compare/v2.5.0-beta.5...v2.5.0-beta.6) (2024-03-28) | ||
### Bug Fixes | ||
* 去除多余样式 ([bcb810d](https://github.com/rennzhang/codemirror-editor-vue3/commit/bcb810d3c7d5c019d2c894106070d93a19a32c0b)) | ||
* 修复路径报错 ([439b8cc](https://github.com/rennzhang/codemirror-editor-vue3/commit/439b8cce758c996efa1b8fb662ca9f6c677c345c)) | ||
### Features | ||
* 宽高支持百分比 ([dda1e5b](https://github.com/rennzhang/codemirror-editor-vue3/commit/dda1e5b85b38f987fba236a05fd7917c285ab1b5)) | ||
# [2.5.0-beta.5](https://github.com/rennzhang/codemirror-editor-vue3/compare/v2.5.0-beta.4...v2.5.0-beta.5) (2024-03-28) | ||
@@ -2,0 +17,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { defineComponent as M, ref as v, onMounted as L, markRaw as j, watch as x, unref as w, openBlock as b, createElementBlock as S, computed as T, nextTick as q, shallowRef as K, getCurrentInstance as Q, onBeforeUnmount as X, normalizeClass as Y, normalizeStyle as ee, createBlock as te, resolveDynamicComponent as ne, mergeProps as oe } from "vue"; | ||
import { defineComponent as M, ref as x, onMounted as j, markRaw as T, watch as $, unref as k, openBlock as S, createElementBlock as E, computed as I, nextTick as K, shallowRef as Q, getCurrentInstance as X, onBeforeUnmount as Y, normalizeClass as ee, normalizeStyle as te, createBlock as ne, resolveDynamicComponent as re, mergeProps as oe } from "vue"; | ||
import "codemirror/lib/codemirror.css"; | ||
@@ -8,9 +8,9 @@ import "codemirror/addon/fold/foldgutter.css"; | ||
import "codemirror/addon/selection/active-line.js"; | ||
import R from "codemirror"; | ||
import z from "codemirror"; | ||
import "codemirror/addon/merge/merge.css"; | ||
import "codemirror/addon/merge/merge.js"; | ||
import re from "diff-match-patch"; | ||
import se from "diff-match-patch"; | ||
import "codemirror/addon/mode/simple.js"; | ||
!window.CodeMirror && (window.CodeMirror = R); | ||
const _ = window.CodeMirror || R, se = M({ | ||
!window.CodeMirror && (window.CodeMirror = z); | ||
const _ = window.CodeMirror || z, ae = M({ | ||
name: "DefaultMode", | ||
@@ -48,9 +48,9 @@ props: { | ||
setup(e, { emit: n }) { | ||
const r = v(), t = v(null), o = () => { | ||
t.value = j(_.fromTextArea(r.value, e.options)), n("update:cminstance", t.value); | ||
const s = x( | ||
const o = x(), t = x(null), r = () => { | ||
t.value = T(_.fromTextArea(o.value, e.options)), n("update:cminstance", t.value); | ||
const s = $( | ||
() => e.cminstance, | ||
(l) => { | ||
var m; | ||
l && ((m = e.cminstance) == null || m.setValue(e.value || e.content)), n("ready", w(t)), s == null || s(); | ||
l && ((m = e.cminstance) == null || m.setValue(e.value || e.content)), n("ready", k(t)), s == null || s(); | ||
}, | ||
@@ -60,28 +60,28 @@ { deep: !0 } | ||
}; | ||
return L(() => { | ||
o(); | ||
return j(() => { | ||
r(); | ||
}), { | ||
textarea: r, | ||
initialize: o | ||
textarea: o, | ||
initialize: r | ||
}; | ||
} | ||
}), I = (e, n) => { | ||
const r = e.__vccOpts || e; | ||
for (const [t, o] of n) | ||
r[t] = o; | ||
return r; | ||
}, ae = ["name", "placeholder"]; | ||
function le(e, n, r, t, o, s) { | ||
return b(), S("textarea", { | ||
}), A = (e, n) => { | ||
const o = e.__vccOpts || e; | ||
for (const [t, r] of n) | ||
o[t] = r; | ||
return o; | ||
}, le = ["name", "placeholder"]; | ||
function ie(e, n, o, t, r, s) { | ||
return S(), E("textarea", { | ||
ref: "textarea", | ||
name: e.$props.name, | ||
placeholder: e.$props.placeholder | ||
}, null, 8, ae); | ||
}, null, 8, le); | ||
} | ||
const F = /* @__PURE__ */ I(se, [["render", le]]); | ||
window.diff_match_patch = re; | ||
const H = /* @__PURE__ */ A(ae, [["render", ie]]); | ||
window.diff_match_patch = se; | ||
window.DIFF_DELETE = -1; | ||
window.DIFF_INSERT = 1; | ||
window.DIFF_EQUAL = 0; | ||
const ie = M({ | ||
const ce = M({ | ||
name: "MergeMode", | ||
@@ -100,77 +100,77 @@ props: { | ||
setup(e, { emit: n }) { | ||
const r = v(), t = v(), o = () => { | ||
r.value = j( | ||
const o = x(), t = x(), r = () => { | ||
o.value = T( | ||
_.MergeView(t.value, e.options) | ||
), n("update:cminstance", r.value), n("ready", r); | ||
), n("update:cminstance", o.value), n("ready", o); | ||
}; | ||
return L(() => { | ||
o(); | ||
return j(() => { | ||
r(); | ||
}), { | ||
mergeView: t, | ||
initialize: o | ||
initialize: r | ||
}; | ||
} | ||
}), ce = { ref: "mergeView" }; | ||
function ue(e, n, r, t, o, s) { | ||
return b(), S("div", ce, null, 512); | ||
}), ue = { ref: "mergeView" }; | ||
function de(e, n, o, t, r, s) { | ||
return S(), E("div", ue, null, 512); | ||
} | ||
const de = /* @__PURE__ */ I(ie, [["render", ue]]); | ||
var pe = /* @__PURE__ */ ((e) => (e.info = "info", e.warning = "warning", e.error = "error", e))(pe || {}); | ||
function me() { | ||
const e = /* @__PURE__ */ new Date(), n = e.getHours() < 10 ? `0${e.getHours()}` : e.getHours(), r = e.getMinutes() < 10 ? `0${e.getMinutes()}` : e.getMinutes(), t = e.getSeconds() < 10 ? `0${e.getSeconds()}` : e.getSeconds(); | ||
return `${n}:${r}:${t}`; | ||
const pe = /* @__PURE__ */ A(ce, [["render", de]]); | ||
var me = /* @__PURE__ */ ((e) => (e.info = "info", e.warning = "warning", e.error = "error", e))(me || {}); | ||
function ge() { | ||
const e = /* @__PURE__ */ new Date(), n = e.getHours() < 10 ? `0${e.getHours()}` : e.getHours(), o = e.getMinutes() < 10 ? `0${e.getMinutes()}` : e.getMinutes(), t = e.getSeconds() < 10 ? `0${e.getSeconds()}` : e.getSeconds(); | ||
return `${n}:${o}:${t}`; | ||
} | ||
function Fe(e) { | ||
function He(e) { | ||
return `#link#${JSON.stringify(e)}#link#`; | ||
} | ||
function ge(e) { | ||
const n = /#link#(.+)#link#/g, r = []; | ||
function fe(e) { | ||
const n = /#link#(.+)#link#/g, o = []; | ||
let t; | ||
for (t = n.exec(e); t; ) { | ||
const o = document.createElement("a"), s = JSON.parse(t[1]), l = Object.entries(s); | ||
const r = document.createElement("a"), s = JSON.parse(t[1]), l = Object.entries(s); | ||
for (const [m, u] of l) | ||
o.setAttribute(m, u); | ||
o.className = "editor_custom_link", o.innerHTML = "logDownload", r.push({ | ||
r.setAttribute(m, u); | ||
r.className = "editor_custom_link", r.innerHTML = "logDownload", o.push({ | ||
start: t.index, | ||
end: t.index + t[0].length, | ||
node: o | ||
node: r | ||
}), t = n.exec(e); | ||
} | ||
return r; | ||
return o; | ||
} | ||
function He(e = "", n = "info") { | ||
function Re(e = "", n = "info") { | ||
return `#log<${n}>log#${e}#log<${n}>log#`; | ||
} | ||
function fe(e) { | ||
function he(e) { | ||
const n = []; | ||
function r() { | ||
function o() { | ||
const t = /#log<(\w*)>log#((.|\r\n|\n)*?)#log<(\w*)>log#/g; | ||
let o; | ||
for (o = t.exec(e); o; ) { | ||
const l = o[0].replace(/\r\n/g, ` | ||
let r; | ||
for (r = t.exec(e); r; ) { | ||
const l = r[0].replace(/\r\n/g, ` | ||
`).split(` | ||
`), u = o[2].replace(/\r\n/g, ` | ||
`), u = r[2].replace(/\r\n/g, ` | ||
`).split(` | ||
`), d = document.createElement("span"), c = o[1]; | ||
d.className = `c-editor--log__${c}`; | ||
`), d = document.createElement("span"), i = r[1]; | ||
d.className = `c-editor--log__${i}`; | ||
let p = 0; | ||
for (let i = 0; i < l.length; i++) { | ||
const f = l[i], k = u[i], y = d.cloneNode(!1); | ||
y.innerText = k, n.push({ | ||
start: o.index + p, | ||
end: o.index + p + f.length, | ||
for (let a = 0; a < l.length; a++) { | ||
const g = l[a], v = u[a], y = d.cloneNode(!1); | ||
y.innerText = v, n.push({ | ||
start: r.index + p, | ||
end: r.index + p + g.length, | ||
node: y | ||
}), p = p + f.length + 1; | ||
}), p = p + g.length + 1; | ||
} | ||
o = t.exec(e); | ||
r = t.exec(e); | ||
} | ||
} | ||
return r(), n; | ||
return o(), n; | ||
} | ||
function Re(e, n) { | ||
return `[${me()}] <${n}> ${e}`; | ||
function ze(e, n) { | ||
return `[${ge()}] <${n}> ${e}`; | ||
} | ||
function ze(e, n, r) { | ||
const o = new Array(Math.max(n || 15, 5)).join(r || "="); | ||
return `${o}${e}${o}`; | ||
function Be(e, n, o) { | ||
const r = new Array(Math.max(n || 15, 5)).join(o || "="); | ||
return `${r}${e}${r}`; | ||
} | ||
@@ -251,3 +251,3 @@ const C = [ | ||
}); | ||
const he = M({ | ||
const ve = M({ | ||
name: "CodemirrorFclog", | ||
@@ -278,7 +278,7 @@ props: { | ||
setup(e, { emit: n }) { | ||
const r = v(), t = v(null), o = (l = e.cminstance) => { | ||
l.getAllMarks().forEach((c) => c.clear()); | ||
const u = l.getValue(), d = [].concat(ge(u)).concat(fe(u)); | ||
for (let c = 0; c < d.length; c++) { | ||
const p = d[c]; | ||
const o = x(), t = x(null), r = (l = e.cminstance) => { | ||
l.getAllMarks().forEach((i) => i.clear()); | ||
const u = l.getValue(), d = [].concat(fe(u)).concat(he(u)); | ||
for (let i = 0; i < d.length; i++) { | ||
const p = d[i]; | ||
l.markText( | ||
@@ -292,27 +292,27 @@ l.posFromIndex(p.start), | ||
var l; | ||
t.value = j(_.fromTextArea(r.value, e.options)), n("update:cminstance", w(t)), (l = t.value) == null || l.on("change", o); | ||
t.value = T(_.fromTextArea(o.value, e.options)), n("update:cminstance", k(t)), (l = t.value) == null || l.on("change", r); | ||
}; | ||
return x( | ||
return $( | ||
() => e.cminstance, | ||
(l) => { | ||
var m; | ||
l && (o(e.cminstance), (m = e.cminstance) == null || m.setValue(e.value), n("ready", t)); | ||
l && (r(e.cminstance), (m = e.cminstance) == null || m.setValue(e.value), n("ready", t)); | ||
}, | ||
{ deep: !0, immediate: !0 } | ||
), L(() => { | ||
), j(() => { | ||
s(); | ||
}), { | ||
initialize: s, | ||
textarea: r | ||
textarea: o | ||
}; | ||
} | ||
}), ve = ["name", "placeholder"]; | ||
function ye(e, n, r, t, o, s) { | ||
return b(), S("textarea", { | ||
}), ye = ["name", "placeholder"]; | ||
function ke(e, n, o, t, r, s) { | ||
return S(), E("textarea", { | ||
ref: "textarea", | ||
name: e.$props.name, | ||
placeholder: e.$props.placeholder | ||
}, null, 8, ve); | ||
}, null, 8, ye); | ||
} | ||
const we = /* @__PURE__ */ I(he, [["render", ye]]), z = { | ||
const xe = /* @__PURE__ */ A(ve, [["render", ke]]), B = { | ||
"update:value": () => !0, | ||
@@ -322,3 +322,3 @@ change: (e, n) => ({ value: e, cm: n }), | ||
ready: (e) => e | ||
}, ke = [ | ||
}, we = [ | ||
"changes", | ||
@@ -344,6 +344,6 @@ "scroll", | ||
const e = {}; | ||
return ke.forEach((n) => { | ||
e[n] = (...r) => r; | ||
return we.forEach((n) => { | ||
e[n] = (...o) => o; | ||
}), e; | ||
}, xe = { ...z, ...$e() }, O = { | ||
}, _e = { ...B, ...$e() }, L = { | ||
mode: "text", | ||
@@ -360,3 +360,3 @@ // Language mode | ||
}; | ||
function _e(e) { | ||
function Se(e) { | ||
Promise.resolve().then(() => { | ||
@@ -370,10 +370,10 @@ const n = e.getScrollInfo(); | ||
cminstance: n, | ||
emit: r, | ||
emit: o, | ||
internalInstance: t, | ||
content: o | ||
content: r | ||
}) => { | ||
const s = T( | ||
const s = I( | ||
() => { | ||
var u; | ||
return e.merge ? (u = w(n)) == null ? void 0 : u.editor() : w(n); | ||
return e.merge ? (u = k(n)) == null ? void 0 : u.editor() : k(n); | ||
} | ||
@@ -384,4 +384,4 @@ ), l = () => { | ||
if (d.startsWith("on")) { | ||
const c = d.replace(d[2], d[2].toLowerCase()).slice(2); | ||
!z[c] && u.push(c); | ||
const i = d.replace(d[2], d[2].toLowerCase()).slice(2); | ||
!B[i] && u.push(i); | ||
} | ||
@@ -392,12 +392,12 @@ }), u; | ||
listenerEvents: () => { | ||
s.value.on("change", (c) => { | ||
const p = c.getValue(); | ||
p === o.value && p !== "" || (o.value = p, r("update:value", o.value || ""), r("input", o.value || " "), Promise.resolve().then(() => { | ||
r("change", o.value, c); | ||
}), e.keepCursorInEnd && _e(c)); | ||
s.value.on("change", (i) => { | ||
const p = i.getValue(); | ||
p === r.value && p !== "" || (r.value = p, o("update:value", r.value || ""), o("input", r.value || " "), Promise.resolve().then(() => { | ||
o("change", r.value, i); | ||
}), e.keepCursorInEnd && Se(i)); | ||
}); | ||
const u = {}; | ||
l().filter((c) => !u[c] && (u[c] = !0)).forEach((c) => { | ||
s.value.on(c, (...p) => { | ||
r(c, ...p); | ||
l().filter((i) => !u[i] && (u[i] = !0)).forEach((i) => { | ||
s.value.on(i, (...p) => { | ||
o(i, ...p); | ||
}); | ||
@@ -408,29 +408,28 @@ }); | ||
}; | ||
function Ce({ props: e, cminstance: n, presetRef: r }) { | ||
const t = v(null), o = v(null), s = T( | ||
function Ce({ props: e, cminstance: n, presetRef: o }) { | ||
const t = x("100%"), r = x("100%"), s = I( | ||
() => { | ||
var i; | ||
return e.merge ? (i = w(n)) == null ? void 0 : i.editor() : w(n); | ||
var a; | ||
return e.merge ? (a = k(n)) == null ? void 0 : a.editor() : k(n); | ||
} | ||
), l = () => { | ||
q(() => { | ||
var i; | ||
(i = s.value) == null || i.refresh(); | ||
K(() => { | ||
var a; | ||
(a = s.value) == null || a.refresh(); | ||
}); | ||
}, m = (i = e.width, f = e.height) => { | ||
var y; | ||
t.value = String(i).replace("px", ""), o.value = String(f).replace("px", ""); | ||
const k = o.value; | ||
(y = s.value) == null || y.setSize(t.value, k); | ||
}, m = (a = e.width, g = e.height) => { | ||
var b; | ||
let v = "", y = ""; | ||
String(a).includes("%") ? (y = "100%", t.value = String(a)) : (y = String(a).replace("px", ""), t.value = `${y}px`), String(g).includes("%") ? (v = "100%", r.value = String(g)) : (v = String(g).replace("px", ""), r.value = `${v}px`), (b = s.value) == null || b.setSize(y, v); | ||
}, u = () => { | ||
var f; | ||
const i = (f = s.value) == null ? void 0 : f.getWrapperElement(); | ||
i == null || i.remove(); | ||
var g; | ||
const a = (g = s.value) == null ? void 0 : g.getWrapperElement(); | ||
a == null || a.remove(); | ||
}, d = () => { | ||
var f, k, y; | ||
const i = (f = s.value) == null ? void 0 : f.getDoc().getHistory(); | ||
(k = r.value) == null || k.initialize(), u(), (y = s.value) == null || y.getDoc().setHistory(i); | ||
}, c = () => { | ||
const i = document.querySelector(".CodeMirror-gutters"); | ||
return (i == null ? void 0 : i.style.left.replace("px", "")) !== "0"; | ||
var g, v, y; | ||
const a = (g = s.value) == null ? void 0 : g.getDoc().getHistory(); | ||
(v = o.value) == null || v.initialize(), u(), (y = s.value) == null || y.getDoc().setHistory(a); | ||
}, i = () => { | ||
const a = document.querySelector(".CodeMirror-gutters"); | ||
return (a == null ? void 0 : a.style.left.replace("px", "")) !== "0"; | ||
}; | ||
@@ -442,10 +441,11 @@ return { | ||
destroy: u, | ||
containerHeight: o, | ||
containerWidth: t, | ||
containerHeight: r, | ||
reviseStyle: () => { | ||
if (l(), !c()) | ||
if (l(), !i()) | ||
return; | ||
const i = setInterval(() => { | ||
c() ? l() : clearInterval(i); | ||
}, 60), f = setTimeout(() => { | ||
clearInterval(i), clearTimeout(f); | ||
const a = setInterval(() => { | ||
i() ? l() : clearInterval(a); | ||
}, 60), g = setTimeout(() => { | ||
clearInterval(a), clearTimeout(g); | ||
}, 400); | ||
@@ -455,3 +455,3 @@ } | ||
} | ||
const H = /* @__PURE__ */ M({ | ||
const R = /* @__PURE__ */ M({ | ||
__name: "index", | ||
@@ -465,7 +465,7 @@ props: { | ||
type: Object, | ||
default: () => O | ||
default: () => L | ||
}, | ||
globalOptions: { | ||
type: Object, | ||
default: () => O | ||
default: () => L | ||
}, | ||
@@ -513,17 +513,17 @@ placeholder: { | ||
}, | ||
emits: xe, | ||
setup(e, { expose: n, emit: r }) { | ||
var D, N, V; | ||
emits: _e, | ||
setup(e, { expose: n, emit: o }) { | ||
var N, V, F; | ||
typeof Object.assign != "function" && Object.defineProperty(Object, "assign", { | ||
value(a) { | ||
if (a == null) | ||
value(c) { | ||
if (c == null) | ||
throw new TypeError("Cannot convert undefined or null to object"); | ||
const g = Object(a); | ||
const f = Object(c); | ||
for (let h = 1; h < arguments.length; h++) { | ||
const $ = arguments[h]; | ||
if ($ != null) | ||
for (const E in $) | ||
Object.prototype.hasOwnProperty.call($, E) && (g[E] = $[E]); | ||
const w = arguments[h]; | ||
if (w != null) | ||
for (const O in w) | ||
Object.prototype.hasOwnProperty.call(w, O) && (f[O] = w[O]); | ||
} | ||
return g; | ||
return f; | ||
}, | ||
@@ -533,5 +533,5 @@ writable: !0, | ||
}); | ||
const t = e, o = r, s = v(null), l = v(""), m = K(F), u = v({ | ||
const t = e, r = o, s = x(null), l = x(""), m = Q(H), u = x({ | ||
foldGutter: !0, | ||
...O, | ||
...L, | ||
...t.globalOptions, | ||
@@ -543,104 +543,108 @@ ...t.options, | ||
"CodeMirror-foldgutter", | ||
...((D = t.options) == null ? void 0 : D.gutters) || [] | ||
...((N = t.options) == null ? void 0 : N.gutters) || [] | ||
]) | ||
] | ||
}), d = Q(), c = t.name || ((V = (N = d == null ? void 0 : d.parent) == null ? void 0 : N.type) == null ? void 0 : V.name) || void 0, p = v(null), i = T( | ||
() => { | ||
var a; | ||
return t.merge ? (a = w(s)) == null ? void 0 : a.editor() : w(s); | ||
} | ||
), { refresh: f, resize: k, destroy: y, containerHeight: P, reviseStyle: U } = Ce({ | ||
}), d = X(), i = t.name || ((F = (V = d == null ? void 0 : d.parent) == null ? void 0 : V.type) == null ? void 0 : F.name) || void 0, p = x(null), a = I(() => { | ||
var c; | ||
return t.merge ? (c = k(s)) == null ? void 0 : c.editor() : k(s); | ||
}), { | ||
refresh: g, | ||
resize: v, | ||
destroy: y, | ||
containerHeight: b, | ||
containerWidth: U, | ||
reviseStyle: W | ||
} = Ce({ | ||
props: t, | ||
cminstance: s, | ||
presetRef: p | ||
}), { listenerEvents: W } = be({ | ||
}), { listenerEvents: G } = be({ | ||
props: t, | ||
cminstance: s, | ||
emit: o, | ||
emit: r, | ||
internalInstance: d, | ||
content: l | ||
}), A = () => { | ||
t.unseenLines !== void 0 && t.marker !== void 0 && t.unseenLines.forEach((a) => { | ||
var h, $; | ||
const g = (h = s.value) == null ? void 0 : h.lineInfo(a); | ||
($ = s.value) == null || $.setGutterMarker( | ||
a, | ||
}), D = () => { | ||
t.unseenLines !== void 0 && t.marker !== void 0 && t.unseenLines.forEach((c) => { | ||
var h, w; | ||
const f = (h = s.value) == null ? void 0 : h.lineInfo(c); | ||
(w = s.value) == null || w.setGutterMarker( | ||
c, | ||
"breakpoints", | ||
g != null && g.gutterMarkers ? null : t.marker() | ||
f != null && f.gutterMarkers ? null : t.marker() | ||
); | ||
}); | ||
}, G = (a) => { | ||
var h, $; | ||
const g = (h = s.value) == null ? void 0 : h.getValue(); | ||
a !== g && (($ = s.value) == null || $.setValue(a), l.value = a, U()), A(); | ||
}, J = () => { | ||
W(), A(), k(t.width, t.height), o("ready", s.value), x( | ||
}, J = (c) => { | ||
var h, w; | ||
const f = (h = s.value) == null ? void 0 : h.getValue(); | ||
c !== f && ((w = s.value) == null || w.setValue(c), l.value = c, W()), D(); | ||
}, Z = () => { | ||
G(), D(), v(t.width, t.height), r("ready", s.value), $( | ||
[() => t.width, () => t.height], | ||
([a, g]) => { | ||
k(a, g); | ||
([c, f]) => { | ||
v(c, f); | ||
}, | ||
{ deep: !0 } | ||
); | ||
}, Z = () => { | ||
}, q = () => { | ||
if (t.options.mode === "fclog" || t.options.mode === "log") { | ||
m.value = we; | ||
m.value = xe; | ||
return; | ||
} | ||
if (t.merge) { | ||
m.value = de; | ||
m.value = pe; | ||
return; | ||
} | ||
m.value = F; | ||
m.value = H; | ||
}; | ||
return x( | ||
return $( | ||
() => t.options, | ||
(a) => { | ||
var g; | ||
(c) => { | ||
var f; | ||
for (const h in t.options) | ||
(g = i.value) == null || g.setOption( | ||
(f = a.value) == null || f.setOption( | ||
h, | ||
w(a[h]) | ||
k(c[h]) | ||
); | ||
}, | ||
{ deep: !0 } | ||
), x( | ||
), $( | ||
() => t.value, | ||
(a) => { | ||
G(a); | ||
(c) => { | ||
J(c); | ||
} | ||
), x(() => t.merge, Z, { immediate: !0 }), X(() => { | ||
), $(() => t.merge, q, { immediate: !0 }), Y(() => { | ||
y(); | ||
}), n({ | ||
cminstance: s, | ||
resize: k, | ||
refresh: f, | ||
resize: v, | ||
refresh: g, | ||
destroy: y | ||
}), (a, g) => (b(), S("div", { | ||
class: Y(["codemirror-container", { | ||
merge: a.$props.merge, | ||
bordered: a.$props.border || a.$props.merge && !t.originalStyle, | ||
"width-auto": !a.$props.width || a.$props.width == "100%", | ||
"height-auto": !a.$props.height || a.$props.height == "100%", | ||
}), (c, f) => (S(), E("div", { | ||
class: ee(["codemirror-container", { | ||
merge: c.$props.merge, | ||
bordered: c.$props.border || c.$props.merge && !t.originalStyle, | ||
"original-style": t.originalStyle | ||
}]), | ||
style: ee({ | ||
height: w(P) + "px" | ||
style: te({ | ||
height: k(b), | ||
width: k(U) | ||
}) | ||
}, [ | ||
(b(), te(ne(m.value), oe({ | ||
(S(), ne(re(m.value), oe({ | ||
ref_key: "presetRef", | ||
ref: p, | ||
cminstance: s.value, | ||
"onUpdate:cminstance": g[0] || (g[0] = (h) => s.value = h), | ||
"onUpdate:cminstance": f[0] || (f[0] = (h) => s.value = h), | ||
style: { height: "100%" } | ||
}, { | ||
...a.$props, | ||
...a.$attrs, | ||
...c.$props, | ||
...c.$attrs, | ||
options: u.value, | ||
name: w(c), | ||
name: k(i), | ||
content: l.value | ||
}, { onReady: J }), null, 16, ["cminstance"])) | ||
}, { onReady: Z }), null, 16, ["cminstance"])) | ||
], 6)); | ||
} | ||
}), B = (e, n) => (n && n.options && (H.props.globalOptions.default = () => n.options), e.component((n == null ? void 0 : n.componentName) || "Codemirror", H), e), Be = window.CodeMirror || _, Pe = B, Ue = B; | ||
}), P = (e, n) => (n && n.options && (R.props.globalOptions.default = () => n.options), e.component((n == null ? void 0 : n.componentName) || "Codemirror", R), e), Pe = window.CodeMirror || _, Ue = P, We = P; | ||
function styleInject(css,ref){if(ref===void 0){ref={}}var insertAt=ref.insertAt;if(!css||typeof document==="undefined"){return}var head=document.head||document.getElementsByTagName("head")[0];var style=document.createElement("style");style.type="text/css";if(insertAt==="top"){if(head.firstChild){head.insertBefore(style,head.firstChild)}else{head.appendChild(style)}}else{head.appendChild(style)}if(style.styleSheet){style.styleSheet.cssText=css}else{style.appendChild(document.createTextNode(css))}};styleInject(`.codemirror-container { | ||
@@ -657,12 +661,3 @@ position: relative; | ||
} | ||
.codemirror-container.width-auto { | ||
width: 100%; | ||
} | ||
.codemirror-container.height-auto { | ||
height: 100%; | ||
} | ||
.codemirror-container.height-auto .CodeMirror, | ||
.codemirror-container.height-auto .cm-s-default { | ||
height: 100% !important; | ||
} | ||
.codemirror-container .editor_custom_link { | ||
@@ -709,15 +704,15 @@ cursor: pointer; | ||
export { | ||
Be as CodeMirror, | ||
Pe as GlobalCmComponent, | ||
Ue as InstallCodemirro, | ||
H as VueCodemirror, | ||
Fe as createLinkMark, | ||
Re as createLog, | ||
He as createLogMark, | ||
ze as createTitle, | ||
H as default, | ||
ge as getLinkMarks, | ||
me as getLocalTime, | ||
fe as getLogMark, | ||
pe as logErrorType | ||
Pe as CodeMirror, | ||
Ue as GlobalCmComponent, | ||
We as InstallCodemirro, | ||
R as VueCodemirror, | ||
He as createLinkMark, | ||
ze as createLog, | ||
Re as createLogMark, | ||
Be as createTitle, | ||
R as default, | ||
fe as getLinkMarks, | ||
ge as getLocalTime, | ||
he as getLogMark, | ||
me as logErrorType | ||
}; |
@@ -17,4 +17,5 @@ import type { Ref } from "vue"; | ||
destroy: () => void; | ||
containerHeight: Ref<string | null>; | ||
containerWidth: Ref<string>; | ||
containerHeight: Ref<string>; | ||
reviseStyle: () => void; | ||
}; |
{ | ||
"name": "codemirror-editor-vue3", | ||
"description": "CodeMirror component for Vue3", | ||
"version": "2.5.0-beta.5", | ||
"version": "2.5.0-beta.6", | ||
"license": "MIT", | ||
@@ -58,2 +58,3 @@ "files": [ | ||
"dependencies": { | ||
"@wdns/vue-code-block": "^2.3.2", | ||
"codemirror": "^5.65.16", | ||
@@ -78,2 +79,3 @@ "diff-match-patch": "^1.0.5" | ||
"@vue/cli-plugin-typescript": "~4.5.15", | ||
"@vueuse/core": "^10.9.0", | ||
"chalk": "^4.1.2", | ||
@@ -83,7 +85,6 @@ "conventional-changelog-cli": "^2.0.31", | ||
"diff-match-patch": "^1.0.5", | ||
"enquirer": "^2.3.6", | ||
"eslint": "^8.35.0", | ||
"eslint-config-airbnb-base": "^15.0.0", | ||
"eslint-config-prettier": "^8.6.0", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-vue": "^9.9.0", | ||
@@ -95,7 +96,5 @@ "execa": "^7.0.0", | ||
"picocolors": "^1.0.0", | ||
"prettier": "^2.8.4", | ||
"prompts": "^2.4.2", | ||
"semver": "^7.3.5", | ||
"tsx": "^3.12.3", | ||
"enquirer": "^2.3.6", | ||
"typescript": "^5.4.3", | ||
@@ -107,3 +106,3 @@ "unplugin-auto-import": "^0.15.0", | ||
"vite-plugin-windicss": "^1.8.10", | ||
"vitepress": "1.0.0-alpha.49", | ||
"vitepress": "^1.0.1", | ||
"vue": "^3.4.21", | ||
@@ -110,0 +109,0 @@ "vue-router": "^4.1.6", |
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
72838
40
0
6
1375
+ Added@wdns/vue-code-block@^2.3.2
+ Added@wdns/vue-code-block@2.3.5(transitive)
+ Addedhighlight.js@11.11.1(transitive)
+ Addedprismjs@1.29.0(transitive)
+ Addedua-parser-js@1.0.40(transitive)