oasis-editor 0.0.12 → 0.0.14

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.
Files changed (31) hide show
  1. package/dist/{OasisEditorApp-DsSNl4Fj.js → OasisEditorApp-BtRbOf8l.js} +249 -19
  2. package/dist/app/controllers/useEditorLayout.d.ts +2 -1
  3. package/dist/assets/{importDocxWorker-CtcRQ7NG.js → importDocxWorker-cjz15bhS.js} +1 -1
  4. package/dist/core/commands/builtinCommands.d.ts +1 -1
  5. package/dist/core/commands/publicCommandTypes.d.ts +5 -0
  6. package/dist/core/editorState.d.ts +1 -0
  7. package/dist/core/model/index.d.ts +1 -0
  8. package/dist/core/model/types/document.d.ts +7 -0
  9. package/dist/core/model/types/documentComments.d.ts +50 -0
  10. package/dist/export/docx/commentsXml.d.ts +34 -0
  11. package/dist/export/docx/docxTypes.d.ts +7 -0
  12. package/dist/i18n/locales/en.d.ts +4 -0
  13. package/dist/i18n/locales/pt-BR.d.ts +4 -0
  14. package/dist/import/docx/comments.d.ts +12 -0
  15. package/dist/import/docx/commentsXml.d.ts +14 -0
  16. package/dist/import/docx/runs/types.d.ts +10 -0
  17. package/dist/import/docx/runs.d.ts +5 -1
  18. package/dist/{index-BUOuw27s.js → index-4CDpujGG.js} +541 -117
  19. package/dist/index.d.ts +1 -1
  20. package/dist/oasis-editor.css +1 -1
  21. package/dist/oasis-editor.js +1 -1
  22. package/dist/oasis-editor.umd.cjs +4 -4
  23. package/dist/plugins/internal/createEssentialsPlugin.d.ts +1 -0
  24. package/dist/ui/OasisEditorEditor.d.ts +2 -1
  25. package/dist/ui/app/buildEditorViewProps.d.ts +2 -1
  26. package/dist/ui/canvas/CanvasCommentGeometry.d.ts +13 -0
  27. package/dist/ui/components/CommentHighlightOverlay.d.ts +16 -0
  28. package/dist/ui/components/Toolbar/presets/builtinToolbarIds.d.ts +1 -0
  29. package/dist/ui/components/Toolbar/schema/items.d.ts +2 -0
  30. package/dist/ui/editorUiTypes.d.ts +8 -0
  31. package/package.json +1 -1
@@ -93,6 +93,7 @@ export interface EssentialsParagraphCapability {
93
93
  setIndentRight: (value: number | null) => void;
94
94
  setIndentFirstLine: (value: number | null) => void;
95
95
  setIndentHanging: (value: number | null) => void;
96
+ setSpecialIndent: (kind: "none" | "firstLine" | "hanging", value?: number | null) => void;
96
97
  setShading: (value: string | null) => void;
97
98
  applyBorders: () => void;
98
99
  setLineHeight: (value: number | null) => void;
@@ -2,7 +2,7 @@ import { Accessor, JSX } from '../solid-js';
2
2
  import { ToolbarHost } from '../components/Toolbar/state/createToolbarApi.js';
3
3
  import { EditorLayoutParagraph, EditorState } from '../../core/model.js';
4
4
  import { ImportProgressState } from '../../app/controllers/useEditorDocumentIO.js';
5
- import { CaretBox, InputBox, LayoutOptionsOverlay, RevisionBox, SelectedImageBox, SelectedTextBoxBox, SelectionBox } from '../editorUiTypes.js';
5
+ import { CaretBox, CommentHighlightBox, InputBox, LayoutOptionsOverlay, RevisionBox, SelectedImageBox, SelectedTextBoxBox, SelectionBox } from '../editorUiTypes.js';
6
6
  import { ResizeHandleDirection } from '../resizeGeometry.js';
7
7
 
8
8
  type ImportProgress = ImportProgressState;
@@ -17,6 +17,7 @@ export interface OasisEditorEditorLayoutProps {
17
17
  }
18
18
  export interface OasisEditorEditorOverlayProps {
19
19
  selectionBoxes: Accessor<SelectionBox[]>;
20
+ commentHighlights: Accessor<CommentHighlightBox[]>;
20
21
  selectedImageBox: Accessor<SelectedImageBox | null>;
21
22
  selectedTextBoxBox: Accessor<SelectedTextBoxBox | null>;
22
23
  caretBox: Accessor<CaretBox>;
@@ -1,5 +1,5 @@
1
1
  import { Accessor, JSX } from '../../solid-js';
2
- import { CaretBox, InputBox, LayoutOptionsOverlay, RevisionBox, SelectedImageBox, SelectedTextBoxBox, SelectionBox } from '../../../editorUiTypes.js';
2
+ import { CaretBox, CommentHighlightBox, InputBox, LayoutOptionsOverlay, RevisionBox, SelectedImageBox, SelectedTextBoxBox, SelectionBox } from '../../../editorUiTypes.js';
3
3
  import { OasisEditorEditorFileHandlers, OasisEditorEditorInputHandlers, OasisEditorEditorLayoutProps, OasisEditorEditorOverlayProps, OasisEditorEditorRefProps, OasisEditorEditorSurfaceHandlers } from '../../../OasisEditorEditor.js';
4
4
  import { createEditorFocusController } from '../../useEditorFocus.js';
5
5
  import { createEditorSurfaceEvents } from '../../../../app/controllers/useEditorSurfaceEvents.js';
@@ -20,6 +20,7 @@ export interface EditorViewPropsContext {
20
20
  className: string | undefined;
21
21
  style: JSX.CSSProperties | undefined;
22
22
  selectionBoxes: Accessor<SelectionBox[]>;
23
+ commentHighlights: Accessor<CommentHighlightBox[]>;
23
24
  selectedImageBox: Accessor<SelectedImageBox | null>;
24
25
  selectedTextBoxBox: Accessor<SelectedTextBoxBox | null>;
25
26
  layoutOptions: LayoutOptionsOverlay;
@@ -0,0 +1,13 @@
1
+ import { EditorState } from '../../../../core/model.js';
2
+ import { CommentHighlightBox } from '../../../editorUiTypes.js';
3
+ import { CanvasLayoutSnapshot } from '../../CanvasLayoutSnapshot.js';
4
+
5
+ /**
6
+ * Project each document comment's start/end anchors into highlight rectangles
7
+ * over the commented text, reusing the canvas layout snapshot's per-line slot
8
+ * positions (the same machinery `computeCanvasSelectionGeometry` uses for the
9
+ * live selection). Multi-line and cross-paragraph comments yield one box per
10
+ * covered line; every box carries its `commentId` so the overlay can group them
11
+ * and resolve the popup body on hover.
12
+ */
13
+ export declare function computeCommentHighlights(snapshot: CanvasLayoutSnapshot, state: EditorState): CommentHighlightBox[];
@@ -0,0 +1,16 @@
1
+ import { Accessor } from '../../solid-js';
2
+ import { EditorComment } from '../../../../core/model.js';
3
+ import { CommentHighlightBox } from '../../../editorUiTypes.js';
4
+
5
+ export interface CommentHighlightOverlayProps {
6
+ boxes: Accessor<CommentHighlightBox[]>;
7
+ /** Comment bodies keyed by their editor-local id, for the hover popup. */
8
+ commentsById: Accessor<Record<string, EditorComment>>;
9
+ }
10
+ /**
11
+ * Renders the highlight rectangles over commented text and, on hover/click of a
12
+ * highlight, a small popup with the comment's author/date/text (mirroring the
13
+ * track-changes `RevisionOverlay`). Hit-testing happens on the overlay divs
14
+ * themselves (`pointer-events: auto`), so no canvas hit-test plumbing is needed.
15
+ */
16
+ export declare function CommentHighlightOverlay(props: CommentHighlightOverlayProps): import("solid-js").JSX.Element;
@@ -33,6 +33,7 @@ export declare const OASIS_TOOLBAR_ITEMS: {
33
33
  readonly outdent: "editor-toolbar-list-outdent";
34
34
  readonly indent: "editor-toolbar-list-indent";
35
35
  readonly listOptions: "editor-toolbar-list-options";
36
+ readonly specialIndent: "editor-toolbar-special-indent";
36
37
  readonly lineSpacing: "editor-toolbar-line-spacing-control";
37
38
  readonly metrics: "editor-toolbar-metrics";
38
39
  readonly table: "editor-toolbar-table";
@@ -84,6 +84,8 @@ export interface SplitItem extends ToolbarItemBase {
84
84
  command: CommandRef;
85
85
  /** Chevron-opened content. */
86
86
  menu: MenuContent;
87
+ /** Extra class applied to the popover panel. */
88
+ panelClass?: string;
87
89
  }
88
90
  export interface MenuItem extends ToolbarItemBase {
89
91
  type: "menu";
@@ -48,6 +48,14 @@ export interface RevisionBox {
48
48
  left: number;
49
49
  top: number;
50
50
  }
51
+ /** One highlight rectangle over a commented text range, tagged with its id. */
52
+ export interface CommentHighlightBox {
53
+ commentId: string;
54
+ left: number;
55
+ top: number;
56
+ width: number;
57
+ height: number;
58
+ }
51
59
  /**
52
60
  * State and actions backing the Word-style "Layout Options" popup for the
53
61
  * selected image or text box.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oasis-editor",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",