@a3s-lab/office 0.7.2 → 0.7.3

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,8 +1,9 @@
1
1
  import type { Editor } from '@tiptap/core';
2
2
  import type { WorkDocumentLayoutFont } from '../work-document-fonts';
3
- export declare function DocumentSelectionToolbar({ editor, canInsertComment, layoutFonts, onInsertComment, }: {
3
+ export declare function DocumentSelectionToolbar({ editor, canInsertComment, layoutFonts, onInsertComment, reviewOnly, }: {
4
4
  editor: Editor;
5
5
  canInsertComment: boolean;
6
6
  layoutFonts?: readonly WorkDocumentLayoutFont[];
7
7
  onInsertComment: () => void;
8
+ reviewOnly?: boolean;
8
9
  }): import("react").JSX.Element;
@@ -14,6 +14,7 @@ export type DocumentViewMode = 'page' | 'web';
14
14
  interface DocumentToolbarProps {
15
15
  editor: Editor;
16
16
  defaultRibbonCollapsed?: boolean;
17
+ reviewOnly?: boolean;
17
18
  history?: {
18
19
  canRedo: boolean;
19
20
  canUndo: boolean;
@@ -73,5 +74,5 @@ interface DocumentToolbarProps {
73
74
  onOpenWordCount: () => void;
74
75
  onOpenFindReplace: (mode: DocumentFindReplaceMode) => void;
75
76
  }
76
- export declare function DocumentToolbar({ editor, defaultRibbonCollapsed, history, layoutOpen, layout, layoutFonts, navigationOpen, pageColor, showPageNumbers, showRulers, spellcheckEnabled, viewMode, zoom, pageChromeEditor, pageChromeEditingPart, pageChromeShowPageNumber, onRequestImage, onPageChromeEditingPartChange, onClosePageChrome, onTogglePageChromePageNumber, onToggleLayout, onLayoutChange, onOpenLayout, onToggleNavigation, onTogglePageNumbers, onToggleRulers, onPageColorChange, onToggleSpellcheck, onViewModeChange, onZoomChange, onZoomFit, onInsertSection, onInsertNote, onInsertCaption, onInsertCrossReference, citationsOpen, citationSourceCount, onToggleCitations, onInsertField, onRefreshFields, canInsertComment, onInsertComment, commentsOpen, commentCount, onToggleComments, trackChanges, changesOpen, changeCount, findReplaceMode, fileActions, onRibbonTabChange, onToggleTrackChanges, onToggleChanges, onOpenWordCount, onOpenFindReplace, }: DocumentToolbarProps): import("react").JSX.Element;
77
+ export declare function DocumentToolbar({ editor, defaultRibbonCollapsed, reviewOnly, history, layoutOpen, layout, layoutFonts, navigationOpen, pageColor, showPageNumbers, showRulers, spellcheckEnabled, viewMode, zoom, pageChromeEditor, pageChromeEditingPart, pageChromeShowPageNumber, onRequestImage, onPageChromeEditingPartChange, onClosePageChrome, onTogglePageChromePageNumber, onToggleLayout, onLayoutChange, onOpenLayout, onToggleNavigation, onTogglePageNumbers, onToggleRulers, onPageColorChange, onToggleSpellcheck, onViewModeChange, onZoomChange, onZoomFit, onInsertSection, onInsertNote, onInsertCaption, onInsertCrossReference, citationsOpen, citationSourceCount, onToggleCitations, onInsertField, onRefreshFields, canInsertComment, onInsertComment, commentsOpen, commentCount, onToggleComments, trackChanges, changesOpen, changeCount, findReplaceMode, fileActions, onRibbonTabChange, onToggleTrackChanges, onToggleChanges, onOpenWordCount, onOpenFindReplace, }: DocumentToolbarProps): import("react").JSX.Element;
77
78
  export {};
@@ -1,8 +1,10 @@
1
1
  import type { Editor } from '@tiptap/core';
2
+ import type { WorkOfficeCollaborationActor } from '../../../collaboration/office-collaboration';
2
3
  import { type WorkDocumentCommentView } from '../work-document-comments';
3
4
  import type { WorkDocumentContent } from '../work-types';
4
5
  import type { DocumentCommentDraft } from './document-comment-composer';
5
6
  export interface DocumentCommentsController {
7
+ canDeleteComment: (id: string) => boolean;
6
8
  canInsert: boolean;
7
9
  close: () => void;
8
10
  closeDraft: (restoreEditorFocus?: boolean) => void;
@@ -17,10 +19,13 @@ export interface DocumentCommentsController {
17
19
  toggleOpen: () => void;
18
20
  toggleResolved: (id: string) => void;
19
21
  }
20
- export declare function useDocumentComments({ contentRef, editor, onBeforeDraft, }: {
22
+ export declare function useDocumentComments({ actor, contentRef, deleteOwnOnly, editor, enabled, onBeforeDraft, }: {
23
+ actor?: WorkOfficeCollaborationActor;
21
24
  contentRef: {
22
25
  current: WorkDocumentContent;
23
26
  };
27
+ deleteOwnOnly?: boolean;
24
28
  editor: Editor | null;
29
+ enabled?: boolean;
25
30
  onBeforeDraft?: () => void;
26
31
  }): DocumentCommentsController;
@@ -7,7 +7,11 @@ export interface WorkDocumentCommentAnchor {
7
7
  to: number;
8
8
  anchorText: string;
9
9
  }
10
- export interface WorkDocumentCommentView extends WorkDocumentComment, WorkDocumentCommentAnchor {
10
+ export interface WorkDocumentCommentView extends WorkDocumentComment {
11
+ from: number | null;
12
+ to: number | null;
13
+ anchorText: string;
14
+ detached: boolean;
11
15
  }
12
16
  export interface WorkDocumentCommentRange {
13
17
  from: number;
@@ -148,12 +148,14 @@ export interface WorkDocumentBibliography {
148
148
  }
149
149
  export interface WorkDocumentCommentReply {
150
150
  id: string;
151
+ actorId?: string;
151
152
  author: string;
152
153
  date: string;
153
154
  text: string;
154
155
  }
155
156
  export interface WorkDocumentComment {
156
157
  id: string;
158
+ actorId?: string;
157
159
  author: string;
158
160
  date: string;
159
161
  text: string;
Binary file
package/dist/styles.css CHANGED
@@ -8742,6 +8742,10 @@ button.work-office-collaboration-participant:hover .work-office-collaboration-lo
8742
8742
  opacity: .64;
8743
8743
  }
8744
8744
 
8745
+ .work-document-comment-track > .work-document-comment-card.detached {
8746
+ border-left-color: var(--a3s-faint);
8747
+ }
8748
+
8745
8749
  .work-document-comment-draft-item, .work-document-comment-empty-item {
8746
8750
  display: contents;
8747
8751
  }
@@ -8860,10 +8864,17 @@ button.work-office-collaboration-participant:hover .work-office-collaboration-lo
8860
8864
  color: var(--a3s-faint);
8861
8865
  text-overflow: ellipsis;
8862
8866
  white-space: nowrap;
8867
+ align-items: center;
8868
+ gap: 4px;
8863
8869
  font-size: 8px;
8870
+ display: flex;
8864
8871
  overflow: hidden;
8865
8872
  }
8866
8873
 
8874
+ .work-document-comment-card.detached .work-document-comment-quote {
8875
+ color: var(--a3s-amber, #9a6700);
8876
+ }
8877
+
8867
8878
  .work-document-comment-thread {
8868
8879
  gap: 5px;
8869
8880
  padding-left: 38px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a3s-lab/office",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "Open-source collaborative browser editors for documents, Markdown, spreadsheets, presentations, and PDFs.",
5
5
  "keywords": [
6
6
  "office",
@@ -90,15 +90,19 @@
90
90
  "playground:visual:spreadsheet-ribbon": "playwright test visual-tests/spreadsheet-ribbon.functional.spec.ts --config playwright.config.ts",
91
91
  "playground:visual:update": "playwright test --config playwright.config.ts --update-snapshots",
92
92
  "test": "rstest",
93
- "test:e2e": "bun run test:e2e:fixtures && a3s-test run tests/e2e/word-page-color.acl --json && a3s-test run tests/e2e/word-page-setup-phone.acl --json && a3s-test run tests/e2e/word-paragraph-layout-phone.acl --json && a3s-test run tests/e2e/word-list-formatting-phone.acl --json && a3s-test run tests/e2e/word-font-picker-phone.acl --json && a3s-test run tests/e2e/word-comments-drawer.acl --json && a3s-test run tests/e2e/word-comment-windowing.acl --json && a3s-test run tests/e2e/word-citations-phone.acl --json && a3s-test run tests/e2e/word-navigation-search.acl --json && a3s-test run tests/e2e/word-navigation-windowing.acl --json && a3s-test run tests/e2e/word-find-replace-phone.acl --json && a3s-test run tests/e2e/word-page-navigation.acl --json && a3s-test run tests/e2e/word-page-windowing.acl --json && a3s-test run tests/e2e/word-ai-question.acl --json && a3s-test run tests/e2e/word-picture-insert.acl --json && a3s-test run tests/e2e/word-picture-alt-text-phone.acl --json && a3s-test run tests/e2e/word-track-changes-phone.acl --json && a3s-test run tests/e2e/word-review-conflict-phone.acl --json && a3s-test run tests/e2e/word-revision-windowing.acl --json && a3s-test run tests/e2e/word-table-phone.acl --json && a3s-test run tests/e2e/word-table-borders.acl --json && a3s-test run tests/e2e/word-theme-table.acl --json && a3s-test run tests/e2e/word-styled-table.acl --json && a3s-test run tests/e2e/word-multi-page-table.acl --json && a3s-test run tests/e2e/word-cross-reference-phone.acl --json && a3s-test run tests/e2e/word-bookmark-links-phone.acl --json && a3s-test run tests/e2e/word-notes-phone.acl --json && a3s-test run tests/e2e/word-fields-phone.acl --json && a3s-test run tests/e2e/spreadsheet-phone-rename.acl --json && a3s-test run tests/e2e/spreadsheet-phone-find.acl --json && a3s-test run tests/e2e/spreadsheet-phone-context-menu.acl --json && a3s-test run tests/e2e/spreadsheet-phone-task-pane.acl --json && a3s-test run tests/e2e/presentation-cut-paste-focus.acl --json && a3s-test run tests/e2e/presentation-presenter-view.acl --json && a3s-test run tests/e2e/presentation-phone-chart-pane.acl --json && a3s-test run tests/e2e/presentation-phone-comments.acl --json && a3s-test run tests/e2e/pdf-thumbnail-keyboard.acl --json && a3s-test run tests/e2e/pdf-page-drawer-phone.acl --json && a3s-test run tests/e2e/markdown-phone-modes.acl --json && a3s-test run tests/e2e/office-sidebar-breakpoint.acl --json && a3s-test run tests/e2e/office-docs-navigation.acl --json && a3s-test run tests/e2e/collaboration-playground-entry.acl --json && a3s-test run tests/e2e/collaboration-participants.acl --json && a3s-test run tests/e2e/collaboration-pdf-annotations.acl --json && a3s-test run tests/e2e/collaboration-spreadsheet-cells.acl --json && a3s-test run tests/e2e/collaboration-presentation-elements.acl --json",
94
- "test:e2e:check": "bun run test:e2e:fixtures && a3s-test check tests/e2e/word-page-color.acl --json && a3s-test check tests/e2e/word-page-setup-phone.acl --json && a3s-test check tests/e2e/word-paragraph-layout-phone.acl --json && a3s-test check tests/e2e/word-list-formatting-phone.acl --json && a3s-test check tests/e2e/word-font-picker-phone.acl --json && a3s-test check tests/e2e/word-comments-drawer.acl --json && a3s-test check tests/e2e/word-comment-windowing.acl --json && a3s-test check tests/e2e/word-citations-phone.acl --json && a3s-test check tests/e2e/word-navigation-search.acl --json && a3s-test check tests/e2e/word-navigation-windowing.acl --json && a3s-test check tests/e2e/word-find-replace-phone.acl --json && a3s-test check tests/e2e/word-page-navigation.acl --json && a3s-test check tests/e2e/word-page-windowing.acl --json && a3s-test check tests/e2e/word-ai-question.acl --json && a3s-test check tests/e2e/word-picture-insert.acl --json && a3s-test check tests/e2e/word-picture-alt-text-phone.acl --json && a3s-test check tests/e2e/word-track-changes-phone.acl --json && a3s-test check tests/e2e/word-review-conflict-phone.acl --json && a3s-test check tests/e2e/word-revision-windowing.acl --json && a3s-test check tests/e2e/word-table-phone.acl --json && a3s-test check tests/e2e/word-table-borders.acl --json && a3s-test check tests/e2e/word-theme-table.acl --json && a3s-test check tests/e2e/word-styled-table.acl --json && a3s-test check tests/e2e/word-multi-page-table.acl --json && a3s-test check tests/e2e/word-cross-reference-phone.acl --json && a3s-test check tests/e2e/word-bookmark-links-phone.acl --json && a3s-test check tests/e2e/word-notes-phone.acl --json && a3s-test check tests/e2e/word-fields-phone.acl --json && a3s-test check tests/e2e/spreadsheet-phone-rename.acl --json && a3s-test check tests/e2e/spreadsheet-phone-find.acl --json && a3s-test check tests/e2e/spreadsheet-phone-context-menu.acl --json && a3s-test check tests/e2e/spreadsheet-phone-task-pane.acl --json && a3s-test check tests/e2e/presentation-cut-paste-focus.acl --json && a3s-test check tests/e2e/presentation-presenter-view.acl --json && a3s-test check tests/e2e/presentation-phone-chart-pane.acl --json && a3s-test check tests/e2e/presentation-phone-comments.acl --json && a3s-test check tests/e2e/pdf-thumbnail-keyboard.acl --json && a3s-test check tests/e2e/pdf-page-drawer-phone.acl --json && a3s-test check tests/e2e/markdown-phone-modes.acl --json && a3s-test check tests/e2e/office-sidebar-breakpoint.acl --json && a3s-test check tests/e2e/office-docs-navigation.acl --json && a3s-test check tests/e2e/collaboration-playground-entry.acl --json && a3s-test check tests/e2e/collaboration-participants.acl --json && a3s-test check tests/e2e/collaboration-pdf-annotations.acl --json && a3s-test check tests/e2e/collaboration-spreadsheet-cells.acl --json && a3s-test check tests/e2e/collaboration-presentation-elements.acl --json",
93
+ "test:e2e": "bun run test:e2e:fixtures && a3s-test run tests/e2e/word-page-color.acl --json && a3s-test run tests/e2e/word-page-setup-phone.acl --json && a3s-test run tests/e2e/word-paragraph-layout-phone.acl --json && a3s-test run tests/e2e/word-list-formatting-phone.acl --json && a3s-test run tests/e2e/word-font-picker-phone.acl --json && a3s-test run tests/e2e/word-comments-drawer.acl --json && a3s-test run tests/e2e/word-comment-windowing.acl --json && a3s-test run tests/e2e/word-citations-phone.acl --json && a3s-test run tests/e2e/word-navigation-search.acl --json && a3s-test run tests/e2e/word-navigation-windowing.acl --json && a3s-test run tests/e2e/word-find-replace-phone.acl --json && a3s-test run tests/e2e/word-page-navigation.acl --json && a3s-test run tests/e2e/word-page-windowing.acl --json && a3s-test run tests/e2e/word-ai-question.acl --json && a3s-test run tests/e2e/word-picture-insert.acl --json && a3s-test run tests/e2e/word-picture-alt-text-phone.acl --json && a3s-test run tests/e2e/word-track-changes-phone.acl --json && a3s-test run tests/e2e/word-review-conflict-phone.acl --json && a3s-test run tests/e2e/word-revision-windowing.acl --json && a3s-test run tests/e2e/word-table-phone.acl --json && a3s-test run tests/e2e/word-table-borders.acl --json && a3s-test run tests/e2e/word-theme-table.acl --json && a3s-test run tests/e2e/word-styled-table.acl --json && a3s-test run tests/e2e/word-multi-page-table.acl --json && a3s-test run tests/e2e/word-cross-reference-phone.acl --json && a3s-test run tests/e2e/word-bookmark-links-phone.acl --json && a3s-test run tests/e2e/word-notes-phone.acl --json && a3s-test run tests/e2e/word-fields-phone.acl --json && a3s-test run tests/e2e/spreadsheet-phone-rename.acl --json && a3s-test run tests/e2e/spreadsheet-phone-find.acl --json && a3s-test run tests/e2e/spreadsheet-phone-context-menu.acl --json && a3s-test run tests/e2e/spreadsheet-phone-task-pane.acl --json && a3s-test run tests/e2e/presentation-cut-paste-focus.acl --json && a3s-test run tests/e2e/presentation-presenter-view.acl --json && a3s-test run tests/e2e/presentation-phone-chart-pane.acl --json && a3s-test run tests/e2e/presentation-phone-comments.acl --json && a3s-test run tests/e2e/pdf-thumbnail-keyboard.acl --json && a3s-test run tests/e2e/pdf-page-drawer-phone.acl --json && a3s-test run tests/e2e/markdown-phone-modes.acl --json && a3s-test run tests/e2e/office-sidebar-breakpoint.acl --json && a3s-test run tests/e2e/office-docs-navigation.acl --json && a3s-test run tests/e2e/collaboration-playground-entry.acl --json && a3s-test run tests/e2e/collaboration-document-comments.acl --command-timeout-ms 120000 --json && a3s-test run tests/e2e/collaboration-participants.acl --json && a3s-test run tests/e2e/collaboration-pdf-annotations.acl --json && a3s-test run tests/e2e/collaboration-spreadsheet-cells.acl --json && a3s-test run tests/e2e/collaboration-presentation-elements.acl --json",
94
+ "test:e2e:check": "bun run test:e2e:fixtures && a3s-test check tests/e2e/word-page-color.acl --json && a3s-test check tests/e2e/word-page-setup-phone.acl --json && a3s-test check tests/e2e/word-paragraph-layout-phone.acl --json && a3s-test check tests/e2e/word-list-formatting-phone.acl --json && a3s-test check tests/e2e/word-font-picker-phone.acl --json && a3s-test check tests/e2e/word-comments-drawer.acl --json && a3s-test check tests/e2e/word-comment-windowing.acl --json && a3s-test check tests/e2e/word-citations-phone.acl --json && a3s-test check tests/e2e/word-navigation-search.acl --json && a3s-test check tests/e2e/word-navigation-windowing.acl --json && a3s-test check tests/e2e/word-find-replace-phone.acl --json && a3s-test check tests/e2e/word-page-navigation.acl --json && a3s-test check tests/e2e/word-page-windowing.acl --json && a3s-test check tests/e2e/word-ai-question.acl --json && a3s-test check tests/e2e/word-picture-insert.acl --json && a3s-test check tests/e2e/word-picture-alt-text-phone.acl --json && a3s-test check tests/e2e/word-track-changes-phone.acl --json && a3s-test check tests/e2e/word-review-conflict-phone.acl --json && a3s-test check tests/e2e/word-revision-windowing.acl --json && a3s-test check tests/e2e/word-table-phone.acl --json && a3s-test check tests/e2e/word-table-borders.acl --json && a3s-test check tests/e2e/word-theme-table.acl --json && a3s-test check tests/e2e/word-styled-table.acl --json && a3s-test check tests/e2e/word-multi-page-table.acl --json && a3s-test check tests/e2e/word-cross-reference-phone.acl --json && a3s-test check tests/e2e/word-bookmark-links-phone.acl --json && a3s-test check tests/e2e/word-notes-phone.acl --json && a3s-test check tests/e2e/word-fields-phone.acl --json && a3s-test check tests/e2e/spreadsheet-phone-rename.acl --json && a3s-test check tests/e2e/spreadsheet-phone-find.acl --json && a3s-test check tests/e2e/spreadsheet-phone-context-menu.acl --json && a3s-test check tests/e2e/spreadsheet-phone-task-pane.acl --json && a3s-test check tests/e2e/presentation-cut-paste-focus.acl --json && a3s-test check tests/e2e/presentation-presenter-view.acl --json && a3s-test check tests/e2e/presentation-phone-chart-pane.acl --json && a3s-test check tests/e2e/presentation-phone-comments.acl --json && a3s-test check tests/e2e/pdf-thumbnail-keyboard.acl --json && a3s-test check tests/e2e/pdf-page-drawer-phone.acl --json && a3s-test check tests/e2e/markdown-phone-modes.acl --json && a3s-test check tests/e2e/office-sidebar-breakpoint.acl --json && a3s-test check tests/e2e/office-docs-navigation.acl --json && a3s-test check tests/e2e/collaboration-playground-entry.acl --json && a3s-test check tests/e2e/collaboration-document-comments.acl --json && a3s-test check tests/e2e/collaboration-participants.acl --json && a3s-test check tests/e2e/collaboration-pdf-annotations.acl --json && a3s-test check tests/e2e/collaboration-spreadsheet-cells.acl --json && a3s-test check tests/e2e/collaboration-presentation-elements.acl --json",
95
95
  "test:e2e:fixtures": "bun scripts/create-e2e-fixtures.ts",
96
96
  "test:e2e:initial-focus": "a3s-test run tests/e2e/office-editor-initial-focus.acl --json",
97
97
  "test:e2e:initial-focus:check": "a3s-test check tests/e2e/office-editor-initial-focus.acl --json",
98
+ "test:e2e:docs": "a3s-test run tests/e2e/office-docs-navigation.acl --json",
99
+ "test:e2e:docs:check": "a3s-test check tests/e2e/office-docs-navigation.acl --json",
98
100
  "test:e2e:collaboration-participants": "a3s-test run tests/e2e/collaboration-participants.acl --json",
99
101
  "test:e2e:collaboration-participants:check": "a3s-test check tests/e2e/collaboration-participants.acl --json",
100
102
  "test:e2e:collaboration-playground": "a3s-test run tests/e2e/collaboration-playground-entry.acl --json",
101
103
  "test:e2e:collaboration-playground:check": "a3s-test check tests/e2e/collaboration-playground-entry.acl --json",
104
+ "test:e2e:collaboration-document-comments": "a3s-test run tests/e2e/collaboration-document-comments.acl --command-timeout-ms 120000 --json",
105
+ "test:e2e:collaboration-document-comments:check": "a3s-test check tests/e2e/collaboration-document-comments.acl --json",
102
106
  "test:e2e:collaboration-pdf-annotations": "a3s-test run tests/e2e/collaboration-pdf-annotations.acl --json",
103
107
  "test:e2e:collaboration-pdf-annotations:check": "a3s-test check tests/e2e/collaboration-pdf-annotations.acl --json",
104
108
  "test:e2e:collaboration-spreadsheet-cells": "a3s-test run tests/e2e/collaboration-spreadsheet-cells.acl --json",
@@ -175,7 +179,10 @@
175
179
  },
176
180
  "devDependencies": {
177
181
  "@biomejs/biome": "2.4.15",
182
+ "@fontsource-variable/geist": "^5.3.0",
183
+ "@fontsource-variable/geist-mono": "^5.3.0",
178
184
  "@rspress/core": "^2.0.17",
185
+ "@rspress/shared": "2.0.19",
179
186
  "@playwright/test": "1.61.1",
180
187
  "@rsbuild/core": "^2.1.5",
181
188
  "@rsbuild/plugin-react": "^2.1.0",