@tangle-network/sandbox-ui 0.3.11 → 0.3.12

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.
@@ -10753,6 +10753,21 @@ function connectionLabel(state) {
10753
10753
  return "Offline";
10754
10754
  }
10755
10755
  }
10756
+ function connectionDescription(state, collaborators, readOnly) {
10757
+ if (readOnly) {
10758
+ return state === "disconnected" ? "Live access is paused. You can keep reading while the editor reconnects." : "You are viewing the live document in read-only mode.";
10759
+ }
10760
+ switch (state) {
10761
+ case "synced":
10762
+ return collaborators > 0 ? `You and ${collaborators} collaborator${collaborators === 1 ? "" : "s"} are editing the same document.` : "You are editing the live document. Changes sync automatically.";
10763
+ case "connected":
10764
+ case "connecting":
10765
+ return "Connecting the live document. Local edits stay in place while sync catches up.";
10766
+ case "disconnected":
10767
+ default:
10768
+ return "Live updates are paused. You can keep editing and reconnect when the transport is healthy again.";
10769
+ }
10770
+ }
10756
10771
  function CollaborativeDocumentSurface({
10757
10772
  markdown,
10758
10773
  placeholder,
@@ -10764,26 +10779,30 @@ function CollaborativeDocumentSurface({
10764
10779
  const { state } = useEditorConnection();
10765
10780
  const { collaborators } = useCollaborators();
10766
10781
  const initialContent = useMemo4(() => markdownToHtml(markdown), [markdown]);
10782
+ const collaboratorCount = collaborators.length + 1;
10767
10783
  return /* @__PURE__ */ jsxs3("div", { className: cn("flex h-full min-h-0 flex-col gap-3", className), children: [
10768
10784
  /* @__PURE__ */ jsxs3("div", { className: "flex flex-wrap items-center justify-between gap-3 rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--bg-card)]/80 px-3 py-2", children: [
10769
- /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 text-xs text-[var(--text-muted)]", children: [
10770
- /* @__PURE__ */ jsxs3(
10771
- "span",
10772
- {
10773
- className: cn(
10774
- "inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 font-medium",
10775
- connectionTone(state)
10776
- ),
10777
- children: [
10778
- state === "disconnected" ? /* @__PURE__ */ jsx5(WifiOff, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx5(Wifi, { className: "h-3.5 w-3.5" }),
10779
- connectionLabel(state)
10780
- ]
10781
- }
10782
- ),
10783
- /* @__PURE__ */ jsxs3("span", { className: "inline-flex items-center gap-1.5 rounded-full border border-[var(--border-subtle)] bg-[var(--bg-input)] px-2.5 py-1", children: [
10784
- /* @__PURE__ */ jsx5(Users, { className: "h-3.5 w-3.5" }),
10785
- collaborators.length === 0 ? "Solo editing" : `${collaborators.length + 1} active`
10786
- ] })
10785
+ /* @__PURE__ */ jsxs3("div", { className: "min-w-0 space-y-2", children: [
10786
+ /* @__PURE__ */ jsxs3("div", { className: "flex flex-wrap items-center gap-2 text-xs text-[var(--text-muted)]", children: [
10787
+ /* @__PURE__ */ jsxs3(
10788
+ "span",
10789
+ {
10790
+ className: cn(
10791
+ "inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 font-medium",
10792
+ connectionTone(state)
10793
+ ),
10794
+ children: [
10795
+ state === "disconnected" ? /* @__PURE__ */ jsx5(WifiOff, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx5(Wifi, { className: "h-3.5 w-3.5" }),
10796
+ connectionLabel(state)
10797
+ ]
10798
+ }
10799
+ ),
10800
+ /* @__PURE__ */ jsxs3("span", { className: "inline-flex items-center gap-1.5 rounded-full border border-[var(--border-subtle)] bg-[var(--bg-input)] px-2.5 py-1", children: [
10801
+ /* @__PURE__ */ jsx5(Users, { className: "h-3.5 w-3.5" }),
10802
+ collaborators.length === 0 ? "Solo editing" : `${collaboratorCount} active`
10803
+ ] })
10804
+ ] }),
10805
+ /* @__PURE__ */ jsx5("p", { className: "text-xs text-[var(--text-muted)]", children: connectionDescription(state, collaborators.length, readOnly) })
10787
10806
  ] }),
10788
10807
  /* @__PURE__ */ jsx5(CollaboratorsList, { collaborators })
10789
10808
  ] }),
@@ -10834,6 +10853,7 @@ function DocumentEditorPane({
10834
10853
  const activeMode = mode ?? uncontrolledMode;
10835
10854
  const isCollaborative = backend === "collaborative" && Boolean(collaboration);
10836
10855
  const isDirty = normalizeMarkdown(draft) !== normalizeMarkdown(markdown);
10856
+ const saveStateLabel = readOnly ? "Read only" : isCollaborative ? isDirty ? "Snapshot pending" : "Live document current" : isDirty ? "Unsaved changes" : "Saved";
10837
10857
  useEffect5(() => {
10838
10858
  setDraft(markdown);
10839
10859
  }, [markdown]);
@@ -10885,8 +10905,8 @@ function DocumentEditorPane({
10885
10905
  ),
10886
10906
  /* @__PURE__ */ jsxs3("div", { className: "flex flex-wrap items-center gap-2 text-xs text-[var(--text-muted)]", children: [
10887
10907
  toolbar,
10888
- /* @__PURE__ */ jsx5("span", { className: "rounded-full border border-[var(--border-subtle)] bg-[var(--bg-card)] px-2.5 py-1 font-medium", children: isCollaborative ? "Collaborative" : "Local draft" }),
10889
- isDirty && /* @__PURE__ */ jsx5("span", { children: "Unsaved changes" }),
10908
+ /* @__PURE__ */ jsx5("span", { className: "rounded-full border border-[var(--border-subtle)] bg-[var(--bg-card)] px-2.5 py-1 font-medium", children: isCollaborative ? "Live document" : "Local draft" }),
10909
+ /* @__PURE__ */ jsx5("span", { className: "rounded-full border border-[var(--border-subtle)] bg-[var(--bg-input)] px-2.5 py-1", children: saveStateLabel }),
10890
10910
  onSave && !readOnly && /* @__PURE__ */ jsxs3(
10891
10911
  "button",
10892
10912
  {
@@ -484,7 +484,7 @@ import { lazy, Suspense } from "react";
484
484
  import { Download as Download2, X as X3 } from "lucide-react";
485
485
  import { Fragment, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
486
486
  var LazyDocumentEditorPane = lazy(async () => {
487
- const module = await import("./document-editor-pane-AFBP2KFT.js");
487
+ const module = await import("./document-editor-pane-AVKKXSLG.js");
488
488
  return { default: module.DocumentEditorPane };
489
489
  });
490
490
  function FileArtifactPane({
@@ -18,7 +18,7 @@ import {
18
18
  FileArtifactPane,
19
19
  FileTree,
20
20
  filterFileTree
21
- } from "./chunk-6NYG2R7V.js";
21
+ } from "./chunk-IAIJUFM6.js";
22
22
  import {
23
23
  ArtifactPane
24
24
  } from "./chunk-W4LM3QYZ.js";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  DocumentEditorPane
4
- } from "./chunk-BOBXH6CH.js";
4
+ } from "./chunk-4HT5J6CE.js";
5
5
  import "./chunk-Q56BYXQF.js";
6
6
  import "./chunk-W4LM3QYZ.js";
7
7
  import "./chunk-LTFK464G.js";
package/dist/editor.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  useEditorConnection,
12
12
  useEditorContext,
13
13
  useYjsState
14
- } from "./chunk-BOBXH6CH.js";
14
+ } from "./chunk-4HT5J6CE.js";
15
15
  import "./chunk-Q56BYXQF.js";
16
16
  import "./chunk-W4LM3QYZ.js";
17
17
  import "./chunk-LTFK464G.js";
package/dist/files.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  FileTabs,
5
5
  FileTree,
6
6
  filterFileTree
7
- } from "./chunk-6NYG2R7V.js";
7
+ } from "./chunk-IAIJUFM6.js";
8
8
  import "./chunk-W4LM3QYZ.js";
9
9
  import "./chunk-LTFK464G.js";
10
10
  import "./chunk-RQHJBTEU.js";
package/dist/index.js CHANGED
@@ -89,7 +89,7 @@ import {
89
89
  StatusBar,
90
90
  TerminalPanel,
91
91
  WorkspaceLayout
92
- } from "./chunk-CREVWUCA.js";
92
+ } from "./chunk-QMKWQF6F.js";
93
93
  import "./chunk-OEX7NZE3.js";
94
94
  import {
95
95
  EmptyState,
@@ -158,7 +158,7 @@ import {
158
158
  FileTabs,
159
159
  FileTree,
160
160
  filterFileTree
161
- } from "./chunk-6NYG2R7V.js";
161
+ } from "./chunk-IAIJUFM6.js";
162
162
  import {
163
163
  ArtifactPane
164
164
  } from "./chunk-W4LM3QYZ.js";
package/dist/workspace.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  StatusBar,
11
11
  TerminalPanel,
12
12
  WorkspaceLayout
13
- } from "./chunk-CREVWUCA.js";
13
+ } from "./chunk-QMKWQF6F.js";
14
14
  import "./chunk-OEX7NZE3.js";
15
15
  import "./chunk-MUOL44AE.js";
16
16
  import "./chunk-6H3EFUUC.js";
@@ -21,7 +21,7 @@ import "./chunk-CJ2RYVZH.js";
21
21
  import "./chunk-BX6AQMUS.js";
22
22
  import "./chunk-YDBXQQLC.js";
23
23
  import "./chunk-TQN3VR4F.js";
24
- import "./chunk-6NYG2R7V.js";
24
+ import "./chunk-IAIJUFM6.js";
25
25
  import {
26
26
  ArtifactPane
27
27
  } from "./chunk-W4LM3QYZ.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox-ui",
3
- "version": "0.3.11",
3
+ "version": "0.3.12",
4
4
  "description": "Unified UI component library for Tangle Sandbox — primitives, chat, dashboard, terminal, editor, and workspace components",
5
5
  "repository": {
6
6
  "type": "git",