@modusoperandi/licit 1.0.5 → 1.0.8
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/BlockquoteInsertNewLineCommand.js +10 -11
- package/BlockquoteInsertNewLineCommand.js.flow +1 -2
- package/BlockquoteNodeSpec.js +2 -3
- package/BlockquoteNodeSpec.js.flow +1 -2
- package/BlockquoteToggleCommand.js +9 -9
- package/BookmarkNodeSpec.js +1 -1
- package/CodeBlockCommand.js +10 -10
- package/CodeBlockCommand.js.flow +1 -1
- package/ContentPlaceholderPlugin.js +17 -18
- package/ContentPlaceholderPlugin.js.flow +10 -14
- package/CursorPlaceholderPlugin.js +8 -9
- package/CursorPlaceholderPlugin.js.flow +0 -2
- package/DocLayoutCommand.js +10 -12
- package/DocLayoutCommand.js.flow +1 -3
- package/EditorKeyMap.js +0 -1
- package/EditorKeyMap.js.flow +0 -2
- package/EditorMarks.js +1 -1
- package/EditorNodes.js +1 -2
- package/EditorNodes.js.flow +0 -1
- package/EditorPageLayoutPlugin.js +8 -8
- package/FontTypeMarkSpec.js +1 -1
- package/FontTypeMarkSpec.js.flow +1 -1
- package/HTMLMutator.js +6 -7
- package/HTMLMutator.js.flow +2 -3
- package/HeadingNodeSpec.js +2 -12
- package/HeadingNodeSpec.js.flow +4 -14
- package/HistoryRedoCommand.js +9 -9
- package/HistoryUndoCommand.js +9 -9
- package/HorizontalRuleCommand.js +9 -9
- package/ImageUploadPlaceholderPlugin.js +14 -18
- package/ImageUploadPlaceholderPlugin.js.flow +6 -11
- package/LinkMarkSpec.js +6 -1
- package/LinkMarkSpec.js.flow +5 -0
- package/LinkSetURLCommand.js +126 -55
- package/LinkSetURLCommand.js.flow +61 -37
- package/LinkTooltipPlugin.js +119 -31
- package/LinkTooltipPlugin.js.flow +91 -22
- package/ListItemInsertNewLineCommand.js +10 -11
- package/ListItemInsertNewLineCommand.js.flow +1 -2
- package/ListItemMergeCommand.js +17 -16
- package/ListItemMergeCommand.js.flow +4 -6
- package/ListSplitCommand.js +9 -9
- package/ListToggleCommand.js +9 -9
- package/MarksClearCommand.js +9 -9
- package/MathEditCommand.js +10 -11
- package/MathEditCommand.js.flow +1 -2
- package/OrderedListNodeSpec.js +1 -1
- package/ParagraphNodeSpec.js +11 -2
- package/ParagraphNodeSpec.js.flow +9 -2
- package/ParagraphSpacingCommand.js +13 -14
- package/ParagraphSpacingCommand.js.flow +4 -9
- package/PrintCommand.js +9 -9
- package/SelectionPlaceholderPlugin.js +8 -9
- package/SelectionPlaceholderPlugin.js.flow +0 -2
- package/SpacerMarkSpec.js +1 -1
- package/StyleView.js +3 -4
- package/StyleView.js.flow +0 -1
- package/TableBackgroundColorCommand.js +13 -16
- package/TableBackgroundColorCommand.js.flow +14 -18
- package/TableBorderColorCommand.js +13 -16
- package/TableBorderColorCommand.js.flow +14 -20
- package/TableCellColorCommand.js +11 -13
- package/TableCellColorCommand.js.flow +2 -4
- package/TableCellMenuPlugin.js +16 -16
- package/TableCellMenuPlugin.js.flow +5 -8
- package/TableInsertCommand.js +12 -15
- package/TableInsertCommand.js.flow +3 -6
- package/TableMergeCellsCommand.js +13 -12
- package/TableMergeCellsCommand.js.flow +4 -3
- package/TableNodesSpecs.js +4 -2
- package/TableNodesSpecs.js.flow +4 -2
- package/TableResizePlugin.js +18 -18
- package/TableResizePlugin.js.flow +2 -3
- package/TextInsertTabSpaceCommand.js +9 -9
- package/Types.js +1 -0
- package/Types.js.flow +2 -5
- package/WebFontLoader.js +4 -4
- package/bom.xml +20047 -28206
- package/buildEditorPlugins.js +4 -4
- package/buildInputRules.js +8 -4
- package/buildInputRules.js.flow +8 -4
- package/client/CollabConnector.js +9 -9
- package/client/EditorConnection.js +8 -6
- package/client/EditorConnection.js.flow +3 -2
- package/client/Licit.js +22 -59
- package/client/Licit.js.flow +12 -45
- package/client/Licit.test.js +49 -39
- package/client/Licit.test.js.flow +40 -34
- package/client/Reporter.js +3 -3
- package/client/SimpleConnector.js +4 -4
- package/client/http.js +0 -6
- package/client/http.js.flow +0 -8
- package/client/throttle.js +8 -2
- package/client/throttle.js.flow +2 -2
- package/convertFromDOMElement.js +2 -4
- package/convertFromDOMElement.js.flow +2 -5
- package/convertFromHTML.js +2 -3
- package/convertFromHTML.js.flow +2 -4
- package/convertFromJSON.js +1 -2
- package/convertFromJSON.js.flow +1 -2
- package/convertToCSSPTValue.js +6 -10
- package/convertToCSSPTValue.js.flow +8 -11
- package/createCommand.js +9 -9
- package/createEditorKeyMap.js +1 -1
- package/createEmptyEditorState.js +2 -3
- package/createEmptyEditorState.js.flow +2 -4
- package/createTableResizingPlugin.js +6 -6
- package/createTableResizingPlugin.js.flow +1 -1
- package/findActiveMark.js +1 -1
- package/findActiveMark.js.flow +1 -1
- package/insertTable.js +0 -3
- package/insertTable.js.flow +0 -2
- package/joinDown.js +1 -3
- package/joinDown.js.flow +1 -3
- package/joinUp.js +1 -3
- package/joinUp.js.flow +1 -3
- package/lookUpElement.js +2 -1
- package/lookUpElement.js.flow +1 -1
- package/normalizeHTML.js +3 -1
- package/normalizeHTML.js.flow +3 -1
- package/package.json +23 -17
- package/patchAnchorElements.js +1 -1
- package/patchAnchorElements.js.flow +1 -1
- package/patchBreakElements.js +3 -2
- package/patchBreakElements.js.flow +2 -2
- package/patchElementInlineStyles.js +1 -1
- package/patchElementInlineStyles.js.flow +1 -1
- package/patchListElements.js +6 -7
- package/patchListElements.js.flow +7 -8
- package/patchMathElements.js +5 -7
- package/patchMathElements.js.flow +2 -4
- package/patchStyleElements.js +1 -1
- package/patchStyleElements.js.flow +7 -6
- package/patchTableElements.js +2 -3
- package/patchTableElements.js.flow +2 -3
- package/sanitizeURL.js +1 -1
- package/sanitizeURL.js.flow +1 -1
- package/splitListItem.js +2 -2
- package/splitListItem.js.flow +1 -1
- package/styles.css +32 -3
- package/toggleBlockquote.js +4 -5
- package/toggleBlockquote.js.flow +5 -12
- package/toggleCodeBlock.js +6 -6
- package/toggleCodeBlock.js.flow +10 -10
- package/ui/AlertInfo.js +9 -10
- package/ui/AlertInfo.js.flow +0 -1
- package/ui/BookmarkNodeView.js +13 -13
- package/ui/BookmarkNodeView.js.flow +0 -2
- package/ui/CommandButton.js +9 -9
- package/ui/CommandMenu.js +12 -12
- package/ui/CommandMenu.js.flow +1 -1
- package/ui/CommandMenuButton.js +11 -13
- package/ui/CommandMenuButton.js.flow +2 -5
- package/ui/CustomEditorView.js +13 -12
- package/ui/CustomEditorView.js.flow +1 -0
- package/ui/CustomMenu.js +8 -10
- package/ui/CustomMenu.js.flow +0 -3
- package/ui/CustomMenuItem.js +10 -11
- package/ui/CustomMenuItem.js.flow +0 -1
- package/ui/CustomNodeView.js +27 -16
- package/ui/CustomNodeView.js.flow +16 -9
- package/ui/CustomRadioButton.js +13 -16
- package/ui/CustomRadioButton.js.flow +2 -4
- package/ui/DocLayoutEditor.js +10 -13
- package/ui/DocLayoutEditor.js.flow +1 -5
- package/ui/Editor.js +16 -16
- package/ui/Editor.js.flow +7 -12
- package/ui/EditorFrameset.js +9 -10
- package/ui/EditorFrameset.js.flow +0 -2
- package/ui/EditorToolbar.js +24 -30
- package/ui/EditorToolbar.js.flow +22 -43
- package/ui/EditorToolbarConfig.js +5 -5
- package/ui/EditorToolbarConfig.js.flow +1 -1
- package/ui/FontSizeCommandMenuButton.js +10 -10
- package/ui/FontSizeCommandMenuButton.js.flow +1 -1
- package/ui/FontTypeCommandMenuButton.js +11 -12
- package/ui/FontTypeCommandMenuButton.js.flow +4 -5
- package/ui/Frag.js +8 -9
- package/ui/Frag.js.flow +0 -2
- package/ui/Icon.js +12 -18
- package/ui/Icon.js.flow +0 -7
- package/ui/ImageInlineEditor.js +9 -10
- package/ui/ImageInlineEditor.js.flow +0 -1
- package/ui/LinkTooltip.js +62 -28
- package/ui/LinkTooltip.js.flow +55 -24
- package/ui/LinkURLEditor.js +151 -36
- package/ui/LinkURLEditor.js.flow +176 -54
- package/ui/ListItemNodeView.js +4 -4
- package/ui/ListTypeButton.js +11 -15
- package/ui/ListTypeButton.js.flow +2 -6
- package/ui/ListTypeCommandButton.js +10 -10
- package/ui/ListTypeCommandButton.js.flow +1 -1
- package/ui/ListTypeMenu.js +11 -12
- package/ui/ListTypeMenu.js.flow +1 -2
- package/ui/LoadingIndicator.js +8 -9
- package/ui/LoadingIndicator.js.flow +0 -1
- package/ui/MathEditor.js +10 -15
- package/ui/MathEditor.js.flow +1 -9
- package/ui/MathInlineEditor.js +13 -14
- package/ui/MathInlineEditor.js.flow +3 -5
- package/ui/MathNodeView.js +16 -16
- package/ui/MathNodeView.js.flow +10 -21
- package/ui/PasteMenu.js +11 -15
- package/ui/PasteMenu.js.flow +0 -5
- package/ui/ResizeObserver.js +4 -4
- package/ui/ResizeObserver.js.flow +3 -4
- package/ui/RichTextEditor.js +9 -9
- package/ui/SelectionObserver.js +6 -6
- package/ui/SelectionObserver.js.flow +2 -2
- package/ui/TableCellMenu.js +9 -10
- package/ui/TableCellMenu.js.flow +0 -2
- package/ui/TableGridSizeEditor.js +12 -15
- package/ui/TableGridSizeEditor.js.flow +7 -6
- package/ui/TableNodeView.js +15 -13
- package/ui/TableNodeView.js.flow +3 -3
- package/ui/bindScrollHandler.js +2 -1
- package/ui/bindScrollHandler.js.flow +1 -1
- package/ui/canUseCSSFont.js +5 -4
- package/ui/canUseCSSFont.js.flow +4 -5
- package/ui/czi-editor.css +1 -4
- package/ui/czi-form.css +102 -8
- package/ui/czi-image-view.css +1 -5
- package/ui/czi-link-tooltip.css +41 -0
- package/ui/czi-list.css +0 -4
- package/ui/czi-loading-indicator.css +1 -46
- package/ui/czi-table-cell-menu.css +3 -1
- package/ui/findActiveFontSize.js +2 -1
- package/ui/findActiveFontSize.js.flow +1 -4
- package/ui/findActiveFontType.js +4 -3
- package/ui/findActiveFontType.js.flow +3 -6
- package/ui/handleEditorDrop.js +1 -1
- package/ui/handleEditorDrop.js.flow +1 -1
- package/ui/handleEditorKeyDown.js +1 -1
- package/ui/handleEditorKeyDown.js.flow +1 -1
- package/ui/handleEditorPaste.js +1 -1
- package/ui/handleEditorPaste.js.flow +1 -1
- package/ui/injectStyleSheet.js +2 -2
- package/ui/injectStyleSheet.js.flow +2 -4
- package/ui/isElementFullyVisible.js +1 -10
- package/ui/isElementFullyVisible.js.flow +1 -13
- package/ui/mathquill-editor/MathQuillEditor.js +12 -14
- package/ui/mathquill-editor/MathQuillEditor.js.flow +0 -2
- package/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js +9 -10
- package/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js.flow +0 -1
- package/ui/mathquill-editor/mathquill-import-kludge.js +1 -9
- package/ui/mathquill-editor/mathquill-import-kludge.js.flow +0 -9
- package/ui/renderLaTeXAsHTML.js +3 -7
- package/ui/renderLaTeXAsHTML.js.flow +0 -4
- package/ui/resolveImage.js +4 -5
- package/ui/resolveImage.js.flow +3 -5
- package/ui/toCSSLineSpacing.js +2 -3
- package/ui/toCSSLineSpacing.js.flow +2 -4
- package/styles0.css +0 -29
package/ui/LinkURLEditor.js.flow
CHANGED
|
@@ -5,54 +5,85 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
|
|
6
6
|
import sanitizeURL from '../sanitizeURL.js';
|
|
7
7
|
import {
|
|
8
|
-
CustomButton
|
|
8
|
+
CustomButton,
|
|
9
|
+
preventEventDefault,
|
|
9
10
|
} from '@modusoperandi/licit-ui-commands';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
} from '
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
} from '@modusoperandi/licit-ui-commands';
|
|
16
|
-
|
|
17
|
-
import './czi-form.css';
|
|
18
|
-
import './czi-image-url-editor.css';
|
|
11
|
+
import { ENTER } from './KeyCodes.js';
|
|
12
|
+
import uuid from '../uuid.js';
|
|
13
|
+
import { EditorView } from 'prosemirror-view';
|
|
14
|
+
import { INNER_LINK } from '../Types.js';
|
|
15
|
+
import { Tooltip as ReactTooltip } from 'react-tooltip';
|
|
19
16
|
|
|
20
17
|
const BAD_CHARACTER_PATTER = /\s/;
|
|
21
18
|
|
|
22
19
|
class LinkURLEditor extends React.PureComponent<any, any> {
|
|
23
|
-
|
|
24
|
-
// Upgrade outdated packages.
|
|
25
|
-
// To take care of the property type declaration.
|
|
26
|
-
static propsTypes = {
|
|
20
|
+
static propTypes = {
|
|
27
21
|
href: PropTypes.string,
|
|
28
|
-
close:
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
-
!fn.prototype ||
|
|
32
|
-
(typeof fn.prototype.constructor !== 'function' &&
|
|
33
|
-
fn.prototype.constructor.length !== 1)
|
|
34
|
-
) {
|
|
35
|
-
return new Error(
|
|
36
|
-
propName + 'must be a function with 1 arg of type string'
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
return null;
|
|
40
|
-
},
|
|
22
|
+
close: PropTypes.func.isRequired,
|
|
23
|
+
selectedTab: this.state?.selectedTab,
|
|
41
24
|
};
|
|
42
25
|
|
|
43
26
|
state = {
|
|
44
|
-
url: this.props.
|
|
27
|
+
url: this.props.href_,
|
|
28
|
+
TOCselectedNode_: this.props.TOCselectedNode_,
|
|
29
|
+
view_: this.props.view_,
|
|
30
|
+
selectionId: this.props.selectionId_,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
componentDidMount() {
|
|
34
|
+
const { selectionId } = this.state;
|
|
35
|
+
const defaultTab = selectionId ? 'innerlink' : 'webpage';
|
|
36
|
+
|
|
37
|
+
const selectedTab = this.props.selectedTab || defaultTab;
|
|
38
|
+
this.openForm(selectedTab);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
openForm = (formName) => {
|
|
42
|
+
let i;
|
|
43
|
+
const tabcontent = document.getElementsByClassName('tabcontent');
|
|
44
|
+
for (i = 0; i < tabcontent.length; i++) {
|
|
45
|
+
tabcontent[i].style.display = 'none';
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const tablinks = document.getElementsByClassName('tablinks');
|
|
49
|
+
for (i = 0; i < tablinks.length; i++) {
|
|
50
|
+
tablinks[i].classList.remove('active');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const selectedTab = document.getElementById(formName);
|
|
54
|
+
if (selectedTab) {
|
|
55
|
+
selectedTab.style.display = 'block';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const clickedButton = document.querySelector(
|
|
59
|
+
`.tablinks[data-form="${formName}"]`
|
|
60
|
+
);
|
|
61
|
+
if (clickedButton) {
|
|
62
|
+
clickedButton.classList.add('active');
|
|
63
|
+
}
|
|
45
64
|
};
|
|
46
65
|
|
|
47
66
|
render(): React.Element<any> {
|
|
48
|
-
const {
|
|
49
|
-
|
|
67
|
+
const { url, TOCselectedNode_, view_, selectionId } =
|
|
68
|
+
this.state;
|
|
69
|
+
|
|
70
|
+
const isTOCValid = () => {
|
|
71
|
+
if (!TOCselectedNode_ || TOCselectedNode_.length === 0) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return TOCselectedNode_.some(
|
|
76
|
+
item => item.node_ && item.node_.textContent.trim() !== ''
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
const isValid = isTOCValid();
|
|
80
|
+
console.log('isTOCValid:', isValid);
|
|
50
81
|
|
|
51
82
|
const error = url ? BAD_CHARACTER_PATTER.test(url) : false;
|
|
52
83
|
|
|
53
84
|
let label = 'Apply';
|
|
54
|
-
let disabled
|
|
55
|
-
if (href) {
|
|
85
|
+
let disabled;
|
|
86
|
+
if (this.props.href) {
|
|
56
87
|
label = url ? 'Apply' : 'Remove';
|
|
57
88
|
disabled = error;
|
|
58
89
|
} else {
|
|
@@ -61,33 +92,124 @@ class LinkURLEditor extends React.PureComponent<any, any> {
|
|
|
61
92
|
|
|
62
93
|
return (
|
|
63
94
|
<div className="czi-image-url-editor">
|
|
64
|
-
<
|
|
65
|
-
<
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
95
|
+
<div className="czi-form" style={{padding:'10px', display:'flex'}}>
|
|
96
|
+
<div className="tab">
|
|
97
|
+
<button
|
|
98
|
+
className="tablinks"
|
|
99
|
+
data-form="webpage"
|
|
100
|
+
onClick={() => this.openForm('webpage')}
|
|
101
|
+
>
|
|
102
|
+
Existing Web Page
|
|
103
|
+
</button>
|
|
104
|
+
<button
|
|
105
|
+
className="tablinks"
|
|
106
|
+
data-form="innerlink"
|
|
107
|
+
onClick={() => this.openForm('innerlink')}
|
|
108
|
+
>
|
|
109
|
+
Place in this Document
|
|
110
|
+
</button>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<div className="tabcontent" id="webpage">
|
|
114
|
+
<form onSubmit={preventEventDefault}>
|
|
115
|
+
<fieldset>
|
|
116
|
+
<label>Add a Link : </label>
|
|
117
|
+
<input
|
|
118
|
+
autoFocus={true}
|
|
119
|
+
onChange={this._onURLChange}
|
|
120
|
+
onKeyDown={this._onKeyDown}
|
|
121
|
+
placeholder="Paste a URL"
|
|
122
|
+
spellCheck={false}
|
|
123
|
+
type="text"
|
|
124
|
+
value={selectionId ? null : url}
|
|
125
|
+
/>
|
|
126
|
+
</fieldset>
|
|
127
|
+
<div className="czi-form-buttons">
|
|
128
|
+
<CustomButton label="Cancel" onClick={this._cancel} />
|
|
129
|
+
<CustomButton
|
|
130
|
+
active={true}
|
|
131
|
+
disabled={disabled}
|
|
132
|
+
label={label}
|
|
133
|
+
onClick={() => {
|
|
134
|
+
this._apply();
|
|
135
|
+
}}
|
|
136
|
+
/>
|
|
137
|
+
</div>
|
|
138
|
+
</form>
|
|
85
139
|
</div>
|
|
86
|
-
|
|
140
|
+
{!isValid ? (
|
|
141
|
+
<div className="tabcontent" id="innerlink" >
|
|
142
|
+
<p>No TOC styles</p>
|
|
143
|
+
<div className="czi-form-buttons">
|
|
144
|
+
<CustomButton label="Cancel" onClick={this._cancel} />
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
) : (
|
|
148
|
+
<div className="tabcontent" id="innerlink">
|
|
149
|
+
<form action="#">
|
|
150
|
+
<label>Select the Inner Link</label>
|
|
151
|
+
<br></br>
|
|
152
|
+
<select
|
|
153
|
+
defaultValue={
|
|
154
|
+
TOCselectedNode_.some(res => res.node_.textContent === url) ? url : null
|
|
155
|
+
}
|
|
156
|
+
id="toc"
|
|
157
|
+
name="toccontents"
|
|
158
|
+
size="3"
|
|
159
|
+
>
|
|
160
|
+
{TOCselectedNode_?.filter(res => res.node_.textContent.trim() !== '').map((res, index) => (
|
|
161
|
+
<option
|
|
162
|
+
data-tooltip-content={res.node_.textContent}
|
|
163
|
+
data-tooltip-id="select-toc-tooltip"
|
|
164
|
+
key={index}
|
|
165
|
+
onClick={() => {
|
|
166
|
+
this.handleOptionChange(
|
|
167
|
+
res.node_.textContent,
|
|
168
|
+
res.pos_,
|
|
169
|
+
view_
|
|
170
|
+
);
|
|
171
|
+
}}
|
|
172
|
+
value={res.node_.textContent}
|
|
173
|
+
>
|
|
174
|
+
{res.node_.textContent}
|
|
175
|
+
</option>
|
|
176
|
+
))}
|
|
177
|
+
</select>
|
|
178
|
+
<ReactTooltip
|
|
179
|
+
effect="solid"
|
|
180
|
+
id="select-toc-tooltip"
|
|
181
|
+
place="bottom"
|
|
182
|
+
/>
|
|
183
|
+
<br></br>
|
|
184
|
+
<div className="czi-form-buttons">
|
|
185
|
+
<CustomButton label="Cancel" onClick={this._cancel} />
|
|
186
|
+
</div>
|
|
187
|
+
</form>
|
|
188
|
+
</div>
|
|
189
|
+
)}
|
|
190
|
+
</div>
|
|
87
191
|
</div>
|
|
88
192
|
);
|
|
89
193
|
}
|
|
90
194
|
|
|
195
|
+
handleOptionChange = (textContent_, tocNodePosition_, view: EditorView) => {
|
|
196
|
+
const tr = view.state.tr;
|
|
197
|
+
const TocNode = view.state.doc.nodeAt(tocNodePosition_);
|
|
198
|
+
let textContent;
|
|
199
|
+
if (!TocNode?.attrs?.innerLink) {
|
|
200
|
+
const nodeUUID = uuid();
|
|
201
|
+
const texthash = '#';
|
|
202
|
+
const nodeAttrs = TocNode.attrs;
|
|
203
|
+
const nodeconcat_UUID = texthash.concat(nodeUUID);
|
|
204
|
+
nodeAttrs.innerLink = nodeconcat_UUID;
|
|
205
|
+
tr.setNodeMarkup(tocNodePosition_, undefined, nodeAttrs);
|
|
206
|
+
textContent = nodeconcat_UUID.concat(INNER_LINK, textContent_);
|
|
207
|
+
} else {
|
|
208
|
+
textContent = TocNode.attrs.innerLink.concat(INNER_LINK, textContent_);
|
|
209
|
+
}
|
|
210
|
+
this.props.close(textContent);
|
|
211
|
+
};
|
|
212
|
+
|
|
91
213
|
_onKeyDown = (e: any) => {
|
|
92
214
|
if (e.keyCode === ENTER) {
|
|
93
215
|
e.preventDefault();
|
package/ui/ListItemNodeView.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _classCallCheck(
|
|
3
|
-
function _defineProperties(
|
|
4
|
-
function _createClass(
|
|
5
|
-
function _defineProperty(
|
|
2
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
8
|
import { Node } from 'prosemirror-model';
|
package/ui/ListTypeButton.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _classCallCheck(
|
|
5
|
-
function _defineProperties(
|
|
6
|
-
function _createClass(
|
|
4
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
5
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
6
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
7
7
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
-
function _possibleConstructorReturn(
|
|
9
|
-
function _assertThisInitialized(
|
|
8
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
9
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
-
function _getPrototypeOf(
|
|
12
|
-
function _inherits(
|
|
13
|
-
function _setPrototypeOf(
|
|
14
|
-
function _defineProperty(
|
|
11
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
12
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
13
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
14
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
15
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
16
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
17
|
// [FS] IRAD-1039 2020-09-23
|
|
@@ -22,12 +22,10 @@ import { EditorState } from 'prosemirror-state';
|
|
|
22
22
|
import { Transform } from 'prosemirror-transform';
|
|
23
23
|
import { EditorView } from 'prosemirror-view';
|
|
24
24
|
import * as React from 'react';
|
|
25
|
-
import { CustomButton } from '@modusoperandi/licit-ui-commands';
|
|
25
|
+
import { CustomButton, createPopUp } from '@modusoperandi/licit-ui-commands';
|
|
26
26
|
import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
|
|
27
|
-
import { createPopUp } from '@modusoperandi/licit-ui-commands';
|
|
28
27
|
import uuid from './uuid.js';
|
|
29
28
|
import ListTypeMenu from './ListTypeMenu.js';
|
|
30
|
-
import './czi-custom-menu-button.css';
|
|
31
29
|
var ListTypeButton = /*#__PURE__*/function (_React$PureComponent) {
|
|
32
30
|
function ListTypeButton() {
|
|
33
31
|
var _this;
|
|
@@ -52,7 +50,7 @@ var ListTypeButton = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
52
50
|
_defineProperty(_this, "_hideMenu", function () {
|
|
53
51
|
var menu = _this._menu;
|
|
54
52
|
_this._menu = null;
|
|
55
|
-
menu
|
|
53
|
+
menu === null || menu === void 0 || menu.close();
|
|
56
54
|
});
|
|
57
55
|
_defineProperty(_this, "_showMenu", function () {
|
|
58
56
|
var menu = _this._menu;
|
|
@@ -99,11 +97,9 @@ var ListTypeButton = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
99
97
|
title = _this$props.title;
|
|
100
98
|
var enabled = !disabled && commandGroups.some(function (group, ii) {
|
|
101
99
|
return Object.keys(group).some(function (label) {
|
|
102
|
-
// const command = group[label];
|
|
103
100
|
var disabledVal = true;
|
|
104
101
|
try {
|
|
105
102
|
disabledVal = false;
|
|
106
|
-
// !editorView || !command.isEnabled(editorState, editorView);
|
|
107
103
|
} catch (ex) {
|
|
108
104
|
disabledVal = false;
|
|
109
105
|
}
|
|
@@ -8,12 +8,10 @@ import { EditorState } from 'prosemirror-state';
|
|
|
8
8
|
import { Transform } from 'prosemirror-transform';
|
|
9
9
|
import { EditorView } from 'prosemirror-view';
|
|
10
10
|
import * as React from 'react';
|
|
11
|
-
import { CustomButton } from '@modusoperandi/licit-ui-commands';
|
|
11
|
+
import { CustomButton, createPopUp } from '@modusoperandi/licit-ui-commands';
|
|
12
12
|
import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
|
|
13
|
-
import { createPopUp } from '@modusoperandi/licit-ui-commands';
|
|
14
13
|
import uuid from './uuid.js';
|
|
15
14
|
import ListTypeMenu from './ListTypeMenu.js';
|
|
16
|
-
import './czi-custom-menu-button.css';
|
|
17
15
|
|
|
18
16
|
class ListTypeButton extends React.PureComponent<any, any> {
|
|
19
17
|
props: {
|
|
@@ -50,11 +48,9 @@ class ListTypeButton extends React.PureComponent<any, any> {
|
|
|
50
48
|
!disabled &&
|
|
51
49
|
commandGroups.some((group, ii) => {
|
|
52
50
|
return Object.keys(group).some((label) => {
|
|
53
|
-
// const command = group[label];
|
|
54
51
|
let disabledVal = true;
|
|
55
52
|
try {
|
|
56
53
|
disabledVal = false;
|
|
57
|
-
// !editorView || !command.isEnabled(editorState, editorView);
|
|
58
54
|
} catch (ex) {
|
|
59
55
|
disabledVal = false;
|
|
60
56
|
}
|
|
@@ -96,7 +92,7 @@ class ListTypeButton extends React.PureComponent<any, any> {
|
|
|
96
92
|
_hideMenu = (): void => {
|
|
97
93
|
const menu = this._menu;
|
|
98
94
|
this._menu = null;
|
|
99
|
-
menu
|
|
95
|
+
menu?.close();
|
|
100
96
|
};
|
|
101
97
|
|
|
102
98
|
_showMenu = (): void => {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _classCallCheck(
|
|
3
|
-
function _defineProperties(
|
|
4
|
-
function _createClass(
|
|
2
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
5
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
6
|
-
function _possibleConstructorReturn(
|
|
7
|
-
function _assertThisInitialized(
|
|
6
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
7
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
-
function _getPrototypeOf(
|
|
10
|
-
function _inherits(
|
|
11
|
-
function _setPrototypeOf(
|
|
12
|
-
function _defineProperty(
|
|
9
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
10
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
11
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
14
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
15
|
// [FS] IRAD-1039 2020-09-23
|
|
@@ -73,7 +73,7 @@ var ListTypeCommandButton = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
73
73
|
// [FS] IRAD-1317 2021-05-06
|
|
74
74
|
// To disable the list menu when select an image
|
|
75
75
|
disabled = hasImageNode(editorState);
|
|
76
|
-
disabled = editorView.disabled || disabled
|
|
76
|
+
disabled = editorView.disabled || disabled;
|
|
77
77
|
}
|
|
78
78
|
return /*#__PURE__*/React.createElement(ListTypeButton, {
|
|
79
79
|
className: "width-50 czi-icon format_list_numbered",
|
|
@@ -66,7 +66,7 @@ class ListTypeCommandButton extends React.PureComponent<any, any> {
|
|
|
66
66
|
// To disable the list menu when select an image
|
|
67
67
|
disabled =
|
|
68
68
|
hasImageNode(editorState);
|
|
69
|
-
|
|
69
|
+
disabled = editorView.disabled || disabled;
|
|
70
70
|
}
|
|
71
71
|
return (
|
|
72
72
|
<ListTypeButton
|
package/ui/ListTypeMenu.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _classCallCheck(
|
|
3
|
-
function _defineProperties(
|
|
4
|
-
function _createClass(
|
|
2
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
5
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
6
|
-
function _possibleConstructorReturn(
|
|
7
|
-
function _assertThisInitialized(
|
|
6
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
7
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
-
function _getPrototypeOf(
|
|
10
|
-
function _inherits(
|
|
11
|
-
function _setPrototypeOf(
|
|
12
|
-
function _defineProperty(
|
|
9
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
10
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
11
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
14
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
15
|
import * as React from 'react';
|
|
@@ -18,7 +18,6 @@ import { EditorState } from 'prosemirror-state';
|
|
|
18
18
|
import { Transform } from 'prosemirror-transform';
|
|
19
19
|
import { EditorView } from 'prosemirror-view';
|
|
20
20
|
import uuid from './uuid.js';
|
|
21
|
-
import './listType.css';
|
|
22
21
|
|
|
23
22
|
// [FS] IRAD-1039 2020-09-24
|
|
24
23
|
// UI to show the list buttons
|
|
@@ -49,7 +48,7 @@ var ListTypeMenu = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
49
48
|
editorView = _this$props.editorView,
|
|
50
49
|
onCommand = _this$props.onCommand;
|
|
51
50
|
if (command.execute(editorState, dispatch, editorView, e)) {
|
|
52
|
-
onCommand
|
|
51
|
+
onCommand === null || onCommand === void 0 || onCommand();
|
|
53
52
|
}
|
|
54
53
|
});
|
|
55
54
|
return _this;
|
|
@@ -64,7 +63,7 @@ var ListTypeMenu = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
64
63
|
commandGroups.forEach(function (group, ii) {
|
|
65
64
|
Object.keys(group).forEach(function (label) {
|
|
66
65
|
var command = group[label];
|
|
67
|
-
children.push(
|
|
66
|
+
children.push(/*#__PURE__*/React.createElement("button", {
|
|
68
67
|
className: "buttonsize",
|
|
69
68
|
id: label,
|
|
70
69
|
key: label,
|
package/ui/ListTypeMenu.js.flow
CHANGED
|
@@ -4,7 +4,6 @@ import { EditorState } from 'prosemirror-state';
|
|
|
4
4
|
import { Transform } from 'prosemirror-transform';
|
|
5
5
|
import { EditorView } from 'prosemirror-view';
|
|
6
6
|
import uuid from './uuid.js';
|
|
7
|
-
import './listType.css';
|
|
8
7
|
|
|
9
8
|
// [FS] IRAD-1039 2020-09-24
|
|
10
9
|
// UI to show the list buttons
|
|
@@ -62,7 +61,7 @@ class ListTypeMenu extends React.PureComponent<any, any> {
|
|
|
62
61
|
_execute = (command, e) => {
|
|
63
62
|
const { dispatch, editorState, editorView, onCommand } = this.props;
|
|
64
63
|
if (command.execute(editorState, dispatch, editorView, e)) {
|
|
65
|
-
onCommand
|
|
64
|
+
onCommand?.();
|
|
66
65
|
}
|
|
67
66
|
};
|
|
68
67
|
}
|
package/ui/LoadingIndicator.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _classCallCheck(
|
|
3
|
-
function _defineProperties(
|
|
4
|
-
function _createClass(
|
|
2
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
-
function _possibleConstructorReturn(
|
|
9
|
-
function _assertThisInitialized(
|
|
8
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
9
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
-
function _getPrototypeOf(
|
|
12
|
-
function _inherits(
|
|
13
|
-
function _setPrototypeOf(
|
|
14
|
-
import './czi-loading-indicator.css';
|
|
11
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
12
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
13
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
15
14
|
import * as React from 'react';
|
|
16
15
|
|
|
17
16
|
// https://loading.io/css/
|
package/ui/MathEditor.js
CHANGED
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _classCallCheck(
|
|
3
|
-
function _defineProperties(
|
|
4
|
-
function _createClass(
|
|
2
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
5
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
6
|
-
function _possibleConstructorReturn(
|
|
7
|
-
function _assertThisInitialized(
|
|
6
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
7
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
-
function _getPrototypeOf(
|
|
10
|
-
function _inherits(
|
|
11
|
-
function _setPrototypeOf(
|
|
12
|
-
function _defineProperty(
|
|
9
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
10
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
11
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
14
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
15
|
import * as React from 'react';
|
|
16
16
|
import PropTypes from 'prop-types';
|
|
17
|
-
import { CustomButton } from '@modusoperandi/licit-ui-commands';
|
|
17
|
+
import { CustomButton, preventEventDefault } from '@modusoperandi/licit-ui-commands';
|
|
18
18
|
import MathQuillEditor from './mathquill-editor/MathQuillEditor.js';
|
|
19
|
-
import { preventEventDefault } from '@modusoperandi/licit-ui-commands';
|
|
20
|
-
import uuid from './uuid.js';
|
|
21
|
-
import './czi-form.css';
|
|
22
19
|
var MathEditor = /*#__PURE__*/function (_React$PureComponent) {
|
|
23
20
|
function MathEditor() {
|
|
24
21
|
var _this;
|
|
@@ -31,8 +28,6 @@ var MathEditor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
31
28
|
initialValue: _this.props.initialValue,
|
|
32
29
|
value: _this.props.initialValue || ''
|
|
33
30
|
});
|
|
34
|
-
_defineProperty(_this, "_id", uuid());
|
|
35
|
-
_defineProperty(_this, "_unmounted", false);
|
|
36
31
|
_defineProperty(_this, "_onChange", function (value) {
|
|
37
32
|
_this.setState({
|
|
38
33
|
value: value
|