@fileverse-dev/dsheet 4.0.5-edit-mode-13 → 4.0.5-edit-mode-14

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.
@@ -1,5 +1,60 @@
1
- import { E as a, S as n } from "./crypto-constants-ZTlAYRUf.js";
2
- const E = a, d = n, f = [
1
+ import { E as a, S as l } from "./crypto-constants-ZTlAYRUf.js";
2
+ const s = "#9CA3AF", c = [
3
+ "#30bced",
4
+ "#6eeb83",
5
+ "#fa69d1",
6
+ "#ecd444",
7
+ "#ee6352",
8
+ "#db3041",
9
+ "#0ad7f2",
10
+ "#1bff39"
11
+ ];
12
+ function E(o) {
13
+ const t = /* @__PURE__ */ new Map();
14
+ return o.forEach((e) => {
15
+ const n = e == null ? void 0 : e.socketId, r = e == null ? void 0 : e.user;
16
+ typeof n == "string" && r && t.set(n, {
17
+ name: r.name ?? "",
18
+ color: r.color ?? s,
19
+ isEns: r.isEns ?? ""
20
+ });
21
+ }), t;
22
+ }
23
+ function S(o, t) {
24
+ const e = o.map((r) => {
25
+ const i = t.get(r);
26
+ return i ? {
27
+ clientId: r,
28
+ name: i.name,
29
+ color: i.color,
30
+ isEns: i.isEns,
31
+ isPlaceholder: !1
32
+ } : {
33
+ clientId: r,
34
+ name: "",
35
+ color: s,
36
+ isEns: "",
37
+ isPlaceholder: !0
38
+ };
39
+ });
40
+ e.sort((r, i) => !!r.isPlaceholder != !!i.isPlaceholder ? r.isPlaceholder ? 1 : -1 : String(r.clientId).localeCompare(String(i.clientId)));
41
+ const n = /* @__PURE__ */ new Set();
42
+ return e.filter((r) => r.isPlaceholder || !r.name ? !0 : n.has(r.name) ? !1 : (n.add(r.name), !0));
43
+ }
44
+ function h(o, t) {
45
+ return o.forEach((e) => {
46
+ if (e.isPlaceholder || !e.name) return;
47
+ let n = t.get(e.name);
48
+ n || (n = c[t.size % c.length], t.set(e.name, n)), e.color = n;
49
+ }), o;
50
+ }
51
+ function _(o, t) {
52
+ return o.slice().sort().map((e) => {
53
+ const n = t.get(e);
54
+ return n ? `${e}:${n.name}:${n.isEns}` : `${e}:?`;
55
+ }).join("|");
56
+ }
57
+ const g = a, p = l, C = [
3
58
  {
4
59
  id: "0",
5
60
  name: "Sheet1",
@@ -7,7 +62,7 @@ const E = a, d = n, f = [
7
62
  config: {},
8
63
  order: 0
9
64
  }
10
- ], m = [
65
+ ], A = [
11
66
  "undo",
12
67
  "redo",
13
68
  "format-painter",
@@ -45,7 +100,7 @@ const E = a, d = n, f = [
45
100
  "quick-formula",
46
101
  "dataVerification",
47
102
  "search"
48
- ], u = [
103
+ ], L = [
49
104
  "cut",
50
105
  "copy",
51
106
  "paste",
@@ -82,7 +137,7 @@ const E = a, d = n, f = [
82
137
  "freeze-row",
83
138
  "|",
84
139
  "clear-format"
85
- ], S = [
140
+ ], R = [
86
141
  "cut",
87
142
  "copy",
88
143
  "paste",
@@ -119,41 +174,36 @@ const E = a, d = n, f = [
119
174
  "freeze-column",
120
175
  "|",
121
176
  "clear-format"
122
- ], _ = {
177
+ ], w = {
123
178
  height: null,
124
179
  isShow: !1,
125
180
  left: null,
126
181
  top: null,
127
182
  value: "",
128
183
  width: null
129
- }, l = "#5298FF", r = [
130
- "#30bced",
131
- "#6eeb83",
132
- "#fa69d1",
133
- "#ecd444",
134
- "#ee6352",
135
- "#db3041",
136
- "#0ad7f2",
137
- "#1bff39"
138
- ];
139
- function c(e) {
140
- return r[e % r.length];
184
+ }, u = "#5298FF";
185
+ function d(o) {
186
+ return c[o % c.length];
141
187
  }
142
- function i() {
188
+ function f() {
143
189
  return "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0");
144
190
  }
145
- function h(e, o, t) {
146
- return e ? l : o ?? (t != null ? c(t) : i());
191
+ function O(o, t, e) {
192
+ return t || (o ? u : e != null ? d(e) : f());
147
193
  }
148
194
  export {
149
- _ as C,
150
- f as D,
151
- E,
152
- S as H,
153
- d as S,
154
- m as T,
155
- r as a,
156
- u as b,
157
- l as c,
158
- h as p
195
+ w as C,
196
+ C as D,
197
+ g as E,
198
+ R as H,
199
+ p as S,
200
+ A as T,
201
+ h as a,
202
+ E as b,
203
+ c,
204
+ L as d,
205
+ u as e,
206
+ _ as i,
207
+ S as m,
208
+ O as p
159
209
  };
@@ -1,5 +1,5 @@
1
1
  export { ERROR_MESSAGES_FLAG, SERVICES_API_KEY, } from './editor/constants/shared-constants';
2
+ export { COLLAB_PRESENCE_COLORS } from './sync-local/presence';
2
3
  export declare const ENS_PRESENCE_COLOR = "#5298FF";
3
- export declare const COLLAB_PRESENCE_COLORS: readonly ["#30bced", "#6eeb83", "#fa69d1", "#ecd444", "#ee6352", "#db3041", "#0ad7f2", "#1bff39"];
4
- /** ENS brand color, else `color`, else palette by `clientId`, else random. */
4
+ /** Explicit awareness color, else ENS brand color, palette, or random fallback. */
5
5
  export declare function presenceColor(isEns: boolean | undefined, color?: string, clientId?: number): string;
package/dist/constants.js CHANGED
@@ -1,8 +1,8 @@
1
- import { a as R, c as _, E as C, S as a, p as s } from "./constants-CRFfbkoQ.js";
1
+ import { c as R, e as _, E as C, S as s, p as O } from "./constants-DUN0oTKe.js";
2
2
  export {
3
3
  R as COLLAB_PRESENCE_COLORS,
4
4
  _ as ENS_PRESENCE_COLOR,
5
5
  C as ERROR_MESSAGES_FLAG,
6
- a as SERVICES_API_KEY,
7
- s as presenceColor
6
+ s as SERVICES_API_KEY,
7
+ O as presenceColor
8
8
  };