@zipify/wysiwyg 1.0.0-dev.86 → 1.0.0-dev.89
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
CHANGED
|
@@ -18985,6 +18985,10 @@ function useModalToggler({ onBeforeOpened, onClosed, wrapperRef, modalRef } = {}
|
|
|
18985
18985
|
options: {
|
|
18986
18986
|
padding: 16
|
|
18987
18987
|
}
|
|
18988
|
+
},
|
|
18989
|
+
{
|
|
18990
|
+
name: "flip",
|
|
18991
|
+
enabled: false
|
|
18988
18992
|
}
|
|
18989
18993
|
]
|
|
18990
18994
|
});
|
|
@@ -22824,31 +22828,30 @@ function useEditor({ content, onChange, extensions: extensions2, isReadonlyRef }
|
|
|
22824
22828
|
watch(isReadonlyRef, (isReadonly) => editor.setEditable(!isReadonly), { immediate: true });
|
|
22825
22829
|
return editor;
|
|
22826
22830
|
}
|
|
22827
|
-
function useToolbar({ wrapperRef, offsets, isActiveRef }) {
|
|
22831
|
+
function useToolbar({ wrapperRef, offsets, isActiveRef, placementRef }) {
|
|
22828
22832
|
const wrapperEl = useElementRef(wrapperRef);
|
|
22829
22833
|
let popper2;
|
|
22830
22834
|
function mount(element) {
|
|
22831
|
-
const modifiers2 = [
|
|
22832
|
-
{
|
|
22833
|
-
name: "offset",
|
|
22834
|
-
options: { offset: offsets }
|
|
22835
|
-
},
|
|
22836
|
-
{
|
|
22837
|
-
name: "preventOverflow",
|
|
22838
|
-
options: {
|
|
22839
|
-
altAxis: true,
|
|
22840
|
-
padding: 2
|
|
22841
|
-
}
|
|
22842
|
-
},
|
|
22843
|
-
{
|
|
22844
|
-
name: "flip",
|
|
22845
|
-
options: { boundary: "document" }
|
|
22846
|
-
}
|
|
22847
|
-
];
|
|
22848
|
-
console.log(modifiers2, ContextWindow);
|
|
22849
22835
|
popper2 = createPopper(wrapperEl.value, element, {
|
|
22850
|
-
placement:
|
|
22851
|
-
|
|
22836
|
+
placement: placementRef.value,
|
|
22837
|
+
strategy: "fixed",
|
|
22838
|
+
modifiers: [
|
|
22839
|
+
{
|
|
22840
|
+
name: "offset",
|
|
22841
|
+
options: { offset: offsets }
|
|
22842
|
+
},
|
|
22843
|
+
{
|
|
22844
|
+
name: "preventOverflow",
|
|
22845
|
+
options: {
|
|
22846
|
+
altAxis: true,
|
|
22847
|
+
padding: 2
|
|
22848
|
+
}
|
|
22849
|
+
},
|
|
22850
|
+
{
|
|
22851
|
+
name: "flip",
|
|
22852
|
+
enabled: false
|
|
22853
|
+
}
|
|
22854
|
+
]
|
|
22852
22855
|
});
|
|
22853
22856
|
}
|
|
22854
22857
|
const update = () => popper2 == null ? void 0 : popper2.update();
|
|
@@ -23754,7 +23757,9 @@ const List = Node$1.create({
|
|
|
23754
23757
|
baseClass: ""
|
|
23755
23758
|
}),
|
|
23756
23759
|
addAttributes: () => ({
|
|
23757
|
-
bullet: {
|
|
23760
|
+
bullet: {
|
|
23761
|
+
default: { type: ListTypes.DISC }
|
|
23762
|
+
}
|
|
23758
23763
|
}),
|
|
23759
23764
|
parseHTML() {
|
|
23760
23765
|
const HTML_TYPES = {
|
|
@@ -25885,6 +25890,11 @@ const __vue2_script = {
|
|
|
25885
25890
|
required: false,
|
|
25886
25891
|
default: () => [0, 8]
|
|
25887
25892
|
},
|
|
25893
|
+
toolbarPlacement: {
|
|
25894
|
+
type: String,
|
|
25895
|
+
required: false,
|
|
25896
|
+
default: "top-start"
|
|
25897
|
+
},
|
|
25888
25898
|
baseListClass: {
|
|
25889
25899
|
type: String,
|
|
25890
25900
|
required: false,
|
|
@@ -25925,6 +25935,7 @@ const __vue2_script = {
|
|
|
25925
25935
|
const isToolbarActiveRef = computed(() => props.active && !props.readonly);
|
|
25926
25936
|
const toolbar = useToolbar({
|
|
25927
25937
|
wrapperRef: wysiwygRef,
|
|
25938
|
+
placementRef: toRef(props, "toolbarPlacement"),
|
|
25928
25939
|
isActiveRef: isToolbarActiveRef,
|
|
25929
25940
|
offsets: props.toolbarOffsets
|
|
25930
25941
|
});
|
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: false,
|
|
102
|
+
default: 'top-start'
|
|
103
|
+
},
|
|
104
|
+
|
|
99
105
|
baseListClass: {
|
|
100
106
|
type: String,
|
|
101
107
|
required: false,
|
|
@@ -144,6 +150,7 @@ export default {
|
|
|
144
150
|
|
|
145
151
|
const toolbar = useToolbar({
|
|
146
152
|
wrapperRef: wysiwygRef,
|
|
153
|
+
placementRef: toRef(props, 'toolbarPlacement'),
|
|
147
154
|
isActiveRef: isToolbarActiveRef,
|
|
148
155
|
offsets: props.toolbarOffsets
|
|
149
156
|
});
|
|
@@ -22,12 +22,15 @@ export function useModalToggler({ onBeforeOpened, onClosed, wrapperRef, modalRef
|
|
|
22
22
|
offset: [0, 4]
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
|
|
26
25
|
{
|
|
27
26
|
name: 'preventOverflow',
|
|
28
27
|
options: {
|
|
29
28
|
padding: 16
|
|
30
29
|
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'flip',
|
|
33
|
+
enabled: false
|
|
31
34
|
}
|
|
32
35
|
]
|
|
33
36
|
});
|
|
@@ -1,36 +1,31 @@
|
|
|
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, offsets, isActiveRef }) {
|
|
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
|
-
const modifiers = [
|
|
11
|
-
{
|
|
12
|
-
name: 'offset',
|
|
13
|
-
options: { offset: offsets }
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: 'preventOverflow',
|
|
17
|
-
options: {
|
|
18
|
-
altAxis: true,
|
|
19
|
-
padding: 2
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
name: 'flip',
|
|
24
|
-
options: { boundary: 'document' }
|
|
25
|
-
}
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
// eslint-disable-next-line no-console
|
|
29
|
-
console.log(modifiers, ContextWindow);
|
|
30
|
-
|
|
31
9
|
popper = createPopper(wrapperEl.value, element, {
|
|
32
|
-
placement:
|
|
33
|
-
|
|
10
|
+
placement: placementRef.value,
|
|
11
|
+
strategy: 'fixed',
|
|
12
|
+
modifiers: [
|
|
13
|
+
{
|
|
14
|
+
name: 'offset',
|
|
15
|
+
options: { offset: offsets }
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'preventOverflow',
|
|
19
|
+
options: {
|
|
20
|
+
altAxis: true,
|
|
21
|
+
padding: 2
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'flip',
|
|
26
|
+
enabled: false
|
|
27
|
+
}
|
|
28
|
+
]
|
|
34
29
|
});
|
|
35
30
|
}
|
|
36
31
|
|