@modusoperandi/licit 1.0.0 → 1.0.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/TableResizePlugin.js +2 -2
- package/TableResizePlugin.js.flow +2 -2
- package/bom.xml +44 -6
- package/index.d.ts +165 -6
- package/index.js +1 -1
- package/index.js.flow +1 -1
- package/package.json +2 -1
package/TableResizePlugin.js
CHANGED
|
@@ -46,7 +46,7 @@ import { Transform } from 'prosemirror-transform';
|
|
|
46
46
|
import { Decoration, DecorationSet, EditorView } from 'prosemirror-view';
|
|
47
47
|
import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
|
|
48
48
|
import nullthrows from 'nullthrows';
|
|
49
|
-
import { cellAround, pointsAtCell,
|
|
49
|
+
import { cellAround, pointsAtCell, setCellAttr, tableNodeTypes, TableMap, TableView } from 'prosemirror-tables';
|
|
50
50
|
var PLUGIN_KEY = new PluginKey('tableColumnResizing');
|
|
51
51
|
|
|
52
52
|
// [FS] IRAD-949 2020-05-27
|
|
@@ -288,7 +288,7 @@ function handleDragEnd(view, event) {
|
|
|
288
288
|
if (attrs.colwidth && compareNumbersList(attrs.colwidth, colwidth)) {
|
|
289
289
|
continue;
|
|
290
290
|
}
|
|
291
|
-
tr = tr.setNodeMarkup(start + pos, null,
|
|
291
|
+
tr = tr.setNodeMarkup(start + pos, null, setCellAttr('colwidth', colwidth));
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
var marginLeft = parseFloat(tableElement.style.marginLeft) || null;
|
|
@@ -39,7 +39,7 @@ import nullthrows from 'nullthrows';
|
|
|
39
39
|
import {
|
|
40
40
|
cellAround,
|
|
41
41
|
pointsAtCell,
|
|
42
|
-
|
|
42
|
+
setCellAttr,
|
|
43
43
|
tableNodeTypes,
|
|
44
44
|
TableMap,
|
|
45
45
|
TableView,
|
|
@@ -344,7 +344,7 @@ function handleDragEnd(view: EditorView, event: any): void {
|
|
|
344
344
|
tr = tr.setNodeMarkup(
|
|
345
345
|
start + pos,
|
|
346
346
|
null,
|
|
347
|
-
|
|
347
|
+
setCellAttr('colwidth', colwidth)
|
|
348
348
|
);
|
|
349
349
|
}
|
|
350
350
|
}
|
package/bom.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<bom xmlns="http://cyclonedx.org/schema/bom/1.4" version="1" serialNumber="urn:uuid:
|
|
2
|
+
<bom xmlns="http://cyclonedx.org/schema/bom/1.4" version="1" serialNumber="urn:uuid:35353f41-2493-4d16-b79b-446e3dd2a3fd">
|
|
3
3
|
<metadata>
|
|
4
|
-
<timestamp>2024-02-
|
|
4
|
+
<timestamp>2024-02-10T23:05:08.237Z</timestamp>
|
|
5
5
|
<tools>
|
|
6
6
|
<tool>
|
|
7
7
|
<name>npm</name>
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
</externalReferences>
|
|
47
47
|
</tool>
|
|
48
48
|
</tools>
|
|
49
|
-
<component type="application" bom-ref="@modusoperandi/licit@1.0.
|
|
49
|
+
<component type="application" bom-ref="@modusoperandi/licit@1.0.1">
|
|
50
50
|
<group>@modusoperandi</group>
|
|
51
51
|
<name>licit</name>
|
|
52
|
-
<version>1.0.
|
|
52
|
+
<version>1.0.1</version>
|
|
53
53
|
<description>Rich text editor built with React and ProseMirror</description>
|
|
54
|
-
<purl>pkg:npm/%40modusoperandi/licit@1.0.
|
|
54
|
+
<purl>pkg:npm/%40modusoperandi/licit@1.0.1</purl>
|
|
55
55
|
<externalReferences>
|
|
56
56
|
<reference type="vcs">
|
|
57
57
|
<url>git+https://github.com/MO-Movia/licit.git</url>
|
|
@@ -17283,6 +17283,42 @@
|
|
|
17283
17283
|
<property name="cdx:npm:package:path">node_modules/mime-types</property>
|
|
17284
17284
|
</properties>
|
|
17285
17285
|
</component>
|
|
17286
|
+
<component type="library" bom-ref="browserkeymap@2.0.2">
|
|
17287
|
+
<author>Marijn Haverbeke</author>
|
|
17288
|
+
<name>browserkeymap</name>
|
|
17289
|
+
<version>2.0.2</version>
|
|
17290
|
+
<description>Map browser events to key names, and key names to values</description>
|
|
17291
|
+
<licenses>
|
|
17292
|
+
<license>
|
|
17293
|
+
<id>MIT</id>
|
|
17294
|
+
</license>
|
|
17295
|
+
</licenses>
|
|
17296
|
+
<purl>pkg:npm/browserkeymap@2.0.2</purl>
|
|
17297
|
+
<externalReferences>
|
|
17298
|
+
<reference type="vcs">
|
|
17299
|
+
<url>git+https://github.com/marijnh/browserkeymap.git</url>
|
|
17300
|
+
<comment>as detected from PackageJson property "repository.url"</comment>
|
|
17301
|
+
</reference>
|
|
17302
|
+
<reference type="website">
|
|
17303
|
+
<url>https://github.com/marijnh/browserkeymap#readme</url>
|
|
17304
|
+
<comment>as detected from PackageJson property "homepage"</comment>
|
|
17305
|
+
</reference>
|
|
17306
|
+
<reference type="issue-tracker">
|
|
17307
|
+
<url>https://github.com/marijnh/browserkeymap/issues</url>
|
|
17308
|
+
<comment>as detected from PackageJson property "bugs.url"</comment>
|
|
17309
|
+
</reference>
|
|
17310
|
+
<reference type="distribution">
|
|
17311
|
+
<url>https://registry.npmjs.org/browserkeymap/-/browserkeymap-2.0.2.tgz</url>
|
|
17312
|
+
<comment>as detected from npm-ls property "resolved" and property "integrity"</comment>
|
|
17313
|
+
<hashes>
|
|
17314
|
+
<hash alg="SHA-512">fd1f0ca9c2f3de6b645e2c9691e58f30709733409938bf3fd7948dad778d721726397c1f7bf7ad4092473a93874abc3ae14684a80837237ca5b7da4436285328</hash>
|
|
17315
|
+
</hashes>
|
|
17316
|
+
</reference>
|
|
17317
|
+
</externalReferences>
|
|
17318
|
+
<properties>
|
|
17319
|
+
<property name="cdx:npm:package:path">node_modules/browserkeymap</property>
|
|
17320
|
+
</properties>
|
|
17321
|
+
</component>
|
|
17286
17322
|
<component type="library" bom-ref="clean-webpack-plugin@4.0.0">
|
|
17287
17323
|
<author>John Agan</author>
|
|
17288
17324
|
<name>clean-webpack-plugin</name>
|
|
@@ -60707,7 +60743,7 @@
|
|
|
60707
60743
|
</component>
|
|
60708
60744
|
</components>
|
|
60709
60745
|
<dependencies>
|
|
60710
|
-
<dependency ref="@modusoperandi/licit@1.0.
|
|
60746
|
+
<dependency ref="@modusoperandi/licit@1.0.1">
|
|
60711
60747
|
<dependency ref="@babel/cli@7.23.9"/>
|
|
60712
60748
|
<dependency ref="@babel/core@7.23.9"/>
|
|
60713
60749
|
<dependency ref="@babel/eslint-parser@7.23.10"/>
|
|
@@ -60737,6 +60773,7 @@
|
|
|
60737
60773
|
<dependency ref="babel-plugin-flow-react-proptypes@26.0.0"/>
|
|
60738
60774
|
<dependency ref="babel-plugin-transform-react-remove-prop-types@0.4.24"/>
|
|
60739
60775
|
<dependency ref="body-parser@1.20.2"/>
|
|
60776
|
+
<dependency ref="browserkeymap@2.0.2"/>
|
|
60740
60777
|
<dependency ref="clean-webpack-plugin@4.0.0"/>
|
|
60741
60778
|
<dependency ref="copy-webpack-plugin@11.0.0"/>
|
|
60742
60779
|
<dependency ref="copyfiles@2.4.1"/>
|
|
@@ -62639,6 +62676,7 @@
|
|
|
62639
62676
|
<dependency ref="mime-types@2.1.35">
|
|
62640
62677
|
<dependency ref="mime-db@1.52.0"/>
|
|
62641
62678
|
</dependency>
|
|
62679
|
+
<dependency ref="browserkeymap@2.0.2"/>
|
|
62642
62680
|
<dependency ref="clean-webpack-plugin@4.0.0">
|
|
62643
62681
|
<dependency ref="del@4.1.1"/>
|
|
62644
62682
|
<dependency ref="webpack@5.90.1"/>
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,165 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
// from "./isEditorStateEmpty"
|
|
2
|
+
import { EditorState, Plugin } from 'prosemirror-state';
|
|
3
|
+
import { Node, Schema } from 'prosemirror-model';
|
|
4
|
+
import { Transform } from 'prosemirror-transform';
|
|
5
|
+
import { EditorView } from 'prosemirror-view';
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
|
|
8
|
+
export default function isEditorStateEmpty(editorState: EditorState): boolean;
|
|
9
|
+
|
|
10
|
+
// from "./ui/uuid";
|
|
11
|
+
export default function uuid(): string;
|
|
12
|
+
|
|
13
|
+
// from './client/Licit.js';
|
|
14
|
+
|
|
15
|
+
export type DataType = Readonly<{
|
|
16
|
+
JSON: symbol;
|
|
17
|
+
HTML: symbol;
|
|
18
|
+
}>;
|
|
19
|
+
|
|
20
|
+
export class Licit extends React.Component<any, any> {
|
|
21
|
+
runtime: any;
|
|
22
|
+
|
|
23
|
+
constructor(props: any, context: any);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Provides access to prosemirror view.
|
|
27
|
+
*/
|
|
28
|
+
get editorView(): EditorView;
|
|
29
|
+
|
|
30
|
+
initialize(props: any);
|
|
31
|
+
|
|
32
|
+
initEditorState(plugins: Array<Plugin>, dataType: DataType, data: any);
|
|
33
|
+
|
|
34
|
+
getEffectivePlugins(
|
|
35
|
+
schema: Schema,
|
|
36
|
+
defaultPlugins: Array<Plugin>,
|
|
37
|
+
plugins: Array<Plugin>
|
|
38
|
+
): { plugins: Array<Plugin>; schema: Schema; pasteJSONPlugin: Plugin };
|
|
39
|
+
|
|
40
|
+
onReady(state: EditorState);
|
|
41
|
+
|
|
42
|
+
showAlert();
|
|
43
|
+
|
|
44
|
+
resetCounters(transaction: Transform);
|
|
45
|
+
|
|
46
|
+
setCounterFlags(transaction: Transform, reset: boolean);
|
|
47
|
+
|
|
48
|
+
getDeletedArtifactIds();
|
|
49
|
+
|
|
50
|
+
isNodeHasAttribute(node: Node, attrName: string);
|
|
51
|
+
|
|
52
|
+
getDocument(content: any, editorState: EditorState, dataType: DataType);
|
|
53
|
+
|
|
54
|
+
insertJSON(json: { [key: string]: any } | string): void;
|
|
55
|
+
|
|
56
|
+
setContent(content: any, dataType: DataType): void;
|
|
57
|
+
|
|
58
|
+
hasDataChanged(nextData: any, nextDataType: DataType);
|
|
59
|
+
|
|
60
|
+
changeContent(data: any, dataType: DataType);
|
|
61
|
+
|
|
62
|
+
shouldComponentUpdate(nextProps: any, nextState: any);
|
|
63
|
+
|
|
64
|
+
setDocID(nextState: any);
|
|
65
|
+
|
|
66
|
+
render(): React.ReactElement<any>;
|
|
67
|
+
|
|
68
|
+
_onChange(data: { state: EditorState; transaction: Transform }): void;
|
|
69
|
+
|
|
70
|
+
closeOpenedPopupModels();
|
|
71
|
+
|
|
72
|
+
_onReady(editorView: EditorView): void;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* LICIT properties:
|
|
76
|
+
* docID {number} [0] Collaborative Doument ID
|
|
77
|
+
* debug {boolean} [false] To enable/disable ProseMirror Debug Tools, available only in development.
|
|
78
|
+
* width {string} [100%] Width of the editor.
|
|
79
|
+
* height {height} [100%] Height of the editor.
|
|
80
|
+
* readOnly {boolean} [false] To enable/disable editing mode.
|
|
81
|
+
* onChange {@callback} [null] Fires after each significant change.
|
|
82
|
+
* @param data {JSON} Modified document data.
|
|
83
|
+
* onReady {@callback} [null] Fires when the editor is fully ready.
|
|
84
|
+
* @param ref {LICIT} Rerefence of the editor.
|
|
85
|
+
* data {JSON} [null] Document data to be loaded into the editor.
|
|
86
|
+
* disabled {boolean} [false] Disable the editor.
|
|
87
|
+
* embedded {boolean} [false] Disable/Enable inline behaviour.
|
|
88
|
+
*/
|
|
89
|
+
setProps(props: any): void;
|
|
90
|
+
|
|
91
|
+
exportPDF();
|
|
92
|
+
|
|
93
|
+
goToEnd(): void;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// from './Types';
|
|
97
|
+
export type NodeSpec = {
|
|
98
|
+
attrs?: { [key: string]: any };
|
|
99
|
+
content?: string;
|
|
100
|
+
draggable?: boolean;
|
|
101
|
+
group?: string;
|
|
102
|
+
inline?: boolean;
|
|
103
|
+
name?: string;
|
|
104
|
+
parseDOM?: Array<any>;
|
|
105
|
+
toDOM?: (node: any) => Array<any>;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export type MarkSpec = {
|
|
109
|
+
attrs?: { [key: string]: any };
|
|
110
|
+
name?: string;
|
|
111
|
+
parseDOM: Array<any>;
|
|
112
|
+
toDOM: (node: any) => Array<any>;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export type EditorProps = {
|
|
116
|
+
// TODO: Fill the interface.
|
|
117
|
+
// https://github.com/ProseMirror/prosemirror-view/blob/master/src/index.js
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export type DirectEditorProps = EditorProps & {
|
|
121
|
+
// TODO: Fill the interface.
|
|
122
|
+
// https://github.com/ProseMirror/prosemirror-view/blob/master/src/index.js
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export type RenderCommentProps = {
|
|
126
|
+
commentThreadId: string;
|
|
127
|
+
isActive: boolean;
|
|
128
|
+
requestCommentThreadDeletion: Function;
|
|
129
|
+
requestCommentThreadReflow: Function;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export type ImageLike = {
|
|
133
|
+
height: number;
|
|
134
|
+
id: string;
|
|
135
|
+
src: string;
|
|
136
|
+
width: number;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export type EditorRuntime = {
|
|
140
|
+
// Image Proxy
|
|
141
|
+
canProxyImageSrc?: (src: string) => boolean;
|
|
142
|
+
getProxyImageSrc?: (src: string) => string;
|
|
143
|
+
|
|
144
|
+
// Image Upload
|
|
145
|
+
canUploadImage?: () => boolean;
|
|
146
|
+
uploadImage?: (obj: Blob) => Promise<ImageLike>;
|
|
147
|
+
|
|
148
|
+
// Comments
|
|
149
|
+
canComment?: () => boolean;
|
|
150
|
+
createCommentThreadID?: () => string;
|
|
151
|
+
renderComment?: (
|
|
152
|
+
props: RenderCommentProps
|
|
153
|
+
) => React.ReactElement<any> | undefined;
|
|
154
|
+
|
|
155
|
+
// External HTML
|
|
156
|
+
canLoadHTML?: () => boolean;
|
|
157
|
+
loadHTML?: () => Promise<string>;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
// from './client/http';
|
|
161
|
+
export function GET(url);
|
|
162
|
+
export function POST(url, body, type);
|
|
163
|
+
export function PUT(url, body, type);
|
|
164
|
+
export function DELETE(url, type);
|
|
165
|
+
export function PATCH(url, body, type);
|
package/index.js
CHANGED
|
@@ -4,5 +4,5 @@ export { default as uuid } from './ui/uuid';
|
|
|
4
4
|
// [FS] IRAD-978 2020-06-05
|
|
5
5
|
// Export Licit as a component
|
|
6
6
|
export { default as Licit, DataType } from './client/Licit.js';
|
|
7
|
-
export { ImageLike, EditorRuntime } from './Types';
|
|
7
|
+
// export { ImageLike, EditorRuntime } from './Types'; //Flow garbles these types beyond use for now
|
|
8
8
|
export { GET, POST, DELETE, PATCH } from './client/http';
|
package/index.js.flow
CHANGED
|
@@ -6,5 +6,5 @@ export { default as uuid } from './ui/uuid';
|
|
|
6
6
|
// [FS] IRAD-978 2020-06-05
|
|
7
7
|
// Export Licit as a component
|
|
8
8
|
export { default as Licit, DataType } from './client/Licit.js';
|
|
9
|
-
export { ImageLike, EditorRuntime } from './Types';
|
|
9
|
+
// export { ImageLike, EditorRuntime } from './Types'; //Flow garbles these types beyond use for now
|
|
10
10
|
export { GET, POST, DELETE, PATCH } from './client/http';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modusoperandi/licit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"subversion": "1",
|
|
6
6
|
"description": "Rich text editor built with React and ProseMirror",
|
|
@@ -99,6 +99,7 @@
|
|
|
99
99
|
"dependencies": {
|
|
100
100
|
"@cfaester/enzyme-adapter-react-18": "^0.7.1",
|
|
101
101
|
"body-parser": "^1.19.0",
|
|
102
|
+
"browserkeymap": "^2.0.2",
|
|
102
103
|
"cors": "^2.8.5",
|
|
103
104
|
"express": "^4.17.1",
|
|
104
105
|
"flatted": "^3.1.0",
|