@tldraw/editor 3.10.0-canary.3bf31007c5a7 → 3.10.0-canary.407ba01017c1

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,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/hooks/usePeerIds.ts"],
4
- "sourcesContent": ["import { useComputed, useValue } from '@tldraw/state-react'\nimport { uniq } from '../utils/uniq'\nimport { useEditor } from './useEditor'\n\n// TODO: maybe move this to a computed property on the App class?\n/**\n * @returns The list of peer UserIDs\n * @internal\n */\nexport function usePeerIds() {\n\tconst editor = useEditor()\n\n\tconst $userIds = useComputed(\n\t\t'userIds',\n\t\t() => uniq(editor.getCollaborators().map((p) => p.userId)).sort(),\n\t\t{ isEqual: (a, b) => a.join(',') === b.join?.(',') },\n\t\t[editor]\n\t)\n\n\treturn useValue($userIds)\n}\n"],
4
+ "sourcesContent": ["import { useComputed, useValue } from '@tldraw/state-react'\nimport { uniq } from '../utils/uniq'\nimport { useEditor } from './useEditor'\n\n// TODO: maybe move this to a computed property on the App class?\n/**\n * @returns The list of peer UserIDs\n * @public\n */\nexport function usePeerIds() {\n\tconst editor = useEditor()\n\n\tconst $userIds = useComputed(\n\t\t'userIds',\n\t\t() => uniq(editor.getCollaborators().map((p) => p.userId)).sort(),\n\t\t{ isEqual: (a, b) => a.join(',') === b.join?.(',') },\n\t\t[editor]\n\t)\n\n\treturn useValue($userIds)\n}\n"],
5
5
  "mappings": "AAAA,SAAS,aAAa,gBAAgB;AACtC,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAOnB,SAAS,aAAa;AAC5B,QAAM,SAAS,UAAU;AAEzB,QAAM,WAAW;AAAA,IAChB;AAAA,IACA,MAAM,KAAK,OAAO,iBAAiB,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK;AAAA,IAChE,EAAE,SAAS,CAAC,GAAG,MAAM,EAAE,KAAK,GAAG,MAAM,EAAE,OAAO,GAAG,EAAE;AAAA,IACnD,CAAC,MAAM;AAAA,EACR;AAEA,SAAO,SAAS,QAAQ;AACzB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/hooks/usePresence.ts"],
4
- "sourcesContent": ["import { useValue } from '@tldraw/state-react'\nimport { TLInstancePresence } from '@tldraw/tlschema'\nimport { useEditor } from './useEditor'\n\n// TODO: maybe move this to a computed property on the App class?\n/**\n * @returns The list of peer UserIDs\n * @internal\n */\nexport function usePresence(userId: string): TLInstancePresence | null {\n\tconst editor = useEditor()\n\n\tconst latestPresence = useValue(\n\t\t`latestPresence:${userId}`,\n\t\t() => {\n\t\t\treturn editor.getCollaborators().find((c) => c.userId === userId)\n\t\t},\n\t\t[editor, userId]\n\t)\n\n\treturn latestPresence ?? null\n}\n"],
4
+ "sourcesContent": ["import { useValue } from '@tldraw/state-react'\nimport { TLInstancePresence } from '@tldraw/tlschema'\nimport { useEditor } from './useEditor'\n\n// TODO: maybe move this to a computed property on the App class?\n/**\n * @returns The latest presence of the user matching userId\n * @public\n */\nexport function usePresence(userId: string): TLInstancePresence | null {\n\tconst editor = useEditor()\n\n\tconst latestPresence = useValue(\n\t\t`latestPresence:${userId}`,\n\t\t() => {\n\t\t\treturn editor.getCollaborators().find((c) => c.userId === userId)\n\t\t},\n\t\t[editor, userId]\n\t)\n\n\treturn latestPresence ?? null\n}\n"],
5
5
  "mappings": "AAAA,SAAS,gBAAgB;AAEzB,SAAS,iBAAiB;AAOnB,SAAS,YAAY,QAA2C;AACtE,QAAM,SAAS,UAAU;AAEzB,QAAM,iBAAiB;AAAA,IACtB,kBAAkB,MAAM;AAAA,IACxB,MAAM;AACL,aAAO,OAAO,iBAAiB,EAAE,KAAK,CAAC,MAAM,EAAE,WAAW,MAAM;AAAA,IACjE;AAAA,IACA,CAAC,QAAQ,MAAM;AAAA,EAChB;AAEA,SAAO,kBAAkB;AAC1B;",
6
6
  "names": []
7
7
  }
@@ -1,8 +1,8 @@
1
- const version = "3.10.0-canary.3bf31007c5a7";
1
+ const version = "3.10.0-canary.407ba01017c1";
2
2
  const publishDates = {
3
3
  major: "2024-09-13T14:36:29.063Z",
4
- minor: "2025-03-03T14:30:27.310Z",
5
- patch: "2025-03-03T14:30:27.310Z"
4
+ minor: "2025-03-04T13:35:29.429Z",
5
+ patch: "2025-03-04T13:35:29.429Z"
6
6
  };
7
7
  export {
8
8
  publishDates,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/version.ts"],
4
- "sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '3.10.0-canary.3bf31007c5a7'\nexport const publishDates = {\n\tmajor: '2024-09-13T14:36:29.063Z',\n\tminor: '2025-03-03T14:30:27.310Z',\n\tpatch: '2025-03-03T14:30:27.310Z',\n}\n"],
4
+ "sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '3.10.0-canary.407ba01017c1'\nexport const publishDates = {\n\tmajor: '2024-09-13T14:36:29.063Z',\n\tminor: '2025-03-04T13:35:29.429Z',\n\tpatch: '2025-03-04T13:35:29.429Z',\n}\n"],
5
5
  "mappings": "AAGO,MAAM,UAAU;AAChB,MAAM,eAAe;AAAA,EAC3B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACR;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tldraw/editor",
3
3
  "description": "A tiny little drawing app (editor).",
4
- "version": "3.10.0-canary.3bf31007c5a7",
4
+ "version": "3.10.0-canary.407ba01017c1",
5
5
  "author": {
6
6
  "name": "tldraw Inc.",
7
7
  "email": "hello@tldraw.com"
@@ -48,12 +48,12 @@
48
48
  "@tiptap/core": "^2.9.1",
49
49
  "@tiptap/pm": "^2.9.1",
50
50
  "@tiptap/react": "^2.9.1",
51
- "@tldraw/state": "3.10.0-canary.3bf31007c5a7",
52
- "@tldraw/state-react": "3.10.0-canary.3bf31007c5a7",
53
- "@tldraw/store": "3.10.0-canary.3bf31007c5a7",
54
- "@tldraw/tlschema": "3.10.0-canary.3bf31007c5a7",
55
- "@tldraw/utils": "3.10.0-canary.3bf31007c5a7",
56
- "@tldraw/validate": "3.10.0-canary.3bf31007c5a7",
51
+ "@tldraw/state": "3.10.0-canary.407ba01017c1",
52
+ "@tldraw/state-react": "3.10.0-canary.407ba01017c1",
53
+ "@tldraw/store": "3.10.0-canary.407ba01017c1",
54
+ "@tldraw/tlschema": "3.10.0-canary.407ba01017c1",
55
+ "@tldraw/utils": "3.10.0-canary.407ba01017c1",
56
+ "@tldraw/validate": "3.10.0-canary.407ba01017c1",
57
57
  "@types/core-js": "^2.5.8",
58
58
  "@use-gesture/react": "^10.3.1",
59
59
  "classnames": "^2.5.1",
@@ -92,7 +92,6 @@ import {
92
92
  structuredClone,
93
93
  uniqueId,
94
94
  } from '@tldraw/utils'
95
- import { Number } from 'core-js'
96
95
  import EventEmitter from 'eventemitter3'
97
96
  import {
98
97
  TLEditorSnapshot,
@@ -5,7 +5,7 @@ import { useEditor } from './useEditor'
5
5
  // TODO: maybe move this to a computed property on the App class?
6
6
  /**
7
7
  * @returns The list of peer UserIDs
8
- * @internal
8
+ * @public
9
9
  */
10
10
  export function usePeerIds() {
11
11
  const editor = useEditor()
@@ -4,8 +4,8 @@ import { useEditor } from './useEditor'
4
4
 
5
5
  // TODO: maybe move this to a computed property on the App class?
6
6
  /**
7
- * @returns The list of peer UserIDs
8
- * @internal
7
+ * @returns The latest presence of the user matching userId
8
+ * @public
9
9
  */
10
10
  export function usePresence(userId: string): TLInstancePresence | null {
11
11
  const editor = useEditor()
package/src/version.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  // This file is automatically generated by internal/scripts/refresh-assets.ts.
2
2
  // Do not edit manually. Or do, I'm a comment, not a cop.
3
3
 
4
- export const version = '3.10.0-canary.3bf31007c5a7'
4
+ export const version = '3.10.0-canary.407ba01017c1'
5
5
  export const publishDates = {
6
6
  major: '2024-09-13T14:36:29.063Z',
7
- minor: '2025-03-03T14:30:27.310Z',
8
- patch: '2025-03-03T14:30:27.310Z',
7
+ minor: '2025-03-04T13:35:29.429Z',
8
+ patch: '2025-03-04T13:35:29.429Z',
9
9
  }