markloom 0.5.1 → 0.6.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.
Files changed (67) hide show
  1. package/PACKAGES.md +26 -0
  2. package/README.md +20 -2
  3. package/collab.md +42 -7
  4. package/dist/ai/index.cjs +4 -4
  5. package/dist/ai/index.d.cts +5 -4
  6. package/dist/ai/index.d.ts +5 -4
  7. package/dist/ai/index.js +3 -3
  8. package/dist/ai/theme.css +66 -102
  9. package/dist/{chunk-VXM7Q6P5.cjs → chunk-ACFYBYZJ.cjs} +2604 -966
  10. package/dist/chunk-CGYCJORO.js +759 -0
  11. package/dist/chunk-EADZKEU4.cjs +498 -0
  12. package/dist/chunk-EJSFZHGT.js +24 -0
  13. package/dist/{chunk-YIFOGP2D.cjs → chunk-I5VK4U7J.cjs} +103 -60
  14. package/dist/{chunk-ZMTLSFLO.js → chunk-KYZJIOOL.js} +2138 -500
  15. package/dist/chunk-QEVME6ZU.cjs +759 -0
  16. package/dist/{chunk-MFYF2A6U.js → chunk-SNFF6X45.js} +51 -1
  17. package/dist/{chunk-FCH7LZFI.js → chunk-TB2OY3D4.js} +50 -7
  18. package/dist/{chunk-4TMHVNL6.cjs → chunk-TWD5T4YC.cjs} +155 -105
  19. package/dist/{chunk-JS527FDV.cjs → chunk-U3JZDFL4.cjs} +49 -9
  20. package/dist/{chunk-RLTHVQNQ.js → chunk-VSBIMMI7.js} +45 -5
  21. package/dist/chunk-YBAT343I.js +498 -0
  22. package/dist/chunk-ZKQSQSSM.cjs +24 -0
  23. package/dist/{client-ZRZj2nkq.d.cts → client-CLYq17SW.d.ts} +63 -7
  24. package/dist/{client-6KiH4kGK.d.ts → client-DAth8pPq.d.cts} +63 -7
  25. package/dist/collab/index.cjs +16 -4
  26. package/dist/collab/index.d.cts +19 -6
  27. package/dist/collab/index.d.ts +19 -6
  28. package/dist/collab/index.js +18 -6
  29. package/dist/{controller-BNuuUM3E.d.ts → controller-6AJ36G52.d.ts} +99 -7
  30. package/dist/{controller-DQITsFhy.d.cts → controller-BIOO_XKJ.d.cts} +99 -7
  31. package/dist/index.cjs +57 -7
  32. package/dist/index.d.cts +18 -5
  33. package/dist/index.d.ts +18 -5
  34. package/dist/index.js +54 -4
  35. package/dist/io/index.cjs +1413 -0
  36. package/dist/io/index.d.cts +33 -0
  37. package/dist/io/index.d.ts +33 -0
  38. package/dist/io/index.js +1413 -0
  39. package/dist/react/index.cjs +8 -8
  40. package/dist/react/index.d.cts +5 -4
  41. package/dist/react/index.d.ts +5 -4
  42. package/dist/react/index.js +7 -7
  43. package/dist/{rebase-batch-8rL_aXEE.d.ts → rebase-batch-DlerAcFN.d.ts} +11 -9
  44. package/dist/{rebase-batch-bYnBJpRO.d.cts → rebase-batch-PjENQ742.d.cts} +11 -9
  45. package/dist/suggest-Bk4zLzuv.d.ts +120 -0
  46. package/dist/suggest-BkGGiPKA.d.cts +120 -0
  47. package/dist/types-COUweEav.d.cts +30 -0
  48. package/dist/types-COUweEav.d.ts +30 -0
  49. package/dist/versions-9mG1epfB.d.cts +51 -0
  50. package/dist/versions-Bubyo4pt.d.ts +51 -0
  51. package/dist/view/index.cjs +56 -12
  52. package/dist/view/index.d.cts +203 -11
  53. package/dist/view/index.d.ts +203 -11
  54. package/dist/view/index.js +52 -8
  55. package/dist/view/theme.css +1829 -1587
  56. package/io.md +38 -0
  57. package/package.json +21 -5
  58. package/dist/chunk-4JSJAHTB.js +0 -255
  59. package/dist/chunk-ALZ3A5CS.cjs +0 -255
  60. package/dist/chunk-GQ2HHRGI.cjs +0 -16
  61. package/dist/chunk-LA5SBCGQ.js +0 -16
  62. package/dist/chunk-LEYAQNJA.js +0 -220
  63. package/dist/chunk-YXQDCW4Y.cjs +0 -220
  64. package/dist/comments-DlExS6f-.d.cts +0 -43
  65. package/dist/comments-PhnR7Gkn.d.ts +0 -43
  66. package/dist/step-BrvHIK7O.d.cts +0 -65
  67. package/dist/step-BrvHIK7O.d.ts +0 -65
@@ -0,0 +1,24 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined") return require.apply(this, arguments);
5
+ throw Error('Dynamic require of "' + x + '" is not supported');
6
+ });
7
+
8
+ // src/tree/types.ts
9
+ function isText(n) {
10
+ return n != null && typeof n === "object" && "text" in n;
11
+ }
12
+ function isElement(n) {
13
+ return n != null && typeof n === "object" && "children" in n;
14
+ }
15
+ function isInlineAtom(n) {
16
+ return isElement(n) && (n.type === "mention" || n.type === "hard_break" || n.type === "math");
17
+ }
18
+
19
+
20
+
21
+
22
+
23
+
24
+ exports.__require = __require; exports.isText = isText; exports.isElement = isElement; exports.isInlineAtom = isInlineAtom;
@@ -1,4 +1,5 @@
1
- import { P as Path, E as ElementNode, S as Step } from './step-BrvHIK7O.cjs';
1
+ import { P as Path, E as ElementNode } from './types-COUweEav.js';
2
+ import { S as Step, a as DocVersion } from './versions-Bubyo4pt.js';
2
3
 
3
4
  /** 光标/选区在协议里的轻量形态(path + offset,无 assoc) */
4
5
  type WireSel = {
@@ -24,6 +25,8 @@ type ClientJoin = {
24
25
  color?: string;
25
26
  /** 空房时用客户端 doc 初始化 */
26
27
  seed?: ElementNode;
28
+ /** 可选鉴权(worker COLLAB_TOKEN 启用时必填) */
29
+ token?: string;
27
30
  };
28
31
  type ClientOp = {
29
32
  type: 'op';
@@ -40,13 +43,24 @@ type ClientPresence = {
40
43
  type ClientPing = {
41
44
  type: 'ping';
42
45
  };
43
- type ClientMsg = ClientJoin | ClientOp | ClientPresence | ClientPing;
46
+ /** 命名版本侧信道(不进 OT doc version) */
47
+ type ClientVersionSave = {
48
+ type: 'version-save';
49
+ version: DocVersion;
50
+ };
51
+ type ClientVersionRemove = {
52
+ type: 'version-remove';
53
+ id: string;
54
+ };
55
+ type ClientMsg = ClientJoin | ClientOp | ClientPresence | ClientPing | ClientVersionSave | ClientVersionRemove;
44
56
  type ServerWelcome = {
45
57
  type: 'welcome';
46
58
  siteId: number;
47
59
  version: number;
48
60
  doc: ElementNode;
49
61
  peers: PeerInfo[];
62
+ /** 房间内命名版本快照列表 */
63
+ versions?: DocVersion[];
50
64
  };
51
65
  type ServerOp = {
52
66
  type: 'op';
@@ -84,8 +98,14 @@ type ServerError = {
84
98
  type ServerPong = {
85
99
  type: 'pong';
86
100
  };
87
- type ServerMsg = ServerWelcome | ServerOp | ServerPresence | ServerPeerJoin | ServerPeerLeave | ServerResync | ServerError | ServerPong;
101
+ /** 全量版本列表(save/remove 后广播;welcome 亦可带) */
102
+ type ServerVersions = {
103
+ type: 'versions';
104
+ versions: DocVersion[];
105
+ };
106
+ type ServerMsg = ServerWelcome | ServerOp | ServerPresence | ServerPeerJoin | ServerPeerLeave | ServerResync | ServerError | ServerPong | ServerVersions;
88
107
 
108
+ type CollabStatus = 'connecting' | 'open' | 'closed' | 'resyncing' | 'auth-error';
89
109
  type CollabConfig = {
90
110
  /** ws(s)://host 或 http(s)://host(自动改 scheme) */
91
111
  url: string;
@@ -94,12 +114,27 @@ type CollabConfig = {
94
114
  color?: string;
95
115
  /** 空房初始化文档;默认由 Editor 传入当前 doc */
96
116
  seed?: ElementNode;
117
+ /**
118
+ * 鉴权钩:静态 token 或每次 join 取一次(可 async)。
119
+ * worker 设 COLLAB_TOKEN 时服务端校验;未设则忽略。
120
+ */
121
+ token?: string | (() => string | Promise<string>);
122
+ /**
123
+ * 头像条挂载点(应用壳顶栏,类似日期条)。
124
+ * 不传则插在 editor root 内 sticky 顶(lab 默认)。
125
+ */
126
+ railParent?: () => HTMLElement | null;
127
+ /** 连接状态(connecting/open/closed/resyncing/auth-error) */
128
+ onStatus?: (s: CollabStatus) => void;
129
+ /** 服务端强制 resync(版本落后 / rebase 失败) */
130
+ onResync?: (version: number) => void;
131
+ onError?: (message: string) => void;
97
132
  };
98
133
  type CollabHandlers = {
99
134
  /** 权威快照(welcome / resync) */
100
135
  onDoc: (doc: ElementNode, version: number) => void;
101
- /** 已变换的远端 steps,应 applyRemote */
102
- onRemote: (steps: Step[]) => void;
136
+ /** 已变换的远端 steps + 作者 siteId,应 applyRemote(不入本端 undo 栈) */
137
+ onRemote: (steps: Step[], siteId: number) => void;
103
138
  /** 进房成功(分配 siteId,可画本人头像) */
104
139
  onWelcome?: (info: {
105
140
  siteId: number;
@@ -108,7 +143,11 @@ type CollabHandlers = {
108
143
  color?: string;
109
144
  }) => void;
110
145
  onPeers?: (peers: PeerInfo[]) => void;
111
- onStatus?: (s: 'connecting' | 'open' | 'closed') => void;
146
+ onStatus?: (s: CollabStatus) => void;
147
+ /** 即将应用权威快照(resync 路径) */
148
+ onResync?: (version: number) => void;
149
+ /** 房间命名版本列表(welcome / 远端 save·remove) */
150
+ onVersions?: (versions: DocVersion[]) => void;
112
151
  onError?: (message: string) => void;
113
152
  };
114
153
  /**
@@ -122,6 +161,9 @@ declare class CollabClient {
122
161
  private closed;
123
162
  private retry;
124
163
  private reconnectTimer;
164
+ private pingTimer;
165
+ private lastPong;
166
+ private authFailed;
125
167
  siteId: number;
126
168
  version: number;
127
169
  private clientSeq;
@@ -130,15 +172,29 @@ declare class CollabClient {
130
172
  private joined;
131
173
  constructor(cfg: CollabConfig, handlers: CollabHandlers);
132
174
  get peersList(): PeerInfo[];
175
+ get status(): CollabStatus;
133
176
  private connect;
177
+ private sendJoin;
178
+ private startHeartbeat;
179
+ private stopHeartbeat;
134
180
  private scheduleReconnect;
135
181
  private send;
136
182
  private onServer;
137
183
  /** 本地已 apply 的 steps 推上服务器 */
138
184
  push(steps: Step[]): void;
185
+ /** 命名版本上行(侧信道,不进 OT) */
186
+ pushVersion(v: DocVersion): void;
187
+ removeVersion(id: string): void;
188
+ /** 用一批 steps 搬所有 peer 的 wire 选区(作者打字时彩光标贴字) */
189
+ private mapPeerSelsThrough;
190
+ /**
191
+ * 作者无历史 presence 时,从本批最后一次 insertText 推光标到插入末尾。
192
+ * 有 sel 时 mapPeerSelsThrough 已搬过,不再覆盖。
193
+ */
194
+ private ensureAuthorCaret;
139
195
  presence(sel: WireSel | null): void;
140
196
  close(): void;
141
197
  }
142
198
  declare function connectCollab(cfg: CollabConfig, handlers: CollabHandlers): CollabClient;
143
199
 
144
- export { type ClientJoin as C, type PeerInfo as P, type ServerMsg as S, type WireSel as W, type ClientMsg as a, type ClientOp as b, CollabClient as c, type CollabConfig as d, type CollabHandlers as e, type ServerOp as f, type ServerWelcome as g, connectCollab as h };
200
+ export { type ClientJoin as C, type PeerInfo as P, type ServerMsg as S, type WireSel as W, type ClientMsg as a, type ClientOp as b, CollabClient as c, type CollabConfig as d, type CollabHandlers as e, type CollabStatus as f, type ServerOp as g, type ServerWelcome as h, connectCollab as i };
@@ -1,4 +1,5 @@
1
- import { P as Path, E as ElementNode, S as Step } from './step-BrvHIK7O.js';
1
+ import { P as Path, E as ElementNode } from './types-COUweEav.cjs';
2
+ import { S as Step, a as DocVersion } from './versions-9mG1epfB.cjs';
2
3
 
3
4
  /** 光标/选区在协议里的轻量形态(path + offset,无 assoc) */
4
5
  type WireSel = {
@@ -24,6 +25,8 @@ type ClientJoin = {
24
25
  color?: string;
25
26
  /** 空房时用客户端 doc 初始化 */
26
27
  seed?: ElementNode;
28
+ /** 可选鉴权(worker COLLAB_TOKEN 启用时必填) */
29
+ token?: string;
27
30
  };
28
31
  type ClientOp = {
29
32
  type: 'op';
@@ -40,13 +43,24 @@ type ClientPresence = {
40
43
  type ClientPing = {
41
44
  type: 'ping';
42
45
  };
43
- type ClientMsg = ClientJoin | ClientOp | ClientPresence | ClientPing;
46
+ /** 命名版本侧信道(不进 OT doc version) */
47
+ type ClientVersionSave = {
48
+ type: 'version-save';
49
+ version: DocVersion;
50
+ };
51
+ type ClientVersionRemove = {
52
+ type: 'version-remove';
53
+ id: string;
54
+ };
55
+ type ClientMsg = ClientJoin | ClientOp | ClientPresence | ClientPing | ClientVersionSave | ClientVersionRemove;
44
56
  type ServerWelcome = {
45
57
  type: 'welcome';
46
58
  siteId: number;
47
59
  version: number;
48
60
  doc: ElementNode;
49
61
  peers: PeerInfo[];
62
+ /** 房间内命名版本快照列表 */
63
+ versions?: DocVersion[];
50
64
  };
51
65
  type ServerOp = {
52
66
  type: 'op';
@@ -84,8 +98,14 @@ type ServerError = {
84
98
  type ServerPong = {
85
99
  type: 'pong';
86
100
  };
87
- type ServerMsg = ServerWelcome | ServerOp | ServerPresence | ServerPeerJoin | ServerPeerLeave | ServerResync | ServerError | ServerPong;
101
+ /** 全量版本列表(save/remove 后广播;welcome 亦可带) */
102
+ type ServerVersions = {
103
+ type: 'versions';
104
+ versions: DocVersion[];
105
+ };
106
+ type ServerMsg = ServerWelcome | ServerOp | ServerPresence | ServerPeerJoin | ServerPeerLeave | ServerResync | ServerError | ServerPong | ServerVersions;
88
107
 
108
+ type CollabStatus = 'connecting' | 'open' | 'closed' | 'resyncing' | 'auth-error';
89
109
  type CollabConfig = {
90
110
  /** ws(s)://host 或 http(s)://host(自动改 scheme) */
91
111
  url: string;
@@ -94,12 +114,27 @@ type CollabConfig = {
94
114
  color?: string;
95
115
  /** 空房初始化文档;默认由 Editor 传入当前 doc */
96
116
  seed?: ElementNode;
117
+ /**
118
+ * 鉴权钩:静态 token 或每次 join 取一次(可 async)。
119
+ * worker 设 COLLAB_TOKEN 时服务端校验;未设则忽略。
120
+ */
121
+ token?: string | (() => string | Promise<string>);
122
+ /**
123
+ * 头像条挂载点(应用壳顶栏,类似日期条)。
124
+ * 不传则插在 editor root 内 sticky 顶(lab 默认)。
125
+ */
126
+ railParent?: () => HTMLElement | null;
127
+ /** 连接状态(connecting/open/closed/resyncing/auth-error) */
128
+ onStatus?: (s: CollabStatus) => void;
129
+ /** 服务端强制 resync(版本落后 / rebase 失败) */
130
+ onResync?: (version: number) => void;
131
+ onError?: (message: string) => void;
97
132
  };
98
133
  type CollabHandlers = {
99
134
  /** 权威快照(welcome / resync) */
100
135
  onDoc: (doc: ElementNode, version: number) => void;
101
- /** 已变换的远端 steps,应 applyRemote */
102
- onRemote: (steps: Step[]) => void;
136
+ /** 已变换的远端 steps + 作者 siteId,应 applyRemote(不入本端 undo 栈) */
137
+ onRemote: (steps: Step[], siteId: number) => void;
103
138
  /** 进房成功(分配 siteId,可画本人头像) */
104
139
  onWelcome?: (info: {
105
140
  siteId: number;
@@ -108,7 +143,11 @@ type CollabHandlers = {
108
143
  color?: string;
109
144
  }) => void;
110
145
  onPeers?: (peers: PeerInfo[]) => void;
111
- onStatus?: (s: 'connecting' | 'open' | 'closed') => void;
146
+ onStatus?: (s: CollabStatus) => void;
147
+ /** 即将应用权威快照(resync 路径) */
148
+ onResync?: (version: number) => void;
149
+ /** 房间命名版本列表(welcome / 远端 save·remove) */
150
+ onVersions?: (versions: DocVersion[]) => void;
112
151
  onError?: (message: string) => void;
113
152
  };
114
153
  /**
@@ -122,6 +161,9 @@ declare class CollabClient {
122
161
  private closed;
123
162
  private retry;
124
163
  private reconnectTimer;
164
+ private pingTimer;
165
+ private lastPong;
166
+ private authFailed;
125
167
  siteId: number;
126
168
  version: number;
127
169
  private clientSeq;
@@ -130,15 +172,29 @@ declare class CollabClient {
130
172
  private joined;
131
173
  constructor(cfg: CollabConfig, handlers: CollabHandlers);
132
174
  get peersList(): PeerInfo[];
175
+ get status(): CollabStatus;
133
176
  private connect;
177
+ private sendJoin;
178
+ private startHeartbeat;
179
+ private stopHeartbeat;
134
180
  private scheduleReconnect;
135
181
  private send;
136
182
  private onServer;
137
183
  /** 本地已 apply 的 steps 推上服务器 */
138
184
  push(steps: Step[]): void;
185
+ /** 命名版本上行(侧信道,不进 OT) */
186
+ pushVersion(v: DocVersion): void;
187
+ removeVersion(id: string): void;
188
+ /** 用一批 steps 搬所有 peer 的 wire 选区(作者打字时彩光标贴字) */
189
+ private mapPeerSelsThrough;
190
+ /**
191
+ * 作者无历史 presence 时,从本批最后一次 insertText 推光标到插入末尾。
192
+ * 有 sel 时 mapPeerSelsThrough 已搬过,不再覆盖。
193
+ */
194
+ private ensureAuthorCaret;
139
195
  presence(sel: WireSel | null): void;
140
196
  close(): void;
141
197
  }
142
198
  declare function connectCollab(cfg: CollabConfig, handlers: CollabHandlers): CollabClient;
143
199
 
144
- export { type ClientJoin as C, type PeerInfo as P, type ServerMsg as S, type WireSel as W, type ClientMsg as a, type ClientOp as b, CollabClient as c, type CollabConfig as d, type CollabHandlers as e, type ServerOp as f, type ServerWelcome as g, connectCollab as h };
200
+ export { type ClientJoin as C, type PeerInfo as P, type ServerMsg as S, type WireSel as W, type ClientMsg as a, type ClientOp as b, CollabClient as c, type CollabConfig as d, type CollabHandlers as e, type CollabStatus as f, type ServerOp as g, type ServerWelcome as h, connectCollab as i };
@@ -4,22 +4,34 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkALZ3A5CScjs = require('../chunk-ALZ3A5CS.cjs');
8
7
 
9
8
 
10
9
 
11
10
 
12
11
 
13
- var _chunkJS527FDVcjs = require('../chunk-JS527FDV.cjs');
14
- require('../chunk-GQ2HHRGI.cjs');
12
+ var _chunkEADZKEU4cjs = require('../chunk-EADZKEU4.cjs');
15
13
 
16
14
 
17
15
 
18
16
 
19
17
 
20
18
 
19
+ var _chunkU3JZDFL4cjs = require('../chunk-U3JZDFL4.cjs');
20
+ require('../chunk-ZKQSQSSM.cjs');
21
21
 
22
22
 
23
23
 
24
24
 
25
- exports.COLLAB_COLORS = _chunkALZ3A5CScjs.COLLAB_COLORS; exports.CollabClient = _chunkALZ3A5CScjs.CollabClient; exports.collabColor = _chunkALZ3A5CScjs.collabColor; exports.collabInitial = _chunkALZ3A5CScjs.collabInitial; exports.connectCollab = _chunkALZ3A5CScjs.connectCollab; exports.rebaseBatchOver = _chunkJS527FDVcjs.rebaseBatchOver; exports.rebaseOne = _chunkJS527FDVcjs.rebaseOne; exports.rebaseStepsThrough = _chunkJS527FDVcjs.rebaseStepsThrough; exports.transformRemoteAgainstPending = _chunkJS527FDVcjs.transformRemoteAgainstPending;
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+ exports.COLLAB_CARET_COLORS = _chunkEADZKEU4cjs.COLLAB_CARET_COLORS; exports.COLLAB_COLORS = _chunkEADZKEU4cjs.COLLAB_COLORS; exports.CollabClient = _chunkEADZKEU4cjs.CollabClient; exports.collabCaretColor = _chunkEADZKEU4cjs.collabCaretColor; exports.collabColor = _chunkEADZKEU4cjs.collabColor; exports.collabFg = _chunkEADZKEU4cjs.collabFg; exports.collabInitial = _chunkEADZKEU4cjs.collabInitial; exports.collabLuma = _chunkEADZKEU4cjs.collabLuma; exports.connectCollab = _chunkEADZKEU4cjs.connectCollab; exports.rebaseBatchOver = _chunkU3JZDFL4cjs.rebaseBatchOver; exports.rebaseOne = _chunkU3JZDFL4cjs.rebaseOne; exports.rebaseStepsThrough = _chunkU3JZDFL4cjs.rebaseStepsThrough; exports.solidify = _chunkEADZKEU4cjs.solidify; exports.transformRemoteAgainstPending = _chunkU3JZDFL4cjs.transformRemoteAgainstPending; exports.transformSeqThroughOne = _chunkU3JZDFL4cjs.transformSeqThroughOne;
@@ -1,11 +1,24 @@
1
- export { C as ClientJoin, a as ClientMsg, b as ClientOp, c as CollabClient, d as CollabConfig, e as CollabHandlers, P as PeerInfo, S as ServerMsg, f as ServerOp, g as ServerWelcome, W as WireSel, h as connectCollab } from '../client-ZRZj2nkq.cjs';
2
- export { r as rebaseBatchOver, a as rebaseOne, b as rebaseStepsThrough, t as transformRemoteAgainstPending } from '../rebase-batch-bYnBJpRO.cjs';
3
- import '../step-BrvHIK7O.cjs';
1
+ export { C as ClientJoin, a as ClientMsg, b as ClientOp, c as CollabClient, d as CollabConfig, e as CollabHandlers, f as CollabStatus, P as PeerInfo, S as ServerMsg, g as ServerOp, h as ServerWelcome, W as WireSel, i as connectCollab } from '../client-DAth8pPq.cjs';
2
+ export { r as rebaseBatchOver, a as rebaseOne, b as rebaseStepsThrough, t as transformRemoteAgainstPending, c as transformSeqThroughOne } from '../rebase-batch-PjENQ742.cjs';
3
+ import '../types-COUweEav.cjs';
4
+ import '../versions-9mG1epfB.cjs';
4
5
 
5
- /** 协作用户色板(飞书/Notion 式高饱和,互不撞) */
6
- declare const COLLAB_COLORS: readonly ["#3370ff", "#f54a45", "#ff8800", "#00b578", "#7b61ff", "#e13edb", "#14c0ff", "#8f959e", "#d83931", "#2ea121"];
6
+ /**
7
+ * 协作轮流色 — 对齐飞书「字体高亮色」色相顺序(去掉「无」与近白)。
8
+ * 浅色用于头像/名牌底;光标条用 collabCaretColor 加实,避免白底发虚。
9
+ */
10
+ declare const COLLAB_COLORS: readonly ["#ffd6d6", "#ffe8b8", "#d4f0c8", "#c8e4ff", "#e0d4f5", "#d0d0d0", "#6b6b6b", "#e85d4c", "#f5a623", "#f0c040", "#34b33a", "#3b6ff5", "#7c5cff"];
11
+ /** 同序加实色 — 光标竖条专用(同色相、更高饱和/更实) */
12
+ declare const COLLAB_CARET_COLORS: readonly ["#f06a6a", "#e09a20", "#3db84a", "#3d8cf0", "#8b6ef0", "#8a8a8a", "#4a4a4a", "#e03d30", "#f09000", "#e0a800", "#1f9e28", "#2f5ff0", "#6a48f0"];
7
13
  declare function collabColor(siteId: number, explicit?: string): string;
14
+ /** 光标竖条/描边:浅色会发虚,用同序实色;显式 color 则压实 */
15
+ declare function collabCaretColor(siteId: number, explicit?: string): string;
16
+ /** 浅色压实:保色相、压亮度,白底上竖条仍利落 */
17
+ declare function solidify(hex: string): string;
18
+ /** 相对亮度 0..1(sRGB 近似);浅色头像用深字 */
19
+ declare function collabLuma(hex: string): number;
20
+ declare function collabFg(bg: string): string;
8
21
  /** 头像一字:优先首字/首字母 */
9
22
  declare function collabInitial(name?: string, siteId?: number): string;
10
23
 
11
- export { COLLAB_COLORS, collabColor, collabInitial };
24
+ export { COLLAB_CARET_COLORS, COLLAB_COLORS, collabCaretColor, collabColor, collabFg, collabInitial, collabLuma, solidify };
@@ -1,11 +1,24 @@
1
- export { C as ClientJoin, a as ClientMsg, b as ClientOp, c as CollabClient, d as CollabConfig, e as CollabHandlers, P as PeerInfo, S as ServerMsg, f as ServerOp, g as ServerWelcome, W as WireSel, h as connectCollab } from '../client-6KiH4kGK.js';
2
- export { r as rebaseBatchOver, a as rebaseOne, b as rebaseStepsThrough, t as transformRemoteAgainstPending } from '../rebase-batch-8rL_aXEE.js';
3
- import '../step-BrvHIK7O.js';
1
+ export { C as ClientJoin, a as ClientMsg, b as ClientOp, c as CollabClient, d as CollabConfig, e as CollabHandlers, f as CollabStatus, P as PeerInfo, S as ServerMsg, g as ServerOp, h as ServerWelcome, W as WireSel, i as connectCollab } from '../client-CLYq17SW.js';
2
+ export { r as rebaseBatchOver, a as rebaseOne, b as rebaseStepsThrough, t as transformRemoteAgainstPending, c as transformSeqThroughOne } from '../rebase-batch-DlerAcFN.js';
3
+ import '../types-COUweEav.js';
4
+ import '../versions-Bubyo4pt.js';
4
5
 
5
- /** 协作用户色板(飞书/Notion 式高饱和,互不撞) */
6
- declare const COLLAB_COLORS: readonly ["#3370ff", "#f54a45", "#ff8800", "#00b578", "#7b61ff", "#e13edb", "#14c0ff", "#8f959e", "#d83931", "#2ea121"];
6
+ /**
7
+ * 协作轮流色 — 对齐飞书「字体高亮色」色相顺序(去掉「无」与近白)。
8
+ * 浅色用于头像/名牌底;光标条用 collabCaretColor 加实,避免白底发虚。
9
+ */
10
+ declare const COLLAB_COLORS: readonly ["#ffd6d6", "#ffe8b8", "#d4f0c8", "#c8e4ff", "#e0d4f5", "#d0d0d0", "#6b6b6b", "#e85d4c", "#f5a623", "#f0c040", "#34b33a", "#3b6ff5", "#7c5cff"];
11
+ /** 同序加实色 — 光标竖条专用(同色相、更高饱和/更实) */
12
+ declare const COLLAB_CARET_COLORS: readonly ["#f06a6a", "#e09a20", "#3db84a", "#3d8cf0", "#8b6ef0", "#8a8a8a", "#4a4a4a", "#e03d30", "#f09000", "#e0a800", "#1f9e28", "#2f5ff0", "#6a48f0"];
7
13
  declare function collabColor(siteId: number, explicit?: string): string;
14
+ /** 光标竖条/描边:浅色会发虚,用同序实色;显式 color 则压实 */
15
+ declare function collabCaretColor(siteId: number, explicit?: string): string;
16
+ /** 浅色压实:保色相、压亮度,白底上竖条仍利落 */
17
+ declare function solidify(hex: string): string;
18
+ /** 相对亮度 0..1(sRGB 近似);浅色头像用深字 */
19
+ declare function collabLuma(hex: string): number;
20
+ declare function collabFg(bg: string): string;
8
21
  /** 头像一字:优先首字/首字母 */
9
22
  declare function collabInitial(name?: string, siteId?: number): string;
10
23
 
11
- export { COLLAB_COLORS, collabColor, collabInitial };
24
+ export { COLLAB_CARET_COLORS, COLLAB_COLORS, collabCaretColor, collabColor, collabFg, collabInitial, collabLuma, solidify };
@@ -1,25 +1,37 @@
1
1
  import {
2
+ COLLAB_CARET_COLORS,
2
3
  COLLAB_COLORS,
3
4
  CollabClient,
5
+ collabCaretColor,
4
6
  collabColor,
7
+ collabFg,
5
8
  collabInitial,
6
- connectCollab
7
- } from "../chunk-4JSJAHTB.js";
9
+ collabLuma,
10
+ connectCollab,
11
+ solidify
12
+ } from "../chunk-YBAT343I.js";
8
13
  import {
9
14
  rebaseBatchOver,
10
15
  rebaseOne,
11
16
  rebaseStepsThrough,
12
- transformRemoteAgainstPending
13
- } from "../chunk-RLTHVQNQ.js";
14
- import "../chunk-LA5SBCGQ.js";
17
+ transformRemoteAgainstPending,
18
+ transformSeqThroughOne
19
+ } from "../chunk-VSBIMMI7.js";
20
+ import "../chunk-EJSFZHGT.js";
15
21
  export {
22
+ COLLAB_CARET_COLORS,
16
23
  COLLAB_COLORS,
17
24
  CollabClient,
25
+ collabCaretColor,
18
26
  collabColor,
27
+ collabFg,
19
28
  collabInitial,
29
+ collabLuma,
20
30
  connectCollab,
21
31
  rebaseBatchOver,
22
32
  rebaseOne,
23
33
  rebaseStepsThrough,
24
- transformRemoteAgainstPending
34
+ solidify,
35
+ transformRemoteAgainstPending,
36
+ transformSeqThroughOne
25
37
  };