@rool-dev/extension 0.3.8-dev.009f6e4 → 0.3.8-dev.368b058
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/README.md +8 -7
- package/dist/cli/build-pipeline.js +1 -1
- package/dist/cli/dev.js +1 -1
- package/dist/cli/init.js +1 -1
- package/dist/dev/DevHostController.d.ts +4 -0
- package/dist/dev/DevHostController.d.ts.map +1 -1
- package/dist/dev/DevHostController.js +18 -1
- package/dist/dev/HostShell.svelte +11 -8
- package/dist/dev/HostShell.svelte.d.ts +1 -8
- package/dist/dev/HostShell.svelte.d.ts.map +1 -1
- package/dist/dev/Sidebar.svelte +14 -1
- package/dist/dev/Sidebar.svelte.d.ts +1 -0
- package/dist/dev/Sidebar.svelte.d.ts.map +1 -1
- package/dist/dev/app.css +1 -0
- package/dist/dev/host-shell.js +153 -62
- package/dist/dev/host-shell.js.map +1 -1
- package/dist/host.d.ts +6 -1
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +11 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/protocol.d.ts +3 -0
- package/dist/protocol.d.ts.map +1 -1
- package/dist/reactive.svelte.d.ts +2 -1
- package/dist/reactive.svelte.d.ts.map +1 -1
- package/dist/reactive.svelte.js +15 -1
- package/package.json +2 -2
package/dist/dev/host-shell.js
CHANGED
|
@@ -313,6 +313,19 @@ function set_component_context(context) {
|
|
|
313
313
|
component_context = context;
|
|
314
314
|
}
|
|
315
315
|
/**
|
|
316
|
+
* Retrieves the context that belongs to the closest parent component with the specified `key`.
|
|
317
|
+
* Must be called during component initialisation.
|
|
318
|
+
*
|
|
319
|
+
* [`createContext`](https://svelte.dev/docs/svelte/svelte#createContext) is a type-safe alternative.
|
|
320
|
+
*
|
|
321
|
+
* @template T
|
|
322
|
+
* @param {any} key
|
|
323
|
+
* @returns {T}
|
|
324
|
+
*/
|
|
325
|
+
function getContext(key) {
|
|
326
|
+
return get_or_init_context_map("getContext").get(key);
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
316
329
|
* @param {Record<string, unknown>} props
|
|
317
330
|
* @param {any} runes
|
|
318
331
|
* @param {Function} [fn]
|
|
@@ -355,6 +368,27 @@ function pop(component) {
|
|
|
355
368
|
function is_runes() {
|
|
356
369
|
return !legacy_mode_flag || component_context !== null && component_context.l === null;
|
|
357
370
|
}
|
|
371
|
+
/**
|
|
372
|
+
* @param {string} name
|
|
373
|
+
* @returns {Map<unknown, unknown>}
|
|
374
|
+
*/
|
|
375
|
+
function get_or_init_context_map(name) {
|
|
376
|
+
if (component_context === null) lifecycle_outside_component(name);
|
|
377
|
+
return component_context.c ??= new Map(get_parent_context(component_context) || void 0);
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* @param {ComponentContext} component_context
|
|
381
|
+
* @returns {Map<unknown, unknown> | null}
|
|
382
|
+
*/
|
|
383
|
+
function get_parent_context(component_context) {
|
|
384
|
+
let parent = component_context.p;
|
|
385
|
+
while (parent !== null) {
|
|
386
|
+
const context_map = parent.c;
|
|
387
|
+
if (context_map !== null) return context_map;
|
|
388
|
+
parent = parent.p;
|
|
389
|
+
}
|
|
390
|
+
return null;
|
|
391
|
+
}
|
|
358
392
|
//#endregion
|
|
359
393
|
//#region ../../node_modules/.pnpm/svelte@5.54.0/node_modules/svelte/src/internal/client/dom/task.js
|
|
360
394
|
/** @type {Array<() => void>} */
|
|
@@ -3179,6 +3213,52 @@ function from_html(content, flags) {
|
|
|
3179
3213
|
};
|
|
3180
3214
|
}
|
|
3181
3215
|
/**
|
|
3216
|
+
* @param {string} content
|
|
3217
|
+
* @param {number} flags
|
|
3218
|
+
* @param {'svg' | 'math'} ns
|
|
3219
|
+
* @returns {() => Node | Node[]}
|
|
3220
|
+
*/
|
|
3221
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3222
|
+
function from_namespace(content, flags, ns = "svg") {
|
|
3223
|
+
/**
|
|
3224
|
+
* Whether or not the first item is a text/element node. If not, we need to
|
|
3225
|
+
* create an additional comment node to act as `effect.nodes.start`
|
|
3226
|
+
*/
|
|
3227
|
+
var has_start = !content.startsWith("<!>");
|
|
3228
|
+
var is_fragment = (flags & 1) !== 0;
|
|
3229
|
+
var wrapped = `<${ns}>${has_start ? content : "<!>" + content}</${ns}>`;
|
|
3230
|
+
/** @type {Element | DocumentFragment} */
|
|
3231
|
+
var node;
|
|
3232
|
+
return () => {
|
|
3233
|
+
if (hydrating) {
|
|
3234
|
+
assign_nodes(hydrate_node, null);
|
|
3235
|
+
return hydrate_node;
|
|
3236
|
+
}
|
|
3237
|
+
if (!node) {
|
|
3238
|
+
var root = /* @__PURE__ */ get_first_child(create_fragment_from_html(wrapped));
|
|
3239
|
+
if (is_fragment) {
|
|
3240
|
+
node = document.createDocumentFragment();
|
|
3241
|
+
while (/* @__PURE__ */ get_first_child(root)) node.appendChild(/* @__PURE__ */ get_first_child(root));
|
|
3242
|
+
} else node = /* @__PURE__ */ get_first_child(root);
|
|
3243
|
+
}
|
|
3244
|
+
var clone = node.cloneNode(true);
|
|
3245
|
+
if (is_fragment) {
|
|
3246
|
+
var start = /* @__PURE__ */ get_first_child(clone);
|
|
3247
|
+
var end = clone.lastChild;
|
|
3248
|
+
assign_nodes(start, end);
|
|
3249
|
+
} else assign_nodes(clone, clone);
|
|
3250
|
+
return clone;
|
|
3251
|
+
};
|
|
3252
|
+
}
|
|
3253
|
+
/**
|
|
3254
|
+
* @param {string} content
|
|
3255
|
+
* @param {number} flags
|
|
3256
|
+
*/
|
|
3257
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3258
|
+
function from_svg(content, flags) {
|
|
3259
|
+
return /* @__PURE__ */ from_namespace(content, flags, "svg");
|
|
3260
|
+
}
|
|
3261
|
+
/**
|
|
3182
3262
|
* Don't mark this as side-effect-free, hydration needs to walk all nodes
|
|
3183
3263
|
* @param {any} value
|
|
3184
3264
|
*/
|
|
@@ -4119,48 +4199,6 @@ function bind_this(element_or_component = {}, update, get_value, get_parts) {
|
|
|
4119
4199
|
//#region ../../node_modules/.pnpm/svelte@5.54.0/node_modules/svelte/src/internal/client/reactivity/props.js
|
|
4120
4200
|
/** @import { Effect, Source } from './types.js' */
|
|
4121
4201
|
/**
|
|
4122
|
-
* The proxy handler for rest props (i.e. `const { x, ...rest } = $props()`).
|
|
4123
|
-
* Is passed the full `$$props` object and excludes the named props.
|
|
4124
|
-
* @type {ProxyHandler<{ props: Record<string | symbol, unknown>, exclude: Array<string | symbol>, name?: string }>}}
|
|
4125
|
-
*/
|
|
4126
|
-
var rest_props_handler = {
|
|
4127
|
-
get(target, key) {
|
|
4128
|
-
if (target.exclude.includes(key)) return;
|
|
4129
|
-
return target.props[key];
|
|
4130
|
-
},
|
|
4131
|
-
set(target, key) {
|
|
4132
|
-
return false;
|
|
4133
|
-
},
|
|
4134
|
-
getOwnPropertyDescriptor(target, key) {
|
|
4135
|
-
if (target.exclude.includes(key)) return;
|
|
4136
|
-
if (key in target.props) return {
|
|
4137
|
-
enumerable: true,
|
|
4138
|
-
configurable: true,
|
|
4139
|
-
value: target.props[key]
|
|
4140
|
-
};
|
|
4141
|
-
},
|
|
4142
|
-
has(target, key) {
|
|
4143
|
-
if (target.exclude.includes(key)) return false;
|
|
4144
|
-
return key in target.props;
|
|
4145
|
-
},
|
|
4146
|
-
ownKeys(target) {
|
|
4147
|
-
return Reflect.ownKeys(target.props).filter((key) => !target.exclude.includes(key));
|
|
4148
|
-
}
|
|
4149
|
-
};
|
|
4150
|
-
/**
|
|
4151
|
-
* @param {Record<string, unknown>} props
|
|
4152
|
-
* @param {string[]} exclude
|
|
4153
|
-
* @param {string} [name]
|
|
4154
|
-
* @returns {Record<string, unknown>}
|
|
4155
|
-
*/
|
|
4156
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
4157
|
-
function rest_props(props, exclude, name) {
|
|
4158
|
-
return new Proxy({
|
|
4159
|
-
props,
|
|
4160
|
-
exclude
|
|
4161
|
-
}, rest_props_handler);
|
|
4162
|
-
}
|
|
4163
|
-
/**
|
|
4164
4202
|
* This function is responsible for synchronizing a possibly bound prop with the inner component state.
|
|
4165
4203
|
* It is used whenever the compiler sees that the component writes to the prop, or when it has a default prop_value.
|
|
4166
4204
|
* @template V
|
|
@@ -9011,12 +9049,14 @@ var BridgeHost = class {
|
|
|
9011
9049
|
channel;
|
|
9012
9050
|
iframe;
|
|
9013
9051
|
user;
|
|
9052
|
+
_colorScheme;
|
|
9014
9053
|
eventCleanups = [];
|
|
9015
9054
|
_destroyed = false;
|
|
9016
9055
|
constructor(options) {
|
|
9017
9056
|
this.channel = options.channel;
|
|
9018
9057
|
this.iframe = options.iframe;
|
|
9019
9058
|
this.user = options.user;
|
|
9059
|
+
this._colorScheme = options.colorScheme ?? "light";
|
|
9020
9060
|
window.addEventListener("message", this._onMessage);
|
|
9021
9061
|
for (const eventName of FORWARDED_EVENTS) {
|
|
9022
9062
|
const handler = (data) => {
|
|
@@ -9042,6 +9082,7 @@ var BridgeHost = class {
|
|
|
9042
9082
|
linkAccess: this.channel.linkAccess,
|
|
9043
9083
|
userId: this.channel.userId,
|
|
9044
9084
|
user: this.user,
|
|
9085
|
+
colorScheme: this._colorScheme,
|
|
9045
9086
|
schema: this.channel.getSchema(),
|
|
9046
9087
|
metadata: this.channel.getAllMetadata()
|
|
9047
9088
|
};
|
|
@@ -9097,6 +9138,15 @@ var BridgeHost = class {
|
|
|
9097
9138
|
});
|
|
9098
9139
|
}
|
|
9099
9140
|
}
|
|
9141
|
+
/** Update the color scheme and push to the extension iframe. */
|
|
9142
|
+
setColorScheme(colorScheme) {
|
|
9143
|
+
this._colorScheme = colorScheme;
|
|
9144
|
+
this._postToApp({
|
|
9145
|
+
type: "rool:event",
|
|
9146
|
+
name: "colorSchemeChanged",
|
|
9147
|
+
data: { colorScheme }
|
|
9148
|
+
});
|
|
9149
|
+
}
|
|
9100
9150
|
_postToApp(message) {
|
|
9101
9151
|
if (this._destroyed) return;
|
|
9102
9152
|
this.iframe.contentWindow?.postMessage(message, "*");
|
|
@@ -9184,6 +9234,7 @@ var DevHostController = class {
|
|
|
9184
9234
|
publishedExtensions = [];
|
|
9185
9235
|
installedExtensionIds = [];
|
|
9186
9236
|
sidebarCollapsed = false;
|
|
9237
|
+
colorScheme = "light";
|
|
9187
9238
|
publishState = "idle";
|
|
9188
9239
|
publishMessage = null;
|
|
9189
9240
|
publishUrl = null;
|
|
@@ -9203,6 +9254,7 @@ var DevHostController = class {
|
|
|
9203
9254
|
this._spaceKey = `rool-devhost:${options.channelId}:space`;
|
|
9204
9255
|
this.env = this._getSavedEnv();
|
|
9205
9256
|
this.sidebarCollapsed = storageGet("rool-devhost:collapsed") === "true";
|
|
9257
|
+
this.colorScheme = this._getSavedColorScheme();
|
|
9206
9258
|
}
|
|
9207
9259
|
get tabs() {
|
|
9208
9260
|
return [{
|
|
@@ -9404,6 +9456,12 @@ var DevHostController = class {
|
|
|
9404
9456
|
storageSet("rool-devhost:collapsed", String(this.sidebarCollapsed));
|
|
9405
9457
|
this._onChange();
|
|
9406
9458
|
}
|
|
9459
|
+
toggleColorScheme() {
|
|
9460
|
+
this.colorScheme = this.colorScheme === "light" ? "dark" : "light";
|
|
9461
|
+
storageSet("rool-devhost:colorScheme", this.colorScheme);
|
|
9462
|
+
for (const host of Object.values(this.bridgeHosts)) host.setColorScheme(this.colorScheme);
|
|
9463
|
+
this._onChange();
|
|
9464
|
+
}
|
|
9407
9465
|
registerIframe(tabId, el) {
|
|
9408
9466
|
this.iframeEls[tabId] = el;
|
|
9409
9467
|
this._bindBridge(tabId);
|
|
@@ -9429,7 +9487,8 @@ var DevHostController = class {
|
|
|
9429
9487
|
if (el && ch && !this.bridgeHosts[tabId]) this.bridgeHosts[tabId] = createBridgeHost({
|
|
9430
9488
|
channel: ch,
|
|
9431
9489
|
iframe: el,
|
|
9432
|
-
user: this._bridgeUser
|
|
9490
|
+
user: this._bridgeUser,
|
|
9491
|
+
colorScheme: this.colorScheme
|
|
9433
9492
|
});
|
|
9434
9493
|
}
|
|
9435
9494
|
_bindAllBridges() {
|
|
@@ -9472,6 +9531,11 @@ var DevHostController = class {
|
|
|
9472
9531
|
if (saved === "local" || saved === "dev" || saved === "prod") return saved;
|
|
9473
9532
|
return "prod";
|
|
9474
9533
|
}
|
|
9534
|
+
_getSavedColorScheme() {
|
|
9535
|
+
const saved = storageGet("rool-devhost:colorScheme");
|
|
9536
|
+
if (saved === "light" || saved === "dark") return saved;
|
|
9537
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
9538
|
+
}
|
|
9475
9539
|
};
|
|
9476
9540
|
//#endregion
|
|
9477
9541
|
//#region src/dev/Sidebar.svelte
|
|
@@ -9498,7 +9562,9 @@ var root_19 = /* @__PURE__ */ from_html(`<div class="absolute top-full mt-1 left
|
|
|
9498
9562
|
var root_28 = /* @__PURE__ */ from_html(`<a target="_blank" rel="noopener noreferrer" class="block text-[11px] text-indigo-500 hover:text-indigo-600 mt-1.5 truncate"> </a>`);
|
|
9499
9563
|
var root_29 = /* @__PURE__ */ from_html(`<div class="text-[11px] text-red-500 mt-1.5"> </div>`);
|
|
9500
9564
|
var root_22 = /* @__PURE__ */ from_html(`<div class="px-4 py-3 border-b border-slate-100"><div class="text-[10px] font-semibold text-slate-400 uppercase tracking-wider mb-1.5">Publish</div> <button><!></button> <!></div>`);
|
|
9501
|
-
var
|
|
9565
|
+
var root_30 = /* @__PURE__ */ from_svg(`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>`);
|
|
9566
|
+
var root_31 = /* @__PURE__ */ from_svg(`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>`);
|
|
9567
|
+
var root_2$1 = /* @__PURE__ */ from_html(`<div class="w-[280px] shrink-0 bg-white border-r border-slate-200 flex flex-col overflow-y-auto"><div class="px-4 pt-4 pb-3 border-b border-slate-100"><div class="flex items-start justify-between mb-1"><!> <button class="p-1 -mr-1 text-slate-400 hover:text-slate-600 transition-colors shrink-0" title="Collapse sidebar"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 18l-6-6 6-6"></path></svg></button></div> <!> <!> <!></div> <!> <!> <!> <div class="px-4 py-3 border-b border-slate-100"><div class="text-[10px] font-semibold text-slate-400 uppercase tracking-wider mb-1.5">Environment</div> <div class="flex rounded-md border border-slate-200 overflow-hidden"><button>Local</button> <button>Dev</button> <button>Prod</button></div> <div class="text-[10px] text-slate-400 mt-1 font-mono"> </div></div> <div class="px-4 py-3 border-b border-slate-100"><div class="text-[10px] font-semibold text-slate-400 uppercase tracking-wider mb-1.5">Space</div> <div class="relative" data-dropdown=""><button type="button"> <svg class="absolute right-2.5 top-1/2 -translate-y-1/2 text-slate-400 pointer-events-none" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"></path></svg></button> <!></div> <div class="text-[11px] text-slate-400 leading-normal mt-1.5"><span></span> </div></div> <!> <div class="px-4 py-3 mt-auto flex items-center justify-between"><a href="https://docs.rool.dev/extension" target="_blank" rel="noopener noreferrer" class="text-[11px] text-slate-400 hover:text-indigo-500 transition-colors">Documentation</a> <button class="p-1 text-slate-400 hover:text-indigo-500 transition-colors"><!></button> <button class="text-[11px] text-slate-400 hover:text-red-500 transition-colors">Sign out</button></div></div>`);
|
|
9502
9568
|
function Sidebar($$anchor, $$props) {
|
|
9503
9569
|
push($$props, true);
|
|
9504
9570
|
let dropdownOpen = prop($$props, "dropdownOpen", 15);
|
|
@@ -9519,7 +9585,7 @@ function Sidebar($$anchor, $$props) {
|
|
|
9519
9585
|
delegated("click", button, () => $$props.controller.toggleSidebar());
|
|
9520
9586
|
append($$anchor, div);
|
|
9521
9587
|
};
|
|
9522
|
-
var
|
|
9588
|
+
var alternate_3 = ($$anchor) => {
|
|
9523
9589
|
var div_2 = root_2$1();
|
|
9524
9590
|
var div_3 = child(div_2);
|
|
9525
9591
|
var div_4 = child(div_3);
|
|
@@ -9826,6 +9892,19 @@ function Sidebar($$anchor, $$props) {
|
|
|
9826
9892
|
});
|
|
9827
9893
|
var div_38 = sibling(node_14, 2);
|
|
9828
9894
|
var button_8 = sibling(child(div_38), 2);
|
|
9895
|
+
var node_17 = child(button_8);
|
|
9896
|
+
var consequent_22 = ($$anchor) => {
|
|
9897
|
+
append($$anchor, root_30());
|
|
9898
|
+
};
|
|
9899
|
+
var alternate_2 = ($$anchor) => {
|
|
9900
|
+
append($$anchor, root_31());
|
|
9901
|
+
};
|
|
9902
|
+
if_block(node_17, ($$render) => {
|
|
9903
|
+
if ($$props.colorScheme === "light") $$render(consequent_22);
|
|
9904
|
+
else $$render(alternate_2, -1);
|
|
9905
|
+
});
|
|
9906
|
+
reset(button_8);
|
|
9907
|
+
var button_9 = sibling(button_8, 2);
|
|
9829
9908
|
reset(div_38);
|
|
9830
9909
|
reset(div_2);
|
|
9831
9910
|
template_effect(() => {
|
|
@@ -9837,6 +9916,7 @@ function Sidebar($$anchor, $$props) {
|
|
|
9837
9916
|
set_text(text_12, `${get(selectedSpace)?.name ?? "Select a space..." ?? ""} `);
|
|
9838
9917
|
set_class(span_6, 1, `inline-block w-1.5 h-1.5 rounded-full mr-1 align-middle ${$$props.statusState === "ok" ? "bg-green-500" : $$props.statusState === "loading" ? "bg-amber-500" : "bg-slate-400"}`);
|
|
9839
9918
|
set_text(text_14, ` ${$$props.statusText ?? ""}`);
|
|
9919
|
+
set_attribute(button_8, "title", $$props.colorScheme === "light" ? "Switch to dark mode" : "Switch to light mode");
|
|
9840
9920
|
});
|
|
9841
9921
|
delegated("click", button_1, () => $$props.controller.toggleSidebar());
|
|
9842
9922
|
delegated("click", button_2, () => $$props.controller.switchEnv("local"));
|
|
@@ -9846,12 +9926,13 @@ function Sidebar($$anchor, $$props) {
|
|
|
9846
9926
|
e.stopPropagation();
|
|
9847
9927
|
dropdownOpen(!dropdownOpen());
|
|
9848
9928
|
});
|
|
9849
|
-
delegated("click", button_8, () => $$props.controller.
|
|
9929
|
+
delegated("click", button_8, () => $$props.controller.toggleColorScheme());
|
|
9930
|
+
delegated("click", button_9, () => $$props.controller.logout());
|
|
9850
9931
|
append($$anchor, div_2);
|
|
9851
9932
|
};
|
|
9852
9933
|
if_block(node, ($$render) => {
|
|
9853
9934
|
if ($$props.sidebarCollapsed) $$render(consequent);
|
|
9854
|
-
else $$render(
|
|
9935
|
+
else $$render(alternate_3, -1);
|
|
9855
9936
|
});
|
|
9856
9937
|
append($$anchor, fragment);
|
|
9857
9938
|
pop();
|
|
@@ -15244,11 +15325,7 @@ var root_1 = /* @__PURE__ */ from_html(`<div class="flex items-center justify-ce
|
|
|
15244
15325
|
var root$1 = /* @__PURE__ */ from_html(`<!> <div class="flex-1 min-w-0 flex flex-col"><!></div>`, 1);
|
|
15245
15326
|
function HostShell($$anchor, $$props) {
|
|
15246
15327
|
push($$props, true);
|
|
15247
|
-
const
|
|
15248
|
-
"$$slots",
|
|
15249
|
-
"$$events",
|
|
15250
|
-
"$$legacy"
|
|
15251
|
-
]);
|
|
15328
|
+
const { channelId, extensionUrl, manifest, manifestError } = getContext("hostConfig");
|
|
15252
15329
|
let spaces = /* @__PURE__ */ state(proxy([]));
|
|
15253
15330
|
let currentSpaceId = /* @__PURE__ */ state(null);
|
|
15254
15331
|
let statusText = /* @__PURE__ */ state("Initializing...");
|
|
@@ -15259,11 +15336,17 @@ function HostShell($$anchor, $$props) {
|
|
|
15259
15336
|
let publishedExtensions = /* @__PURE__ */ state(proxy([]));
|
|
15260
15337
|
let installedExtensionIds = /* @__PURE__ */ state(proxy([]));
|
|
15261
15338
|
let tabs = /* @__PURE__ */ state(proxy([]));
|
|
15339
|
+
let colorScheme = /* @__PURE__ */ state("light");
|
|
15262
15340
|
let publishState = /* @__PURE__ */ state("idle");
|
|
15263
15341
|
let publishMessage = /* @__PURE__ */ state(null);
|
|
15264
15342
|
let publishUrl = /* @__PURE__ */ state(null);
|
|
15265
15343
|
let dropdownOpen = /* @__PURE__ */ state(false);
|
|
15266
|
-
const controller = new DevHostController(
|
|
15344
|
+
const controller = new DevHostController({
|
|
15345
|
+
channelId,
|
|
15346
|
+
extensionUrl,
|
|
15347
|
+
manifest,
|
|
15348
|
+
manifestError
|
|
15349
|
+
}, syncState, tick);
|
|
15267
15350
|
function syncState() {
|
|
15268
15351
|
set(spaces, controller.spaces, true);
|
|
15269
15352
|
set(currentSpaceId, controller.currentSpaceId, true);
|
|
@@ -15271,6 +15354,7 @@ function HostShell($$anchor, $$props) {
|
|
|
15271
15354
|
set(statusState, controller.statusState, true);
|
|
15272
15355
|
set(placeholderText, controller.placeholderText, true);
|
|
15273
15356
|
set(sidebarCollapsed, controller.sidebarCollapsed, true);
|
|
15357
|
+
set(colorScheme, controller.colorScheme, true);
|
|
15274
15358
|
set(env, controller.env, true);
|
|
15275
15359
|
set(publishedExtensions, controller.publishedExtensions, true);
|
|
15276
15360
|
set(installedExtensionIds, controller.installedExtensionIds, true);
|
|
@@ -15279,7 +15363,7 @@ function HostShell($$anchor, $$props) {
|
|
|
15279
15363
|
set(publishMessage, controller.publishMessage, true);
|
|
15280
15364
|
set(publishUrl, controller.publishUrl, true);
|
|
15281
15365
|
}
|
|
15282
|
-
let uninstalledExtensions = /* @__PURE__ */ user_derived(() => get(publishedExtensions).filter((ext) => ext.extensionId !==
|
|
15366
|
+
let uninstalledExtensions = /* @__PURE__ */ user_derived(() => get(publishedExtensions).filter((ext) => ext.extensionId !== channelId && !get(installedExtensionIds).includes(ext.extensionId)));
|
|
15283
15367
|
syncState();
|
|
15284
15368
|
onMount(() => {
|
|
15285
15369
|
controller.boot();
|
|
@@ -15296,10 +15380,10 @@ function HostShell($$anchor, $$props) {
|
|
|
15296
15380
|
return controller;
|
|
15297
15381
|
},
|
|
15298
15382
|
get manifest() {
|
|
15299
|
-
return
|
|
15383
|
+
return manifest;
|
|
15300
15384
|
},
|
|
15301
15385
|
get manifestError() {
|
|
15302
|
-
return
|
|
15386
|
+
return manifestError;
|
|
15303
15387
|
},
|
|
15304
15388
|
get spaces() {
|
|
15305
15389
|
return get(spaces);
|
|
@@ -15319,6 +15403,9 @@ function HostShell($$anchor, $$props) {
|
|
|
15319
15403
|
get sidebarCollapsed() {
|
|
15320
15404
|
return get(sidebarCollapsed);
|
|
15321
15405
|
},
|
|
15406
|
+
get colorScheme() {
|
|
15407
|
+
return get(colorScheme);
|
|
15408
|
+
},
|
|
15322
15409
|
get publishState() {
|
|
15323
15410
|
return get(publishState);
|
|
15324
15411
|
},
|
|
@@ -15385,14 +15472,18 @@ var style = document.createElement("style");
|
|
|
15385
15472
|
style.textContent = app_default + "\n" + gridstack_default;
|
|
15386
15473
|
document.head.appendChild(style);
|
|
15387
15474
|
var root = document.getElementById("rool-host");
|
|
15475
|
+
var channelId = root.dataset.channelId ?? "extension-dev";
|
|
15476
|
+
var extensionUrl = root.dataset.extensionUrl ?? "/";
|
|
15477
|
+
var manifest = root.dataset.manifest ? JSON.parse(root.dataset.manifest) : null;
|
|
15478
|
+
var manifestError = root.dataset.manifestError ?? null;
|
|
15388
15479
|
mount(HostShell, {
|
|
15389
15480
|
target: root,
|
|
15390
|
-
|
|
15391
|
-
channelId
|
|
15392
|
-
extensionUrl
|
|
15393
|
-
manifest
|
|
15394
|
-
manifestError
|
|
15395
|
-
}
|
|
15481
|
+
context: new Map([["hostConfig", {
|
|
15482
|
+
channelId,
|
|
15483
|
+
extensionUrl,
|
|
15484
|
+
manifest,
|
|
15485
|
+
manifestError
|
|
15486
|
+
}]])
|
|
15396
15487
|
});
|
|
15397
15488
|
//#endregion
|
|
15398
15489
|
|