@zipify/wysiwyg 1.0.0-dev.75 → 1.0.0-dev.76

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
@@ -14391,6 +14391,12 @@ function importIcon(name) {
14391
14391
  }
14392
14392
  return icon;
14393
14393
  }
14394
+ function isWysiwygContent(content) {
14395
+ return typeof content === "object" && content.__wswg__;
14396
+ }
14397
+ function markWysiwygContent(content) {
14398
+ return { ...content, __wswg__: true };
14399
+ }
14394
14400
  var render$E = function __render__6() {
14395
14401
  var _vm = this;
14396
14402
  var _h = _vm.$createElement;
@@ -22776,7 +22782,7 @@ const Toolbar = /* @__PURE__ */ function() {
22776
22782
  function useEditor({ content, onChange, extensions: extensions2, isReadonlyRef }) {
22777
22783
  const editor = reactive(new Editor({
22778
22784
  content: ContentNormalizer.normalize(content.value),
22779
- onUpdate: () => onChange({ ...editor.getJSON(), __wswg__: true }),
22785
+ onUpdate: () => onChange(editor.getJSON()),
22780
22786
  extensions: extensions2,
22781
22787
  injectCSS: false
22782
22788
  }));
@@ -25952,7 +25958,7 @@ const __vue2_script = {
25952
25958
  });
25953
25959
  const updateToolbar = () => toolbar.update();
25954
25960
  function onChange(content) {
25955
- emit("input", content);
25961
+ emit("input", markWysiwygContent(content));
25956
25962
  updateToolbar();
25957
25963
  }
25958
25964
  const pageBlocks = toRef(props, "pageBlocks");
@@ -26020,5 +26026,6 @@ export {
26020
26026
  NodeFactory,
26021
26027
  NodeTypes,
26022
26028
  TextSettings,
26023
- Wysiwyg
26029
+ Wysiwyg,
26030
+ isWysiwygContent
26024
26031
  };
package/lib/Wysiwyg.vue CHANGED
@@ -21,6 +21,7 @@ import { ContextWindow, FavoriteColors, Storage } from './services';
21
21
  import { Devices } from './enums';
22
22
  import { outClick } from './directives';
23
23
  import { Font } from './models';
24
+ import { markWysiwygContent } from './utils';
24
25
 
25
26
  const MIN_FONT_SIZE = 5;
26
27
  const MAX_FONT_SIZE = 112;
@@ -150,7 +151,7 @@ export default {
150
151
  const updateToolbar = () => toolbar.update();
151
152
 
152
153
  function onChange(content) {
153
- emit('input', content);
154
+ emit('input', markWysiwygContent(content));
154
155
  updateToolbar();
155
156
  }
156
157
 
@@ -4,7 +4,6 @@ exports[`life cycle should emit changes 1`] = `
4
4
  Array [
5
5
  Array [
6
6
  Object {
7
- "__wswg__": true,
8
7
  "content": Array [
9
8
  Object {
10
9
  "content": Array [
@@ -5,7 +5,7 @@ import { ContentNormalizer } from '../services';
5
5
  export function useEditor({ content, onChange, extensions, isReadonlyRef }) {
6
6
  const editor = reactive(new Editor({
7
7
  content: ContentNormalizer.normalize(content.value),
8
- onUpdate: () => onChange({ ...editor.getJSON(), __wswg__: true }),
8
+ onUpdate: () => onChange(editor.getJSON()),
9
9
  extensions,
10
10
  injectCSS: false
11
11
  }));
package/lib/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export { default as Wysiwyg } from './Wysiwyg';
2
2
  export { NodeFactory } from './services';
3
3
  export { NodeTypes, TextSettings, Alignments } from './enums';
4
+ export { isWysiwygContent } from './utils';
@@ -7,3 +7,4 @@ export { convertLineHeight } from './convertLineHeight';
7
7
  export { convertFontSize } from './convertFontSize';
8
8
  export { convertAlignment } from './convertAlignment';
9
9
  export { importIcon } from './importIcon';
10
+ export { isWysiwygContent, markWysiwygContent } from './isWysiwygContent';
@@ -0,0 +1,7 @@
1
+ export function isWysiwygContent(content) {
2
+ return typeof content === 'object' && content.__wswg__;
3
+ }
4
+
5
+ export function markWysiwygContent(content) {
6
+ return { ...content, __wswg__: true };
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zipify/wysiwyg",
3
- "version": "1.0.0-dev.75",
3
+ "version": "1.0.0-dev.76",
4
4
  "description": "Zipify modification of TipTap text editor",
5
5
  "main": "dist/wysiwyg.mjs",
6
6
  "repository": {