@zipify/wysiwyg 1.0.0-dev.48 → 1.0.0-dev.50

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/lib/Wysiwyg.vue CHANGED
@@ -110,6 +110,11 @@ export default {
110
110
  }
111
111
  },
112
112
 
113
+ emits: [
114
+ 'input',
115
+ 'updateFavoriteColors'
116
+ ],
117
+
113
118
  setup(props, { emit }) {
114
119
  ContextWindow.use(props.window);
115
120
 
@@ -123,10 +128,11 @@ export default {
123
128
  isActiveRef: toRef(props, 'active'),
124
129
  offsets: props.toolbarOffsets
125
130
  });
131
+ const updateToolbar = () => toolbar.update();
126
132
 
127
133
  function onChange(content) {
128
134
  emit('input', content);
129
- toolbar.update();
135
+ updateToolbar();
130
136
  }
131
137
 
132
138
  const pageBlocks = toRef(props, 'pageBlocks');
@@ -166,7 +172,13 @@ export default {
166
172
  provide(InjectionTokens.FAVORITE_COLORS, favoriteColors);
167
173
  provide(InjectionTokens.PAGE_BLOCKS, pageBlocks);
168
174
 
169
- return { editor, toolbarRef, wysiwygRef, toolbar };
175
+ return {
176
+ editor,
177
+ toolbarRef,
178
+ wysiwygRef,
179
+ toolbar,
180
+ updateToolbar
181
+ };
170
182
  }
171
183
  };
172
184
  </script>
@@ -3,10 +3,10 @@ import { useElementRef } from '../components/base';
3
3
 
4
4
  export function useToolbar({ wrapperRef, offsets, isActiveRef }) {
5
5
  const wrapperEl = useElementRef(wrapperRef);
6
- let toolbar;
6
+ let popper;
7
7
 
8
8
  function mount(element) {
9
- toolbar = createPopper(wrapperEl.value, element, {
9
+ popper = createPopper(wrapperEl.value, element, {
10
10
  placement: 'top-start',
11
11
  modifiers: [
12
12
  {
@@ -28,10 +28,9 @@ export function useToolbar({ wrapperRef, offsets, isActiveRef }) {
28
28
  });
29
29
  }
30
30
 
31
- const update = () => toolbar?.update();
31
+ const update = () => popper?.update();
32
32
 
33
33
  return {
34
- toolbar,
35
34
  update,
36
35
  mount,
37
36
  isActiveRef,
@@ -150,9 +150,14 @@ export const StylePreset = Extension.create({
150
150
  .run();
151
151
  }),
152
152
 
153
- removeFormat: createCommand(({ commands }) => {
154
- commands.removePresetCustomization();
155
- commands.applyDefaultPreset();
153
+ removeFormat: createCommand(({ chain }) => {
154
+ chain()
155
+ .storeSelection()
156
+ .expandSelectionToBlock()
157
+ .unsetAllMarks()
158
+ .applyDefaultPreset()
159
+ .restoreSelection()
160
+ .run();
156
161
  })
157
162
  };
158
163
  },
@@ -10,7 +10,7 @@
10
10
  pointer-events: none;
11
11
  }
12
12
 
13
- .zw-style {
13
+ .zw-style.zw-style.zw-style {
14
14
  font-weight: var(--zw-font-weight, var(--zw-preset-font-weight));
15
15
  font-family: var(--zw-font-family, var(--zw-preset-font-family));
16
16
  color: var(--zw-font-color, var(--zw-preset-color));
@@ -21,7 +21,7 @@
21
21
 
22
22
  @media (min-width: 1200px) {
23
23
 
24
- .zw-style {
24
+ .zw-style.zw-style.zw-style {
25
25
  font-size: var(--zw-font-size-desktop, var(--zw-preset-desktop-font-size));
26
26
  text-align: var(--zw-text-align-desktop, var(--zw-preset-desktop-text-align));
27
27
  line-height: var(--zw-line-height-desktop, var(--zw-preset-desktop-line-height));
@@ -30,7 +30,7 @@
30
30
 
31
31
  @media (min-width: 769px) and (max-width: 1199.98px) {
32
32
 
33
- .zw-style {
33
+ .zw-style.zw-style.zw-style {
34
34
  font-size: var(--zw-font-size-tablet, var(--zw-preset-tablet-font-size));
35
35
  text-align: var(--zw-text-align-tablet, var(--zw-preset-tablet-text-align));
36
36
  line-height: var(--zw-line-height-tablet, var(--zw-preset-tablet-line-height));
@@ -39,15 +39,17 @@
39
39
 
40
40
  @media (max-width: 768.98px) {
41
41
 
42
- .zw-style {
42
+ .zw-style.zw-style.zw-style {
43
43
  font-size: var(--zw-font-size-mobile, var(--zw-preset-mobile-font-size));
44
44
  text-align: var(--zw-text-align-mobile, var(--zw-preset-mobile-text-align));
45
45
  line-height: var(--zw-line-height-mobile, var(--zw-preset-mobile-line-height));
46
46
  }
47
47
  }
48
48
 
49
+
49
50
  /* ProseMirror styles */
50
51
 
52
+
51
53
  .ProseMirror {
52
54
  position: relative;
53
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zipify/wysiwyg",
3
- "version": "1.0.0-dev.48",
3
+ "version": "1.0.0-dev.50",
4
4
  "description": "Zipify modification of TipTap text editor",
5
5
  "main": "dist/wysiwyg.mjs",
6
6
  "repository": {