@heyirisai/docx-editor-vue 1.9.0
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/LICENSE +201 -0
- package/README.md +116 -0
- package/dist/KeyboardShortcutsDialog-B0fEvXnH.js +2799 -0
- package/dist/KeyboardShortcutsDialog-Cmezq6eJ.cjs +1 -0
- package/dist/RenderedDomContext-CHc18N_2.js +2 -0
- package/dist/TablePropertiesDialog-B6ncvNnv.cjs +1 -0
- package/dist/TablePropertiesDialog-P_vyKNTn.js +1145 -0
- package/dist/_plugin-vue_export-helper-B52Kst-M.js +8 -0
- package/dist/_plugin-vue_export-helper-CX7YVcP6.cjs +1 -0
- package/dist/components/DocxEditor/types.d.ts +193 -0
- package/dist/components/EditorToolbarContext.d.ts +9 -0
- package/dist/components/Toolbar/presets.d.ts +20 -0
- package/dist/components/dialogs/index.d.ts +27 -0
- package/dist/components/imageContextMenuTypes.d.ts +30 -0
- package/dist/components/imageSelectionTypes.d.ts +14 -0
- package/dist/components/insertTableState.d.ts +9 -0
- package/dist/components/sidebar/cardStyles.d.ts +3 -0
- package/dist/components/sidebar/cardUtils.d.ts +1 -0
- package/dist/components/sidebar/resolveItemPositions.d.ts +4 -0
- package/dist/components/sidebar/sidebarUtils.d.ts +4 -0
- package/dist/components/tableStylePresets.d.ts +53 -0
- package/dist/components/toolbarUtils.d.ts +1 -0
- package/dist/components/ui/Icons.d.ts +1 -0
- package/dist/components/ui/fontPickerValue.d.ts +1 -0
- package/dist/components/ui/fontPickerValue.test.d.ts +1 -0
- package/dist/components/ui/hyperlinkPopupTypes.d.ts +20 -0
- package/dist/composables/fileOpen.test.d.ts +1 -0
- package/dist/composables/imageOverlayRect.d.ts +44 -0
- package/dist/composables/imageOverlayRect.test.d.ts +1 -0
- package/dist/composables/index.d.ts +30 -0
- package/dist/composables/useAutoSave.d.ts +40 -0
- package/dist/composables/useClipboard.d.ts +22 -0
- package/dist/composables/useColorMode.d.ts +8 -0
- package/dist/composables/useCommentLifecycle.d.ts +62 -0
- package/dist/composables/useCommentManagement.d.ts +68 -0
- package/dist/composables/useCommentSidebarItems.d.ts +24 -0
- package/dist/composables/useCommentSidebarItems.test.d.ts +1 -0
- package/dist/composables/useContextMenus.cut.test.d.ts +1 -0
- package/dist/composables/useContextMenus.d.ts +39 -0
- package/dist/composables/useControllableBoolean.d.ts +16 -0
- package/dist/composables/useControllableBoolean.test.d.ts +1 -0
- package/dist/composables/useDocumentLifecycle.d.ts +11 -0
- package/dist/composables/useDocxEditor.d.ts +96 -0
- package/dist/composables/useDocxEditorRefApi.d.ts +53 -0
- package/dist/composables/useDragAutoScroll.d.ts +11 -0
- package/dist/composables/useFileIO.d.ts +41 -0
- package/dist/composables/useFindReplace.d.ts +34 -0
- package/dist/composables/useFixedDropdown.d.ts +14 -0
- package/dist/composables/useFontLifecycle.d.ts +12 -0
- package/dist/composables/useFormattingActions.d.ts +31 -0
- package/dist/composables/useHistory.d.ts +9 -0
- package/dist/composables/useHostCallbacks.d.ts +7 -0
- package/dist/composables/useHyperlinkManagement.d.ts +38 -0
- package/dist/composables/useImageActions.d.ts +24 -0
- package/dist/composables/useKeyboardShortcuts.d.ts +25 -0
- package/dist/composables/useMenuActions.d.ts +26 -0
- package/dist/composables/useOutlineSidebar.d.ts +24 -0
- package/dist/composables/useOutlineSidebar.test.d.ts +1 -0
- package/dist/composables/usePageSetupControls.d.ts +22 -0
- package/dist/composables/usePagesPointer.d.ts +86 -0
- package/dist/composables/useParagraphStyleOptions.d.ts +18 -0
- package/dist/composables/usePortalClass.d.ts +8 -0
- package/dist/composables/useSelectionHighlight.d.ts +19 -0
- package/dist/composables/useSelectionSync.d.ts +36 -0
- package/dist/composables/useTableResize.d.ts +7 -0
- package/dist/composables/useTableSelection.d.ts +10 -0
- package/dist/composables/useToolbarDropdowns.d.ts +15 -0
- package/dist/composables/useToolbarFontSize.d.ts +15 -0
- package/dist/composables/useTrackedChanges.d.ts +12 -0
- package/dist/composables/useVisualLineNavigation.d.ts +11 -0
- package/dist/composables/useWatermarkControls.d.ts +15 -0
- package/dist/composables/useWheelZoom.d.ts +10 -0
- package/dist/composables/useZoom.d.ts +16 -0
- package/dist/composables.cjs +1 -0
- package/dist/composables.js +401 -0
- package/dist/dialogs.cjs +1 -0
- package/dist/dialogs.js +3 -0
- package/dist/docx-editor-vue.css +2 -0
- package/dist/i18n/LocaleContext.d.ts +1 -0
- package/dist/i18n/index.d.ts +26 -0
- package/dist/index.cjs +19 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +4449 -0
- package/dist/lib/utils.d.ts +10 -0
- package/dist/plugin-api/RenderedDomContext.d.ts +1 -0
- package/dist/plugin-api/index.d.ts +18 -0
- package/dist/plugin-api/types.d.ts +28 -0
- package/dist/plugin-api.cjs +1 -0
- package/dist/plugin-api.js +62 -0
- package/dist/renderAsync.d.ts +31 -0
- package/dist/styles/index.d.ts +12 -0
- package/dist/styles/zIndex.d.ts +24 -0
- package/dist/styles.cjs +1 -0
- package/dist/styles.js +5 -0
- package/dist/ui.cjs +18 -0
- package/dist/ui.d.ts +79 -0
- package/dist/ui.js +986 -0
- package/dist/useCommentSidebarItems-DBeGKNGA.cjs +1 -0
- package/dist/useCommentSidebarItems-DXbF857R.js +45 -0
- package/dist/useDragAutoScroll-CVltVfKK.js +520 -0
- package/dist/useDragAutoScroll-liP5PRvM.cjs +1 -0
- package/dist/usePortalClass-B9gFYxe0.cjs +4 -0
- package/dist/usePortalClass-HM-UHRlE.js +3534 -0
- package/dist/utils/domQueries.d.ts +39 -0
- package/dist/utils/imageClipboard.d.ts +9 -0
- package/dist/utils/refApiQueries.d.ts +10 -0
- package/dist/zIndex-CH0jZ7U7.cjs +1 -0
- package/dist/zIndex-CxELVe_L.js +12 -0
- package/package.json +119 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { EditorView } from 'prosemirror-view';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the painted header/footer instance nearest the viewport center — the
|
|
4
|
+
* one the user is editing. The same HF is painted on every page (shared
|
|
5
|
+
* `r:id`), so the chrome outline must track the active page rather than snap to
|
|
6
|
+
* page one's copy (mirrors core's `getHfDomSnapshot` host pick; #691).
|
|
7
|
+
*/
|
|
8
|
+
export declare function nearestHfHostEl(position: 'header' | 'footer'): HTMLElement | null;
|
|
9
|
+
/**
|
|
10
|
+
* Find the painted span containing `pmPos`. By default scoped to body spans
|
|
11
|
+
* (which carry both pmStart and pmEnd) so HF runs in the separate PM document
|
|
12
|
+
* don't mis-resolve double-/triple-click selection. When `hfSection` is set
|
|
13
|
+
* (the user is editing a header/footer), scope to that section's painted host
|
|
14
|
+
* instead — the HF spans live in `.layout-page-header` / `.layout-page-footer`
|
|
15
|
+
* and carry PM positions from the HF document, so resolving against body spans
|
|
16
|
+
* would compute word/paragraph bounds from the wrong text (#691).
|
|
17
|
+
*/
|
|
18
|
+
export declare function findElementAtPosition(container: HTMLElement, pmPos: number, hfSection?: 'header' | 'footer'): HTMLElement | null;
|
|
19
|
+
/**
|
|
20
|
+
* Smooth-scroll the viewport so the painted element at `pmPos` is
|
|
21
|
+
* visible (48px top padding). Falls back to a CSS attribute selector
|
|
22
|
+
* when no body span carries pmPos in its [start,end] range.
|
|
23
|
+
*/
|
|
24
|
+
export declare function scrollVisiblePositionIntoView(pagesContainer: HTMLElement | null, viewport: HTMLElement | null, pmPos: number): void;
|
|
25
|
+
/**
|
|
26
|
+
* Resolve a viewport-space click coordinate to a PM document position,
|
|
27
|
+
* clamped to `doc.content.size`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolvePos(pagesContainer: HTMLElement | null, view: EditorView | null, clientX: number, clientY: number): number | null;
|
|
30
|
+
/**
|
|
31
|
+
* Double-click word selection — expand `pos` to its word bounds and
|
|
32
|
+
* hand the resulting range to `setPmSelection`.
|
|
33
|
+
*/
|
|
34
|
+
export declare function selectWord(pagesContainer: HTMLElement | null, pos: number, setPmSelection: (from: number, to: number) => void, hfSection?: 'header' | 'footer'): void;
|
|
35
|
+
/**
|
|
36
|
+
* Triple-click paragraph selection — expand `pos` to the enclosing
|
|
37
|
+
* `.layout-paragraph` element's PM range.
|
|
38
|
+
*/
|
|
39
|
+
export declare function selectParagraph(pagesContainer: HTMLElement | null, pos: number, setPmSelection: (from: number, to: number) => void, hfSection?: 'header' | 'footer'): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EditorView } from 'prosemirror-view';
|
|
2
|
+
export declare function copyImageToClipboard(view: EditorView, pmPos: number): void;
|
|
3
|
+
export declare function blobToDataUrl(blob: Blob): Promise<string>;
|
|
4
|
+
export declare function loadImageDimensions(src: string): Promise<{
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function pasteFromClipboard(view: EditorView): Promise<void>;
|
|
9
|
+
export declare function triggerReplaceImage(view: EditorView, pmPos: number): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure ref-API query helpers — read-only inspectors over the PM document
|
|
3
|
+
* and the paginated layout. Used by DocxEditor's `defineExpose` ref API
|
|
4
|
+
* (`findInDocument`, `getSelectionInfo`, `getPageContent`).
|
|
5
|
+
*
|
|
6
|
+
* Lifted to `@heyirisai/docx-editor-core/prosemirror/queries` and shared
|
|
7
|
+
* with the React adapter; re-exported here to keep existing import sites stable.
|
|
8
|
+
*/
|
|
9
|
+
export { findInDocument, getSelectionInfo, getPageContent, } from '@heyirisai/docx-editor-core/prosemirror/queries';
|
|
10
|
+
export type { FindInDocumentMatch, SelectionInfo, PageContent, } from '@heyirisai/docx-editor-core/prosemirror/queries';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={selectionOverlay:10,decorationLayer:11,imageOverlay:15,hfInlineEditor:10,ruler:30,dropdown:100,contextMenu:1e4};Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
|
package/package.json
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@heyirisai/docx-editor-vue",
|
|
3
|
+
"version": "1.9.0",
|
|
4
|
+
"description": "Vue 3 DOCX editor adapter for @heyirisai/docx-editor-core.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./ui": {
|
|
16
|
+
"types": "./dist/ui.d.ts",
|
|
17
|
+
"import": "./dist/ui.js",
|
|
18
|
+
"require": "./dist/ui.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./composables": {
|
|
21
|
+
"types": "./dist/composables/index.d.ts",
|
|
22
|
+
"import": "./dist/composables.js",
|
|
23
|
+
"require": "./dist/composables.cjs"
|
|
24
|
+
},
|
|
25
|
+
"./dialogs": {
|
|
26
|
+
"types": "./dist/components/dialogs/index.d.ts",
|
|
27
|
+
"import": "./dist/dialogs.js",
|
|
28
|
+
"require": "./dist/dialogs.cjs"
|
|
29
|
+
},
|
|
30
|
+
"./plugin-api": {
|
|
31
|
+
"types": "./dist/plugin-api/index.d.ts",
|
|
32
|
+
"import": "./dist/plugin-api.js",
|
|
33
|
+
"require": "./dist/plugin-api.cjs"
|
|
34
|
+
},
|
|
35
|
+
"./styles": {
|
|
36
|
+
"types": "./dist/styles/index.d.ts",
|
|
37
|
+
"import": "./dist/styles.js",
|
|
38
|
+
"require": "./dist/styles.cjs"
|
|
39
|
+
},
|
|
40
|
+
"./styles.css": "./dist/docx-editor-vue.css"
|
|
41
|
+
},
|
|
42
|
+
"typesVersions": {
|
|
43
|
+
"*": {
|
|
44
|
+
"ui": [
|
|
45
|
+
"./dist/ui.d.ts"
|
|
46
|
+
],
|
|
47
|
+
"composables": [
|
|
48
|
+
"./dist/composables/index.d.ts"
|
|
49
|
+
],
|
|
50
|
+
"dialogs": [
|
|
51
|
+
"./dist/components/dialogs/index.d.ts"
|
|
52
|
+
],
|
|
53
|
+
"plugin-api": [
|
|
54
|
+
"./dist/plugin-api/index.d.ts"
|
|
55
|
+
],
|
|
56
|
+
"styles": [
|
|
57
|
+
"./dist/styles/index.d.ts"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"sideEffects": [
|
|
62
|
+
"*.css"
|
|
63
|
+
],
|
|
64
|
+
"files": [
|
|
65
|
+
"dist"
|
|
66
|
+
],
|
|
67
|
+
"scripts": {
|
|
68
|
+
"build": "vite build && node ../../scripts/inject-package-doc.mjs --package @heyirisai/docx-editor-vue",
|
|
69
|
+
"typecheck": "tsc --noEmit",
|
|
70
|
+
"api:extract": "node ../../scripts/api-extractor.mjs --package @heyirisai/docx-editor-vue --local",
|
|
71
|
+
"api:check": "node ../../scripts/api-extractor.mjs --package @heyirisai/docx-editor-vue"
|
|
72
|
+
},
|
|
73
|
+
"peerDependencies": {
|
|
74
|
+
"prosemirror-commands": "^1.5.2",
|
|
75
|
+
"prosemirror-dropcursor": "^1.8.2",
|
|
76
|
+
"prosemirror-history": "^1.4.0",
|
|
77
|
+
"prosemirror-keymap": "^1.2.2",
|
|
78
|
+
"prosemirror-model": "^1.19.4",
|
|
79
|
+
"prosemirror-state": "^1.4.3",
|
|
80
|
+
"prosemirror-tables": "^1.8.5",
|
|
81
|
+
"prosemirror-transform": "^1.12.0",
|
|
82
|
+
"prosemirror-view": "^1.41.6",
|
|
83
|
+
"vue": "^3.3.0"
|
|
84
|
+
},
|
|
85
|
+
"dependencies": {
|
|
86
|
+
"@heyirisai/docx-editor-agents": "^1.9.0",
|
|
87
|
+
"@heyirisai/docx-editor-core": "^1.9.0",
|
|
88
|
+
"@heyirisai/docx-editor-i18n": "^1.9.0"
|
|
89
|
+
},
|
|
90
|
+
"keywords": [
|
|
91
|
+
"docx",
|
|
92
|
+
"editor",
|
|
93
|
+
"vue",
|
|
94
|
+
"word",
|
|
95
|
+
"document"
|
|
96
|
+
],
|
|
97
|
+
"author": {
|
|
98
|
+
"name": "Jedr Blaszyk",
|
|
99
|
+
"email": "jedr@eigenpal.com",
|
|
100
|
+
"url": "https://github.com/jedrazb"
|
|
101
|
+
},
|
|
102
|
+
"license": "Apache-2.0",
|
|
103
|
+
"homepage": "https://docx-editor.dev/",
|
|
104
|
+
"repository": {
|
|
105
|
+
"type": "git",
|
|
106
|
+
"url": "https://github.com/eigenpal/docx-editor.git",
|
|
107
|
+
"directory": "packages/vue"
|
|
108
|
+
},
|
|
109
|
+
"publishConfig": {
|
|
110
|
+
"access": "public"
|
|
111
|
+
},
|
|
112
|
+
"devDependencies": {
|
|
113
|
+
"prosemirror-history": "^1.4.0",
|
|
114
|
+
"prosemirror-model": "^1.25.4",
|
|
115
|
+
"prosemirror-state": "^1.4.3",
|
|
116
|
+
"prosemirror-view": "^1.41.6",
|
|
117
|
+
"vite-plugin-dts": "^5.0.0"
|
|
118
|
+
}
|
|
119
|
+
}
|