oasis-editor 0.0.133 → 0.0.135
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/dist/{OasisEditorApp-DmXn9H33.js → OasisEditorApp-207_qEC4.js} +602 -30
- package/dist/app/controllers/EditorCommandsController.d.ts +5 -0
- package/dist/app/controllers/createCropSession.d.ts +26 -0
- package/dist/app/controllers/useEditorImageOperations.d.ts +7 -0
- package/dist/assets/{importDocxWorker-CCwhxVSR.js → importDocxWorker-B0cSSI12.js} +1 -1
- package/dist/core/commands/builtinCommands.d.ts +1 -1
- package/dist/core/commands/image.d.ts +51 -1
- package/dist/core/commands/publicCommandTypes.d.ts +5 -0
- package/dist/core/lineDash.d.ts +16 -0
- package/dist/core/model/index.d.ts +1 -1
- package/dist/core/model/types/primitives.d.ts +19 -0
- package/dist/core/pluginUiTypes.d.ts +1 -1
- package/dist/core/transactionMergeKeys.d.ts +2 -0
- package/dist/export/docx/docxTypes.d.ts +2 -1
- package/dist/export/docx/text/drawingContainerXml.d.ts +7 -1
- package/dist/export/pdf/draw/drawImageObject.d.ts +14 -0
- package/dist/export/pdf/writer/PdfContentStream.d.ts +8 -0
- package/dist/export/pdf/writer/pdfTypes.d.ts +12 -0
- package/dist/i18n/locales/en.d.ts +28 -0
- package/dist/i18n/locales/pt-BR.d.ts +28 -0
- package/dist/{index-BOj4-NlJ.js → index-CaKZARyM.js} +1217 -468
- package/dist/oasis-editor.css +1 -1
- package/dist/oasis-editor.js +49 -49
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/plugins/internal/essentialsCapabilities.d.ts +21 -1
- package/dist/ui/OasisEditorEditorProps.d.ts +5 -0
- package/dist/ui/app/buildEditorViewProps.d.ts +2 -0
- package/dist/ui/app/createAppCommandsController.d.ts +8 -0
- package/dist/ui/app/createEditorCommandRuntime.d.ts +4 -0
- package/dist/ui/app/createEditorInteractionRuntime.d.ts +7 -0
- package/dist/ui/app/essentials/types.d.ts +5 -0
- package/dist/ui/canvas/paragraph/canvasInlineImage.d.ts +1 -1
- package/dist/ui/components/Toolbar/controls/ImageSizeControls.d.ts +16 -0
- package/dist/ui/components/Toolbar/pictureBorderPresets.d.ts +19 -0
- package/dist/ui/components/Toolbar/primitives/ColorGrids.d.ts +20 -0
- package/dist/ui/components/Toolbar/primitives/PictureBorderPicker.d.ts +37 -0
- package/dist/ui/components/Toolbar/primitives/WideMenuButton.d.ts +27 -0
- package/dist/ui/components/Toolbar/schema/items.d.ts +15 -1
- package/dist/ui/cropGeometry.d.ts +23 -0
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ImageBorderPatch } from '../../core/commands/image.js';
|
|
1
2
|
import { EditorParagraphListStyle, EditorParagraphStyle, EditorSection, EditorState, EditorTextStyle } from '../../core/model.js';
|
|
2
3
|
import { TextCaseMode } from '../../core/commands/text.js';
|
|
3
4
|
import { BooleanStyleKey, ParagraphStyleKey, ToolbarStyleState } from '../../ui/toolbarStyleState.js';
|
|
@@ -44,6 +45,10 @@ declare function createEditorCommandsControllerImpl(deps: EditorCommandsControll
|
|
|
44
45
|
promptForImageAlt: () => void;
|
|
45
46
|
applyImageCaptionCommand: (caption: string) => void;
|
|
46
47
|
promptForImageCaption: () => void;
|
|
48
|
+
applyImageWidthCmCommand: (cm: number) => void;
|
|
49
|
+
applyImageHeightCmCommand: (cm: number) => void;
|
|
50
|
+
applyImageCropAspectCommand: (preset: string) => void;
|
|
51
|
+
applyImageBorderCommand: (patch: ImageBorderPatch) => void;
|
|
47
52
|
handleListTab: (direction: "indent" | "outdent") => boolean;
|
|
48
53
|
handleListEnter: () => boolean;
|
|
49
54
|
handleListBoundaryBackspace: (event: KeyboardEvent & {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EditorState } from '../../core/model.js';
|
|
2
|
+
import { ResizeHandleDirection } from '../../ui/resizeGeometry.js';
|
|
3
|
+
import { EditorHistoryState } from '../../ui/editorHistory.js';
|
|
4
|
+
import { EditorLogger } from '../../utils/logger.js';
|
|
5
|
+
|
|
6
|
+
export interface CropSessionDeps {
|
|
7
|
+
state: EditorState;
|
|
8
|
+
applyState: (next: EditorState) => void;
|
|
9
|
+
updateHistoryState: (updater: (current: EditorHistoryState) => EditorHistoryState) => void;
|
|
10
|
+
cloneState: (source: EditorState) => EditorState;
|
|
11
|
+
focusInput: () => void;
|
|
12
|
+
logger: EditorLogger;
|
|
13
|
+
/** Visual zoom factor `z`; pointer deltas (screen px) are divided by it. */
|
|
14
|
+
zoomFactor?: () => number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Drives a handle-based image crop, mirroring {@link createResizeSession}: it
|
|
18
|
+
* tracks the pointer, resolves the next crop + displayed size via
|
|
19
|
+
* {@link resolveCroppedImage} from the captured start geometry each move (so
|
|
20
|
+
* rounding never accumulates), and snapshots the pre-crop state onto the undo
|
|
21
|
+
* stack on release.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createCropSession(deps: CropSessionDeps): {
|
|
24
|
+
start: (paragraphId: string, paragraphOffset: number, handleDirection: ResizeHandleDirection, event: MouseEvent, initialState: EditorState) => void;
|
|
25
|
+
stop: () => void;
|
|
26
|
+
};
|
|
@@ -39,6 +39,9 @@ export interface EditorImageOperationsDeps {
|
|
|
39
39
|
export declare function createEditorImageOperations(deps: EditorImageOperationsDeps): ReturnType<typeof createEditorImageOperationsImpl>;
|
|
40
40
|
declare function createEditorImageOperationsImpl(deps: EditorImageOperationsDeps): {
|
|
41
41
|
dragging: import('solid-js').Accessor<boolean>;
|
|
42
|
+
cropMode: import('solid-js').Accessor<boolean>;
|
|
43
|
+
setCropMode: import('solid-js').Setter<boolean>;
|
|
44
|
+
toggleCropMode: () => void;
|
|
42
45
|
draggedImageInfo: import('solid-js').Accessor<ActiveImageDrag | null>;
|
|
43
46
|
mousePos: import('solid-js').Accessor<{
|
|
44
47
|
x: number;
|
|
@@ -57,6 +60,7 @@ declare function createEditorImageOperationsImpl(deps: EditorImageOperationsDeps
|
|
|
57
60
|
stopImageDrag: () => void;
|
|
58
61
|
stopImageResize: () => void;
|
|
59
62
|
stopImageRotate: () => void;
|
|
63
|
+
stopImageCrop: () => void;
|
|
60
64
|
handleImageMouseDown: (paragraphId: string, paragraphOffset: number, event: MouseEvent & {
|
|
61
65
|
currentTarget: HTMLElement;
|
|
62
66
|
}) => void;
|
|
@@ -66,5 +70,8 @@ declare function createEditorImageOperationsImpl(deps: EditorImageOperationsDeps
|
|
|
66
70
|
handleImageRotateHandleMouseDown: (paragraphId: string, paragraphOffset: number, event: MouseEvent & {
|
|
67
71
|
currentTarget: HTMLElement;
|
|
68
72
|
}) => void;
|
|
73
|
+
handleImageCropHandleMouseDown: (paragraphId: string, paragraphOffset: number, direction: ResizeHandleDirection, event: MouseEvent & {
|
|
74
|
+
currentTarget: HTMLElement;
|
|
75
|
+
}) => void;
|
|
69
76
|
};
|
|
70
77
|
export {};
|