@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 CHANGED
@@ -631,16 +631,16 @@
631
631
  width: 234px;
632
632
  }
633
633
 
634
- .zw-toolbar[data-v-7afee166] {
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: fixed;
640
+ position: absolute;
641
641
  }
642
- .zw-toolbar[data-v-7afee166]::before,
643
- .zw-toolbar[data-v-7afee166]::after {
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-7afee166]::before {
651
+ .zw-toolbar[data-v-a84e0da4]::before {
652
652
  top: var(--zw-toolbar-safe-zone);
653
653
  }
654
- .zw-toolbar[data-v-7afee166]::after {
654
+ .zw-toolbar[data-v-a84e0da4]::after {
655
655
  bottom: var(--zw-toolbar-safe-zone);
656
656
  }
657
- .zw-toolbar--enter-active[data-v-7afee166],
658
- .zw-toolbar--leave-active[data-v-7afee166] {
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-7afee166] {
661
+ .zw-toolbar--leave-active[data-v-a84e0da4] {
662
662
  transition: opacity 0s ease-in;
663
663
  }
664
- .zw-toolbar--enter[data-v-7afee166],
665
- .zw-toolbar--leave-to[data-v-7afee166] {
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
- "7afee166",
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: { rootBoundary: "document" }
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
  });
@@ -61,7 +61,7 @@ export default {
61
61
  color: rgb(var(--zw-color-n70));
62
62
  z-index: 999999;
63
63
  text-align: left;
64
- position: fixed;
64
+ position: absolute;
65
65
  }
66
66
 
67
67
  .zw-toolbar::before,
@@ -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: { rootBoundary: 'document' }
27
+ options: { boundary: scrollerRootRef.value }
27
28
  }
28
29
  ]
29
30
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zipify/wysiwyg",
3
- "version": "1.0.0-dev.81",
3
+ "version": "1.0.0-dev.84",
4
4
  "description": "Zipify modification of TipTap text editor",
5
5
  "main": "dist/wysiwyg.mjs",
6
6
  "repository": {