@gmb/bitmark-parser-generator 5.9.0 → 5.10.0
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/LICENSE +6 -2
- package/dist/browser/bitmark-parser-generator.min.js +1 -1
- package/dist/browser/bundle-report.html +2 -2
- package/dist/browser/cjs/index.cjs +96 -83
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +12 -8
- package/dist/browser/esm/index.d.ts +12 -8
- package/dist/browser/esm/index.js +96 -83
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/cli/main.js +96 -83
- package/dist/cli/main.js.map +1 -1
- package/dist/index.cjs +96 -83
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -8
- package/dist/index.d.ts +12 -8
- package/dist/index.js +96 -83
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8"/>
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
6
|
-
<title>@gmb/bitmark-parser-generator [
|
|
6
|
+
<title>@gmb/bitmark-parser-generator [11 Feb 2026 at 02:19]</title>
|
|
7
7
|
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
|
|
8
8
|
|
|
9
9
|
<script>
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<body>
|
|
32
32
|
<div id="app"></div>
|
|
33
33
|
<script>
|
|
34
|
-
window.chartData = [{"label":"bitmark-parser-generator.min.js","isAsset":true,"statSize":
|
|
34
|
+
window.chartData = [{"label":"bitmark-parser-generator.min.js","isAsset":true,"statSize":1266612,"parsedSize":552813,"gzipSize":107428,"groups":[{"label":"dist/browser/cjs","path":"./dist/browser/cjs","statSize":1260550,"groups":[{"id":922,"label":"index.cjs","path":"./dist/browser/cjs/index.cjs","statSize":1260550,"parsedSize":552709,"gzipSize":107428}],"parsedSize":552709,"gzipSize":107428},{"label":"node_modules/@ncoderz/superenum/dist","path":"./node_modules/@ncoderz/superenum/dist","statSize":6062,"groups":[{"id":722,"label":"index.cjs","path":"./node_modules/@ncoderz/superenum/dist/index.cjs","statSize":6062}],"parsedSize":0,"gzipSize":0}],"isInitialByEntrypoint":{"main":true}}];
|
|
35
35
|
window.entrypoints = ["main"];
|
|
36
36
|
window.defaultSizes = "stat";
|
|
37
37
|
window.compressionAlgorithm = "gzip";
|
|
@@ -738,8 +738,10 @@ var TagFormat = {
|
|
|
738
738
|
// If the value is treated as a number
|
|
739
739
|
boolean: "boolean",
|
|
740
740
|
// If the value is treated as a boolean
|
|
741
|
-
invertedBoolean: "invertedBoolean"
|
|
741
|
+
invertedBoolean: "invertedBoolean",
|
|
742
742
|
// If the value is treated as a boolean with the value inverted (e.g. isLongAnswer ==> isShortAnswer = false)
|
|
743
|
+
enumeration: "enumeration"
|
|
744
|
+
// If the value is treated as an enumeration (the value is a string that must be one of a predefined set of values)
|
|
743
745
|
};
|
|
744
746
|
|
|
745
747
|
// src/model/enum/TextFormat.ts
|
|
@@ -883,9 +885,12 @@ var PropertyTagConfig = class extends AbstractTagConfig {
|
|
|
883
885
|
// If the property is treated as an array rather than a single value
|
|
884
886
|
__publicField(this, "format");
|
|
885
887
|
// How the property is formatted
|
|
888
|
+
__publicField(this, "values");
|
|
889
|
+
// If the format is an enumeration, the possible values of the property
|
|
886
890
|
__publicField(this, "defaultValue");
|
|
887
891
|
this.array = params.maxCount === Count.infinity || params.maxCount > 1;
|
|
888
892
|
this.format = params.format;
|
|
893
|
+
this.values = params.values;
|
|
889
894
|
this.defaultValue = params.defaultValue;
|
|
890
895
|
}
|
|
891
896
|
toString(options) {
|
|
@@ -897,6 +902,7 @@ var PropertyTagConfig = class extends AbstractTagConfig {
|
|
|
897
902
|
if (this.minCount != null) s += `, min=${this.minCount}`;
|
|
898
903
|
if (this.array != null) s += `, arr=${this.array}`;
|
|
899
904
|
if (this.format != null) s += `, fmt=${this.format}`;
|
|
905
|
+
if (this.values != null) s += `, vals=[${this.values.join(",")}]`;
|
|
900
906
|
if (this.defaultValue != null) s += `, def=${this.defaultValue}`;
|
|
901
907
|
if (this.jsonKey != null) s += `, json=${this.jsonKey}`;
|
|
902
908
|
}
|
|
@@ -1190,7 +1196,6 @@ var propertyKeys = {
|
|
|
1190
1196
|
property_aiGenerated: "@aiGenerated",
|
|
1191
1197
|
property_allowedBit: "@allowedBit",
|
|
1192
1198
|
property_allowPrint: "@allowPrint",
|
|
1193
|
-
property_allowPrintEnforceSpaceConfiguration: "@allowPrintEnforceSpaceConfiguration",
|
|
1194
1199
|
property_allowSubtitles: "@allowSubtitles",
|
|
1195
1200
|
property_alt: "@alt",
|
|
1196
1201
|
property_altLangTag: "@altLangTag",
|
|
@@ -2510,27 +2515,6 @@ var CARDSETS = {
|
|
|
2510
2515
|
]
|
|
2511
2516
|
},
|
|
2512
2517
|
[CardSetConfigKey.table]: {
|
|
2513
|
-
variants: [
|
|
2514
|
-
// Side 1
|
|
2515
|
-
[
|
|
2516
|
-
// Variant 1..N
|
|
2517
|
-
{
|
|
2518
|
-
tags: [
|
|
2519
|
-
{
|
|
2520
|
-
key: ConfigKey.group_standardItemLeadInstructionHint,
|
|
2521
|
-
description: "Standard tags for lead, instruction, and hint."
|
|
2522
|
-
},
|
|
2523
|
-
{
|
|
2524
|
-
key: ConfigKey.tag_title,
|
|
2525
|
-
description: "Title of the table."
|
|
2526
|
-
}
|
|
2527
|
-
],
|
|
2528
|
-
repeatCount: Count.infinity
|
|
2529
|
-
}
|
|
2530
|
-
]
|
|
2531
|
-
]
|
|
2532
|
-
},
|
|
2533
|
-
[CardSetConfigKey.tableExtended]: {
|
|
2534
2518
|
variants: [
|
|
2535
2519
|
// Side 1
|
|
2536
2520
|
[
|
|
@@ -3492,14 +3476,9 @@ var GROUPS = {
|
|
|
3492
3476
|
{
|
|
3493
3477
|
key: ConfigKey.property_allowPrint,
|
|
3494
3478
|
description: "If true, the book allows printing",
|
|
3495
|
-
format: TagFormat.
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
{
|
|
3499
|
-
key: ConfigKey.property_allowPrintEnforceSpaceConfiguration,
|
|
3500
|
-
description: "If true, enforces space configuration for printing regardless of the allowPrint setting",
|
|
3501
|
-
format: TagFormat.boolean,
|
|
3502
|
-
defaultValue: "false"
|
|
3479
|
+
format: TagFormat.enumeration,
|
|
3480
|
+
values: ["enforceFalse", "enforceTrue", "useSpaceConfiguration"],
|
|
3481
|
+
defaultValue: "enforceFalse"
|
|
3503
3482
|
},
|
|
3504
3483
|
{
|
|
3505
3484
|
key: ConfigKey.property_hasPrintRestriction,
|
|
@@ -4475,6 +4454,7 @@ var ConfigHydrator = class {
|
|
|
4475
4454
|
chain: _chain,
|
|
4476
4455
|
deprecated,
|
|
4477
4456
|
format,
|
|
4457
|
+
values,
|
|
4478
4458
|
defaultValue,
|
|
4479
4459
|
jsonKey
|
|
4480
4460
|
} = _tag;
|
|
@@ -4493,6 +4473,7 @@ var ConfigHydrator = class {
|
|
|
4493
4473
|
chain,
|
|
4494
4474
|
jsonKey,
|
|
4495
4475
|
format,
|
|
4476
|
+
values,
|
|
4496
4477
|
defaultValue,
|
|
4497
4478
|
deprecated
|
|
4498
4479
|
});
|
|
@@ -7896,15 +7877,35 @@ var BITS = {
|
|
|
7896
7877
|
},
|
|
7897
7878
|
[BitType.tableImage]: {
|
|
7898
7879
|
since: "1.5.15",
|
|
7899
|
-
baseBitType: BitType.
|
|
7880
|
+
baseBitType: BitType.table,
|
|
7900
7881
|
description: "Table image bit, used to create images in tables in articles or books",
|
|
7901
7882
|
tags: [
|
|
7902
7883
|
{
|
|
7903
7884
|
key: ConfigKey.property_caption,
|
|
7904
7885
|
description: "Caption for the table image, used to provide a description for the image",
|
|
7905
7886
|
format: TagFormat.bitmarkText
|
|
7887
|
+
},
|
|
7888
|
+
{
|
|
7889
|
+
key: ConfigKey.resource_backgroundWallpaper,
|
|
7890
|
+
description: "Background wallpaper for the image, used to set a background for the image",
|
|
7891
|
+
chain: [
|
|
7892
|
+
{
|
|
7893
|
+
key: ConfigKey.group_resourceImageCommon,
|
|
7894
|
+
description: "Common resource image tags for images"
|
|
7895
|
+
}
|
|
7896
|
+
]
|
|
7897
|
+
},
|
|
7898
|
+
{
|
|
7899
|
+
key: ConfigKey.group_resourceBitTags,
|
|
7900
|
+
description: "Resource bit tags for images, used to define additional properties for images"
|
|
7901
|
+
},
|
|
7902
|
+
{
|
|
7903
|
+
key: ConfigKey.group_resourceImage,
|
|
7904
|
+
description: "Resource image tags for images, used to attach images to the bit",
|
|
7905
|
+
minCount: 1
|
|
7906
7906
|
}
|
|
7907
|
-
]
|
|
7907
|
+
],
|
|
7908
|
+
resourceAttachmentAllowed: false
|
|
7908
7909
|
},
|
|
7909
7910
|
[BitType.tableImageAlt]: {
|
|
7910
7911
|
since: "1.16.0",
|
|
@@ -9424,8 +9425,7 @@ var BITS = {
|
|
|
9424
9425
|
[BitType.tableExtended]: {
|
|
9425
9426
|
since: "4.14.0",
|
|
9426
9427
|
baseBitType: BitType.table,
|
|
9427
|
-
description: "Extended table bit, used to create complex tables with all HTML table features"
|
|
9428
|
-
cardSet: CardSetConfigKey.tableExtended
|
|
9428
|
+
description: "Extended table bit, used to create complex tables with all HTML table features"
|
|
9429
9429
|
},
|
|
9430
9430
|
[BitType.tableAlt]: {
|
|
9431
9431
|
since: "1.16.0",
|
|
@@ -10449,7 +10449,7 @@ var instance2 = new Config();
|
|
|
10449
10449
|
// src/generated/package_info.ts
|
|
10450
10450
|
var PACKAGE_INFO = {
|
|
10451
10451
|
"name": "@gmb/bitmark-parser-generator",
|
|
10452
|
-
"version": "5.
|
|
10452
|
+
"version": "5.10.0",
|
|
10453
10453
|
"author": "Get More Brain Ltd",
|
|
10454
10454
|
"license": "ISC",
|
|
10455
10455
|
"description": "A bitmark parser and generator using Peggy.js"
|
|
@@ -11070,6 +11070,8 @@ var NodeType = {
|
|
|
11070
11070
|
indexValue: "indexValue",
|
|
11071
11071
|
ingredients: "ingredients",
|
|
11072
11072
|
ingredientsValue: "ingredientsValue",
|
|
11073
|
+
ingredient: "ingredient",
|
|
11074
|
+
ingredientValue: "ingredientValue",
|
|
11073
11075
|
instruction: "instruction",
|
|
11074
11076
|
instructionValue: "instructionValue",
|
|
11075
11077
|
internalComment: "internalComment",
|
|
@@ -11382,6 +11384,7 @@ var NodeType = {
|
|
|
11382
11384
|
srcAltValue: "srcAltValue",
|
|
11383
11385
|
start: "start",
|
|
11384
11386
|
statement: "statement",
|
|
11387
|
+
statementValue: "statementValue",
|
|
11385
11388
|
statements: "statements",
|
|
11386
11389
|
statementsValue: "statementsValue",
|
|
11387
11390
|
statementText: "statementText",
|
|
@@ -12048,7 +12051,7 @@ function normalizeTableFormat(bitType, table) {
|
|
|
12048
12051
|
delete t.columns;
|
|
12049
12052
|
delete t.data;
|
|
12050
12053
|
}
|
|
12051
|
-
const isExtended = instance2.isOfBitType(bitType, BitType.tableExtended);
|
|
12054
|
+
const isExtended = instance2.isOfBitType(bitType, BitType.tableExtended) || instance2.isOfBitType(bitType, BitType.tableImage);
|
|
12052
12055
|
if (isExtended && isTableBasicFormat(table)) {
|
|
12053
12056
|
return convertBasicToExtendedTableFormat(table);
|
|
12054
12057
|
}
|
|
@@ -25012,12 +25015,6 @@ var Builder = class extends BaseBuilder {
|
|
|
25012
25015
|
data.allowPrint,
|
|
25013
25016
|
options
|
|
25014
25017
|
),
|
|
25015
|
-
allowPrintEnforceSpaceConfiguration: this.toAstProperty(
|
|
25016
|
-
bitType,
|
|
25017
|
-
ConfigKey.property_allowPrintEnforceSpaceConfiguration,
|
|
25018
|
-
data.allowPrintEnforceSpaceConfiguration,
|
|
25019
|
-
options
|
|
25020
|
-
),
|
|
25021
25018
|
printParentChapterLevel: this.toAstProperty(
|
|
25022
25019
|
bitType,
|
|
25023
25020
|
ConfigKey.property_printParentChapterLevel,
|
|
@@ -27390,7 +27387,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27390
27387
|
if (parent?.key !== NodeType.bitsValue) return true;
|
|
27391
27388
|
for (const gt of groupTag) {
|
|
27392
27389
|
const { name, tags: tags2 } = gt;
|
|
27393
|
-
this.writeNL();
|
|
27394
27390
|
this.writeProperty("groupTag", name, route, {
|
|
27395
27391
|
format: TagFormat.plainText,
|
|
27396
27392
|
writeEmpty: true
|
|
@@ -27399,7 +27395,8 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27399
27395
|
for (const t of tags2) {
|
|
27400
27396
|
this.writeProperty("tag", t, route, {
|
|
27401
27397
|
format: TagFormat.plainText,
|
|
27402
|
-
writeEmpty: true
|
|
27398
|
+
writeEmpty: true,
|
|
27399
|
+
forceChain: true
|
|
27403
27400
|
});
|
|
27404
27401
|
}
|
|
27405
27402
|
}
|
|
@@ -27407,7 +27404,7 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27407
27404
|
return false;
|
|
27408
27405
|
}
|
|
27409
27406
|
// bitmarkAst -> bits -> bitsValue -> labelTrue / labelFalse
|
|
27410
|
-
|
|
27407
|
+
leaf_labelTrue(node, route) {
|
|
27411
27408
|
const value = node.value;
|
|
27412
27409
|
const parent = this.getParentNode(route);
|
|
27413
27410
|
if (parent?.key !== NodeType.bitsValue) return true;
|
|
@@ -27420,16 +27417,18 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27420
27417
|
}
|
|
27421
27418
|
if (haveTrue)
|
|
27422
27419
|
this.writeProperty("labelTrue", value, route, {
|
|
27423
|
-
format: TagFormat.plainText
|
|
27420
|
+
format: TagFormat.plainText,
|
|
27421
|
+
forceChain: true
|
|
27424
27422
|
});
|
|
27425
27423
|
if (haveFalse)
|
|
27426
27424
|
this.writeProperty("labelFalse", bit.labelFalse, route, {
|
|
27427
|
-
format: TagFormat.plainText
|
|
27425
|
+
format: TagFormat.plainText,
|
|
27426
|
+
forceChain: true
|
|
27428
27427
|
});
|
|
27429
27428
|
}
|
|
27430
27429
|
return false;
|
|
27431
27430
|
}
|
|
27432
|
-
|
|
27431
|
+
leaf_labelFalse(_node, _route) {
|
|
27433
27432
|
return true;
|
|
27434
27433
|
}
|
|
27435
27434
|
// bitmarkAst -> bits -> bitsValue -> imageSource
|
|
@@ -27438,26 +27437,29 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27438
27437
|
const parent = this.getParentNode(route);
|
|
27439
27438
|
if (parent?.key !== NodeType.bitsValue) return true;
|
|
27440
27439
|
const { url, mockupId, size, format, trim } = imageSource;
|
|
27441
|
-
this.writeNL();
|
|
27442
27440
|
this.writeProperty("imageSource", url, route, {
|
|
27443
27441
|
format: TagFormat.plainText
|
|
27444
27442
|
});
|
|
27445
27443
|
if (url) {
|
|
27446
27444
|
if (mockupId)
|
|
27447
27445
|
this.writeProperty("mockupId", mockupId, route, {
|
|
27448
|
-
format: TagFormat.plainText
|
|
27446
|
+
format: TagFormat.plainText,
|
|
27447
|
+
forceChain: true
|
|
27449
27448
|
});
|
|
27450
27449
|
if (size)
|
|
27451
27450
|
this.writeProperty("size", size, route, {
|
|
27452
|
-
format: TagFormat.plainText
|
|
27451
|
+
format: TagFormat.plainText,
|
|
27452
|
+
forceChain: true
|
|
27453
27453
|
});
|
|
27454
27454
|
if (format)
|
|
27455
27455
|
this.writeProperty("format", format, route, {
|
|
27456
|
-
format: TagFormat.plainText
|
|
27456
|
+
format: TagFormat.plainText,
|
|
27457
|
+
forceChain: true
|
|
27457
27458
|
});
|
|
27458
27459
|
if (instance5.isBoolean(trim))
|
|
27459
27460
|
this.writeProperty("trim", trim, route, {
|
|
27460
|
-
format: TagFormat.plainText
|
|
27461
|
+
format: TagFormat.plainText,
|
|
27462
|
+
forceChain: true
|
|
27461
27463
|
});
|
|
27462
27464
|
}
|
|
27463
27465
|
return false;
|
|
@@ -27468,13 +27470,13 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27468
27470
|
const parent = this.getParentNode(route);
|
|
27469
27471
|
if (parent?.key !== NodeType.bitsValue) return true;
|
|
27470
27472
|
const { technicalTerm, lang } = nodeValue;
|
|
27471
|
-
this.writeNL();
|
|
27472
27473
|
this.writeProperty("technicalTerm", technicalTerm, route, {
|
|
27473
27474
|
format: TagFormat.plainText
|
|
27474
27475
|
});
|
|
27475
27476
|
if (lang != null) {
|
|
27476
27477
|
this.writeProperty("lang", lang, route, {
|
|
27477
|
-
format: TagFormat.plainText
|
|
27478
|
+
format: TagFormat.plainText,
|
|
27479
|
+
forceChain: true
|
|
27478
27480
|
});
|
|
27479
27481
|
}
|
|
27480
27482
|
return false;
|
|
@@ -27485,28 +27487,31 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27485
27487
|
const parent = this.getParentNode(route);
|
|
27486
27488
|
if (parent?.key !== NodeType.bitsValue) return true;
|
|
27487
27489
|
const { servings, unit, unitAbbr, decimalPlaces, disableCalculation, hint } = nodeValue;
|
|
27488
|
-
this.writeNL();
|
|
27489
27490
|
this.writeProperty("servings", servings, route, {
|
|
27490
27491
|
format: TagFormat.plainText
|
|
27491
27492
|
});
|
|
27492
27493
|
if (unit != null) {
|
|
27493
27494
|
this.writeProperty("unit", unit, route, {
|
|
27494
|
-
format: TagFormat.plainText
|
|
27495
|
+
format: TagFormat.plainText,
|
|
27496
|
+
forceChain: true
|
|
27495
27497
|
});
|
|
27496
27498
|
}
|
|
27497
27499
|
if (unitAbbr != null) {
|
|
27498
27500
|
this.writeProperty("unitAbbr", unitAbbr, route, {
|
|
27499
|
-
format: TagFormat.plainText
|
|
27501
|
+
format: TagFormat.plainText,
|
|
27502
|
+
forceChain: true
|
|
27500
27503
|
});
|
|
27501
27504
|
}
|
|
27502
27505
|
if (decimalPlaces != null) {
|
|
27503
27506
|
this.writeProperty("decimalPlaces", decimalPlaces, route, {
|
|
27504
|
-
format: TagFormat.plainText
|
|
27507
|
+
format: TagFormat.plainText,
|
|
27508
|
+
forceChain: true
|
|
27505
27509
|
});
|
|
27506
27510
|
}
|
|
27507
27511
|
if (disableCalculation != null) {
|
|
27508
27512
|
this.writeProperty("disableCalculation", disableCalculation, route, {
|
|
27509
|
-
format: TagFormat.plainText
|
|
27513
|
+
format: TagFormat.plainText,
|
|
27514
|
+
forceChain: true
|
|
27510
27515
|
});
|
|
27511
27516
|
}
|
|
27512
27517
|
if (hint != null) {
|
|
@@ -27522,13 +27527,13 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27522
27527
|
const parent = this.getParentNode(route);
|
|
27523
27528
|
if (parent?.key !== NodeType.bitsValue) return true;
|
|
27524
27529
|
const { name, title, avatarImage } = person;
|
|
27525
|
-
this.writeNL();
|
|
27526
27530
|
this.writeProperty("person", name, route, {
|
|
27527
27531
|
format: TagFormat.plainText
|
|
27528
27532
|
});
|
|
27529
27533
|
if (title) {
|
|
27530
27534
|
this.writeProperty("title", title, route, {
|
|
27531
|
-
format: TagFormat.plainText
|
|
27535
|
+
format: TagFormat.plainText,
|
|
27536
|
+
forceChain: true
|
|
27532
27537
|
});
|
|
27533
27538
|
}
|
|
27534
27539
|
if (avatarImage) {
|
|
@@ -27576,7 +27581,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27576
27581
|
if (parent.key !== NodeType.term && parent.key !== NodeType.definition && parent.key !== NodeType.alternativeDefinitionsValue && parent.key !== NodeType.question && parent.key !== NodeType.answer && parent.key !== NodeType.alternativeAnswersValue) {
|
|
27577
27582
|
return true;
|
|
27578
27583
|
}
|
|
27579
|
-
this.writeNL();
|
|
27580
27584
|
this.writeResource(ResourceType.icon, resource.image.src);
|
|
27581
27585
|
return true;
|
|
27582
27586
|
}
|
|
@@ -27604,13 +27608,13 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27604
27608
|
if (parent?.key !== NodeType.bitsValue) return true;
|
|
27605
27609
|
const { level, label } = n;
|
|
27606
27610
|
const levelKey = node.key === NodeType.ratingLevelStart ? "ratingLevelStart" : "ratingLevelEnd";
|
|
27607
|
-
this.writeNL();
|
|
27608
27611
|
this.writeProperty(levelKey, level, route, {
|
|
27609
27612
|
format: TagFormat.plainText
|
|
27610
27613
|
});
|
|
27611
27614
|
if (label) {
|
|
27612
27615
|
this.writeProperty("label", label, route, {
|
|
27613
|
-
format: TagFormat.bitmarkText
|
|
27616
|
+
format: TagFormat.bitmarkText,
|
|
27617
|
+
forceChain: true
|
|
27614
27618
|
});
|
|
27615
27619
|
}
|
|
27616
27620
|
return false;
|
|
@@ -27632,12 +27636,14 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27632
27636
|
});
|
|
27633
27637
|
if (color) {
|
|
27634
27638
|
this.writeProperty("color", color, route, {
|
|
27635
|
-
format: TagFormat.plainText
|
|
27639
|
+
format: TagFormat.plainText,
|
|
27640
|
+
forceChain: true
|
|
27636
27641
|
});
|
|
27637
27642
|
}
|
|
27638
27643
|
if (emphasis) {
|
|
27639
27644
|
this.writeProperty("emphasis", emphasis, route, {
|
|
27640
|
-
format: TagFormat.plainText
|
|
27645
|
+
format: TagFormat.plainText,
|
|
27646
|
+
forceChain: true
|
|
27641
27647
|
});
|
|
27642
27648
|
}
|
|
27643
27649
|
}
|
|
@@ -27646,7 +27652,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27646
27652
|
// bitmarkAst -> bits -> bitsValue -> partialAnswer
|
|
27647
27653
|
enter_partialAnswer(node, route) {
|
|
27648
27654
|
if (node.value) {
|
|
27649
|
-
this.writeNL();
|
|
27650
27655
|
this.writeProperty("partialAnswer", node.value, route, {
|
|
27651
27656
|
format: TagFormat.plainText
|
|
27652
27657
|
});
|
|
@@ -27656,7 +27661,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27656
27661
|
// bitmarkAst -> bits -> bitsValue -> questions -> questionsValue -> partialAnswer
|
|
27657
27662
|
leaf_partialAnswer(node, route) {
|
|
27658
27663
|
if (node.value) {
|
|
27659
|
-
this.writeNL();
|
|
27660
27664
|
this.writeProperty("partialAnswer", node.value, route, {
|
|
27661
27665
|
format: TagFormat.plainText
|
|
27662
27666
|
});
|
|
@@ -27667,7 +27671,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27667
27671
|
// bitmarkAst -> bits -> bitsValue -> questions -> questionsValue -> sampleSolution
|
|
27668
27672
|
enter_sampleSolution(node, route) {
|
|
27669
27673
|
if (node.value) {
|
|
27670
|
-
this.writeNL();
|
|
27671
27674
|
this.writeProperty("sampleSolution", node.value, route, {
|
|
27672
27675
|
format: TagFormat.plainText
|
|
27673
27676
|
});
|
|
@@ -27676,7 +27679,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27676
27679
|
}
|
|
27677
27680
|
leaf_sampleSolution(node, route) {
|
|
27678
27681
|
if (node.value) {
|
|
27679
|
-
this.writeNL();
|
|
27680
27682
|
this.writeProperty("sampleSolution", node.value, route, {
|
|
27681
27683
|
format: TagFormat.plainText
|
|
27682
27684
|
});
|
|
@@ -27686,7 +27688,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27686
27688
|
// bitmarkAst -> bits -> bitsValue -> reasonableNumOfChars
|
|
27687
27689
|
// bitmarkAst -> bits -> bitsValue -> questions -> questionsValue -> reasonableNumOfChars
|
|
27688
27690
|
leaf_reasonableNumOfChars(node, route) {
|
|
27689
|
-
this.writeNL();
|
|
27690
27691
|
this.writeProperty("reasonableNumOfChars", node.value, route, {
|
|
27691
27692
|
format: TagFormat.plainText
|
|
27692
27693
|
});
|
|
@@ -28693,7 +28694,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
28693
28694
|
// bitmarkAst -> bits -> bitsValue -> * -> lang
|
|
28694
28695
|
leaf_lang(node, route) {
|
|
28695
28696
|
if (!node.value) return;
|
|
28696
|
-
this.writeNL();
|
|
28697
28697
|
this.writeProperty("lang", node.value, route, {
|
|
28698
28698
|
format: TagFormat.boolean
|
|
28699
28699
|
});
|
|
@@ -28701,7 +28701,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
28701
28701
|
// bitmarkAst -> bits -> bitsValue -> * -> refAuthor
|
|
28702
28702
|
enter_refAuthor(node, route) {
|
|
28703
28703
|
if (!node.value) return;
|
|
28704
|
-
this.writeNL();
|
|
28705
28704
|
this.writeProperty("refAuthor", node.value, route, {
|
|
28706
28705
|
format: TagFormat.plainText,
|
|
28707
28706
|
array: true
|
|
@@ -28710,7 +28709,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
28710
28709
|
// bitmarkAst -> bits -> bitsValue -> * -> refBookTitle
|
|
28711
28710
|
leaf_refBookTitle(node, route) {
|
|
28712
28711
|
if (!node.value) return;
|
|
28713
|
-
this.writeNL();
|
|
28714
28712
|
this.writeProperty("refBookTitle", node.value, route, {
|
|
28715
28713
|
format: TagFormat.plainText,
|
|
28716
28714
|
array: true
|
|
@@ -28719,7 +28717,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
28719
28717
|
// bitmarkAst -> bits -> bitsValue -> * -> refPublisher
|
|
28720
28718
|
enter_refPublisher(node, route) {
|
|
28721
28719
|
if (!node.value) return;
|
|
28722
|
-
this.writeNL();
|
|
28723
28720
|
this.writeProperty("refPublisher", node.value, route, {
|
|
28724
28721
|
format: TagFormat.plainText,
|
|
28725
28722
|
array: true
|
|
@@ -28728,7 +28725,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
28728
28725
|
// bitmarkAst -> bits -> bitsValue -> * -> refPublicationYear
|
|
28729
28726
|
leaf_refPublicationYear(node, route) {
|
|
28730
28727
|
if (!node.value) return;
|
|
28731
|
-
this.writeNL();
|
|
28732
28728
|
this.writeProperty("refPublicationYear", node.value, route, {
|
|
28733
28729
|
format: TagFormat.plainText
|
|
28734
28730
|
});
|
|
@@ -28736,7 +28732,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
28736
28732
|
// bitmarkAst -> bits -> bitsValue -> * -> citationStyle
|
|
28737
28733
|
leaf_citationStyle(node, route) {
|
|
28738
28734
|
if (!node.value) return;
|
|
28739
|
-
this.writeNL();
|
|
28740
28735
|
this.writeProperty("citationStyle", node.value, route, {
|
|
28741
28736
|
format: TagFormat.plainText
|
|
28742
28737
|
});
|
|
@@ -29068,7 +29063,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
29068
29063
|
const config = instance2.getBitConfig(bitType);
|
|
29069
29064
|
const propertyConfig = instance2.getTagConfigForTag(config.tags, propertyConfigKey);
|
|
29070
29065
|
if (!propertyConfig) return;
|
|
29071
|
-
this.writeNL_IfNotChain(route);
|
|
29072
29066
|
this.writeProperty(propertyConfig.tag, node.value, route, {
|
|
29073
29067
|
format: propertyConfig.format ?? TagFormat.plainText,
|
|
29074
29068
|
array: propertyConfig.array ?? false,
|
|
@@ -29452,7 +29446,7 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
29452
29446
|
if (options.ignoreFalse && val === false) continue;
|
|
29453
29447
|
if (options.ignoreTrue && val === true) continue;
|
|
29454
29448
|
if (!options.writeEmpty && val === "") continue;
|
|
29455
|
-
if (propertyIndex
|
|
29449
|
+
if (!options.forceChain && propertyIndex === 0) this.writeNL_IfNotChain(route);
|
|
29456
29450
|
this.writeOPA();
|
|
29457
29451
|
this.writeTagKey(name);
|
|
29458
29452
|
this.writeColon();
|
|
@@ -30665,7 +30659,7 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
30665
30659
|
if (bitJson.isTracked == null) bitJson.isTracked = true;
|
|
30666
30660
|
if (bitJson.isInfoOnly == null) bitJson.isInfoOnly = false;
|
|
30667
30661
|
}
|
|
30668
|
-
if (instance2.isOfBitType(bitType, BitType.table)) {
|
|
30662
|
+
if (instance2.isOfBitType(bitType, BitType.table) && !instance2.isOfBitType(bitType, BitType.tableImage)) {
|
|
30669
30663
|
if (bitJson.tableFixedHeader == null) bitJson.tableFixedHeader = false;
|
|
30670
30664
|
if (bitJson.tableHeaderWhitespaceNoWrap == null) {
|
|
30671
30665
|
bitJson.tableHeaderWhitespaceNoWrap = false;
|
|
@@ -30680,6 +30674,11 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
30680
30674
|
if (bitJson.tableResizableColumns == null) bitJson.tableResizableColumns = false;
|
|
30681
30675
|
if (bitJson.tableColumnMinWidth == null) bitJson.tableColumnMinWidth = 0;
|
|
30682
30676
|
}
|
|
30677
|
+
if (instance2.isOfBitType(bitType, BitType.tableImage)) {
|
|
30678
|
+
if (this.tableIsEmpty(bitJson.table)) {
|
|
30679
|
+
delete bitJson.table;
|
|
30680
|
+
}
|
|
30681
|
+
}
|
|
30683
30682
|
if (instance2.isOfBitType(bitType, BitType.bookReference)) {
|
|
30684
30683
|
if (bitJson.refAuthor == null) bitJson.refAuthor = [];
|
|
30685
30684
|
if (bitJson.refBookTitle == null) bitJson.refBookTitle = "";
|
|
@@ -30720,7 +30719,7 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
30720
30719
|
}
|
|
30721
30720
|
if (instance2.isOfBitType(bitType, BitType.book)) {
|
|
30722
30721
|
if (bitJson.maxTocChapterLevel == null) bitJson.maxTocChapterLevel = -1;
|
|
30723
|
-
if (bitJson.allowPrint == null) bitJson.allowPrint =
|
|
30722
|
+
if (bitJson.allowPrint == null) bitJson.allowPrint = "enforceFalse";
|
|
30724
30723
|
if (bitJson.hasPrintRestriction == null) bitJson.hasPrintRestriction = true;
|
|
30725
30724
|
if (bitJson.enforceUpdateOverUserInput == null) bitJson.enforceUpdateOverUserInput = false;
|
|
30726
30725
|
if (bitJson.hasMarkAsDone == null) bitJson.hasMarkAsDone = false;
|
|
@@ -30820,6 +30819,19 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
30820
30819
|
}
|
|
30821
30820
|
return bitJson;
|
|
30822
30821
|
}
|
|
30822
|
+
tableIsEmpty(table) {
|
|
30823
|
+
if (!table) return true;
|
|
30824
|
+
if (Object.keys(table).length === 0) return true;
|
|
30825
|
+
const tableStandard = table;
|
|
30826
|
+
if (tableStandard.columns?.length === 0 && tableStandard.data?.length) {
|
|
30827
|
+
return true;
|
|
30828
|
+
}
|
|
30829
|
+
const tableExtended = table;
|
|
30830
|
+
if (tableExtended.header?.rows.length === 0 && tableExtended.body?.rows.length === 0 && tableExtended.footer?.rows.length === 0) {
|
|
30831
|
+
return true;
|
|
30832
|
+
}
|
|
30833
|
+
return false;
|
|
30834
|
+
}
|
|
30823
30835
|
/**
|
|
30824
30836
|
* Convert any bitmark texts to strings.
|
|
30825
30837
|
*/
|
|
@@ -34431,6 +34443,7 @@ function propertyContentProcessor(context, contentDepth, tagsConfig, content, ta
|
|
|
34431
34443
|
chain: void 0,
|
|
34432
34444
|
jsonKey: void 0,
|
|
34433
34445
|
format: TagFormat.bitmarkText,
|
|
34446
|
+
values: void 0,
|
|
34434
34447
|
defaultValue: void 0,
|
|
34435
34448
|
deprecated: void 0
|
|
34436
34449
|
})
|