@modusoperandi/licit 0.13.25 → 0.14.0
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/.eslintrc.js +1 -1
- package/README.md +1 -0
- package/dist/BlockquoteInsertNewLineCommand.js +3 -23
- package/dist/BlockquoteNodeSpec.js +3 -13
- package/dist/BlockquoteToggleCommand.js +3 -16
- package/dist/BookmarkNodeSpec.js +0 -6
- package/dist/BulletListNodeSpec.js +2 -16
- package/dist/CZIProseMirror.js +3 -27
- package/dist/CodeBlockCommand.js +3 -19
- package/dist/CodeBlockNodeSpec.js +3 -4
- package/dist/CodeMarkSpec.js +0 -4
- package/dist/ContentPlaceholderPlugin.js +6 -58
- package/dist/CursorPlaceholderPlugin.js +2 -32
- package/dist/DocLayoutCommand.js +5 -28
- package/dist/DocNodeSpec.js +0 -9
- package/dist/EMMarkSpec.js +0 -4
- package/dist/EditorCommands.js +5 -33
- package/dist/EditorKeyMap.js +4 -18
- package/dist/EditorMarks.js +2 -26
- package/dist/EditorNodes.js +4 -22
- package/dist/EditorPageLayoutPlugin.js +3 -15
- package/dist/EditorPlugins.js +0 -4
- package/dist/EditorSchema.js +0 -5
- package/dist/EditorState.js +0 -2
- package/dist/FontSizeMarkSpec.js +0 -12
- package/dist/FontTypeMarkSpec.js +15 -19
- package/dist/HTMLMutator.js +5 -24
- package/dist/HardBreakNodeSpec.js +0 -2
- package/dist/HeadingNodeSpec.js +6 -15
- package/dist/HistoryRedoCommand.js +3 -11
- package/dist/HistoryUndoCommand.js +3 -11
- package/dist/HorizontalRuleCommand.js +3 -22
- package/dist/HorizontalRuleNodeSpec.js +0 -10
- package/dist/ImageFromURLCommand.js +0 -9
- package/dist/ImageNodeSpec.js +2 -14
- package/dist/ImageSourceCommand.js +3 -39
- package/dist/ImageUploadCommand.js +3 -21
- package/dist/ImageUploadPlaceholderPlugin.js +10 -48
- package/dist/LinkMarkSpec.js +0 -4
- package/dist/LinkSetURLCommand.js +3 -28
- package/dist/LinkTooltipPlugin.js +6 -52
- package/dist/ListItemInsertNewLineCommand.js +3 -23
- package/dist/ListItemMergeCommand.js +15 -66
- package/dist/ListItemNodeSpec.js +0 -11
- package/dist/ListSplitCommand.js +3 -14
- package/dist/ListToggleCommand.js +5 -26
- package/dist/MarksClearCommand.js +6 -17
- package/dist/MathEditCommand.js +3 -38
- package/dist/MathNodeSpec.js +0 -10
- package/dist/OrderedListNodeSpec.js +0 -24
- package/dist/ParagraphNodeSpec.js +5 -26
- package/dist/ParagraphSpacingCommand.js +3 -32
- package/dist/PrintCommand.js +3 -13
- package/dist/SelectionPlaceholderPlugin.js +2 -31
- package/dist/SpacerMarkSpec.js +2 -6
- package/dist/StrikeMarkSpec.js +0 -4
- package/dist/StrongMarkSpec.js +2 -5
- package/dist/StyleView.js +1 -7
- package/dist/TableBackgroundColorCommand.js +3 -24
- package/dist/TableBorderColorCommand.js +3 -24
- package/dist/TableCellColorCommand.js +3 -23
- package/dist/TableCellMenuPlugin.js +9 -45
- package/dist/TableInsertCommand.js +7 -39
- package/dist/TableMergeCellsCommand.js +5 -30
- package/dist/TableNodesSpecs.js +4 -23
- package/dist/TablePlugins.js +0 -5
- package/dist/TableResizePlugin.js +54 -138
- package/dist/TextColorMarkSpec.js +0 -9
- package/dist/TextHighlightMarkSpec.js +0 -8
- package/dist/TextInsertTabSpaceCommand.js +3 -28
- package/dist/TextNoWrapMarkSpec.js +0 -4
- package/dist/TextSelectionMarkSpec.js +0 -5
- package/dist/TextSubMarkSpec.js +0 -4
- package/dist/TextSuperMarkSpec.js +0 -4
- package/dist/TextUnderlineMarkSpec.js +0 -4
- package/dist/Types.js +0 -6
- package/dist/WebFontLoader.js +3 -8
- package/dist/blockQuoteInputRule.js +0 -13
- package/dist/bom.xml +1492 -1645
- package/dist/buildEditorPlugins.js +5 -27
- package/dist/buildInputRules.js +12 -24
- package/dist/client/CollabConnector.js +6 -30
- package/dist/client/EditorConnection.js +23 -69
- package/dist/client/Licit.js +79 -163
- package/dist/client/Licit.js.flow +16 -2
- package/dist/client/Licit.test.js +6 -13
- package/dist/client/Reporter.js +1 -8
- package/dist/client/SimpleConnector.js +6 -26
- package/dist/client/http.js +8 -15
- package/dist/client/throttle.js +0 -2
- package/dist/convertFromDOMElement.js +2 -10
- package/dist/convertFromHTML.js +0 -5
- package/dist/convertFromJSON.js +3 -13
- package/dist/convertToCSSPTValue.js +0 -6
- package/dist/convertToJSON.js +0 -2
- package/dist/createCommand.js +3 -11
- package/dist/createEditorKeyMap.js +0 -13
- package/dist/createEmptyEditorState.js +0 -7
- package/dist/createTableResizingPlugin.js +5 -16
- package/dist/findActionableCell.js +0 -19
- package/dist/findActiveMark.js +0 -11
- package/dist/hyphenize.js +2 -4
- package/dist/index.js +0 -9
- package/dist/insertTable.js +0 -16
- package/dist/isEditorStateEmpty.js +0 -6
- package/dist/isTableNode.js +0 -3
- package/dist/joinDown.js +0 -7
- package/dist/joinListNode.js +0 -15
- package/dist/joinUp.js +0 -9
- package/dist/keymaps.js +0 -15
- package/dist/lookUpElement.js +0 -3
- package/dist/nodeAt.js +0 -3
- package/dist/normalizeHTML.js +9 -25
- package/dist/patchAnchorElements.js +5 -12
- package/dist/patchBreakElements.js +0 -6
- package/dist/patchElementInlineStyles.js +5 -15
- package/dist/patchListElements.js +20 -54
- package/dist/patchMathElements.js +11 -21
- package/dist/patchParagraphElements.js +0 -5
- package/dist/patchStyleElements.js +12 -41
- package/dist/patchTableElements.js +9 -37
- package/dist/rebaseDocWithSteps.js +0 -6
- package/dist/sanitizeURL.js +0 -3
- package/dist/splitListItem.js +12 -43
- package/dist/toClosestFontPtSize.js +1 -5
- package/dist/toSafeHTMLDocument.js +0 -1
- package/dist/toggleBlockquote.js +2 -19
- package/dist/toggleCodeBlock.js +2 -22
- package/dist/ui/AlertInfo.js +6 -22
- package/dist/ui/BookmarkNodeView.js +7 -28
- package/dist/ui/CommandButton.js +3 -19
- package/dist/ui/CommandMenu.js +3 -25
- package/dist/ui/CommandMenuButton.js +3 -36
- package/dist/ui/CustomEditorView.js +3 -16
- package/dist/ui/CustomMenu.js +0 -8
- package/dist/ui/CustomMenuItem.js +4 -18
- package/dist/ui/CustomNodeView.js +21 -67
- package/dist/ui/CustomRadioButton.js +14 -33
- package/dist/ui/DocLayoutEditor.js +5 -27
- package/dist/ui/Editor.js +18 -79
- package/dist/ui/EditorFrameset.js +3 -18
- package/dist/ui/EditorToolbar.js +10 -46
- package/dist/ui/EditorToolbarConfig.js +10 -20
- package/dist/ui/FontSizeCommandMenuButton.js +5 -19
- package/dist/ui/FontTypeCommandMenuButton.js +5 -22
- package/dist/ui/Frag.js +0 -7
- package/dist/ui/Icon.js +5 -25
- package/dist/ui/ImageAlignEditor.js +3 -16
- package/dist/ui/ImageInlineEditor.js +3 -16
- package/dist/ui/ImageNodeView.js +20 -109
- package/dist/ui/ImageResizeBox.js +3 -53
- package/dist/ui/ImageURLEditor.js +3 -28
- package/dist/ui/ImageUploadEditor.js +3 -35
- package/dist/ui/LinkTooltip.js +5 -25
- package/dist/ui/LinkURLEditor.js +3 -29
- package/dist/ui/ListItemNodeView.js +15 -30
- package/dist/ui/ListTypeButton.js +5 -37
- package/dist/ui/ListTypeCommandButton.js +3 -19
- package/dist/ui/ListTypeMenu.js +4 -25
- package/dist/ui/LoadingIndicator.js +0 -7
- package/dist/ui/MathEditor.js +3 -24
- package/dist/ui/MathInlineEditor.js +3 -26
- package/dist/ui/MathNodeView.js +9 -59
- package/dist/ui/PasteMenu.js +4 -20
- package/dist/ui/ResizeObserver.js +0 -18
- package/dist/ui/RichTextEditor.js +5 -27
- package/dist/ui/SelectionObserver.js +3 -29
- package/dist/ui/TableCellMenu.js +3 -18
- package/dist/ui/TableGridSizeEditor.js +5 -51
- package/dist/ui/TableNodeView.js +0 -11
- package/dist/ui/bindScrollHandler.js +2 -9
- package/dist/ui/canUseCSSFont.js +2 -8
- package/dist/ui/czi-icon.css +4 -4
- package/dist/ui/findActiveFontSize.js +2 -18
- package/dist/ui/findActiveFontType.js +0 -12
- package/dist/ui/handleEditorDrop.js +0 -9
- package/dist/ui/handleEditorKeyDown.js +0 -7
- package/dist/ui/handleEditorPaste.js +0 -9
- package/dist/ui/htmlElementToRect.js +0 -4
- package/dist/ui/injectStyleSheet.js +0 -10
- package/dist/ui/isElementFullyVisible.js +2 -8
- package/dist/ui/isOffline.js +0 -2
- package/dist/ui/isReactClass.js +0 -4
- package/dist/ui/mathquill-editor/MathQuillEditor.js +9 -44
- package/dist/ui/mathquill-editor/MathQuillEditorSymbols.js +1 -3
- package/dist/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js +3 -16
- package/dist/ui/mathquill-editor/mathquill-import-kludge.js +5 -7
- package/dist/ui/renderLaTeXAsHTML.js +2 -13
- package/dist/ui/resolveImage.js +7 -32
- package/dist/ui/toCSSColor.js +0 -14
- package/dist/ui/toCSSLineSpacing.js +10 -11
- package/dist/ui/toHexColor.js +0 -8
- package/dist/ui/uuid.js +0 -2
- package/dist/uuid.js +0 -2
- package/package-lock.json.old +32889 -0
- package/package.json +45 -69
- package/src/client/Licit.js +16 -2
- package/src/ui/czi-icon.css +4 -4
- package/utils/build_web_server.js +1 -7
- package/webpack.config.js +3 -3
|
@@ -4,31 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.bpfrpt_proptype_NodeViewProps = void 0;
|
|
7
|
-
|
|
8
7
|
var _prosemirrorModel = require("prosemirror-model");
|
|
9
|
-
|
|
10
8
|
var _prosemirrorView = require("prosemirror-view");
|
|
11
|
-
|
|
12
9
|
var React = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
10
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
15
|
-
|
|
16
11
|
var _SelectionObserver = _interopRequireDefault(require("./SelectionObserver"));
|
|
17
|
-
|
|
18
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
-
|
|
24
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
-
|
|
26
16
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
27
|
-
|
|
28
17
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
18
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
20
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
32
21
|
var bpfrpt_proptype_NodeViewProps = {
|
|
33
22
|
"editorView": function () {
|
|
34
23
|
return (typeof _prosemirrorView.EditorView === "function" ? _propTypes.default.instanceOf(_prosemirrorView.EditorView).isRequired : _propTypes.default.any.isRequired).apply(this, arguments);
|
|
@@ -45,90 +34,71 @@ exports.bpfrpt_proptype_NodeViewProps = bpfrpt_proptype_NodeViewProps;
|
|
|
45
34
|
const SELECTED_NODE_CLASS_NAME = 'ProseMirror-selectednode';
|
|
46
35
|
const mountedViews = new Set();
|
|
47
36
|
const pendingViews = new Set();
|
|
48
|
-
|
|
49
37
|
function onMutation(mutations, observer) {
|
|
50
38
|
const root = document.body;
|
|
51
|
-
|
|
52
39
|
if (!root) {
|
|
53
40
|
return;
|
|
54
41
|
}
|
|
55
|
-
|
|
56
42
|
const mountingViews = [];
|
|
57
|
-
|
|
58
43
|
for (const view of pendingViews) {
|
|
59
44
|
const el = view.dom;
|
|
60
|
-
|
|
61
45
|
if (root.contains(el)) {
|
|
62
46
|
pendingViews.delete(view);
|
|
63
47
|
mountingViews.push(view);
|
|
64
|
-
|
|
65
48
|
view.__renderReactComponent();
|
|
66
49
|
}
|
|
67
50
|
}
|
|
68
|
-
|
|
69
51
|
for (const view of mountedViews) {
|
|
70
52
|
const el = view.dom;
|
|
71
|
-
|
|
72
53
|
if (!root.contains(el)) {
|
|
73
54
|
mountedViews.delete(el);
|
|
74
|
-
|
|
75
55
|
_reactDom.default.unmountComponentAtNode(el);
|
|
76
56
|
}
|
|
77
57
|
}
|
|
78
|
-
|
|
79
58
|
mountingViews.forEach(view => mountedViews.add(view));
|
|
80
|
-
|
|
81
59
|
if (mountedViews.size === 0) {
|
|
82
60
|
observer.disconnect();
|
|
83
61
|
}
|
|
84
|
-
}
|
|
85
|
-
// See https://discuss.prosemirror.net/t/copy-selection-issue-with-the-image-node/1673/2;
|
|
86
|
-
|
|
62
|
+
}
|
|
87
63
|
|
|
64
|
+
// Workaround to get in-selection views selected.
|
|
65
|
+
// See https://discuss.prosemirror.net/t/copy-selection-issue-with-the-image-node/1673/2;
|
|
88
66
|
function onSelection(entries, observer) {
|
|
89
67
|
if (!window.getSelection) {
|
|
90
68
|
console.warn('window.getSelection() is not supported');
|
|
91
69
|
observer.disconnect();
|
|
92
70
|
return;
|
|
93
71
|
}
|
|
94
|
-
|
|
95
72
|
const selection = window.getSelection();
|
|
96
|
-
|
|
97
73
|
if (!selection.containsNode) {
|
|
98
74
|
console.warn('selection.containsNode() is not supported');
|
|
99
75
|
observer.disconnect();
|
|
100
76
|
return;
|
|
101
77
|
}
|
|
102
|
-
|
|
103
78
|
for (const view of mountedViews) {
|
|
104
79
|
const el = view.dom;
|
|
105
|
-
|
|
106
80
|
if (selection.containsNode(el)) {
|
|
107
81
|
view.selectNode();
|
|
108
82
|
} else {
|
|
109
83
|
view.deselectNode();
|
|
110
84
|
}
|
|
111
85
|
}
|
|
112
|
-
|
|
113
86
|
if (mountedViews.size === 0) {
|
|
114
87
|
observer.disconnect();
|
|
115
88
|
}
|
|
116
89
|
}
|
|
117
|
-
|
|
118
90
|
const selectionObserver = new _SelectionObserver.default(onSelection);
|
|
119
|
-
const mutationObserver = new MutationObserver(onMutation);
|
|
91
|
+
const mutationObserver = new MutationObserver(onMutation);
|
|
92
|
+
|
|
93
|
+
// This implements the `NodeView` interface and renders a Node with a react
|
|
120
94
|
// Component.
|
|
121
95
|
// https://prosemirror.net/docs/ref/#view.NodeView
|
|
122
96
|
// https://github.com/ProseMirror/prosemirror-view/blob/master/src/viewdesc.js#L429
|
|
123
|
-
|
|
124
97
|
class CustomNodeView {
|
|
125
98
|
constructor(node, editorView, getPos, decorations) {
|
|
126
99
|
_defineProperty(this, "dom", void 0);
|
|
127
|
-
|
|
128
100
|
_defineProperty(this, "props", void 0);
|
|
129
|
-
|
|
130
101
|
_defineProperty(this, "_selected", void 0);
|
|
131
|
-
|
|
132
102
|
this.props = {
|
|
133
103
|
decorations,
|
|
134
104
|
editorView,
|
|
@@ -137,71 +107,60 @@ class CustomNodeView {
|
|
|
137
107
|
selected: false,
|
|
138
108
|
focused: false
|
|
139
109
|
};
|
|
140
|
-
pendingViews.add(this);
|
|
110
|
+
pendingViews.add(this);
|
|
141
111
|
|
|
112
|
+
// The editor will use this as the node's DOM representation
|
|
142
113
|
const dom = this.createDOMElement();
|
|
143
114
|
this.dom = dom;
|
|
144
115
|
dom.onClick = this._onClick;
|
|
145
|
-
|
|
146
116
|
if (pendingViews.size === 1) {
|
|
147
117
|
// [FS] IRAD-1060 2020-09-10
|
|
148
118
|
// Observe the editorview's dom insteadof root document so that
|
|
149
119
|
// if multiple instances of editor in a page shouldn't cross-talk
|
|
150
|
-
mutationObserver.observe(
|
|
151
|
-
/*document*/
|
|
152
|
-
editorView.dom, {
|
|
120
|
+
mutationObserver.observe( /*document*/editorView.dom, {
|
|
153
121
|
childList: true,
|
|
154
122
|
subtree: true
|
|
155
123
|
});
|
|
156
|
-
selectionObserver.observe(
|
|
157
|
-
/*document*/
|
|
158
|
-
editorView.dom);
|
|
124
|
+
selectionObserver.observe( /*document*/editorView.dom);
|
|
159
125
|
}
|
|
160
126
|
}
|
|
161
|
-
|
|
162
127
|
update(node, decorations) {
|
|
163
128
|
this.props = _objectSpread(_objectSpread({}, this.props), {}, {
|
|
164
129
|
node
|
|
165
130
|
});
|
|
166
|
-
|
|
167
131
|
this.__renderReactComponent();
|
|
168
|
-
|
|
169
132
|
return true;
|
|
170
133
|
}
|
|
171
|
-
|
|
172
134
|
stopEvent() {
|
|
173
135
|
return false;
|
|
174
|
-
}
|
|
175
|
-
|
|
136
|
+
}
|
|
176
137
|
|
|
138
|
+
// Mark this node as being the selected node.
|
|
177
139
|
selectNode() {
|
|
178
140
|
this._selected = true;
|
|
179
141
|
this.dom.classList.add(SELECTED_NODE_CLASS_NAME);
|
|
180
|
-
|
|
181
142
|
this.__renderReactComponent();
|
|
182
|
-
}
|
|
183
|
-
|
|
143
|
+
}
|
|
184
144
|
|
|
145
|
+
// Remove selected node marking from this node.
|
|
185
146
|
deselectNode() {
|
|
186
147
|
this._selected = false;
|
|
187
148
|
this.dom.classList.remove(SELECTED_NODE_CLASS_NAME);
|
|
188
|
-
|
|
189
149
|
this.__renderReactComponent();
|
|
190
|
-
}
|
|
191
|
-
|
|
150
|
+
}
|
|
192
151
|
|
|
152
|
+
// This should be overwrite by subclass.
|
|
193
153
|
createDOMElement() {
|
|
194
154
|
// The editor will use this as the node's DOM representation.
|
|
195
155
|
// return document.createElement('span');
|
|
196
156
|
throw new Error('not implemented');
|
|
197
|
-
}
|
|
198
|
-
|
|
157
|
+
}
|
|
199
158
|
|
|
159
|
+
// This should be overwrite by subclass.
|
|
200
160
|
renderReactComponent() {
|
|
201
161
|
// return <CustomNodeViewComponent {...this.props} />;
|
|
202
162
|
throw new Error('not implemented');
|
|
203
163
|
}
|
|
204
|
-
|
|
205
164
|
destroy() {
|
|
206
165
|
// Called when the node view is removed from the editor or the whole
|
|
207
166
|
// editor is destroyed.
|
|
@@ -211,13 +170,11 @@ class CustomNodeView {
|
|
|
211
170
|
// FIX: This solves the image missing issue.
|
|
212
171
|
pendingViews.delete(this);
|
|
213
172
|
}
|
|
214
|
-
|
|
215
173
|
__renderReactComponent() {
|
|
216
174
|
const {
|
|
217
175
|
editorView,
|
|
218
176
|
getPos
|
|
219
177
|
} = this.props;
|
|
220
|
-
|
|
221
178
|
if (editorView.state && editorView.state.selection) {
|
|
222
179
|
const {
|
|
223
180
|
from
|
|
@@ -229,11 +186,8 @@ class CustomNodeView {
|
|
|
229
186
|
this.props.selected = false;
|
|
230
187
|
this.props.focused = false;
|
|
231
188
|
}
|
|
232
|
-
|
|
233
189
|
_reactDom.default.render(this.renderReactComponent(), this.dom);
|
|
234
190
|
}
|
|
235
|
-
|
|
236
191
|
}
|
|
237
|
-
|
|
238
192
|
var _default = CustomNodeView;
|
|
239
193
|
exports.default = _default;
|
|
@@ -4,58 +4,41 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
require("./czi-custom-radio-button.css");
|
|
9
|
-
|
|
10
8
|
var _licitUiCommands = require("@modusoperandi/licit-ui-commands");
|
|
11
|
-
|
|
12
9
|
var React = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
11
|
var _uuid = _interopRequireDefault(require("./uuid"));
|
|
17
|
-
|
|
18
12
|
const _excluded = ["title", "className", "checked", "label", "inline", "name", "onSelect", "disabled"];
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
-
|
|
24
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
-
|
|
26
16
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
|
-
|
|
28
17
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
|
-
|
|
30
18
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
19
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
21
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
34
22
|
;
|
|
35
|
-
|
|
36
23
|
class CustomRadioButton extends React.PureComponent {
|
|
37
24
|
constructor() {
|
|
38
25
|
super(...arguments);
|
|
39
|
-
|
|
40
26
|
_defineProperty(this, "props", void 0);
|
|
41
|
-
|
|
42
27
|
_defineProperty(this, "_name", (0, _uuid.default)());
|
|
43
28
|
}
|
|
44
|
-
|
|
45
29
|
render() {
|
|
46
30
|
const _this$props = this.props,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
31
|
+
{
|
|
32
|
+
title,
|
|
33
|
+
className,
|
|
34
|
+
checked,
|
|
35
|
+
label,
|
|
36
|
+
inline,
|
|
37
|
+
name,
|
|
38
|
+
onSelect,
|
|
39
|
+
disabled
|
|
40
|
+
} = _this$props,
|
|
41
|
+
pointerProps = _objectWithoutProperties(_this$props, _excluded);
|
|
59
42
|
const klass = (0, _classnames.default)(className, 'czi-custom-radio-button', {
|
|
60
43
|
checked: checked,
|
|
61
44
|
inline: inline
|
|
@@ -79,8 +62,6 @@ class CustomRadioButton extends React.PureComponent {
|
|
|
79
62
|
className: "czi-custom-radio-button-label"
|
|
80
63
|
}, label));
|
|
81
64
|
}
|
|
82
|
-
|
|
83
65
|
}
|
|
84
|
-
|
|
85
66
|
var _default = CustomRadioButton;
|
|
86
67
|
exports.default = _default;
|
|
@@ -4,61 +4,45 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.bpfrpt_proptype_DocLayoutEditorValue = void 0;
|
|
7
|
-
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _DocNodeSpec = require("../DocNodeSpec");
|
|
11
|
-
|
|
12
9
|
var _licitUiCommands = require("@modusoperandi/licit-ui-commands");
|
|
13
|
-
|
|
14
10
|
var _CustomRadioButton = _interopRequireDefault(require("./CustomRadioButton"));
|
|
15
|
-
|
|
16
11
|
require("./czi-body-layout-editor.css");
|
|
17
|
-
|
|
18
12
|
require("./czi-form.css");
|
|
19
|
-
|
|
20
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
21
|
-
|
|
22
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
-
|
|
24
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
-
|
|
26
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
17
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
19
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
30
20
|
var bpfrpt_proptype_DocLayoutEditorValue = {
|
|
31
21
|
"layout": _propTypes.default.string,
|
|
32
22
|
"width": _propTypes.default.number
|
|
33
23
|
};
|
|
34
24
|
exports.bpfrpt_proptype_DocLayoutEditorValue = bpfrpt_proptype_DocLayoutEditorValue;
|
|
35
|
-
|
|
36
25
|
class DocLayoutEditor extends React.PureComponent {
|
|
37
26
|
// [FS] IRAD-1005 2020-07-07
|
|
38
27
|
// Upgrade outdated packages.
|
|
39
28
|
// To take care of the property type declaration.
|
|
29
|
+
|
|
40
30
|
constructor(props, context) {
|
|
41
31
|
super(props, context);
|
|
42
|
-
|
|
43
32
|
_defineProperty(this, "_unmounted", false);
|
|
44
|
-
|
|
45
33
|
_defineProperty(this, "state", void 0);
|
|
46
|
-
|
|
47
34
|
_defineProperty(this, "_onSelect", selectedValue => {
|
|
48
35
|
this.setState({
|
|
49
36
|
selectedValue
|
|
50
37
|
});
|
|
51
38
|
});
|
|
52
|
-
|
|
53
39
|
_defineProperty(this, "_cancel", () => {
|
|
54
40
|
this.props.close();
|
|
55
41
|
});
|
|
56
|
-
|
|
57
42
|
_defineProperty(this, "_apply", () => {
|
|
58
43
|
const {
|
|
59
44
|
selectedValue
|
|
60
45
|
} = this.state;
|
|
61
|
-
|
|
62
46
|
if (typeof selectedValue === 'string') {
|
|
63
47
|
this.props.close({
|
|
64
48
|
width: null,
|
|
@@ -71,7 +55,6 @@ class DocLayoutEditor extends React.PureComponent {
|
|
|
71
55
|
});
|
|
72
56
|
}
|
|
73
57
|
});
|
|
74
|
-
|
|
75
58
|
const {
|
|
76
59
|
width,
|
|
77
60
|
layout
|
|
@@ -80,7 +63,6 @@ class DocLayoutEditor extends React.PureComponent {
|
|
|
80
63
|
width,
|
|
81
64
|
layout,
|
|
82
65
|
selectedValue: width || layout || _DocNodeSpec.LAYOUT.US_LETTER_PORTRAIT // or LAYOUT.A4_PORTRAIT to define default layout
|
|
83
|
-
|
|
84
66
|
};
|
|
85
67
|
}
|
|
86
68
|
|
|
@@ -142,24 +124,20 @@ class DocLayoutEditor extends React.PureComponent {
|
|
|
142
124
|
onClick: this._apply
|
|
143
125
|
}))));
|
|
144
126
|
}
|
|
145
|
-
|
|
146
127
|
}
|
|
147
|
-
|
|
148
128
|
_defineProperty(DocLayoutEditor, "propsTypes", {
|
|
149
129
|
// initialValue: PropTypes.shape({
|
|
150
130
|
// layout: PropTypes.string,
|
|
151
131
|
// width: PropTypes.number,
|
|
152
132
|
// }),
|
|
133
|
+
|
|
153
134
|
close: function (props, propName) {
|
|
154
135
|
const fn = props[propName];
|
|
155
|
-
|
|
156
136
|
if (!fn.prototype || typeof fn.prototype.constructor !== 'function' && fn.prototype.constructor.length !== 1) {
|
|
157
137
|
return new Error(propName + 'must be a function with 1 arg of type DocLayoutEditorValue');
|
|
158
138
|
}
|
|
159
|
-
|
|
160
139
|
return null;
|
|
161
140
|
}
|
|
162
141
|
});
|
|
163
|
-
|
|
164
142
|
var _default = DocLayoutEditor;
|
|
165
143
|
exports.default = _default;
|