@inkandswitch/patchwork-pkg-base 0.0.73 → 0.0.75
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/module-settings-url +1 -1
- package/package.json +1 -1
- package/packages/chat/dist/{ChatRoot-BRiX2ym6.js → ChatRoot-BYmq4SXi.js} +3541 -6287
- package/packages/chat/dist/{context-tool-CAHkp64h.js → context-tool-Bob-FZ_T.js} +2 -2
- package/packages/chat/dist/{index-Bt9HfG9I.js → index-wkaHcVCz.js} +3 -3
- package/packages/chat/dist/index.js +1 -1
- package/packages/chat/dist/{tool-DoxHbcfW.js → tool-DCOdh_fx.js} +1 -1
- package/packages/chat/package.json +3 -3
- package/packages/isolation/dist/assets/{component-DA0d3480.js → component-Daum8ibW.js} +118 -240
- package/packages/isolation/dist/assets/component-Daum8ibW.js.map +1 -0
- package/packages/isolation/dist/index.js +1 -1
- package/packages/llm-host/dist/LlmConfigTray-Ck7LaNf9.js +595 -0
- package/packages/llm-host/dist/index.js +1 -1
- package/packages/threepane/dist/IsolatedDocumentArea-TH3ENI3M.js +2 -0
- package/packages/threepane/dist/PatchworkFrame-WMZ3SLEE.js +2 -0
- package/packages/threepane/dist/PatchworkFrame-WMZ3SLEE.js.map +7 -0
- package/packages/threepane/dist/chunk-ESMUVHPH.js +2 -0
- package/packages/threepane/dist/chunk-ESMUVHPH.js.map +7 -0
- package/packages/threepane/dist/{chunk-FX3MJIE5.js → chunk-FRVSEOM5.js} +3 -3
- package/packages/threepane/dist/chunk-FRVSEOM5.js.map +7 -0
- package/packages/threepane/dist/{datatypes-WPL4KARJ.js → datatypes-5DFL6VIN.js} +2 -2
- package/packages/threepane/dist/index.js +1 -1
- package/plugin-registry-url +1 -1
- package/packages/chat/dist/assets/worker-CFUOJ0Hd.js +0 -9
- package/packages/isolation/dist/assets/component-DA0d3480.js.map +0 -1
- package/packages/llm-host/dist/LlmConfigTray-BPL_cmra.js +0 -591
- package/packages/threepane/dist/IsolatedDocumentArea-MSJE4GCW.js +0 -2
- package/packages/threepane/dist/PatchworkFrame-3XYJCU3F.js +0 -2
- package/packages/threepane/dist/PatchworkFrame-3XYJCU3F.js.map +0 -7
- package/packages/threepane/dist/chunk-2NJMYYSD.js +0 -2
- package/packages/threepane/dist/chunk-2NJMYYSD.js.map +0 -7
- package/packages/threepane/dist/chunk-FX3MJIE5.js.map +0 -7
- /package/packages/threepane/dist/{IsolatedDocumentArea-MSJE4GCW.js.map → IsolatedDocumentArea-TH3ENI3M.js.map} +0 -0
- /package/packages/threepane/dist/{datatypes-WPL4KARJ.js.map → datatypes-5DFL6VIN.js.map} +0 -0
|
@@ -65,7 +65,7 @@ const plugins = [
|
|
|
65
65
|
// with "Failed to resolve module specifier @automerge/automerge-repo/slim".
|
|
66
66
|
// Deferring it keeps discovery to metadata only — the runtime imports
|
|
67
67
|
// happen later, when load() runs in a context that has the import map.
|
|
68
|
-
load: async () => (await __vitePreload(async () => { const {mountIsolation} = await import('./assets/component-
|
|
68
|
+
load: async () => (await __vitePreload(async () => { const {mountIsolation} = await import('./assets/component-Daum8ibW.js');return { mountIsolation }},true ?[]:void 0,import.meta.url)).mountIsolation
|
|
69
69
|
}
|
|
70
70
|
];
|
|
71
71
|
|
|
@@ -0,0 +1,595 @@
|
|
|
1
|
+
import { ensureConfig as xe, dom as Se, writeScopeOverride as Ee, readScopedConfig as Ce, readConfig as ie, writeConfig as Ae } from "./patchwork-llm-h1ZevlV6.js";
|
|
2
|
+
const ke = !1, Te = (e, t) => e === t, M = {
|
|
3
|
+
equals: Te
|
|
4
|
+
};
|
|
5
|
+
let ue = ge;
|
|
6
|
+
const x = 1, _ = 2, ae = {
|
|
7
|
+
owned: null,
|
|
8
|
+
cleanups: null,
|
|
9
|
+
context: null,
|
|
10
|
+
owner: null
|
|
11
|
+
};
|
|
12
|
+
var d = null;
|
|
13
|
+
let R = null, Pe = null, a = null, m = null, b = null, j = 0;
|
|
14
|
+
function de(e, t) {
|
|
15
|
+
const n = a, o = d, i = e.length === 0, r = t === void 0 ? o : t, l = i ? ae : {
|
|
16
|
+
owned: null,
|
|
17
|
+
cleanups: null,
|
|
18
|
+
context: r ? r.context : null,
|
|
19
|
+
owner: r
|
|
20
|
+
}, s = i ? e : () => e(() => E(() => $(l)));
|
|
21
|
+
d = l, a = null;
|
|
22
|
+
try {
|
|
23
|
+
return A(s, !0);
|
|
24
|
+
} finally {
|
|
25
|
+
a = n, d = o;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function P(e, t) {
|
|
29
|
+
t = t ? Object.assign({}, M, t) : M;
|
|
30
|
+
const n = {
|
|
31
|
+
value: e,
|
|
32
|
+
observers: null,
|
|
33
|
+
observerSlots: null,
|
|
34
|
+
comparator: t.equals || void 0
|
|
35
|
+
}, o = (i) => (typeof i == "function" && (i = i(n.value)), pe(n, i));
|
|
36
|
+
return [he.bind(n), o];
|
|
37
|
+
}
|
|
38
|
+
function H(e, t, n) {
|
|
39
|
+
const o = q(e, t, !1, x);
|
|
40
|
+
N(o);
|
|
41
|
+
}
|
|
42
|
+
function $e(e, t, n) {
|
|
43
|
+
ue = _e;
|
|
44
|
+
const o = q(e, t, !1, x);
|
|
45
|
+
n || (o.user = !0), b ? b.push(o) : N(o);
|
|
46
|
+
}
|
|
47
|
+
function O(e, t, n) {
|
|
48
|
+
n = n ? Object.assign({}, M, n) : M;
|
|
49
|
+
const o = q(e, t, !0, 0);
|
|
50
|
+
return o.observers = null, o.observerSlots = null, o.comparator = n.equals || void 0, N(o), he.bind(o);
|
|
51
|
+
}
|
|
52
|
+
function E(e) {
|
|
53
|
+
if (a === null) return e();
|
|
54
|
+
const t = a;
|
|
55
|
+
a = null;
|
|
56
|
+
try {
|
|
57
|
+
return e();
|
|
58
|
+
} finally {
|
|
59
|
+
a = t;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function re(e) {
|
|
63
|
+
return d === null || (d.cleanups === null ? d.cleanups = [e] : d.cleanups.push(e)), e;
|
|
64
|
+
}
|
|
65
|
+
function Ne() {
|
|
66
|
+
return d;
|
|
67
|
+
}
|
|
68
|
+
function Le(e, t) {
|
|
69
|
+
const n = d, o = a;
|
|
70
|
+
d = e, a = null;
|
|
71
|
+
try {
|
|
72
|
+
return A(t, !0);
|
|
73
|
+
} catch (i) {
|
|
74
|
+
W(i);
|
|
75
|
+
} finally {
|
|
76
|
+
d = n, a = o;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function he() {
|
|
80
|
+
if (this.sources && this.state)
|
|
81
|
+
if (this.state === x) N(this);
|
|
82
|
+
else {
|
|
83
|
+
const e = m;
|
|
84
|
+
m = null, A(() => D(this), !1), m = e;
|
|
85
|
+
}
|
|
86
|
+
if (a) {
|
|
87
|
+
const e = this.observers;
|
|
88
|
+
if (!e || e[e.length - 1] !== a) {
|
|
89
|
+
const t = e ? e.length : 0;
|
|
90
|
+
a.sources ? (a.sources.push(this), a.sourceSlots.push(t)) : (a.sources = [this], a.sourceSlots = [t]), e ? (e.push(a), this.observerSlots.push(a.sources.length - 1)) : (this.observers = [a], this.observerSlots = [a.sources.length - 1]);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return this.value;
|
|
94
|
+
}
|
|
95
|
+
function pe(e, t, n) {
|
|
96
|
+
let o = e.value;
|
|
97
|
+
return (!e.comparator || !e.comparator(o, t)) && (e.value = t, e.observers && e.observers.length && A(() => {
|
|
98
|
+
for (let i = 0; i < e.observers.length; i += 1) {
|
|
99
|
+
const r = e.observers[i], l = R && R.running;
|
|
100
|
+
l && R.disposed.has(r), (l ? !r.tState : !r.state) && (r.pure ? m.push(r) : b.push(r), r.observers && me(r)), l || (r.state = x);
|
|
101
|
+
}
|
|
102
|
+
if (m.length > 1e6)
|
|
103
|
+
throw m = [], new Error();
|
|
104
|
+
}, !1)), t;
|
|
105
|
+
}
|
|
106
|
+
function N(e) {
|
|
107
|
+
if (!e.fn) return;
|
|
108
|
+
$(e);
|
|
109
|
+
const t = j;
|
|
110
|
+
Oe(e, e.value, t);
|
|
111
|
+
}
|
|
112
|
+
function Oe(e, t, n) {
|
|
113
|
+
let o;
|
|
114
|
+
const i = d, r = a;
|
|
115
|
+
a = d = e;
|
|
116
|
+
try {
|
|
117
|
+
o = e.fn(t);
|
|
118
|
+
} catch (l) {
|
|
119
|
+
return e.pure && (e.state = x, e.owned && e.owned.forEach($), e.owned = null), e.updatedAt = n + 1, W(l);
|
|
120
|
+
} finally {
|
|
121
|
+
a = r, d = i;
|
|
122
|
+
}
|
|
123
|
+
(!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? pe(e, o) : e.value = o, e.updatedAt = n);
|
|
124
|
+
}
|
|
125
|
+
function q(e, t, n, o = x, i) {
|
|
126
|
+
const r = {
|
|
127
|
+
fn: e,
|
|
128
|
+
state: o,
|
|
129
|
+
updatedAt: null,
|
|
130
|
+
owned: null,
|
|
131
|
+
sources: null,
|
|
132
|
+
sourceSlots: null,
|
|
133
|
+
cleanups: null,
|
|
134
|
+
value: t,
|
|
135
|
+
owner: d,
|
|
136
|
+
context: d ? d.context : null,
|
|
137
|
+
pure: n
|
|
138
|
+
};
|
|
139
|
+
return d === null || d !== ae && (d.owned ? d.owned.push(r) : d.owned = [r]), r;
|
|
140
|
+
}
|
|
141
|
+
function B(e) {
|
|
142
|
+
if (e.state === 0) return;
|
|
143
|
+
if (e.state === _) return D(e);
|
|
144
|
+
if (e.suspense && E(e.suspense.inFallback)) return e.suspense.effects.push(e);
|
|
145
|
+
const t = [e];
|
|
146
|
+
for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < j); )
|
|
147
|
+
e.state && t.push(e);
|
|
148
|
+
for (let n = t.length - 1; n >= 0; n--)
|
|
149
|
+
if (e = t[n], e.state === x)
|
|
150
|
+
N(e);
|
|
151
|
+
else if (e.state === _) {
|
|
152
|
+
const o = m;
|
|
153
|
+
m = null, A(() => D(e, t[0]), !1), m = o;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function A(e, t) {
|
|
157
|
+
if (m) return e();
|
|
158
|
+
let n = !1;
|
|
159
|
+
t || (m = []), b ? n = !0 : b = [], j++;
|
|
160
|
+
try {
|
|
161
|
+
const o = e();
|
|
162
|
+
return Me(n), o;
|
|
163
|
+
} catch (o) {
|
|
164
|
+
n || (b = null), m = null, W(o);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function Me(e) {
|
|
168
|
+
if (m && (ge(m), m = null), e) return;
|
|
169
|
+
const t = b;
|
|
170
|
+
b = null, t.length && A(() => ue(t), !1);
|
|
171
|
+
}
|
|
172
|
+
function ge(e) {
|
|
173
|
+
for (let t = 0; t < e.length; t++) B(e[t]);
|
|
174
|
+
}
|
|
175
|
+
function _e(e) {
|
|
176
|
+
let t, n = 0;
|
|
177
|
+
for (t = 0; t < e.length; t++) {
|
|
178
|
+
const o = e[t];
|
|
179
|
+
o.user ? e[n++] = o : B(o);
|
|
180
|
+
}
|
|
181
|
+
for (t = 0; t < n; t++) B(e[t]);
|
|
182
|
+
}
|
|
183
|
+
function D(e, t) {
|
|
184
|
+
e.state = 0;
|
|
185
|
+
for (let n = 0; n < e.sources.length; n += 1) {
|
|
186
|
+
const o = e.sources[n];
|
|
187
|
+
if (o.sources) {
|
|
188
|
+
const i = o.state;
|
|
189
|
+
i === x ? o !== t && (!o.updatedAt || o.updatedAt < j) && B(o) : i === _ && D(o, t);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
function me(e) {
|
|
194
|
+
for (let t = 0; t < e.observers.length; t += 1) {
|
|
195
|
+
const n = e.observers[t];
|
|
196
|
+
n.state || (n.state = _, n.pure ? m.push(n) : b.push(n), n.observers && me(n));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
function $(e) {
|
|
200
|
+
let t;
|
|
201
|
+
if (e.sources)
|
|
202
|
+
for (; e.sources.length; ) {
|
|
203
|
+
const n = e.sources.pop(), o = e.sourceSlots.pop(), i = n.observers;
|
|
204
|
+
if (i && i.length) {
|
|
205
|
+
const r = i.pop(), l = n.observerSlots.pop();
|
|
206
|
+
o < i.length && (r.sourceSlots[l] = o, i[o] = r, n.observerSlots[o] = l);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (e.tOwned) {
|
|
210
|
+
for (t = e.tOwned.length - 1; t >= 0; t--) $(e.tOwned[t]);
|
|
211
|
+
delete e.tOwned;
|
|
212
|
+
}
|
|
213
|
+
if (e.owned) {
|
|
214
|
+
for (t = e.owned.length - 1; t >= 0; t--) $(e.owned[t]);
|
|
215
|
+
e.owned = null;
|
|
216
|
+
}
|
|
217
|
+
if (e.cleanups) {
|
|
218
|
+
for (t = e.cleanups.length - 1; t >= 0; t--) e.cleanups[t]();
|
|
219
|
+
e.cleanups = null;
|
|
220
|
+
}
|
|
221
|
+
e.state = 0;
|
|
222
|
+
}
|
|
223
|
+
function He(e) {
|
|
224
|
+
return e instanceof Error ? e : new Error(typeof e == "string" ? e : "Unknown error", {
|
|
225
|
+
cause: e
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
function W(e, t = d) {
|
|
229
|
+
throw He(e);
|
|
230
|
+
}
|
|
231
|
+
function le(e, t) {
|
|
232
|
+
return E(() => e(t || {}));
|
|
233
|
+
}
|
|
234
|
+
const Be = (e) => `Stale read from <${e}>.`;
|
|
235
|
+
function De(e) {
|
|
236
|
+
const t = e.keyed, n = O(() => e.when, void 0, void 0), o = t ? n : O(n, void 0, {
|
|
237
|
+
equals: (i, r) => !i == !r
|
|
238
|
+
});
|
|
239
|
+
return O(() => {
|
|
240
|
+
const i = o();
|
|
241
|
+
if (i) {
|
|
242
|
+
const r = e.children;
|
|
243
|
+
return typeof r == "function" && r.length > 0 ? E(() => r(t ? i : () => {
|
|
244
|
+
if (!E(o)) throw Be("Show");
|
|
245
|
+
return n();
|
|
246
|
+
})) : r;
|
|
247
|
+
}
|
|
248
|
+
return e.fallback;
|
|
249
|
+
}, void 0, void 0);
|
|
250
|
+
}
|
|
251
|
+
function Ue(e, t, n) {
|
|
252
|
+
let o = n.length, i = t.length, r = o, l = 0, s = 0, f = t[i - 1].nextSibling, h = null;
|
|
253
|
+
for (; l < i || s < r; ) {
|
|
254
|
+
if (t[l] === n[s]) {
|
|
255
|
+
l++, s++;
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
for (; t[i - 1] === n[r - 1]; )
|
|
259
|
+
i--, r--;
|
|
260
|
+
if (i === l) {
|
|
261
|
+
const p = r < o ? s ? n[s - 1].nextSibling : n[r - s] : f;
|
|
262
|
+
for (; s < r; ) e.insertBefore(n[s++], p);
|
|
263
|
+
} else if (r === s)
|
|
264
|
+
for (; l < i; )
|
|
265
|
+
(!h || !h.has(t[l])) && t[l].remove(), l++;
|
|
266
|
+
else if (t[l] === n[r - 1] && n[s] === t[i - 1]) {
|
|
267
|
+
const p = t[--i].nextSibling;
|
|
268
|
+
e.insertBefore(n[s++], t[l++].nextSibling), e.insertBefore(n[--r], p), t[i] = n[r];
|
|
269
|
+
} else {
|
|
270
|
+
if (!h) {
|
|
271
|
+
h = /* @__PURE__ */ new Map();
|
|
272
|
+
let v = s;
|
|
273
|
+
for (; v < r; ) h.set(n[v], v++);
|
|
274
|
+
}
|
|
275
|
+
const p = h.get(t[l]);
|
|
276
|
+
if (p != null)
|
|
277
|
+
if (s < p && p < r) {
|
|
278
|
+
let v = l, y = 1, S;
|
|
279
|
+
for (; ++v < i && v < r && !((S = h.get(t[v])) == null || S !== p + y); )
|
|
280
|
+
y++;
|
|
281
|
+
if (y > p - s) {
|
|
282
|
+
const G = t[l];
|
|
283
|
+
for (; s < p; ) e.insertBefore(n[s++], G);
|
|
284
|
+
} else e.replaceChild(n[s++], t[l++]);
|
|
285
|
+
} else l++;
|
|
286
|
+
else t[l++].remove();
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
const fe = "_$DX_DELEGATE";
|
|
291
|
+
function Ve(e, t, n, o = {}) {
|
|
292
|
+
let i;
|
|
293
|
+
return de((r) => {
|
|
294
|
+
i = r, t === document ? e() : U(t, e(), t.firstChild ? null : void 0, n);
|
|
295
|
+
}, o.owner), () => {
|
|
296
|
+
i(), t.textContent = "";
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
function we(e, t, n, o) {
|
|
300
|
+
let i;
|
|
301
|
+
const r = () => {
|
|
302
|
+
const s = o ? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template") : document.createElement("template");
|
|
303
|
+
return s.innerHTML = e, n ? s.content.firstChild.firstChild : o ? s.firstChild : s.content.firstChild;
|
|
304
|
+
}, l = t ? () => E(() => document.importNode(i || (i = r()), !0)) : () => (i || (i = r())).cloneNode(!0);
|
|
305
|
+
return l.cloneNode = l, l;
|
|
306
|
+
}
|
|
307
|
+
function je(e, t = window.document) {
|
|
308
|
+
const n = t[fe] || (t[fe] = /* @__PURE__ */ new Set());
|
|
309
|
+
for (let o = 0, i = e.length; o < i; o++) {
|
|
310
|
+
const r = e[o];
|
|
311
|
+
n.has(r) || (n.add(r), t.addEventListener(r, Ge));
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function T(e, t, n) {
|
|
315
|
+
n != null ? e.style.setProperty(t, n) : e.style.removeProperty(t);
|
|
316
|
+
}
|
|
317
|
+
function F(e, t, n) {
|
|
318
|
+
return E(() => e(t, n));
|
|
319
|
+
}
|
|
320
|
+
function U(e, t, n, o) {
|
|
321
|
+
if (n !== void 0 && !o && (o = []), typeof t != "function") return V(e, t, o, n);
|
|
322
|
+
H((i) => V(e, t(), i, n), o);
|
|
323
|
+
}
|
|
324
|
+
function Ge(e) {
|
|
325
|
+
let t = e.target;
|
|
326
|
+
const n = `$$${e.type}`, o = e.target, i = e.currentTarget, r = (f) => Object.defineProperty(e, "target", {
|
|
327
|
+
configurable: !0,
|
|
328
|
+
value: f
|
|
329
|
+
}), l = () => {
|
|
330
|
+
const f = t[n];
|
|
331
|
+
if (f && !t.disabled) {
|
|
332
|
+
const h = t[`${n}Data`];
|
|
333
|
+
if (h !== void 0 ? f.call(t, h, e) : f.call(t, e), e.cancelBubble) return;
|
|
334
|
+
}
|
|
335
|
+
return t.host && typeof t.host != "string" && !t.host._$host && t.contains(e.target) && r(t.host), !0;
|
|
336
|
+
}, s = () => {
|
|
337
|
+
for (; l() && (t = t._$host || t.parentNode || t.host); ) ;
|
|
338
|
+
};
|
|
339
|
+
if (Object.defineProperty(e, "currentTarget", {
|
|
340
|
+
configurable: !0,
|
|
341
|
+
get() {
|
|
342
|
+
return t || document;
|
|
343
|
+
}
|
|
344
|
+
}), e.composedPath) {
|
|
345
|
+
const f = e.composedPath();
|
|
346
|
+
r(f[0]);
|
|
347
|
+
for (let h = 0; h < f.length - 2 && (t = f[h], !!l()); h++) {
|
|
348
|
+
if (t._$host) {
|
|
349
|
+
t = t._$host, s();
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
if (t.parentNode === i)
|
|
353
|
+
break;
|
|
354
|
+
}
|
|
355
|
+
} else s();
|
|
356
|
+
r(o);
|
|
357
|
+
}
|
|
358
|
+
function V(e, t, n, o, i) {
|
|
359
|
+
for (; typeof n == "function"; ) n = n();
|
|
360
|
+
if (t === n) return n;
|
|
361
|
+
const r = typeof t, l = o !== void 0;
|
|
362
|
+
if (e = l && n[0] && n[0].parentNode || e, r === "string" || r === "number") {
|
|
363
|
+
if (r === "number" && (t = t.toString(), t === n))
|
|
364
|
+
return n;
|
|
365
|
+
if (l) {
|
|
366
|
+
let s = n[0];
|
|
367
|
+
s && s.nodeType === 3 ? s.data !== t && (s.data = t) : s = document.createTextNode(t), n = C(e, n, o, s);
|
|
368
|
+
} else
|
|
369
|
+
n !== "" && typeof n == "string" ? n = e.firstChild.data = t : n = e.textContent = t;
|
|
370
|
+
} else if (t == null || r === "boolean")
|
|
371
|
+
n = C(e, n, o);
|
|
372
|
+
else {
|
|
373
|
+
if (r === "function")
|
|
374
|
+
return H(() => {
|
|
375
|
+
let s = t();
|
|
376
|
+
for (; typeof s == "function"; ) s = s();
|
|
377
|
+
n = V(e, s, n, o);
|
|
378
|
+
}), () => n;
|
|
379
|
+
if (Array.isArray(t)) {
|
|
380
|
+
const s = [], f = n && Array.isArray(n);
|
|
381
|
+
if (I(s, t, n, i))
|
|
382
|
+
return H(() => n = V(e, s, n, o, !0)), () => n;
|
|
383
|
+
if (s.length === 0) {
|
|
384
|
+
if (n = C(e, n, o), l) return n;
|
|
385
|
+
} else f ? n.length === 0 ? ce(e, s, o) : Ue(e, n, s) : (n && C(e), ce(e, s));
|
|
386
|
+
n = s;
|
|
387
|
+
} else if (t.nodeType) {
|
|
388
|
+
if (Array.isArray(n)) {
|
|
389
|
+
if (l) return n = C(e, n, o, t);
|
|
390
|
+
C(e, n, null, t);
|
|
391
|
+
} else n == null || n === "" || !e.firstChild ? e.appendChild(t) : e.replaceChild(t, e.firstChild);
|
|
392
|
+
n = t;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
return n;
|
|
396
|
+
}
|
|
397
|
+
function I(e, t, n, o) {
|
|
398
|
+
let i = !1;
|
|
399
|
+
for (let r = 0, l = t.length; r < l; r++) {
|
|
400
|
+
let s = t[r], f = n && n[e.length], h;
|
|
401
|
+
if (!(s == null || s === !0 || s === !1)) if ((h = typeof s) == "object" && s.nodeType)
|
|
402
|
+
e.push(s);
|
|
403
|
+
else if (Array.isArray(s))
|
|
404
|
+
i = I(e, s, f) || i;
|
|
405
|
+
else if (h === "function")
|
|
406
|
+
if (o) {
|
|
407
|
+
for (; typeof s == "function"; ) s = s();
|
|
408
|
+
i = I(e, Array.isArray(s) ? s : [s], Array.isArray(f) ? f : [f]) || i;
|
|
409
|
+
} else
|
|
410
|
+
e.push(s), i = !0;
|
|
411
|
+
else {
|
|
412
|
+
const p = String(s);
|
|
413
|
+
f && f.nodeType === 3 && f.data === p ? e.push(f) : e.push(document.createTextNode(p));
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
return i;
|
|
417
|
+
}
|
|
418
|
+
function ce(e, t, n = null) {
|
|
419
|
+
for (let o = 0, i = t.length; o < i; o++) e.insertBefore(t[o], n);
|
|
420
|
+
}
|
|
421
|
+
function C(e, t, n, o) {
|
|
422
|
+
if (n === void 0) return e.textContent = "";
|
|
423
|
+
const i = o || document.createTextNode("");
|
|
424
|
+
if (t.length) {
|
|
425
|
+
let r = !1;
|
|
426
|
+
for (let l = t.length - 1; l >= 0; l--) {
|
|
427
|
+
const s = t[l];
|
|
428
|
+
if (i !== s) {
|
|
429
|
+
const f = s.parentNode === e;
|
|
430
|
+
!r && !l ? f ? e.replaceChild(i, s) : e.insertBefore(i, n) : f && s.remove();
|
|
431
|
+
} else r = !0;
|
|
432
|
+
}
|
|
433
|
+
} else e.insertBefore(i, n);
|
|
434
|
+
return [i];
|
|
435
|
+
}
|
|
436
|
+
const Re = "http://www.w3.org/2000/svg";
|
|
437
|
+
function Fe(e, t = !1, n = void 0) {
|
|
438
|
+
return t ? document.createElementNS(Re, e) : document.createElement(e, {
|
|
439
|
+
is: n
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
function Ie(e) {
|
|
443
|
+
const {
|
|
444
|
+
useShadow: t
|
|
445
|
+
} = e, n = document.createTextNode(""), o = () => e.mount || document.body, i = Ne();
|
|
446
|
+
let r;
|
|
447
|
+
return $e(() => {
|
|
448
|
+
r || (r = Le(i, () => O(() => e.children)));
|
|
449
|
+
const l = o();
|
|
450
|
+
if (l instanceof HTMLHeadElement) {
|
|
451
|
+
const [s, f] = P(!1), h = () => f(!0);
|
|
452
|
+
de((p) => U(l, () => s() ? p() : r(), null)), re(h);
|
|
453
|
+
} else {
|
|
454
|
+
const s = Fe(e.isSVG ? "g" : "div", e.isSVG), f = t && s.attachShadow ? s.attachShadow({
|
|
455
|
+
mode: "open"
|
|
456
|
+
}) : s;
|
|
457
|
+
Object.defineProperty(s, "_$host", {
|
|
458
|
+
get() {
|
|
459
|
+
return n.parentNode;
|
|
460
|
+
},
|
|
461
|
+
configurable: !0
|
|
462
|
+
}), U(f, r), l.appendChild(s), e.ref && e.ref(s), re(() => l.contains(s) && l.removeChild(s));
|
|
463
|
+
}
|
|
464
|
+
}, void 0, {}), n;
|
|
465
|
+
}
|
|
466
|
+
var qe = /* @__PURE__ */ we("<div class=llm-config-tray-popover><div>"), We = /* @__PURE__ */ we('<div class=llm-config-tray><button class=llm-config-tray-button title="LLM model & config"><span>🤖</span><span>model');
|
|
467
|
+
function Qe(e) {
|
|
468
|
+
const t = document.createElement("style");
|
|
469
|
+
t.textContent = `
|
|
470
|
+
.llm-config-tray { position: relative; display: inline-flex; align-items: center; }
|
|
471
|
+
.llm-config-tray-button {
|
|
472
|
+
display: inline-flex; align-items: center; gap: var(--studio-space-2xs, 0.25rem);
|
|
473
|
+
height: 1.75rem; padding: 0 var(--studio-space-xs, 0.375rem);
|
|
474
|
+
border: 1px solid var(--studio-chrome-offset-20, var(--studio-fill-offset-20, #d4d4d4));
|
|
475
|
+
border-radius: var(--studio-radius-sm, 4px);
|
|
476
|
+
background: var(--studio-chrome, var(--studio-fill, white));
|
|
477
|
+
color: var(--studio-chrome-line, var(--studio-line, black));
|
|
478
|
+
font: 500 0.75rem/1 var(--studio-family-sans, system-ui, sans-serif); cursor: pointer;
|
|
479
|
+
}
|
|
480
|
+
.llm-config-tray-button:hover {
|
|
481
|
+
background: var(--studio-chrome-offset-10, var(--studio-fill-offset-10, #f2f2f2));
|
|
482
|
+
}
|
|
483
|
+
.llm-config-tray-popover {
|
|
484
|
+
position: fixed; z-index: 2147483000; box-sizing: border-box;
|
|
485
|
+
max-width: min(92vw, 520px); max-height: 80vh; overflow: auto;
|
|
486
|
+
background: var(--studio-fill, white); color: var(--studio-line, black);
|
|
487
|
+
border: 1px solid var(--studio-fill-offset-20, #d4d4d4);
|
|
488
|
+
border-radius: var(--studio-radius-md, 8px);
|
|
489
|
+
box-shadow: var(--studio-shadow-lg, 0 8px 32px rgba(0,0,0,0.24));
|
|
490
|
+
padding: var(--studio-space-sm, 0.5rem);
|
|
491
|
+
}
|
|
492
|
+
`, e.append(t);
|
|
493
|
+
const [n, o] = P(!1), [i, r] = P(), [l, s] = P({}), [f, h] = P(null);
|
|
494
|
+
let p, v, y, S = null;
|
|
495
|
+
function G(c) {
|
|
496
|
+
return c ? {
|
|
497
|
+
read: () => {
|
|
498
|
+
try {
|
|
499
|
+
return Ce(c);
|
|
500
|
+
} catch {
|
|
501
|
+
return ie();
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
write: (u) => Ee(c, u)
|
|
505
|
+
} : {
|
|
506
|
+
read: () => ie(),
|
|
507
|
+
write: (u) => Ae(u)
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
async function ve() {
|
|
511
|
+
const c = i(), u = l() || {};
|
|
512
|
+
await xe(c, e), y && (y.replaceChildren(), S = Se({
|
|
513
|
+
source: G(c),
|
|
514
|
+
scope: c,
|
|
515
|
+
toolName: c?.toolName || u.toolName,
|
|
516
|
+
toolPrompt: u.toolPrompt,
|
|
517
|
+
toolTools: u.toolTools
|
|
518
|
+
}), y.append(S));
|
|
519
|
+
}
|
|
520
|
+
function ye() {
|
|
521
|
+
const c = p.getBoundingClientRect(), u = Math.max(0, c.top - 16), k = Math.max(0, window.innerHeight - c.bottom - 16), g = u >= Math.min(window.innerHeight * 0.8, k);
|
|
522
|
+
h({
|
|
523
|
+
left: Math.max(8, c.right - Math.min(520, window.innerWidth * 0.92)),
|
|
524
|
+
top: g ? c.top - 8 : c.bottom + 8,
|
|
525
|
+
maxHeight: Math.min(window.innerHeight * 0.8, g ? u : k),
|
|
526
|
+
above: g
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
function K(c, u) {
|
|
530
|
+
r(c?.toolId ? c : void 0), s(u || {}), ye(), o(!0), queueMicrotask(ve);
|
|
531
|
+
}
|
|
532
|
+
function L() {
|
|
533
|
+
try {
|
|
534
|
+
S?.destroy?.();
|
|
535
|
+
} catch {
|
|
536
|
+
}
|
|
537
|
+
S = null, o(!1);
|
|
538
|
+
}
|
|
539
|
+
const Q = (c) => {
|
|
540
|
+
const u = c.detail;
|
|
541
|
+
!u || u.component !== "llm-config-tray" || K(u.scope, u);
|
|
542
|
+
};
|
|
543
|
+
document.addEventListener("patchwork:open-tool", Q);
|
|
544
|
+
const X = (c) => {
|
|
545
|
+
if (!n()) return;
|
|
546
|
+
const u = c.composedPath();
|
|
547
|
+
v && u.includes(v) || p && u.includes(p) || L();
|
|
548
|
+
}, Y = (c) => {
|
|
549
|
+
c.key === "Escape" && n() && L();
|
|
550
|
+
};
|
|
551
|
+
document.addEventListener("click", X), document.addEventListener("keydown", Y);
|
|
552
|
+
const be = Ve(() => (() => {
|
|
553
|
+
var c = We(), u = c.firstChild;
|
|
554
|
+
u.$$click = (g) => {
|
|
555
|
+
g.stopPropagation(), n() ? L() : K(void 0, {});
|
|
556
|
+
};
|
|
557
|
+
var k = p;
|
|
558
|
+
return typeof k == "function" ? F(k, u) : p = u, U(c, le(De, {
|
|
559
|
+
get when() {
|
|
560
|
+
return n();
|
|
561
|
+
},
|
|
562
|
+
get children() {
|
|
563
|
+
return le(Ie, {
|
|
564
|
+
get mount() {
|
|
565
|
+
return document.body;
|
|
566
|
+
},
|
|
567
|
+
get children() {
|
|
568
|
+
var g = qe(), J = g.firstChild;
|
|
569
|
+
g.$$click = (w) => w.stopPropagation();
|
|
570
|
+
var Z = v;
|
|
571
|
+
typeof Z == "function" ? F(Z, g) : v = g;
|
|
572
|
+
var z = y;
|
|
573
|
+
return typeof z == "function" ? F(z, J) : y = J, H((w) => {
|
|
574
|
+
var ee = `${f()?.left ?? 0}px`, te = `${f()?.top ?? 0}px`, ne = `${f()?.maxHeight ?? 0}px`, oe = f()?.above ? "translateY(-100%)" : "none", se = f() ? "visible" : "hidden";
|
|
575
|
+
return ee !== w.e && T(g, "left", w.e = ee), te !== w.t && T(g, "top", w.t = te), ne !== w.a && T(g, "max-height", w.a = ne), oe !== w.o && T(g, "transform", w.o = oe), se !== w.i && T(g, "visibility", w.i = se), w;
|
|
576
|
+
}, {
|
|
577
|
+
e: void 0,
|
|
578
|
+
t: void 0,
|
|
579
|
+
a: void 0,
|
|
580
|
+
o: void 0,
|
|
581
|
+
i: void 0
|
|
582
|
+
}), g;
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
}), null), c;
|
|
587
|
+
})(), e);
|
|
588
|
+
return () => {
|
|
589
|
+
L(), be(), t.remove(), document.removeEventListener("patchwork:open-tool", Q), document.removeEventListener("click", X), document.removeEventListener("keydown", Y);
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
je(["click"]);
|
|
593
|
+
export {
|
|
594
|
+
Qe as LlmConfigTray
|
|
595
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as Fe,b as B,c as j,d as ie,e as ae,f as le,g as se,h as de,i as ce,j as ue,k as me,l as fe,m as he,n as x,o as F,p as P,q as pe,r as ge,s as we,t as ve}from"./chunk-FRVSEOM5.js";import{a as M,b as _e}from"./chunk-ESMUVHPH.js";import{b as xe}from"./chunk-FW4363Y4.js";import{template as y}from"solid-js/web";import{delegateEvents as rt}from"solid-js/web";import{memo as nt}from"solid-js/web";import{setStyleProperty as it}from"solid-js/web";import{setAttribute as G}from"solid-js/web";import{effect as W}from"solid-js/web";import{getOwner as T}from"solid-js/web";import{use as R}from"solid-js/web";import{insert as _}from"solid-js/web";import{createComponent as m}from"solid-js/web";import"@inkandswitch/patchwork-elements";import{subscribe as gt}from"@inkandswitch/patchwork-providers";import{template as q}from"solid-js/web";import{delegateEvents as Pe}from"solid-js/web";import{memo as Me}from"solid-js/web";import{insert as be}from"solid-js/web";import{createComponent as O}from"solid-js/web";import{For as Be,Show as z}from"solid-js";var He=q("<div class=threepane-widgets>"),Ve=q("<div class=threepane-widgets__empty><button type=button class=threepane-widgets__add>\uFF0B Add document list"),Ne=q("<div class=threepane-widget>"),je="chee/document-list";function ye(e){let a=()=>{let l=e.rootFolderUrl(),r=e.configHandle();!l||!r||r.change(i=>{i.sidebar.widgets.push([je,l])})};return(()=>{var l=He();return be(l,O(z,{get when(){return e.ready()},get children(){return O(z,{get when(){return e.widgets().length},get fallback(){return O(z,{get when(){return Me(()=>!!e.rootFolderUrl())()&&e.configHandle()},get children(){var r=Ve(),i=r.firstChild;return i.$$click=a,r}})},get children(){return O(Be,{get each(){return e.widgets()},children:r=>(()=>{var i=Ne();return be(i,O(P,{slot:r})),i})()})}})}})),l})()}Pe(["click"]);import{template as De}from"solid-js/web";import{setAttribute as ze}from"solid-js/web";import{effect as qe}from"solid-js/web";import{insert as Se}from"solid-js/web";import{createComponent as K}from"solid-js/web";import{For as Xe,Show as Ye}from"solid-js";var Ke=De("<div class=frame-tray>"),Ge=De("<div class=frame-tray__item>");function $e(e){return K(Ye,{get when(){return e.slots().length},get children(){var a=Ke();return Se(a,K(Xe,{get each(){return F(e.slots())},children:l=>(()=>{var r=Ge();return Se(r,K(P,{slot:l})),qe(()=>ze(r,"data-tray-id",x(l))),r})()})),a}})}import{createEffect as U,createMemo as J,createSignal as v,onCleanup as k,onMount as Q,Show as C}from"solid-js";import{render as wt}from"solid-js/web";import{createDocOfDatatype2 as Qe}from"@inkandswitch/patchwork-plugins";import{getRegistry as Je}from"@inkandswitch/patchwork-plugins";function H(e){return Je("patchwork:datatype").loadWhenReady(e)}var Ze=new Set(["document-title","spacer"]),et="chee/document-list";function ke(e){return e?[[et,e]]:[]}async function Ce(e,a){let l=e.doc()?.rootFolderUrl,r=e.doc()?.tools?.threepane;if(r){(await a.find(r)).change(d=>{if(l&&!d.sidebar?.widgets?.length&&(d.sidebar.widgets=ke(l)),!d.tray)d.tray=M.slice();else{let c=F(d.tray);c.length!==d.tray.length&&(d.tray=c);let u=new Set(d.tray.map(f=>x(f)));for(let f of M)u.has(f)||(d.tray.push(f),u.add(f))}d.doctitle?.tools?.length||(d.doctitle={...d.doctitle,tools:_e.slice()})});return}let i=await H("threepane:config");if(!i){console.warn("frame: threepane:config datatype never registered");return}if(e.doc()?.tools?.threepane)return;let t=e.doc(),o=(t?.documentToolbarToolIds??[]).filter(n=>!Ze.has(n)),s=await Qe(i,a);s.change(n=>{o.length&&(n.doctitle.tools=o),n.sidebar.widgets=ke(t?.rootFolderUrl),n.tray||(n.tray=M.slice())}),e.change(n=>{n.tools||(n.tools={}),n.tools.threepane||(n.tools.threepane=s.url)})}var Re=xe(Fe(),1);import{createDocOfDatatype2 as tt}from"@inkandswitch/patchwork-plugins";var w=(0,Re.default)("patchwork:threepane:examples");async function Ie(e,a){let l=e.doc();if(!l?.rootFolderUrl){w("skipped \u2014 account has no rootFolderUrl");return}if(l.exampleDocsSeededAt){w("skipped \u2014 already ran for this account at",new Date(l.exampleDocsSeededAt).toISOString());return}w("claiming marker on account",e.url),e.change(c=>{c.exampleDocsSeededAt||(c.exampleDocsSeededAt=Date.now())});let r=await a.find(l.rootFolderUrl),i=r.doc()?.docs?.length??0;if(i){w(`skipped \u2014 root folder already has ${i} doc(s); only fresh accounts are seeded`);return}let t=window.location.hostname.includes("gaios"),o=t?[]:await ot();if(w(t?"gaios examples":"bundle init scripts:",o),!t&&!o.length){w("skipped \u2014 no static module bundles to ask");return}let s=await H("folder");if(!s){w("folder datatype never registered; giving up");return}let n=await tt(s,a,c=>{c.title="Examples"});if(t){let{seedGaiosExamples:c}=await import("./gaiosExamples-YDNQB35L.js");await c(a,n)}for(let c of o)try{await(await import(c)).default?.(a,n),w("ran init script",c)}catch(u){w("init script unavailable or failed",c,u)}let d=n.doc()?.docs?.length??0;if(!d){w("no bundle contributed any documents");return}r.change(c=>{c.docs.unshift({name:"Examples",type:"folder",url:n.url})}),w(`seeded ${d} document(s) into Examples folder`,n.url)}var Ee="https://patchwork-tools.netlify.app/init.js",Te="https://patchwork-base.netlify.app/init.js";async function ot(){let e=window.patchwork?.packages;if(!e?.urls)return[Te,Ee];await e.doneLoading;let a=Object.values(e.urls).filter(r=>typeof r=="string"&&!r.startsWith("automerge:")).map(r=>new URL("init.js",new URL(r,document.baseURI)).href),l=a.length?[]:[Te];return[...new Set([...a,...l,Ee])]}var at=y("<div class=frame-shell><aside class=frame-warning-banner>research grade software. do not share links. sharing a doc is sharing your account.</aside><div class=frame><patchwork-view component=patchwork-selected-doc-provider><patchwork-view component=patchwork-account-provider><patchwork-view component=patchwork-tool-storage-provider><patchwork-view component=patchwork-worker-provider>",!0,!1,!1),lt=y("<div style=display:contents>"),st=y("<div class=main-area>"),dt=y("<div class=frame__popover-backdrop><div class=frame__popover role=dialog aria-modal=true><div class=frame__popover-toolbar><patchwork-view tool-id=doc-openwith></patchwork-view></div><div class=frame__popover-body><patchwork-view>",!0,!1,!1),ct=y('<button type=button class="frame__sidebar-toggle frame__left-toggle">'),ut=y("<div class=threepane-sidebar><div class=threepane-sidebar__footer><footer class=threepane-account-bar><button type=button class=threepane-account-bar__button>Settings"),mt=y("<div class=frame__tray-dock>"),ft=y('<button type=button class="threepane-account-bar__button threepane-account-bar__avatar"title=Account aria-label=Account><patchwork-view tool-id=contact-avatar>',!0,!1,!1),ht=y("<button type=button class=threepane-account-bar__button>Packages"),pt=y('<svg xmlns=http://www.w3.org/2000/svg width=18 height=18 viewBox="0 0 24 24"fill=none stroke=var(--studio-chrome-line) stroke-width=1.75 stroke-linecap=round stroke-linejoin=round><rect width=18 height=18 x=3 y=3 rx=2></rect><path d="M9 3v18">'),vt=180,_t=720,bt=120,yt=3,X=(e,a)=>{let[l,r]=v(!1);return U(()=>{let i=a();if(!i)return;r(!1);let t=o=>{o.detail?.componentId===e&&r(!0)};i.addEventListener("patchwork:mounted",t),k(()=>i.removeEventListener("patchwork:mounted",t))}),l};function Y(e,a){e.dispatchEvent(new CustomEvent("patchwork:open-document",{detail:a,bubbles:!0,composed:!0}))}function St({handle:e,repo:a,...l}){we();let r=e.url,[i,t]=v(),o=X("patchwork-account-provider",i),[s,n]=v(),d=X("patchwork-tool-storage-provider",s),[c,u]=v(),f=X("patchwork-selected-doc-provider",c),g=J(()=>f()&&o()&&d());return(()=>{var S=at(),p=S.firstChild,Z=p.firstChild,V=p.nextSibling,L=V.firstChild,I=L.firstChild,D=I.firstChild,A=D.firstChild;return _(p,m(C,{get when(){return l.isolation},get children(){return[" ","isolation is highly experimental. if things are broken, switch back to wild west."]}}),null),R(u,L),L._$owner=T(),R(t,I),I.docUrl=r,I._$owner=T(),R(n,D),D.docUrl=r,D._$owner=T(),A._$owner=T(),_(A,m(C,{get when(){return g()},get children(){return m(Dt,{handle:e,repo:a,get isolation(){return l.isolation}})}})),S})()}function Dt(e){let a=B(()=>e.handle.url,{repo:e.repo});(async()=>{await Ce(e.handle,e.repo),await Ie(e.handle,e.repo)})().catch(h=>{console.error("frame: account bootstrap failed",h)});let[l,r]=v(0);U(()=>{let h=a();if(!h)return;let b=()=>r($=>$+1);h.on("change",b),k(()=>h.off("change",b))});let i=J(()=>(l(),a()?.doc())),t=e.handle.url,o=()=>i()?.tools?.threepane,s=B(()=>o(),{repo:e.repo}),[n,d]=v(0);U(()=>{let h=s();if(!h)return;let b=()=>d($=>$+1);h.on("change",b),k(()=>h.off("change",b))});let c=J(()=>(n(),s()?.doc())),u=()=>c()?.doctitle?.tools,f=()=>c()?.sidebar?.widgets??[],g=()=>c()?.tray??[],S=()=>i()?.rootFolderUrl,p=de(),Z=ce({setLeftSidebarWidth:p.setLeftSidebarWidth,setRightSidebarWidth:p.setRightSidebarWidth,setIsSidebarCollapsed:p.setIsSidebarCollapsed,setIsRightSidebarCollapsed:p.setIsRightSidebarCollapsed,isLeftCollapsed:p.isSidebarCollapsed,isRightCollapsed:p.isRightSidebarCollapsed,minWidth:vt,maxWidth:_t,autoCloseWidth:bt,dragThreshold:yt}),{events:V,dismissEvent:L,clearAll:I}=me(),D,[A,Ue]=v(null),[Le,ee]=v(null);Q(()=>{let h=gt(D,{type:"patchwork:selected-view"},b=>Ue(b));k(h)});let E=()=>A()?.url,N=()=>A()?.toolId??void 0,te=()=>le(j.rightWidth,ae),oe=()=>se(j.rightCollapsed),[Ae,re]=v(),Oe=ue(Ae,E),[ne,We]=v(!1);return U(()=>{ne()||(e.isolation||!E()||Oe())&&We(!0)}),(()=>{var h=lt(),b=D;return typeof b=="function"?R(b,h):D=h,_(h,m(fe,{get events(){return V()},onDismiss:L,onClearAll:I}),null),_(h,m(kt,{accountDocUrl:t,sidebarState:p,sidebarResize:Z,sidebarWidgets:f,traySlots:g,configHandle:s,rootFolderUrl:S,widgetsReady:ne,contactUrl:()=>i()?.contactUrl,moduleSettingsUrl:()=>i()?.moduleSettingsUrl,get isolation(){return e.isolation},onInterceptOpen:ee,get children(){return m(C,{get when(){return E()},get fallback(){return(()=>{var $=st();return _($,m(pe,{viewKey:E,selectedDocUrl:E,toolId:N,ref:re})),$})()},get children(){return m(C,{get when(){return e.isolation},get fallback(){return m(ge,{setMainDocElement:re,selectedDocUrl:E,selectedToolId:N,doctitleSlots:u,get isLeftCollapsed(){return p.isSidebarCollapsed},initialRightWidth:te,initialRightCollapsed:oe})},get children(){return m(ve,{get contactUrl(){return i()?.contactUrl},selectedDocUrl:E,selectedToolId:N,doctitleSlots:u,get isLeftCollapsed(){return p.isSidebarCollapsed},initialRightWidth:te,initialRightCollapsed:oe})}})}})}}),null),_(h,m(C,{get when(){return Le()},children:$=>m($t,{get view(){return $()},onClose:()=>ee(null)})}),null),h})()}function $t(e){let[a,l]=v(e.view.toolId??void 0);U(()=>l(e.view.toolId??void 0));let r;return Q(()=>{let i=s=>{s.key==="Escape"&&e.onClose()};window.addEventListener("keydown",i),k(()=>window.removeEventListener("keydown",i));let t=r;if(!t)return;let o=s=>{let{url:n,toolId:d}=s.detail;n&&(s.stopPropagation(),l(d??void 0))};t.addEventListener("patchwork:open-document",o),k(()=>t.removeEventListener("patchwork:open-document",o))}),(()=>{var i=dt(),t=i.firstChild,o=t.firstChild,s=o.firstChild,n=o.nextSibling,d=n.firstChild;i.$$click=()=>e.onClose(),t.$$click=u=>u.stopPropagation();var c=r;return typeof c=="function"?R(c,t):r=t,s._$owner=T(),d._$owner=T(),W(u=>{var f=e.view.url,g=e.view.url,S=a();return f!==u.e&&(s.docUrl=u.e=f),g!==u.t&&(d.docUrl=u.t=g),S!==u.a&&(d.toolId=u.a=S),u},{e:void 0,t:void 0,a:void 0}),i})()}function kt(e){let a=e.sidebarState.isSidebarCollapsed,l=()=>e.traySlots().length>0,r;Q(()=>{if(!e.isolation||!r)return;let t=r,o=s=>{let{url:n,toolId:d}=s.detail;n&&(s.stopPropagation(),e.onInterceptOpen?.({url:n,toolId:d??null}))};t.addEventListener("patchwork:open-document",o),k(()=>t.removeEventListener("patchwork:open-document",o))});let i;return U(()=>{if(e.sidebarState.isSidebarCollapsed())return;let t=i;if(!t)return;let o=()=>{t.getBoundingClientRect().width<=window.innerWidth*.75||(e.sidebarState.setIsSidebarCollapsed(!0),window.dispatchEvent(new CustomEvent(ie)))};t.addEventListener("patchwork:open-document",o),k(()=>t.removeEventListener("patchwork:open-document",o))}),[(()=>{var t=ct();return t.$$click=()=>e.sidebarState.setIsSidebarCollapsed(o=>!o),_(t,m(Ct,{})),W(o=>{var s=a()?"Show sidebar":"Hide sidebar",n=a()?"Show sidebar":"Hide sidebar",d=!a();return s!==o.e&&G(t,"title",o.e=s),n!==o.t&&G(t,"aria-label",o.t=n),d!==o.a&&G(t,"aria-pressed",o.a=d),o},{e:void 0,t:void 0,a:void 0}),t})(),m(he,{side:"left",isCollapsed:a,get width(){return e.sidebarState.leftSidebarWidth},get onMouseDown(){return e.sidebarResize.handleMouseDown},get onToggleClick(){return e.sidebarResize.handleToggleClick},get children(){var t=ut(),o=t.firstChild,s=o.firstChild,n=s.firstChild,d=i;typeof d=="function"?R(d,t):i=t,_(t,m(ye,{get widgets(){return e.sidebarWidgets},get configHandle(){return e.configHandle},get rootFolderUrl(){return e.rootFolderUrl},get ready(){return e.widgetsReady}}),o);var c=r;return typeof c=="function"?R(c,o):r=o,_(s,m(C,{get when(){return e.contactUrl()},children:u=>(()=>{var f=ft(),g=f.firstChild;return f.$$click=S=>Y(S.currentTarget,{url:e.accountDocUrl,toolId:"account-picker"}),g._$owner=T(),W(()=>g.docUrl=u()),f})()}),n),_(s,m(C,{get when(){return e.moduleSettingsUrl()},children:u=>(()=>{var f=ht();return f.$$click=g=>Y(g.currentTarget,{url:u(),toolId:"packages"}),f})()}),n),n.$$click=u=>Y(u.currentTarget,{url:e.accountDocUrl,toolId:"frame-configurator"}),W(()=>t.classList.toggle("threepane-sidebar--has-tray",!!l())),t}}),m(C,{get when(){return l()},get children(){var t=mt();return _(t,m($e,{get slots(){return e.traySlots}})),W(o=>{var s=!!a(),n=`${e.sidebarState.leftSidebarWidth()}px`;return s!==o.e&&t.classList.toggle("frame__tray-dock--collapsed",o.e=s),n!==o.t&&it(t,"width",o.t=n),o},{e:void 0,t:void 0}),t}}),nt(()=>e.children)]}function Ct(){return pt()}function ko(e){return(a,l)=>wt(()=>m(St,{handle:a,get repo(){return l.repo},isolation:e}),l)}rt(["click"]);export{St as PatchworkFrame,ko as renderPatchworkFrame};
|
|
2
|
+
//# sourceMappingURL=PatchworkFrame-WMZ3SLEE.js.map
|