@modusoperandi/licit-referencing 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/Commands.d.ts +5 -1
- package/Commands.js +6 -1
- package/Dropdown.d.ts +4 -0
- package/Dropdown.js +4 -0
- package/ReferenceNodeSpec.d.ts +4 -0
- package/ReferenceNodeSpec.js +5 -0
- package/ReferenceView.d.ts +4 -0
- package/ReferenceView.js +8 -2
- package/ReferencingPlugin.d.ts +4 -0
- package/ReferencingPlugin.js +4 -0
- package/Types.d.ts +4 -0
- package/Types.js +4 -0
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/package.json +10 -10
package/Commands.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* @copyright Copyright 2025 Modus Operandi Inc. All Rights Reserved.
|
|
4
|
+
*/
|
|
1
5
|
import { EditorView } from 'prosemirror-view';
|
|
2
|
-
export declare function insertReference(view: EditorView, id: string, docId: string, docLabel: string): void;
|
|
6
|
+
export declare function insertReference(view: EditorView, id: string, docId: string, docLabel: string, scrollId: string): void;
|
package/Commands.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* @copyright Copyright 2025 Modus Operandi Inc. All Rights Reserved.
|
|
4
|
+
*/
|
|
1
5
|
import { REFERENCE } from './ReferenceNodeSpec';
|
|
2
|
-
export function insertReference(view, id, docId, docLabel) {
|
|
6
|
+
export function insertReference(view, id, docId, docLabel, scrollId) {
|
|
3
7
|
const node = view.state?.schema.nodes[REFERENCE].create({
|
|
4
8
|
docId,
|
|
5
9
|
docLabel,
|
|
6
10
|
id,
|
|
11
|
+
scrollId
|
|
7
12
|
});
|
|
8
13
|
const tr = view.state.tr.replaceSelectionWith(node);
|
|
9
14
|
view.dispatch(tr);
|
package/Dropdown.d.ts
CHANGED
package/Dropdown.js
CHANGED
package/ReferenceNodeSpec.d.ts
CHANGED
package/ReferenceNodeSpec.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* @copyright Copyright 2025 Modus Operandi Inc. All Rights Reserved.
|
|
4
|
+
*/
|
|
1
5
|
export const REFERENCE = 'reference';
|
|
2
6
|
export const ReferenceNodeSpec = {
|
|
3
7
|
attrs: {
|
|
@@ -5,6 +9,7 @@ export const ReferenceNodeSpec = {
|
|
|
5
9
|
docId: { default: null },
|
|
6
10
|
docLabel: { default: null },
|
|
7
11
|
id: { default: null },
|
|
12
|
+
scrollId: { default: null },
|
|
8
13
|
class: { default: 'ref-background' },
|
|
9
14
|
},
|
|
10
15
|
content: 'block+',
|
package/ReferenceView.d.ts
CHANGED
package/ReferenceView.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* @copyright Copyright 2025 Modus Operandi Inc. All Rights Reserved.
|
|
4
|
+
*/
|
|
1
5
|
import { DOMSerializer, Fragment } from 'prosemirror-model';
|
|
2
6
|
import { HamBurgerIcon } from './Dropdown';
|
|
3
7
|
import { createPopUp, atAnchorTopCenter, } from '@modusoperandi/licit-ui-commands';
|
|
@@ -60,7 +64,9 @@ export class ReferenceView {
|
|
|
60
64
|
json = DOMSerializer.fromSchema(this.view.state.schema).serializeFragment(json);
|
|
61
65
|
}
|
|
62
66
|
this.dom.innerText = '';
|
|
63
|
-
|
|
67
|
+
for (const n of this.dom.childNodes) {
|
|
68
|
+
n.remove();
|
|
69
|
+
}
|
|
64
70
|
this.dom.appendChild(json);
|
|
65
71
|
return json;
|
|
66
72
|
}
|
|
@@ -177,7 +183,7 @@ export class ReferenceView {
|
|
|
177
183
|
}
|
|
178
184
|
goToRef = () => {
|
|
179
185
|
const docId = encodeURIComponent(this.node.attrs.docId);
|
|
180
|
-
const scrollId = encodeURIComponent(this.node.attrs.
|
|
186
|
+
const scrollId = encodeURIComponent(this.node.attrs.scrollId);
|
|
181
187
|
const fullurl = `/knite/document/${docId}?artifactId=${scrollId}`;
|
|
182
188
|
window.open(fullurl, '_blank')?.focus();
|
|
183
189
|
};
|
package/ReferencingPlugin.d.ts
CHANGED
package/ReferencingPlugin.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* @copyright Copyright 2025 Modus Operandi Inc. All Rights Reserved.
|
|
4
|
+
*/
|
|
1
5
|
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
2
6
|
import { Schema } from 'prosemirror-model';
|
|
3
7
|
import { ReferenceNodeSpec, REFERENCE } from './ReferenceNodeSpec';
|
package/Types.d.ts
CHANGED
package/Types.js
CHANGED
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modusoperandi/licit-referencing",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"subversion": "1",
|
|
6
6
|
"description": "Referencing plugin built with ProseMirror",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/jest": "^30.0.0",
|
|
35
|
-
"@types/react": "^18.
|
|
36
|
-
"@modusoperandi/eslint-config": "^
|
|
35
|
+
"@types/react": "^18.3.27",
|
|
36
|
+
"@modusoperandi/eslint-config": "^3.0.3",
|
|
37
37
|
"copyfiles": "^2.4.1",
|
|
38
|
-
"eslint": "^9.
|
|
38
|
+
"eslint": "^9.39.2",
|
|
39
39
|
"husky": "^9.1.7",
|
|
40
40
|
"identity-obj-proxy": "^3.0.0",
|
|
41
41
|
"jest": "^30.2.0",
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"jest-junit": "^15.0.0",
|
|
44
44
|
"jest-prosemirror": "^3.0.1",
|
|
45
45
|
"jest-sonar-reporter": "^2.0.0",
|
|
46
|
-
"prettier": "^2.
|
|
47
|
-
"ts-jest": "^29.
|
|
48
|
-
"ts-node": "^10.2
|
|
46
|
+
"prettier": "^2.8.8",
|
|
47
|
+
"ts-jest": "^29.4.6",
|
|
48
|
+
"ts-node": "^10.9.2",
|
|
49
49
|
"typescript": "^5.9.3"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"react": "^18.
|
|
53
|
-
"react-dom": "^18.
|
|
52
|
+
"react": "^18.3.1",
|
|
53
|
+
"react-dom": "^18.3.1"
|
|
54
54
|
},
|
|
55
55
|
"importSort": {
|
|
56
56
|
".js": {
|
|
@@ -63,4 +63,4 @@
|
|
|
63
63
|
"pre-commit": "npx eslint --fix && prettier --write"
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
}
|
|
66
|
+
}
|