argous 1.2.203 → 1.2.204

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.
@@ -1,16 +1,8 @@
1
- /**
2
- * Copyright (c) 2017-present, Ephox, Inc.
3
- *
4
- * This source code is licensed under the Apache 2 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
1
  import { IProps } from './Editor';
10
2
  import { IEvents } from '../Events';
11
3
  import * as PropTypes from 'prop-types';
12
4
 
13
- export type CopyProps<T> = { [P in keyof T]: PropTypes.Requireable<P | unknown> };
5
+ export type CopyProps<T> = { [P in keyof T]: PropTypes.Requireable<unknown> };
14
6
 
15
7
  export type IEventPropTypes = CopyProps<IEvents>;
16
8
 
@@ -30,6 +22,7 @@ export const eventPropTypes: IEventPropTypes = {
30
22
  onClearUndos: PropTypes.func,
31
23
  onClick: PropTypes.func,
32
24
  onContextMenu: PropTypes.func,
25
+ onCommentChange: PropTypes.func,
33
26
  onCopy: PropTypes.func,
34
27
  onCut: PropTypes.func,
35
28
  onDblclick: PropTypes.func,
@@ -78,7 +71,15 @@ export const eventPropTypes: IEventPropTypes = {
78
71
  onShow: PropTypes.func,
79
72
  onSubmit: PropTypes.func,
80
73
  onUndo: PropTypes.func,
81
- onVisualAid: PropTypes.func
74
+ onVisualAid: PropTypes.func,
75
+ onSkinLoadError: PropTypes.func,
76
+ onThemeLoadError: PropTypes.func,
77
+ onModelLoadError: PropTypes.func,
78
+ onPluginLoadError: PropTypes.func,
79
+ onIconsLoadError: PropTypes.func,
80
+ onLanguageLoadError: PropTypes.func,
81
+ onScriptsLoad: PropTypes.func,
82
+ onScriptsLoadError: PropTypes.func,
82
83
  };
83
84
 
84
85
  export const EditorPropTypes: IEditorPropTypes = {
@@ -88,7 +89,6 @@ export const EditorPropTypes: IEditorPropTypes = {
88
89
  init: PropTypes.object,
89
90
  initialValue: PropTypes.string,
90
91
  onEditorChange: PropTypes.func,
91
- outputFormat: PropTypes.oneOf(['html', 'text']),
92
92
  value: PropTypes.string,
93
93
  tagName: PropTypes.string,
94
94
  cloudChannel: PropTypes.string,
@@ -96,7 +96,16 @@ export const EditorPropTypes: IEditorPropTypes = {
96
96
  toolbar: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
97
97
  disabled: PropTypes.bool,
98
98
  textareaName: PropTypes.string,
99
- tinymceScriptSrc: PropTypes.string,
99
+ tinymceScriptSrc: PropTypes.oneOfType([
100
+ PropTypes.string,
101
+ PropTypes.arrayOf(PropTypes.string),
102
+ PropTypes.arrayOf(PropTypes.shape({
103
+ src: PropTypes.string,
104
+ async: PropTypes.bool,
105
+ defer: PropTypes.bool
106
+ }))
107
+ ]),
108
+ rollback: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf([false])]),
100
109
  scriptLoading: PropTypes.shape({
101
110
  async: PropTypes.bool,
102
111
  defer: PropTypes.bool,
@@ -1,11 +1,3 @@
1
- /**
2
- * Copyright (c) 2017-present, Ephox, Inc.
3
- *
4
- * This source code is licensed under the Apache 2 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
1
+ import { Editor, IAllProps } from './components/Editor';
8
2
 
9
- import { Editor } from './components/Editor';
10
-
11
- export { Editor };
3
+ export { Editor, IAllProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "argous",
3
- "version": "1.2.203",
3
+ "version": "1.2.204",
4
4
  "description": "Argous.",
5
5
  "main": "lib/index.js",
6
6
  "author": "Carlos Schneider",
@@ -1,96 +0,0 @@
1
- /**
2
- * Copyright (c) 2017-present, Ephox, Inc.
3
- *
4
- * This source code is licensed under the Apache 2 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import { uuid } from './Utils';
10
-
11
- export type callbackFn = () => void;
12
- export interface IStateObj {
13
- listeners: callbackFn[];
14
- scriptId: string;
15
- scriptLoading: boolean;
16
- scriptLoaded: boolean;
17
- }
18
-
19
- const createState = (): IStateObj => ({
20
- listeners: [],
21
- scriptId: uuid('tiny-script'),
22
- scriptLoading: false,
23
- scriptLoaded: false
24
- });
25
-
26
- interface ScriptLoaderInterface {
27
- load: (doc: Document, url: string, async: boolean, defer: boolean, delay: number, callback: callbackFn) => void;
28
- reinitialize: () => void;
29
- }
30
-
31
- const CreateScriptLoader = (): ScriptLoaderInterface => {
32
- let state: IStateObj = createState();
33
-
34
- const injectScriptTag = (scriptId: string, doc: Document, url: string, async: boolean, defer: boolean, callback: callbackFn) => {
35
- const scriptTag = doc.createElement('script');
36
- scriptTag.referrerPolicy = 'origin';
37
- scriptTag.type = 'application/javascript';
38
- scriptTag.id = scriptId;
39
- scriptTag.src = url;
40
- scriptTag.async = async;
41
- scriptTag.defer = defer;
42
-
43
- // scriptTag.appendChild(document.createTextNode(url));
44
-
45
- const handler = () => {
46
- scriptTag.removeEventListener('load', handler);
47
- callback();
48
- };
49
- scriptTag.addEventListener('load', handler);
50
- if (doc.head) {
51
- doc.head.appendChild(scriptTag);
52
- }
53
- // document.body.appendChild(scriptTag);
54
- };
55
-
56
- const load = (doc: Document, url: string, async: boolean, defer: boolean, delay: number, callback: callbackFn) => {
57
-
58
- const scriptTagInjection = () => injectScriptTag(
59
- state.scriptId, doc, url, async, defer,
60
- () => {
61
- state.listeners.forEach((fn) => fn());
62
- state.scriptLoaded = true;
63
- }
64
- );
65
-
66
- if (state.scriptLoaded) {
67
- callback();
68
- } else {
69
- state.listeners.push(callback);
70
- if (!state.scriptLoading) {
71
- state.scriptLoading = true;
72
- if (delay > 0) {
73
- setTimeout(scriptTagInjection, delay);
74
- } else {
75
- scriptTagInjection();
76
- }
77
- }
78
- }
79
- };
80
-
81
- // Only to be used by tests.
82
- const reinitialize = () => {
83
- state = createState();
84
- };
85
-
86
- return {
87
- load,
88
- reinitialize
89
- };
90
- };
91
-
92
- const ScriptLoader = CreateScriptLoader();
93
-
94
- export {
95
- ScriptLoader
96
- };