@modusoperandi/licit 0.13.2 → 0.13.18

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 (59) hide show
  1. package/.eslintrc.js +59 -55
  2. package/README.md +15 -1
  3. package/dist/bom.xml +5663 -3933
  4. package/dist/client/CollabConnector.js +5 -1
  5. package/dist/client/CollabConnector.js.flow +6 -2
  6. package/dist/client/EditorConnection.js +5 -4
  7. package/dist/client/EditorConnection.js.flow +10 -5
  8. package/dist/client/Licit.js +105 -30
  9. package/dist/client/Licit.js.flow +120 -47
  10. package/dist/client/Licit.test.js +30 -3
  11. package/dist/client/Licit.test.js.flow +34 -3
  12. package/dist/client/SimpleConnector.js +7 -0
  13. package/dist/client/SimpleConnector.js.flow +6 -0
  14. package/dist/client/http.js +12 -0
  15. package/dist/client/http.js.flow +4 -0
  16. package/dist/convertFromDOMElement.js.flow +2 -2
  17. package/dist/convertFromHTML.js +9 -4
  18. package/dist/convertFromHTML.js.flow +15 -5
  19. package/dist/convertFromJSON.js +12 -28
  20. package/dist/convertFromJSON.js.flow +9 -31
  21. package/dist/createEmptyEditorState.js +3 -6
  22. package/dist/createEmptyEditorState.js.flow +4 -8
  23. package/dist/index.js +11 -1
  24. package/dist/index.js.flow +1 -1
  25. package/dist/patchStyleElements.js +1 -3
  26. package/dist/patchStyleElements.js.flow +2 -2
  27. package/dist/ui/czi-link-tooltip.css +1 -1
  28. package/dist/ui/czi-vars.css +1 -1
  29. package/licit/client/index.js +2 -1
  30. package/licit/server/collab/instance.js +21 -6
  31. package/licit/server/collab/server.js +19 -4
  32. package/licit/server/collab/start.js +1 -1
  33. package/package.json +9 -13
  34. package/src/client/CollabConnector.js +6 -2
  35. package/src/client/EditorConnection.js +10 -5
  36. package/src/client/Licit.js +120 -47
  37. package/src/client/Licit.test.js +34 -3
  38. package/src/client/SimpleConnector.js +6 -0
  39. package/src/client/http.js +4 -0
  40. package/src/convertFromDOMElement.js +2 -2
  41. package/src/convertFromHTML.js +15 -5
  42. package/src/convertFromJSON.js +9 -31
  43. package/src/createEmptyEditorState.js +4 -8
  44. package/src/index.js +1 -1
  45. package/src/patchStyleElements.js +2 -2
  46. package/src/ui/czi-link-tooltip.css +1 -1
  47. package/src/ui/czi-vars.css +1 -1
  48. package/utils/build_licit_collab_server.js +1 -1
  49. package/webpack.config.js +1 -1
  50. package/node_modules/prosemirror-utils/LICENSE +0 -13
  51. package/node_modules/prosemirror-utils/README.md +0 -0
  52. package/node_modules/prosemirror-utils/dist/helpers.js +0 -119
  53. package/node_modules/prosemirror-utils/dist/index.js +0 -17
  54. package/node_modules/prosemirror-utils/dist/index.js.map +0 -1
  55. package/node_modules/prosemirror-utils/dist/node.js +0 -106
  56. package/node_modules/prosemirror-utils/dist/selection.js +0 -168
  57. package/node_modules/prosemirror-utils/dist/transforms.js +0 -257
  58. package/node_modules/prosemirror-utils/package.json +0 -81
  59. package/node_modules/prosemirror-utils/typings.d.ts +0 -79
package/.eslintrc.js CHANGED
@@ -1,15 +1,15 @@
1
1
  module.exports = {
2
- 'parser': 'babel-eslint',
3
- 'parserOptions': {
4
- 'sourceType': 'module',
5
- 'allowImportExportEverywhere': false,
6
- 'codeFrame': true,
7
- 'ecmaFeatures': {
8
- 'jsx': true
2
+ parser: 'babel-eslint',
3
+ parserOptions: {
4
+ sourceType: 'module',
5
+ allowImportExportEverywhere: false,
6
+ codeFrame: true,
7
+ ecmaFeatures: {
8
+ jsx: true,
9
9
  },
10
10
  },
11
- 'plugins': ['react'],
12
- 'rules': {
11
+ plugins: ['react'],
12
+ rules: {
13
13
  'react/jsx-sort-props': 'error',
14
14
  'react/jsx-uses-react': 'error',
15
15
  'react/jsx-uses-vars': 'error',
@@ -22,59 +22,63 @@ module.exports = {
22
22
  // The following rule was being reported as misconfigured. After correcting
23
23
  // that, it was reported as not existing at all.
24
24
  // "no-unused-expression": [true, "allow-fast-null-checks"],
25
- 'no-unused-vars': ['error', { 'vars': 'all', 'args': 'none', 'ignoreRestSiblings': false }],
25
+ 'no-unused-vars': [
26
+ 'error',
27
+ { vars: 'all', args: 'none', ignoreRestSiblings: false },
28
+ ],
26
29
  'no-var': 'error',
27
30
  'prefer-const': 'error',
28
- 'quotes': [2, 'single', { 'avoidEscape': true }],
29
- 'semi': [2, 'always'],
30
- 'strict': 0
31
+ quotes: [2, 'single', { avoidEscape: true }],
32
+ semi: [2, 'always'],
33
+ strict: 0,
31
34
  },
32
- 'globals': {
33
- '__dirname': false,
34
- '$ReadOnlyArray': false,
35
- 'Blob': false,
36
- 'File': false,
37
- 'Class': false,
38
- 'Component': false,
39
- 'Document': true,
40
- 'Element': false,
41
- 'Event': false,
42
- 'HTMLElement': false,
43
- 'HTMLTableCellElement': false,
44
- 'HTMLButtonElement': false,
45
- 'HTMLLIElement': false,
46
- 'Image': false,
47
- 'localStorage': false,
48
- 'Map': false,
49
- 'DragEvent': false,
50
- 'MouseEvent': false,
51
- 'KeyboardEvent': false,
52
- 'MutationObserver': false,
53
- 'Promise': false,
54
- 'Set': false,
55
- 'Slice': false,
56
- 'SyntheticEvent': false,
57
- 'SyntheticInputEvent': false,
58
- 'SyntheticMouseEvent': false,
59
- 'cancelAnimationFrame': false,
60
- 'clearTimeout': false,
61
- 'console': false,
62
- 'document': false,
63
- 'module': false,
64
- 'process': false,
65
- 'require': false,
66
- 'requestAnimationFrame': false,
67
- 'setTimeout': false,
68
- 'window': false
35
+ globals: {
36
+ __dirname: false,
37
+ $ReadOnlyArray: false,
38
+ Blob: false,
39
+ File: false,
40
+ Class: false,
41
+ Component: false,
42
+ Document: true,
43
+ Element: false,
44
+ Event: false,
45
+ HTMLElement: false,
46
+ HTMLTableCellElement: false,
47
+ HTMLButtonElement: false,
48
+ HTMLLIElement: false,
49
+ Image: false,
50
+ localStorage: false,
51
+ Map: false,
52
+ DragEvent: false,
53
+ MouseEvent: false,
54
+ KeyboardEvent: false,
55
+ MutationObserver: false,
56
+ Promise: false,
57
+ Set: false,
58
+ Slice: false,
59
+ Symbol: false,
60
+ SyntheticEvent: false,
61
+ SyntheticInputEvent: false,
62
+ SyntheticMouseEvent: false,
63
+ cancelAnimationFrame: false,
64
+ clearTimeout: false,
65
+ console: false,
66
+ document: false,
67
+ module: false,
68
+ process: false,
69
+ require: false,
70
+ requestAnimationFrame: false,
71
+ setTimeout: false,
72
+ window: false,
69
73
  },
70
- 'overrides': [
74
+ overrides: [
71
75
  {
72
76
  // enable jest globals in test files
73
77
  files: '*.test.js',
74
78
  plugins: ['jest'],
75
79
  env: {
76
- 'jest/globals': true
77
- }
78
- }
79
- ]
80
+ 'jest/globals': true,
81
+ },
82
+ },
83
+ ],
80
84
  };
package/README.md CHANGED
@@ -192,7 +192,8 @@ Please refer *licit\client\index.js* for getting more detailed idea on passing p
192
192
  | width|Width of the editor|100%
193
193
  | height|Height of the editor|100%
194
194
  | readOnly |To enable/disable editing mode|false
195
- | data |Document data to be loaded into the editor|null
195
+ | data |Document JSON/HTML data to be loaded into the editor|null
196
+ | dataType |Document data type - JSON/HTML|JSON
196
197
  | disabled|To disable the editor|false
197
198
  | embedded|To disable/enable inline behavior of the editor|false
198
199
  | fitToContent|To disable/enable fit to content behavior of the editor|false
@@ -204,6 +205,19 @@ Please refer *licit\client\index.js* for getting more detailed idea on passing p
204
205
  |onChange | Fires after each significant change |<ul><li>data: document JSON</li><li>isEmpty: true when empty</li><li>view: prosemirror view</li></ul>
205
206
  |onReady| Fires once when the editor is ready |licit reference
206
207
 
208
+ |Method Name| Description|Parameter|
209
+ |--|--|--|
210
+ |setProps | Update properties of the editor using an editor instance |<ul><li>props: Licit properties' object</li></ul>
211
+
212
+ To set data to editor:
213
+
214
+ > function setData() { const props = {};
215
+ > Object.assign(props, this.props);
216
+ > // here the *this.props* is the *ref* input from the onReadyCB(ref) (Please refer *licit\client\index.js* for onReadyCB(ref) method)
217
+ > props.data = {
218
+ > "type":"doc","attrs":{"layout":null,"padding":null,"width":null,"counterFlags":null},"content":[{"type":"paragraph","attrs":{"align":null,"color":null,"id":null,"indent":null,"lineSpacing":null,"paddingBottom":null,"paddingTop":null},"content":[{"type":"text","text":"Hello
219
+ > World!!!"}]}]};
220
+ > this.setProps(props); }
207
221
 
208
222
  To load the styles:
209
223
  Either in *angular.json*, add