@zipify/wysiwyg 1.2.1 → 1.2.2

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
@@ -22947,7 +22947,10 @@ const FontFamily = Mark.create({
22947
22947
  }),
22948
22948
  getFont: createCommand(({ commands: commands2 }) => {
22949
22949
  const fontFamily = commands2.getFontFamily();
22950
- return computed(() => commands2.findFontByName(unref(fontFamily)));
22950
+ return computed(() => {
22951
+ const fontName = unref(fontFamily) || unref(this.options.defaultPreset).common.font_family;
22952
+ return commands2.findFontByName(fontName);
22953
+ });
22951
22954
  }),
22952
22955
  findFontByName: createCommand((_, name) => {
22953
22956
  return this.options.fonts.find((font) => font.name === name);
@@ -25716,7 +25719,7 @@ const SelectionProcessor = Extension.create({
25716
25719
  this.storage.selection = state.selection;
25717
25720
  }),
25718
25721
  restoreSelection: createCommand(({ commands: commands2 }) => {
25719
- commands2.setTextSelection(this.storage.selection);
25722
+ this.storage.selection && commands2.setTextSelection(this.storage.selection);
25720
25723
  }),
25721
25724
  expandSelectionToBlock: createCommand(({ state, commands: commands2 }) => {
25722
25725
  let from2 = state.selection.from;
@@ -35,7 +35,11 @@ export const FontFamily = Mark.create({
35
35
  getFont: createCommand(({ commands }) => {
36
36
  const fontFamily = commands.getFontFamily();
37
37
 
38
- return computed(() => commands.findFontByName(unref(fontFamily)));
38
+ return computed(() => {
39
+ const fontName = unref(fontFamily) || unref(this.options.defaultPreset).common.font_family;
40
+
41
+ return commands.findFontByName(fontName);
42
+ });
39
43
  }),
40
44
 
41
45
  findFontByName: createCommand((_, name) => {
@@ -16,7 +16,7 @@ export const SelectionProcessor = Extension.create({
16
16
  }),
17
17
 
18
18
  restoreSelection: createCommand(({ commands }) => {
19
- commands.setTextSelection(this.storage.selection);
19
+ this.storage.selection && commands.setTextSelection(this.storage.selection);
20
20
  }),
21
21
 
22
22
  expandSelectionToBlock: createCommand(({ state, commands }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zipify/wysiwyg",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Zipify modification of TipTap text editor",
5
5
  "main": "dist/wysiwyg.mjs",
6
6
  "bin": {