@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 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
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @license MIT
3
+ * @copyright Copyright 2025 Modus Operandi Inc. All Rights Reserved.
4
+ */
1
5
  import React from 'react';
2
6
  import { ViewProps } from '@modusoperandi/licit-ui-commands/ui/PopUp';
3
7
  export interface HamBurgerIconProps extends ViewProps {
package/Dropdown.js CHANGED
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @license MIT
3
+ * @copyright Copyright 2025 Modus Operandi Inc. All Rights Reserved.
4
+ */
1
5
  import React from 'react';
2
6
  import { CustomButton } from '@modusoperandi/licit-ui-commands';
3
7
  export class HamBurgerIcon extends React.PureComponent {
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @license MIT
3
+ * @copyright Copyright 2025 Modus Operandi Inc. All Rights Reserved.
4
+ */
1
5
  import { NodeSpec } from 'prosemirror-model';
2
6
  export declare const REFERENCE = "reference";
3
7
  export declare const ReferenceNodeSpec: NodeSpec;
@@ -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+',
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @license MIT
3
+ * @copyright Copyright 2025 Modus Operandi Inc. All Rights Reserved.
4
+ */
1
5
  import { Fragment, Node } from 'prosemirror-model';
2
6
  import { EditorView, NodeView } from 'prosemirror-view';
3
7
  import { getFragment } from './Types';
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
- this.dom.childNodes.forEach((n) => this.dom.removeChild(n));
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.id);
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
  };
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @license MIT
3
+ * @copyright Copyright 2025 Modus Operandi Inc. All Rights Reserved.
4
+ */
1
5
  import { Plugin } from 'prosemirror-state';
2
6
  import { Schema } from 'prosemirror-model';
3
7
  import { ReferencingPluginOptions } from './Types';
@@ -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
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @license MIT
3
+ * @copyright Copyright 2025 Modus Operandi Inc. All Rights Reserved.
4
+ */
1
5
  import { Fragment } from 'prosemirror-model';
2
6
  /**
3
7
  * Function that takes the reference id and returns a Promise that
package/Types.js CHANGED
@@ -1 +1,5 @@
1
+ /**
2
+ * @license MIT
3
+ * @copyright Copyright 2025 Modus Operandi Inc. All Rights Reserved.
4
+ */
1
5
  export {};
package/index.d.ts CHANGED
@@ -1,2 +1,6 @@
1
+ /**
2
+ * @license MIT
3
+ * @copyright Copyright 2025 Modus Operandi Inc. All Rights Reserved.
4
+ */
1
5
  export * from './ReferencingPlugin';
2
6
  export * from './Commands';
package/index.js CHANGED
@@ -1,2 +1,6 @@
1
+ /**
2
+ * @license MIT
3
+ * @copyright Copyright 2025 Modus Operandi Inc. All Rights Reserved.
4
+ */
1
5
  export * from './ReferencingPlugin';
2
6
  export * from './Commands';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modusoperandi/licit-referencing",
3
- "version": "1.0.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.0.21",
36
- "@modusoperandi/eslint-config": "^2.1.4",
35
+ "@types/react": "^18.3.27",
36
+ "@modusoperandi/eslint-config": "^3.0.3",
37
37
  "copyfiles": "^2.4.1",
38
- "eslint": "^9.37.0",
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.1.2",
47
- "ts-jest": "^29.0.3",
48
- "ts-node": "^10.2.0",
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.2.0",
53
- "react-dom": "^18.2.0"
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
+ }