@vobs/ui 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activity-rail.cjs +65 -629
- package/dist/activity-rail.cjs.map +1 -1
- package/dist/activity-rail.js +44 -612
- package/dist/activity-rail.js.map +1 -1
- package/dist/alert.cjs +58 -536
- package/dist/alert.cjs.map +1 -1
- package/dist/alert.js +33 -519
- package/dist/alert.js.map +1 -1
- package/dist/avatar.cjs +45 -519
- package/dist/avatar.cjs.map +1 -1
- package/dist/avatar.js +26 -508
- package/dist/avatar.js.map +1 -1
- package/dist/button.cjs +46 -559
- package/dist/button.cjs.map +1 -1
- package/dist/button.js +21 -545
- package/dist/button.js.map +1 -1
- package/dist/card.cjs +55 -532
- package/dist/card.cjs.map +1 -1
- package/dist/card.js +30 -515
- package/dist/card.js.map +1 -1
- package/dist/chat-composer.cjs +84 -602
- package/dist/chat-composer.cjs.map +1 -1
- package/dist/chat-composer.js +52 -576
- package/dist/chat-composer.js.map +1 -1
- package/dist/dialog.cjs +88 -591
- package/dist/dialog.cjs.map +1 -1
- package/dist/dialog.js +63 -569
- package/dist/dialog.js.map +1 -1
- package/dist/drawer.cjs +91 -594
- package/dist/drawer.cjs.map +1 -1
- package/dist/drawer.js +65 -571
- package/dist/drawer.js.map +1 -1
- package/dist/editor-tabs.cjs +75 -635
- package/dist/editor-tabs.cjs.map +1 -1
- package/dist/editor-tabs.js +51 -616
- package/dist/editor-tabs.js.map +1 -1
- package/dist/file-tree.cjs +70 -634
- package/dist/file-tree.cjs.map +1 -1
- package/dist/file-tree.js +49 -617
- package/dist/file-tree.js.map +1 -1
- package/dist/forms.cjs +80 -589
- package/dist/forms.cjs.map +1 -1
- package/dist/forms.js +41 -559
- package/dist/forms.js.map +1 -1
- package/dist/icon.cjs +44 -624
- package/dist/icon.cjs.map +1 -1
- package/dist/icon.js +25 -615
- package/dist/icon.js.map +1 -1
- package/dist/icons.cjs +2 -3
- package/dist/icons.cjs.map +1 -1
- package/dist/icons.js +0 -1
- package/dist/icons.js.map +1 -1
- package/dist/index.cjs +735 -1586
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +811 -1517
- package/dist/index.js.map +1 -1
- package/dist/kbd.cjs +53 -525
- package/dist/kbd.cjs.map +1 -1
- package/dist/kbd.js +30 -509
- package/dist/kbd.js.map +1 -1
- package/dist/menu.cjs +68 -582
- package/dist/menu.cjs.map +1 -1
- package/dist/menu.js +47 -565
- package/dist/menu.js.map +1 -1
- package/dist/nav-list.cjs +71 -635
- package/dist/nav-list.cjs.map +1 -1
- package/dist/nav-list.js +50 -618
- package/dist/nav-list.js.map +1 -1
- package/dist/overlay.cjs +43 -197
- package/dist/overlay.cjs.map +1 -1
- package/dist/overlay.js +20 -192
- package/dist/overlay.js.map +1 -1
- package/dist/page-header.cjs +68 -585
- package/dist/page-header.cjs.map +1 -1
- package/dist/page-header.js +42 -565
- package/dist/page-header.js.map +1 -1
- package/dist/pagination.cjs +70 -585
- package/dist/pagination.cjs.map +1 -1
- package/dist/pagination.js +53 -572
- package/dist/pagination.js.map +1 -1
- package/dist/stat-card.cjs +62 -538
- package/dist/stat-card.cjs.map +1 -1
- package/dist/stat-card.js +36 -519
- package/dist/stat-card.js.map +1 -1
- package/dist/status-bar.cjs +65 -576
- package/dist/status-bar.cjs.map +1 -1
- package/dist/status-bar.js +43 -560
- package/dist/status-bar.js.map +1 -1
- package/dist/table.cjs +87 -605
- package/dist/table.cjs.map +1 -1
- package/dist/table.js +57 -579
- package/dist/table.js.map +1 -1
- package/dist/tabs.cjs +62 -626
- package/dist/tabs.cjs.map +1 -1
- package/dist/tabs.js +45 -613
- package/dist/tabs.js.map +1 -1
- package/dist/tag.cjs +40 -514
- package/dist/tag.cjs.map +1 -1
- package/dist/tag.js +18 -503
- package/dist/tag.js.map +1 -1
- package/dist/toast.cjs +95 -1001
- package/dist/toast.cjs.map +1 -1
- package/dist/toast.js +74 -980
- package/dist/toast.js.map +1 -1
- package/dist/types.cjs +18 -2
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +5 -1
- package/dist/types.d.ts +5 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +1 -1
- package/dist/utils.cjs +77 -580
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +29 -545
- package/dist/utils.js.map +1 -1
- package/dist/workbench-titlebar.cjs +83 -598
- package/dist/workbench-titlebar.cjs.map +1 -1
- package/dist/workbench-titlebar.js +55 -575
- package/dist/workbench-titlebar.js.map +1 -1
- package/package.json +5 -5
- package/src/types.ts +7 -0
|
@@ -1,551 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __VOBS_CJS_FILE_URL = require("url").pathToFileURL(__filename).href;
|
|
2
|
+
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
7
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function hasDebugHooks() {
|
|
9
|
-
return activeDebugHooks !== null;
|
|
10
|
-
}
|
|
11
|
-
__name(hasDebugHooks, "hasDebugHooks");
|
|
12
|
-
function invokeDebug(name, ...args) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
__name(invokeDebug, "invokeDebug");
|
|
16
|
-
|
|
17
|
-
// packages/reactivity/src/owner.ts
|
|
18
|
-
var currentOwner = null;
|
|
19
|
-
var nextOwnerId = 1;
|
|
20
|
-
var ownerNames = /* @__PURE__ */ new WeakMap();
|
|
21
|
-
function createOwner() {
|
|
22
|
-
const parent = currentOwner;
|
|
23
|
-
let disposed = parent?.disposed ?? false;
|
|
24
|
-
const children = [];
|
|
25
|
-
const cleanups = [];
|
|
26
|
-
const errorHandlers = /* @__PURE__ */ new Set();
|
|
27
|
-
const owner = {
|
|
28
|
-
id: `owner-${nextOwnerId++}`,
|
|
29
|
-
parent,
|
|
30
|
-
children,
|
|
31
|
-
depth: (parent?.depth ?? -1) + 1,
|
|
32
|
-
get disposed() {
|
|
33
|
-
return disposed;
|
|
34
|
-
},
|
|
35
|
-
run(fn) {
|
|
36
|
-
if (disposed) throw new Error("Vobs: \u5DF2\u9500\u6BC1\u7684 Owner \u4E0D\u80FD\u7EE7\u7EED\u8FD0\u884C");
|
|
37
|
-
const previous = currentOwner;
|
|
38
|
-
currentOwner = owner;
|
|
39
|
-
try {
|
|
40
|
-
return fn();
|
|
41
|
-
} finally {
|
|
42
|
-
currentOwner = previous;
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
addCleanup(cleanup) {
|
|
46
|
-
if (disposed) {
|
|
47
|
-
cleanup();
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
cleanups.push(cleanup);
|
|
51
|
-
},
|
|
52
|
-
onDispose(cleanup) {
|
|
53
|
-
owner.addCleanup(cleanup);
|
|
54
|
-
},
|
|
55
|
-
onError(handler) {
|
|
56
|
-
errorHandlers.add(handler);
|
|
57
|
-
const remove = /* @__PURE__ */ __name(() => errorHandlers.delete(handler), "remove");
|
|
58
|
-
owner.addCleanup(remove);
|
|
59
|
-
return remove;
|
|
60
|
-
},
|
|
61
|
-
handleError(error) {
|
|
62
|
-
for (const handler of [...errorHandlers].reverse()) {
|
|
63
|
-
try {
|
|
64
|
-
handler(error);
|
|
65
|
-
return true;
|
|
66
|
-
} catch (handlerError) {
|
|
67
|
-
return parent?.handleError(handlerError) ?? false;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return parent?.handleError(error) ?? false;
|
|
71
|
-
},
|
|
72
|
-
dispose() {
|
|
73
|
-
if (disposed) return;
|
|
74
|
-
disposed = true;
|
|
75
|
-
for (const child of [...children]) child.dispose();
|
|
76
|
-
children.length = 0;
|
|
77
|
-
let firstError;
|
|
78
|
-
for (let index = cleanups.length - 1; index >= 0; index--) {
|
|
79
|
-
try {
|
|
80
|
-
cleanups[index]();
|
|
81
|
-
} catch (error) {
|
|
82
|
-
firstError ?? (firstError = error);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
cleanups.length = 0;
|
|
86
|
-
if (parent) {
|
|
87
|
-
const index = parent.children.indexOf(owner);
|
|
88
|
-
if (index >= 0) parent.children.splice(index, 1);
|
|
89
|
-
}
|
|
90
|
-
if (firstError) throw firstError;
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
if (parent && !parent.disposed) parent.children.push(owner);
|
|
94
|
-
return owner;
|
|
95
|
-
}
|
|
96
|
-
__name(createOwner, "createOwner");
|
|
97
|
-
function setOwnerDebugName(owner, name) {
|
|
98
|
-
ownerNames.set(owner, name);
|
|
99
|
-
}
|
|
100
|
-
__name(setOwnerDebugName, "setOwnerDebugName");
|
|
101
|
-
function getCurrentOwner() {
|
|
102
|
-
return currentOwner;
|
|
103
|
-
}
|
|
104
|
-
__name(getCurrentOwner, "getCurrentOwner");
|
|
105
|
-
|
|
106
|
-
// packages/reactivity/src/signal.ts
|
|
107
|
-
var currentSubscriber = null;
|
|
108
|
-
function getCurrentSubscriber() {
|
|
109
|
-
return currentSubscriber;
|
|
110
|
-
}
|
|
111
|
-
__name(getCurrentSubscriber, "getCurrentSubscriber");
|
|
112
|
-
function setCurrentSubscriber(subscriber) {
|
|
113
|
-
currentSubscriber = subscriber;
|
|
114
|
-
}
|
|
115
|
-
__name(setCurrentSubscriber, "setCurrentSubscriber");
|
|
116
|
-
|
|
117
|
-
// packages/reactivity/src/scheduler.ts
|
|
118
|
-
var _Scheduler = class _Scheduler {
|
|
119
|
-
constructor() {
|
|
120
|
-
this.dirtyEffects = /* @__PURE__ */ new Set();
|
|
121
|
-
this.lowPriorityEffects = /* @__PURE__ */ new Set();
|
|
122
|
-
// flush 不可重入(flushing 标志保证),缓冲数组可在轮次间安全复用,避免每轮分配。
|
|
123
|
-
this.normalBuffer = [];
|
|
124
|
-
this.lowBuffer = [];
|
|
125
|
-
this.flushing = false;
|
|
126
|
-
this.scheduled = false;
|
|
127
|
-
this.batchDepth = 0;
|
|
128
|
-
}
|
|
129
|
-
schedule(effect2) {
|
|
130
|
-
if (effect2.disposed) return;
|
|
131
|
-
this.dirtyEffects.add(effect2);
|
|
132
|
-
this.lowPriorityEffects.delete(effect2);
|
|
133
|
-
this.ensureScheduled();
|
|
134
|
-
}
|
|
135
|
-
/** Queue an effect behind normal updates while preserving deterministic order. */
|
|
136
|
-
scheduleLow(effect2) {
|
|
137
|
-
if (effect2.disposed) return;
|
|
138
|
-
if (!this.dirtyEffects.has(effect2)) this.lowPriorityEffects.add(effect2);
|
|
139
|
-
this.ensureScheduled();
|
|
140
|
-
}
|
|
141
|
-
ensureScheduled() {
|
|
142
|
-
if (this.batchDepth === 0 && !this.flushing && !this.scheduled) {
|
|
143
|
-
this.scheduled = true;
|
|
144
|
-
queueMicrotask(() => {
|
|
145
|
-
this.scheduled = false;
|
|
146
|
-
this.flush();
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
remove(effect2) {
|
|
151
|
-
this.dirtyEffects.delete(effect2);
|
|
152
|
-
this.lowPriorityEffects.delete(effect2);
|
|
153
|
-
}
|
|
154
|
-
batch(fn) {
|
|
155
|
-
this.batchDepth++;
|
|
156
|
-
try {
|
|
157
|
-
return fn();
|
|
158
|
-
} finally {
|
|
159
|
-
this.batchDepth--;
|
|
160
|
-
if (this.batchDepth === 0) this.flush();
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
flush() {
|
|
164
|
-
if (this.flushing || this.batchDepth > 0) return;
|
|
165
|
-
this.flushing = true;
|
|
166
|
-
let rounds = 0;
|
|
167
|
-
let firstError;
|
|
168
|
-
let hasError = false;
|
|
169
|
-
try {
|
|
170
|
-
while (this.dirtyEffects.size > 0 || this.lowPriorityEffects.size > 0) {
|
|
171
|
-
if (++rounds > 100) {
|
|
172
|
-
this.dirtyEffects.clear();
|
|
173
|
-
this.lowPriorityEffects.clear();
|
|
174
|
-
throw new Error("Vobs: \u54CD\u5E94\u5F0F\u66F4\u65B0\u8D85\u8FC7 100 \u8F6E\uFF0C\u53EF\u80FD\u5B58\u5728\u5FAA\u73AF\u4F9D\u8D56");
|
|
175
|
-
}
|
|
176
|
-
this.collectRunnable(this.dirtyEffects, this.normalBuffer);
|
|
177
|
-
this.collectRunnable(this.lowPriorityEffects, this.lowBuffer);
|
|
178
|
-
sortEffects(this.normalBuffer);
|
|
179
|
-
sortEffects(this.lowBuffer);
|
|
180
|
-
for (const effect2 of this.normalBuffer) {
|
|
181
|
-
try {
|
|
182
|
-
effect2.run();
|
|
183
|
-
} catch (error) {
|
|
184
|
-
if (!hasError) {
|
|
185
|
-
firstError = error;
|
|
186
|
-
hasError = true;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
for (const effect2 of this.lowBuffer) {
|
|
191
|
-
try {
|
|
192
|
-
effect2.run();
|
|
193
|
-
} catch (error) {
|
|
194
|
-
if (!hasError) {
|
|
195
|
-
firstError = error;
|
|
196
|
-
hasError = true;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
this.normalBuffer.length = 0;
|
|
201
|
-
this.lowBuffer.length = 0;
|
|
202
|
-
}
|
|
203
|
-
} finally {
|
|
204
|
-
this.normalBuffer.length = 0;
|
|
205
|
-
this.lowBuffer.length = 0;
|
|
206
|
-
this.flushing = false;
|
|
207
|
-
}
|
|
208
|
-
if (hasError) throw firstError;
|
|
209
|
-
}
|
|
210
|
-
/** 收集未 disposed 的 effect 并清空源集合;run() 期间新调度的 effect 留给下一轮。 */
|
|
211
|
-
collectRunnable(source, target) {
|
|
212
|
-
for (const effect2 of source) {
|
|
213
|
-
if (!effect2.disposed) target.push(effect2);
|
|
214
|
-
}
|
|
215
|
-
source.clear();
|
|
216
|
-
}
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
217
11
|
};
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
__name(sortEffects, "sortEffects");
|
|
226
|
-
var scheduler = new Scheduler();
|
|
227
|
-
|
|
228
|
-
// packages/reactivity/src/effect.ts
|
|
229
|
-
var nextEffectOrder = 1;
|
|
230
|
-
function cleanupDependencies(subscriber) {
|
|
231
|
-
for (const dependency of subscriber.dependencies) {
|
|
232
|
-
dependency.unsubscribe(subscriber);
|
|
233
|
-
}
|
|
234
|
-
subscriber.dependencies.clear();
|
|
235
|
-
}
|
|
236
|
-
__name(cleanupDependencies, "cleanupDependencies");
|
|
237
|
-
function effect(callback) {
|
|
238
|
-
const owner = getCurrentOwner();
|
|
239
|
-
let cleanup;
|
|
240
|
-
let dirty = true;
|
|
241
|
-
let disposed = false;
|
|
242
|
-
const eff = {
|
|
243
|
-
order: nextEffectOrder++,
|
|
244
|
-
depth: owner?.depth ?? 0,
|
|
245
|
-
dependencies: /* @__PURE__ */ new Set(),
|
|
246
|
-
get disposed() {
|
|
247
|
-
return disposed;
|
|
248
|
-
},
|
|
249
|
-
notify() {
|
|
250
|
-
if (disposed || dirty) return;
|
|
251
|
-
dirty = true;
|
|
252
|
-
scheduler.schedule(eff);
|
|
253
|
-
},
|
|
254
|
-
run() {
|
|
255
|
-
if (disposed || !dirty) return;
|
|
256
|
-
dirty = false;
|
|
257
|
-
const previousCleanup = cleanup;
|
|
258
|
-
cleanup = void 0;
|
|
259
|
-
let cleanupError;
|
|
260
|
-
if (previousCleanup) {
|
|
261
|
-
try {
|
|
262
|
-
previousCleanup();
|
|
263
|
-
} catch (error) {
|
|
264
|
-
const handled2 = owner?.handleError(error) ?? false;
|
|
265
|
-
if (!handled2) cleanupError = error;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
cleanupDependencies(eff);
|
|
269
|
-
const previous = getCurrentSubscriber();
|
|
270
|
-
setCurrentSubscriber(eff);
|
|
271
|
-
let thrown;
|
|
272
|
-
let handled = false;
|
|
273
|
-
try {
|
|
274
|
-
const result = owner ? owner.run(callback) : callback();
|
|
275
|
-
cleanup = typeof result === "function" ? result : void 0;
|
|
276
|
-
} catch (error) {
|
|
277
|
-
thrown = error;
|
|
278
|
-
handled = owner?.handleError(error) ?? false;
|
|
279
|
-
if (!handled) throw error;
|
|
280
|
-
} finally {
|
|
281
|
-
setCurrentSubscriber(previous);
|
|
282
|
-
}
|
|
283
|
-
if (cleanupError && !thrown) throw cleanupError;
|
|
284
|
-
},
|
|
285
|
-
scheduleLow() {
|
|
286
|
-
if (disposed || dirty) return;
|
|
287
|
-
dirty = true;
|
|
288
|
-
scheduler.scheduleLow(eff);
|
|
289
|
-
},
|
|
290
|
-
dispose() {
|
|
291
|
-
if (disposed) return;
|
|
292
|
-
disposed = true;
|
|
293
|
-
dirty = false;
|
|
294
|
-
scheduler.remove(eff);
|
|
295
|
-
const previousCleanup = cleanup;
|
|
296
|
-
cleanup = void 0;
|
|
297
|
-
let cleanupError;
|
|
298
|
-
if (previousCleanup) {
|
|
299
|
-
try {
|
|
300
|
-
previousCleanup();
|
|
301
|
-
} catch (error) {
|
|
302
|
-
const handled = owner?.handleError(error) ?? false;
|
|
303
|
-
if (!handled) cleanupError = error;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
cleanupDependencies(eff);
|
|
307
|
-
if (cleanupError) throw cleanupError;
|
|
308
|
-
}
|
|
309
|
-
};
|
|
310
|
-
owner?.addCleanup(eff.dispose);
|
|
311
|
-
eff.run();
|
|
312
|
-
return eff;
|
|
313
|
-
}
|
|
314
|
-
__name(effect, "effect");
|
|
315
|
-
|
|
316
|
-
// packages/runtime/src/debug.ts
|
|
317
|
-
var activeRuntimeDebugHooks = null;
|
|
318
|
-
function getRuntimeDebugHooks() {
|
|
319
|
-
return activeRuntimeDebugHooks;
|
|
320
|
-
}
|
|
321
|
-
__name(getRuntimeDebugHooks, "getRuntimeDebugHooks");
|
|
322
|
-
function invokeRuntimeDebug(name, ...args) {
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
|
-
__name(invokeRuntimeDebug, "invokeRuntimeDebug");
|
|
326
|
-
function readDebugValue(read) {
|
|
327
|
-
try {
|
|
328
|
-
return read();
|
|
329
|
-
} catch {
|
|
330
|
-
return "[Uninspectable]";
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
__name(readDebugValue, "readDebugValue");
|
|
334
|
-
function describeDebugNode(node) {
|
|
335
|
-
if (!node || typeof node !== "object") return "node";
|
|
336
|
-
const value = node;
|
|
337
|
-
const name = typeof value.tagName === "string" ? value.tagName.toLowerCase() : typeof value.nodeName === "string" ? value.nodeName.toLowerCase() : "node";
|
|
338
|
-
const id = typeof value.id === "string" && value.id ? `#${value.id}` : "";
|
|
339
|
-
const className = typeof value.className === "string" && value.className ? `.${value.className.trim().split(/\s+/).filter(Boolean).join(".")}` : "";
|
|
340
|
-
return `${name}${id}${className}`;
|
|
341
|
-
}
|
|
342
|
-
__name(describeDebugNode, "describeDebugNode");
|
|
343
|
-
|
|
344
|
-
// packages/runtime/src/hmr.ts
|
|
345
|
-
var globalTarget = globalThis;
|
|
346
|
-
var hmrGlobal = globalTarget.__VOBS_HMR__ ?? { modules: /* @__PURE__ */ new Map() };
|
|
347
|
-
globalTarget.__VOBS_HMR__ = hmrGlobal;
|
|
348
|
-
function markHmrInstanceMounted(node, parent) {
|
|
349
|
-
const instance = hmrInstances.get(node);
|
|
350
|
-
if (instance) instance.parent = parent;
|
|
351
|
-
}
|
|
352
|
-
__name(markHmrInstanceMounted, "markHmrInstanceMounted");
|
|
353
|
-
var hmrInstances = /* @__PURE__ */ new WeakMap();
|
|
354
|
-
var nodeOwners = /* @__PURE__ */ new WeakMap();
|
|
355
|
-
var eventBindings = /* @__PURE__ */ new WeakMap();
|
|
356
|
-
function getRenderer() {
|
|
357
|
-
{
|
|
358
|
-
throw new Error("\u6E32\u67D3\u5668\u672A\u521D\u59CB\u5316");
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
__name(getRenderer, "getRenderer");
|
|
362
|
-
function createText(content) {
|
|
363
|
-
return getRenderer().createText(content);
|
|
364
|
-
}
|
|
365
|
-
__name(createText, "createText");
|
|
366
|
-
function createElement(tag) {
|
|
367
|
-
return getRenderer().createElement(tag);
|
|
368
|
-
}
|
|
369
|
-
__name(createElement, "createElement");
|
|
370
|
-
function createComment(content) {
|
|
371
|
-
return getRenderer().createComment(content);
|
|
372
|
-
}
|
|
373
|
-
__name(createComment, "createComment");
|
|
374
|
-
function insertBefore(parent, child, anchor) {
|
|
375
|
-
if (isVobsFragment(child)) {
|
|
376
|
-
child.mount(parent, isVobsFragment(anchor) ? anchor.start : anchor);
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
getRenderer().insertBefore(parent, child, isVobsFragment(anchor) ? anchor.start : anchor);
|
|
380
|
-
markHmrInstanceMounted(child, parent);
|
|
381
|
-
}
|
|
382
|
-
__name(insertBefore, "insertBefore");
|
|
383
|
-
function removeChild(parent, child) {
|
|
384
|
-
disposeNodeOwner(child);
|
|
385
|
-
if (isVobsFragment(child)) {
|
|
386
|
-
child.unmount(parent);
|
|
387
|
-
return;
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
388
17
|
}
|
|
389
|
-
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
function setTextContent(node, content) {
|
|
393
|
-
getRenderer().setTextContent(node, content);
|
|
394
|
-
}
|
|
395
|
-
__name(setTextContent, "setTextContent");
|
|
396
|
-
function setAttribute(node, key, value) {
|
|
397
|
-
getRenderer().setAttribute(node, key, value);
|
|
398
|
-
}
|
|
399
|
-
__name(setAttribute, "setAttribute");
|
|
400
|
-
function addEventListener(node, event, handler) {
|
|
401
|
-
const renderer = getRenderer();
|
|
402
|
-
const owner = getCurrentOwner();
|
|
403
|
-
let bindings = eventBindings.get(node);
|
|
404
|
-
if (!bindings) {
|
|
405
|
-
bindings = /* @__PURE__ */ new Map();
|
|
406
|
-
eventBindings.set(node, bindings);
|
|
407
|
-
}
|
|
408
|
-
const previous = bindings.get(event);
|
|
409
|
-
if (previous && previous.original === handler && previous.owner === owner) return;
|
|
410
|
-
if (previous) renderer.removeEventListener(node, event, previous.handler);
|
|
411
|
-
const listener = owner ? (reason) => {
|
|
412
|
-
try {
|
|
413
|
-
owner.run(() => handler(reason));
|
|
414
|
-
} catch (error) {
|
|
415
|
-
const handled = owner.handleError(error);
|
|
416
|
-
invokeRuntimeDebug("error", {
|
|
417
|
-
error,
|
|
418
|
-
owner,
|
|
419
|
-
phase: "event",
|
|
420
|
-
handled,
|
|
421
|
-
recovery: handled ? "handled" : "propagated"
|
|
422
|
-
});
|
|
423
|
-
if (!handled) throw error;
|
|
424
|
-
}
|
|
425
|
-
} : handler;
|
|
426
|
-
const binding = { handler: listener, owner, original: handler };
|
|
427
|
-
bindings.set(event, binding);
|
|
428
|
-
renderer.addEventListener(node, event, listener);
|
|
429
|
-
owner?.onDispose(() => {
|
|
430
|
-
if (bindings?.get(event) !== binding) return;
|
|
431
|
-
bindings.delete(event);
|
|
432
|
-
renderer.removeEventListener(node, event, listener);
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
__name(addEventListener, "addEventListener");
|
|
436
|
-
function createBlock(factory) {
|
|
437
|
-
const owner = createOwner();
|
|
438
|
-
setOwnerDebugName(owner, "dynamic");
|
|
439
|
-
let node;
|
|
440
|
-
try {
|
|
441
|
-
node = owner.run(factory);
|
|
442
|
-
} catch (error) {
|
|
443
|
-
owner.dispose();
|
|
444
|
-
throw error;
|
|
445
|
-
}
|
|
446
|
-
if (!node) {
|
|
447
|
-
owner.dispose();
|
|
448
|
-
return null;
|
|
449
|
-
}
|
|
450
|
-
associateNodeOwner(node, owner);
|
|
451
|
-
return node;
|
|
452
|
-
}
|
|
453
|
-
__name(createBlock, "createBlock");
|
|
454
|
-
function associateNodeOwner(node, owner) {
|
|
455
|
-
nodeOwners.set(node, owner);
|
|
456
|
-
}
|
|
457
|
-
__name(associateNodeOwner, "associateNodeOwner");
|
|
458
|
-
function disposeNodeOwner(node) {
|
|
459
|
-
const owner = nodeOwners.get(node);
|
|
460
|
-
if (!owner) return;
|
|
461
|
-
nodeOwners.delete(node);
|
|
462
|
-
owner.dispose();
|
|
463
|
-
}
|
|
464
|
-
__name(disposeNodeOwner, "disposeNodeOwner");
|
|
465
|
-
|
|
466
|
-
// packages/runtime/src/fragment.ts
|
|
467
|
-
function createFragment(factory) {
|
|
468
|
-
const start = createComment("vobs:fragment:start");
|
|
469
|
-
const end = createComment("vobs:fragment:end");
|
|
470
|
-
let parent = null;
|
|
471
|
-
let initialized = false;
|
|
472
|
-
const owner = getCurrentOwner();
|
|
473
|
-
const fragment = {
|
|
474
|
-
kind: "vobs-fragment",
|
|
475
|
-
start,
|
|
476
|
-
end,
|
|
477
|
-
mount(nextParent, anchor) {
|
|
478
|
-
if (parent && parent !== nextParent) {
|
|
479
|
-
throw new Error("Vobs Fragment: \u4E0D\u80FD\u8DE8\u7236\u8282\u70B9\u79FB\u52A8 Fragment");
|
|
480
|
-
}
|
|
481
|
-
if (initialized) {
|
|
482
|
-
moveRange(nextParent, start, end, anchor);
|
|
483
|
-
return;
|
|
484
|
-
}
|
|
485
|
-
const renderer = getRenderer();
|
|
486
|
-
renderer.insertBefore(nextParent, start, anchor);
|
|
487
|
-
renderer.insertBefore(nextParent, end, anchor);
|
|
488
|
-
parent = nextParent;
|
|
489
|
-
initialized = true;
|
|
490
|
-
if (owner) owner.run(() => factory(nextParent, end));
|
|
491
|
-
else factory(nextParent, end);
|
|
492
|
-
},
|
|
493
|
-
unmount(nextParent) {
|
|
494
|
-
if (!initialized || parent !== nextParent) {
|
|
495
|
-
throw new Error("Vobs Fragment: Fragment \u4E0D\u5C5E\u4E8E\u6307\u5B9A\u7236\u8282\u70B9");
|
|
496
|
-
}
|
|
497
|
-
const renderer = getRenderer();
|
|
498
|
-
let current = renderer.nextSibling(start);
|
|
499
|
-
while (current && current !== end) {
|
|
500
|
-
const next = renderer.nextSibling(current);
|
|
501
|
-
renderer.removeChild(nextParent, current);
|
|
502
|
-
current = next;
|
|
503
|
-
}
|
|
504
|
-
renderer.removeChild(nextParent, start);
|
|
505
|
-
renderer.removeChild(nextParent, end);
|
|
506
|
-
parent = null;
|
|
507
|
-
initialized = false;
|
|
508
|
-
}
|
|
509
|
-
};
|
|
510
|
-
return fragment;
|
|
511
|
-
}
|
|
512
|
-
__name(createFragment, "createFragment");
|
|
513
|
-
function isVobsFragment(value) {
|
|
514
|
-
return Boolean(value) && typeof value === "object" && value.kind === "vobs-fragment";
|
|
515
|
-
}
|
|
516
|
-
__name(isVobsFragment, "isVobsFragment");
|
|
517
|
-
function moveRange(parent, start, end, anchor) {
|
|
518
|
-
const renderer = getRenderer();
|
|
519
|
-
const nodes = [start];
|
|
520
|
-
let current = renderer.nextSibling(start);
|
|
521
|
-
while (current) {
|
|
522
|
-
nodes.push(current);
|
|
523
|
-
if (current === end) break;
|
|
524
|
-
current = renderer.nextSibling(current);
|
|
525
|
-
}
|
|
526
|
-
if (nodes[nodes.length - 1] !== end) {
|
|
527
|
-
throw new Error("Vobs Fragment: \u627E\u4E0D\u5230\u7ED3\u675F\u951A\u70B9");
|
|
528
|
-
}
|
|
529
|
-
for (const node of nodes) renderer.insertBefore(parent, node, anchor);
|
|
530
|
-
}
|
|
531
|
-
__name(moveRange, "moveRange");
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
532
21
|
|
|
533
|
-
// packages/
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
if (next === current) return;
|
|
541
|
-
if (current) removeChild(parent, current);
|
|
542
|
-
current = next;
|
|
543
|
-
if (current) insertBefore(parent, current, marker);
|
|
544
|
-
});
|
|
545
|
-
}
|
|
546
|
-
__name(insertDynamic, "insertDynamic");
|
|
22
|
+
// packages/ui/src/workbench-titlebar.ts
|
|
23
|
+
var workbench_titlebar_exports = {};
|
|
24
|
+
__export(workbench_titlebar_exports, {
|
|
25
|
+
WorkbenchTitlebar: () => WorkbenchTitlebar
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(workbench_titlebar_exports);
|
|
28
|
+
var import_vobs2 = require("@vobs/vobs");
|
|
547
29
|
|
|
548
30
|
// packages/ui/src/utils.ts
|
|
31
|
+
var import_reactivity = require("@vobs/reactivity");
|
|
32
|
+
var import_vobs = require("@vobs/vobs");
|
|
549
33
|
function classNames(...values) {
|
|
550
34
|
return values.flatMap((value) => typeof value === "string" ? value.trim().split(/\s+/u) : []).filter(Boolean).join(" ");
|
|
551
35
|
}
|
|
@@ -560,8 +44,8 @@ function hasProp(props, name) {
|
|
|
560
44
|
}
|
|
561
45
|
__name(hasProp, "hasProp");
|
|
562
46
|
function bindClassList(root, props, readBaseClasses) {
|
|
563
|
-
effect(() => {
|
|
564
|
-
setAttribute(root, "class", classNames(
|
|
47
|
+
(0, import_reactivity.effect)(() => {
|
|
48
|
+
(0, import_vobs.setAttribute)(root, "class", classNames(
|
|
565
49
|
...readBaseClasses(),
|
|
566
50
|
readString(props, "class"),
|
|
567
51
|
readString(props, "className")
|
|
@@ -575,7 +59,7 @@ function bindCommonAttributes(root, props, skip = [], options = {}) {
|
|
|
575
59
|
ignored.add("className");
|
|
576
60
|
ignored.add("children");
|
|
577
61
|
ignored.add("style");
|
|
578
|
-
effect(() => {
|
|
62
|
+
(0, import_reactivity.effect)(() => {
|
|
579
63
|
const next = /* @__PURE__ */ new Map();
|
|
580
64
|
for (const name of Object.keys(props)) {
|
|
581
65
|
if (ignored.has(name) || name.startsWith("on")) continue;
|
|
@@ -589,7 +73,7 @@ function bindCommonAttributes(root, props, skip = [], options = {}) {
|
|
|
589
73
|
for (const name of managed) {
|
|
590
74
|
if (!next.has(name)) removeAttribute(root, name);
|
|
591
75
|
}
|
|
592
|
-
for (const [name, value] of next) setAttribute(root, name, value);
|
|
76
|
+
for (const [name, value] of next) (0, import_vobs.setAttribute)(root, name, value);
|
|
593
77
|
setManagedAttributes(root, next.keys());
|
|
594
78
|
});
|
|
595
79
|
}
|
|
@@ -599,35 +83,35 @@ function bindUserStyle(root, props) {
|
|
|
599
83
|
}
|
|
600
84
|
__name(bindUserStyle, "bindUserStyle");
|
|
601
85
|
function bindStyle(root, props, createStyle) {
|
|
602
|
-
effect(() => {
|
|
86
|
+
(0, import_reactivity.effect)(() => {
|
|
603
87
|
const userStyle = readString(props, "style");
|
|
604
88
|
const internalStyle = createStyle();
|
|
605
89
|
const style = [internalStyle, userStyle].filter(Boolean).join("; ");
|
|
606
|
-
if (style) setAttribute(root, "style", style);
|
|
90
|
+
if (style) (0, import_vobs.setAttribute)(root, "style", style);
|
|
607
91
|
else removeAttribute(root, "style");
|
|
608
92
|
});
|
|
609
93
|
}
|
|
610
94
|
__name(bindStyle, "bindStyle");
|
|
611
95
|
function bindTextContent(node, read) {
|
|
612
|
-
effect(() => {
|
|
613
|
-
setTextContent(node, String(read() ?? ""));
|
|
96
|
+
(0, import_reactivity.effect)(() => {
|
|
97
|
+
(0, import_vobs.setTextContent)(node, String(read() ?? ""));
|
|
614
98
|
});
|
|
615
99
|
}
|
|
616
100
|
__name(bindTextContent, "bindTextContent");
|
|
617
101
|
function mountSlot(parent, props, propName) {
|
|
618
|
-
insertDynamic(parent, null, () => resolveSlot(Reflect.get(props, propName)));
|
|
102
|
+
(0, import_vobs.insertDynamic)(parent, null, () => resolveSlot(Reflect.get(props, propName)));
|
|
619
103
|
}
|
|
620
104
|
__name(mountSlot, "mountSlot");
|
|
621
105
|
function resolveSlot(value) {
|
|
622
106
|
const resolved = typeof value === "function" ? value() : value;
|
|
623
107
|
if (resolved === void 0 || resolved === null || resolved === false) return null;
|
|
624
|
-
if (typeof resolved === "string" || typeof resolved === "number") return createText(String(resolved));
|
|
108
|
+
if (typeof resolved === "string" || typeof resolved === "number") return (0, import_vobs.createText)(String(resolved));
|
|
625
109
|
if (Array.isArray(resolved)) {
|
|
626
110
|
const children = resolved;
|
|
627
|
-
return createFragment((parent, anchor) => {
|
|
111
|
+
return (0, import_vobs.createFragment)((parent, anchor) => {
|
|
628
112
|
for (const child of children) {
|
|
629
113
|
const node = resolveSlot(child);
|
|
630
|
-
if (node) insertBefore(parent, node, anchor);
|
|
114
|
+
if (node) (0, import_vobs.insertBefore)(parent, node, anchor);
|
|
631
115
|
}
|
|
632
116
|
});
|
|
633
117
|
}
|
|
@@ -639,7 +123,7 @@ function setOptionalAttribute(node, name, value) {
|
|
|
639
123
|
removeAttribute(node, name);
|
|
640
124
|
return;
|
|
641
125
|
}
|
|
642
|
-
setAttribute(node, name, String(value));
|
|
126
|
+
(0, import_vobs.setAttribute)(node, name, String(value));
|
|
643
127
|
}
|
|
644
128
|
__name(setOptionalAttribute, "setOptionalAttribute");
|
|
645
129
|
function readString(props, name) {
|
|
@@ -674,9 +158,9 @@ __name(removeAttribute, "removeAttribute");
|
|
|
674
158
|
|
|
675
159
|
// packages/ui/src/workbench-titlebar.ts
|
|
676
160
|
function WorkbenchTitlebar(props = {}) {
|
|
677
|
-
const root = createElement("header");
|
|
678
|
-
const left = createElement("div");
|
|
679
|
-
const right = createElement("div");
|
|
161
|
+
const root = (0, import_vobs2.createElement)("header");
|
|
162
|
+
const left = (0, import_vobs2.createElement)("div");
|
|
163
|
+
const right = (0, import_vobs2.createElement)("div");
|
|
680
164
|
bindClassList(root, props, () => ["vui-wbtitlebar"]);
|
|
681
165
|
bindCommonAttributes(root, props, [
|
|
682
166
|
"mode",
|
|
@@ -692,50 +176,50 @@ function WorkbenchTitlebar(props = {}) {
|
|
|
692
176
|
"onProjectClick"
|
|
693
177
|
]);
|
|
694
178
|
bindUserStyle(root, props);
|
|
695
|
-
setAttribute(left, "class", "vui-wbtitlebar__left");
|
|
696
|
-
setAttribute(right, "class", "vui-wbtitlebar__right");
|
|
697
|
-
insertDynamic(left, null, () => createTitlebarLeft(props));
|
|
179
|
+
(0, import_vobs2.setAttribute)(left, "class", "vui-wbtitlebar__left");
|
|
180
|
+
(0, import_vobs2.setAttribute)(right, "class", "vui-wbtitlebar__right");
|
|
181
|
+
(0, import_vobs2.insertDynamic)(left, null, () => createTitlebarLeft(props));
|
|
698
182
|
if (hasProp(props, "actions")) mountSlot(right, props, "actions");
|
|
699
183
|
if (hasProp(props, "children")) mountSlot(right, props, "children");
|
|
700
|
-
insertBefore(root, left, null);
|
|
701
|
-
insertBefore(root, right, null);
|
|
184
|
+
(0, import_vobs2.insertBefore)(root, left, null);
|
|
185
|
+
(0, import_vobs2.insertBefore)(root, right, null);
|
|
702
186
|
return root;
|
|
703
187
|
}
|
|
704
188
|
__name(WorkbenchTitlebar, "WorkbenchTitlebar");
|
|
705
189
|
function createTitlebarLeft(props) {
|
|
706
|
-
return createFragment((parent, anchor) => {
|
|
190
|
+
return (0, import_vobs2.createFragment)((parent, anchor) => {
|
|
707
191
|
if (readProp(props, "windowControls", true)) {
|
|
708
|
-
const lights = createElement("div");
|
|
709
|
-
setAttribute(lights, "class", "vui-wbtitlebar__lights");
|
|
710
|
-
insertBefore(lights, createWindowLight("close", props, "onWindowClose"), null);
|
|
711
|
-
insertBefore(lights, createWindowLight("min", props, "onWindowMinimize"), null);
|
|
712
|
-
insertBefore(lights, createWindowLight("max", props, "onWindowMaximize"), null);
|
|
713
|
-
insertBefore(parent, lights, anchor);
|
|
192
|
+
const lights = (0, import_vobs2.createElement)("div");
|
|
193
|
+
(0, import_vobs2.setAttribute)(lights, "class", "vui-wbtitlebar__lights");
|
|
194
|
+
(0, import_vobs2.insertBefore)(lights, createWindowLight("close", props, "onWindowClose"), null);
|
|
195
|
+
(0, import_vobs2.insertBefore)(lights, createWindowLight("min", props, "onWindowMinimize"), null);
|
|
196
|
+
(0, import_vobs2.insertBefore)(lights, createWindowLight("max", props, "onWindowMaximize"), null);
|
|
197
|
+
(0, import_vobs2.insertBefore)(parent, lights, anchor);
|
|
714
198
|
}
|
|
715
199
|
if (hasProp(props, "mode")) {
|
|
716
|
-
const mode = createElement("span");
|
|
717
|
-
setAttribute(mode, "class", "vui-wbtitlebar__mode-chip");
|
|
200
|
+
const mode = (0, import_vobs2.createElement)("span");
|
|
201
|
+
(0, import_vobs2.setAttribute)(mode, "class", "vui-wbtitlebar__mode-chip");
|
|
718
202
|
if (hasProp(props, "modeIcon")) {
|
|
719
|
-
const icon = createElement("span");
|
|
720
|
-
setAttribute(icon, "class", "vui-wbtitlebar__mode-icon");
|
|
203
|
+
const icon = (0, import_vobs2.createElement)("span");
|
|
204
|
+
(0, import_vobs2.setAttribute)(icon, "class", "vui-wbtitlebar__mode-icon");
|
|
721
205
|
mountSlot(icon, props, "modeIcon");
|
|
722
|
-
insertBefore(mode, icon, null);
|
|
206
|
+
(0, import_vobs2.insertBefore)(mode, icon, null);
|
|
723
207
|
}
|
|
724
|
-
const text = createText("");
|
|
208
|
+
const text = (0, import_vobs2.createText)("");
|
|
725
209
|
bindTextContent(text, () => readProp(props, "mode", ""));
|
|
726
|
-
insertBefore(mode, text, null);
|
|
727
|
-
insertBefore(parent, mode, anchor);
|
|
210
|
+
(0, import_vobs2.insertBefore)(mode, text, null);
|
|
211
|
+
(0, import_vobs2.insertBefore)(parent, mode, anchor);
|
|
728
212
|
}
|
|
729
|
-
if (hasProp(props, "project")) insertBefore(parent, createProjectSelector(props), anchor);
|
|
213
|
+
if (hasProp(props, "project")) (0, import_vobs2.insertBefore)(parent, createProjectSelector(props), anchor);
|
|
730
214
|
});
|
|
731
215
|
}
|
|
732
216
|
__name(createTitlebarLeft, "createTitlebarLeft");
|
|
733
217
|
function createWindowLight(kind, props, handlerName) {
|
|
734
|
-
const light = createElement("button");
|
|
735
|
-
setAttribute(light, "class", `vui-wbtitlebar__light vui-wbtitlebar__light--${kind}`);
|
|
736
|
-
setAttribute(light, "type", "button");
|
|
737
|
-
setAttribute(light, "aria-label", kind === "close" ? "Close window" : kind === "min" ? "Minimize window" : "Maximize window");
|
|
738
|
-
addEventListener(light, "click", (event) => {
|
|
218
|
+
const light = (0, import_vobs2.createElement)("button");
|
|
219
|
+
(0, import_vobs2.setAttribute)(light, "class", `vui-wbtitlebar__light vui-wbtitlebar__light--${kind}`);
|
|
220
|
+
(0, import_vobs2.setAttribute)(light, "type", "button");
|
|
221
|
+
(0, import_vobs2.setAttribute)(light, "aria-label", kind === "close" ? "Close window" : kind === "min" ? "Minimize window" : "Maximize window");
|
|
222
|
+
(0, import_vobs2.addEventListener)(light, "click", (event) => {
|
|
739
223
|
const handler = readProp(props, handlerName, void 0);
|
|
740
224
|
if (typeof handler === "function") handler(event);
|
|
741
225
|
});
|
|
@@ -743,33 +227,34 @@ function createWindowLight(kind, props, handlerName) {
|
|
|
743
227
|
}
|
|
744
228
|
__name(createWindowLight, "createWindowLight");
|
|
745
229
|
function createProjectSelector(props) {
|
|
746
|
-
const button = createElement("button");
|
|
747
|
-
setAttribute(button, "class", "vui-wbtitlebar__project-selector");
|
|
748
|
-
setAttribute(button, "type", "button");
|
|
230
|
+
const button = (0, import_vobs2.createElement)("button");
|
|
231
|
+
(0, import_vobs2.setAttribute)(button, "class", "vui-wbtitlebar__project-selector");
|
|
232
|
+
(0, import_vobs2.setAttribute)(button, "type", "button");
|
|
749
233
|
setOptionalAttribute(button, "aria-label", readProp(props, "project", "Project"));
|
|
750
234
|
if (hasProp(props, "projectIcon")) {
|
|
751
|
-
const icon = createElement("span");
|
|
752
|
-
setAttribute(icon, "class", "vui-wbtitlebar__project-icon");
|
|
235
|
+
const icon = (0, import_vobs2.createElement)("span");
|
|
236
|
+
(0, import_vobs2.setAttribute)(icon, "class", "vui-wbtitlebar__project-icon");
|
|
753
237
|
mountSlot(icon, props, "projectIcon");
|
|
754
|
-
insertBefore(button, icon, null);
|
|
238
|
+
(0, import_vobs2.insertBefore)(button, icon, null);
|
|
755
239
|
}
|
|
756
|
-
const project = createText("");
|
|
240
|
+
const project = (0, import_vobs2.createText)("");
|
|
757
241
|
bindTextContent(project, () => readProp(props, "project", ""));
|
|
758
|
-
insertBefore(button, project, null);
|
|
242
|
+
(0, import_vobs2.insertBefore)(button, project, null);
|
|
759
243
|
if (hasProp(props, "projectChevron")) {
|
|
760
|
-
const chevron = createElement("span");
|
|
761
|
-
setAttribute(chevron, "class", "vui-wbtitlebar__project-chevron");
|
|
244
|
+
const chevron = (0, import_vobs2.createElement)("span");
|
|
245
|
+
(0, import_vobs2.setAttribute)(chevron, "class", "vui-wbtitlebar__project-chevron");
|
|
762
246
|
mountSlot(chevron, props, "projectChevron");
|
|
763
|
-
insertBefore(button, chevron, null);
|
|
247
|
+
(0, import_vobs2.insertBefore)(button, chevron, null);
|
|
764
248
|
}
|
|
765
|
-
addEventListener(button, "click", (event) => {
|
|
249
|
+
(0, import_vobs2.addEventListener)(button, "click", (event) => {
|
|
766
250
|
const handler = readProp(props, "onProjectClick", void 0);
|
|
767
251
|
if (typeof handler === "function") handler(event);
|
|
768
252
|
});
|
|
769
253
|
return button;
|
|
770
254
|
}
|
|
771
255
|
__name(createProjectSelector, "createProjectSelector");
|
|
772
|
-
|
|
773
|
-
exports
|
|
774
|
-
|
|
256
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
257
|
+
0 && (module.exports = {
|
|
258
|
+
WorkbenchTitlebar
|
|
259
|
+
});
|
|
775
260
|
//# sourceMappingURL=workbench-titlebar.cjs.map
|