@ai-ecoverse/slicc-spectrum 1.36.0 → 1.37.1
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 +6 -6
- package/dist/slicc-dummy.js +5 -3
- package/dist/slicc-dummy.js.map +2 -2
- package/dist/slicc-ui.js +204 -56
- package/dist/slicc-ui.js.map +3 -3
- package/dist/types/app/app.d.ts +1 -1
- package/dist/types/app/changes.d.ts +16 -0
- package/dist/types/dummy/changes.d.ts +1 -1
- package/dist/types/dummy/updates.d.ts +1 -1
- package/dist/types/model/types.d.ts +1 -1
- package/package.json +2 -2
package/dist/slicc-ui.js
CHANGED
|
@@ -10682,9 +10682,8 @@ var SliccNetwork = class extends ModelElement {
|
|
|
10682
10682
|
margin: 0 auto;
|
|
10683
10683
|
box-sizing: border-box;
|
|
10684
10684
|
}
|
|
10685
|
-
.page:focus
|
|
10686
|
-
outline:
|
|
10687
|
-
outline-offset: calc(-1 * var(--swc-focus-indicator-thickness));
|
|
10685
|
+
.page:focus {
|
|
10686
|
+
outline: none;
|
|
10688
10687
|
}
|
|
10689
10688
|
section {
|
|
10690
10689
|
display: grid;
|
|
@@ -14498,6 +14497,7 @@ e25("swc-progress-bar", o56);
|
|
|
14498
14497
|
var states = {
|
|
14499
14498
|
current: ["neutral", "Up to date"],
|
|
14500
14499
|
queued: ["neutral", "Waiting"],
|
|
14500
|
+
starting: ["info", "Starting"],
|
|
14501
14501
|
checking: ["info", "Checking"],
|
|
14502
14502
|
downloading: ["info", "Downloading"],
|
|
14503
14503
|
linking: ["info", "Linking"],
|
|
@@ -14528,7 +14528,7 @@ function updatesStatus(items) {
|
|
|
14528
14528
|
if (items.some((item2) => item2.state === "ready" || item2.state === "available")) {
|
|
14529
14529
|
return "update ready";
|
|
14530
14530
|
}
|
|
14531
|
-
return null;
|
|
14531
|
+
return items.some((item2) => item2.state === "starting") ? "starting" : null;
|
|
14532
14532
|
}
|
|
14533
14533
|
var UpdateVisibility = class {
|
|
14534
14534
|
#boot;
|
|
@@ -14579,9 +14579,8 @@ var SliccUpdates = class extends ModelElement {
|
|
|
14579
14579
|
padding: var(--swc-spacing-400);
|
|
14580
14580
|
margin: 0 auto;
|
|
14581
14581
|
}
|
|
14582
|
-
.page:focus
|
|
14583
|
-
outline:
|
|
14584
|
-
outline-offset: calc(-1 * var(--swc-focus-indicator-thickness));
|
|
14582
|
+
.page:focus {
|
|
14583
|
+
outline: none;
|
|
14585
14584
|
}
|
|
14586
14585
|
.hint {
|
|
14587
14586
|
margin: 0 0 var(--swc-spacing-300);
|
|
@@ -14733,7 +14732,7 @@ var SliccUpdates = class extends ModelElement {
|
|
|
14733
14732
|
accessible-label=${`${item2.label}: ${progress.phase === "download" ? "downloading" : "linking"}`}
|
|
14734
14733
|
></swc-progress-bar>`;
|
|
14735
14734
|
}
|
|
14736
|
-
if (!running.has(item2.state)) return A;
|
|
14735
|
+
if (!running.has(item2.state) && item2.state !== "starting") return A;
|
|
14737
14736
|
return b`<swc-progress-bar
|
|
14738
14737
|
size="s"
|
|
14739
14738
|
indeterminate
|
|
@@ -14772,7 +14771,7 @@ var SliccUpdates = class extends ModelElement {
|
|
|
14772
14771
|
</div>
|
|
14773
14772
|
<div class="meta">
|
|
14774
14773
|
<span class="version">${item2.from ?? "Not installed"}${item2.to && item2.to !== item2.from ? b` → ${item2.to}` : A}</span>
|
|
14775
|
-
${this.#checked(item2.checkedAt)}
|
|
14774
|
+
${item2.state === "starting" ? A : this.#checked(item2.checkedAt)}
|
|
14776
14775
|
</div>
|
|
14777
14776
|
${this.#progress(item2)}
|
|
14778
14777
|
${error ? b`<div class="error" role="alert">
|
|
@@ -14818,6 +14817,7 @@ function railCapacity(width, count) {
|
|
|
14818
14817
|
function updatesVariant(status2) {
|
|
14819
14818
|
if (status2.endsWith("failed")) return "negative";
|
|
14820
14819
|
if (status2.startsWith("updating")) return "info";
|
|
14820
|
+
if (status2 === "starting") return "neutral";
|
|
14821
14821
|
return "notice";
|
|
14822
14822
|
}
|
|
14823
14823
|
var overscrollLocks = /* @__PURE__ */ new WeakMap();
|
|
@@ -15145,12 +15145,14 @@ var SliccApp = class extends ThemedElement {
|
|
|
15145
15145
|
const restored = this.dock.api.getPanel("updates");
|
|
15146
15146
|
if (restored) this.dock.reveal("updates");
|
|
15147
15147
|
else this.show("updates");
|
|
15148
|
-
|
|
15149
|
-
|
|
15150
|
-
|
|
15151
|
-
}
|
|
15148
|
+
const panel = this.dock.api.getPanel("updates");
|
|
15149
|
+
if (!port.ready() && restored?.params?.boot !== false)
|
|
15150
|
+
panel?.api.updateParameters({ boot: true });
|
|
15151
|
+
else if (!restored) panel?.api.updateParameters({ boot: void 0 });
|
|
15152
|
+
this.#save();
|
|
15152
15153
|
} else if (this.dock.api.getPanel("updates")?.params?.boot && port.ready() && !port.list().some((item2) => item2.state === "failed")) {
|
|
15153
15154
|
this.dock.close("updates");
|
|
15155
|
+
this.#save();
|
|
15154
15156
|
}
|
|
15155
15157
|
}
|
|
15156
15158
|
#factories(model) {
|
|
@@ -16803,14 +16805,29 @@ function groups(changes) {
|
|
|
16803
16805
|
}
|
|
16804
16806
|
return [...byRepo];
|
|
16805
16807
|
}
|
|
16808
|
+
function commands(text2) {
|
|
16809
|
+
const parts2 = text2.split("`").map((part2, index) => index % 2 ? { code: part2 } : part2);
|
|
16810
|
+
if (parts2.length % 2 === 0) return { parts: [text2], codes: [] };
|
|
16811
|
+
const codes = parts2.flatMap(
|
|
16812
|
+
(part2) => typeof part2 === "string" || !part2.code ? [] : [part2.code]
|
|
16813
|
+
);
|
|
16814
|
+
return { parts: parts2, codes: [...new Set(codes)] };
|
|
16815
|
+
}
|
|
16806
16816
|
function errorLine(error) {
|
|
16807
16817
|
return b`<div class="error" role="status" aria-live="polite">${error ? b`<swc-icon-alert-diamond size="s" aria-hidden="true"></swc-icon-alert-diamond><span>${error}</span>` : A}</div>`;
|
|
16808
16818
|
}
|
|
16809
16819
|
var SliccChanges = class extends ModelElement {
|
|
16810
|
-
static properties = {
|
|
16820
|
+
static properties = {
|
|
16821
|
+
...ModelElement.properties,
|
|
16822
|
+
error: { state: true },
|
|
16823
|
+
copied: { state: true },
|
|
16824
|
+
uncopied: { state: true }
|
|
16825
|
+
};
|
|
16811
16826
|
constructor() {
|
|
16812
16827
|
super();
|
|
16813
16828
|
this.error = "";
|
|
16829
|
+
this.copied = "";
|
|
16830
|
+
this.uncopied = false;
|
|
16814
16831
|
}
|
|
16815
16832
|
static styles = [
|
|
16816
16833
|
shared,
|
|
@@ -16829,6 +16846,50 @@ var SliccChanges = class extends ModelElement {
|
|
|
16829
16846
|
padding: 0;
|
|
16830
16847
|
overflow: visible;
|
|
16831
16848
|
}
|
|
16849
|
+
.unavailable {
|
|
16850
|
+
display: grid;
|
|
16851
|
+
gap: var(--swc-spacing-200);
|
|
16852
|
+
align-content: start;
|
|
16853
|
+
padding: var(--swc-spacing-300);
|
|
16854
|
+
overflow-y: auto;
|
|
16855
|
+
color: var(--swc-neutral-subdued-content-color-default);
|
|
16856
|
+
}
|
|
16857
|
+
.unavailable p {
|
|
16858
|
+
margin: 0;
|
|
16859
|
+
}
|
|
16860
|
+
.command {
|
|
16861
|
+
display: flex;
|
|
16862
|
+
align-items: center;
|
|
16863
|
+
gap: var(--swc-spacing-100);
|
|
16864
|
+
padding: var(--swc-spacing-75) var(--swc-spacing-75) var(--swc-spacing-75) var(--swc-spacing-200);
|
|
16865
|
+
border-radius: var(--swc-corner-radius-medium-default);
|
|
16866
|
+
background: var(--swc-background-layer-1-color);
|
|
16867
|
+
}
|
|
16868
|
+
code {
|
|
16869
|
+
overflow-wrap: anywhere;
|
|
16870
|
+
font-family: var(--swc-code-font-family-stack);
|
|
16871
|
+
font-size: var(--swc-font-size-75);
|
|
16872
|
+
color: var(--swc-code-color);
|
|
16873
|
+
}
|
|
16874
|
+
.command code {
|
|
16875
|
+
flex: 1;
|
|
16876
|
+
min-width: 0;
|
|
16877
|
+
user-select: all;
|
|
16878
|
+
}
|
|
16879
|
+
p code {
|
|
16880
|
+
display: inline-block;
|
|
16881
|
+
max-inline-size: 100%;
|
|
16882
|
+
font-size: var(--swc-font-size-50);
|
|
16883
|
+
color: inherit;
|
|
16884
|
+
}
|
|
16885
|
+
.summary {
|
|
16886
|
+
min-width: 0;
|
|
16887
|
+
overflow: hidden;
|
|
16888
|
+
text-overflow: ellipsis;
|
|
16889
|
+
}
|
|
16890
|
+
.bar swc-action-button {
|
|
16891
|
+
flex: none;
|
|
16892
|
+
}
|
|
16832
16893
|
.repo {
|
|
16833
16894
|
display: flex;
|
|
16834
16895
|
gap: var(--swc-spacing-100);
|
|
@@ -16977,7 +17038,7 @@ var SliccChanges = class extends ModelElement {
|
|
|
16977
17038
|
}
|
|
16978
17039
|
#list(changes) {
|
|
16979
17040
|
const grouped = groups(changes);
|
|
16980
|
-
if (grouped.length
|
|
17041
|
+
if (grouped.length === 1 && !grouped[0][0])
|
|
16981
17042
|
return b`<ul aria-label="Pending changes" @keydown=${this.#keydown}>${changes.map((change) => this.#row(change))}</ul>`;
|
|
16982
17043
|
return b`<ul aria-label="Pending changes" @keydown=${this.#keydown}>${grouped.map(
|
|
16983
17044
|
([repo, items]) => b`<li data-repo=${repo}>
|
|
@@ -16989,13 +17050,38 @@ var SliccChanges = class extends ModelElement {
|
|
|
16989
17050
|
</li>`
|
|
16990
17051
|
)}</ul>`;
|
|
16991
17052
|
}
|
|
17053
|
+
async copy(code2) {
|
|
17054
|
+
try {
|
|
17055
|
+
await globalThis.navigator.clipboard.writeText(code2);
|
|
17056
|
+
this.copied = code2;
|
|
17057
|
+
this.uncopied = false;
|
|
17058
|
+
} catch {
|
|
17059
|
+
this.copied = "";
|
|
17060
|
+
this.uncopied = true;
|
|
17061
|
+
}
|
|
17062
|
+
}
|
|
17063
|
+
#unavailable(text2) {
|
|
17064
|
+
const { parts: parts2, codes } = commands(text2);
|
|
17065
|
+
return b`<div class="unavailable">
|
|
17066
|
+
<p data-unavailable>${parts2.map((part2) => typeof part2 === "string" ? part2 : b`<code>${part2.code}</code>`)}</p>
|
|
17067
|
+
${codes.map(
|
|
17068
|
+
(code2) => b`<div class="command" data-command=${code2}>
|
|
17069
|
+
<code>${code2}</code>
|
|
17070
|
+
<swc-action-button size="s" quiet data-action="copy-command" accessible-label=${this.copied === code2 ? "Copied" : `Copy ${code2}`} @click=${() => this.copy(code2)}>
|
|
17071
|
+
<swc-icon-copy slot="icon"></swc-icon-copy>${this.copied === code2 ? "Copied" : "Copy"}
|
|
17072
|
+
</swc-action-button>
|
|
17073
|
+
</div>`
|
|
17074
|
+
)}
|
|
17075
|
+
${this.uncopied ? b`<div class="error" role="alert" data-error="copy"><swc-icon-alert-diamond size="s" aria-hidden="true"></swc-icon-alert-diamond><span>Couldn’t copy. Select the command and copy it.</span></div>` : A}
|
|
17076
|
+
</div>`;
|
|
17077
|
+
}
|
|
16992
17078
|
render() {
|
|
16993
17079
|
const port = this.model ? changesOf(this.model) : null;
|
|
16994
17080
|
const unavailable = port?.unavailable?.() ?? null;
|
|
16995
|
-
if (unavailable) return
|
|
17081
|
+
if (unavailable) return this.#unavailable(unavailable);
|
|
16996
17082
|
const changes = port?.changes() ?? [];
|
|
16997
17083
|
return b`<div class="bar">
|
|
16998
|
-
<span>${changes.length} pending ${changes.length === 1 ? "change" : "changes"}</span>
|
|
17084
|
+
<span class="summary">${changes.length} pending ${changes.length === 1 ? "change" : "changes"}</span>
|
|
16999
17085
|
<span class="spacer"></span>
|
|
17000
17086
|
${changes.length ? b`<swc-action-button size="s" quiet @click=${() => this.#all("accept")}>Accept all</swc-action-button>
|
|
17001
17087
|
<swc-action-button size="s" quiet @click=${() => this.#all("revert")}>Revert all</swc-action-button>` : A}
|
|
@@ -17020,9 +17106,26 @@ var SliccDiffPanel = class extends ThemedElement {
|
|
|
17020
17106
|
flex: 1;
|
|
17021
17107
|
min-height: 0;
|
|
17022
17108
|
}
|
|
17023
|
-
|
|
17109
|
+
:host {
|
|
17110
|
+
container-type: inline-size;
|
|
17111
|
+
}
|
|
17112
|
+
swc-action-group,
|
|
17113
|
+
.bar swc-action-button {
|
|
17024
17114
|
flex: none;
|
|
17025
17115
|
}
|
|
17116
|
+
.bar .path {
|
|
17117
|
+
min-width: 0;
|
|
17118
|
+
}
|
|
17119
|
+
@container (width < 480px) {
|
|
17120
|
+
.bar .label {
|
|
17121
|
+
position: absolute;
|
|
17122
|
+
inline-size: 1px;
|
|
17123
|
+
block-size: 1px;
|
|
17124
|
+
overflow: hidden;
|
|
17125
|
+
clip-path: inset(50%);
|
|
17126
|
+
white-space: nowrap;
|
|
17127
|
+
}
|
|
17128
|
+
}
|
|
17026
17129
|
swc-action-button.selected {
|
|
17027
17130
|
--swc-action-button-background-color-default: var(--swc-neutral-background-color-selected-default);
|
|
17028
17131
|
--swc-action-button-background-color-hover: var(--swc-neutral-background-color-selected-hover);
|
|
@@ -17076,7 +17179,7 @@ var SliccDiffPanel = class extends ThemedElement {
|
|
|
17076
17179
|
return b`<div class="bar">
|
|
17077
17180
|
${statusMark(change.status, false)}
|
|
17078
17181
|
<span class="path" title=${this.path}>${this.path}</span>
|
|
17079
|
-
<span>${statusLabels[change.status]}${by ? ` by ${by}` : ""}</span>
|
|
17182
|
+
<span class="label">${statusLabels[change.status]}${by ? ` by ${by}` : ""}</span>
|
|
17080
17183
|
<span class="spacer"></span>
|
|
17081
17184
|
${change.before === null && change.after === null ? A : b`<swc-action-group size="s" compact accessible-label="Diff layout">
|
|
17082
17185
|
${layouts.map(
|
|
@@ -17089,11 +17192,11 @@ var SliccDiffPanel = class extends ThemedElement {
|
|
|
17089
17192
|
>`
|
|
17090
17193
|
)}
|
|
17091
17194
|
</swc-action-group>`}
|
|
17092
|
-
<swc-action-button size="s" quiet @click=${() => port?.accept(this.path)}>
|
|
17093
|
-
<swc-icon-checkmark slot="icon"></swc-icon-checkmark>Accept
|
|
17195
|
+
<swc-action-button size="s" quiet data-action="accept" accessible-label="Accept" title="Accept" @click=${() => port?.accept(this.path)}>
|
|
17196
|
+
<swc-icon-checkmark slot="icon"></swc-icon-checkmark><span class="label">Accept</span>
|
|
17094
17197
|
</swc-action-button>
|
|
17095
|
-
<swc-action-button size="s" quiet @click=${() => this.#revert(port, change)}>
|
|
17096
|
-
<swc-icon-revert slot="icon"></swc-icon-revert>Revert
|
|
17198
|
+
<swc-action-button size="s" quiet data-action="revert" accessible-label="Revert" title="Revert" @click=${() => this.#revert(port, change)}>
|
|
17199
|
+
<swc-icon-revert slot="icon"></swc-icon-revert><span class="label">Revert</span>
|
|
17097
17200
|
</swc-action-button>
|
|
17098
17201
|
</div>
|
|
17099
17202
|
${errorLine(this.error)}
|
|
@@ -19758,12 +19861,15 @@ function tool(call, color = "light") {
|
|
|
19758
19861
|
const kind = toolKind(call.name);
|
|
19759
19862
|
return b`<details class="tool" data-status=${call.status} data-tool=${call.name} data-kind=${kind.id}>
|
|
19760
19863
|
<summary>
|
|
19761
|
-
<
|
|
19762
|
-
|
|
19763
|
-
|
|
19764
|
-
|
|
19765
|
-
|
|
19766
|
-
|
|
19864
|
+
<span class="head">
|
|
19865
|
+
<swc-icon-chevron-right class="chevron" size="s" aria-hidden="true"></swc-icon-chevron-right>
|
|
19866
|
+
<span class="kind">${kind.icon}</span>
|
|
19867
|
+
<span class="title">${call.title}</span>
|
|
19868
|
+
<span class="name">${call.name}</span>
|
|
19869
|
+
${call.meta ? b`<span class="tool-meta">${call.meta}</span>` : A}
|
|
19870
|
+
${state(call.status)}
|
|
19871
|
+
</span>
|
|
19872
|
+
${call.image ? b`<span class="thumb"><img src=${call.image} alt="" /></span>` : A}
|
|
19767
19873
|
</summary>
|
|
19768
19874
|
<div class="call">
|
|
19769
19875
|
${body(call, color)}
|
|
@@ -20315,6 +20421,18 @@ var messageCss = i`
|
|
|
20315
20421
|
:is(details.tool, details.cluster) > summary {
|
|
20316
20422
|
padding-inline: var(--swc-spacing-100);
|
|
20317
20423
|
}
|
|
20424
|
+
details.tool > summary {
|
|
20425
|
+
flex-direction: column;
|
|
20426
|
+
align-items: stretch;
|
|
20427
|
+
justify-content: center;
|
|
20428
|
+
gap: 0;
|
|
20429
|
+
}
|
|
20430
|
+
details.tool > summary > .head {
|
|
20431
|
+
display: flex;
|
|
20432
|
+
align-items: center;
|
|
20433
|
+
gap: var(--swc-spacing-100);
|
|
20434
|
+
min-inline-size: 0;
|
|
20435
|
+
}
|
|
20318
20436
|
:is(details.tool, details.cluster) > summary:hover {
|
|
20319
20437
|
background: var(--swc-gray-100);
|
|
20320
20438
|
}
|
|
@@ -20432,6 +20550,19 @@ var messageCss = i`
|
|
|
20432
20550
|
white-space: pre-wrap;
|
|
20433
20551
|
overflow-wrap: anywhere;
|
|
20434
20552
|
}
|
|
20553
|
+
.thumb {
|
|
20554
|
+
padding-inline-start: calc(var(--swc-spacing-100) + var(--swc-spacing-300));
|
|
20555
|
+
padding-block: var(--swc-spacing-75);
|
|
20556
|
+
}
|
|
20557
|
+
.thumb img {
|
|
20558
|
+
display: block;
|
|
20559
|
+
max-inline-size: min(100%, calc(var(--swc-spacing-1000) * 2));
|
|
20560
|
+
max-block-size: calc(var(--swc-spacing-1000) * 1.25);
|
|
20561
|
+
border-radius: var(--swc-corner-radius-75);
|
|
20562
|
+
}
|
|
20563
|
+
details[open] > summary .thumb {
|
|
20564
|
+
display: none;
|
|
20565
|
+
}
|
|
20435
20566
|
.shot {
|
|
20436
20567
|
display: block;
|
|
20437
20568
|
max-inline-size: min(100%, calc(var(--swc-spacing-1000) * 5));
|
|
@@ -21906,9 +22037,9 @@ e25("swc-icon-clock", o70);
|
|
|
21906
22037
|
// src/app/composer.ts
|
|
21907
22038
|
var limit = 25 * 1024 * 1024;
|
|
21908
22039
|
function available(model) {
|
|
21909
|
-
return
|
|
22040
|
+
return commands2.filter((command2) => command2.available?.(model) ?? true);
|
|
21910
22041
|
}
|
|
21911
|
-
var
|
|
22042
|
+
var commands2 = [
|
|
21912
22043
|
{
|
|
21913
22044
|
name: "clear",
|
|
21914
22045
|
detail: "Start a new chat",
|
|
@@ -22097,14 +22228,27 @@ var SliccComposer = class extends ModelElement {
|
|
|
22097
22228
|
min-height: var(--swc-component-height-75);
|
|
22098
22229
|
}
|
|
22099
22230
|
.hint {
|
|
22231
|
+
display: flex;
|
|
22100
22232
|
flex: 1;
|
|
22233
|
+
flex-wrap: wrap;
|
|
22234
|
+
align-items: center;
|
|
22101
22235
|
min-width: 0;
|
|
22102
|
-
|
|
22236
|
+
max-block-size: var(--swc-component-height-75);
|
|
22103
22237
|
overflow: hidden;
|
|
22104
|
-
text-overflow: ellipsis;
|
|
22105
22238
|
font-size: var(--swc-font-size-75);
|
|
22106
22239
|
color: var(--swc-neutral-subdued-content-color-default);
|
|
22107
22240
|
}
|
|
22241
|
+
.hint > span {
|
|
22242
|
+
display: flex;
|
|
22243
|
+
align-items: center;
|
|
22244
|
+
block-size: var(--swc-component-height-75);
|
|
22245
|
+
gap: var(--swc-spacing-50);
|
|
22246
|
+
white-space: nowrap;
|
|
22247
|
+
}
|
|
22248
|
+
.hint > span + span::before {
|
|
22249
|
+
content: '·';
|
|
22250
|
+
padding-inline-start: var(--swc-spacing-75);
|
|
22251
|
+
}
|
|
22108
22252
|
.below swc-action-button {
|
|
22109
22253
|
margin-inline-start: auto;
|
|
22110
22254
|
}
|
|
@@ -22385,7 +22529,7 @@ var SliccComposer = class extends ModelElement {
|
|
|
22385
22529
|
}
|
|
22386
22530
|
if (kind === "argument") {
|
|
22387
22531
|
const name = this.value.match(/^\/(\w+)/)?.[1];
|
|
22388
|
-
return filter(
|
|
22532
|
+
return filter(commands2.find((command2) => command2.name === name)?.args?.(model) ?? [], query);
|
|
22389
22533
|
}
|
|
22390
22534
|
const files = this.#paths.map((path) => ({
|
|
22391
22535
|
value: path,
|
|
@@ -22405,7 +22549,7 @@ var SliccComposer = class extends ModelElement {
|
|
|
22405
22549
|
if (this.popup?.kind === "file" || this.popup?.kind === "secret") return;
|
|
22406
22550
|
const found = trigger(this.value, area.selectionStart ?? this.value.length);
|
|
22407
22551
|
const name = this.value.match(/^\/(\w+)/)?.[1];
|
|
22408
|
-
const takes =
|
|
22552
|
+
const takes = commands2.some((command2) => command2.name === name && command2.args);
|
|
22409
22553
|
this.popup = found && (found.kind !== "argument" || takes) ? { ...found, items: this.#choices(found.kind, found.query), index: 0 } : null;
|
|
22410
22554
|
}
|
|
22411
22555
|
openPopup(kind) {
|
|
@@ -22687,8 +22831,12 @@ var SliccComposer = class extends ModelElement {
|
|
|
22687
22831
|
</div>
|
|
22688
22832
|
<div class="below">
|
|
22689
22833
|
<div class="hint">
|
|
22690
|
-
<kbd>Enter</kbd> ${busy ? "steer" : "send"}
|
|
22691
|
-
|
|
22834
|
+
<span><kbd>Enter</kbd> ${busy ? "steer" : "send"}</span>
|
|
22835
|
+
${busy ? b`<span><kbd>Ctrl+Enter</kbd> queue</span><span><kbd>Esc</kbd> stop</span>` : A}
|
|
22836
|
+
<span><kbd>/</kbd> commands</span>
|
|
22837
|
+
<span><kbd>@</kbd> mention</span>
|
|
22838
|
+
<span><kbd>Shift+Enter</kbd> new line</span>
|
|
22839
|
+
<span><kbd>↑</kbd> history</span>
|
|
22692
22840
|
</div>
|
|
22693
22841
|
${speech ? b`<swc-action-button
|
|
22694
22842
|
size="s"
|
|
@@ -32968,31 +33116,31 @@ function parseColor(sequence) {
|
|
|
32968
33116
|
}
|
|
32969
33117
|
}
|
|
32970
33118
|
function parseSequence(sequence) {
|
|
32971
|
-
const
|
|
33119
|
+
const commands3 = [];
|
|
32972
33120
|
while (sequence.length > 0) {
|
|
32973
33121
|
const code2 = sequence.shift();
|
|
32974
33122
|
if (!code2) continue;
|
|
32975
33123
|
const codeInt = Number.parseInt(code2);
|
|
32976
33124
|
if (Number.isNaN(codeInt)) continue;
|
|
32977
|
-
if (codeInt === 0)
|
|
33125
|
+
if (codeInt === 0) commands3.push({ type: "resetAll" });
|
|
32978
33126
|
else if (codeInt <= 9) {
|
|
32979
|
-
if (decorations[codeInt])
|
|
33127
|
+
if (decorations[codeInt]) commands3.push({
|
|
32980
33128
|
type: "setDecoration",
|
|
32981
33129
|
value: decorations[codeInt]
|
|
32982
33130
|
});
|
|
32983
33131
|
} else if (codeInt <= 29) {
|
|
32984
33132
|
const decoration = decorations[codeInt - 20];
|
|
32985
33133
|
if (decoration) {
|
|
32986
|
-
|
|
33134
|
+
commands3.push({
|
|
32987
33135
|
type: "resetDecoration",
|
|
32988
33136
|
value: decoration
|
|
32989
33137
|
});
|
|
32990
|
-
if (decoration === "dim")
|
|
33138
|
+
if (decoration === "dim") commands3.push({
|
|
32991
33139
|
type: "resetDecoration",
|
|
32992
33140
|
value: "bold"
|
|
32993
33141
|
});
|
|
32994
33142
|
}
|
|
32995
|
-
} else if (codeInt <= 37)
|
|
33143
|
+
} else if (codeInt <= 37) commands3.push({
|
|
32996
33144
|
type: "setForegroundColor",
|
|
32997
33145
|
value: {
|
|
32998
33146
|
type: "named",
|
|
@@ -33001,12 +33149,12 @@ function parseSequence(sequence) {
|
|
|
33001
33149
|
});
|
|
33002
33150
|
else if (codeInt === 38) {
|
|
33003
33151
|
const color = parseColor(sequence);
|
|
33004
|
-
if (color)
|
|
33152
|
+
if (color) commands3.push({
|
|
33005
33153
|
type: "setForegroundColor",
|
|
33006
33154
|
value: color
|
|
33007
33155
|
});
|
|
33008
|
-
} else if (codeInt === 39)
|
|
33009
|
-
else if (codeInt <= 47)
|
|
33156
|
+
} else if (codeInt === 39) commands3.push({ type: "resetForegroundColor" });
|
|
33157
|
+
else if (codeInt <= 47) commands3.push({
|
|
33010
33158
|
type: "setBackgroundColor",
|
|
33011
33159
|
value: {
|
|
33012
33160
|
type: "named",
|
|
@@ -33015,27 +33163,27 @@ function parseSequence(sequence) {
|
|
|
33015
33163
|
});
|
|
33016
33164
|
else if (codeInt === 48) {
|
|
33017
33165
|
const color = parseColor(sequence);
|
|
33018
|
-
if (color)
|
|
33166
|
+
if (color) commands3.push({
|
|
33019
33167
|
type: "setBackgroundColor",
|
|
33020
33168
|
value: color
|
|
33021
33169
|
});
|
|
33022
|
-
} else if (codeInt === 49)
|
|
33023
|
-
else if (codeInt === 53)
|
|
33170
|
+
} else if (codeInt === 49) commands3.push({ type: "resetBackgroundColor" });
|
|
33171
|
+
else if (codeInt === 53) commands3.push({
|
|
33024
33172
|
type: "setDecoration",
|
|
33025
33173
|
value: "overline"
|
|
33026
33174
|
});
|
|
33027
|
-
else if (codeInt === 55)
|
|
33175
|
+
else if (codeInt === 55) commands3.push({
|
|
33028
33176
|
type: "resetDecoration",
|
|
33029
33177
|
value: "overline"
|
|
33030
33178
|
});
|
|
33031
|
-
else if (codeInt >= 90 && codeInt <= 97)
|
|
33179
|
+
else if (codeInt >= 90 && codeInt <= 97) commands3.push({
|
|
33032
33180
|
type: "setForegroundColor",
|
|
33033
33181
|
value: {
|
|
33034
33182
|
type: "named",
|
|
33035
33183
|
name: namedColors[codeInt - 90 + 8]
|
|
33036
33184
|
}
|
|
33037
33185
|
});
|
|
33038
|
-
else if (codeInt >= 100 && codeInt <= 107)
|
|
33186
|
+
else if (codeInt >= 100 && codeInt <= 107) commands3.push({
|
|
33039
33187
|
type: "setBackgroundColor",
|
|
33040
33188
|
value: {
|
|
33041
33189
|
type: "named",
|
|
@@ -33043,7 +33191,7 @@ function parseSequence(sequence) {
|
|
|
33043
33191
|
}
|
|
33044
33192
|
});
|
|
33045
33193
|
}
|
|
33046
|
-
return
|
|
33194
|
+
return commands3;
|
|
33047
33195
|
}
|
|
33048
33196
|
function createAnsiSequenceParser() {
|
|
33049
33197
|
let foreground = null;
|
|
@@ -33062,15 +33210,15 @@ function createAnsiSequenceParser() {
|
|
|
33062
33210
|
decorations: new Set(decorations2)
|
|
33063
33211
|
});
|
|
33064
33212
|
if (findResult.sequence) {
|
|
33065
|
-
const
|
|
33066
|
-
for (const styleToken of
|
|
33213
|
+
const commands3 = parseSequence(findResult.sequence);
|
|
33214
|
+
for (const styleToken of commands3) if (styleToken.type === "resetAll") {
|
|
33067
33215
|
foreground = null;
|
|
33068
33216
|
background = null;
|
|
33069
33217
|
decorations2.clear();
|
|
33070
33218
|
} else if (styleToken.type === "resetForegroundColor") foreground = null;
|
|
33071
33219
|
else if (styleToken.type === "resetBackgroundColor") background = null;
|
|
33072
33220
|
else if (styleToken.type === "resetDecoration") decorations2.delete(styleToken.value);
|
|
33073
|
-
for (const styleToken of
|
|
33221
|
+
for (const styleToken of commands3) if (styleToken.type === "setForegroundColor") foreground = styleToken.value;
|
|
33074
33222
|
else if (styleToken.type === "setBackgroundColor") background = styleToken.value;
|
|
33075
33223
|
else if (styleToken.type === "setDecoration") decorations2.add(styleToken.value);
|
|
33076
33224
|
}
|