oasis-editor 0.0.205 → 0.0.207

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.
@@ -37,6 +37,8 @@ export interface EssentialsFormattingCapability {
37
37
  replyComment: () => boolean;
38
38
  editComment: () => boolean;
39
39
  canEditComment: () => boolean;
40
+ toggleCommentsPanel: () => boolean;
41
+ isCommentsPanelOpen: () => boolean;
40
42
  navigateRevisionNext: () => boolean;
41
43
  navigateRevisionPrevious: () => boolean;
42
44
  navigateCommentNext: () => boolean;
@@ -46,6 +48,8 @@ export interface EssentialsFormattingCapability {
46
48
  resolveSelectedComment: () => boolean;
47
49
  reopenSelectedComment: () => boolean;
48
50
  deleteSelectedComment: () => boolean;
51
+ canDeleteSelectedComment: () => boolean;
52
+ canManageSelectedComment: () => boolean;
49
53
  insertText: (text: string, fontFamily?: string | null) => boolean;
50
54
  insertEquation: (expression: EditorMathExpression) => boolean;
51
55
  updateEquation: (runId: string, expression: EditorMathExpression) => boolean;
@@ -1,4 +1,4 @@
1
1
  import { OasisEditorAppProps } from './OasisEditorAppProps.js';
2
2
  import { JSX } from 'solid-js';
3
- export type { OasisEditorLoadingOptions, OasisEditorAppUiProps, OasisEditorAppDocumentProps, OasisEditorAppRuntimeProps, OasisEditorAppProps, ToolbarLayoutMode, ToolbarViewMode, } from './OasisEditorAppProps.js';
3
+ export type { OasisEditorLoadingOptions, OasisEditorAppUiProps, OasisEditorAppDocumentProps, OasisEditorAppRuntimeProps, OasisEditorAppProps, OasisReviewAccess, ToolbarLayoutMode, ToolbarViewMode, } from './OasisEditorAppProps.js';
4
4
  export declare function OasisEditorApp(props?: OasisEditorAppProps): JSX.Element;
@@ -5,6 +5,7 @@ import { MenuRegistry } from './components/Menubar/menuRegistry.js';
5
5
  import { DocumentPersistence } from '../app/controllers/useEditorPersistence.js';
6
6
  import { OasisPlugin } from '../core/plugin.js';
7
7
  import { OasisEditorClient, OasisEditorClientController } from '../app/client/OasisEditorClient.js';
8
+ import { OasisReviewAccess } from '../core/commands/commentPermissions.js';
8
9
  /** Toolbar display mode. */
9
10
  export type ToolbarViewMode = "ribbon" | "compact";
10
11
  /** Toolbar overflow behavior. */
@@ -51,10 +52,20 @@ export interface OasisEditorAppDocumentProps {
51
52
  */
52
53
  persistenceKey?: string;
53
54
  }
55
+ /**
56
+ * Optional host-supplied review identity. Undefined retains standalone editor
57
+ * behavior; configured identities require stable ids for owner-only actions.
58
+ *
59
+ * Authorization here is UI/client defense-in-depth, not a server security
60
+ * boundary. A collaborative backend must independently enforce the same policy.
61
+ */
62
+ export type { OasisReviewAccess } from '../core/commands/commentPermissions.js';
54
63
  /** Runtime configuration properties for the editor app (plugins, customization). */
55
64
  export interface OasisEditorAppRuntimeProps {
56
65
  onReady?: (client: OasisEditorClient) => void;
57
66
  plugins?: OasisPlugin[];
67
+ /** Restrict comment mutation to the authenticated host identity. */
68
+ review?: OasisReviewAccess;
58
69
  /** @internal Used by createOasisEditor()/mount() to bind the public client. */
59
70
  client?: OasisEditorClientController;
60
71
  /**
@@ -24,6 +24,8 @@ export interface OasisEditorEditorOverlayProps {
24
24
  commentHighlights: Accessor<CommentHighlightBox[]>;
25
25
  onReplyToComment?: (commentId: string) => void;
26
26
  onEditComment?: (commentId: string) => void;
27
+ canEditComment?: (commentId: string) => boolean;
28
+ canReplyComment?: (commentId: string) => boolean;
27
29
  selectedImageBox: Accessor<SelectedImageBox | null>;
28
30
  selectedTextBoxBox: Accessor<SelectedTextBoxBox | null>;
29
31
  selectedTableBox: Accessor<SelectedTableBox | null>;
@@ -27,6 +27,8 @@ export interface EditorViewOverlayInput {
27
27
  commentHighlights: Accessor<CommentHighlightBox[]>;
28
28
  onReplyToComment?: (commentId: string) => void;
29
29
  onEditComment?: (commentId: string) => void;
30
+ canEditComment?: (commentId: string) => boolean;
31
+ canReplyComment?: (commentId: string) => boolean;
30
32
  selectedImageBox: Accessor<SelectedImageBox | null>;
31
33
  selectedTextBoxBox: Accessor<SelectedTextBoxBox | null>;
32
34
  selectedTableBox: Accessor<SelectedTableBox | null>;
@@ -1,4 +1,5 @@
1
1
  import { EditorState } from '../../core/model.js';
2
+ import { OasisReviewAccess } from '../../core/commands/commentPermissions.js';
2
3
  export interface CommentComposerDraft {
3
4
  mode: "new" | "reply" | "edit";
4
5
  /** Snapshot captured before modal focus steals the editor selection. */
@@ -15,14 +16,30 @@ export interface CommentComposerDeps {
15
16
  isReadOnly: () => boolean;
16
17
  applyTransactionalState: (change: (current: EditorState) => EditorState) => void;
17
18
  focusInput: () => void;
19
+ access?: () => OasisReviewAccess | undefined;
18
20
  }
19
21
  /** One instance per editor; never a global author, dialog, or comment state. */
20
22
  export declare function createEditorCommentComposer(deps: CommentComposerDeps): {
21
23
  draft: import('solid-js').Accessor<CommentComposerDraft | null>;
22
24
  lastAuthor: import('solid-js').Accessor<string>;
25
+ panelOpen: import('solid-js').Accessor<boolean>;
26
+ togglePanel: () => boolean;
27
+ closePanel: () => void;
23
28
  canCreate: () => boolean;
24
29
  canReply: () => boolean;
30
+ canReplyId: (id: string) => boolean;
25
31
  canEdit: () => boolean;
32
+ canEditId: (id: string) => boolean;
33
+ canDeleteId: (id: string) => boolean;
34
+ canDeleteSelected: () => boolean;
35
+ deleteSelected: () => boolean;
36
+ deleteById: (id: string) => boolean;
37
+ canResolveId: (id: string) => boolean;
38
+ canResolveSelected: () => boolean;
39
+ resolveSelected: (resolved: boolean) => boolean;
40
+ resolveById: (id: string, resolved: boolean) => boolean;
41
+ authorName: () => string;
42
+ authorLocked: () => boolean;
26
43
  openNew: () => boolean;
27
44
  openReply: () => boolean;
28
45
  openReplyToId: (parentId: string) => boolean;
@@ -7,6 +7,8 @@ export interface CommentHighlightOverlayProps {
7
7
  commentsById: Accessor<Record<string, EditorComment>>;
8
8
  onReplyToComment?: (commentId: string) => void;
9
9
  onEditComment?: (commentId: string) => void;
10
+ canEditComment?: (commentId: string) => boolean;
11
+ canReplyComment?: (commentId: string) => boolean;
10
12
  readOnly?: boolean;
11
13
  }
12
14
  /**
@@ -0,0 +1,11 @@
1
+ import { Accessor, JSX } from 'solid-js';
2
+ import { EditorState } from '../../core/model.js';
3
+ import { EditorCommentComposer } from '../app/createEditorCommentComposer.js';
4
+ export interface ReviewCommentsPanelProps {
5
+ state: Accessor<EditorState>;
6
+ composer: EditorCommentComposer;
7
+ onNavigate: (id: string) => void;
8
+ onClose: () => void;
9
+ }
10
+ /** All thread actions share the command-side permission controller. */
11
+ export declare function ReviewCommentsPanel(props: ReviewCommentsPanelProps): JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oasis-editor",
3
- "version": "0.0.205",
3
+ "version": "0.0.207",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {