@elisra-devops/docgen-skins 0.10.8 → 0.10.9
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/bin/index.js +3 -3
- package/bin/index.js.map +1 -1
- package/bin/models/json/JSONRun.js +39 -35
- package/bin/models/json/JSONRun.js.map +1 -1
- package/bin/models/json/default.js +12 -9
- package/bin/models/json/default.js.map +1 -1
- package/bin/models/json/paragraph/JSONRichTextParagraph.d.ts +134 -2
- package/bin/models/json/paragraph/JSONRichTextParagraph.js +402 -53
- package/bin/models/json/paragraph/JSONRichTextParagraph.js.map +1 -1
- package/bin/models/json/wordJsonModels.d.ts +41 -4
- package/package.json +1 -1
- package/src/index.ts +3 -9
- package/src/models/json/JSONRun.ts +36 -32
- package/src/models/json/default.ts +12 -9
- package/src/models/json/paragraph/JSONRichTextParagraph.ts +428 -405
- package/src/models/json/wordJsonModels.ts +49 -4
|
@@ -29,45 +29,49 @@ export default class JSONRun {
|
|
|
29
29
|
if (fieldtype !== 'SuiteHeaderParagraphTitle') {
|
|
30
30
|
text = `${striphtml(text.toString(), { cb: replaceBr })}` || '';
|
|
31
31
|
}
|
|
32
|
-
run.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
if (run.type === 'text') {
|
|
33
|
+
run.value = text;
|
|
34
|
+
run.textStyling.Bold = style.isBold;
|
|
35
|
+
run.textStyling.Italic = style.IsItalic;
|
|
36
|
+
run.textStyling.Underline = style.IsUnderline;
|
|
37
|
+
run.textStyling.Size = style.Size;
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
if (run.textStyling.Uri === '') {
|
|
40
|
+
run.textStyling.Uri = null;
|
|
41
|
+
} else {
|
|
42
|
+
run.textStyling.Uri = style.Uri;
|
|
43
|
+
}
|
|
44
|
+
run.textStyling.Font = style.Font;
|
|
45
|
+
if (rowArray.length == 1) {
|
|
46
|
+
run.textStyling.InsertLineBreak = style.InsertLineBreak;
|
|
47
|
+
} else {
|
|
48
|
+
run.textStyling.InsertLineBreak = false;
|
|
49
|
+
}
|
|
50
|
+
if (rowArray.length - 1 == i) {
|
|
51
|
+
run.textStyling.InsertLineBreak = style.InsertLineBreak;
|
|
52
|
+
}
|
|
53
|
+
run.textStyling.InsertSpace = style.InsertSpace;
|
|
54
|
+
runs.push(JSON.parse(JSON.stringify(run)));
|
|
48
55
|
}
|
|
49
|
-
if (rowArray.length - 1 == i) {
|
|
50
|
-
run.InsertLineBreak = style.InsertLineBreak;
|
|
51
|
-
}
|
|
52
|
-
run.InsertSpace = style.InsertSpace;
|
|
53
|
-
runs.push(JSON.parse(JSON.stringify(run)));
|
|
54
56
|
});
|
|
55
57
|
} catch (e) {
|
|
56
58
|
logger.silly(`${value} - cannot be splitted`);
|
|
57
59
|
runs[0] = defaultJsonRun;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
runs[0].Uri
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
if (defaultJsonRun.type === 'text') {
|
|
61
|
+
runs[0].value = value ? `${striphtml(value.toString(), { cb: replaceBr })}` : ``;
|
|
62
|
+
runs[0].textStyling.Bold = style.isBold;
|
|
63
|
+
runs[0].textStyling.Italic = style.IsItalic;
|
|
64
|
+
runs[0].textStyling.Underline = style.IsUnderline;
|
|
65
|
+
runs[0].textStyling.Size = style.Size;
|
|
66
|
+
if (runs[0].textStyling.Uri === '') {
|
|
67
|
+
runs[0].textStyling.Uri = null;
|
|
68
|
+
} else {
|
|
69
|
+
runs[0].textStyling.Uri = style.Uri;
|
|
70
|
+
}
|
|
71
|
+
runs[0].textStyling.Font = style.Font;
|
|
72
|
+
runs[0].textStyling.InsertLineBreak = style.InsertLineBreak;
|
|
73
|
+
runs[0].textStyling.InsertSpace = style.InsertSpace;
|
|
67
74
|
}
|
|
68
|
-
runs[0].Font = style.Font;
|
|
69
|
-
runs[0].InsertLineBreak = style.InsertLineBreak;
|
|
70
|
-
runs[0].InsertSpace = style.InsertSpace;
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
return runs;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { Run, StyleOptions } from './wordJsonModels';
|
|
2
2
|
|
|
3
3
|
export let defaultJsonRun: Run = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
type: 'text',
|
|
5
|
+
value: ``,
|
|
6
|
+
textStyling: {
|
|
7
|
+
Bold: false,
|
|
8
|
+
Italic: false,
|
|
9
|
+
Underline: false,
|
|
10
|
+
Size: 12,
|
|
11
|
+
Uri: null,
|
|
12
|
+
Font: 'Arial',
|
|
13
|
+
InsertLineBreak: false,
|
|
14
|
+
InsertSpace: true,
|
|
15
|
+
},
|
|
13
16
|
};
|
|
14
17
|
|
|
15
18
|
export let DescriptionandProcedureStyle: StyleOptions = {
|