@zipify/wysiwyg 1.0.0-dev.85 → 1.0.0-dev.88
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 +12 -4
- package/lib/Wysiwyg.vue +7 -0
- package/lib/composables/useToolbar.js +3 -3
- package/lib/extensions/list/List.js +3 -1
- 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, offsets, isActiveRef }) {
|
|
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",
|
|
@@ -22844,7 +22844,7 @@ function useToolbar({ wrapperRef, offsets, isActiveRef }) {
|
|
|
22844
22844
|
},
|
|
22845
22845
|
{
|
|
22846
22846
|
name: "flip",
|
|
22847
|
-
|
|
22847
|
+
enabled: false
|
|
22848
22848
|
}
|
|
22849
22849
|
]
|
|
22850
22850
|
});
|
|
@@ -23752,7 +23752,9 @@ const List = Node$1.create({
|
|
|
23752
23752
|
baseClass: ""
|
|
23753
23753
|
}),
|
|
23754
23754
|
addAttributes: () => ({
|
|
23755
|
-
bullet: {
|
|
23755
|
+
bullet: {
|
|
23756
|
+
default: { type: ListTypes.DISC }
|
|
23757
|
+
}
|
|
23756
23758
|
}),
|
|
23757
23759
|
parseHTML() {
|
|
23758
23760
|
const HTML_TYPES = {
|
|
@@ -25883,6 +25885,11 @@ const __vue2_script = {
|
|
|
25883
25885
|
required: false,
|
|
25884
25886
|
default: () => [0, 8]
|
|
25885
25887
|
},
|
|
25888
|
+
toolbarPlacement: {
|
|
25889
|
+
type: String,
|
|
25890
|
+
required: false,
|
|
25891
|
+
default: "top-start"
|
|
25892
|
+
},
|
|
25886
25893
|
baseListClass: {
|
|
25887
25894
|
type: String,
|
|
25888
25895
|
required: false,
|
|
@@ -25923,6 +25930,7 @@ const __vue2_script = {
|
|
|
25923
25930
|
const isToolbarActiveRef = computed(() => props.active && !props.readonly);
|
|
25924
25931
|
const toolbar = useToolbar({
|
|
25925
25932
|
wrapperRef: wysiwygRef,
|
|
25933
|
+
placementRef: toRef(props, "toolbarPlacement"),
|
|
25926
25934
|
isActiveRef: isToolbarActiveRef,
|
|
25927
25935
|
offsets: props.toolbarOffsets
|
|
25928
25936
|
});
|
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
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createPopper } from '@popperjs/core';
|
|
2
2
|
import { useElementRef } from '../components/base';
|
|
3
3
|
|
|
4
|
-
export function useToolbar({ wrapperRef, offsets, isActiveRef }) {
|
|
4
|
+
export function useToolbar({ wrapperRef, offsets, isActiveRef, placementRef }) {
|
|
5
5
|
const wrapperEl = useElementRef(wrapperRef);
|
|
6
6
|
let popper;
|
|
7
7
|
|
|
8
8
|
function mount(element) {
|
|
9
9
|
popper = createPopper(wrapperEl.value, element, {
|
|
10
|
-
placement:
|
|
10
|
+
placement: placementRef.value,
|
|
11
11
|
modifiers: [
|
|
12
12
|
{
|
|
13
13
|
name: 'offset',
|
|
@@ -22,7 +22,7 @@ export function useToolbar({ wrapperRef, offsets, isActiveRef }) {
|
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
name: 'flip',
|
|
25
|
-
|
|
25
|
+
enabled: false
|
|
26
26
|
}
|
|
27
27
|
]
|
|
28
28
|
});
|