@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
package/dist/index.js
CHANGED
|
@@ -691,8 +691,10 @@ var TagFormat = {
|
|
|
691
691
|
// If the value is treated as a number
|
|
692
692
|
boolean: "boolean",
|
|
693
693
|
// If the value is treated as a boolean
|
|
694
|
-
invertedBoolean: "invertedBoolean"
|
|
694
|
+
invertedBoolean: "invertedBoolean",
|
|
695
695
|
// If the value is treated as a boolean with the value inverted (e.g. isLongAnswer ==> isShortAnswer = false)
|
|
696
|
+
enumeration: "enumeration"
|
|
697
|
+
// If the value is treated as an enumeration (the value is a string that must be one of a predefined set of values)
|
|
696
698
|
};
|
|
697
699
|
|
|
698
700
|
// src/model/enum/TextFormat.ts
|
|
@@ -836,9 +838,12 @@ var PropertyTagConfig = class extends AbstractTagConfig {
|
|
|
836
838
|
// If the property is treated as an array rather than a single value
|
|
837
839
|
__publicField(this, "format");
|
|
838
840
|
// How the property is formatted
|
|
841
|
+
__publicField(this, "values");
|
|
842
|
+
// If the format is an enumeration, the possible values of the property
|
|
839
843
|
__publicField(this, "defaultValue");
|
|
840
844
|
this.array = params.maxCount === Count.infinity || params.maxCount > 1;
|
|
841
845
|
this.format = params.format;
|
|
846
|
+
this.values = params.values;
|
|
842
847
|
this.defaultValue = params.defaultValue;
|
|
843
848
|
}
|
|
844
849
|
toString(options) {
|
|
@@ -850,6 +855,7 @@ var PropertyTagConfig = class extends AbstractTagConfig {
|
|
|
850
855
|
if (this.minCount != null) s += `, min=${this.minCount}`;
|
|
851
856
|
if (this.array != null) s += `, arr=${this.array}`;
|
|
852
857
|
if (this.format != null) s += `, fmt=${this.format}`;
|
|
858
|
+
if (this.values != null) s += `, vals=[${this.values.join(",")}]`;
|
|
853
859
|
if (this.defaultValue != null) s += `, def=${this.defaultValue}`;
|
|
854
860
|
if (this.jsonKey != null) s += `, json=${this.jsonKey}`;
|
|
855
861
|
}
|
|
@@ -1143,7 +1149,6 @@ var propertyKeys = {
|
|
|
1143
1149
|
property_aiGenerated: "@aiGenerated",
|
|
1144
1150
|
property_allowedBit: "@allowedBit",
|
|
1145
1151
|
property_allowPrint: "@allowPrint",
|
|
1146
|
-
property_allowPrintEnforceSpaceConfiguration: "@allowPrintEnforceSpaceConfiguration",
|
|
1147
1152
|
property_allowSubtitles: "@allowSubtitles",
|
|
1148
1153
|
property_alt: "@alt",
|
|
1149
1154
|
property_altLangTag: "@altLangTag",
|
|
@@ -2463,27 +2468,6 @@ var CARDSETS = {
|
|
|
2463
2468
|
]
|
|
2464
2469
|
},
|
|
2465
2470
|
[CardSetConfigKey.table]: {
|
|
2466
|
-
variants: [
|
|
2467
|
-
// Side 1
|
|
2468
|
-
[
|
|
2469
|
-
// Variant 1..N
|
|
2470
|
-
{
|
|
2471
|
-
tags: [
|
|
2472
|
-
{
|
|
2473
|
-
key: ConfigKey.group_standardItemLeadInstructionHint,
|
|
2474
|
-
description: "Standard tags for lead, instruction, and hint."
|
|
2475
|
-
},
|
|
2476
|
-
{
|
|
2477
|
-
key: ConfigKey.tag_title,
|
|
2478
|
-
description: "Title of the table."
|
|
2479
|
-
}
|
|
2480
|
-
],
|
|
2481
|
-
repeatCount: Count.infinity
|
|
2482
|
-
}
|
|
2483
|
-
]
|
|
2484
|
-
]
|
|
2485
|
-
},
|
|
2486
|
-
[CardSetConfigKey.tableExtended]: {
|
|
2487
2471
|
variants: [
|
|
2488
2472
|
// Side 1
|
|
2489
2473
|
[
|
|
@@ -3445,14 +3429,9 @@ var GROUPS = {
|
|
|
3445
3429
|
{
|
|
3446
3430
|
key: ConfigKey.property_allowPrint,
|
|
3447
3431
|
description: "If true, the book allows printing",
|
|
3448
|
-
format: TagFormat.
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
{
|
|
3452
|
-
key: ConfigKey.property_allowPrintEnforceSpaceConfiguration,
|
|
3453
|
-
description: "If true, enforces space configuration for printing regardless of the allowPrint setting",
|
|
3454
|
-
format: TagFormat.boolean,
|
|
3455
|
-
defaultValue: "false"
|
|
3432
|
+
format: TagFormat.enumeration,
|
|
3433
|
+
values: ["enforceFalse", "enforceTrue", "useSpaceConfiguration"],
|
|
3434
|
+
defaultValue: "enforceFalse"
|
|
3456
3435
|
},
|
|
3457
3436
|
{
|
|
3458
3437
|
key: ConfigKey.property_hasPrintRestriction,
|
|
@@ -4428,6 +4407,7 @@ var ConfigHydrator = class {
|
|
|
4428
4407
|
chain: _chain,
|
|
4429
4408
|
deprecated,
|
|
4430
4409
|
format,
|
|
4410
|
+
values,
|
|
4431
4411
|
defaultValue,
|
|
4432
4412
|
jsonKey
|
|
4433
4413
|
} = _tag;
|
|
@@ -4446,6 +4426,7 @@ var ConfigHydrator = class {
|
|
|
4446
4426
|
chain,
|
|
4447
4427
|
jsonKey,
|
|
4448
4428
|
format,
|
|
4429
|
+
values,
|
|
4449
4430
|
defaultValue,
|
|
4450
4431
|
deprecated
|
|
4451
4432
|
});
|
|
@@ -7849,15 +7830,35 @@ var BITS = {
|
|
|
7849
7830
|
},
|
|
7850
7831
|
[BitType.tableImage]: {
|
|
7851
7832
|
since: "1.5.15",
|
|
7852
|
-
baseBitType: BitType.
|
|
7833
|
+
baseBitType: BitType.table,
|
|
7853
7834
|
description: "Table image bit, used to create images in tables in articles or books",
|
|
7854
7835
|
tags: [
|
|
7855
7836
|
{
|
|
7856
7837
|
key: ConfigKey.property_caption,
|
|
7857
7838
|
description: "Caption for the table image, used to provide a description for the image",
|
|
7858
7839
|
format: TagFormat.bitmarkText
|
|
7840
|
+
},
|
|
7841
|
+
{
|
|
7842
|
+
key: ConfigKey.resource_backgroundWallpaper,
|
|
7843
|
+
description: "Background wallpaper for the image, used to set a background for the image",
|
|
7844
|
+
chain: [
|
|
7845
|
+
{
|
|
7846
|
+
key: ConfigKey.group_resourceImageCommon,
|
|
7847
|
+
description: "Common resource image tags for images"
|
|
7848
|
+
}
|
|
7849
|
+
]
|
|
7850
|
+
},
|
|
7851
|
+
{
|
|
7852
|
+
key: ConfigKey.group_resourceBitTags,
|
|
7853
|
+
description: "Resource bit tags for images, used to define additional properties for images"
|
|
7854
|
+
},
|
|
7855
|
+
{
|
|
7856
|
+
key: ConfigKey.group_resourceImage,
|
|
7857
|
+
description: "Resource image tags for images, used to attach images to the bit",
|
|
7858
|
+
minCount: 1
|
|
7859
7859
|
}
|
|
7860
|
-
]
|
|
7860
|
+
],
|
|
7861
|
+
resourceAttachmentAllowed: false
|
|
7861
7862
|
},
|
|
7862
7863
|
[BitType.tableImageAlt]: {
|
|
7863
7864
|
since: "1.16.0",
|
|
@@ -9377,8 +9378,7 @@ var BITS = {
|
|
|
9377
9378
|
[BitType.tableExtended]: {
|
|
9378
9379
|
since: "4.14.0",
|
|
9379
9380
|
baseBitType: BitType.table,
|
|
9380
|
-
description: "Extended table bit, used to create complex tables with all HTML table features"
|
|
9381
|
-
cardSet: CardSetConfigKey.tableExtended
|
|
9381
|
+
description: "Extended table bit, used to create complex tables with all HTML table features"
|
|
9382
9382
|
},
|
|
9383
9383
|
[BitType.tableAlt]: {
|
|
9384
9384
|
since: "1.16.0",
|
|
@@ -10402,7 +10402,7 @@ var instance2 = new Config();
|
|
|
10402
10402
|
// src/generated/package_info.ts
|
|
10403
10403
|
var PACKAGE_INFO = {
|
|
10404
10404
|
"name": "@gmb/bitmark-parser-generator",
|
|
10405
|
-
"version": "5.
|
|
10405
|
+
"version": "5.10.0",
|
|
10406
10406
|
"author": "Get More Brain Ltd",
|
|
10407
10407
|
"license": "ISC",
|
|
10408
10408
|
"description": "A bitmark parser and generator using Peggy.js"
|
|
@@ -11023,6 +11023,8 @@ var NodeType = {
|
|
|
11023
11023
|
indexValue: "indexValue",
|
|
11024
11024
|
ingredients: "ingredients",
|
|
11025
11025
|
ingredientsValue: "ingredientsValue",
|
|
11026
|
+
ingredient: "ingredient",
|
|
11027
|
+
ingredientValue: "ingredientValue",
|
|
11026
11028
|
instruction: "instruction",
|
|
11027
11029
|
instructionValue: "instructionValue",
|
|
11028
11030
|
internalComment: "internalComment",
|
|
@@ -11335,6 +11337,7 @@ var NodeType = {
|
|
|
11335
11337
|
srcAltValue: "srcAltValue",
|
|
11336
11338
|
start: "start",
|
|
11337
11339
|
statement: "statement",
|
|
11340
|
+
statementValue: "statementValue",
|
|
11338
11341
|
statements: "statements",
|
|
11339
11342
|
statementsValue: "statementsValue",
|
|
11340
11343
|
statementText: "statementText",
|
|
@@ -12001,7 +12004,7 @@ function normalizeTableFormat(bitType, table) {
|
|
|
12001
12004
|
delete t.columns;
|
|
12002
12005
|
delete t.data;
|
|
12003
12006
|
}
|
|
12004
|
-
const isExtended = instance2.isOfBitType(bitType, BitType.tableExtended);
|
|
12007
|
+
const isExtended = instance2.isOfBitType(bitType, BitType.tableExtended) || instance2.isOfBitType(bitType, BitType.tableImage);
|
|
12005
12008
|
if (isExtended && isTableBasicFormat(table)) {
|
|
12006
12009
|
return convertBasicToExtendedTableFormat(table);
|
|
12007
12010
|
}
|
|
@@ -24965,12 +24968,6 @@ var Builder = class extends BaseBuilder {
|
|
|
24965
24968
|
data.allowPrint,
|
|
24966
24969
|
options
|
|
24967
24970
|
),
|
|
24968
|
-
allowPrintEnforceSpaceConfiguration: this.toAstProperty(
|
|
24969
|
-
bitType,
|
|
24970
|
-
ConfigKey.property_allowPrintEnforceSpaceConfiguration,
|
|
24971
|
-
data.allowPrintEnforceSpaceConfiguration,
|
|
24972
|
-
options
|
|
24973
|
-
),
|
|
24974
24971
|
printParentChapterLevel: this.toAstProperty(
|
|
24975
24972
|
bitType,
|
|
24976
24973
|
ConfigKey.property_printParentChapterLevel,
|
|
@@ -27343,7 +27340,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27343
27340
|
if (parent?.key !== NodeType.bitsValue) return true;
|
|
27344
27341
|
for (const gt of groupTag) {
|
|
27345
27342
|
const { name, tags: tags2 } = gt;
|
|
27346
|
-
this.writeNL();
|
|
27347
27343
|
this.writeProperty("groupTag", name, route, {
|
|
27348
27344
|
format: TagFormat.plainText,
|
|
27349
27345
|
writeEmpty: true
|
|
@@ -27352,7 +27348,8 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27352
27348
|
for (const t of tags2) {
|
|
27353
27349
|
this.writeProperty("tag", t, route, {
|
|
27354
27350
|
format: TagFormat.plainText,
|
|
27355
|
-
writeEmpty: true
|
|
27351
|
+
writeEmpty: true,
|
|
27352
|
+
forceChain: true
|
|
27356
27353
|
});
|
|
27357
27354
|
}
|
|
27358
27355
|
}
|
|
@@ -27360,7 +27357,7 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27360
27357
|
return false;
|
|
27361
27358
|
}
|
|
27362
27359
|
// bitmarkAst -> bits -> bitsValue -> labelTrue / labelFalse
|
|
27363
|
-
|
|
27360
|
+
leaf_labelTrue(node, route) {
|
|
27364
27361
|
const value = node.value;
|
|
27365
27362
|
const parent = this.getParentNode(route);
|
|
27366
27363
|
if (parent?.key !== NodeType.bitsValue) return true;
|
|
@@ -27373,16 +27370,18 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27373
27370
|
}
|
|
27374
27371
|
if (haveTrue)
|
|
27375
27372
|
this.writeProperty("labelTrue", value, route, {
|
|
27376
|
-
format: TagFormat.plainText
|
|
27373
|
+
format: TagFormat.plainText,
|
|
27374
|
+
forceChain: true
|
|
27377
27375
|
});
|
|
27378
27376
|
if (haveFalse)
|
|
27379
27377
|
this.writeProperty("labelFalse", bit.labelFalse, route, {
|
|
27380
|
-
format: TagFormat.plainText
|
|
27378
|
+
format: TagFormat.plainText,
|
|
27379
|
+
forceChain: true
|
|
27381
27380
|
});
|
|
27382
27381
|
}
|
|
27383
27382
|
return false;
|
|
27384
27383
|
}
|
|
27385
|
-
|
|
27384
|
+
leaf_labelFalse(_node, _route) {
|
|
27386
27385
|
return true;
|
|
27387
27386
|
}
|
|
27388
27387
|
// bitmarkAst -> bits -> bitsValue -> imageSource
|
|
@@ -27391,26 +27390,29 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27391
27390
|
const parent = this.getParentNode(route);
|
|
27392
27391
|
if (parent?.key !== NodeType.bitsValue) return true;
|
|
27393
27392
|
const { url, mockupId, size, format, trim } = imageSource;
|
|
27394
|
-
this.writeNL();
|
|
27395
27393
|
this.writeProperty("imageSource", url, route, {
|
|
27396
27394
|
format: TagFormat.plainText
|
|
27397
27395
|
});
|
|
27398
27396
|
if (url) {
|
|
27399
27397
|
if (mockupId)
|
|
27400
27398
|
this.writeProperty("mockupId", mockupId, route, {
|
|
27401
|
-
format: TagFormat.plainText
|
|
27399
|
+
format: TagFormat.plainText,
|
|
27400
|
+
forceChain: true
|
|
27402
27401
|
});
|
|
27403
27402
|
if (size)
|
|
27404
27403
|
this.writeProperty("size", size, route, {
|
|
27405
|
-
format: TagFormat.plainText
|
|
27404
|
+
format: TagFormat.plainText,
|
|
27405
|
+
forceChain: true
|
|
27406
27406
|
});
|
|
27407
27407
|
if (format)
|
|
27408
27408
|
this.writeProperty("format", format, route, {
|
|
27409
|
-
format: TagFormat.plainText
|
|
27409
|
+
format: TagFormat.plainText,
|
|
27410
|
+
forceChain: true
|
|
27410
27411
|
});
|
|
27411
27412
|
if (instance5.isBoolean(trim))
|
|
27412
27413
|
this.writeProperty("trim", trim, route, {
|
|
27413
|
-
format: TagFormat.plainText
|
|
27414
|
+
format: TagFormat.plainText,
|
|
27415
|
+
forceChain: true
|
|
27414
27416
|
});
|
|
27415
27417
|
}
|
|
27416
27418
|
return false;
|
|
@@ -27421,13 +27423,13 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27421
27423
|
const parent = this.getParentNode(route);
|
|
27422
27424
|
if (parent?.key !== NodeType.bitsValue) return true;
|
|
27423
27425
|
const { technicalTerm, lang } = nodeValue;
|
|
27424
|
-
this.writeNL();
|
|
27425
27426
|
this.writeProperty("technicalTerm", technicalTerm, route, {
|
|
27426
27427
|
format: TagFormat.plainText
|
|
27427
27428
|
});
|
|
27428
27429
|
if (lang != null) {
|
|
27429
27430
|
this.writeProperty("lang", lang, route, {
|
|
27430
|
-
format: TagFormat.plainText
|
|
27431
|
+
format: TagFormat.plainText,
|
|
27432
|
+
forceChain: true
|
|
27431
27433
|
});
|
|
27432
27434
|
}
|
|
27433
27435
|
return false;
|
|
@@ -27438,28 +27440,31 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27438
27440
|
const parent = this.getParentNode(route);
|
|
27439
27441
|
if (parent?.key !== NodeType.bitsValue) return true;
|
|
27440
27442
|
const { servings, unit, unitAbbr, decimalPlaces, disableCalculation, hint } = nodeValue;
|
|
27441
|
-
this.writeNL();
|
|
27442
27443
|
this.writeProperty("servings", servings, route, {
|
|
27443
27444
|
format: TagFormat.plainText
|
|
27444
27445
|
});
|
|
27445
27446
|
if (unit != null) {
|
|
27446
27447
|
this.writeProperty("unit", unit, route, {
|
|
27447
|
-
format: TagFormat.plainText
|
|
27448
|
+
format: TagFormat.plainText,
|
|
27449
|
+
forceChain: true
|
|
27448
27450
|
});
|
|
27449
27451
|
}
|
|
27450
27452
|
if (unitAbbr != null) {
|
|
27451
27453
|
this.writeProperty("unitAbbr", unitAbbr, route, {
|
|
27452
|
-
format: TagFormat.plainText
|
|
27454
|
+
format: TagFormat.plainText,
|
|
27455
|
+
forceChain: true
|
|
27453
27456
|
});
|
|
27454
27457
|
}
|
|
27455
27458
|
if (decimalPlaces != null) {
|
|
27456
27459
|
this.writeProperty("decimalPlaces", decimalPlaces, route, {
|
|
27457
|
-
format: TagFormat.plainText
|
|
27460
|
+
format: TagFormat.plainText,
|
|
27461
|
+
forceChain: true
|
|
27458
27462
|
});
|
|
27459
27463
|
}
|
|
27460
27464
|
if (disableCalculation != null) {
|
|
27461
27465
|
this.writeProperty("disableCalculation", disableCalculation, route, {
|
|
27462
|
-
format: TagFormat.plainText
|
|
27466
|
+
format: TagFormat.plainText,
|
|
27467
|
+
forceChain: true
|
|
27463
27468
|
});
|
|
27464
27469
|
}
|
|
27465
27470
|
if (hint != null) {
|
|
@@ -27475,13 +27480,13 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27475
27480
|
const parent = this.getParentNode(route);
|
|
27476
27481
|
if (parent?.key !== NodeType.bitsValue) return true;
|
|
27477
27482
|
const { name, title, avatarImage } = person;
|
|
27478
|
-
this.writeNL();
|
|
27479
27483
|
this.writeProperty("person", name, route, {
|
|
27480
27484
|
format: TagFormat.plainText
|
|
27481
27485
|
});
|
|
27482
27486
|
if (title) {
|
|
27483
27487
|
this.writeProperty("title", title, route, {
|
|
27484
|
-
format: TagFormat.plainText
|
|
27488
|
+
format: TagFormat.plainText,
|
|
27489
|
+
forceChain: true
|
|
27485
27490
|
});
|
|
27486
27491
|
}
|
|
27487
27492
|
if (avatarImage) {
|
|
@@ -27529,7 +27534,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27529
27534
|
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) {
|
|
27530
27535
|
return true;
|
|
27531
27536
|
}
|
|
27532
|
-
this.writeNL();
|
|
27533
27537
|
this.writeResource(ResourceType.icon, resource.image.src);
|
|
27534
27538
|
return true;
|
|
27535
27539
|
}
|
|
@@ -27557,13 +27561,13 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27557
27561
|
if (parent?.key !== NodeType.bitsValue) return true;
|
|
27558
27562
|
const { level, label } = n;
|
|
27559
27563
|
const levelKey = node.key === NodeType.ratingLevelStart ? "ratingLevelStart" : "ratingLevelEnd";
|
|
27560
|
-
this.writeNL();
|
|
27561
27564
|
this.writeProperty(levelKey, level, route, {
|
|
27562
27565
|
format: TagFormat.plainText
|
|
27563
27566
|
});
|
|
27564
27567
|
if (label) {
|
|
27565
27568
|
this.writeProperty("label", label, route, {
|
|
27566
|
-
format: TagFormat.bitmarkText
|
|
27569
|
+
format: TagFormat.bitmarkText,
|
|
27570
|
+
forceChain: true
|
|
27567
27571
|
});
|
|
27568
27572
|
}
|
|
27569
27573
|
return false;
|
|
@@ -27585,12 +27589,14 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27585
27589
|
});
|
|
27586
27590
|
if (color) {
|
|
27587
27591
|
this.writeProperty("color", color, route, {
|
|
27588
|
-
format: TagFormat.plainText
|
|
27592
|
+
format: TagFormat.plainText,
|
|
27593
|
+
forceChain: true
|
|
27589
27594
|
});
|
|
27590
27595
|
}
|
|
27591
27596
|
if (emphasis) {
|
|
27592
27597
|
this.writeProperty("emphasis", emphasis, route, {
|
|
27593
|
-
format: TagFormat.plainText
|
|
27598
|
+
format: TagFormat.plainText,
|
|
27599
|
+
forceChain: true
|
|
27594
27600
|
});
|
|
27595
27601
|
}
|
|
27596
27602
|
}
|
|
@@ -27599,7 +27605,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27599
27605
|
// bitmarkAst -> bits -> bitsValue -> partialAnswer
|
|
27600
27606
|
enter_partialAnswer(node, route) {
|
|
27601
27607
|
if (node.value) {
|
|
27602
|
-
this.writeNL();
|
|
27603
27608
|
this.writeProperty("partialAnswer", node.value, route, {
|
|
27604
27609
|
format: TagFormat.plainText
|
|
27605
27610
|
});
|
|
@@ -27609,7 +27614,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27609
27614
|
// bitmarkAst -> bits -> bitsValue -> questions -> questionsValue -> partialAnswer
|
|
27610
27615
|
leaf_partialAnswer(node, route) {
|
|
27611
27616
|
if (node.value) {
|
|
27612
|
-
this.writeNL();
|
|
27613
27617
|
this.writeProperty("partialAnswer", node.value, route, {
|
|
27614
27618
|
format: TagFormat.plainText
|
|
27615
27619
|
});
|
|
@@ -27620,7 +27624,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27620
27624
|
// bitmarkAst -> bits -> bitsValue -> questions -> questionsValue -> sampleSolution
|
|
27621
27625
|
enter_sampleSolution(node, route) {
|
|
27622
27626
|
if (node.value) {
|
|
27623
|
-
this.writeNL();
|
|
27624
27627
|
this.writeProperty("sampleSolution", node.value, route, {
|
|
27625
27628
|
format: TagFormat.plainText
|
|
27626
27629
|
});
|
|
@@ -27629,7 +27632,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27629
27632
|
}
|
|
27630
27633
|
leaf_sampleSolution(node, route) {
|
|
27631
27634
|
if (node.value) {
|
|
27632
|
-
this.writeNL();
|
|
27633
27635
|
this.writeProperty("sampleSolution", node.value, route, {
|
|
27634
27636
|
format: TagFormat.plainText
|
|
27635
27637
|
});
|
|
@@ -27639,7 +27641,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
27639
27641
|
// bitmarkAst -> bits -> bitsValue -> reasonableNumOfChars
|
|
27640
27642
|
// bitmarkAst -> bits -> bitsValue -> questions -> questionsValue -> reasonableNumOfChars
|
|
27641
27643
|
leaf_reasonableNumOfChars(node, route) {
|
|
27642
|
-
this.writeNL();
|
|
27643
27644
|
this.writeProperty("reasonableNumOfChars", node.value, route, {
|
|
27644
27645
|
format: TagFormat.plainText
|
|
27645
27646
|
});
|
|
@@ -28646,7 +28647,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
28646
28647
|
// bitmarkAst -> bits -> bitsValue -> * -> lang
|
|
28647
28648
|
leaf_lang(node, route) {
|
|
28648
28649
|
if (!node.value) return;
|
|
28649
|
-
this.writeNL();
|
|
28650
28650
|
this.writeProperty("lang", node.value, route, {
|
|
28651
28651
|
format: TagFormat.boolean
|
|
28652
28652
|
});
|
|
@@ -28654,7 +28654,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
28654
28654
|
// bitmarkAst -> bits -> bitsValue -> * -> refAuthor
|
|
28655
28655
|
enter_refAuthor(node, route) {
|
|
28656
28656
|
if (!node.value) return;
|
|
28657
|
-
this.writeNL();
|
|
28658
28657
|
this.writeProperty("refAuthor", node.value, route, {
|
|
28659
28658
|
format: TagFormat.plainText,
|
|
28660
28659
|
array: true
|
|
@@ -28663,7 +28662,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
28663
28662
|
// bitmarkAst -> bits -> bitsValue -> * -> refBookTitle
|
|
28664
28663
|
leaf_refBookTitle(node, route) {
|
|
28665
28664
|
if (!node.value) return;
|
|
28666
|
-
this.writeNL();
|
|
28667
28665
|
this.writeProperty("refBookTitle", node.value, route, {
|
|
28668
28666
|
format: TagFormat.plainText,
|
|
28669
28667
|
array: true
|
|
@@ -28672,7 +28670,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
28672
28670
|
// bitmarkAst -> bits -> bitsValue -> * -> refPublisher
|
|
28673
28671
|
enter_refPublisher(node, route) {
|
|
28674
28672
|
if (!node.value) return;
|
|
28675
|
-
this.writeNL();
|
|
28676
28673
|
this.writeProperty("refPublisher", node.value, route, {
|
|
28677
28674
|
format: TagFormat.plainText,
|
|
28678
28675
|
array: true
|
|
@@ -28681,7 +28678,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
28681
28678
|
// bitmarkAst -> bits -> bitsValue -> * -> refPublicationYear
|
|
28682
28679
|
leaf_refPublicationYear(node, route) {
|
|
28683
28680
|
if (!node.value) return;
|
|
28684
|
-
this.writeNL();
|
|
28685
28681
|
this.writeProperty("refPublicationYear", node.value, route, {
|
|
28686
28682
|
format: TagFormat.plainText
|
|
28687
28683
|
});
|
|
@@ -28689,7 +28685,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
28689
28685
|
// bitmarkAst -> bits -> bitsValue -> * -> citationStyle
|
|
28690
28686
|
leaf_citationStyle(node, route) {
|
|
28691
28687
|
if (!node.value) return;
|
|
28692
|
-
this.writeNL();
|
|
28693
28688
|
this.writeProperty("citationStyle", node.value, route, {
|
|
28694
28689
|
format: TagFormat.plainText
|
|
28695
28690
|
});
|
|
@@ -29021,7 +29016,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
29021
29016
|
const config = instance2.getBitConfig(bitType);
|
|
29022
29017
|
const propertyConfig = instance2.getTagConfigForTag(config.tags, propertyConfigKey);
|
|
29023
29018
|
if (!propertyConfig) return;
|
|
29024
|
-
this.writeNL_IfNotChain(route);
|
|
29025
29019
|
this.writeProperty(propertyConfig.tag, node.value, route, {
|
|
29026
29020
|
format: propertyConfig.format ?? TagFormat.plainText,
|
|
29027
29021
|
array: propertyConfig.array ?? false,
|
|
@@ -29405,7 +29399,7 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
29405
29399
|
if (options.ignoreFalse && val === false) continue;
|
|
29406
29400
|
if (options.ignoreTrue && val === true) continue;
|
|
29407
29401
|
if (!options.writeEmpty && val === "") continue;
|
|
29408
|
-
if (propertyIndex
|
|
29402
|
+
if (!options.forceChain && propertyIndex === 0) this.writeNL_IfNotChain(route);
|
|
29409
29403
|
this.writeOPA();
|
|
29410
29404
|
this.writeTagKey(name);
|
|
29411
29405
|
this.writeColon();
|
|
@@ -30618,7 +30612,7 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
30618
30612
|
if (bitJson.isTracked == null) bitJson.isTracked = true;
|
|
30619
30613
|
if (bitJson.isInfoOnly == null) bitJson.isInfoOnly = false;
|
|
30620
30614
|
}
|
|
30621
|
-
if (instance2.isOfBitType(bitType, BitType.table)) {
|
|
30615
|
+
if (instance2.isOfBitType(bitType, BitType.table) && !instance2.isOfBitType(bitType, BitType.tableImage)) {
|
|
30622
30616
|
if (bitJson.tableFixedHeader == null) bitJson.tableFixedHeader = false;
|
|
30623
30617
|
if (bitJson.tableHeaderWhitespaceNoWrap == null) {
|
|
30624
30618
|
bitJson.tableHeaderWhitespaceNoWrap = false;
|
|
@@ -30633,6 +30627,11 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
30633
30627
|
if (bitJson.tableResizableColumns == null) bitJson.tableResizableColumns = false;
|
|
30634
30628
|
if (bitJson.tableColumnMinWidth == null) bitJson.tableColumnMinWidth = 0;
|
|
30635
30629
|
}
|
|
30630
|
+
if (instance2.isOfBitType(bitType, BitType.tableImage)) {
|
|
30631
|
+
if (this.tableIsEmpty(bitJson.table)) {
|
|
30632
|
+
delete bitJson.table;
|
|
30633
|
+
}
|
|
30634
|
+
}
|
|
30636
30635
|
if (instance2.isOfBitType(bitType, BitType.bookReference)) {
|
|
30637
30636
|
if (bitJson.refAuthor == null) bitJson.refAuthor = [];
|
|
30638
30637
|
if (bitJson.refBookTitle == null) bitJson.refBookTitle = "";
|
|
@@ -30673,7 +30672,7 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
30673
30672
|
}
|
|
30674
30673
|
if (instance2.isOfBitType(bitType, BitType.book)) {
|
|
30675
30674
|
if (bitJson.maxTocChapterLevel == null) bitJson.maxTocChapterLevel = -1;
|
|
30676
|
-
if (bitJson.allowPrint == null) bitJson.allowPrint =
|
|
30675
|
+
if (bitJson.allowPrint == null) bitJson.allowPrint = "enforceFalse";
|
|
30677
30676
|
if (bitJson.hasPrintRestriction == null) bitJson.hasPrintRestriction = true;
|
|
30678
30677
|
if (bitJson.enforceUpdateOverUserInput == null) bitJson.enforceUpdateOverUserInput = false;
|
|
30679
30678
|
if (bitJson.hasMarkAsDone == null) bitJson.hasMarkAsDone = false;
|
|
@@ -30773,6 +30772,19 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
30773
30772
|
}
|
|
30774
30773
|
return bitJson;
|
|
30775
30774
|
}
|
|
30775
|
+
tableIsEmpty(table) {
|
|
30776
|
+
if (!table) return true;
|
|
30777
|
+
if (Object.keys(table).length === 0) return true;
|
|
30778
|
+
const tableStandard = table;
|
|
30779
|
+
if (tableStandard.columns?.length === 0 && tableStandard.data?.length) {
|
|
30780
|
+
return true;
|
|
30781
|
+
}
|
|
30782
|
+
const tableExtended = table;
|
|
30783
|
+
if (tableExtended.header?.rows.length === 0 && tableExtended.body?.rows.length === 0 && tableExtended.footer?.rows.length === 0) {
|
|
30784
|
+
return true;
|
|
30785
|
+
}
|
|
30786
|
+
return false;
|
|
30787
|
+
}
|
|
30776
30788
|
/**
|
|
30777
30789
|
* Convert any bitmark texts to strings.
|
|
30778
30790
|
*/
|
|
@@ -34402,6 +34414,7 @@ function propertyContentProcessor(context, contentDepth, tagsConfig, content, ta
|
|
|
34402
34414
|
chain: void 0,
|
|
34403
34415
|
jsonKey: void 0,
|
|
34404
34416
|
format: TagFormat.bitmarkText,
|
|
34417
|
+
values: void 0,
|
|
34405
34418
|
defaultValue: void 0,
|
|
34406
34419
|
deprecated: void 0
|
|
34407
34420
|
})
|