oasis-editor 0.0.231 → 0.0.232
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-QuRS1JVm.js +1 -0
- package/dist/app/controllers/useEditorClipboard.d.ts +3 -0
- package/dist/defaultToolbar-BLpx6Q1W.js +1 -0
- package/dist/i18n/locales/en.d.ts +7 -0
- package/dist/i18n/locales/pt-BR.d.ts +7 -0
- package/dist/oasis-editor.css +1 -1
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +1 -1
- package/dist/ui/app/clipboardPaste.d.ts +2 -0
- package/dist/ui/app/clipboardWrite.d.ts +2 -2
- package/dist/ui/app/createEditorChrome.d.ts +2 -0
- package/dist/ui/app/createEditorClipboardActions.d.ts +19 -0
- package/dist/ui/app/createEditorCommandRuntime.d.ts +2 -0
- package/dist/ui/app/createEditorInteractionRuntime.d.ts +2 -0
- package/dist/ui/app/essentials/browser.d.ts +2 -6
- package/dist/ui/app/essentials/types.d.ts +2 -0
- package/dist/ui/app/useEditorContextMenuClipboard.d.ts +5 -3
- package/dist/ui/app/useEditorInteractionWiring.d.ts +2 -0
- package/dist/ui/components/ClipboardFeedback.d.ts +6 -0
- package/dist/ui/components/Toolbar/primitives/popoverBranch.d.ts +2 -0
- package/package.json +3 -2
- package/dist/OasisEditorApp-IDmEjhGJ.js +0 -1
- package/dist/defaultToolbar-D9PBASVE.js +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EditorState } from '../../core/model.js';
|
|
2
|
+
export type ClipboardIssue = "access-denied" | "empty" | "unsupported" | "document-changed";
|
|
2
3
|
export type ClipboardPasteMode = "rich" | "text" | "merge";
|
|
3
4
|
export interface ClipboardPasteDeps {
|
|
4
5
|
state: () => EditorState;
|
|
@@ -9,6 +10,7 @@ export interface ClipboardPasteDeps {
|
|
|
9
10
|
resetTransactionGrouping: () => void;
|
|
10
11
|
focusInput: () => void;
|
|
11
12
|
onError?: (error: unknown) => void;
|
|
13
|
+
onIssue?: (issue: ClipboardIssue) => void;
|
|
12
14
|
}
|
|
13
15
|
/** A permissions prompt may still deny access at runtime. */
|
|
14
16
|
export declare function canReadSystemClipboard(): boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { EditorState } from '../../core/model.js';
|
|
2
|
-
import { ClipboardPasteDeps } from './clipboardPaste.js';
|
|
2
|
+
import { ClipboardIssue, ClipboardPasteDeps } from './clipboardPaste.js';
|
|
3
3
|
/** Clipboard writes must be initiated from the user's gesture. */
|
|
4
4
|
export declare function canWriteSystemClipboard(): boolean;
|
|
5
5
|
/**
|
|
6
6
|
* A rejected write always returns false. In particular, Cut must not delete
|
|
7
7
|
* text because an asynchronous Clipboard API call was merely attempted.
|
|
8
8
|
*/
|
|
9
|
-
export declare function writeEditorSelectionToClipboard(snapshot: EditorState): Promise<boolean>;
|
|
9
|
+
export declare function writeEditorSelectionToClipboard(snapshot: EditorState, onIssue?: (issue: ClipboardIssue) => void): Promise<boolean>;
|
|
10
10
|
/** Atomic undoable deletion, only after successful clipboard write. */
|
|
11
11
|
export declare function cutEditorSelection(deps: ClipboardPasteDeps): Promise<boolean>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EditorClipboardActions } from './createEditorClipboardActions.js';
|
|
1
2
|
import { MergeKey } from '../../core/transactionMergeKeys.js';
|
|
2
3
|
import { EditorSelection, EditorState } from '../../core/model.js';
|
|
3
4
|
import { ToolbarStyleState } from '../toolbarStyleState.js';
|
|
@@ -18,6 +19,7 @@ interface ContextMenuState {
|
|
|
18
19
|
y: number;
|
|
19
20
|
}
|
|
20
21
|
export interface EditorChromeDeps {
|
|
22
|
+
clipboardActions?: EditorClipboardActions;
|
|
21
23
|
state: () => EditorState;
|
|
22
24
|
selection: () => EditorSelection;
|
|
23
25
|
toolbarStyleState: () => ToolbarStyleState;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ClipboardIssue, ClipboardPasteDeps, ClipboardPasteMode } from './clipboardPaste.js';
|
|
2
|
+
export interface ClipboardNotice {
|
|
3
|
+
action: "copy" | "cut" | "paste";
|
|
4
|
+
issue: ClipboardIssue;
|
|
5
|
+
mode?: ClipboardPasteMode;
|
|
6
|
+
}
|
|
7
|
+
/** One editor's actions, feedback and single-use native-paste fallback. */
|
|
8
|
+
export declare function createEditorClipboardActions(deps: ClipboardPasteDeps): ReturnType<typeof createClipboardActions>;
|
|
9
|
+
export type EditorClipboardActions = ReturnType<typeof createEditorClipboardActions>;
|
|
10
|
+
declare function createClipboardActions(deps: ClipboardPasteDeps): {
|
|
11
|
+
notice: import('solid-js').Accessor<ClipboardNotice | undefined>;
|
|
12
|
+
dismiss: () => void;
|
|
13
|
+
consumePasteMode: () => ClipboardPasteMode | undefined;
|
|
14
|
+
copy: () => Promise<boolean>;
|
|
15
|
+
cut: () => Promise<boolean>;
|
|
16
|
+
paste: (mode?: ClipboardPasteMode) => Promise<boolean>;
|
|
17
|
+
hasSelection: () => boolean;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EditorClipboardActions } from './createEditorClipboardActions.js';
|
|
1
2
|
import { BooleanStyleKey } from '../toolbarStyleState.js';
|
|
2
3
|
import { EditorState } from '../../core/model.js';
|
|
3
4
|
import { EditorLogger } from '../../utils/logger.js';
|
|
@@ -17,6 +18,7 @@ interface LinkDialogSetter {
|
|
|
17
18
|
}): void;
|
|
18
19
|
}
|
|
19
20
|
export interface EditorCommandRuntimeDeps {
|
|
21
|
+
clipboardActions?: EditorClipboardActions;
|
|
20
22
|
document: DocumentRuntime;
|
|
21
23
|
interaction: InteractionRuntime;
|
|
22
24
|
commentComposer: EditorCommentComposer;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EditorClipboardActions } from './createEditorClipboardActions.js';
|
|
1
2
|
import { EditorPosition, EditorState } from '../../core/model.js';
|
|
2
3
|
import { EditorLogger } from '../../utils/logger.js';
|
|
3
4
|
import { createEditorCommandsController } from '../../app/controllers/EditorCommandsController.js';
|
|
@@ -6,6 +7,7 @@ import { SelectedObjectRun } from '../../core/commands/selectedObjectRun.js';
|
|
|
6
7
|
type DocRuntime = ReturnType<typeof createEditorDocumentRuntime>;
|
|
7
8
|
type CommandsController = ReturnType<typeof createEditorCommandsController>;
|
|
8
9
|
export interface EditorInteractionRuntimeDeps {
|
|
10
|
+
clipboardActions?: EditorClipboardActions;
|
|
9
11
|
state: EditorState;
|
|
10
12
|
logger: EditorLogger;
|
|
11
13
|
isReadOnly: () => boolean;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { EssentialsBrowserCapability } from '../../../plugins/internal/essentialsCapabilities.js';
|
|
2
2
|
import { CreateEditorEssentialsPluginOptions } from './types.js';
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
* that currently holds focus. Keyboard copy through the editor input continues
|
|
6
|
-
* to use useEditorClipboard, preserving its existing rich-clipboard behavior.
|
|
7
|
-
*/
|
|
8
|
-
export declare function buildEssentialsBrowser(options: Pick<CreateEditorEssentialsPluginOptions, "state" | "isReadOnly" | "applyTransactionalState" | "tableOps" | "clearPreferredColumn" | "resetTransactionGrouping" | "focusInput">): EssentialsBrowserCapability;
|
|
3
|
+
/** Ribbon and context-menu actions share this editor's clipboard feedback. */
|
|
4
|
+
export declare function buildEssentialsBrowser(options: Pick<CreateEditorEssentialsPluginOptions, "state" | "isReadOnly" | "applyTransactionalState" | "tableOps" | "clearPreferredColumn" | "resetTransactionGrouping" | "focusInput" | "clipboardActions">): EssentialsBrowserCapability;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EditorClipboardActions } from '../createEditorClipboardActions.js';
|
|
1
2
|
import { MergeKey } from '../../../core/transactionMergeKeys.js';
|
|
2
3
|
import { EditorState } from '../../../core/model.js';
|
|
3
4
|
import { SelectedImageRun } from '../../../core/commands/image.js';
|
|
@@ -9,6 +10,7 @@ import { EditorCommentComposer } from '../createEditorCommentComposer.js';
|
|
|
9
10
|
import { createEditorTableOperations } from '../../../app/controllers/useEditorTableOperations.js';
|
|
10
11
|
import { EssentialsDesignCapability } from '../../../plugins/internal/essentialsCapabilities.js';
|
|
11
12
|
export interface CreateEditorEssentialsPluginOptions {
|
|
13
|
+
clipboardActions?: EditorClipboardActions;
|
|
12
14
|
design?: EssentialsDesignCapability;
|
|
13
15
|
state: () => EditorState;
|
|
14
16
|
isReadOnly: () => boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EditorClipboardActions } from './createEditorClipboardActions.js';
|
|
1
2
|
import { MergeKey } from '../../core/transactionMergeKeys.js';
|
|
2
3
|
import { EditorState } from '../../core/model.js';
|
|
3
4
|
import { TranslateFn } from '../../i18n/index.js';
|
|
@@ -9,6 +10,7 @@ interface ContextMenuState {
|
|
|
9
10
|
y: number;
|
|
10
11
|
}
|
|
11
12
|
export interface EditorContextMenuClipboardDeps {
|
|
13
|
+
clipboardActions?: EditorClipboardActions;
|
|
12
14
|
state: () => EditorState;
|
|
13
15
|
isReadOnly: () => boolean;
|
|
14
16
|
t: TranslateFn;
|
|
@@ -53,8 +55,8 @@ declare function createEditorContextMenuClipboardImpl(deps: EditorContextMenuCli
|
|
|
53
55
|
buildContextMenuItems: () => ContextMenuItem[];
|
|
54
56
|
closeContextMenu: () => void;
|
|
55
57
|
handleEditorContextMenu: (event: MouseEvent) => void;
|
|
56
|
-
programmaticCopy: () => Promise<
|
|
57
|
-
programmaticCut: () => Promise<
|
|
58
|
-
programmaticPaste: () => Promise<
|
|
58
|
+
programmaticCopy: () => Promise<boolean>;
|
|
59
|
+
programmaticCut: () => Promise<boolean>;
|
|
60
|
+
programmaticPaste: () => Promise<boolean>;
|
|
59
61
|
};
|
|
60
62
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EditorClipboardActions } from './createEditorClipboardActions.js';
|
|
1
2
|
import { EditorState } from '../../core/model.js';
|
|
2
3
|
import { EditorLogger } from '../../utils/logger.js';
|
|
3
4
|
import { createEditorClipboardController } from '../../app/controllers/useEditorClipboard.js';
|
|
@@ -25,6 +26,7 @@ type ClipboardParams = Parameters<typeof createEditorClipboardController>[0];
|
|
|
25
26
|
* the pointer/keyboard interaction controllers on top of them.
|
|
26
27
|
*/
|
|
27
28
|
export interface EditorInteractionWiringContext {
|
|
29
|
+
clipboardActions?: EditorClipboardActions;
|
|
28
30
|
state: EditorState;
|
|
29
31
|
applyState: NavigationParams["applyState"];
|
|
30
32
|
applyTransactionalState: TextDragParams["applyTransactionalState"];
|
|
@@ -3,5 +3,7 @@ export interface PopoverBranch {
|
|
|
3
3
|
open: () => boolean;
|
|
4
4
|
contains: (target: Node) => boolean;
|
|
5
5
|
children: Set<PopoverBranch>;
|
|
6
|
+
/** A chosen action ends this menu path; opening a child does not. */
|
|
7
|
+
closeAll: () => void;
|
|
6
8
|
}
|
|
7
9
|
export declare const PopoverBranchContext: import('solid-js').Context<PopoverBranch | undefined>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oasis-editor",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.232",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -77,7 +77,8 @@
|
|
|
77
77
|
"test:ribbon:ci": "node scripts/verify-ribbon-ci.mjs",
|
|
78
78
|
"test:ribbon:contexts": "node scripts/verify-ribbon-contexts.mjs",
|
|
79
79
|
"test:ribbon:icons": "node scripts/verify-ribbon-icons.mjs",
|
|
80
|
-
"test:ribbon:editing": "node scripts/verify-ribbon-editing.mjs"
|
|
80
|
+
"test:ribbon:editing": "node scripts/verify-ribbon-editing.mjs",
|
|
81
|
+
"test:ribbon:clipboard": "node scripts/verify-ribbon-clipboard.mjs"
|
|
81
82
|
},
|
|
82
83
|
"devDependencies": {
|
|
83
84
|
"@eslint/js": "^10.0.1",
|