@inkandswitch/patchwork-pkg-base 0.0.54 → 0.0.55

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.
@@ -8359,26 +8359,6 @@ function urlFromText(line) {
8359
8359
 
8360
8360
  // src/CollaboratorCursor.tsx
8361
8361
  var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
8362
- var USER_COLOR_PALETTE = [
8363
- "hsl(200, 70%, 50%)",
8364
- "hsl(10, 75%, 58%)",
8365
- "hsl(145, 70%, 45%)",
8366
- "hsl(270, 70%, 55%)",
8367
- "hsl(38, 85%, 50%)",
8368
- "hsl(350, 70%, 55%)",
8369
- "hsl(178, 70%, 45%)",
8370
- "hsl(235, 70%, 58%)",
8371
- "hsl(85, 70%, 45%)",
8372
- "hsl(310, 70%, 55%)",
8373
- "hsl(25, 80%, 52%)",
8374
- "hsl(188, 75%, 48%)"
8375
- ];
8376
- function generateColorFromString(str) {
8377
- const hash = Math.abs(
8378
- str.split("").reduce((acc, char) => acc + char.charCodeAt(0), 0)
8379
- );
8380
- return USER_COLOR_PALETTE[hash % USER_COLOR_PALETTE.length];
8381
- }
8382
8362
  function splitPresenceUserId(userId) {
8383
8363
  if (!userId.startsWith("automerge:")) return { actorId: userId };
8384
8364
  const i = userId.indexOf("-");
@@ -8500,9 +8480,9 @@ function useContactInfo() {
8500
8480
  // this prevents tldraw from hiding local cursors across multiple sessions under the same account.
8501
8481
  userId: contactUrl ? `${contactUrl}-${repo.peerId}` : repo.peerId,
8502
8482
  name: contactDoc?.name ?? "Anonymous",
8503
- // Derived from the contact url with the same rule the contact-cursor
8504
- // token uses, so the cursor arrow and the token always match.
8505
- color: contactUrl ? generateColorFromString(contactUrl) : void 0
8483
+ // The color chosen in the account picker; it rides along in our presence
8484
+ // record, so the cursor arrow always matches the contact-cursor token.
8485
+ color: contactDoc?.color
8506
8486
  };
8507
8487
  }
8508
8488
  function TldrawTool({