@atom.io/template-react-realtime-text-editor 0.0.17 → 0.0.19

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @atom.io/template-react-realtime-text-editor
2
2
 
3
+ ## 0.0.19
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [3281c91]
8
+ - atom.io@0.54.7
9
+ - @atom.io/react@0.2.1
10
+ - @atom.io/realtime@0.1.2
11
+
12
+ ## 0.0.18
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [4b4c19a]
17
+ - Updated dependencies [90f634c]
18
+ - Updated dependencies [5f84875]
19
+ - Updated dependencies [b166670]
20
+ - Updated dependencies [ffbb22d]
21
+ - Updated dependencies [06c8a0c]
22
+ - Updated dependencies [90f634c]
23
+ - Updated dependencies [4349006]
24
+ - Updated dependencies [90f634c]
25
+ - Updated dependencies [8b43951]
26
+ - Updated dependencies [ccefaca]
27
+ - atom.io@0.54.6
28
+ - @atom.io/realtime@0.1.2
29
+ - @atom.io/react@0.2.1
30
+
3
31
  ## 0.0.17
4
32
 
5
33
  ### Patch Changes
package/node/service.ts CHANGED
@@ -42,13 +42,12 @@ import {
42
42
  type MarkdownCommand,
43
43
  } from "../src/protocol.ts"
44
44
 
45
- export type MarkdownDocumentInstrumentation =
46
- MosaicTextDocumentInstrumentation & {
47
- readonly activeFullDocumentModels: 1
48
- readonly maximumFullDocumentModels: 1
49
- }
45
+ type MarkdownDocumentInstrumentation = MosaicTextDocumentInstrumentation & {
46
+ readonly activeFullDocumentModels: 1
47
+ readonly maximumFullDocumentModels: 1
48
+ }
50
49
 
51
- export type MarkdownDocumentRangeInspection = MosaicTextDocumentRangeInspection
50
+ type MarkdownDocumentRangeInspection = MosaicTextDocumentRangeInspection
52
51
 
53
52
  export type MarkdownDocumentService = Disposable & {
54
53
  bindSocket(options: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atom.io/template-react-realtime-text-editor",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "description": "A realtime text editor built with atom.io, React, and Lasertag.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,11 +10,11 @@
10
10
  "license": "Apache-2.0",
11
11
  "type": "module",
12
12
  "dependencies": {
13
- "@atom.io/react": "0.2.0",
14
- "@atom.io/realtime": "0.1.1",
13
+ "@atom.io/react": "0.2.1",
14
+ "@atom.io/realtime": "0.1.2",
15
15
  "@lexical/react": "0.53.0",
16
16
  "@lexical/selection": "0.53.0",
17
- "atom.io": "0.54.5",
17
+ "atom.io": "0.54.7",
18
18
  "lexical": "0.53.0",
19
19
  "react": "19.3.1",
20
20
  "react-dom": "19.3.1",
@@ -23,11 +23,11 @@
23
23
  "zod": "4.6.7"
24
24
  },
25
25
  "devDependencies": {
26
- "@atom.io/eslint-plugin": "0.1.1",
27
- "@dprint/json": "0.25.2",
28
- "@dprint/markdown": "0.28.2",
29
- "@dprint/oxc": "0.49.0",
30
- "@playwright/test": "1.64.1",
26
+ "@atom.io/eslint-plugin": "0.1.2",
27
+ "@dprint/json": "0.26.0",
28
+ "@dprint/markdown": "0.29.0",
29
+ "@dprint/oxc": "0.49.1",
30
+ "@playwright/test": "1.65.0",
31
31
  "@testing-library/dom": "10.4.2",
32
32
  "@testing-library/react": "16.3.3",
33
33
  "@types/node": "26.6.6",
@@ -36,16 +36,16 @@
36
36
  "@typescript-eslint/parser": "8.72.1",
37
37
  "@typescript/native": "npm:typescript@7.0.2",
38
38
  "@vitejs/plugin-react": "6.2.1",
39
- "concurrently": "10.0.6",
39
+ "concurrently": "10.0.7",
40
40
  "dprint": "0.64.3",
41
41
  "dprint-plugin-malva": "0.16.0",
42
42
  "eslint": "10.14.0",
43
43
  "happy-dom": "21.0.4",
44
- "lasertag": "0.8.10",
45
- "oxlint": "1.91.0",
46
- "oxlint-tsgolint": "7.0.2005",
44
+ "lasertag": "0.8.11",
45
+ "oxlint": "1.92.0",
46
+ "oxlint-tsgolint": "7.0.2006",
47
47
  "typescript": "npm:@typescript/typescript6@6.0.2",
48
- "vite": "8.3.5",
48
+ "vite": "8.3.6",
49
49
  "vitest": "5.1.0"
50
50
  },
51
51
  "engines": {
@@ -31,7 +31,7 @@ export const MarkdownText = mosaicText({
31
31
  maximumRunsPerOperation: 65_536,
32
32
  })
33
33
 
34
- export const {
34
+ const {
35
35
  emptyIndexRoot: EMPTY_MARKDOWN_INDEX_ROOT,
36
36
  indexMemberModel: markdownIndexMemberModel,
37
37
  indexMemberSchema: markdownIndexMemberSchema,
@@ -44,6 +44,14 @@ export const {
44
44
  text: MarkdownText,
45
45
  })
46
46
 
47
+ /** @internal Used by implementation tests. */
48
+ export {
49
+ EMPTY_MARKDOWN_INDEX_ROOT,
50
+ markdownIndexMemberModel,
51
+ markdownIndexRootModel,
52
+ markdownSourceModel,
53
+ }
54
+
47
55
  const id = z.string().min(1).max(512)
48
56
  const emptyIndexMember = (memberId: string): MosaicTextIndexMember => ({
49
57
  fragments: [],
@@ -56,10 +64,12 @@ const emptyIndexMember = (memberId: string): MosaicTextIndexMember => ({
56
64
  export const markdownSourceAtom = mutableAtom<InstanceType<typeof MarkdownText>>(
57
65
  { class: MarkdownText, key: `markdownSource` },
58
66
  )
67
+ /** @internal Used by implementation tests. */
59
68
  export const markdownIndexRootAtom = atom<MosaicTextIndexRoot>({
60
69
  default: EMPTY_MARKDOWN_INDEX_ROOT,
61
70
  key: `markdownIndexRoot`,
62
71
  })
72
+ /** @internal Used by implementation tests. */
63
73
  export const markdownIndexMemberAtoms = atomFamily<
64
74
  MosaicTextIndexMember,
65
75
  string
@@ -88,7 +98,7 @@ const relativePosition = z
88
98
  })
89
99
  .strict()
90
100
 
91
- export const markdownPresenceSchema: z.ZodType<MarkdownPresence> = z
101
+ const markdownPresenceSchema: z.ZodType<MarkdownPresence> = z
92
102
  .object({
93
103
  actor: id,
94
104
  color: z.string().min(1).max(64),
@@ -105,14 +115,15 @@ export const markdownPresenceSchema: z.ZodType<MarkdownPresence> = z
105
115
  })
106
116
  .strict()
107
117
 
108
- export const markdownPresenceAtoms = atomFamily<MarkdownPresence | null, string>(
109
- { default: null, key: `markdownPresence` },
110
- )
118
+ const markdownPresenceAtoms = atomFamily<MarkdownPresence | null, string>({
119
+ default: null,
120
+ key: `markdownPresence`,
121
+ })
111
122
  export const markdownPresenceKey = (
112
123
  identity: Pick<MarkdownPresence, `actor` | `session`>,
113
124
  ): string => `${identity.actor}\u0000${identity.session}`
114
125
 
115
- export const markdownDocumentDomain = mosaicDomain({
126
+ const markdownDocumentDomain = mosaicDomain({
116
127
  configSchema: z.object({}).strict(),
117
128
  key: `markdown-document`,
118
129
  members: {
package/src/identities.ts CHANGED
@@ -17,7 +17,3 @@ export function identityById(id: string | null | undefined): Identity {
17
17
  SIMULATED_IDENTITIES[0]
18
18
  )
19
19
  }
20
-
21
- export function identityFromUserKey(userKey: string): Identity {
22
- return identityById(userKey.replace(/^user::/, ``).split(`::`)[0])
23
- }
package/src/protocol.ts CHANGED
@@ -1,7 +1,4 @@
1
- import type {
2
- MosaicTextIndexRange,
3
- MosaicTextRelativePosition,
4
- } from "@atom.io/realtime"
1
+ import type { MosaicTextRelativePosition } from "@atom.io/realtime"
5
2
 
6
3
  export const MARKDOWN_EVENTS = {
7
4
  command: `markdown-domain:command`,
@@ -14,7 +11,7 @@ export type MarkdownAcknowledgement<Value> =
14
11
  | { readonly ok: true; readonly value: Value }
15
12
  | { readonly ok: false; readonly reason: string }
16
13
 
17
- export type MarkdownEditCommand = {
14
+ type MarkdownEditCommand = {
18
15
  readonly anchor: MosaicTextRelativePosition
19
16
  readonly gestureId: string
20
17
  readonly head: MosaicTextRelativePosition
@@ -23,7 +20,7 @@ export type MarkdownEditCommand = {
23
20
  readonly type: `replace`
24
21
  }
25
22
 
26
- export type MarkdownImportCommand = {
23
+ type MarkdownImportCommand = {
27
24
  readonly gestureId: string
28
25
  readonly sequence: number
29
26
  readonly text: string
@@ -31,5 +28,3 @@ export type MarkdownImportCommand = {
31
28
  }
32
29
 
33
30
  export type MarkdownCommand = MarkdownEditCommand | MarkdownImportCommand
34
-
35
- export type MarkdownViewport = MosaicTextIndexRange
package/src/session.ts CHANGED
@@ -14,13 +14,6 @@ export function getBrowserSession(): { clientId: string; identity: Identity } {
14
14
  return { clientId, identity }
15
15
  }
16
16
 
17
- export function realtimeAuth(
18
- identity: Identity,
19
- clientId: string,
20
- ): { sessionId: string; userId: string } {
21
- return { sessionId: clientId, userId: identity.id }
22
- }
23
-
24
17
  export function switchBrowserIdentity(identityId: string): void {
25
18
  window.localStorage.setItem(IDENTITY_KEY, identityId)
26
19
  const url = new URL(window.location.href)
@@ -21,12 +21,12 @@ import {
21
21
  type MarkdownVirtualWindow,
22
22
  } from "./virtualization.ts"
23
23
 
24
- export type MarkdownScrollViewport = {
24
+ type MarkdownScrollViewport = {
25
25
  readonly height: number
26
26
  readonly scrollTop: number
27
27
  }
28
28
 
29
- export type MarkdownWorkspacePeer = {
29
+ type MarkdownWorkspacePeer = {
30
30
  readonly id: string
31
31
  readonly selection: MosaicTextSelection | null
32
32
  readonly value: MarkdownPresence
@@ -56,7 +56,7 @@ export type MarkdownWorkspaceState = Disposable & {
56
56
  setScroll(viewport: MarkdownScrollViewport, defer: boolean): void
57
57
  }
58
58
 
59
- export const EMPTY_PARSE_METRICS: MarkdownParseInstrumentation = {
59
+ const EMPTY_PARSE_METRICS: MarkdownParseInstrumentation = {
60
60
  canceled: false,
61
61
  elapsedMs: 0,
62
62
  parsedBlocks: 0,