@lincyaw/workspace 1.0.0-rc.53 → 1.0.0-rc.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lincyaw/workspace",
3
- "version": "1.0.0-rc.53",
3
+ "version": "1.0.0-rc.55",
4
4
  "description": "Presmium's workspace service (presmium serve): documents, their history, reviews and the workspace site",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -34,12 +34,12 @@
34
34
  "mime-types": "3.0.2",
35
35
  "playwright-chromium": "1.64.1",
36
36
  "yaml": "^2.9.1",
37
- "@lincyaw/compiler": "1.0.0-rc.53",
38
- "@lincyaw/server": "1.0.0-rc.53",
39
- "@lincyaw/kernel": "1.0.0-rc.53"
37
+ "@lincyaw/compiler": "1.0.0-rc.55",
38
+ "@lincyaw/kernel": "1.0.0-rc.55",
39
+ "@lincyaw/server": "1.0.0-rc.55"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/mime-types": "^3.0.1",
43
- "@lincyaw/mcp": "1.0.0-rc.53"
43
+ "@lincyaw/mcp": "1.0.0-rc.55"
44
44
  }
45
45
  }
@@ -70,7 +70,7 @@ export function createAuthoringClients(editor: SourceEditor, options: { reviewRe
70
70
  if (!validateAuthoringClientQuery(query)) throw new RequestError(400, 'client-query-invalid')
71
71
  const all = [...clients.values()].filter(client => client.member === member.id && client.value.document === document && (!query.clientId || client.value.clientId === query.clientId)
72
72
  && (!query.after || client.value.clientId > query.after)).sort((a, b) => a.value.clientId.localeCompare(b.value.clientId))
73
- const answer = { document, clients: [] as AuthoringClientDescriptor[], unavailable: ['new-comment-restore', 'active-comment-discard', 'other-form-drafts', 'review', 'open-document', ...options.reviewRequired ? ['source-writes-require-review'] : []] }
73
+ const answer = { document, clients: [] as AuthoringClientDescriptor[], unavailable: ['other-form-drafts', 'review', 'open-document', ...options.reviewRequired ? ['source-writes-require-review'] : []] }
74
74
  for (const client of all) {
75
75
  const row = structuredClone(client.value)
76
76
  row.snapshot.actions = row.snapshot.actions.filter(type => !requiresReview(type))
@@ -203,8 +203,9 @@ export function createAuthoringClients(editor: SourceEditor, options: { reviewRe
203
203
  if (action.type === 'production-drafts.discard' && (result.type !== action.type || result.draft !== action.draft || !result.discarded)) throw new RequestError(400, 'client-result-invalid')
204
204
  const sameComment = (a: import('@lincyaw/kernel').ClientCommentDraftReference | null, b: import('@lincyaw/kernel').ClientCommentDraftReference | null) => a === null || b === null ? a === b
205
205
  : a.id === b.id && a.revision === b.revision && a.token === b.token
206
- if (action.type === 'comment-drafts.restore' && (result.type !== action.type || !sameComment(result.draft, action.draft) || result.composerId !== action.composerId
207
- || !sameComment(result.preservedCurrent, action.expectedCurrent) || result.restored.revision !== 1 || result.restored.id === action.draft.id || result.restored.id === action.expectedCurrent?.id)) throw new RequestError(400, 'client-result-invalid')
206
+ if (action.type === 'comment-drafts.restore' && (result.type !== action.type || !sameComment(result.draft, action.draft)
207
+ || action.composerId !== undefined && (result.composerId !== action.composerId || !sameComment(result.preservedCurrent, action.expectedCurrent ?? null))
208
+ || result.restored.revision !== 1 || result.restored.id === action.draft.id || result.restored.id === result.preservedCurrent?.id)) throw new RequestError(400, 'client-result-invalid')
208
209
  if (action.type === 'comment-drafts.discard' && (result.type !== action.type || !sameComment(result.draft, action.draft) || !result.discarded)) throw new RequestError(400, 'client-result-invalid')
209
210
  const sameDraft = (a: import('@lincyaw/kernel').ClientComponentDraftReference | null, b: import('@lincyaw/kernel').ClientComponentDraftReference | null) => a === null || b === null ? a === b
210
211
  : a.id === b.id && a.revision === b.revision && a.token === b.token && a.blockId === b.blockId && a.stepId === b.stepId