@zipify/wysiwyg 1.0.0-dev.83 → 1.0.0-dev.84
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/wysiwyg.mjs +7 -2
- package/lib/Wysiwyg.vue +8 -0
- package/lib/composables/useToolbar.js +2 -2
- package/package.json +1 -1
package/dist/wysiwyg.mjs
CHANGED
|
@@ -22824,7 +22824,7 @@ function useEditor({ content, onChange, extensions: extensions2, isReadonlyRef }
|
|
|
22824
22824
|
watch(isReadonlyRef, (isReadonly) => editor.setEditable(!isReadonly), { immediate: true });
|
|
22825
22825
|
return editor;
|
|
22826
22826
|
}
|
|
22827
|
-
function useToolbar({ wrapperRef, offsets, isActiveRef }) {
|
|
22827
|
+
function useToolbar({ wrapperRef, scrollerRootRef, offsets, isActiveRef }) {
|
|
22828
22828
|
const wrapperEl = useElementRef(wrapperRef);
|
|
22829
22829
|
let popper2;
|
|
22830
22830
|
function mount(element) {
|
|
@@ -22845,7 +22845,7 @@ function useToolbar({ wrapperRef, offsets, isActiveRef }) {
|
|
|
22845
22845
|
},
|
|
22846
22846
|
{
|
|
22847
22847
|
name: "flip",
|
|
22848
|
-
options: { boundary:
|
|
22848
|
+
options: { boundary: scrollerRootRef.value }
|
|
22849
22849
|
}
|
|
22850
22850
|
]
|
|
22851
22851
|
});
|
|
@@ -25906,6 +25906,10 @@ const __vue2_script = {
|
|
|
25906
25906
|
window: {
|
|
25907
25907
|
required: false,
|
|
25908
25908
|
default: () => window
|
|
25909
|
+
},
|
|
25910
|
+
scrollerRoot: {
|
|
25911
|
+
required: false,
|
|
25912
|
+
default: () => document.body
|
|
25909
25913
|
}
|
|
25910
25914
|
},
|
|
25911
25915
|
emits: [
|
|
@@ -25924,6 +25928,7 @@ const __vue2_script = {
|
|
|
25924
25928
|
const isToolbarActiveRef = computed(() => props.active && !props.readonly);
|
|
25925
25929
|
const toolbar = useToolbar({
|
|
25926
25930
|
wrapperRef: wysiwygRef,
|
|
25931
|
+
scrollerRootRef: toRef(props, "scrollerRoot"),
|
|
25927
25932
|
isActiveRef: isToolbarActiveRef,
|
|
25928
25933
|
offsets: props.toolbarOffsets
|
|
25929
25934
|
});
|
package/lib/Wysiwyg.vue
CHANGED
|
@@ -125,6 +125,13 @@ export default {
|
|
|
125
125
|
window: {
|
|
126
126
|
required: false,
|
|
127
127
|
default: () => window
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
// Requires HTMLElement type but it different in iframe and outside
|
|
131
|
+
// eslint-disable-next-line vue/require-prop-types
|
|
132
|
+
scrollerRoot: {
|
|
133
|
+
required: false,
|
|
134
|
+
default: () => document.body
|
|
128
135
|
}
|
|
129
136
|
},
|
|
130
137
|
|
|
@@ -144,6 +151,7 @@ export default {
|
|
|
144
151
|
|
|
145
152
|
const toolbar = useToolbar({
|
|
146
153
|
wrapperRef: wysiwygRef,
|
|
154
|
+
scrollerRootRef: toRef(props, 'scrollerRoot'),
|
|
147
155
|
isActiveRef: isToolbarActiveRef,
|
|
148
156
|
offsets: props.toolbarOffsets
|
|
149
157
|
});
|
|
@@ -2,7 +2,7 @@ import { createPopper } from '@popperjs/core';
|
|
|
2
2
|
import { useElementRef } from '../components/base';
|
|
3
3
|
import { ContextWindow } from '../services';
|
|
4
4
|
|
|
5
|
-
export function useToolbar({ wrapperRef, offsets, isActiveRef }) {
|
|
5
|
+
export function useToolbar({ wrapperRef, scrollerRootRef, offsets, isActiveRef }) {
|
|
6
6
|
const wrapperEl = useElementRef(wrapperRef);
|
|
7
7
|
let popper;
|
|
8
8
|
|
|
@@ -24,7 +24,7 @@ export function useToolbar({ wrapperRef, offsets, isActiveRef }) {
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
name: 'flip',
|
|
27
|
-
options: { boundary:
|
|
27
|
+
options: { boundary: scrollerRootRef.value }
|
|
28
28
|
}
|
|
29
29
|
]
|
|
30
30
|
});
|