@modusoperandi/licit 0.1.9 → 0.13.2
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/.github/workflows/build.yml +1 -7
- package/.github/workflows/lint.yml +1 -1
- package/README.md +1 -1
- package/babel.config.json +54 -0
- package/dist/BlockquoteNodeSpec.js +2 -2
- package/dist/CZIProseMirror.js +4 -4
- package/dist/CodeBlockCommand.js +2 -2
- package/dist/CodeBlockCommand.js.flow +1 -1
- package/dist/CursorPlaceholderPlugin.js +2 -2
- package/dist/DocLayoutCommand.js +2 -4
- package/dist/DocLayoutCommand.js.flow +1 -1
- package/dist/DocNodeSpec.js +1 -1
- package/dist/EditorCommands.js +23 -35
- package/dist/EditorCommands.js.flow +7 -7
- package/dist/EditorKeyMap.js +3 -3
- package/dist/FontTypeMarkSpec.js +1 -1
- package/dist/HeadingNodeSpec.js +2 -2
- package/dist/ImageSourceCommand.js +2 -4
- package/dist/ImageSourceCommand.js.flow +1 -1
- package/dist/ImageUploadPlaceholderPlugin.js +1 -1
- package/dist/LinkSetURLCommand.js +4 -8
- package/dist/LinkSetURLCommand.js.flow +3 -3
- package/dist/LinkTooltipPlugin.js +9 -15
- package/dist/LinkTooltipPlugin.js.flow +5 -5
- package/dist/ListToggleCommand.js +5 -11
- package/dist/ListToggleCommand.js.flow +3 -3
- package/dist/MarkNames.js +1 -1
- package/dist/MarksClearCommand.js +3 -3
- package/dist/MarksClearCommand.js.flow +1 -1
- package/dist/MathEditCommand.js +2 -2
- package/dist/MathEditCommand.js.flow +1 -1
- package/dist/ParagraphNodeSpec.js +3 -4
- package/dist/ParagraphNodeSpec.js.flow +2 -6
- package/dist/ParagraphSpacingCommand.js +3 -3
- package/dist/SelectionPlaceholderPlugin.js +2 -2
- package/dist/SpacerMarkSpec.js +1 -1
- package/dist/TableBackgroundColorCommand.js +3 -7
- package/dist/TableBackgroundColorCommand.js.flow +3 -3
- package/dist/TableBorderColorCommand.js +3 -7
- package/dist/TableBorderColorCommand.js.flow +3 -3
- package/dist/TableCellColorCommand.js +3 -7
- package/dist/TableCellColorCommand.js.flow +3 -3
- package/dist/TableCellMenuPlugin.js +4 -6
- package/dist/TableCellMenuPlugin.js.flow +3 -3
- package/dist/TableInsertCommand.js +3 -5
- package/dist/TableInsertCommand.js.flow +2 -2
- package/dist/TableResizePlugin.js +2 -2
- package/dist/TextInsertTabSpaceCommand.js +2 -4
- package/dist/TextInsertTabSpaceCommand.js.flow +1 -1
- package/dist/Types.js +1 -1
- package/dist/bom.xml +4970 -4167
- package/dist/client/CollabConnector.js +17 -2
- package/dist/client/CollabConnector.js.flow +17 -2
- package/dist/client/EditorConnection.js +15 -4
- package/dist/client/EditorConnection.js.flow +14 -3
- package/dist/client/Licit.js +73 -58
- package/dist/client/Licit.js.flow +101 -85
- package/dist/client/Licit.test.js +18 -17
- package/dist/client/Licit.test.js.flow +13 -11
- package/dist/client/SimpleConnector.js +4 -2
- package/dist/client/SimpleConnector.js.flow +3 -1
- package/dist/client/http.js +3 -3
- package/dist/convertToCSSPTValue.js +1 -1
- package/dist/createEmptyEditorState.js +1 -1
- package/dist/index.js +16 -16
- package/dist/joinListNode.js +2 -2
- package/dist/joinListNode.js.flow +1 -1
- package/dist/keymaps.js +2 -2
- package/dist/patchStyleElements.js +3 -3
- package/dist/patchStyleElements.js.flow +1 -1
- package/dist/splitListItem.js +2 -2
- package/dist/styles.css +2 -2
- package/dist/styles0.css +3 -3
- package/dist/toggleBlockquote.js +6 -14
- package/dist/toggleBlockquote.js.flow +4 -4
- package/dist/toggleCodeBlock.js +4 -10
- package/dist/toggleCodeBlock.js.flow +3 -3
- package/dist/ui/AlertInfo.js +2 -2
- package/dist/ui/CommandButton.js +2 -4
- package/dist/ui/CommandButton.js.flow +1 -1
- package/dist/ui/CommandMenuButton.js +5 -7
- package/dist/ui/CommandMenuButton.js.flow +2 -2
- package/dist/ui/CustomMenuItem.js +3 -5
- package/dist/ui/CustomMenuItem.js.flow +1 -1
- package/dist/ui/CustomNodeView.js +3 -3
- package/dist/ui/CustomRadioButton.js +8 -6
- package/dist/ui/CustomRadioButton.js.flow +3 -3
- package/dist/ui/DocLayoutEditor.js +5 -7
- package/dist/ui/DocLayoutEditor.js.flow +2 -2
- package/dist/ui/Editor.js +1 -2
- package/dist/ui/Editor.js.flow +1 -2
- package/dist/ui/EditorFrameset.js +1 -1
- package/dist/ui/EditorToolbar.js +4 -4
- package/dist/ui/EditorToolbar.js.flow +1 -1
- package/dist/ui/EditorToolbarConfig.js +1 -1
- package/dist/ui/FontSizeCommandMenuButton.js +3 -3
- package/dist/ui/FontSizeCommandMenuButton.js.flow +1 -1
- package/dist/ui/FontTypeCommandMenuButton.js +3 -3
- package/dist/ui/FontTypeCommandMenuButton.js.flow +1 -1
- package/dist/ui/ImageAlignEditor.js +5 -5
- package/dist/ui/ImageAlignEditor.js.flow +1 -1
- package/dist/ui/ImageInlineEditor.js +5 -5
- package/dist/ui/ImageInlineEditor.js.flow +1 -1
- package/dist/ui/ImageNodeView.js +5 -7
- package/dist/ui/ImageNodeView.js.flow +2 -2
- package/dist/ui/ImageResizeBox.js +4 -4
- package/dist/ui/ImageResizeBox.js.flow +1 -1
- package/dist/ui/ImageURLEditor.js +6 -8
- package/dist/ui/ImageURLEditor.js.flow +2 -2
- package/dist/ui/ImageUploadEditor.js +3 -5
- package/dist/ui/ImageUploadEditor.js.flow +2 -2
- package/dist/ui/LinkTooltip.js +4 -4
- package/dist/ui/LinkTooltip.js.flow +1 -1
- package/dist/ui/LinkURLEditor.js +4 -6
- package/dist/ui/LinkURLEditor.js.flow +2 -2
- package/dist/ui/ListTypeButton.js +5 -7
- package/dist/ui/ListTypeButton.js.flow +2 -2
- package/dist/ui/MathEditor.js +4 -6
- package/dist/ui/MathEditor.js.flow +2 -2
- package/dist/ui/MathInlineEditor.js +7 -9
- package/dist/ui/MathInlineEditor.js.flow +2 -2
- package/dist/ui/MathNodeView.js +5 -7
- package/dist/ui/MathNodeView.js.flow +2 -2
- package/dist/ui/ResizeObserver.js +1 -1
- package/dist/ui/TableGridSizeEditor.js +7 -9
- package/dist/ui/TableGridSizeEditor.js.flow +2 -2
- package/dist/ui/czi-link-tooltip.css +1 -1
- package/dist/ui/czi-vars.css +1 -45
- package/dist/ui/findActiveFontType.js +1 -1
- package/dist/ui/htmlElementToRect.js +1 -1
- package/dist/ui/isElementFullyVisible.js +2 -2
- package/dist/ui/isElementFullyVisible.js.flow +1 -1
- package/dist/ui/mathquill-editor/MathQuillEditorSymbols.js +1 -1
- package/dist/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js +2 -2
- package/dist/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js.flow +1 -1
- package/dist/ui/resolveImage.js +3 -3
- package/dist/ui/toCSSColor.js +1 -1
- package/dist/ui/toCSSLineSpacing.js +1 -36
- package/dist/ui/toCSSLineSpacing.js.flow +0 -27
- package/flow-typed/@modusoperandilicit-ui-commands.js +5 -0
- package/jest.config.js +207 -0
- package/lint.sh +0 -0
- package/node_modules/prosemirror-utils/LICENSE +13 -0
- package/{dist/ui/PopUpTypes.js.flow → node_modules/prosemirror-utils/README.md} +0 -0
- package/node_modules/prosemirror-utils/dist/helpers.js +119 -0
- package/node_modules/prosemirror-utils/dist/index.js +17 -0
- package/node_modules/prosemirror-utils/dist/index.js.map +1 -0
- package/node_modules/prosemirror-utils/dist/node.js +106 -0
- package/node_modules/prosemirror-utils/dist/selection.js +168 -0
- package/node_modules/prosemirror-utils/dist/transforms.js +257 -0
- package/node_modules/prosemirror-utils/package.json +81 -0
- package/node_modules/prosemirror-utils/typings.d.ts +79 -0
- package/package.json +14 -8
- package/scripts/build_bin.py +0 -0
- package/scripts/ci_check_dist.sh +0 -0
- package/src/CodeBlockCommand.js +1 -1
- package/src/DocLayoutCommand.js +1 -1
- package/src/EditorCommands.js +7 -7
- package/src/ImageSourceCommand.js +1 -1
- package/src/LinkSetURLCommand.js +3 -3
- package/src/LinkTooltipPlugin.js +5 -5
- package/src/ListToggleCommand.js +3 -3
- package/src/MarksClearCommand.js +1 -1
- package/src/MathEditCommand.js +1 -1
- package/src/ParagraphNodeSpec.js +2 -6
- package/src/TableBackgroundColorCommand.js +3 -3
- package/src/TableBorderColorCommand.js +3 -3
- package/src/TableCellColorCommand.js +3 -3
- package/src/TableCellMenuPlugin.js +3 -3
- package/src/TableInsertCommand.js +2 -2
- package/src/TextInsertTabSpaceCommand.js +1 -1
- package/src/client/CollabConnector.js +17 -2
- package/src/client/EditorConnection.js +14 -3
- package/src/client/Licit.js +101 -85
- package/src/client/Licit.test.js +13 -11
- package/src/client/SimpleConnector.js +3 -1
- package/src/joinListNode.js +1 -1
- package/src/patchStyleElements.js +1 -1
- package/src/styles.css +2 -2
- package/src/styles0.css +3 -3
- package/src/toggleBlockquote.js +4 -4
- package/src/toggleCodeBlock.js +3 -3
- package/src/ui/CommandButton.js +1 -1
- package/src/ui/CommandMenuButton.js +2 -2
- package/src/ui/CustomMenuItem.js +1 -1
- package/src/ui/CustomRadioButton.js +3 -3
- package/src/ui/DocLayoutEditor.js +2 -2
- package/src/ui/Editor.js +1 -2
- package/src/ui/EditorToolbar.js +1 -1
- package/src/ui/FontSizeCommandMenuButton.js +1 -1
- package/src/ui/FontTypeCommandMenuButton.js +1 -1
- package/src/ui/ImageAlignEditor.js +1 -1
- package/src/ui/ImageInlineEditor.js +1 -1
- package/src/ui/ImageNodeView.js +2 -2
- package/src/ui/ImageResizeBox.js +1 -1
- package/src/ui/ImageURLEditor.js +2 -2
- package/src/ui/ImageUploadEditor.js +2 -2
- package/src/ui/LinkTooltip.js +1 -1
- package/src/ui/LinkURLEditor.js +2 -2
- package/src/ui/ListTypeButton.js +2 -2
- package/src/ui/MathEditor.js +2 -2
- package/src/ui/MathInlineEditor.js +2 -2
- package/src/ui/MathNodeView.js +2 -2
- package/src/ui/TableGridSizeEditor.js +2 -2
- package/src/ui/czi-link-tooltip.css +1 -1
- package/src/ui/czi-vars.css +1 -45
- package/src/ui/isElementFullyVisible.js +1 -1
- package/src/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js +1 -1
- package/src/ui/toCSSLineSpacing.js +0 -27
- package/build_customstyle_server.py +0 -7
- package/dist/FontSizeCommand.js +0 -80
- package/dist/FontSizeCommand.js.flow +0 -57
- package/dist/FontTypeCommand.js +0 -137
- package/dist/FontTypeCommand.js.flow +0 -100
- package/dist/HeadingCommand.js +0 -65
- package/dist/HeadingCommand.js.flow +0 -51
- package/dist/IndentCommand.js +0 -57
- package/dist/IndentCommand.js.flow +0 -41
- package/dist/MarkToggleCommand.js +0 -90
- package/dist/MarkToggleCommand.js.flow +0 -66
- package/dist/TextAlignCommand.js +0 -151
- package/dist/TextAlignCommand.js.flow +0 -122
- package/dist/TextColorCommand.js +0 -114
- package/dist/TextColorCommand.js.flow +0 -87
- package/dist/TextHighlightCommand.js +0 -118
- package/dist/TextHighlightCommand.js.flow +0 -91
- package/dist/TextLineSpacingCommand.js +0 -177
- package/dist/TextLineSpacingCommand.js.flow +0 -157
- package/dist/applyMark.js +0 -84
- package/dist/applyMark.js.flow +0 -61
- package/dist/clearMarks.js +0 -160
- package/dist/clearMarks.js.flow +0 -128
- package/dist/compareNumber.js +0 -18
- package/dist/compareNumber.js.flow +0 -11
- package/dist/consolidateListNodes.js +0 -291
- package/dist/consolidateListNodes.js.flow +0 -281
- package/dist/coverage/lcov-report/block-navigation.js +0 -77
- package/dist/coverage/lcov-report/block-navigation.js.flow +0 -79
- package/dist/coverage/lcov-report/prettify.js +0 -994
- package/dist/coverage/lcov-report/prettify.js.flow +0 -2
- package/dist/coverage/lcov-report/sorter.js +0 -187
- package/dist/coverage/lcov-report/sorter.js.flow +0 -170
- package/dist/findNodesWithSameMark.js +0 -89
- package/dist/findNodesWithSameMark.js.flow +0 -89
- package/dist/isBulletListNode.js +0 -14
- package/dist/isBulletListNode.js.flow +0 -9
- package/dist/isInsideListItem.js +0 -19
- package/dist/isInsideListItem.js.flow +0 -13
- package/dist/isListNode.js +0 -22
- package/dist/isListNode.js.flow +0 -13
- package/dist/isNodeSelectionForNodeType.js +0 -19
- package/dist/isNodeSelectionForNodeType.js.flow +0 -15
- package/dist/isOrderedListNode.js +0 -14
- package/dist/isOrderedListNode.js.flow +0 -9
- package/dist/isTextStyleMarkCommandEnabled.js +0 -59
- package/dist/isTextStyleMarkCommandEnabled.js.flow +0 -49
- package/dist/noop.js +0 -11
- package/dist/noop.js.flow +0 -5
- package/dist/toggleHeading.js +0 -135
- package/dist/toggleHeading.js.flow +0 -113
- package/dist/toggleList.js +0 -431
- package/dist/toggleList.js.flow +0 -450
- package/dist/transformAndPreserveTextSelection.js +0 -173
- package/dist/transformAndPreserveTextSelection.js.flow +0 -151
- package/dist/ui/ColorEditor.js +0 -118
- package/dist/ui/ColorEditor.js.flow +0 -101
- package/dist/ui/CustomButton.js +0 -62
- package/dist/ui/CustomButton.js.flow +0 -33
- package/dist/ui/PointerSurface.js +0 -173
- package/dist/ui/PointerSurface.js.flow +0 -141
- package/dist/ui/PopUp.js +0 -129
- package/dist/ui/PopUp.js.flow +0 -77
- package/dist/ui/PopUpManager.js +0 -266
- package/dist/ui/PopUpManager.js.flow +0 -213
- package/dist/ui/PopUpPosition.js +0 -156
- package/dist/ui/PopUpPosition.js.flow +0 -104
- package/dist/ui/PopUpTypes.js +0 -1
- package/dist/ui/TooltipSurface.js +0 -99
- package/dist/ui/TooltipSurface.js.flow +0 -76
- package/dist/ui/clamp.js +0 -18
- package/dist/ui/clamp.js.flow +0 -11
- package/dist/ui/createPopUp.js +0 -199
- package/dist/ui/createPopUp.js.flow +0 -205
- package/dist/ui/czi-animations.css +0 -15
- package/dist/ui/czi-color-editor.css +0 -56
- package/dist/ui/czi-custom-button.css +0 -93
- package/dist/ui/czi-pop-up.css +0 -32
- package/dist/ui/czi-tooltip-surface.css +0 -45
- package/dist/ui/preventEventDefault.js +0 -10
- package/dist/ui/preventEventDefault.js.flow +0 -5
- package/dist/ui/rects.js +0 -58
- package/dist/ui/rects.js.flow +0 -47
- package/dist/updateIndentLevel.js +0 -232
- package/dist/updateIndentLevel.js.flow +0 -211
- package/flow-typed/@molicit-citation.js +0 -5
- package/licit/server/customstyles/start.js +0 -184
- package/run_customstyle_server.py +0 -20
- package/src/FontSizeCommand.js +0 -57
- package/src/FontTypeCommand.js +0 -100
- package/src/HeadingCommand.js +0 -51
- package/src/IndentCommand.js +0 -41
- package/src/MarkToggleCommand.js +0 -66
- package/src/TextAlignCommand.js +0 -122
- package/src/TextColorCommand.js +0 -87
- package/src/TextHighlightCommand.js +0 -91
- package/src/TextLineSpacingCommand.js +0 -157
- package/src/applyMark.js +0 -61
- package/src/clearMarks.js +0 -128
- package/src/compareNumber.js +0 -11
- package/src/consolidateListNodes.js +0 -281
- package/src/findNodesWithSameMark.js +0 -89
- package/src/isBulletListNode.js +0 -9
- package/src/isInsideListItem.js +0 -13
- package/src/isListNode.js +0 -13
- package/src/isNodeSelectionForNodeType.js +0 -15
- package/src/isOrderedListNode.js +0 -9
- package/src/isTextStyleMarkCommandEnabled.js +0 -49
- package/src/noop.js +0 -5
- package/src/toggleHeading.js +0 -113
- package/src/toggleList.js +0 -450
- package/src/transformAndPreserveTextSelection.js +0 -151
- package/src/ui/ColorEditor.js +0 -101
- package/src/ui/CustomButton.js +0 -33
- package/src/ui/PointerSurface.js +0 -141
- package/src/ui/PopUp.js +0 -77
- package/src/ui/PopUpManager.js +0 -213
- package/src/ui/PopUpPosition.js +0 -104
- package/src/ui/PopUpTypes.js +0 -0
- package/src/ui/TooltipSurface.js +0 -76
- package/src/ui/clamp.js +0 -11
- package/src/ui/createPopUp.js +0 -205
- package/src/ui/czi-animations.css +0 -15
- package/src/ui/czi-color-editor.css +0 -56
- package/src/ui/czi-custom-button.css +0 -93
- package/src/ui/czi-pop-up.css +0 -32
- package/src/ui/czi-tooltip-surface.css +0 -45
- package/src/ui/preventEventDefault.js +0 -5
- package/src/ui/rects.js +0 -47
- package/src/updateIndentLevel.js +0 -211
- package/utils/build_customstyle_server.js +0 -72
|
@@ -10,7 +10,7 @@ var _Licit = _interopRequireDefault(require("./Licit"));
|
|
|
10
10
|
|
|
11
11
|
var _RichTextEditor = _interopRequireDefault(require("../ui/RichTextEditor"));
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _licitUiCommands = require("@modusoperandi/licit-ui-commands");
|
|
14
14
|
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
|
|
@@ -22,11 +22,22 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
22
22
|
});
|
|
23
23
|
describe('<Licit />', () => {
|
|
24
24
|
let wrapper;
|
|
25
|
-
let licit; //
|
|
25
|
+
let licit; // provide an empty document just to shut up that warning
|
|
26
|
+
|
|
27
|
+
const data = {
|
|
28
|
+
type: 'doc',
|
|
29
|
+
content: [{
|
|
30
|
+
type: 'paragraph',
|
|
31
|
+
content: [{
|
|
32
|
+
type: 'text',
|
|
33
|
+
text: ' '
|
|
34
|
+
}]
|
|
35
|
+
}]
|
|
36
|
+
}; // Mocking the functions used in _onReady
|
|
26
37
|
|
|
27
38
|
const fakeEditorView = {
|
|
28
|
-
focus:
|
|
29
|
-
dispatch:
|
|
39
|
+
focus: _licitUiCommands.noop,
|
|
40
|
+
dispatch: _licitUiCommands.noop,
|
|
30
41
|
state: {
|
|
31
42
|
doc: {
|
|
32
43
|
content: {
|
|
@@ -35,26 +46,16 @@ describe('<Licit />', () => {
|
|
|
35
46
|
resolve: () => ({
|
|
36
47
|
min: () => 0,
|
|
37
48
|
max: () => 10
|
|
38
|
-
})
|
|
49
|
+
}),
|
|
50
|
+
toJSON: () => data
|
|
39
51
|
},
|
|
40
52
|
tr: {
|
|
41
53
|
setSelection: () => fakeEditorView.state.tr,
|
|
42
|
-
scrollIntoView:
|
|
54
|
+
scrollIntoView: _licitUiCommands.noop
|
|
43
55
|
}
|
|
44
56
|
}
|
|
45
57
|
};
|
|
46
58
|
beforeEach(() => {
|
|
47
|
-
// provide an empty document just to shut up that warning
|
|
48
|
-
const data = {
|
|
49
|
-
type: 'doc',
|
|
50
|
-
content: [{
|
|
51
|
-
type: 'paragraph',
|
|
52
|
-
content: [{
|
|
53
|
-
type: 'text',
|
|
54
|
-
text: ' '
|
|
55
|
-
}]
|
|
56
|
-
}]
|
|
57
|
-
};
|
|
58
59
|
wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_Licit.default, {
|
|
59
60
|
data: data
|
|
60
61
|
}));
|
|
@@ -3,7 +3,7 @@ import { configure, shallow } from 'enzyme';
|
|
|
3
3
|
import Adapter from 'enzyme-adapter-react-16';
|
|
4
4
|
import Licit from './Licit';
|
|
5
5
|
import RichTextEditor from '../ui/RichTextEditor';
|
|
6
|
-
import noop from '
|
|
6
|
+
import { noop } from '@modusoperandi/licit-ui-commands';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Configure Jest to use react / enzyme
|
|
@@ -16,6 +16,17 @@ describe('<Licit />', () => {
|
|
|
16
16
|
let wrapper;
|
|
17
17
|
let licit;
|
|
18
18
|
|
|
19
|
+
// provide an empty document just to shut up that warning
|
|
20
|
+
const data = {
|
|
21
|
+
type: 'doc',
|
|
22
|
+
content: [
|
|
23
|
+
{
|
|
24
|
+
type: 'paragraph',
|
|
25
|
+
content: [{ type: 'text', text: ' ' }],
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
|
|
19
30
|
// Mocking the functions used in _onReady
|
|
20
31
|
const fakeEditorView = {
|
|
21
32
|
focus: noop,
|
|
@@ -24,6 +35,7 @@ describe('<Licit />', () => {
|
|
|
24
35
|
doc: {
|
|
25
36
|
content: { size: 10 },
|
|
26
37
|
resolve: () => ({ min: () => 0, max: () => 10 }),
|
|
38
|
+
toJSON: () => data,
|
|
27
39
|
},
|
|
28
40
|
tr: {
|
|
29
41
|
setSelection: () => fakeEditorView.state.tr,
|
|
@@ -33,16 +45,6 @@ describe('<Licit />', () => {
|
|
|
33
45
|
};
|
|
34
46
|
|
|
35
47
|
beforeEach(() => {
|
|
36
|
-
// provide an empty document just to shut up that warning
|
|
37
|
-
const data = {
|
|
38
|
-
type: 'doc',
|
|
39
|
-
content: [
|
|
40
|
-
{
|
|
41
|
-
type: 'paragraph',
|
|
42
|
-
content: [{ type: 'text', text: ' ' }],
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
};
|
|
46
48
|
wrapper = shallow(<Licit data={data} />);
|
|
47
49
|
licit = wrapper.instance();
|
|
48
50
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.default = exports.bpfrpt_proptype_SetStateCall = void 0;
|
|
7
7
|
|
|
8
8
|
var _prosemirrorState = require("prosemirror-state");
|
|
9
9
|
|
|
@@ -55,7 +55,9 @@ class SimpleConnector {
|
|
|
55
55
|
return this._editorState;
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
_defineProperty(this, "updateSchema", schema => {});
|
|
58
|
+
_defineProperty(this, "updateSchema", (schema, data) => {});
|
|
59
|
+
|
|
60
|
+
_defineProperty(this, "cleanUp", () => {});
|
|
59
61
|
|
|
60
62
|
this._editorState = _editorState;
|
|
61
63
|
this._setState = setState;
|
|
@@ -47,7 +47,9 @@ class SimpleConnector {
|
|
|
47
47
|
|
|
48
48
|
// FS IRAD-1040 2020-09-02
|
|
49
49
|
// Send the modified schema to server
|
|
50
|
-
updateSchema = (schema: Schema) => {};
|
|
50
|
+
updateSchema = (schema: Schema, data: any) => {};
|
|
51
|
+
|
|
52
|
+
cleanUp = () => {};
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
export default SimpleConnector;
|
package/dist/client/http.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.req = req;
|
|
7
|
-
exports.GET = GET;
|
|
8
|
-
exports.POST = POST;
|
|
9
6
|
exports.DELETE = DELETE;
|
|
7
|
+
exports.GET = GET;
|
|
10
8
|
exports.PATCH = PATCH;
|
|
9
|
+
exports.POST = POST;
|
|
10
|
+
exports.req = req;
|
|
11
11
|
|
|
12
12
|
/* eslint-disable */
|
|
13
13
|
// A simple wrapper for XHR.
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.PX_TO_PT_RATIO = exports.PT_TO_PX_RATIO = void 0;
|
|
6
7
|
exports.default = convertToCSSPTValue;
|
|
7
|
-
exports.PT_TO_PX_RATIO = exports.PX_TO_PT_RATIO = void 0;
|
|
8
8
|
const SIZE_PATTERN = /([\d\.]+)(px|pt)/i;
|
|
9
9
|
const PX_TO_PT_RATIO = 0.75292857;
|
|
10
10
|
exports.PX_TO_PT_RATIO = PX_TO_PT_RATIO;
|
package/dist/index.js
CHANGED
|
@@ -3,28 +3,28 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "DELETE", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return
|
|
9
|
+
return _http.DELETE;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "EditorRuntime", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function () {
|
|
15
|
-
return
|
|
15
|
+
return _Types.EditorRuntime;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
18
|
+
Object.defineProperty(exports, "EditorState", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function () {
|
|
21
|
-
return
|
|
21
|
+
return _prosemirrorState.EditorState;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "GET", {
|
|
25
25
|
enumerable: true,
|
|
26
26
|
get: function () {
|
|
27
|
-
return
|
|
27
|
+
return _http.GET;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "ImageLike", {
|
|
@@ -33,16 +33,16 @@ Object.defineProperty(exports, "ImageLike", {
|
|
|
33
33
|
return _Types.ImageLike;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
Object.defineProperty(exports, "
|
|
36
|
+
Object.defineProperty(exports, "Licit", {
|
|
37
37
|
enumerable: true,
|
|
38
38
|
get: function () {
|
|
39
|
-
return
|
|
39
|
+
return _Licit.default;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
Object.defineProperty(exports, "
|
|
42
|
+
Object.defineProperty(exports, "PATCH", {
|
|
43
43
|
enumerable: true,
|
|
44
44
|
get: function () {
|
|
45
|
-
return _http.
|
|
45
|
+
return _http.PATCH;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "POST", {
|
|
@@ -51,16 +51,16 @@ Object.defineProperty(exports, "POST", {
|
|
|
51
51
|
return _http.POST;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
Object.defineProperty(exports, "
|
|
54
|
+
Object.defineProperty(exports, "isEditorStateEmpty", {
|
|
55
55
|
enumerable: true,
|
|
56
56
|
get: function () {
|
|
57
|
-
return
|
|
57
|
+
return _isEditorStateEmpty.default;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
Object.defineProperty(exports, "
|
|
60
|
+
Object.defineProperty(exports, "uuid", {
|
|
61
61
|
enumerable: true,
|
|
62
62
|
get: function () {
|
|
63
|
-
return
|
|
63
|
+
return _uuid.default;
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
|
package/dist/joinListNode.js
CHANGED
|
@@ -11,7 +11,7 @@ var _prosemirrorState = require("prosemirror-state");
|
|
|
11
11
|
|
|
12
12
|
var _prosemirrorTransform = require("prosemirror-transform");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _licitUiCommands = require("@modusoperandi/licit-ui-commands");
|
|
15
15
|
|
|
16
16
|
var _joinDown = _interopRequireDefault(require("./joinDown"));
|
|
17
17
|
|
|
@@ -26,7 +26,7 @@ function joinListNode(tr, schema, listNodePos) {
|
|
|
26
26
|
|
|
27
27
|
const node = tr.doc.nodeAt(listNodePos);
|
|
28
28
|
|
|
29
|
-
if (!(0,
|
|
29
|
+
if (!(0, _licitUiCommands.isListNode)(node)) {
|
|
30
30
|
return tr;
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -4,7 +4,7 @@ import { Schema } from 'prosemirror-model';
|
|
|
4
4
|
import { TextSelection } from 'prosemirror-state';
|
|
5
5
|
import { Transform } from 'prosemirror-transform';
|
|
6
6
|
|
|
7
|
-
import isListNode from '
|
|
7
|
+
import { isListNode } from '@modusoperandi/licit-ui-commands';
|
|
8
8
|
import joinDown from './joinDown';
|
|
9
9
|
import joinUp from './joinUp';
|
|
10
10
|
|
package/dist/keymaps.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.KEY_UNDO = exports.KEY_TOGGLE_UNDERLINE = exports.KEY_TOGGLE_STRIKETHROUGH = exports.KEY_TOGGLE_ORDERED_LIST = exports.KEY_TOGGLE_MONOSPACE = exports.KEY_TOGGLE_ITALIC = exports.KEY_TOGGLE_HEADING_6 = exports.KEY_TOGGLE_HEADING_5 = exports.KEY_TOGGLE_HEADING_4 = exports.KEY_TOGGLE_HEADING_3 = exports.KEY_TOGGLE_HEADING_2 = exports.KEY_TOGGLE_HEADING_1 = exports.KEY_TOGGLE_CODE_BLOCK = exports.KEY_TOGGLE_BULLET_LIST = exports.KEY_TOGGLE_BOLD = exports.KEY_TOGGLE_BLOCK_QUOTE = exports.KEY_TAB_SHIFT = exports.KEY_TAB = exports.KEY_SPLIT_LIST_ITEM = exports.KEY_SPLIT_CODEBLOCK = exports.KEY_SHIFT_BACKSPACE = exports.KEY_SET_NORMAL_TEXT = exports.KEY_REDO = exports.KEY_INSERT_NEW_LINE_IN_LIST_ITEM = exports.KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE = exports.KEY_INSERT_NEW_LINE = exports.KEY_INSERT_HORIZONTAL_RULE = exports.KEY_FORWARD_DELETE = exports.KEY_BACK_DELETE = exports.ALL_KEYS = void 0;
|
|
7
7
|
exports.findKeymapByDescription = findKeymapByDescription;
|
|
8
8
|
exports.findShortcutByDescription = findShortcutByDescription;
|
|
9
9
|
exports.findShortcutByKeymap = findShortcutByKeymap;
|
|
10
|
-
exports.
|
|
10
|
+
exports.tooltip = tooltip;
|
|
11
11
|
|
|
12
12
|
var _browserkeymap = _interopRequireDefault(require("browserkeymap"));
|
|
13
13
|
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = patchStyleElements;
|
|
7
6
|
exports.ATTRIBUTE_CSS_BEFORE_CONTENT = void 0;
|
|
7
|
+
exports.default = patchStyleElements;
|
|
8
8
|
|
|
9
9
|
var _stable = _interopRequireDefault(require("stable"));
|
|
10
10
|
|
|
11
11
|
var _toCSSColor = _interopRequireDefault(require("./ui/toCSSColor"));
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _licitUiCommands = require("@modusoperandi/licit-ui-commands");
|
|
14
14
|
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
|
|
@@ -81,7 +81,7 @@ function patchStyleElements(doc) {
|
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
83
|
} else if (key === 'line-height') {
|
|
84
|
-
cssStyleValueStr = (0,
|
|
84
|
+
cssStyleValueStr = (0, _licitUiCommands.toCSSLineSpacing)(cssStyleValueStr);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
if (cssStyleValueStr) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import stable from 'stable';
|
|
4
4
|
import toCSSColor from './ui/toCSSColor';
|
|
5
|
-
import toCSSLineSpacing from '
|
|
5
|
+
import { toCSSLineSpacing } from '@modusoperandi/licit-ui-commands';
|
|
6
6
|
|
|
7
7
|
const LIST_ITEM_PSEUDO_ELEMENT_BEFORE = /li:+before/;
|
|
8
8
|
const NODE_NAME_SELECTOR = /^[a-zA-Z]+\d*$/;
|
package/dist/splitListItem.js
CHANGED
|
@@ -19,9 +19,9 @@ var _prosemirrorUtils = require("prosemirror-utils");
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
22
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
22
|
+
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; }
|
|
23
23
|
|
|
24
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
24
|
+
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; }
|
|
25
25
|
|
|
26
26
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
27
|
|
package/dist/styles.css
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
@import './styles0.css';
|
|
2
2
|
@import './ui/czi-loading-indicator.css';
|
|
3
3
|
@import './ui/czi-math-view.css';
|
|
4
|
-
@import '
|
|
4
|
+
@import '@modusoperandi/licit-ui-commands/dist/ui/czi-pop-up.css';
|
|
5
5
|
@import './ui/czi-selection-placeholder.css';
|
|
6
6
|
@import './ui/czi-table-cell-menu.css';
|
|
7
7
|
@import './ui/czi-table-grid-size-editor.css';
|
|
8
|
-
@import '
|
|
8
|
+
@import '@modusoperandi/licit-ui-commands/dist/ui/czi-tooltip-surface.css';
|
|
9
9
|
@import './ui/mathquill-editor/czi-mathquill-editor.css';
|
|
10
10
|
@import './ui/mathquill-editor/czi-mathquill-editor-symbols-panel.css';
|
|
11
11
|
@import './client/licit.css';
|
package/dist/styles0.css
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
@import './ui/czi-indent.css';
|
|
4
4
|
@import './ui/czi-list.css';
|
|
5
5
|
@import './ui/czi-table.css';
|
|
6
|
-
@import '
|
|
7
|
-
@import '
|
|
8
|
-
@import '
|
|
6
|
+
@import '@modusoperandi/licit-ui-commands/dist/ui/czi-custom-button.css';
|
|
7
|
+
@import '@modusoperandi/licit-ui-commands/dist/ui/czi-animations.css';
|
|
8
|
+
@import '@modusoperandi/licit-ui-commands/dist/ui/czi-color-editor.css';
|
|
9
9
|
@import './ui/czi-bookmark-view.css';
|
|
10
10
|
@import './ui/czi-body-layout-editor.css';
|
|
11
11
|
@import './ui/czi-cursor-placeholder.css';
|
package/dist/toggleBlockquote.js
CHANGED
|
@@ -11,15 +11,7 @@ var _prosemirrorTransform = require("prosemirror-transform");
|
|
|
11
11
|
|
|
12
12
|
var _NodeNames = require("./NodeNames");
|
|
13
13
|
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var _isInsideListItem = _interopRequireDefault(require("./isInsideListItem"));
|
|
17
|
-
|
|
18
|
-
var _isListNode = _interopRequireDefault(require("./isListNode"));
|
|
19
|
-
|
|
20
|
-
var _toggleList = require("./toggleList");
|
|
21
|
-
|
|
22
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
var _licitUiCommands = require("@modusoperandi/licit-ui-commands");
|
|
23
15
|
|
|
24
16
|
function toggleBlockquote(tr, schema) {
|
|
25
17
|
const {
|
|
@@ -56,10 +48,10 @@ function toggleBlockquote(tr, schema) {
|
|
|
56
48
|
poses.push(pos);
|
|
57
49
|
}
|
|
58
50
|
|
|
59
|
-
return !(0,
|
|
51
|
+
return !(0, _licitUiCommands.isListNode)(node);
|
|
60
52
|
}); // Update from the bottom to avoid disruptive changes in pos.
|
|
61
53
|
|
|
62
|
-
poses.sort(
|
|
54
|
+
poses.sort(_licitUiCommands.compareNumber).reverse().forEach(pos => {
|
|
63
55
|
tr = setBlockquoteNode(tr, schema, pos);
|
|
64
56
|
});
|
|
65
57
|
return tr;
|
|
@@ -86,12 +78,12 @@ function setBlockquoteNode(tr, schema, pos) {
|
|
|
86
78
|
|
|
87
79
|
const nodeType = node.type;
|
|
88
80
|
|
|
89
|
-
if ((0,
|
|
81
|
+
if ((0, _licitUiCommands.isInsideListItem)(tr.doc, pos)) {
|
|
90
82
|
return tr;
|
|
91
|
-
} else if ((0,
|
|
83
|
+
} else if ((0, _licitUiCommands.isListNode)(node)) {
|
|
92
84
|
// Toggle list
|
|
93
85
|
if (blockquote) {
|
|
94
|
-
tr = (0,
|
|
86
|
+
tr = (0, _licitUiCommands.unwrapNodesFromList)(tr, schema, pos, paragraphNode => {
|
|
95
87
|
const {
|
|
96
88
|
content,
|
|
97
89
|
marks,
|
|
@@ -4,10 +4,10 @@ import { Schema } from 'prosemirror-model';
|
|
|
4
4
|
import { Transform } from 'prosemirror-transform';
|
|
5
5
|
|
|
6
6
|
import { BLOCKQUOTE, HEADING, LIST_ITEM, PARAGRAPH } from './NodeNames';
|
|
7
|
-
import compareNumber from '
|
|
8
|
-
import isInsideListItem from '
|
|
9
|
-
import isListNode from '
|
|
10
|
-
import { unwrapNodesFromList } from '
|
|
7
|
+
import { compareNumber } from '@modusoperandi/licit-ui-commands';
|
|
8
|
+
import { isInsideListItem } from '@modusoperandi/licit-ui-commands';
|
|
9
|
+
import { isListNode } from '@modusoperandi/licit-ui-commands';
|
|
10
|
+
import { unwrapNodesFromList } from '@modusoperandi/licit-ui-commands';
|
|
11
11
|
|
|
12
12
|
export default function toggleBlockquote(
|
|
13
13
|
tr: Transform,
|
package/dist/toggleCodeBlock.js
CHANGED
|
@@ -15,13 +15,7 @@ var _MarkNames = require("./MarkNames");
|
|
|
15
15
|
|
|
16
16
|
var _NodeNames = require("./NodeNames");
|
|
17
17
|
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
var _compareNumber = _interopRequireDefault(require("./compareNumber"));
|
|
21
|
-
|
|
22
|
-
var _isListNode = _interopRequireDefault(require("./isListNode"));
|
|
23
|
-
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
var _licitUiCommands = require("@modusoperandi/licit-ui-commands");
|
|
25
19
|
|
|
26
20
|
function toggleCodeBlock(tr, schema) {
|
|
27
21
|
const {
|
|
@@ -67,7 +61,7 @@ function toggleCodeBlock(tr, schema) {
|
|
|
67
61
|
return isBlock;
|
|
68
62
|
}); // Update from the bottom to avoid disruptive changes in pos.
|
|
69
63
|
|
|
70
|
-
allowed && poses.sort(
|
|
64
|
+
allowed && poses.sort(_licitUiCommands.compareNumber).reverse().forEach(pos => {
|
|
71
65
|
tr = setCodeBlockNodeEnabled(tr, schema, pos, startWithCodeBlock ? false : true);
|
|
72
66
|
});
|
|
73
67
|
return tr;
|
|
@@ -88,7 +82,7 @@ function setCodeBlockNodeEnabled(tr, schema, pos, enabled) {
|
|
|
88
82
|
return tr;
|
|
89
83
|
}
|
|
90
84
|
|
|
91
|
-
if ((0,
|
|
85
|
+
if ((0, _licitUiCommands.isListNode)(node)) {
|
|
92
86
|
return tr;
|
|
93
87
|
}
|
|
94
88
|
|
|
@@ -105,7 +99,7 @@ function setCodeBlockNodeEnabled(tr, schema, pos, enabled) {
|
|
|
105
99
|
selection
|
|
106
100
|
} = tr;
|
|
107
101
|
tr = tr.setSelection(_prosemirrorState.TextSelection.create(tr.doc, pos, pos + node.nodeSize));
|
|
108
|
-
tr = (0,
|
|
102
|
+
tr = (0, _licitUiCommands.clearMarks)(tr, schema);
|
|
109
103
|
tr = tr.removeMark(pos, pos + node.nodeSize, schema.marks[_MarkNames.MARK_LINK]);
|
|
110
104
|
tr = tr.setSelection(selection);
|
|
111
105
|
tr = tr.setNodeMarkup(pos, codeBlock, node.attrs, node.marks);
|
|
@@ -6,9 +6,9 @@ import { Transform } from 'prosemirror-transform';
|
|
|
6
6
|
|
|
7
7
|
import { MARK_LINK } from './MarkNames';
|
|
8
8
|
import { BLOCKQUOTE, CODE_BLOCK, HEADING, PARAGRAPH } from './NodeNames';
|
|
9
|
-
import { clearMarks } from '
|
|
10
|
-
import compareNumber from '
|
|
11
|
-
import isListNode from '
|
|
9
|
+
import { clearMarks } from '@modusoperandi/licit-ui-commands';
|
|
10
|
+
import { compareNumber } from '@modusoperandi/licit-ui-commands';
|
|
11
|
+
import { isListNode } from '@modusoperandi/licit-ui-commands';
|
|
12
12
|
|
|
13
13
|
export default function toggleCodeBlock(
|
|
14
14
|
tr: Transform,
|
package/dist/ui/AlertInfo.js
CHANGED
|
@@ -17,9 +17,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
17
17
|
|
|
18
18
|
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; }
|
|
19
19
|
|
|
20
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
20
|
+
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; }
|
|
21
21
|
|
|
22
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
22
|
+
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; }
|
|
23
23
|
|
|
24
24
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
25
|
|
package/dist/ui/CommandButton.js
CHANGED
|
@@ -13,12 +13,10 @@ var _prosemirrorView = require("prosemirror-view");
|
|
|
13
13
|
|
|
14
14
|
var React = _interopRequireWildcard(require("react"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _licitUiCommands = require("@modusoperandi/licit-ui-commands");
|
|
17
17
|
|
|
18
18
|
var _licitDocAttrsStep = require("@modusoperandi/licit-doc-attrs-step");
|
|
19
19
|
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
20
|
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
21
|
|
|
24
22
|
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; }
|
|
@@ -64,7 +62,7 @@ class CommandButton extends React.PureComponent {
|
|
|
64
62
|
disabled = !editorView || !command.isEnabled(editorState, editorView, '');
|
|
65
63
|
}
|
|
66
64
|
|
|
67
|
-
return /*#__PURE__*/React.createElement(
|
|
65
|
+
return /*#__PURE__*/React.createElement(_licitUiCommands.CustomButton, {
|
|
68
66
|
active: command.isActive(editorState),
|
|
69
67
|
className: className,
|
|
70
68
|
disabled: disabled,
|
|
@@ -5,7 +5,7 @@ import { Transform } from 'prosemirror-transform';
|
|
|
5
5
|
import { EditorView } from 'prosemirror-view';
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
|
|
8
|
-
import CustomButton from '
|
|
8
|
+
import { CustomButton } from '@modusoperandi/licit-ui-commands';
|
|
9
9
|
import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
|
|
10
10
|
|
|
11
11
|
class CommandButton extends React.PureComponent<any, any> {
|
|
@@ -17,12 +17,10 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
17
17
|
|
|
18
18
|
var _CommandMenu = _interopRequireDefault(require("./CommandMenu"));
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _licitUiCommands = require("@modusoperandi/licit-ui-commands");
|
|
21
21
|
|
|
22
22
|
var _licitDocAttrsStep = require("@modusoperandi/licit-doc-attrs-step");
|
|
23
23
|
|
|
24
|
-
var _createPopUp = _interopRequireDefault(require("./createPopUp"));
|
|
25
|
-
|
|
26
24
|
var _uuid = _interopRequireDefault(require("./uuid"));
|
|
27
25
|
|
|
28
26
|
require("./czi-custom-menu-button.css");
|
|
@@ -33,9 +31,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
33
31
|
|
|
34
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
33
|
|
|
36
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
34
|
+
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; }
|
|
37
35
|
|
|
38
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
36
|
+
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; }
|
|
39
37
|
|
|
40
38
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
41
39
|
|
|
@@ -77,7 +75,7 @@ class CommandMenuButton extends React.PureComponent {
|
|
|
77
75
|
if (menu) {
|
|
78
76
|
menu.update(menuProps);
|
|
79
77
|
} else {
|
|
80
|
-
this._menu = (0,
|
|
78
|
+
this._menu = (0, _licitUiCommands.createPopUp)(_CommandMenu.default, menuProps, {
|
|
81
79
|
anchor: document.getElementById(this._id),
|
|
82
80
|
onClose: this._onClose
|
|
83
81
|
});
|
|
@@ -134,7 +132,7 @@ class CommandMenuButton extends React.PureComponent {
|
|
|
134
132
|
'czi-custom-menu-button': true,
|
|
135
133
|
expanded
|
|
136
134
|
});
|
|
137
|
-
return /*#__PURE__*/React.createElement(
|
|
135
|
+
return /*#__PURE__*/React.createElement(_licitUiCommands.CustomButton, {
|
|
138
136
|
className: buttonClassName,
|
|
139
137
|
disabled: !enabled,
|
|
140
138
|
icon: icon,
|
|
@@ -7,9 +7,9 @@ import { EditorView } from 'prosemirror-view';
|
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
|
|
9
9
|
import CommandMenu from './CommandMenu';
|
|
10
|
-
import CustomButton from '
|
|
10
|
+
import { CustomButton } from '@modusoperandi/licit-ui-commands';
|
|
11
11
|
import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
|
|
12
|
-
import createPopUp from '
|
|
12
|
+
import { createPopUp } from '@modusoperandi/licit-ui-commands';
|
|
13
13
|
import uuid from './uuid';
|
|
14
14
|
|
|
15
15
|
import './czi-custom-menu-button.css';
|