@ai-ecoverse/slicc-spectrum 1.57.0 → 1.58.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/slicc-ui.js CHANGED
@@ -9668,6 +9668,7 @@ var SliccFiles = class extends ModelElement {
9668
9668
  ...ModelElement.properties,
9669
9669
  count: { state: true },
9670
9670
  mounted: { state: true },
9671
+ sources: { state: true },
9671
9672
  mounting: { state: true },
9672
9673
  ejecting: { state: true },
9673
9674
  waiting: { state: true },
@@ -9681,6 +9682,7 @@ var SliccFiles = class extends ModelElement {
9681
9682
  super();
9682
9683
  this.count = 0;
9683
9684
  this.mounted = [];
9685
+ this.sources = /* @__PURE__ */ new Map();
9684
9686
  this.mounting = false;
9685
9687
  this.ejecting = /* @__PURE__ */ new Set();
9686
9688
  this.waiting = [];
@@ -9733,6 +9735,20 @@ var SliccFiles = class extends ModelElement {
9733
9735
  gap: var(--swc-spacing-100);
9734
9736
  min-height: var(--swc-component-height-75);
9735
9737
  }
9738
+ .mounts .source {
9739
+ color: var(--swc-neutral-subdued-content-color-default);
9740
+ }
9741
+ .mounts .path[data-source] {
9742
+ display: flex;
9743
+ flex-wrap: wrap;
9744
+ }
9745
+ .mounts .path[data-source] > span {
9746
+ min-width: 0;
9747
+ max-width: 100%;
9748
+ overflow: hidden;
9749
+ text-overflow: ellipsis;
9750
+ white-space: pre;
9751
+ }
9736
9752
  .mounts .path {
9737
9753
  flex: 1;
9738
9754
  min-width: 0;
@@ -9780,7 +9796,11 @@ var SliccFiles = class extends ModelElement {
9780
9796
  void this.updateComplete.then(() => this.#sync());
9781
9797
  }
9782
9798
  #mounts(files) {
9783
- this.mounted = files.mounts?.() ?? [];
9799
+ const info = files.mountInfo?.();
9800
+ this.mounted = info ? info.map((item2) => item2.target) : files.mounts?.() ?? [];
9801
+ this.sources = new Map(
9802
+ (info ?? []).flatMap((item2) => item2.source ? [[item2.target, item2.source]] : [])
9803
+ );
9784
9804
  this.waiting = files.needsFolder?.() ?? [];
9785
9805
  }
9786
9806
  #sync() {
@@ -9887,6 +9907,11 @@ var SliccFiles = class extends ModelElement {
9887
9907
  </ul>
9888
9908
  </section>`;
9889
9909
  }
9910
+ #mounted(path) {
9911
+ const source = this.sources.get(path);
9912
+ if (!source) return b`<span class="path" title=${path}>${path}</span>`;
9913
+ return b`<span class="path" title=${`${path} \xB7 ${source}`} data-source=${source}><span class="target">${path}</span><span class="source"> · ${source}</span></span>`;
9914
+ }
9890
9915
  #strip(files) {
9891
9916
  if (this.mounted.length === 0) return A;
9892
9917
  const eject = files?.eject?.bind(files);
@@ -9895,7 +9920,7 @@ var SliccFiles = class extends ModelElement {
9895
9920
  <ul aria-labelledby="mounted">
9896
9921
  ${this.mounted.map(
9897
9922
  (path) => b`<li>
9898
- <span class="path" title=${path}>${path}</span>
9923
+ ${this.#mounted(path)}
9899
9924
  ${eject ? b`<swc-action-button
9900
9925
  size="s"
9901
9926
  quiet
@@ -12080,7 +12105,7 @@ var automation = {
12080
12105
  extension: "Browser automation: through the SLICC extension.",
12081
12106
  proxy: "Browser automation: through slicc-node.",
12082
12107
  link: "Browser automation: through a linked device.",
12083
- none: "Browser automation: not available. Install the extension or run slicc-node."
12108
+ none: "Browser automation: not available. Install the extension, or run slicc-node or npx sliccy@next."
12084
12109
  };
12085
12110
  function automationOf(browser) {
12086
12111
  return browser.via ?? "none";
@@ -12523,7 +12548,43 @@ var SliccNetwork = class extends ModelElement {
12523
12548
  color: var(--swc-neutral-subdued-content-color-default);
12524
12549
  overflow-wrap: anywhere;
12525
12550
  }
12551
+ .folders ul {
12552
+ display: flex;
12553
+ flex-direction: column;
12554
+ gap: var(--swc-spacing-75);
12555
+ margin: var(--swc-spacing-75) 0 0;
12556
+ padding: 0;
12557
+ list-style: none;
12558
+ }
12559
+ .folders li {
12560
+ display: flex;
12561
+ align-items: center;
12562
+ gap: var(--swc-spacing-100);
12563
+ min-width: 0;
12564
+ }
12565
+ .folders swc-icon-folder {
12566
+ flex: none;
12567
+ color: var(--swc-neutral-subdued-content-color-default);
12568
+ }
12569
+ .folder {
12570
+ flex: 1;
12571
+ display: flex;
12572
+ flex-wrap: wrap;
12573
+ align-items: center;
12574
+ gap: var(--swc-spacing-50) var(--swc-spacing-100);
12575
+ min-width: 0;
12576
+ overflow-wrap: anywhere;
12577
+ }
12578
+ .folder > code {
12579
+ flex: none;
12580
+ max-width: 100%;
12581
+ }
12582
+ .folder .muted {
12583
+ flex-basis: 100%;
12584
+ font-size: var(--swc-font-size-75);
12585
+ }
12526
12586
  .where code,
12587
+ .folder code,
12527
12588
  [data-browsers] code {
12528
12589
  font-family: var(--swc-code-font-family-stack);
12529
12590
  }
@@ -12908,10 +12969,35 @@ var SliccNetwork = class extends ModelElement {
12908
12969
  <span class="where">${device.host ? b`<code>${device.host}</code>` : A}<span>${device.address ? b`<code>${device.address}</code> · ` : A}${device.mode === "local" ? "This computer" : "Remote"}${device.kind === "seven" ? " \xB7 Follower" : ""}</span></span>
12909
12970
  ${device.policy ? b`<span class="muted" data-policy>Reaches ${device.policy}.</span>` : A}
12910
12971
  ${device.browsers?.length ? b`<span class="muted" data-browsers>${device.browsers.length === 1 ? "Browser" : "Browsers"}: ${device.browsers.map((item2, index) => b`${index ? ", " : ""}${item2.name} (<code>${item2.runtime}</code>)`)}</span>` : A}
12972
+ ${device.folders?.length ? this.#folders(port, device, device.folders) : A}
12911
12973
  ${device.asking ? this.#ask(port, device) : this.#access(port, device)}
12912
12974
  ${device.offers.includes("ssh") ? b`<div class="command" data-copy="ssh"><code>ssh ${device.host}</code>${this.#copyButton(`ssh:${device.id}`, "ssh", "ssh command", `ssh ${device.host}`, "linksError")}</div>` : A}
12913
12975
  </li>`;
12914
12976
  }
12977
+ #folders(port, device, folders) {
12978
+ const heading = `folders-${device.id}`;
12979
+ return b`<div class="folders" data-folders>
12980
+ <span class="muted" id=${heading}>Folders</span>
12981
+ <ul aria-labelledby=${heading}>${folders.map((folder2) => this.#folder(port, device, folder2))}</ul>
12982
+ </div>`;
12983
+ }
12984
+ #folder(port, device, folder2) {
12985
+ const action = `folder:${folder2.source}`;
12986
+ const busy = this.busy === action;
12987
+ const button = folder2.mounted ? port.ejectFolder ? b`<swc-button size="s" variant="secondary" fill-style="outline" data-action="eject-folder" data-id=${folder2.source} accessible-label=${`Eject ${folder2.mounted}`} ?pending=${busy} ?disabled=${this.#waiting(action)} @click=${() => this.#act(action, () => port.ejectFolder?.(folder2.source), "linksError")}>Eject</swc-button>` : A : port.mountFolder ? b`<swc-button size="s" variant="secondary" fill-style="outline" data-action="mount-folder" data-id=${folder2.source} accessible-label=${`Mount ${folder2.source}`} ?pending=${busy} ?disabled=${this.#waiting(action) || device.state !== "connected"} @click=${() => this.#act(action, () => this.#mountFolder(port, folder2.source), "linksError")}>Mount</swc-button>` : A;
12988
+ return b`<li data-folder=${folder2.source} data-mounted=${folder2.mounted ? "yes" : "no"}>
12989
+ <swc-icon-folder size="s" aria-hidden="true"></swc-icon-folder>
12990
+ <span class="folder">
12991
+ <code title=${folder2.source}>${folder2.name}</code>
12992
+ ${folder2.readonly ? b`<swc-badge size="s" variant="neutral" subtle data-readonly>Read-only</swc-badge>` : A}
12993
+ ${folder2.mounted ? b`<span class="muted" data-mounted-at>Mounted at <code>${folder2.mounted}</code></span>` : A}
12994
+ </span>
12995
+ ${button}
12996
+ </li>`;
12997
+ }
12998
+ async #mountFolder(port, source) {
12999
+ await port.mountFolder?.(source);
13000
+ }
12915
13001
  #join(port, links) {
12916
13002
  const ready = links.joinCommand || links.joinUrl;
12917
13003
  const follow = links.followUrl;