@zipify/wysiwyg 1.0.0-dev.81 → 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.css +11 -11
- package/dist/wysiwyg.mjs +10 -5
- package/lib/Wysiwyg.vue +8 -0
- package/lib/components/toolbar/Toolbar.vue +1 -1
- package/lib/composables/useToolbar.js +5 -4
- package/package.json +1 -1
package/dist/wysiwyg.css
CHANGED
|
@@ -631,16 +631,16 @@
|
|
|
631
631
|
width: 234px;
|
|
632
632
|
}
|
|
633
633
|
|
|
634
|
-
.zw-toolbar[data-v-
|
|
634
|
+
.zw-toolbar[data-v-a84e0da4] {
|
|
635
635
|
border-radius: 2px;
|
|
636
636
|
background-color: rgb(var(--zw-color-n15));
|
|
637
637
|
color: rgb(var(--zw-color-n70));
|
|
638
638
|
z-index: 999999;
|
|
639
639
|
text-align: left;
|
|
640
|
-
position:
|
|
640
|
+
position: absolute;
|
|
641
641
|
}
|
|
642
|
-
.zw-toolbar[data-v-
|
|
643
|
-
.zw-toolbar[data-v-
|
|
642
|
+
.zw-toolbar[data-v-a84e0da4]::before,
|
|
643
|
+
.zw-toolbar[data-v-a84e0da4]::after {
|
|
644
644
|
content: "";
|
|
645
645
|
display: block;
|
|
646
646
|
width: 100%;
|
|
@@ -648,21 +648,21 @@
|
|
|
648
648
|
position: absolute;
|
|
649
649
|
--zw-toolbar-safe-zone: calc(-1 * var(--zw-toolbar-offset-y));
|
|
650
650
|
}
|
|
651
|
-
.zw-toolbar[data-v-
|
|
651
|
+
.zw-toolbar[data-v-a84e0da4]::before {
|
|
652
652
|
top: var(--zw-toolbar-safe-zone);
|
|
653
653
|
}
|
|
654
|
-
.zw-toolbar[data-v-
|
|
654
|
+
.zw-toolbar[data-v-a84e0da4]::after {
|
|
655
655
|
bottom: var(--zw-toolbar-safe-zone);
|
|
656
656
|
}
|
|
657
|
-
.zw-toolbar--enter-active[data-v-
|
|
658
|
-
.zw-toolbar--leave-active[data-v-
|
|
657
|
+
.zw-toolbar--enter-active[data-v-a84e0da4],
|
|
658
|
+
.zw-toolbar--leave-active[data-v-a84e0da4] {
|
|
659
659
|
transition: opacity 150ms ease-out;
|
|
660
660
|
}
|
|
661
|
-
.zw-toolbar--leave-active[data-v-
|
|
661
|
+
.zw-toolbar--leave-active[data-v-a84e0da4] {
|
|
662
662
|
transition: opacity 0s ease-in;
|
|
663
663
|
}
|
|
664
|
-
.zw-toolbar--enter[data-v-
|
|
665
|
-
.zw-toolbar--leave-to[data-v-
|
|
664
|
+
.zw-toolbar--enter[data-v-a84e0da4],
|
|
665
|
+
.zw-toolbar--leave-to[data-v-a84e0da4] {
|
|
666
666
|
opacity: 0;
|
|
667
667
|
}
|
|
668
668
|
.zw-wysiwyg {
|
package/dist/wysiwyg.mjs
CHANGED
|
@@ -22793,7 +22793,7 @@ var __component__$1 = /* @__PURE__ */ normalizeComponent(
|
|
|
22793
22793
|
staticRenderFns$1,
|
|
22794
22794
|
false,
|
|
22795
22795
|
__vue2_injectStyles$1,
|
|
22796
|
-
"
|
|
22796
|
+
"a84e0da4",
|
|
22797
22797
|
null,
|
|
22798
22798
|
null
|
|
22799
22799
|
);
|
|
@@ -22824,13 +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, scrollerRootRef, offsets, isActiveRef }) {
|
|
22828
22828
|
const wrapperEl = useElementRef(wrapperRef);
|
|
22829
22829
|
let popper2;
|
|
22830
22830
|
function mount(element) {
|
|
22831
22831
|
popper2 = createPopper(wrapperEl.value, element, {
|
|
22832
22832
|
placement: "top-start",
|
|
22833
|
-
strategy: "fixed",
|
|
22834
22833
|
modifiers: [
|
|
22835
22834
|
{
|
|
22836
22835
|
name: "offset",
|
|
@@ -22840,12 +22839,13 @@ function useToolbar({ wrapperRef, offsets, isActiveRef }) {
|
|
|
22840
22839
|
name: "preventOverflow",
|
|
22841
22840
|
options: {
|
|
22842
22841
|
altAxis: true,
|
|
22843
|
-
padding: 2
|
|
22842
|
+
padding: 2,
|
|
22843
|
+
boundary: ContextWindow.window
|
|
22844
22844
|
}
|
|
22845
22845
|
},
|
|
22846
22846
|
{
|
|
22847
22847
|
name: "flip",
|
|
22848
|
-
options: {
|
|
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
|
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createPopper } from '@popperjs/core';
|
|
2
2
|
import { useElementRef } from '../components/base';
|
|
3
|
+
import { ContextWindow } from '../services';
|
|
3
4
|
|
|
4
|
-
export function useToolbar({ wrapperRef, offsets, isActiveRef }) {
|
|
5
|
+
export function useToolbar({ wrapperRef, scrollerRootRef, offsets, isActiveRef }) {
|
|
5
6
|
const wrapperEl = useElementRef(wrapperRef);
|
|
6
7
|
let popper;
|
|
7
8
|
|
|
8
9
|
function mount(element) {
|
|
9
10
|
popper = createPopper(wrapperEl.value, element, {
|
|
10
11
|
placement: 'top-start',
|
|
11
|
-
strategy: 'fixed',
|
|
12
12
|
modifiers: [
|
|
13
13
|
{
|
|
14
14
|
name: 'offset',
|
|
@@ -18,12 +18,13 @@ export function useToolbar({ wrapperRef, offsets, isActiveRef }) {
|
|
|
18
18
|
name: 'preventOverflow',
|
|
19
19
|
options: {
|
|
20
20
|
altAxis: true,
|
|
21
|
-
padding: 2
|
|
21
|
+
padding: 2,
|
|
22
|
+
boundary: ContextWindow.window
|
|
22
23
|
}
|
|
23
24
|
},
|
|
24
25
|
{
|
|
25
26
|
name: 'flip',
|
|
26
|
-
options: {
|
|
27
|
+
options: { boundary: scrollerRootRef.value }
|
|
27
28
|
}
|
|
28
29
|
]
|
|
29
30
|
});
|