@manuscripts/transform 2.2.1 → 2.2.2-LEAN-3514.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.
@@ -36,67 +36,4 @@ exports.bibliographyItem = {
36
36
  },
37
37
  selectable: false,
38
38
  group: 'block',
39
- parseDOM: [
40
- {
41
- tag: 'div.csl-entry',
42
- getAttrs: (p) => {
43
- const dom = p;
44
- return {
45
- id: dom.getAttribute('id'),
46
- type: dom.getAttribute('data-type'),
47
- author: dom.getAttribute('data-author') || undefined,
48
- issued: dom.getAttribute('data-issued') || undefined,
49
- containerTitle: dom.getAttribute('data-container-title') || undefined,
50
- doi: dom.getAttribute('data-doi') || undefined,
51
- volume: dom.getAttribute('data-volume') || undefined,
52
- issue: dom.getAttribute('data-issue') || undefined,
53
- supplement: dom.getAttribute('data-supplement') || undefined,
54
- page: dom.getAttribute('data-page') || undefined,
55
- title: dom.getAttribute('data-title') || undefined,
56
- literal: dom.getAttribute('data-literal') || undefined,
57
- };
58
- },
59
- },
60
- ],
61
- toDOM: (node) => {
62
- const bibliographyItemNode = node;
63
- const attrs = {};
64
- attrs.class = 'csl-entry';
65
- const { id, type, author, issued, containerTitle, doi, volume, issue, supplement, page, title, literal, } = bibliographyItemNode.attrs;
66
- attrs.id = id;
67
- if (type) {
68
- attrs['data-type'] = type;
69
- }
70
- if (author) {
71
- attrs['data-author'] = author.join(',');
72
- }
73
- if (issued) {
74
- attrs['data-issued'] = issued;
75
- }
76
- if (containerTitle) {
77
- attrs['data-container-title'] = containerTitle;
78
- }
79
- if (doi) {
80
- attrs['data-doi'] = doi;
81
- }
82
- if (volume) {
83
- attrs['data-volume'] = volume;
84
- }
85
- if (issue) {
86
- attrs['data-issue'] = issue;
87
- }
88
- if (supplement) {
89
- attrs['data-supplement'] = supplement;
90
- }
91
- if (page) {
92
- attrs['data-page'] = page;
93
- }
94
- if (title) {
95
- attrs['data-title'] = title;
96
- }
97
- if (literal) {
98
- attrs['data-literal'] = literal;
99
- }
100
- return ['div', attrs, 0];
101
- },
102
39
  };
@@ -19,7 +19,7 @@ exports.tableElementFooter = void 0;
19
19
  exports.tableElementFooter = {
20
20
  attrs: {
21
21
  id: { default: '' },
22
- dataTracked: { default: null }
22
+ dataTracked: { default: null },
23
23
  },
24
24
  content: '(paragraph | footnotes_element)*',
25
25
  group: 'block element',
@@ -33,67 +33,4 @@ export const bibliographyItem = {
33
33
  },
34
34
  selectable: false,
35
35
  group: 'block',
36
- parseDOM: [
37
- {
38
- tag: 'div.csl-entry',
39
- getAttrs: (p) => {
40
- const dom = p;
41
- return {
42
- id: dom.getAttribute('id'),
43
- type: dom.getAttribute('data-type'),
44
- author: dom.getAttribute('data-author') || undefined,
45
- issued: dom.getAttribute('data-issued') || undefined,
46
- containerTitle: dom.getAttribute('data-container-title') || undefined,
47
- doi: dom.getAttribute('data-doi') || undefined,
48
- volume: dom.getAttribute('data-volume') || undefined,
49
- issue: dom.getAttribute('data-issue') || undefined,
50
- supplement: dom.getAttribute('data-supplement') || undefined,
51
- page: dom.getAttribute('data-page') || undefined,
52
- title: dom.getAttribute('data-title') || undefined,
53
- literal: dom.getAttribute('data-literal') || undefined,
54
- };
55
- },
56
- },
57
- ],
58
- toDOM: (node) => {
59
- const bibliographyItemNode = node;
60
- const attrs = {};
61
- attrs.class = 'csl-entry';
62
- const { id, type, author, issued, containerTitle, doi, volume, issue, supplement, page, title, literal, } = bibliographyItemNode.attrs;
63
- attrs.id = id;
64
- if (type) {
65
- attrs['data-type'] = type;
66
- }
67
- if (author) {
68
- attrs['data-author'] = author.join(',');
69
- }
70
- if (issued) {
71
- attrs['data-issued'] = issued;
72
- }
73
- if (containerTitle) {
74
- attrs['data-container-title'] = containerTitle;
75
- }
76
- if (doi) {
77
- attrs['data-doi'] = doi;
78
- }
79
- if (volume) {
80
- attrs['data-volume'] = volume;
81
- }
82
- if (issue) {
83
- attrs['data-issue'] = issue;
84
- }
85
- if (supplement) {
86
- attrs['data-supplement'] = supplement;
87
- }
88
- if (page) {
89
- attrs['data-page'] = page;
90
- }
91
- if (title) {
92
- attrs['data-title'] = title;
93
- }
94
- if (literal) {
95
- attrs['data-literal'] = literal;
96
- }
97
- return ['div', attrs, 0];
98
- },
99
36
  };
@@ -16,7 +16,7 @@
16
16
  export const tableElementFooter = {
17
17
  attrs: {
18
18
  id: { default: '' },
19
- dataTracked: { default: null }
19
+ dataTracked: { default: null },
20
20
  },
21
21
  content: '(paragraph | footnotes_element)*',
22
22
  group: 'block element',
@@ -13,13 +13,14 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import { BibliographicDate, BibliographicName } from '@manuscripts/json-schema';
16
17
  import { NodeSpec } from 'prosemirror-model';
17
18
  import { ManuscriptNode } from '../types';
18
19
  interface Attrs {
19
20
  id: string;
20
21
  type: string;
21
- author?: string[];
22
- issued?: string;
22
+ author?: BibliographicName[];
23
+ issued?: BibliographicDate;
23
24
  containerTitle?: string;
24
25
  doi?: string;
25
26
  volume?: string;
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": "2.2.1",
4
+ "version": "2.2.2-LEAN-3514.1",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-transform",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",