@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 +10 -3
- package/lib/Wysiwyg.vue +2 -1
- package/lib/composables/__tests__/__snapshots__/useEditor.test.js.snap +0 -1
- package/lib/composables/useEditor.js +1 -1
- package/lib/index.js +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/isWysiwygContent.js +7 -0
- package/package.json +1 -1
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(
|
|
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
|
|
|
@@ -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(
|
|
8
|
+
onUpdate: () => onChange(editor.getJSON()),
|
|
9
9
|
extensions,
|
|
10
10
|
injectCSS: false
|
|
11
11
|
}));
|
package/lib/index.js
CHANGED
package/lib/utils/index.js
CHANGED
|
@@ -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';
|