editate 0.7.0 → 0.7.2
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/lib/commands.d.ts +4 -4
- package/lib/doc/types-infer.d.ts +11 -13
- package/lib/index.cjs +320 -284
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +339 -301
- package/lib/index.js.map +1 -1
- package/lib/plugins/index.d.ts +1 -0
- package/lib/plugins/restoreSelection.d.ts +5 -0
- package/lib/plugins/transfer/htmlTransfer.d.ts +2 -0
- package/lib/plugins/transfer/internalTransfer.d.ts +2 -0
- package/package.json +2 -1
package/lib/plugins/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { blockLockPlugin, LockedInRange } from './blockLock.js';
|
|
|
3
3
|
export { debugPlugin } from './debug.js';
|
|
4
4
|
export { keymapPlugin } from './keymap.js';
|
|
5
5
|
export { Undo, Redo, Undoable, Redoable, ClearHistory } from './history.js';
|
|
6
|
+
export { restoreSelectionPlugin } from './restoreSelection.js';
|
|
6
7
|
export { scrollToSelectionPlugin } from './scrollToSelection.js';
|
|
7
8
|
export { nodeIdPlugin, NodeId } from './nodeId.js';
|
|
8
9
|
export { selectionRectPlugin } from './selectionRect.js';
|
|
@@ -8,6 +8,8 @@ type HtmlSerializers<T extends DocNode> = Partial<{
|
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
10
|
* A plugin to handle copying / pasting HTML
|
|
11
|
+
*
|
|
12
|
+
* Under [Trusted Types](https://developer.mozilla.org/en-US/docs/Web/API/Trusted_Types_API), pasted HTML is parsed through a policy named `editate`.
|
|
11
13
|
*/
|
|
12
14
|
export declare function htmlTransferPlugin<T extends DocNode>(editor: Editor<T>, options: {
|
|
13
15
|
serializers: HtmlSerializers<T>;
|
|
@@ -2,6 +2,8 @@ import { Editor } from '../../editor.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* A plugin to handle copying / pasting between editor instances
|
|
4
4
|
*
|
|
5
|
+
* Any website can write data of `options.mime` type to the clipboard, and it's pasted as is, so validate it with {@link EditorOptions.schema}.
|
|
6
|
+
*
|
|
5
7
|
* @param options.mime A MIME type to store the copied fragment in clipboard. Give an app specific one if the schema is not shared with other editate based apps.
|
|
6
8
|
* @defaultValue `"application/x-editate-editor"`
|
|
7
9
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "editate",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "An experimental, type-safe, framework agnostic and small (5kB+) contenteditable state manager.",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"@types/prismjs": "^1.26.6",
|
|
51
51
|
"@types/react": "^19.3.0",
|
|
52
52
|
"@types/react-dom": "^19.3.0",
|
|
53
|
+
"@types/trusted-types": "^2.0.7",
|
|
53
54
|
"@vitest/browser-playwright": "^5.1.0",
|
|
54
55
|
"ai": "^7.0.164",
|
|
55
56
|
"diff": "^9.0.0",
|