@gmb/bitmark-parser-generator 5.9.1 → 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/dist/index.d.cts CHANGED
@@ -718,7 +718,6 @@ declare const ConfigKey: {
718
718
  readonly property_aiGenerated: "@aiGenerated";
719
719
  readonly property_allowedBit: "@allowedBit";
720
720
  readonly property_allowPrint: "@allowPrint";
721
- readonly property_allowPrintEnforceSpaceConfiguration: "@allowPrintEnforceSpaceConfiguration";
722
721
  readonly property_allowSubtitles: "@allowSubtitles";
723
722
  readonly property_alt: "@alt";
724
723
  readonly property_altLangTag: "@altLangTag";
@@ -1806,8 +1805,7 @@ interface BitJson {
1806
1805
  maxCreatedBits: number;
1807
1806
  maxDisplayLevel: number;
1808
1807
  maxTocChapterLevel: number;
1809
- allowPrint: boolean;
1810
- allowPrintEnforceSpaceConfiguration: boolean;
1808
+ allowPrint: string;
1811
1809
  printParentChapterLevel: number;
1812
1810
  sourceDocument: string;
1813
1811
  internalPrintPdf: string;
@@ -2436,7 +2434,6 @@ interface Bit {
2436
2434
  tocContent?: Property;
2437
2435
  page?: Property;
2438
2436
  allowPrint?: Property;
2439
- allowPrintEnforceSpaceConfiguration?: Property;
2440
2437
  allowPrintValue?: Property;
2441
2438
  printParentChapterLevel?: Property;
2442
2439
  platformBrandTarget?: Property;
@@ -2842,6 +2839,8 @@ declare const NodeType: {
2842
2839
  readonly indexValue: "indexValue";
2843
2840
  readonly ingredients: "ingredients";
2844
2841
  readonly ingredientsValue: "ingredientsValue";
2842
+ readonly ingredient: "ingredient";
2843
+ readonly ingredientValue: "ingredientValue";
2845
2844
  readonly instruction: "instruction";
2846
2845
  readonly instructionValue: "instructionValue";
2847
2846
  readonly internalComment: "internalComment";
@@ -3152,6 +3151,7 @@ declare const NodeType: {
3152
3151
  readonly srcAltValue: "srcAltValue";
3153
3152
  readonly start: "start";
3154
3153
  readonly statement: "statement";
3154
+ readonly statementValue: "statementValue";
3155
3155
  readonly statements: "statements";
3156
3156
  readonly statementsValue: "statementsValue";
3157
3157
  readonly statementText: "statementText";
@@ -3781,6 +3781,7 @@ declare const TagFormat: {
3781
3781
  readonly number: "number";
3782
3782
  readonly boolean: "boolean";
3783
3783
  readonly invertedBoolean: "invertedBoolean";
3784
+ readonly enumeration: "enumeration";
3784
3785
  };
3785
3786
  type TagFormatType = EnumType<typeof TagFormat>;
3786
3787
 
@@ -3792,6 +3793,7 @@ declare class PropertyTagConfig extends AbstractTagConfig {
3792
3793
  readonly type: BitTagConfigKeyTypeType;
3793
3794
  readonly array?: boolean;
3794
3795
  readonly format?: TagFormatType;
3796
+ readonly values?: string[];
3795
3797
  readonly defaultValue?: string;
3796
3798
  constructor(params: {
3797
3799
  configKey: ConfigKeyType;
@@ -3801,6 +3803,7 @@ declare class PropertyTagConfig extends AbstractTagConfig {
3801
3803
  chain: TagsConfig | undefined;
3802
3804
  jsonKey: string | undefined;
3803
3805
  format: TagFormatType | undefined;
3806
+ values: string[] | undefined;
3804
3807
  defaultValue: string | undefined;
3805
3808
  deprecated: string | undefined;
3806
3809
  });
@@ -4258,8 +4261,7 @@ declare class Builder extends BaseBuilder {
4258
4261
  maxTocChapterLevel?: number;
4259
4262
  sourceDocument?: string;
4260
4263
  internalPrintPdf?: string;
4261
- allowPrint?: boolean;
4262
- allowPrintEnforceSpaceConfiguration?: boolean;
4264
+ allowPrint?: string;
4263
4265
  hasPrintRestriction?: boolean;
4264
4266
  enforceUpdateOverUserInput?: boolean;
4265
4267
  extractorExtractionTimestamp?: string[];
@@ -5448,8 +5450,8 @@ declare class BitmarkGenerator extends AstWalkerGenerator<BitmarkAst, void> {
5448
5450
  protected exit_bitsValue(_node: NodeInfo, _route: NodeInfo[]): void;
5449
5451
  protected enter_internalComment(node: NodeInfo, route: NodeInfo[]): boolean;
5450
5452
  protected enter_groupTag(node: NodeInfo, route: NodeInfo[]): boolean;
5451
- protected enter_labelTrue(node: NodeInfo, route: NodeInfo[]): boolean;
5452
- protected enter_labelFalse(_node: NodeInfo, _route: NodeInfo[]): boolean;
5453
+ protected leaf_labelTrue(node: NodeInfo, route: NodeInfo[]): boolean;
5454
+ protected leaf_labelFalse(_node: NodeInfo, _route: NodeInfo[]): boolean;
5453
5455
  protected enter_imageSource(node: NodeInfo, route: NodeInfo[]): boolean;
5454
5456
  protected enter_technicalTerm(node: NodeInfo, route: NodeInfo[]): boolean;
5455
5457
  protected enter_servings(node: NodeInfo, route: NodeInfo[]): boolean;
@@ -5710,6 +5712,7 @@ declare class BitmarkGenerator extends AstWalkerGenerator<BitmarkAst, void> {
5710
5712
  ignoreFalse?: boolean;
5711
5713
  ignoreTrue?: boolean;
5712
5714
  writeEmpty?: boolean;
5715
+ forceChain?: boolean;
5713
5716
  }): void;
5714
5717
  protected writeInlineDebug(key: string, state: {
5715
5718
  open?: boolean;
package/dist/index.d.ts CHANGED
@@ -718,7 +718,6 @@ declare const ConfigKey: {
718
718
  readonly property_aiGenerated: "@aiGenerated";
719
719
  readonly property_allowedBit: "@allowedBit";
720
720
  readonly property_allowPrint: "@allowPrint";
721
- readonly property_allowPrintEnforceSpaceConfiguration: "@allowPrintEnforceSpaceConfiguration";
722
721
  readonly property_allowSubtitles: "@allowSubtitles";
723
722
  readonly property_alt: "@alt";
724
723
  readonly property_altLangTag: "@altLangTag";
@@ -1806,8 +1805,7 @@ interface BitJson {
1806
1805
  maxCreatedBits: number;
1807
1806
  maxDisplayLevel: number;
1808
1807
  maxTocChapterLevel: number;
1809
- allowPrint: boolean;
1810
- allowPrintEnforceSpaceConfiguration: boolean;
1808
+ allowPrint: string;
1811
1809
  printParentChapterLevel: number;
1812
1810
  sourceDocument: string;
1813
1811
  internalPrintPdf: string;
@@ -2436,7 +2434,6 @@ interface Bit {
2436
2434
  tocContent?: Property;
2437
2435
  page?: Property;
2438
2436
  allowPrint?: Property;
2439
- allowPrintEnforceSpaceConfiguration?: Property;
2440
2437
  allowPrintValue?: Property;
2441
2438
  printParentChapterLevel?: Property;
2442
2439
  platformBrandTarget?: Property;
@@ -2842,6 +2839,8 @@ declare const NodeType: {
2842
2839
  readonly indexValue: "indexValue";
2843
2840
  readonly ingredients: "ingredients";
2844
2841
  readonly ingredientsValue: "ingredientsValue";
2842
+ readonly ingredient: "ingredient";
2843
+ readonly ingredientValue: "ingredientValue";
2845
2844
  readonly instruction: "instruction";
2846
2845
  readonly instructionValue: "instructionValue";
2847
2846
  readonly internalComment: "internalComment";
@@ -3152,6 +3151,7 @@ declare const NodeType: {
3152
3151
  readonly srcAltValue: "srcAltValue";
3153
3152
  readonly start: "start";
3154
3153
  readonly statement: "statement";
3154
+ readonly statementValue: "statementValue";
3155
3155
  readonly statements: "statements";
3156
3156
  readonly statementsValue: "statementsValue";
3157
3157
  readonly statementText: "statementText";
@@ -3781,6 +3781,7 @@ declare const TagFormat: {
3781
3781
  readonly number: "number";
3782
3782
  readonly boolean: "boolean";
3783
3783
  readonly invertedBoolean: "invertedBoolean";
3784
+ readonly enumeration: "enumeration";
3784
3785
  };
3785
3786
  type TagFormatType = EnumType<typeof TagFormat>;
3786
3787
 
@@ -3792,6 +3793,7 @@ declare class PropertyTagConfig extends AbstractTagConfig {
3792
3793
  readonly type: BitTagConfigKeyTypeType;
3793
3794
  readonly array?: boolean;
3794
3795
  readonly format?: TagFormatType;
3796
+ readonly values?: string[];
3795
3797
  readonly defaultValue?: string;
3796
3798
  constructor(params: {
3797
3799
  configKey: ConfigKeyType;
@@ -3801,6 +3803,7 @@ declare class PropertyTagConfig extends AbstractTagConfig {
3801
3803
  chain: TagsConfig | undefined;
3802
3804
  jsonKey: string | undefined;
3803
3805
  format: TagFormatType | undefined;
3806
+ values: string[] | undefined;
3804
3807
  defaultValue: string | undefined;
3805
3808
  deprecated: string | undefined;
3806
3809
  });
@@ -4258,8 +4261,7 @@ declare class Builder extends BaseBuilder {
4258
4261
  maxTocChapterLevel?: number;
4259
4262
  sourceDocument?: string;
4260
4263
  internalPrintPdf?: string;
4261
- allowPrint?: boolean;
4262
- allowPrintEnforceSpaceConfiguration?: boolean;
4264
+ allowPrint?: string;
4263
4265
  hasPrintRestriction?: boolean;
4264
4266
  enforceUpdateOverUserInput?: boolean;
4265
4267
  extractorExtractionTimestamp?: string[];
@@ -5448,8 +5450,8 @@ declare class BitmarkGenerator extends AstWalkerGenerator<BitmarkAst, void> {
5448
5450
  protected exit_bitsValue(_node: NodeInfo, _route: NodeInfo[]): void;
5449
5451
  protected enter_internalComment(node: NodeInfo, route: NodeInfo[]): boolean;
5450
5452
  protected enter_groupTag(node: NodeInfo, route: NodeInfo[]): boolean;
5451
- protected enter_labelTrue(node: NodeInfo, route: NodeInfo[]): boolean;
5452
- protected enter_labelFalse(_node: NodeInfo, _route: NodeInfo[]): boolean;
5453
+ protected leaf_labelTrue(node: NodeInfo, route: NodeInfo[]): boolean;
5454
+ protected leaf_labelFalse(_node: NodeInfo, _route: NodeInfo[]): boolean;
5453
5455
  protected enter_imageSource(node: NodeInfo, route: NodeInfo[]): boolean;
5454
5456
  protected enter_technicalTerm(node: NodeInfo, route: NodeInfo[]): boolean;
5455
5457
  protected enter_servings(node: NodeInfo, route: NodeInfo[]): boolean;
@@ -5710,6 +5712,7 @@ declare class BitmarkGenerator extends AstWalkerGenerator<BitmarkAst, void> {
5710
5712
  ignoreFalse?: boolean;
5711
5713
  ignoreTrue?: boolean;
5712
5714
  writeEmpty?: boolean;
5715
+ forceChain?: boolean;
5713
5716
  }): void;
5714
5717
  protected writeInlineDebug(key: string, state: {
5715
5718
  open?: boolean;
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",
@@ -3424,14 +3429,9 @@ var GROUPS = {
3424
3429
  {
3425
3430
  key: ConfigKey.property_allowPrint,
3426
3431
  description: "If true, the book allows printing",
3427
- format: TagFormat.boolean,
3428
- defaultValue: "false"
3429
- },
3430
- {
3431
- key: ConfigKey.property_allowPrintEnforceSpaceConfiguration,
3432
- description: "If true, enforces space configuration for printing regardless of the allowPrint setting",
3433
- format: TagFormat.boolean,
3434
- defaultValue: "false"
3432
+ format: TagFormat.enumeration,
3433
+ values: ["enforceFalse", "enforceTrue", "useSpaceConfiguration"],
3434
+ defaultValue: "enforceFalse"
3435
3435
  },
3436
3436
  {
3437
3437
  key: ConfigKey.property_hasPrintRestriction,
@@ -4407,6 +4407,7 @@ var ConfigHydrator = class {
4407
4407
  chain: _chain,
4408
4408
  deprecated,
4409
4409
  format,
4410
+ values,
4410
4411
  defaultValue,
4411
4412
  jsonKey
4412
4413
  } = _tag;
@@ -4425,6 +4426,7 @@ var ConfigHydrator = class {
4425
4426
  chain,
4426
4427
  jsonKey,
4427
4428
  format,
4429
+ values,
4428
4430
  defaultValue,
4429
4431
  deprecated
4430
4432
  });
@@ -10400,7 +10402,7 @@ var instance2 = new Config();
10400
10402
  // src/generated/package_info.ts
10401
10403
  var PACKAGE_INFO = {
10402
10404
  "name": "@gmb/bitmark-parser-generator",
10403
- "version": "5.9.1",
10405
+ "version": "5.10.0",
10404
10406
  "author": "Get More Brain Ltd",
10405
10407
  "license": "ISC",
10406
10408
  "description": "A bitmark parser and generator using Peggy.js"
@@ -11021,6 +11023,8 @@ var NodeType = {
11021
11023
  indexValue: "indexValue",
11022
11024
  ingredients: "ingredients",
11023
11025
  ingredientsValue: "ingredientsValue",
11026
+ ingredient: "ingredient",
11027
+ ingredientValue: "ingredientValue",
11024
11028
  instruction: "instruction",
11025
11029
  instructionValue: "instructionValue",
11026
11030
  internalComment: "internalComment",
@@ -11333,6 +11337,7 @@ var NodeType = {
11333
11337
  srcAltValue: "srcAltValue",
11334
11338
  start: "start",
11335
11339
  statement: "statement",
11340
+ statementValue: "statementValue",
11336
11341
  statements: "statements",
11337
11342
  statementsValue: "statementsValue",
11338
11343
  statementText: "statementText",
@@ -24963,12 +24968,6 @@ var Builder = class extends BaseBuilder {
24963
24968
  data.allowPrint,
24964
24969
  options
24965
24970
  ),
24966
- allowPrintEnforceSpaceConfiguration: this.toAstProperty(
24967
- bitType,
24968
- ConfigKey.property_allowPrintEnforceSpaceConfiguration,
24969
- data.allowPrintEnforceSpaceConfiguration,
24970
- options
24971
- ),
24972
24971
  printParentChapterLevel: this.toAstProperty(
24973
24972
  bitType,
24974
24973
  ConfigKey.property_printParentChapterLevel,
@@ -27341,7 +27340,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27341
27340
  if (parent?.key !== NodeType.bitsValue) return true;
27342
27341
  for (const gt of groupTag) {
27343
27342
  const { name, tags: tags2 } = gt;
27344
- this.writeNL();
27345
27343
  this.writeProperty("groupTag", name, route, {
27346
27344
  format: TagFormat.plainText,
27347
27345
  writeEmpty: true
@@ -27350,7 +27348,8 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27350
27348
  for (const t of tags2) {
27351
27349
  this.writeProperty("tag", t, route, {
27352
27350
  format: TagFormat.plainText,
27353
- writeEmpty: true
27351
+ writeEmpty: true,
27352
+ forceChain: true
27354
27353
  });
27355
27354
  }
27356
27355
  }
@@ -27358,7 +27357,7 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27358
27357
  return false;
27359
27358
  }
27360
27359
  // bitmarkAst -> bits -> bitsValue -> labelTrue / labelFalse
27361
- enter_labelTrue(node, route) {
27360
+ leaf_labelTrue(node, route) {
27362
27361
  const value = node.value;
27363
27362
  const parent = this.getParentNode(route);
27364
27363
  if (parent?.key !== NodeType.bitsValue) return true;
@@ -27371,16 +27370,18 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27371
27370
  }
27372
27371
  if (haveTrue)
27373
27372
  this.writeProperty("labelTrue", value, route, {
27374
- format: TagFormat.plainText
27373
+ format: TagFormat.plainText,
27374
+ forceChain: true
27375
27375
  });
27376
27376
  if (haveFalse)
27377
27377
  this.writeProperty("labelFalse", bit.labelFalse, route, {
27378
- format: TagFormat.plainText
27378
+ format: TagFormat.plainText,
27379
+ forceChain: true
27379
27380
  });
27380
27381
  }
27381
27382
  return false;
27382
27383
  }
27383
- enter_labelFalse(_node, _route) {
27384
+ leaf_labelFalse(_node, _route) {
27384
27385
  return true;
27385
27386
  }
27386
27387
  // bitmarkAst -> bits -> bitsValue -> imageSource
@@ -27389,26 +27390,29 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27389
27390
  const parent = this.getParentNode(route);
27390
27391
  if (parent?.key !== NodeType.bitsValue) return true;
27391
27392
  const { url, mockupId, size, format, trim } = imageSource;
27392
- this.writeNL();
27393
27393
  this.writeProperty("imageSource", url, route, {
27394
27394
  format: TagFormat.plainText
27395
27395
  });
27396
27396
  if (url) {
27397
27397
  if (mockupId)
27398
27398
  this.writeProperty("mockupId", mockupId, route, {
27399
- format: TagFormat.plainText
27399
+ format: TagFormat.plainText,
27400
+ forceChain: true
27400
27401
  });
27401
27402
  if (size)
27402
27403
  this.writeProperty("size", size, route, {
27403
- format: TagFormat.plainText
27404
+ format: TagFormat.plainText,
27405
+ forceChain: true
27404
27406
  });
27405
27407
  if (format)
27406
27408
  this.writeProperty("format", format, route, {
27407
- format: TagFormat.plainText
27409
+ format: TagFormat.plainText,
27410
+ forceChain: true
27408
27411
  });
27409
27412
  if (instance5.isBoolean(trim))
27410
27413
  this.writeProperty("trim", trim, route, {
27411
- format: TagFormat.plainText
27414
+ format: TagFormat.plainText,
27415
+ forceChain: true
27412
27416
  });
27413
27417
  }
27414
27418
  return false;
@@ -27419,13 +27423,13 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27419
27423
  const parent = this.getParentNode(route);
27420
27424
  if (parent?.key !== NodeType.bitsValue) return true;
27421
27425
  const { technicalTerm, lang } = nodeValue;
27422
- this.writeNL();
27423
27426
  this.writeProperty("technicalTerm", technicalTerm, route, {
27424
27427
  format: TagFormat.plainText
27425
27428
  });
27426
27429
  if (lang != null) {
27427
27430
  this.writeProperty("lang", lang, route, {
27428
- format: TagFormat.plainText
27431
+ format: TagFormat.plainText,
27432
+ forceChain: true
27429
27433
  });
27430
27434
  }
27431
27435
  return false;
@@ -27436,28 +27440,31 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27436
27440
  const parent = this.getParentNode(route);
27437
27441
  if (parent?.key !== NodeType.bitsValue) return true;
27438
27442
  const { servings, unit, unitAbbr, decimalPlaces, disableCalculation, hint } = nodeValue;
27439
- this.writeNL();
27440
27443
  this.writeProperty("servings", servings, route, {
27441
27444
  format: TagFormat.plainText
27442
27445
  });
27443
27446
  if (unit != null) {
27444
27447
  this.writeProperty("unit", unit, route, {
27445
- format: TagFormat.plainText
27448
+ format: TagFormat.plainText,
27449
+ forceChain: true
27446
27450
  });
27447
27451
  }
27448
27452
  if (unitAbbr != null) {
27449
27453
  this.writeProperty("unitAbbr", unitAbbr, route, {
27450
- format: TagFormat.plainText
27454
+ format: TagFormat.plainText,
27455
+ forceChain: true
27451
27456
  });
27452
27457
  }
27453
27458
  if (decimalPlaces != null) {
27454
27459
  this.writeProperty("decimalPlaces", decimalPlaces, route, {
27455
- format: TagFormat.plainText
27460
+ format: TagFormat.plainText,
27461
+ forceChain: true
27456
27462
  });
27457
27463
  }
27458
27464
  if (disableCalculation != null) {
27459
27465
  this.writeProperty("disableCalculation", disableCalculation, route, {
27460
- format: TagFormat.plainText
27466
+ format: TagFormat.plainText,
27467
+ forceChain: true
27461
27468
  });
27462
27469
  }
27463
27470
  if (hint != null) {
@@ -27473,13 +27480,13 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27473
27480
  const parent = this.getParentNode(route);
27474
27481
  if (parent?.key !== NodeType.bitsValue) return true;
27475
27482
  const { name, title, avatarImage } = person;
27476
- this.writeNL();
27477
27483
  this.writeProperty("person", name, route, {
27478
27484
  format: TagFormat.plainText
27479
27485
  });
27480
27486
  if (title) {
27481
27487
  this.writeProperty("title", title, route, {
27482
- format: TagFormat.plainText
27488
+ format: TagFormat.plainText,
27489
+ forceChain: true
27483
27490
  });
27484
27491
  }
27485
27492
  if (avatarImage) {
@@ -27527,7 +27534,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27527
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) {
27528
27535
  return true;
27529
27536
  }
27530
- this.writeNL();
27531
27537
  this.writeResource(ResourceType.icon, resource.image.src);
27532
27538
  return true;
27533
27539
  }
@@ -27555,13 +27561,13 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27555
27561
  if (parent?.key !== NodeType.bitsValue) return true;
27556
27562
  const { level, label } = n;
27557
27563
  const levelKey = node.key === NodeType.ratingLevelStart ? "ratingLevelStart" : "ratingLevelEnd";
27558
- this.writeNL();
27559
27564
  this.writeProperty(levelKey, level, route, {
27560
27565
  format: TagFormat.plainText
27561
27566
  });
27562
27567
  if (label) {
27563
27568
  this.writeProperty("label", label, route, {
27564
- format: TagFormat.bitmarkText
27569
+ format: TagFormat.bitmarkText,
27570
+ forceChain: true
27565
27571
  });
27566
27572
  }
27567
27573
  return false;
@@ -27583,12 +27589,14 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27583
27589
  });
27584
27590
  if (color) {
27585
27591
  this.writeProperty("color", color, route, {
27586
- format: TagFormat.plainText
27592
+ format: TagFormat.plainText,
27593
+ forceChain: true
27587
27594
  });
27588
27595
  }
27589
27596
  if (emphasis) {
27590
27597
  this.writeProperty("emphasis", emphasis, route, {
27591
- format: TagFormat.plainText
27598
+ format: TagFormat.plainText,
27599
+ forceChain: true
27592
27600
  });
27593
27601
  }
27594
27602
  }
@@ -27597,7 +27605,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27597
27605
  // bitmarkAst -> bits -> bitsValue -> partialAnswer
27598
27606
  enter_partialAnswer(node, route) {
27599
27607
  if (node.value) {
27600
- this.writeNL();
27601
27608
  this.writeProperty("partialAnswer", node.value, route, {
27602
27609
  format: TagFormat.plainText
27603
27610
  });
@@ -27607,7 +27614,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27607
27614
  // bitmarkAst -> bits -> bitsValue -> questions -> questionsValue -> partialAnswer
27608
27615
  leaf_partialAnswer(node, route) {
27609
27616
  if (node.value) {
27610
- this.writeNL();
27611
27617
  this.writeProperty("partialAnswer", node.value, route, {
27612
27618
  format: TagFormat.plainText
27613
27619
  });
@@ -27618,7 +27624,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27618
27624
  // bitmarkAst -> bits -> bitsValue -> questions -> questionsValue -> sampleSolution
27619
27625
  enter_sampleSolution(node, route) {
27620
27626
  if (node.value) {
27621
- this.writeNL();
27622
27627
  this.writeProperty("sampleSolution", node.value, route, {
27623
27628
  format: TagFormat.plainText
27624
27629
  });
@@ -27627,7 +27632,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27627
27632
  }
27628
27633
  leaf_sampleSolution(node, route) {
27629
27634
  if (node.value) {
27630
- this.writeNL();
27631
27635
  this.writeProperty("sampleSolution", node.value, route, {
27632
27636
  format: TagFormat.plainText
27633
27637
  });
@@ -27637,7 +27641,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27637
27641
  // bitmarkAst -> bits -> bitsValue -> reasonableNumOfChars
27638
27642
  // bitmarkAst -> bits -> bitsValue -> questions -> questionsValue -> reasonableNumOfChars
27639
27643
  leaf_reasonableNumOfChars(node, route) {
27640
- this.writeNL();
27641
27644
  this.writeProperty("reasonableNumOfChars", node.value, route, {
27642
27645
  format: TagFormat.plainText
27643
27646
  });
@@ -28644,7 +28647,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
28644
28647
  // bitmarkAst -> bits -> bitsValue -> * -> lang
28645
28648
  leaf_lang(node, route) {
28646
28649
  if (!node.value) return;
28647
- this.writeNL();
28648
28650
  this.writeProperty("lang", node.value, route, {
28649
28651
  format: TagFormat.boolean
28650
28652
  });
@@ -28652,7 +28654,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
28652
28654
  // bitmarkAst -> bits -> bitsValue -> * -> refAuthor
28653
28655
  enter_refAuthor(node, route) {
28654
28656
  if (!node.value) return;
28655
- this.writeNL();
28656
28657
  this.writeProperty("refAuthor", node.value, route, {
28657
28658
  format: TagFormat.plainText,
28658
28659
  array: true
@@ -28661,7 +28662,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
28661
28662
  // bitmarkAst -> bits -> bitsValue -> * -> refBookTitle
28662
28663
  leaf_refBookTitle(node, route) {
28663
28664
  if (!node.value) return;
28664
- this.writeNL();
28665
28665
  this.writeProperty("refBookTitle", node.value, route, {
28666
28666
  format: TagFormat.plainText,
28667
28667
  array: true
@@ -28670,7 +28670,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
28670
28670
  // bitmarkAst -> bits -> bitsValue -> * -> refPublisher
28671
28671
  enter_refPublisher(node, route) {
28672
28672
  if (!node.value) return;
28673
- this.writeNL();
28674
28673
  this.writeProperty("refPublisher", node.value, route, {
28675
28674
  format: TagFormat.plainText,
28676
28675
  array: true
@@ -28679,7 +28678,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
28679
28678
  // bitmarkAst -> bits -> bitsValue -> * -> refPublicationYear
28680
28679
  leaf_refPublicationYear(node, route) {
28681
28680
  if (!node.value) return;
28682
- this.writeNL();
28683
28681
  this.writeProperty("refPublicationYear", node.value, route, {
28684
28682
  format: TagFormat.plainText
28685
28683
  });
@@ -28687,7 +28685,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
28687
28685
  // bitmarkAst -> bits -> bitsValue -> * -> citationStyle
28688
28686
  leaf_citationStyle(node, route) {
28689
28687
  if (!node.value) return;
28690
- this.writeNL();
28691
28688
  this.writeProperty("citationStyle", node.value, route, {
28692
28689
  format: TagFormat.plainText
28693
28690
  });
@@ -29019,7 +29016,6 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
29019
29016
  const config = instance2.getBitConfig(bitType);
29020
29017
  const propertyConfig = instance2.getTagConfigForTag(config.tags, propertyConfigKey);
29021
29018
  if (!propertyConfig) return;
29022
- this.writeNL_IfNotChain(route);
29023
29019
  this.writeProperty(propertyConfig.tag, node.value, route, {
29024
29020
  format: propertyConfig.format ?? TagFormat.plainText,
29025
29021
  array: propertyConfig.array ?? false,
@@ -29403,7 +29399,7 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
29403
29399
  if (options.ignoreFalse && val === false) continue;
29404
29400
  if (options.ignoreTrue && val === true) continue;
29405
29401
  if (!options.writeEmpty && val === "") continue;
29406
- if (propertyIndex > 0) this.writeNL_IfNotChain(route);
29402
+ if (!options.forceChain && propertyIndex === 0) this.writeNL_IfNotChain(route);
29407
29403
  this.writeOPA();
29408
29404
  this.writeTagKey(name);
29409
29405
  this.writeColon();
@@ -30676,7 +30672,7 @@ var JsonGenerator = class extends AstWalkerGenerator {
30676
30672
  }
30677
30673
  if (instance2.isOfBitType(bitType, BitType.book)) {
30678
30674
  if (bitJson.maxTocChapterLevel == null) bitJson.maxTocChapterLevel = -1;
30679
- if (bitJson.allowPrint == null) bitJson.allowPrint = false;
30675
+ if (bitJson.allowPrint == null) bitJson.allowPrint = "enforceFalse";
30680
30676
  if (bitJson.hasPrintRestriction == null) bitJson.hasPrintRestriction = true;
30681
30677
  if (bitJson.enforceUpdateOverUserInput == null) bitJson.enforceUpdateOverUserInput = false;
30682
30678
  if (bitJson.hasMarkAsDone == null) bitJson.hasMarkAsDone = false;
@@ -34418,6 +34414,7 @@ function propertyContentProcessor(context, contentDepth, tagsConfig, content, ta
34418
34414
  chain: void 0,
34419
34415
  jsonKey: void 0,
34420
34416
  format: TagFormat.bitmarkText,
34417
+ values: void 0,
34421
34418
  defaultValue: void 0,
34422
34419
  deprecated: void 0
34423
34420
  })