@zipify/wysiwyg 1.0.0-dev.64 → 1.0.0-dev.67

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.
Files changed (37) hide show
  1. package/config/vite/lib.config.js +2 -0
  2. package/dist/wysiwyg.css +861 -1
  3. package/dist/wysiwyg.mjs +20528 -12950
  4. package/lib/__tests__/utils/index.js +0 -1
  5. package/lib/composables/__tests__/useEditor.test.js +1 -1
  6. package/lib/extensions/__tests__/Alignment.test.js +1 -2
  7. package/lib/extensions/__tests__/BackgroundColor.test.js +1 -2
  8. package/lib/extensions/__tests__/CaseStyle.test.js +1 -2
  9. package/lib/extensions/__tests__/FontColor.test.js +1 -2
  10. package/lib/extensions/__tests__/FontFamily.test.js +1 -2
  11. package/lib/extensions/__tests__/FontSize.test.js +1 -2
  12. package/lib/extensions/__tests__/FontStyle.test.js +1 -2
  13. package/lib/extensions/__tests__/FontWeight.test.js +1 -2
  14. package/lib/extensions/__tests__/LineHeight.test.js +1 -2
  15. package/lib/extensions/__tests__/Link.test.js +1 -2
  16. package/lib/extensions/__tests__/StylePreset.test.js +1 -2
  17. package/lib/extensions/__tests__/TextDecoration.test.js +1 -2
  18. package/lib/extensions/core/TextProcessor.js +1 -24
  19. package/lib/extensions/core/__tests__/NodeProcessor.test.js +1 -2
  20. package/lib/extensions/core/__tests__/SelectionProcessor.test.js +1 -2
  21. package/lib/extensions/core/__tests__/TextProcessor.test.js +1 -2
  22. package/lib/extensions/list/__tests__/List.test.js +1 -2
  23. package/lib/index.js +2 -0
  24. package/lib/{__tests__/utils → services}/NodeFactory.js +3 -12
  25. package/lib/services/__tests__/ContentNormalizer.test.js +1 -1
  26. package/lib/services/index.js +1 -0
  27. package/package.json +1 -1
  28. package/lib/extensions/core/inputRules/closeDoubleQuote.js +0 -6
  29. package/lib/extensions/core/inputRules/closeSingleQuote.js +0 -6
  30. package/lib/extensions/core/inputRules/copyright.js +0 -6
  31. package/lib/extensions/core/inputRules/ellipsis.js +0 -6
  32. package/lib/extensions/core/inputRules/emDash.js +0 -6
  33. package/lib/extensions/core/inputRules/index.js +0 -9
  34. package/lib/extensions/core/inputRules/openDoubleQuote.js +0 -6
  35. package/lib/extensions/core/inputRules/openSingleQuote.js +0 -6
  36. package/lib/extensions/core/inputRules/registeredTrademark.js +0 -6
  37. package/lib/extensions/core/inputRules/trademark.js +0 -6
@@ -1,4 +1,3 @@
1
1
  export { waitAsyncOperation } from './waitAsyncOperation';
2
- export { NodeFactory } from './NodeFactory';
3
2
  export { withComponentContext } from './withComponentContext';
4
3
  export { setReadonlyProperty } from './setReadonlyProperty';
@@ -2,7 +2,7 @@ import { h, ref, toRef } from 'vue';
2
2
  import { EditorContent } from '@tiptap/vue-2';
3
3
  import { shallowMount } from '@vue/test-utils';
4
4
  import { useEditor } from '../useEditor';
5
- import { NodeFactory } from '../../__tests__/utils';
5
+ import { NodeFactory } from '../../services';
6
6
  import { buildCoreExtensions } from '../../extensions/core';
7
7
 
8
8
  const TestComponent = {
@@ -1,11 +1,10 @@
1
1
  import { Editor, Extension } from '@tiptap/vue-2';
2
2
  import { ref } from 'vue';
3
- import { NodeFactory } from '../../__tests__/utils';
4
3
  import { createCommand } from '../../utils';
5
4
  import { Alignment } from '../Alignment';
6
5
  import { DeviceManager } from '../DeviceManager';
7
6
  import { Alignments } from '../../enums';
8
- import { ContentNormalizer } from '../../services';
7
+ import { ContentNormalizer, NodeFactory } from '../../services';
9
8
  import { buildCoreExtensions } from '../core';
10
9
 
11
10
  const MockStylePreset = Extension.create({
@@ -1,9 +1,8 @@
1
1
  import { Editor, Extension } from '@tiptap/vue-2';
2
2
  import { ref } from 'vue';
3
- import { NodeFactory } from '../../__tests__/utils';
4
3
  import { createCommand } from '../../utils';
5
4
  import { BackgroundColor } from '../BackgroundColor';
6
- import { ContentNormalizer } from '../../services';
5
+ import { ContentNormalizer, NodeFactory } from '../../services';
7
6
  import { buildCoreExtensions } from '../core';
8
7
 
9
8
  const MockStylePreset = Extension.create({
@@ -1,8 +1,7 @@
1
1
  import { Editor } from '@tiptap/vue-2';
2
- import { NodeFactory } from '../../__tests__/utils';
3
2
  import { CaseStyles } from '../../enums';
4
3
  import { CaseStyle } from '../CaseStyle';
5
- import { ContentNormalizer } from '../../services';
4
+ import { ContentNormalizer, NodeFactory } from '../../services';
6
5
  import { buildCoreExtensions } from '../core';
7
6
 
8
7
  function createEditor({ content }) {
@@ -1,9 +1,8 @@
1
1
  import { Editor, Extension } from '@tiptap/vue-2';
2
2
  import { ref } from 'vue';
3
- import { NodeFactory } from '../../__tests__/utils';
4
3
  import { createCommand } from '../../utils';
5
4
  import { FontColor } from '../FontColor';
6
- import { ContentNormalizer } from '../../services';
5
+ import { ContentNormalizer, NodeFactory } from '../../services';
7
6
  import { buildCoreExtensions } from '../core';
8
7
 
9
8
  const MockStylePreset = Extension.create({
@@ -1,12 +1,11 @@
1
1
  import { Editor, Extension } from '@tiptap/vue-2';
2
2
  import { ref } from 'vue';
3
- import { NodeFactory } from '../../__tests__/utils';
4
3
  import { createCommand } from '../../utils';
5
4
  import { Font } from '../../models';
6
5
  import { FontFamily } from '../FontFamily';
7
6
  import { FontWeight } from '../FontWeight';
8
7
  import { FontStyle } from '../FontStyle';
9
- import { ContentNormalizer } from '../../services';
8
+ import { ContentNormalizer, NodeFactory } from '../../services';
10
9
  import { buildCoreExtensions } from '../core';
11
10
 
12
11
  const MockStylePreset = Extension.create({
@@ -1,10 +1,9 @@
1
1
  import { Editor, Extension } from '@tiptap/vue-2';
2
2
  import { ref } from 'vue';
3
- import { NodeFactory } from '../../__tests__/utils';
4
3
  import { createCommand } from '../../utils';
5
4
  import { FontSize } from '../FontSize';
6
5
  import { DeviceManager } from '../DeviceManager';
7
- import { ContentNormalizer } from '../../services';
6
+ import { ContentNormalizer, NodeFactory } from '../../services';
8
7
  import { buildCoreExtensions } from '../core';
9
8
 
10
9
  const MockStylePreset = Extension.create({
@@ -1,12 +1,11 @@
1
1
  import { Editor, Extension } from '@tiptap/vue-2';
2
2
  import { ref } from 'vue';
3
- import { NodeFactory } from '../../__tests__/utils';
4
3
  import { createCommand } from '../../utils';
5
4
  import { FontStyle } from '../FontStyle';
6
5
  import { FontFamily } from '../FontFamily';
7
6
  import { Font } from '../../models';
8
7
  import { FontWeight } from '../FontWeight';
9
- import { ContentNormalizer } from '../../services';
8
+ import { ContentNormalizer, NodeFactory } from '../../services';
10
9
  import { buildCoreExtensions } from '../core';
11
10
 
12
11
  const MockStylePreset = Extension.create({
@@ -1,12 +1,11 @@
1
1
  import { Editor, Extension } from '@tiptap/vue-2';
2
2
  import { ref } from 'vue';
3
- import { NodeFactory } from '../../__tests__/utils';
4
3
  import { createCommand } from '../../utils';
5
4
  import { Font } from '../../models';
6
5
  import { FontWeight } from '../FontWeight';
7
6
  import { FontFamily } from '../FontFamily';
8
7
  import { FontStyle } from '../FontStyle';
9
- import { ContentNormalizer } from '../../services';
8
+ import { ContentNormalizer, NodeFactory } from '../../services';
10
9
  import { buildCoreExtensions } from '../core';
11
10
 
12
11
  const MockStylePreset = Extension.create({
@@ -1,10 +1,9 @@
1
1
  import { Editor, Extension } from '@tiptap/vue-2';
2
2
  import { ref } from 'vue';
3
- import { NodeFactory } from '../../__tests__/utils';
4
3
  import { createCommand } from '../../utils';
5
4
  import { DeviceManager } from '../DeviceManager';
6
5
  import { LineHeight } from '../LineHeight';
7
- import { ContentNormalizer } from '../../services';
6
+ import { ContentNormalizer, NodeFactory } from '../../services';
8
7
  import { buildCoreExtensions } from '../core';
9
8
 
10
9
  const MockStylePreset = Extension.create({
@@ -1,8 +1,7 @@
1
1
  import { ref } from 'vue';
2
2
  import { Editor } from '@tiptap/vue-2';
3
- import { ContentNormalizer } from '../../services';
3
+ import { ContentNormalizer, NodeFactory } from '../../services';
4
4
  import { Link } from '../Link';
5
- import { NodeFactory } from '../../__tests__/utils';
6
5
  import { buildCoreExtensions } from '../core';
7
6
 
8
7
  function createEditor({ content }) {
@@ -1,9 +1,8 @@
1
1
  import { Editor, Extension, Mark } from '@tiptap/vue-2';
2
- import { NodeFactory } from '../../__tests__/utils';
3
2
  import { StylePreset } from '../StylePreset';
4
3
  import { List } from '../list';
5
4
  import { ListTypes, NodeTypes, TextSettings } from '../../enums';
6
- import { ContentNormalizer } from '../../services';
5
+ import { ContentNormalizer, NodeFactory } from '../../services';
7
6
  import { buildCoreExtensions } from '../core';
8
7
 
9
8
  const MockFontSize = Mark.create({
@@ -1,9 +1,8 @@
1
1
  import { Editor, Extension } from '@tiptap/vue-2';
2
2
  import { ref } from 'vue';
3
- import { NodeFactory } from '../../__tests__/utils';
4
3
  import { createCommand } from '../../utils';
5
4
  import { TextDecoration } from '../TextDecoration';
6
- import { ContentNormalizer } from '../../services';
5
+ import { ContentNormalizer, NodeFactory } from '../../services';
7
6
  import { buildCoreExtensions } from '../core';
8
7
 
9
8
  const MockStylePreset = Extension.create({
@@ -1,16 +1,5 @@
1
1
  import { Extension } from '@tiptap/vue-2';
2
2
  import { createCommand } from '../../utils';
3
- import {
4
- emDash,
5
- registeredTrademark,
6
- trademark,
7
- ellipsis,
8
- openDoubleQuote,
9
- openSingleQuote,
10
- closeDoubleQuote,
11
- closeSingleQuote,
12
- copyright
13
- } from './inputRules';
14
3
 
15
4
  export const TextProcessor = Extension.create({
16
5
  name: 'text_processor',
@@ -51,17 +40,5 @@ export const TextProcessor = Extension.create({
51
40
  });
52
41
  })
53
42
  };
54
- },
55
-
56
- addInputRules: () => [
57
- emDash,
58
- registeredTrademark,
59
- trademark,
60
- ellipsis,
61
- openDoubleQuote,
62
- openSingleQuote,
63
- closeDoubleQuote,
64
- closeSingleQuote,
65
- copyright
66
- ]
43
+ }
67
44
  });
@@ -1,7 +1,6 @@
1
1
  import { Editor, Extension } from '@tiptap/vue-2';
2
- import { NodeFactory } from '../../../__tests__/utils';
3
2
  import { NodeTypes } from '../../../enums';
4
- import { ContentNormalizer } from '../../../services';
3
+ import { ContentNormalizer, NodeFactory } from '../../../services';
5
4
  import { buildCoreExtensions } from '../index';
6
5
 
7
6
  const LineHeight = Extension.create({
@@ -1,6 +1,5 @@
1
1
  import { Editor } from '@tiptap/vue-2';
2
- import { NodeFactory } from '../../../__tests__/utils';
3
- import { ContentNormalizer } from '../../../services';
2
+ import { ContentNormalizer, NodeFactory } from '../../../services';
4
3
  import { buildCoreExtensions } from '../index';
5
4
 
6
5
  function createEditor() {
@@ -1,6 +1,5 @@
1
1
  import { Editor, Mark, Extension } from '@tiptap/vue-2';
2
- import { NodeFactory } from '../../../__tests__/utils';
3
- import { ContentNormalizer } from '../../../services';
2
+ import { ContentNormalizer, NodeFactory } from '../../../services';
4
3
  import { NodeTypes, TextSettings } from '../../../enums';
5
4
  import { buildCoreExtensions } from '../index';
6
5
 
@@ -1,9 +1,8 @@
1
1
  import { Editor } from '@tiptap/vue-2';
2
- import { NodeFactory } from '../../../__tests__/utils';
3
2
  import { ListTypes } from '../../../enums';
4
3
  import { StylePreset } from '../../StylePreset';
5
4
  import { List } from '../List';
6
- import { ContentNormalizer } from '../../../services';
5
+ import { ContentNormalizer, NodeFactory } from '../../../services';
7
6
  import { buildCoreExtensions } from '../../core';
8
7
 
9
8
  function createEditor({ content }) {
package/lib/index.js CHANGED
@@ -1 +1,3 @@
1
1
  export { default as Wysiwyg } from './Wysiwyg';
2
+ export { NodeFactory } from './services';
3
+ export { NodeTypes, TextSettings, Alignments } from './enums';
@@ -1,4 +1,4 @@
1
- import { NodeTypes } from '../../enums';
1
+ import { NodeTypes } from '../enums';
2
2
 
3
3
  export class NodeFactory {
4
4
  static doc(content) {
@@ -65,16 +65,7 @@ export class NodeFactory {
65
65
  return { type, attrs };
66
66
  }
67
67
 
68
- static link(attrs) {
69
- return {
70
- type: 'text',
71
- marks: [
72
- {
73
- type: 'link',
74
- attrs: { ...attrs }
75
- }
76
- ],
77
- text: attrs.text
78
- };
68
+ static populateAllDevices(value) {
69
+ return { mobile: value, tablet: value, desktop: value };
79
70
  }
80
71
  }
@@ -1,5 +1,5 @@
1
1
  import { ContentNormalizer } from '../ContentNormalizer';
2
- import { NodeFactory } from '../../__tests__/utils';
2
+ import { NodeFactory } from '../NodeFactory';
3
3
 
4
4
  describe('normalize text content', () => {
5
5
  test('should ignore json content', () => {
@@ -3,3 +3,4 @@ export { Storage } from './Storage';
3
3
  export { FavoriteColors } from './FavoriteColors';
4
4
  export { ContentNormalizer } from './ContentNormalizer';
5
5
  export { ContextWindow } from './ContextWidnow';
6
+ export { NodeFactory } from './NodeFactory';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zipify/wysiwyg",
3
- "version": "1.0.0-dev.64",
3
+ "version": "1.0.0-dev.67",
4
4
  "description": "Zipify modification of TipTap text editor",
5
5
  "main": "dist/wysiwyg.mjs",
6
6
  "repository": {
@@ -1,6 +0,0 @@
1
- import { textInputRule } from '@tiptap/core';
2
-
3
- export const closeDoubleQuote = textInputRule({
4
- find: /"/,
5
- replace: '”'
6
- });
@@ -1,6 +0,0 @@
1
- import { textInputRule } from '@tiptap/core';
2
-
3
- export const closeSingleQuote = textInputRule({
4
- find: /'/,
5
- replace: '’'
6
- });
@@ -1,6 +0,0 @@
1
- import { textInputRule } from '@tiptap/core';
2
-
3
- export const copyright = textInputRule({
4
- find: /\(c\)/i,
5
- replace: '©'
6
- });
@@ -1,6 +0,0 @@
1
- import { textInputRule } from '@tiptap/core';
2
-
3
- export const ellipsis = textInputRule({
4
- find: /\.\.\./,
5
- replace: '…'
6
- });
@@ -1,6 +0,0 @@
1
- import { textInputRule } from '@tiptap/core';
2
-
3
- export const emDash = textInputRule({
4
- find: /--/,
5
- replace: '—'
6
- });
@@ -1,9 +0,0 @@
1
- export { closeDoubleQuote } from './closeDoubleQuote';
2
- export { closeSingleQuote } from './closeSingleQuote';
3
- export { copyright } from './copyright';
4
- export { ellipsis } from './ellipsis';
5
- export { emDash } from './emDash';
6
- export { openDoubleQuote } from './openDoubleQuote';
7
- export { openSingleQuote } from './openSingleQuote';
8
- export { registeredTrademark } from './registeredTrademark';
9
- export { trademark } from './trademark';
@@ -1,6 +0,0 @@
1
- import { textInputRule } from '@tiptap/core';
2
-
3
- export const openDoubleQuote = textInputRule({
4
- find: /(?:^|[\s{[(<'"\u2018\u201C])(")/,
5
- replace: '“'
6
- });
@@ -1,6 +0,0 @@
1
- import { textInputRule } from '@tiptap/core';
2
-
3
- export const openSingleQuote = textInputRule({
4
- find: /(?:^|[\s{[(<'"\u2018\u201C])(')/,
5
- replace: '‘'
6
- });
@@ -1,6 +0,0 @@
1
- import { textInputRule } from '@tiptap/core';
2
-
3
- export const registeredTrademark = textInputRule({
4
- find: /\(r\)/i,
5
- replace: '®'
6
- });
@@ -1,6 +0,0 @@
1
- import { textInputRule } from '@tiptap/core';
2
-
3
- export const trademark = textInputRule({
4
- find: /\(tm\)/i,
5
- replace: '™'
6
- });