reactive-vscode
Advanced tools
Comparing version 0.2.0-beta.6 to 0.2.0-beta.7
@@ -49,2 +49,3 @@ /// <reference types="vscode" /> | ||
import { TreeViewOptions } from 'vscode'; | ||
import { UnwrapNestedRefs } from '@reactive-vscode/reactivity'; | ||
import { Uri } from 'vscode'; | ||
@@ -65,3 +66,3 @@ import { ViewBadge } from 'vscode'; | ||
export declare type ConfigObject<C extends object> = ShallowReactive<C & { | ||
export declare type ConfigObject<C extends object> = UnwrapNestedRefs<C> & { | ||
/** | ||
@@ -77,3 +78,3 @@ * Write the configuration value to the workspace. | ||
$set: (key: keyof C, value: C[keyof C]) => void; | ||
}>; | ||
}; | ||
@@ -80,0 +81,0 @@ export declare interface ConfigRef<T> extends WritableComputedRef<T> { |
@@ -1,8 +0,8 @@ | ||
import { getCurrentScope as L, onScopeDispose as W, shallowRef as l, effectScope as J, computed as f, shallowReactive as F, toValue as a, watchEffect as m, watch as b, ref as E, toRaw as K, isRef as z } from "@reactive-vscode/reactivity"; | ||
import { getCurrentScope as L, onScopeDispose as W, shallowRef as l, effectScope as q, computed as f, reactive as J, toValue as a, watchEffect as m, watch as b, ref as E, shallowReactive as K, toRaw as z, isRef as Y } from "@reactive-vscode/reactivity"; | ||
export * from "@reactive-vscode/reactivity"; | ||
import { workspace as C, commands as k, window as c, debug as V, extensions as R, comments as Y, env as T, EventEmitter as O, tasks as D, Uri as G, languages as Q, ColorThemeKind as A, l10n as N } from "vscode"; | ||
function X(e) { | ||
import { workspace as C, commands as k, window as c, debug as V, extensions as R, comments as G, env as T, EventEmitter as F, tasks as D, Uri as Q, languages as X, ColorThemeKind as A, l10n as N } from "vscode"; | ||
function Z(e) { | ||
return L() ? (W(e), !0) : !1; | ||
} | ||
function $(e, t) { | ||
function O(e, t) { | ||
const n = /* @__PURE__ */ new Map(); | ||
@@ -15,3 +15,3 @@ return (...r) => { | ||
refCount: 1 | ||
}, n.set(i, o)), X(() => { | ||
}, n.set(i, o)), Z(() => { | ||
--o.refCount === 0 && n.delete(i); | ||
@@ -25,20 +25,20 @@ }), o.data; | ||
} | ||
const I = []; | ||
function ve(e) { | ||
I.push(e); | ||
const $ = []; | ||
function ge(e) { | ||
$.push(e); | ||
} | ||
const x = l(null), y = J(); | ||
function ge(e) { | ||
const x = l(null), y = q(); | ||
function he(e) { | ||
return { | ||
activate: (t) => (x.value = t, y.run(() => (P.map((n) => n(t)), e()))), | ||
activate: (t) => (x.value = t, y.run(() => (I.map((n) => n(t)), e()))), | ||
deactivate: () => { | ||
I.map((t) => t()), y.stop(); | ||
$.map((t) => t()), y.stop(); | ||
} | ||
}; | ||
} | ||
const P = []; | ||
function M(e) { | ||
x.value ? e(x.value) : P.push(e); | ||
const I = []; | ||
function P(e) { | ||
x.value ? e(x.value) : I.push(e); | ||
} | ||
function Z(e, t, n) { | ||
function _(e, t, n) { | ||
const r = !e, i = C.getConfiguration(r ? void 0 : e, n); | ||
@@ -52,4 +52,4 @@ function o(d, v) { | ||
}); | ||
return S.update = async (w, U, q) => { | ||
await i.update(d, w, U, q), S.value = w; | ||
return S.update = async (w, H, U) => { | ||
await i.update(d, w, H, U), S.value = w; | ||
}, S.set = (w) => { | ||
@@ -62,3 +62,3 @@ g.value = w; | ||
); | ||
return M(() => { | ||
return P(() => { | ||
u(C.onDidChangeConfiguration( | ||
@@ -79,5 +79,5 @@ r ? (d) => { | ||
} | ||
function he(e, t, n) { | ||
const r = Z(e, t, n); | ||
return F({ | ||
function me(e, t, n) { | ||
const r = _(e, t, n); | ||
return J({ | ||
...r, | ||
@@ -92,6 +92,6 @@ $update(i, o, s, d) { | ||
} | ||
function me(e, t) { | ||
function Ce(e, t) { | ||
const n = l(null), r = [], i = (o) => (...s) => n.value ? n.value[o](...s) : (r.push([o, s]), null); | ||
return M(() => { | ||
n.value = ue(e, t); | ||
return P(() => { | ||
n.value = se(e, t); | ||
for (const [o, s] of r) | ||
@@ -116,6 +116,6 @@ n.value[o](...s); | ||
} | ||
function Ce(e, ...t) { | ||
function be(e, ...t) { | ||
return k.executeCommand(e, ...t); | ||
} | ||
function _(e, t = !1) { | ||
function ee(e, t = !1) { | ||
const n = x.value; | ||
@@ -126,4 +126,4 @@ if (!n && !t) | ||
} | ||
function be(e, t = !1) { | ||
return f(() => _(a(e), t)); | ||
function we(e, t = !1) { | ||
return f(() => ee(a(e), t)); | ||
} | ||
@@ -133,3 +133,3 @@ function u(e) { | ||
} | ||
const ee = h(() => { | ||
const te = h(() => { | ||
const e = l(c.activeColorTheme); | ||
@@ -139,3 +139,3 @@ return u(c.onDidChangeActiveColorTheme((t) => { | ||
})), e; | ||
}), we = h(() => { | ||
}), Te = h(() => { | ||
const e = l(V.activeDebugSession); | ||
@@ -145,3 +145,3 @@ return u(V.onDidChangeActiveDebugSession((t) => { | ||
})), f(() => e.value); | ||
}), te = h(() => { | ||
}), ne = h(() => { | ||
const e = l(c.activeTextEditor); | ||
@@ -152,3 +152,3 @@ return u(c.onDidChangeActiveTextEditor((t) => { | ||
}); | ||
function ne(e, t, n) { | ||
function re(e, t, n) { | ||
const r = "key" in t ? t : c.createTextEditorDecorationType(t); | ||
@@ -160,7 +160,7 @@ m(() => { | ||
} | ||
function Te(e, t) { | ||
const n = te(); | ||
ne(n, e, t); | ||
function De(e, t) { | ||
const n = ne(); | ||
re(n, e, t); | ||
} | ||
const De = h(() => { | ||
const Se = h(() => { | ||
const e = l(c.activeNotebookEditor); | ||
@@ -170,3 +170,3 @@ return u(c.onDidChangeActiveNotebookEditor((t) => { | ||
})), e; | ||
}), Se = h(() => { | ||
}), pe = h(() => { | ||
const e = l(c.activeTerminal); | ||
@@ -176,3 +176,3 @@ return u(c.onDidChangeActiveTerminal((t) => { | ||
})), e; | ||
}), pe = h(() => { | ||
}), xe = h(() => { | ||
const e = l(R.all); | ||
@@ -183,13 +183,13 @@ return u(R.onDidChange(() => { | ||
}); | ||
function re(e, t) { | ||
function ie(e, t) { | ||
u(k.registerCommand(e, t)); | ||
} | ||
function xe(e) { | ||
function Ee(e) { | ||
for (const [t, n] of Object.entries(e)) | ||
n && re(t, n); | ||
n && ie(t, n); | ||
} | ||
function Ee(e, t) { | ||
return u(Y.createCommentController(e, t)); | ||
function ke(e, t) { | ||
return u(G.createCommentController(e, t)); | ||
} | ||
function j(e) { | ||
function M(e) { | ||
var n; | ||
@@ -204,3 +204,3 @@ const t = l((n = a(e)) == null ? void 0 : n.state); | ||
} | ||
function ke(...e) { | ||
function Re(...e) { | ||
const t = E(null); | ||
@@ -228,6 +228,6 @@ function n() { | ||
close: s, | ||
state: j(t) | ||
state: M(t) | ||
}; | ||
} | ||
const Re = h(() => { | ||
const ye = h(() => { | ||
const e = l(T.shell); | ||
@@ -238,3 +238,3 @@ return u(T.onDidChangeShell((t) => { | ||
}); | ||
function ye(e) { | ||
function Ve(e) { | ||
var n; | ||
@@ -255,4 +255,4 @@ const t = l((n = a(e)) == null ? void 0 : n.getText()); | ||
} | ||
function ie(e, t = []) { | ||
const n = Array.isArray(e) ? e : t ?? [], r = u(Array.isArray(e) || e == null ? new O() : e), i = p(r.event, n); | ||
function ae(e, t = []) { | ||
const n = Array.isArray(e) ? e : t ?? [], r = u(Array.isArray(e) || e == null ? new F() : e), i = p(r.event, n); | ||
for (const o of n) | ||
@@ -266,7 +266,7 @@ i(o); | ||
} | ||
function Ve(e) { | ||
function Ae(e) { | ||
return f(() => D.fetchTasks(a(e))); | ||
} | ||
function ae(e) { | ||
return F({ | ||
function oe(e) { | ||
return K({ | ||
get scheme() { | ||
@@ -301,10 +301,10 @@ return a(e).scheme; | ||
} | ||
function Ae(e) { | ||
return ae(() => G.file(a(e))); | ||
function Ne(e) { | ||
return oe(() => Q.file(a(e))); | ||
} | ||
function Ne(e, t) { | ||
const n = new O(), r = l(); | ||
function Le(e, t) { | ||
const n = new F(), r = l(); | ||
m(() => { | ||
r.value && n.fire(), r.value = a(t); | ||
}), u(Q.registerFoldingRangeProvider( | ||
}), u(X.registerFoldingRangeProvider( | ||
e, | ||
@@ -320,3 +320,3 @@ { | ||
} | ||
function Le(e, t, n, r) { | ||
function We(e, t, n, r) { | ||
const i = u(C.createFileSystemWatcher(e, t, n, r)); | ||
@@ -330,6 +330,6 @@ return { | ||
} | ||
const We = h(() => { | ||
const e = ee(); | ||
const Fe = h(() => { | ||
const e = te(); | ||
return f(() => e.value.kind === A.Dark || e.value.kind === A.HighContrast); | ||
}), Fe = h(() => { | ||
}), Oe = h(() => { | ||
const e = l(T.isTelemetryEnabled); | ||
@@ -340,6 +340,6 @@ return u(T.onDidChangeTelemetryEnabled((t) => { | ||
}); | ||
function Oe(e, ...t) { | ||
return f(() => typeof t[0] == "object" ? N.t(a(e), K(t[0])) : N.t(a(e), ...t.map(a))); | ||
function $e(e, ...t) { | ||
return f(() => typeof t[0] == "object" ? N.t(a(e), z(t[0])) : N.t(a(e), ...t.map(a))); | ||
} | ||
const $e = h(() => { | ||
const Ie = h(() => { | ||
const e = l(T.logLevel); | ||
@@ -350,11 +350,11 @@ return u(T.onDidChangeLogLevel((t) => { | ||
}); | ||
function oe(e, t) { | ||
function ue(e, t) { | ||
return u(c.createOutputChannel(e, t)); | ||
} | ||
function Ie(e) { | ||
function Pe(e) { | ||
const t = /* @__PURE__ */ new Date(), n = String(t.getFullYear()).padStart(4, "0"), r = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getDate()).padStart(2, "0"), o = String(t.getHours()).padStart(2, "0"), s = String(t.getMinutes()).padStart(2, "0"), d = String(t.getSeconds()).padStart(2, "0"), v = String(t.getMilliseconds()).padStart(3, "0"); | ||
return `${n}-${r}-${i} ${o}:${s}:${d}.${v} [${e}] `; | ||
} | ||
function ue(e, t = {}) { | ||
const n = t.outputChannel ?? oe(e), r = (i) => (...o) => { | ||
function se(e, t = {}) { | ||
const n = t.outputChannel ?? ue(e), r = (i) => (...o) => { | ||
var s; | ||
@@ -377,3 +377,3 @@ n.appendLine((((s = t.getPrefix) == null ? void 0 : s.call(t, i)) ?? "") + o.join(" ")); | ||
} | ||
function se(e) { | ||
function ce(e) { | ||
var n; | ||
@@ -397,4 +397,4 @@ const t = l(((n = a(e)) == null ? void 0 : n.selections) ?? []); | ||
} | ||
function Pe(e) { | ||
const t = se(e); | ||
function Me(e) { | ||
const t = ce(e); | ||
return f({ | ||
@@ -409,3 +409,3 @@ get() { | ||
} | ||
function Me(e) { | ||
function je(e) { | ||
var n; | ||
@@ -420,3 +420,3 @@ const t = l(((n = a(e)) == null ? void 0 : n.visibleRanges) ?? []); | ||
} | ||
const je = h(() => { | ||
const Be = h(() => { | ||
const e = l(c.terminals); | ||
@@ -428,3 +428,3 @@ function t() { | ||
}); | ||
function Be(e) { | ||
function He(e) { | ||
const t = u(e.id ? c.createStatusBarItem(e.id, e.alignment, e.priority) : c.createStatusBarItem(e.alignment, e.priority)); | ||
@@ -445,3 +445,3 @@ function n(r) { | ||
} | ||
const He = h(() => { | ||
const Ue = h(() => { | ||
const e = l(D.taskExecutions); | ||
@@ -453,3 +453,3 @@ function t() { | ||
}); | ||
function Ue(...e) { | ||
function qe(...e) { | ||
const t = u(c.createTerminal(...e)); | ||
@@ -473,13 +473,13 @@ return { | ||
hide: t.hide.bind(t), | ||
state: j(t) | ||
state: M(t) | ||
}; | ||
} | ||
function ce(e, t) { | ||
function le(e, t) { | ||
u(k.registerTextEditorCommand(e, t)); | ||
} | ||
function qe(e) { | ||
function Je(e) { | ||
for (const [t, n] of Object.entries(e)) | ||
ce(t, n); | ||
le(t, n); | ||
} | ||
function le(e, t) { | ||
function de(e, t) { | ||
var r; | ||
@@ -504,4 +504,4 @@ const n = l(((r = a(e)) == null ? void 0 : r.selections) ?? []); | ||
} | ||
function Je(e, t) { | ||
const n = le(e, t); | ||
function Ke(e, t) { | ||
const n = de(e, t); | ||
return f({ | ||
@@ -516,3 +516,3 @@ get() { | ||
} | ||
function Ke(e) { | ||
function ze(e) { | ||
var n; | ||
@@ -527,3 +527,3 @@ const t = l((n = a(e)) == null ? void 0 : n.viewColumn); | ||
} | ||
function ze(e) { | ||
function Ye(e) { | ||
var n; | ||
@@ -538,3 +538,3 @@ const t = l(((n = a(e)) == null ? void 0 : n.visibleRanges) ?? []); | ||
} | ||
function B(e, t) { | ||
function j(e, t) { | ||
m(() => { | ||
@@ -545,3 +545,3 @@ const n = a(e); | ||
} | ||
function H(e, t) { | ||
function B(e, t) { | ||
m(() => { | ||
@@ -552,5 +552,5 @@ const n = a(e); | ||
} | ||
const Ye = $( | ||
const Ge = O( | ||
(e, t, n) => { | ||
const r = ie(); | ||
const r = ae(); | ||
b(t, () => r.fire()), n != null && n.watchSource && b(n.watchSource, () => r.fire()); | ||
@@ -574,7 +574,7 @@ const i = /* @__PURE__ */ new WeakMap(), o = u(c.createTreeView(e, { | ||
})); | ||
return n != null && n.title && H(o, n.title), n != null && n.badge && B(o, n.badge), o; | ||
return n != null && n.title && B(o, n.title), n != null && n.badge && j(o, n.badge), o; | ||
}, | ||
(e) => e | ||
); | ||
function Ge(e) { | ||
function Qe(e) { | ||
var r; | ||
@@ -594,3 +594,3 @@ const t = E((r = a(e)) == null ? void 0 : r.visible); | ||
} | ||
const Qe = h(() => { | ||
const Xe = h(() => { | ||
const e = l(c.visibleNotebookEditors); | ||
@@ -600,3 +600,3 @@ return u(c.onDidChangeVisibleNotebookEditors((t) => { | ||
})), e; | ||
}), Xe = h(() => { | ||
}), Ze = h(() => { | ||
const e = l(c.visibleTextEditors); | ||
@@ -607,4 +607,4 @@ return u(c.onDidChangeVisibleTextEditors((t) => { | ||
}); | ||
function Ze(e, t, n = !0) { | ||
const r = z(t) ? t : typeof t == "function" ? f(t) : E(t); | ||
function _e(e, t, n = !0) { | ||
const r = Y(t) ? t : typeof t == "function" ? f(t) : E(t); | ||
return m(() => { | ||
@@ -614,3 +614,3 @@ a(n) && k.executeCommand("setContext", e, r.value); | ||
} | ||
const _e = $( | ||
const et = O( | ||
(e, t, n) => { | ||
@@ -643,3 +643,3 @@ const r = l(), i = l(); | ||
} | ||
n != null && n.title && H(r, n.title), n != null && n.badge && B(r, n.badge); | ||
n != null && n.title && B(r, n.title), n != null && n.badge && j(r, n.badge); | ||
function d(v) { | ||
@@ -652,3 +652,3 @@ var g; | ||
(e) => e | ||
), et = h(() => { | ||
), tt = h(() => { | ||
const e = l(c.state); | ||
@@ -661,3 +661,3 @@ return u(c.onDidChangeWindowState((t) => { | ||
}; | ||
}), tt = h(() => { | ||
}), nt = h(() => { | ||
const e = l(C.workspaceFolders); | ||
@@ -669,70 +669,70 @@ return u(C.onDidChangeWorkspaceFolders(() => { | ||
export { | ||
P as activateCbs, | ||
$ as createKeyedComposable, | ||
I as activateCbs, | ||
O as createKeyedComposable, | ||
h as createSingletonComposable, | ||
I as deactivateCbs, | ||
he as defineConfigObject, | ||
Z as defineConfigs, | ||
ge as defineExtension, | ||
me as defineLogger, | ||
Ce as executeCommand, | ||
$ as deactivateCbs, | ||
me as defineConfigObject, | ||
_ as defineConfigs, | ||
he as defineExtension, | ||
Ce as defineLogger, | ||
be as executeCommand, | ||
x as extensionContext, | ||
y as extensionScope, | ||
Ie as getDefaultLoggerPrefix, | ||
M as onActivate, | ||
ve as onDeactivate, | ||
X as tryOnScopeDispose, | ||
be as useAbsolutePath, | ||
ee as useActiveColorTheme, | ||
we as useActiveDebugSession, | ||
Te as useActiveEditorDecorations, | ||
De as useActiveNotebookEditor, | ||
Se as useActiveTerminal, | ||
te as useActiveTextEditor, | ||
pe as useAllExtensions, | ||
re as useCommand, | ||
xe as useCommands, | ||
Ee as useCommentController, | ||
ke as useControlledTerminal, | ||
Re as useDefaultShell, | ||
Pe as getDefaultLoggerPrefix, | ||
P as onActivate, | ||
ge as onDeactivate, | ||
Z as tryOnScopeDispose, | ||
we as useAbsolutePath, | ||
te as useActiveColorTheme, | ||
Te as useActiveDebugSession, | ||
De as useActiveEditorDecorations, | ||
Se as useActiveNotebookEditor, | ||
pe as useActiveTerminal, | ||
ne as useActiveTextEditor, | ||
xe as useAllExtensions, | ||
ie as useCommand, | ||
Ee as useCommands, | ||
ke as useCommentController, | ||
Re as useControlledTerminal, | ||
ye as useDefaultShell, | ||
u as useDisposable, | ||
ye as useDocumentText, | ||
ne as useEditorDecorations, | ||
Ve as useDocumentText, | ||
re as useEditorDecorations, | ||
p as useEvent, | ||
ie as useEventEmitter, | ||
Ve as useFetchTasks, | ||
Ae as useFileUri, | ||
Ne as useFoldingRangeProvider, | ||
Le as useFsWatcher, | ||
We as useIsDarkTheme, | ||
Fe as useIsTelemetryEnabled, | ||
Oe as useL10nText, | ||
$e as useLogLevel, | ||
ue as useLogger, | ||
Pe as useNotebookEditorSelection, | ||
se as useNotebookEditorSelections, | ||
Me as useNotebookEditorVisibleRanges, | ||
je as useOpenedTerminals, | ||
oe as useOutputChannel, | ||
Be as useStatusBarItem, | ||
He as useTaskExecutions, | ||
Ue as useTerminal, | ||
j as useTerminalState, | ||
ce as useTextEditorCommand, | ||
qe as useTextEditorCommands, | ||
Je as useTextEditorSelection, | ||
le as useTextEditorSelections, | ||
Ke as useTextEditorViewColumn, | ||
ze as useTextEditorVisibleRanges, | ||
Ye as useTreeView, | ||
ae as useUri, | ||
B as useViewBadge, | ||
H as useViewTitle, | ||
Ge as useViewVisibility, | ||
Qe as useVisibleNotebookEditors, | ||
Xe as useVisibleTextEditors, | ||
Ze as useVscodeContext, | ||
_e as useWebviewView, | ||
et as useWindowState, | ||
tt as useWorkspaceFolders | ||
ae as useEventEmitter, | ||
Ae as useFetchTasks, | ||
Ne as useFileUri, | ||
Le as useFoldingRangeProvider, | ||
We as useFsWatcher, | ||
Fe as useIsDarkTheme, | ||
Oe as useIsTelemetryEnabled, | ||
$e as useL10nText, | ||
Ie as useLogLevel, | ||
se as useLogger, | ||
Me as useNotebookEditorSelection, | ||
ce as useNotebookEditorSelections, | ||
je as useNotebookEditorVisibleRanges, | ||
Be as useOpenedTerminals, | ||
ue as useOutputChannel, | ||
He as useStatusBarItem, | ||
Ue as useTaskExecutions, | ||
qe as useTerminal, | ||
M as useTerminalState, | ||
le as useTextEditorCommand, | ||
Je as useTextEditorCommands, | ||
Ke as useTextEditorSelection, | ||
de as useTextEditorSelections, | ||
ze as useTextEditorViewColumn, | ||
Ye as useTextEditorVisibleRanges, | ||
Ge as useTreeView, | ||
oe as useUri, | ||
j as useViewBadge, | ||
B as useViewTitle, | ||
Qe as useViewVisibility, | ||
Xe as useVisibleNotebookEditors, | ||
Ze as useVisibleTextEditors, | ||
_e as useVscodeContext, | ||
et as useWebviewView, | ||
tt as useWindowState, | ||
nt as useWorkspaceFolders | ||
}; |
{ | ||
"name": "reactive-vscode", | ||
"type": "module", | ||
"version": "0.2.0-beta.6", | ||
"version": "0.2.0-beta.7", | ||
"description": "Develop VSCode extension with Vue Reactivity API", | ||
@@ -40,3 +40,3 @@ "author": "_Kerman <kermanx@qq.com>", | ||
"dependencies": { | ||
"@reactive-vscode/reactivity": "0.2.0-beta.6" | ||
"@reactive-vscode/reactivity": "0.2.0-beta.7" | ||
}, | ||
@@ -43,0 +43,0 @@ "devDependencies": { |
48251
1283
+ Added@reactive-vscode/reactivity@0.2.0-beta.7(transitive)
- Removed@reactive-vscode/reactivity@0.2.0-beta.6(transitive)