@modusoperandi/licit 1.0.12 → 1.1.1
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/FontTypeMarkSpec.js +0 -4
- package/FontTypeMarkSpec.js.flow +0 -4
- package/LICENSE +22 -0
- package/LinkSetURLCommand.js +8 -6
- package/LinkSetURLCommand.js.flow +9 -14
- package/LinkTooltipPlugin.js +3 -2
- package/LinkTooltipPlugin.js.flow +2 -2
- package/OrderedListNodeSpec.js +0 -3
- package/OrderedListNodeSpec.js.flow +1 -2
- package/bom.xml +1129 -970
- package/client/Licit.js +4 -2
- package/client/Licit.js.flow +13 -2
- package/index.d.ts +1 -1
- package/package.json +5 -4
- package/ui/CustomRadioButton.js +2 -2
- package/ui/LinkURLEditor.js +5 -2
- package/ui/LinkURLEditor.js.flow +16 -10
package/FontTypeMarkSpec.js
CHANGED
|
@@ -28,10 +28,6 @@ var RESOLVED_FONT_NAMES = new Set([]);
|
|
|
28
28
|
function loadAndCacheFont(name) {
|
|
29
29
|
// Cache custom fonts
|
|
30
30
|
RESOLVED_FONT_NAMES.add(name);
|
|
31
|
-
// https://github.com/typekit/webfontloader
|
|
32
|
-
// [FS] IRAD-1061 2020-09-19
|
|
33
|
-
// Now loaded locally, so that it work in closed network as well.
|
|
34
|
-
//WebFontLoader.load({google: {families: [name]}});
|
|
35
31
|
}
|
|
36
32
|
var FontTypeMarkSpec = {
|
|
37
33
|
attrs: {
|
package/FontTypeMarkSpec.js.flow
CHANGED
|
@@ -41,10 +41,6 @@ const RESOLVED_FONT_NAMES = new Set([]);
|
|
|
41
41
|
function loadAndCacheFont(name) {
|
|
42
42
|
// Cache custom fonts
|
|
43
43
|
RESOLVED_FONT_NAMES.add(name);
|
|
44
|
-
// https://github.com/typekit/webfontloader
|
|
45
|
-
// [FS] IRAD-1061 2020-09-19
|
|
46
|
-
// Now loaded locally, so that it work in closed network as well.
|
|
47
|
-
//WebFontLoader.load({google: {families: [name]}});
|
|
48
44
|
}
|
|
49
45
|
|
|
50
46
|
const FontTypeMarkSpec: MarkSpec = {
|
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Portions Copyright (c) 2020 Modus Operandi Inc
|
|
4
|
+
Portions Copyright (c) 2018-2019 Chan Zuckerberg Initiative
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/LinkSetURLCommand.js
CHANGED
|
@@ -67,9 +67,10 @@ var LinkSetURLCommand = /*#__PURE__*/function (_UICommand) {
|
|
|
67
67
|
case 7:
|
|
68
68
|
styles = _context.sent;
|
|
69
69
|
storeTOCvalue = styles.filter(function (style) {
|
|
70
|
-
|
|
70
|
+
var _style$styles;
|
|
71
|
+
return (style === null || style === void 0 || (_style$styles = style.styles) === null || _style$styles === void 0 ? void 0 : _style$styles.toc) === true;
|
|
71
72
|
}).map(function (style) {
|
|
72
|
-
return style.styleName;
|
|
73
|
+
return style === null || style === void 0 ? void 0 : style.styleName;
|
|
73
74
|
});
|
|
74
75
|
view.state.tr.doc.descendants(function (node, pos) {
|
|
75
76
|
if (node.attrs.styleName) {
|
|
@@ -146,9 +147,10 @@ var LinkSetURLCommand = /*#__PURE__*/function (_UICommand) {
|
|
|
146
147
|
}());
|
|
147
148
|
_defineProperty(_this, "executeWithUserInput", function (state, dispatch, view, url) {
|
|
148
149
|
if (dispatch) {
|
|
149
|
-
var
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
var _view$state = view.state,
|
|
151
|
+
selection = _view$state.selection,
|
|
152
|
+
schema = _view$state.schema;
|
|
153
|
+
var _tr = view.state.tr;
|
|
152
154
|
_tr = view ? hideSelectionPlaceholder(view.state) : _tr;
|
|
153
155
|
_tr = _tr.setSelection(selection);
|
|
154
156
|
if (url !== undefined) {
|
|
@@ -166,7 +168,7 @@ var LinkSetURLCommand = /*#__PURE__*/function (_UICommand) {
|
|
|
166
168
|
href: href,
|
|
167
169
|
selectionId: selectionId
|
|
168
170
|
} : null;
|
|
169
|
-
_tr = applyMark(_tr.setSelection(
|
|
171
|
+
_tr = applyMark(_tr.setSelection(selection), schema, markType, attrs);
|
|
170
172
|
}
|
|
171
173
|
dispatch(_tr);
|
|
172
174
|
}
|
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
showSelectionPlaceholder,
|
|
11
11
|
} from './SelectionPlaceholderPlugin.js';
|
|
12
12
|
import {
|
|
13
|
-
applyMark,
|
|
13
|
+
applyMark,
|
|
14
|
+
findNodesWithSameMark,
|
|
15
|
+
createPopUp,
|
|
14
16
|
} from '@modusoperandi/licit-ui-commands';
|
|
15
17
|
import LinkURLEditor from './ui/LinkURLEditor.js';
|
|
16
|
-
import {
|
|
17
|
-
UICommand
|
|
18
|
-
} from '@modusoperandi/licit-doc-attrs-step';
|
|
18
|
+
import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
|
|
19
19
|
import { INNER_LINK } from './Types.js';
|
|
20
20
|
|
|
21
21
|
class LinkSetURLCommand extends UICommand {
|
|
@@ -47,8 +47,8 @@ class LinkSetURLCommand extends UICommand {
|
|
|
47
47
|
const styles = await stylePromise.fetchStyles();
|
|
48
48
|
|
|
49
49
|
storeTOCvalue = styles
|
|
50
|
-
.filter((style) => style
|
|
51
|
-
.map((style) => style
|
|
50
|
+
.filter((style) => style?.styles?.toc === true)
|
|
51
|
+
.map((style) => style?.styleName);
|
|
52
52
|
|
|
53
53
|
view.state.tr.doc.descendants((node, pos) => {
|
|
54
54
|
if (node.attrs.styleName) {
|
|
@@ -108,8 +108,8 @@ class LinkSetURLCommand extends UICommand {
|
|
|
108
108
|
url: ?string
|
|
109
109
|
): boolean => {
|
|
110
110
|
if (dispatch) {
|
|
111
|
-
const { selection, schema } = state;
|
|
112
|
-
let { tr } = state;
|
|
111
|
+
const { selection, schema } = view.state;
|
|
112
|
+
let { tr } = view.state;
|
|
113
113
|
tr = view ? hideSelectionPlaceholder(view.state) : tr;
|
|
114
114
|
tr = tr.setSelection(selection);
|
|
115
115
|
if (url !== undefined) {
|
|
@@ -124,12 +124,7 @@ class LinkSetURLCommand extends UICommand {
|
|
|
124
124
|
}
|
|
125
125
|
const markType = schema.marks[MARK_LINK];
|
|
126
126
|
const attrs = url ? { href, selectionId } : null;
|
|
127
|
-
tr = applyMark(
|
|
128
|
-
tr.setSelection(state.selection),
|
|
129
|
-
schema,
|
|
130
|
-
markType,
|
|
131
|
-
attrs
|
|
132
|
-
);
|
|
127
|
+
tr = applyMark(tr.setSelection(selection), schema, markType, attrs);
|
|
133
128
|
}
|
|
134
129
|
dispatch(tr);
|
|
135
130
|
}
|
package/LinkTooltipPlugin.js
CHANGED
|
@@ -78,9 +78,10 @@ var LinkTooltipView = /*#__PURE__*/function () {
|
|
|
78
78
|
case 9:
|
|
79
79
|
styles = _context.sent;
|
|
80
80
|
storeTOCvalue = styles.filter(function (style) {
|
|
81
|
-
|
|
81
|
+
var _style$styles;
|
|
82
|
+
return (style === null || style === void 0 || (_style$styles = style.styles) === null || _style$styles === void 0 ? void 0 : _style$styles.toc) === true;
|
|
82
83
|
}).map(function (style) {
|
|
83
|
-
return style.styleName;
|
|
84
|
+
return style === null || style === void 0 ? void 0 : style.styleName;
|
|
84
85
|
});
|
|
85
86
|
view.state.tr.doc.descendants(function (node, pos) {
|
|
86
87
|
if (node.attrs.styleName) {
|
|
@@ -144,8 +144,8 @@ class LinkTooltipView {
|
|
|
144
144
|
const styles = await stylePromise.fetchStyles();
|
|
145
145
|
|
|
146
146
|
storeTOCvalue = styles
|
|
147
|
-
.filter((style) => style
|
|
148
|
-
.map((style) => style
|
|
147
|
+
.filter((style) => style?.styles?.toc === true)
|
|
148
|
+
.map((style) => style?.styleName);
|
|
149
149
|
view.state.tr.doc.descendants((node, pos) => {
|
|
150
150
|
if (node.attrs.styleName) {
|
|
151
151
|
for (let i = 0; i <= storeTOCvalue.length; i++) {
|
package/OrderedListNodeSpec.js
CHANGED
|
@@ -21,8 +21,7 @@ const OrderedListNodeSpec: NodeSpec = {
|
|
|
21
21
|
listStyleType: { default: null },
|
|
22
22
|
name: { default: null },
|
|
23
23
|
start: { default: 1 },
|
|
24
|
-
type: { default: 'decimal' }
|
|
25
|
-
styleName: { default: RESERVED_STYLE_NONE },
|
|
24
|
+
type: { default: 'decimal' }
|
|
26
25
|
},
|
|
27
26
|
group: 'block',
|
|
28
27
|
content: LIST_ITEM + '+',
|