@manuscripts/transform 1.1.2 → 1.1.3
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/dist/cjs/schema/nodes/comment.js +3 -0
- package/dist/cjs/transformer/decode.js +3 -0
- package/dist/cjs/transformer/encode.js +4 -2
- package/dist/es/schema/nodes/comment.js +3 -0
- package/dist/es/transformer/decode.js +3 -0
- package/dist/es/transformer/encode.js +4 -2
- package/dist/types/schema/nodes/comment.d.ts +4 -0
- package/package.json +1 -1
|
@@ -362,6 +362,9 @@ const encoders = {
|
|
|
362
362
|
selector: node.attrs.selector,
|
|
363
363
|
target: node.attrs.target,
|
|
364
364
|
contents: node.attrs.contents,
|
|
365
|
+
resolved: node.attrs.resolved,
|
|
366
|
+
contributions: node.attrs.contributions,
|
|
367
|
+
originalText: node.attrs.originalText,
|
|
365
368
|
}),
|
|
366
369
|
footnote: (node, parent) => ({
|
|
367
370
|
containingObject: parent.attrs.id,
|
|
@@ -532,12 +535,11 @@ const encode = (node) => {
|
|
|
532
535
|
if (placeholders.includes(child.type.name)) {
|
|
533
536
|
return;
|
|
534
537
|
}
|
|
535
|
-
const { model
|
|
538
|
+
const { model } = (0, exports.modelFromNode)(child, parent, path, priority);
|
|
536
539
|
if (models.has(model._id)) {
|
|
537
540
|
throw Error(`Encountered duplicate ids in models map while encoding: ${model._id}`);
|
|
538
541
|
}
|
|
539
542
|
models.set(model._id, model);
|
|
540
|
-
commentAnnotationsMap.forEach((val, key) => models.set(key, val));
|
|
541
543
|
child.forEach(addModel(path.concat(child.attrs.id), child));
|
|
542
544
|
};
|
|
543
545
|
node.forEach((cNode) => {
|
|
@@ -354,6 +354,9 @@ const encoders = {
|
|
|
354
354
|
selector: node.attrs.selector,
|
|
355
355
|
target: node.attrs.target,
|
|
356
356
|
contents: node.attrs.contents,
|
|
357
|
+
resolved: node.attrs.resolved,
|
|
358
|
+
contributions: node.attrs.contributions,
|
|
359
|
+
originalText: node.attrs.originalText,
|
|
357
360
|
}),
|
|
358
361
|
footnote: (node, parent) => ({
|
|
359
362
|
containingObject: parent.attrs.id,
|
|
@@ -523,12 +526,11 @@ export const encode = (node) => {
|
|
|
523
526
|
if (placeholders.includes(child.type.name)) {
|
|
524
527
|
return;
|
|
525
528
|
}
|
|
526
|
-
const { model
|
|
529
|
+
const { model } = modelFromNode(child, parent, path, priority);
|
|
527
530
|
if (models.has(model._id)) {
|
|
528
531
|
throw Error(`Encountered duplicate ids in models map while encoding: ${model._id}`);
|
|
529
532
|
}
|
|
530
533
|
models.set(model._id, model);
|
|
531
|
-
commentAnnotationsMap.forEach((val, key) => models.set(key, val));
|
|
532
534
|
child.forEach(addModel(path.concat(child.attrs.id), child));
|
|
533
535
|
};
|
|
534
536
|
node.forEach((cNode) => {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { Contribution } from '@manuscripts/json-schema';
|
|
16
17
|
import { NodeSpec } from 'prosemirror-model';
|
|
17
18
|
import { ManuscriptNode } from '../types';
|
|
18
19
|
interface Attrs {
|
|
@@ -23,6 +24,9 @@ interface Attrs {
|
|
|
23
24
|
from: number;
|
|
24
25
|
to: number;
|
|
25
26
|
};
|
|
27
|
+
resolved?: boolean;
|
|
28
|
+
contributions?: Contribution[];
|
|
29
|
+
originalText?: string;
|
|
26
30
|
}
|
|
27
31
|
export interface CommentNode extends ManuscriptNode {
|
|
28
32
|
attrs: Attrs;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/transform",
|
|
3
3
|
"description": "ProseMirror transformer for Manuscripts applications",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.3",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|