@zipify/wysiwyg 1.0.0-dev.84 → 1.0.0-dev.87
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 +10 -10
- package/lib/Wysiwyg.vue +7 -8
- package/lib/composables/useToolbar.js +4 -6
- package/package.json +1 -1
package/dist/wysiwyg.mjs
CHANGED
|
@@ -22824,12 +22824,12 @@ 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,
|
|
22827
|
+
function useToolbar({ wrapperRef, offsets, isActiveRef, placementRef }) {
|
|
22828
22828
|
const wrapperEl = useElementRef(wrapperRef);
|
|
22829
22829
|
let popper2;
|
|
22830
22830
|
function mount(element) {
|
|
22831
22831
|
popper2 = createPopper(wrapperEl.value, element, {
|
|
22832
|
-
placement:
|
|
22832
|
+
placement: placementRef.value,
|
|
22833
22833
|
modifiers: [
|
|
22834
22834
|
{
|
|
22835
22835
|
name: "offset",
|
|
@@ -22839,13 +22839,12 @@ function useToolbar({ wrapperRef, scrollerRootRef, offsets, isActiveRef }) {
|
|
|
22839
22839
|
name: "preventOverflow",
|
|
22840
22840
|
options: {
|
|
22841
22841
|
altAxis: true,
|
|
22842
|
-
padding: 2
|
|
22843
|
-
boundary: ContextWindow.window
|
|
22842
|
+
padding: 2
|
|
22844
22843
|
}
|
|
22845
22844
|
},
|
|
22846
22845
|
{
|
|
22847
22846
|
name: "flip",
|
|
22848
|
-
|
|
22847
|
+
enabled: false
|
|
22849
22848
|
}
|
|
22850
22849
|
]
|
|
22851
22850
|
});
|
|
@@ -25884,6 +25883,11 @@ const __vue2_script = {
|
|
|
25884
25883
|
required: false,
|
|
25885
25884
|
default: () => [0, 8]
|
|
25886
25885
|
},
|
|
25886
|
+
toolbarPlacement: {
|
|
25887
|
+
type: String,
|
|
25888
|
+
required: true,
|
|
25889
|
+
default: "top-start"
|
|
25890
|
+
},
|
|
25887
25891
|
baseListClass: {
|
|
25888
25892
|
type: String,
|
|
25889
25893
|
required: false,
|
|
@@ -25906,10 +25910,6 @@ const __vue2_script = {
|
|
|
25906
25910
|
window: {
|
|
25907
25911
|
required: false,
|
|
25908
25912
|
default: () => window
|
|
25909
|
-
},
|
|
25910
|
-
scrollerRoot: {
|
|
25911
|
-
required: false,
|
|
25912
|
-
default: () => document.body
|
|
25913
25913
|
}
|
|
25914
25914
|
},
|
|
25915
25915
|
emits: [
|
|
@@ -25928,7 +25928,7 @@ const __vue2_script = {
|
|
|
25928
25928
|
const isToolbarActiveRef = computed(() => props.active && !props.readonly);
|
|
25929
25929
|
const toolbar = useToolbar({
|
|
25930
25930
|
wrapperRef: wysiwygRef,
|
|
25931
|
-
|
|
25931
|
+
placementRef: toRef(props, "toolbarPlacement"),
|
|
25932
25932
|
isActiveRef: isToolbarActiveRef,
|
|
25933
25933
|
offsets: props.toolbarOffsets
|
|
25934
25934
|
});
|
package/lib/Wysiwyg.vue
CHANGED
|
@@ -96,6 +96,12 @@ export default {
|
|
|
96
96
|
default: () => [0, 8]
|
|
97
97
|
},
|
|
98
98
|
|
|
99
|
+
toolbarPlacement: {
|
|
100
|
+
type: String,
|
|
101
|
+
required: true,
|
|
102
|
+
default: 'top-start'
|
|
103
|
+
},
|
|
104
|
+
|
|
99
105
|
baseListClass: {
|
|
100
106
|
type: String,
|
|
101
107
|
required: false,
|
|
@@ -125,13 +131,6 @@ export default {
|
|
|
125
131
|
window: {
|
|
126
132
|
required: false,
|
|
127
133
|
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
|
|
135
134
|
}
|
|
136
135
|
},
|
|
137
136
|
|
|
@@ -151,7 +150,7 @@ export default {
|
|
|
151
150
|
|
|
152
151
|
const toolbar = useToolbar({
|
|
153
152
|
wrapperRef: wysiwygRef,
|
|
154
|
-
|
|
153
|
+
placementRef: toRef(props, 'toolbarPlacement'),
|
|
155
154
|
isActiveRef: isToolbarActiveRef,
|
|
156
155
|
offsets: props.toolbarOffsets
|
|
157
156
|
});
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { createPopper } from '@popperjs/core';
|
|
2
2
|
import { useElementRef } from '../components/base';
|
|
3
|
-
import { ContextWindow } from '../services';
|
|
4
3
|
|
|
5
|
-
export function useToolbar({ wrapperRef,
|
|
4
|
+
export function useToolbar({ wrapperRef, offsets, isActiveRef, placementRef }) {
|
|
6
5
|
const wrapperEl = useElementRef(wrapperRef);
|
|
7
6
|
let popper;
|
|
8
7
|
|
|
9
8
|
function mount(element) {
|
|
10
9
|
popper = createPopper(wrapperEl.value, element, {
|
|
11
|
-
placement:
|
|
10
|
+
placement: placementRef.value,
|
|
12
11
|
modifiers: [
|
|
13
12
|
{
|
|
14
13
|
name: 'offset',
|
|
@@ -18,13 +17,12 @@ export function useToolbar({ wrapperRef, scrollerRootRef, offsets, isActiveRef }
|
|
|
18
17
|
name: 'preventOverflow',
|
|
19
18
|
options: {
|
|
20
19
|
altAxis: true,
|
|
21
|
-
padding: 2
|
|
22
|
-
boundary: ContextWindow.window
|
|
20
|
+
padding: 2
|
|
23
21
|
}
|
|
24
22
|
},
|
|
25
23
|
{
|
|
26
24
|
name: 'flip',
|
|
27
|
-
|
|
25
|
+
enabled: false
|
|
28
26
|
}
|
|
29
27
|
]
|
|
30
28
|
});
|