@gmb/bitmark-parser-generator 4.16.0 → 4.17.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.cjs CHANGED
@@ -305,8 +305,8 @@ var BitType = (0, import_superenum.superenum)({
305
305
  extractorAiChat: "extractor-ai-chat",
306
306
  extractorBlock: "extractor-block",
307
307
  extractorConfiguration: "extractor-configuration",
308
- extractorImages: "extractor-images",
309
- extractorImagesCollapsible: "extractor-images-collapsible",
308
+ extractorImage: "extractor-image",
309
+ extractorImageCollapsible: "extractor-image-collapsible",
310
310
  extractorInformation: "extractor-information",
311
311
  extractorPage: "extractor-page",
312
312
  extractorPageCollapsible: "extractor-page-collapsible",
@@ -1328,6 +1328,7 @@ var propertyKeys = {
1328
1328
  // Deprecated, replaced by person
1329
1329
  property_path: "@path",
1330
1330
  property_platformBackgroundColor: "@platformBackgroundColor",
1331
+ property_platformBorderColor: "@platformBorderColor",
1331
1332
  property_platformBrandTarget: "@platformBrandTarget",
1332
1333
  property_platformButtonBackgroundColor: "@platformButtonBackgroundColor",
1333
1334
  property_platformButtonPrimaryColor: "@platformButtonPrimaryColor",
@@ -1338,6 +1339,8 @@ var propertyKeys = {
1338
1339
  property_platformScrollbarColor: "@platformScrollbarColor",
1339
1340
  property_platformSecondaryColor: "@platformSecondaryColor",
1340
1341
  property_platformSelectionColor: "@platformSelectionColor",
1342
+ property_platformSelectionTextColor: "@platformSelectionTextColor",
1343
+ property_platformBaseLayerColor: "@platformBaseLayerColor",
1341
1344
  property_platformSeparatorColor: "@platformSeparatorColor",
1342
1345
  property_platformTextSelectionColor: "@platformTextSelectionColor",
1343
1346
  property_person: "@person",
@@ -1382,6 +1385,7 @@ var propertyKeys = {
1382
1385
  property_scormSource: "@scormSource",
1383
1386
  property_search: "@search",
1384
1387
  property_searchIndex: "@searchIndex",
1388
+ property_selected: "@selected",
1385
1389
  property_servings: "@servings",
1386
1390
  property_showInIndex: "@showInIndex",
1387
1391
  property_showSubtitles: "@showSubtitles",
@@ -3586,6 +3590,21 @@ var GROUPS = {
3586
3590
  key: ConfigKey.property_platformMessageBackgroundColor,
3587
3591
  description: "The platform section chat message background color",
3588
3592
  format: TagFormat.plainText
3593
+ },
3594
+ {
3595
+ key: ConfigKey.property_platformBorderColor,
3596
+ description: "The platform border color",
3597
+ format: TagFormat.plainText
3598
+ },
3599
+ {
3600
+ key: ConfigKey.property_platformSelectionTextColor,
3601
+ description: "The platform selection text color",
3602
+ format: TagFormat.plainText
3603
+ },
3604
+ {
3605
+ key: ConfigKey.property_platformBaseLayerColor,
3606
+ description: "The platform base layer color",
3607
+ format: TagFormat.plainText
3589
3608
  }
3590
3609
  ]
3591
3610
  },
@@ -3660,6 +3679,12 @@ var GROUPS = {
3660
3679
  description: "The search text for the resource",
3661
3680
  format: TagFormat.plainText
3662
3681
  },
3682
+ {
3683
+ key: ConfigKey.property_selected,
3684
+ description: "If true, the resource is selected",
3685
+ format: TagFormat.boolean,
3686
+ defaultValue: "false"
3687
+ },
3663
3688
  {
3664
3689
  key: ConfigKey.property_srcAlt,
3665
3690
  description: "An alternative source for the resource",
@@ -7162,7 +7187,7 @@ var BITS = {
7162
7187
  description: "Extractor configuration bit, used to configure extractors in articles or books",
7163
7188
  textFormatDefault: TextFormat.plainText
7164
7189
  },
7165
- [BitType.extractorImages]: {
7190
+ [BitType.extractorImage]: {
7166
7191
  since: "4.3.0",
7167
7192
  baseBitType: BitType._standard,
7168
7193
  description: "Extractor images bit, used for images extracted from PDFs",
@@ -7182,9 +7207,9 @@ var BITS = {
7182
7207
  resourceAttachmentAllowed: false,
7183
7208
  textFormatDefault: TextFormat.plainText
7184
7209
  },
7185
- [BitType.extractorImagesCollapsible]: {
7210
+ [BitType.extractorImageCollapsible]: {
7186
7211
  since: "4.3.0",
7187
- baseBitType: BitType.extractorImages,
7212
+ baseBitType: BitType.extractorImage,
7188
7213
  description: "Collapsible extractor images bit, used for images extracted from PDFs"
7189
7214
  },
7190
7215
  [BitType.extractorInformation]: {
@@ -10189,7 +10214,7 @@ var instance2 = new Config();
10189
10214
  // src/generated/package_info.ts
10190
10215
  var PACKAGE_INFO = {
10191
10216
  "name": "@gmb/bitmark-parser-generator",
10192
- "version": "4.16.0",
10217
+ "version": "4.17.0",
10193
10218
  "author": "Get More Brain Ltd",
10194
10219
  "license": "ISC",
10195
10220
  "description": "A bitmark parser and generator using Peggy.js"
@@ -10945,6 +10970,12 @@ var NodeType = (0, import_superenum20.superenum)({
10945
10970
  platformMessageBackgroundColorValue: "platformMessageBackgroundColorValue",
10946
10971
  platformBackgroundImage: "platformBackgroundImage",
10947
10972
  platformBackgroundImageValue: "platformBackgroundImageValue",
10973
+ platformBorderColor: "platformBorderColor",
10974
+ platformBorderColorValue: "platformBorderColorValue",
10975
+ platformSelectionTextColor: "platformSelectionTextColor",
10976
+ platformSelectionTextColorValue: "platformSelectionTextColorValue",
10977
+ platformBaseLayerColor: "platformBaseLayerColor",
10978
+ platformBaseLayerColorValue: "platformBaseLayerColorValue",
10948
10979
  person: "person",
10949
10980
  pointerLeft: "pointerLeft",
10950
10981
  pointerLeftValue: "pointerLeftValue",
@@ -11060,6 +11091,7 @@ var NodeType = (0, import_superenum20.superenum)({
11060
11091
  searchValue: "searchValue",
11061
11092
  section: "section",
11062
11093
  select: "select",
11094
+ selected: "selected",
11063
11095
  servings: "servings",
11064
11096
  servingsValue: "servingsValue",
11065
11097
  showInIndex: "showInIndex",
@@ -22522,7 +22554,8 @@ var ResourceBuilder = class extends BaseBuilder {
22522
22554
  license: data.license,
22523
22555
  copyright: data.copyright,
22524
22556
  showInIndex: data.showInIndex,
22525
- search: data.search
22557
+ search: data.search,
22558
+ selected: data.selected
22526
22559
  });
22527
22560
  return node;
22528
22561
  }
@@ -22687,7 +22720,8 @@ var ResourceBuilder = class extends BaseBuilder {
22687
22720
  copyright,
22688
22721
  showInIndex,
22689
22722
  caption,
22690
- search
22723
+ search,
22724
+ selected
22691
22725
  } = data;
22692
22726
  const { bitType } = context;
22693
22727
  let zoomDisabledDefault = false;
@@ -22696,7 +22730,7 @@ var ResourceBuilder = class extends BaseBuilder {
22696
22730
  BitType.pageBanner,
22697
22731
  BitType.imagesLogoGrave,
22698
22732
  BitType.prototypeImages,
22699
- BitType.extractorImages
22733
+ BitType.extractorImage
22700
22734
  ])) {
22701
22735
  zoomDisabledDefault = true;
22702
22736
  }
@@ -22721,11 +22755,12 @@ var ResourceBuilder = class extends BaseBuilder {
22721
22755
  copyright: copyright ?? "",
22722
22756
  showInIndex: showInIndex ?? false,
22723
22757
  caption: this.handleJsonText(context, TextLocation.tag, caption),
22724
- search: search ?? void 0
22758
+ search: search ?? void 0,
22759
+ selected: selected ?? false
22725
22760
  }
22726
22761
  };
22727
22762
  objectUtils.removeUnwantedProperties(node.image, {
22728
- ignoreFalse: ["zoomDisabled", "showInIndex"],
22763
+ ignoreFalse: ["zoomDisabled", "showInIndex", "selected"],
22729
22764
  ignoreEmptyArrays: ["caption"],
22730
22765
  ignoreUndefined: ["width", "height"],
22731
22766
  ignoreEmptyString: ["src", "alt", "license", "copyright"]
@@ -22754,7 +22789,8 @@ var ResourceBuilder = class extends BaseBuilder {
22754
22789
  copyright,
22755
22790
  showInIndex,
22756
22791
  caption,
22757
- search
22792
+ search,
22793
+ selected
22758
22794
  } = data;
22759
22795
  const node = {
22760
22796
  type: ResourceType.imageLink,
@@ -22779,11 +22815,12 @@ var ResourceBuilder = class extends BaseBuilder {
22779
22815
  copyright: copyright ?? "",
22780
22816
  showInIndex: showInIndex ?? false,
22781
22817
  caption: this.handleJsonText(context, TextLocation.tag, caption),
22782
- search: search ?? void 0
22818
+ search: search ?? void 0,
22819
+ selected: selected ?? false
22783
22820
  }
22784
22821
  };
22785
22822
  objectUtils.removeUnwantedProperties(node.imageLink, {
22786
- ignoreFalse: ["zoomDisabled", "showInIndex"],
22823
+ ignoreFalse: ["zoomDisabled", "showInIndex", "selected"],
22787
22824
  ignoreEmptyArrays: ["caption"],
22788
22825
  ignoreUndefined: ["width", "height"],
22789
22826
  ignoreEmptyString: ["url", "alt", "license", "copyright"]
@@ -22807,7 +22844,8 @@ var ResourceBuilder = class extends BaseBuilder {
22807
22844
  copyright,
22808
22845
  showInIndex,
22809
22846
  caption,
22810
- search
22847
+ search,
22848
+ selected
22811
22849
  } = data;
22812
22850
  const node = {
22813
22851
  type: ResourceType.audio,
@@ -22825,13 +22863,14 @@ var ResourceBuilder = class extends BaseBuilder {
22825
22863
  copyright: copyright ?? "",
22826
22864
  showInIndex: showInIndex ?? false,
22827
22865
  caption: this.handleJsonText(context, TextLocation.tag, caption),
22828
- search: search ?? void 0
22866
+ search: search ?? void 0,
22867
+ selected: selected ?? false
22829
22868
  }
22830
22869
  };
22831
22870
  objectUtils.removeUnwantedProperties(node.audio, {
22832
22871
  ignoreEmptyArrays: ["caption"],
22833
22872
  ignoreEmptyString: ["src", "alt", "license", "copyright"],
22834
- ignoreFalse: ["showInIndex"]
22873
+ ignoreFalse: ["showInIndex", "selected"]
22835
22874
  });
22836
22875
  return nodeValidator.validateResource(node);
22837
22876
  }
@@ -22852,7 +22891,8 @@ var ResourceBuilder = class extends BaseBuilder {
22852
22891
  copyright,
22853
22892
  showInIndex,
22854
22893
  caption,
22855
- search
22894
+ search,
22895
+ selected
22856
22896
  } = data;
22857
22897
  const node = {
22858
22898
  type: ResourceType.audioEmbed,
@@ -22870,7 +22910,8 @@ var ResourceBuilder = class extends BaseBuilder {
22870
22910
  copyright: copyright ?? "",
22871
22911
  showInIndex: showInIndex ?? false,
22872
22912
  caption: this.handleJsonText(context, TextLocation.tag, caption),
22873
- search: search ?? void 0
22913
+ search: search ?? void 0,
22914
+ selected: selected ?? false
22874
22915
  }
22875
22916
  };
22876
22917
  objectUtils.removeUnwantedProperties(node.audioEmbed, {
@@ -22881,7 +22922,7 @@ var ResourceBuilder = class extends BaseBuilder {
22881
22922
  "license",
22882
22923
  "copyright"
22883
22924
  ],
22884
- ignoreFalse: ["showInIndex"]
22925
+ ignoreFalse: ["showInIndex", "selected"]
22885
22926
  });
22886
22927
  return nodeValidator.validateResource(node);
22887
22928
  }
@@ -22902,7 +22943,8 @@ var ResourceBuilder = class extends BaseBuilder {
22902
22943
  copyright,
22903
22944
  showInIndex,
22904
22945
  caption,
22905
- search
22946
+ search,
22947
+ selected
22906
22948
  } = data;
22907
22949
  const node = {
22908
22950
  type: ResourceType.audioLink,
@@ -22921,7 +22963,8 @@ var ResourceBuilder = class extends BaseBuilder {
22921
22963
  copyright: copyright ?? "",
22922
22964
  showInIndex: showInIndex ?? false,
22923
22965
  caption: this.handleJsonText(context, TextLocation.tag, caption),
22924
- search: search ?? void 0
22966
+ search: search ?? void 0,
22967
+ selected: selected ?? false
22925
22968
  }
22926
22969
  };
22927
22970
  objectUtils.removeUnwantedProperties(node.audioLink, {
@@ -22929,7 +22972,8 @@ var ResourceBuilder = class extends BaseBuilder {
22929
22972
  ignoreEmptyString: [
22930
22973
  "url"
22931
22974
  /*'alt', 'license', 'copyright'*/
22932
- ]
22975
+ ],
22976
+ ignoreFalse: ["selected"]
22933
22977
  });
22934
22978
  return nodeValidator.validateResource(node);
22935
22979
  }
@@ -22957,7 +23001,8 @@ var ResourceBuilder = class extends BaseBuilder {
22957
23001
  copyright,
22958
23002
  showInIndex,
22959
23003
  caption,
22960
- search
23004
+ search,
23005
+ selected
22961
23006
  } = data;
22962
23007
  const node = {
22963
23008
  type: ResourceType.video,
@@ -22981,6 +23026,7 @@ var ResourceBuilder = class extends BaseBuilder {
22981
23026
  showInIndex: showInIndex ?? false,
22982
23027
  caption: this.handleJsonText(context, TextLocation.tag, caption),
22983
23028
  search: search ?? void 0,
23029
+ selected: selected ?? false,
22984
23030
  // Have sub-chains so must be at end of chain
22985
23031
  posterImage: posterImage ?? void 0,
22986
23032
  thumbnails: thumbnails ?? void 0
@@ -22995,7 +23041,7 @@ var ResourceBuilder = class extends BaseBuilder {
22995
23041
  "license",
22996
23042
  "copyright"
22997
23043
  ],
22998
- ignoreFalse: ["showInIndex"]
23044
+ ignoreFalse: ["showInIndex", "selected"]
22999
23045
  });
23000
23046
  return nodeValidator.validateResource(node);
23001
23047
  }
@@ -23023,7 +23069,8 @@ var ResourceBuilder = class extends BaseBuilder {
23023
23069
  copyright,
23024
23070
  showInIndex,
23025
23071
  caption,
23026
- search
23072
+ search,
23073
+ selected
23027
23074
  } = data;
23028
23075
  const node = {
23029
23076
  type: ResourceType.videoEmbed,
@@ -23049,7 +23096,8 @@ var ResourceBuilder = class extends BaseBuilder {
23049
23096
  copyright: copyright ?? "",
23050
23097
  showInIndex: showInIndex ?? false,
23051
23098
  caption: this.handleJsonText(context, TextLocation.tag, caption),
23052
- search: search ?? void 0
23099
+ search: search ?? void 0,
23100
+ selected: selected ?? false
23053
23101
  }
23054
23102
  };
23055
23103
  objectUtils.removeUnwantedProperties(node.videoEmbed, {
@@ -23061,7 +23109,7 @@ var ResourceBuilder = class extends BaseBuilder {
23061
23109
  "license",
23062
23110
  "copyright"
23063
23111
  ],
23064
- ignoreFalse: ["showInIndex"]
23112
+ ignoreFalse: ["showInIndex", "selected"]
23065
23113
  });
23066
23114
  return nodeValidator.validateResource(node);
23067
23115
  }
@@ -23089,7 +23137,8 @@ var ResourceBuilder = class extends BaseBuilder {
23089
23137
  copyright,
23090
23138
  showInIndex,
23091
23139
  caption,
23092
- search
23140
+ search,
23141
+ selected
23093
23142
  } = data;
23094
23143
  const node = {
23095
23144
  type: ResourceType.videoLink,
@@ -23115,7 +23164,8 @@ var ResourceBuilder = class extends BaseBuilder {
23115
23164
  copyright: copyright ?? "",
23116
23165
  showInIndex: showInIndex ?? false,
23117
23166
  caption: this.handleJsonText(context, TextLocation.tag, caption),
23118
- search: search ?? void 0
23167
+ search: search ?? void 0,
23168
+ selected: selected ?? false
23119
23169
  }
23120
23170
  };
23121
23171
  objectUtils.removeUnwantedProperties(node.videoLink, {
@@ -23127,7 +23177,7 @@ var ResourceBuilder = class extends BaseBuilder {
23127
23177
  "license",
23128
23178
  "copyright"
23129
23179
  ],
23130
- ignoreFalse: ["showInIndex"]
23180
+ ignoreFalse: ["showInIndex", "selected"]
23131
23181
  });
23132
23182
  return nodeValidator.validateResource(node);
23133
23183
  }
@@ -23175,7 +23225,8 @@ var ResourceBuilder = class extends BaseBuilder {
23175
23225
  copyright,
23176
23226
  showInIndex,
23177
23227
  caption,
23178
- search
23228
+ search,
23229
+ selected
23179
23230
  } = data;
23180
23231
  const node = {
23181
23232
  type: ResourceType.stillImageFilmEmbed,
@@ -23201,7 +23252,8 @@ var ResourceBuilder = class extends BaseBuilder {
23201
23252
  copyright: copyright ?? "",
23202
23253
  showInIndex: showInIndex ?? false,
23203
23254
  caption: this.handleJsonText(context, TextLocation.tag, caption),
23204
- search: search ?? void 0
23255
+ search: search ?? void 0,
23256
+ selected: selected ?? false
23205
23257
  }
23206
23258
  };
23207
23259
  objectUtils.removeUnwantedProperties(node.stillImageFilmEmbed, {
@@ -23213,7 +23265,7 @@ var ResourceBuilder = class extends BaseBuilder {
23213
23265
  "license",
23214
23266
  "copyright"
23215
23267
  ],
23216
- ignoreFalse: ["showInIndex"]
23268
+ ignoreFalse: ["showInIndex", "selected"]
23217
23269
  });
23218
23270
  return nodeValidator.validateResource(node);
23219
23271
  }
@@ -23241,7 +23293,8 @@ var ResourceBuilder = class extends BaseBuilder {
23241
23293
  copyright,
23242
23294
  showInIndex,
23243
23295
  caption,
23244
- search
23296
+ search,
23297
+ selected
23245
23298
  } = data;
23246
23299
  const node = {
23247
23300
  type: ResourceType.stillImageFilmLink,
@@ -23267,7 +23320,8 @@ var ResourceBuilder = class extends BaseBuilder {
23267
23320
  copyright: copyright ?? "",
23268
23321
  showInIndex: showInIndex ?? false,
23269
23322
  caption: this.handleJsonText(context, TextLocation.tag, caption),
23270
- search: search ?? void 0
23323
+ search: search ?? void 0,
23324
+ selected: selected ?? false
23271
23325
  }
23272
23326
  };
23273
23327
  objectUtils.removeUnwantedProperties(node.stillImageFilmLink, {
@@ -23279,7 +23333,7 @@ var ResourceBuilder = class extends BaseBuilder {
23279
23333
  "license",
23280
23334
  "copyright"
23281
23335
  ],
23282
- ignoreFalse: ["showInIndex"]
23336
+ ignoreFalse: ["showInIndex", "selected"]
23283
23337
  });
23284
23338
  return nodeValidator.validateResource(node);
23285
23339
  }
@@ -23290,7 +23344,7 @@ var ResourceBuilder = class extends BaseBuilder {
23290
23344
  * @returns
23291
23345
  */
23292
23346
  articleResource(context, data) {
23293
- const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
23347
+ const { value, srcAlt, license, copyright, showInIndex, caption, search, selected } = data;
23294
23348
  const node = {
23295
23349
  type: ResourceType.article,
23296
23350
  __typeAlias: ResourceType.article,
@@ -23304,12 +23358,14 @@ var ResourceBuilder = class extends BaseBuilder {
23304
23358
  copyright: copyright ?? "",
23305
23359
  showInIndex: showInIndex ?? false,
23306
23360
  caption: this.handleJsonText(context, TextLocation.tag, caption),
23307
- search: search ?? void 0
23361
+ search: search ?? void 0,
23362
+ selected: selected ?? false
23308
23363
  }
23309
23364
  };
23310
23365
  objectUtils.removeUnwantedProperties(node.article, {
23311
23366
  ignoreEmptyArrays: ["caption"],
23312
- ignoreEmptyString: ["body", "alt", "license", "copyright"]
23367
+ ignoreEmptyString: ["body", "alt", "license", "copyright"],
23368
+ ignoreFalse: ["selected"]
23313
23369
  });
23314
23370
  return nodeValidator.validateResource(node);
23315
23371
  }
@@ -23320,7 +23376,7 @@ var ResourceBuilder = class extends BaseBuilder {
23320
23376
  * @returns
23321
23377
  */
23322
23378
  documentResource(context, data) {
23323
- const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
23379
+ const { value, srcAlt, license, copyright, showInIndex, caption, search, selected } = data;
23324
23380
  const node = {
23325
23381
  type: ResourceType.document,
23326
23382
  __typeAlias: ResourceType.document,
@@ -23334,13 +23390,14 @@ var ResourceBuilder = class extends BaseBuilder {
23334
23390
  copyright: copyright ?? "",
23335
23391
  showInIndex: showInIndex ?? false,
23336
23392
  caption: this.handleJsonText(context, TextLocation.tag, caption),
23337
- search: search ?? void 0
23393
+ search: search ?? void 0,
23394
+ selected: selected ?? false
23338
23395
  }
23339
23396
  };
23340
23397
  objectUtils.removeUnwantedProperties(node.document, {
23341
23398
  ignoreEmptyArrays: ["caption"],
23342
23399
  ignoreEmptyString: ["url", "alt", "license", "copyright"],
23343
- ignoreFalse: ["showInIndex"]
23400
+ ignoreFalse: ["showInIndex", "selected"]
23344
23401
  });
23345
23402
  return nodeValidator.validateResource(node);
23346
23403
  }
@@ -23351,7 +23408,7 @@ var ResourceBuilder = class extends BaseBuilder {
23351
23408
  * @returns
23352
23409
  */
23353
23410
  documentEmbedResource(context, data) {
23354
- const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
23411
+ const { value, srcAlt, license, copyright, showInIndex, caption, search, selected } = data;
23355
23412
  const node = {
23356
23413
  type: ResourceType.documentEmbed,
23357
23414
  __typeAlias: ResourceType.documentEmbed,
@@ -23365,13 +23422,14 @@ var ResourceBuilder = class extends BaseBuilder {
23365
23422
  copyright: copyright ?? "",
23366
23423
  showInIndex: showInIndex ?? false,
23367
23424
  caption: this.handleJsonText(context, TextLocation.tag, caption),
23368
- search: search ?? void 0
23425
+ search: search ?? void 0,
23426
+ selected: selected ?? false
23369
23427
  }
23370
23428
  };
23371
23429
  objectUtils.removeUnwantedProperties(node.documentEmbed, {
23372
23430
  ignoreEmptyArrays: ["caption"],
23373
23431
  ignoreEmptyString: ["url", "alt", "license", "copyright"],
23374
- ignoreFalse: ["showInIndex"]
23432
+ ignoreFalse: ["showInIndex", "selected"]
23375
23433
  });
23376
23434
  return nodeValidator.validateResource(node);
23377
23435
  }
@@ -23382,7 +23440,7 @@ var ResourceBuilder = class extends BaseBuilder {
23382
23440
  * @returns
23383
23441
  */
23384
23442
  documentLinkResource(context, data) {
23385
- const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
23443
+ const { value, srcAlt, license, copyright, showInIndex, caption, search, selected } = data;
23386
23444
  const node = {
23387
23445
  type: ResourceType.documentLink,
23388
23446
  __typeAlias: ResourceType.documentLink,
@@ -23396,13 +23454,14 @@ var ResourceBuilder = class extends BaseBuilder {
23396
23454
  copyright: copyright ?? "",
23397
23455
  showInIndex: showInIndex ?? false,
23398
23456
  caption: this.handleJsonText(context, TextLocation.tag, caption),
23399
- search: search ?? void 0
23457
+ search: search ?? void 0,
23458
+ selected: selected ?? false
23400
23459
  }
23401
23460
  };
23402
23461
  objectUtils.removeUnwantedProperties(node.documentLink, {
23403
23462
  ignoreEmptyArrays: ["caption"],
23404
23463
  ignoreEmptyString: ["url", "alt", "license", "copyright"],
23405
- ignoreFalse: ["showInIndex"]
23464
+ ignoreFalse: ["showInIndex", "selected"]
23406
23465
  });
23407
23466
  return nodeValidator.validateResource(node);
23408
23467
  }
@@ -23413,7 +23472,7 @@ var ResourceBuilder = class extends BaseBuilder {
23413
23472
  * @returns
23414
23473
  */
23415
23474
  documentDownloadResource(context, data) {
23416
- const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
23475
+ const { value, srcAlt, license, copyright, showInIndex, caption, search, selected } = data;
23417
23476
  const node = {
23418
23477
  type: ResourceType.documentDownload,
23419
23478
  __typeAlias: ResourceType.documentDownload,
@@ -23427,13 +23486,14 @@ var ResourceBuilder = class extends BaseBuilder {
23427
23486
  copyright: copyright ?? "",
23428
23487
  showInIndex: showInIndex ?? false,
23429
23488
  caption: this.handleJsonText(context, TextLocation.tag, caption),
23430
- search: search ?? void 0
23489
+ search: search ?? void 0,
23490
+ selected: selected ?? false
23431
23491
  }
23432
23492
  };
23433
23493
  objectUtils.removeUnwantedProperties(node.documentDownload, {
23434
23494
  ignoreEmptyArrays: ["caption"],
23435
23495
  ignoreEmptyString: ["url", "alt", "license", "copyright"],
23436
- ignoreFalse: ["showInIndex"]
23496
+ ignoreFalse: ["showInIndex", "selected"]
23437
23497
  });
23438
23498
  return nodeValidator.validateResource(node);
23439
23499
  }
@@ -23444,7 +23504,7 @@ var ResourceBuilder = class extends BaseBuilder {
23444
23504
  * @returns
23445
23505
  */
23446
23506
  appLinkResource(context, data) {
23447
- const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
23507
+ const { value, srcAlt, license, copyright, showInIndex, caption, search, selected } = data;
23448
23508
  const node = {
23449
23509
  type: ResourceType.appLink,
23450
23510
  __typeAlias: ResourceType.appLink,
@@ -23459,7 +23519,8 @@ var ResourceBuilder = class extends BaseBuilder {
23459
23519
  copyright: copyright ?? "",
23460
23520
  showInIndex: showInIndex ?? false,
23461
23521
  caption: this.handleJsonText(context, TextLocation.tag, caption),
23462
- search: search ?? void 0
23522
+ search: search ?? void 0,
23523
+ selected: selected ?? false
23463
23524
  }
23464
23525
  };
23465
23526
  objectUtils.removeUnwantedProperties(node.appLink, {
@@ -23470,7 +23531,7 @@ var ResourceBuilder = class extends BaseBuilder {
23470
23531
  "license",
23471
23532
  "copyright"
23472
23533
  ],
23473
- ignoreFalse: ["showInIndex"]
23534
+ ignoreFalse: ["showInIndex", "selected"]
23474
23535
  });
23475
23536
  return nodeValidator.validateResource(node);
23476
23537
  }
@@ -23489,7 +23550,8 @@ var ResourceBuilder = class extends BaseBuilder {
23489
23550
  copyright,
23490
23551
  showInIndex,
23491
23552
  caption,
23492
- search
23553
+ search,
23554
+ selected
23493
23555
  } = data;
23494
23556
  const node = {
23495
23557
  type: ResourceType.websiteLink,
@@ -23505,13 +23567,14 @@ var ResourceBuilder = class extends BaseBuilder {
23505
23567
  copyright: copyright ?? "",
23506
23568
  showInIndex: showInIndex ?? false,
23507
23569
  caption: this.handleJsonText(context, TextLocation.tag, caption),
23508
- search: search ?? void 0
23570
+ search: search ?? void 0,
23571
+ selected: selected ?? false
23509
23572
  }
23510
23573
  };
23511
23574
  objectUtils.removeUnwantedProperties(node.websiteLink, {
23512
23575
  ignoreEmptyArrays: ["caption"],
23513
23576
  ignoreEmptyString: ["url", "alt", "license", "copyright"],
23514
- ignoreFalse: ["showInIndex"]
23577
+ ignoreFalse: ["showInIndex", "selected"]
23515
23578
  });
23516
23579
  return nodeValidator.validateResource(node);
23517
23580
  }
@@ -24450,6 +24513,24 @@ var Builder = class extends BaseBuilder {
24450
24513
  options
24451
24514
  ),
24452
24515
  platformBackgroundImage: this.toImageResource(context, data.platformBackgroundImage),
24516
+ platformBorderColor: this.toAstProperty(
24517
+ bitType,
24518
+ ConfigKey.property_platformBorderColor,
24519
+ data.platformBorderColor,
24520
+ options
24521
+ ),
24522
+ platformSelectionTextColor: this.toAstProperty(
24523
+ bitType,
24524
+ ConfigKey.property_platformSelectionTextColor,
24525
+ data.platformSelectionTextColor,
24526
+ options
24527
+ ),
24528
+ platformBaseLayerColor: this.toAstProperty(
24529
+ bitType,
24530
+ ConfigKey.property_platformBaseLayerColor,
24531
+ data.platformBaseLayerColor,
24532
+ options
24533
+ ),
24453
24534
  productId: this.toAstProperty(bitType, ConfigKey.property_productId, data.productId, options),
24454
24535
  product: this.toAstProperty(bitType, ConfigKey.property_product, data.product, options),
24455
24536
  // productList: this.toAstProperty(
@@ -28205,7 +28286,7 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
28205
28286
  BitType.pageBanner,
28206
28287
  BitType.imagesLogoGrave,
28207
28288
  BitType.prototypeImages,
28208
- BitType.extractorImages
28289
+ BitType.extractorImage
28209
28290
  ])) {
28210
28291
  this.writeProperty("zoomDisabled", node.value, route, {
28211
28292
  format: TagFormat.boolean,
@@ -28258,6 +28339,14 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
28258
28339
  format: TagFormat.plainText
28259
28340
  });
28260
28341
  }
28342
+ leaf_selected(node, route) {
28343
+ if (node.value == null) return;
28344
+ this.writeNL_IfNotChain(route);
28345
+ this.writeProperty("selected", node.value, route, {
28346
+ format: TagFormat.boolean,
28347
+ ignoreFalse: true
28348
+ });
28349
+ }
28261
28350
  // bitmarkAst -> bits -> bitsValue -> resource -> ...
28262
28351
  // bitmarkAst -> bits -> bitsValue -> resource -> posterImage -> ...
28263
28352
  // bitmarkAst -> bits -> bitsValue -> resource -> thumbnails -> thumbnailsValue -> ...
@@ -29430,7 +29519,7 @@ var JsonGenerator = class extends AstWalkerGenerator {
29430
29519
  } else if (instance2.isOfBitType(bitType, [
29431
29520
  BitType.imagesLogoGrave,
29432
29521
  BitType.prototypeImages,
29433
- BitType.extractorImages
29522
+ BitType.extractorImage
29434
29523
  ])) {
29435
29524
  const images = [];
29436
29525
  for (const r of resources) {
@@ -30011,7 +30100,7 @@ var JsonGenerator = class extends AstWalkerGenerator {
30011
30100
  if (instance2.isOfBitType(bitType, [
30012
30101
  BitType.imagesLogoGrave,
30013
30102
  BitType.prototypeImages,
30014
- BitType.extractorImages
30103
+ BitType.extractorImage
30015
30104
  ])) {
30016
30105
  if (bitType === BitType.imagesLogoGrave) {
30017
30106
  if (bitJson.logos == null) {
@@ -30443,7 +30532,7 @@ var JsonParser = class {
30443
30532
  processResources(bitType, resource, images, logos) {
30444
30533
  const nodes = [];
30445
30534
  if (resource) nodes.push(resource);
30446
- if (instance2.isOfBitType(bitType, [BitType.prototypeImages, BitType.extractorImages])) {
30535
+ if (instance2.isOfBitType(bitType, [BitType.prototypeImages, BitType.extractorImage])) {
30447
30536
  if (Array.isArray(images)) {
30448
30537
  for (const image of images) {
30449
30538
  if (image) nodes.push(image);
@@ -38413,6 +38502,8 @@ var ConfigBuilder = class {
38413
38502
  this.buildFlat(opts);
38414
38503
  const bitConfigs = [];
38415
38504
  const groupConfigs = [];
38505
+ const bitGroupConfigKeys = [];
38506
+ const bitGroupConfigs = [];
38416
38507
  for (const bt of BitType.values()) {
38417
38508
  const bitType = instance2.getBitType(bt);
38418
38509
  const _bitConfig = BITS[bitType];
@@ -38436,8 +38527,101 @@ var ConfigBuilder = class {
38436
38527
  import_fs_extra3.default.ensureDirSync(outputFolderBits);
38437
38528
  import_fs_extra3.default.ensureDirSync(outputFolderGroups);
38438
38529
  const fileWrites = [];
38530
+ const keyToJsonKey = (key, tagNameChain) => {
38531
+ let jsonKey = key;
38532
+ if (key === "%") {
38533
+ jsonKey = "item_todo";
38534
+ } else if (key === "!") {
38535
+ jsonKey = "instruction";
38536
+ } else if (key === "?") {
38537
+ jsonKey = "hint";
38538
+ } else if (key === "#") {
38539
+ jsonKey = "title";
38540
+ } else if (key === "##") {
38541
+ jsonKey = "subTitle";
38542
+ } else if (key === "\u25BC") {
38543
+ jsonKey = "anchor";
38544
+ } else if (key === "\u25BA") {
38545
+ jsonKey = "reference";
38546
+ } else if (key === "$") {
38547
+ jsonKey = "sampleSolution";
38548
+ } else if (key === "+") {
38549
+ jsonKey = "true_todo";
38550
+ } else if (key === "-") {
38551
+ jsonKey = "false_todo";
38552
+ } else if (key === "_") {
38553
+ jsonKey = "gap_todo";
38554
+ } else if (key === "=") {
38555
+ jsonKey = "mark_todo";
38556
+ } else if (key.startsWith("@")) {
38557
+ jsonKey = key.substring(1);
38558
+ } else if (key.startsWith("&")) {
38559
+ jsonKey = key.substring(1);
38560
+ }
38561
+ const thisChain = [...tagNameChain, jsonKey];
38562
+ jsonKey = thisChain.join(".");
38563
+ return jsonKey;
38564
+ };
38565
+ const processTagEntries = (tag, tagNameChain) => {
38566
+ const tags2 = [];
38567
+ let tagName = tag.key;
38568
+ const jsonKey = keyToJsonKey(tagName, tagNameChain);
38569
+ const tagType = typeFromConfigKey(tag.key);
38570
+ let format = "";
38571
+ let chain = void 0;
38572
+ if (tagType === BitTagConfigKeyType.tag) {
38573
+ tagName = tag.key;
38574
+ format = "bitmark--";
38575
+ } else if (tagType === BitTagConfigKeyType.property) {
38576
+ tagName = tag.key;
38577
+ if (tag.format === TagFormat.plainText) {
38578
+ format = "string";
38579
+ } else if (tag.format === TagFormat.boolean) {
38580
+ format = "bool";
38581
+ } else if (tag.format === TagFormat.bitmarkText) {
38582
+ format = "bitmark";
38583
+ } else if (tag.format === TagFormat.number) {
38584
+ format = "number";
38585
+ }
38586
+ } else if (tagType === BitTagConfigKeyType.resource) {
38587
+ format = "string";
38588
+ } else if (tagType === BitTagConfigKeyType.group) {
38589
+ let k = tag.key;
38590
+ if (k.startsWith("group_")) k = k.substring(6);
38591
+ k = /*'_' +*/
38592
+ stringUtils.camelToKebab(k);
38593
+ tags2.push({
38594
+ type: "group",
38595
+ key: k
38596
+ });
38597
+ return tags2;
38598
+ }
38599
+ if (Array.isArray(tag.chain) && tag.chain.length > 0) {
38600
+ const chainTags = [];
38601
+ for (const [_tagKey, chainTag] of tag.chain.entries()) {
38602
+ chainTags.push(...processTagEntries(chainTag, [...tagNameChain, jsonKey]));
38603
+ }
38604
+ chain = chainTags;
38605
+ }
38606
+ const t = {
38607
+ type: "tag",
38608
+ key: tagName,
38609
+ jsonKey,
38610
+ format,
38611
+ default: null,
38612
+ alwaysInclude: false,
38613
+ min: tag.minCount == null ? 0 : tag.minCount,
38614
+ max: tag.maxCount == null ? 1 : tag.maxCount,
38615
+ description: tag.description ?? "",
38616
+ tags: chain
38617
+ // raw: {
38618
+ // ...tag,
38619
+ // },
38620
+ };
38621
+ tags2.push(t);
38622
+ return tags2;
38623
+ };
38439
38624
  for (const b of bitConfigs) {
38440
- const inherits = [];
38441
38625
  const tags2 = [];
38442
38626
  const tagEntriesTypeOrder = [
38443
38627
  BitTagConfigKeyType.tag,
@@ -38454,77 +38638,15 @@ var ConfigBuilder = class {
38454
38638
  const typeOrder = tagEntriesTypeOrder.indexOf(typeA) - tagEntriesTypeOrder.indexOf(typeB);
38455
38639
  return typeOrder;
38456
38640
  });
38457
- if (b.baseBitType)
38458
- inherits.push({
38459
- type: "bit",
38460
- name: b.baseBitType
38641
+ if (b.baseBitType) {
38642
+ tags2.push({
38643
+ type: "group",
38644
+ key: `group-${b.baseBitType}`
38461
38645
  });
38646
+ bitGroupConfigKeys.push(b.baseBitType);
38647
+ }
38462
38648
  for (const [_tagKey, tag] of tagEntries) {
38463
- const tagName = tag.key;
38464
- let format = "";
38465
- let chain = void 0;
38466
- const tagType = typeFromConfigKey(tag.key);
38467
- if (tagType === BitTagConfigKeyType.tag) {
38468
- if (tagName === "%") {
38469
- chain = {
38470
- key: "%",
38471
- format,
38472
- min: tag.minCount,
38473
- max: tag.maxCount,
38474
- description: "Lead",
38475
- chain: {
38476
- key: "%",
38477
- format,
38478
- min: tag.minCount,
38479
- max: tag.maxCount,
38480
- description: "Page number",
38481
- chain: {
38482
- key: "%",
38483
- format,
38484
- min: tag.minCount,
38485
- max: tag.maxCount,
38486
- description: "Margin number"
38487
- }
38488
- }
38489
- };
38490
- }
38491
- format = "bitmark--";
38492
- } else if (tagType === BitTagConfigKeyType.property) {
38493
- if (tag.format === TagFormat.plainText) {
38494
- format = "string";
38495
- } else if (tag.format === TagFormat.boolean) {
38496
- format = "bool";
38497
- } else if (tag.format === TagFormat.bitmarkText) {
38498
- format = "bitmark";
38499
- } else if (tag.format === TagFormat.number) {
38500
- format = "number";
38501
- }
38502
- } else if (tagType === BitTagConfigKeyType.resource) {
38503
- } else if (tagType === BitTagConfigKeyType.group) {
38504
- let k = tag.key;
38505
- if (k.startsWith("group_")) k = k.substring(6);
38506
- k = /*'_' +*/
38507
- stringUtils.camelToKebab(k);
38508
- inherits.push({
38509
- type: "group",
38510
- name: k
38511
- });
38512
- continue;
38513
- }
38514
- const t = {
38515
- key: tagName,
38516
- format,
38517
- default: null,
38518
- alwaysInclude: false,
38519
- min: tag.minCount == null ? 0 : tag.minCount,
38520
- max: tag.maxCount == null ? 1 : tag.maxCount,
38521
- description: tag.description ?? "",
38522
- chain
38523
- // raw: {
38524
- // ...tag,
38525
- // },
38526
- };
38527
- tags2.push(t);
38649
+ tags2.push(...processTagEntries(tag, []));
38528
38650
  }
38529
38651
  const bitJson = {
38530
38652
  name: b.bitType,
@@ -38543,16 +38665,22 @@ var ConfigBuilder = class {
38543
38665
  footerAllowed: b.footerAllowed ?? true,
38544
38666
  footerRequired: b.footerRequired ?? false,
38545
38667
  resourceAttachmentAllowed: b.resourceAttachmentAllowed ?? true,
38546
- inherits,
38547
38668
  tags: tags2
38548
38669
  };
38549
38670
  const output = import_node_path3.default.join(outputFolderBits, `${b.bitType}.jsonc`);
38550
38671
  const str = JSON.stringify(bitJson, null, 2);
38551
38672
  fileWrites.push(import_fs_extra3.default.writeFile(output, str));
38552
38673
  }
38674
+ for (const bt of bitGroupConfigKeys) {
38675
+ const bitType = instance2.getBitType(bt);
38676
+ const _bitConfig = BITS[bitType];
38677
+ if (_bitConfig) {
38678
+ _bitConfig.bitType = bitType;
38679
+ bitGroupConfigs.push(_bitConfig);
38680
+ }
38681
+ }
38553
38682
  const writeGroupConfigs = (groupConfigs2) => {
38554
38683
  for (const g of groupConfigs2) {
38555
- const inherits = [];
38556
38684
  const tags2 = [];
38557
38685
  const groupKey = stringUtils.camelToKebab(g.key);
38558
38686
  const tagEntriesTypeOrder = [
@@ -38568,74 +38696,7 @@ var ConfigBuilder = class {
38568
38696
  return typeOrder;
38569
38697
  });
38570
38698
  for (const [_tagKey, tag] of tagEntries) {
38571
- let tagName = tag.key;
38572
- const tagType = typeFromConfigKey(tag.key);
38573
- let format = "";
38574
- let chain = void 0;
38575
- if (tagType === BitTagConfigKeyType.tag) {
38576
- tagName = tag.name;
38577
- if (tagName === "%") {
38578
- chain = {
38579
- key: "%",
38580
- format,
38581
- min: tag.minCount,
38582
- max: tag.maxCount,
38583
- description: "Lead",
38584
- chain: {
38585
- key: "%",
38586
- format,
38587
- min: tag.minCount,
38588
- max: tag.maxCount,
38589
- description: "Page number",
38590
- chain: {
38591
- key: "%",
38592
- format,
38593
- min: tag.minCount,
38594
- max: tag.maxCount,
38595
- description: "Margin number"
38596
- }
38597
- }
38598
- };
38599
- }
38600
- format = "bitmark--";
38601
- } else if (tagType === BitTagConfigKeyType.property) {
38602
- tagName = tag.key;
38603
- if (tag.format === TagFormat.plainText) {
38604
- format = "string";
38605
- } else if (tag.format === TagFormat.boolean) {
38606
- format = "bool";
38607
- } else if (tag.format === TagFormat.bitmarkText) {
38608
- format = "bitmark";
38609
- } else if (tag.format === TagFormat.number) {
38610
- format = "number";
38611
- }
38612
- } else if (tagType === BitTagConfigKeyType.resource) {
38613
- format = "string";
38614
- } else if (tagType === BitTagConfigKeyType.group) {
38615
- let k = tag.key;
38616
- if (k.startsWith("group_")) k = k.substring(6);
38617
- k = /*'_' +*/
38618
- stringUtils.camelToKebab(k);
38619
- inherits.push({
38620
- type: "group",
38621
- name: k
38622
- });
38623
- continue;
38624
- }
38625
- const t = {
38626
- key: tagName,
38627
- format,
38628
- default: null,
38629
- alwaysInclude: false,
38630
- min: tag.minCount == null ? 0 : tag.minCount,
38631
- max: tag.maxCount == null ? 1 : tag.maxCount,
38632
- description: tag.description ?? "",
38633
- chain
38634
- // raw: {
38635
- // ...tag,
38636
- // },
38637
- };
38638
- tags2.push(t);
38699
+ tags2.push(...processTagEntries(tag, []));
38639
38700
  }
38640
38701
  const bitJson = {
38641
38702
  name: groupKey,
@@ -38648,7 +38709,6 @@ var ConfigBuilder = class {
38648
38709
  changes: ["Initial version"]
38649
38710
  }
38650
38711
  ],
38651
- inherits,
38652
38712
  tags: tags2
38653
38713
  // cards: [
38654
38714
  // {
@@ -38680,7 +38740,49 @@ var ConfigBuilder = class {
38680
38740
  }
38681
38741
  };
38682
38742
  writeGroupConfigs(groupConfigs);
38743
+ const writeBitsAsGroupConfigs = (bitsAsGroupConfigs) => {
38744
+ for (const b of bitsAsGroupConfigs) {
38745
+ const groupKey = `group-${b.bitType}`;
38746
+ const tags2 = [];
38747
+ const tagEntriesTypeOrder = [
38748
+ BitTagConfigKeyType.tag,
38749
+ BitTagConfigKeyType.property,
38750
+ BitTagConfigKeyType.resource,
38751
+ BitTagConfigKeyType.group,
38752
+ BitTagConfigKeyType.unknown
38753
+ ];
38754
+ const tagEntries = Object.entries(b.tags ?? []).sort((a, b2) => {
38755
+ const tagA = a[1];
38756
+ const tagB = b2[1];
38757
+ const typeA = typeFromConfigKey(tagA.key);
38758
+ const typeB = typeFromConfigKey(tagB.key);
38759
+ const typeOrder = tagEntriesTypeOrder.indexOf(typeA) - tagEntriesTypeOrder.indexOf(typeB);
38760
+ return typeOrder;
38761
+ });
38762
+ for (const [_tagKey, tag] of tagEntries) {
38763
+ tags2.push(...processTagEntries(tag, []));
38764
+ }
38765
+ const bitJson = {
38766
+ name: groupKey,
38767
+ description: b.description ?? "",
38768
+ since: "UNKNOWN",
38769
+ deprecated: b.deprecated,
38770
+ history: [
38771
+ {
38772
+ version: "UNKNOWN",
38773
+ changes: ["Initial version"]
38774
+ }
38775
+ ],
38776
+ tags: tags2
38777
+ };
38778
+ const output = import_node_path3.default.join(outputFolderGroups, `${groupKey}.jsonc`);
38779
+ const str = JSON.stringify(bitJson, null, 2);
38780
+ import_fs_extra3.default.writeFileSync(output, str);
38781
+ }
38782
+ };
38783
+ writeBitsAsGroupConfigs(bitGroupConfigs);
38683
38784
  }
38785
+ // Build flat bit configs
38684
38786
  buildFlat(options) {
38685
38787
  const opts = Object.assign({}, options);
38686
38788
  const bitConfigs = [];
@@ -38692,8 +38794,63 @@ var ConfigBuilder = class {
38692
38794
  const outputFolder = opts.outputDir ?? "assets/config";
38693
38795
  const outputFolderBits = import_node_path3.default.join(outputFolder, "bits_flat");
38694
38796
  import_fs_extra3.default.ensureDirSync(outputFolderBits);
38797
+ const processTagEntries = (tag) => {
38798
+ const tags2 = [];
38799
+ let tagName = tag.key;
38800
+ const tagType = typeFromConfigKey(tag.key);
38801
+ let format = "";
38802
+ let chain = void 0;
38803
+ if (tagType === BitTagConfigKeyType.tag) {
38804
+ tagName = tag.name;
38805
+ format = "bitmark--";
38806
+ } else if (tagType === BitTagConfigKeyType.property) {
38807
+ tagName = tag.key;
38808
+ if (tag.format === TagFormat.plainText) {
38809
+ format = "string";
38810
+ } else if (tag.format === TagFormat.boolean) {
38811
+ format = "bool";
38812
+ } else if (tag.format === TagFormat.bitmarkText) {
38813
+ format = "bitmark";
38814
+ } else if (tag.format === TagFormat.number) {
38815
+ format = "number";
38816
+ }
38817
+ } else if (tagType === BitTagConfigKeyType.resource) {
38818
+ format = "string";
38819
+ } else if (tagType === BitTagConfigKeyType.group) {
38820
+ let k = tag.key;
38821
+ if (k.startsWith("group_")) k = k.substring(6);
38822
+ k = /*'_' +*/
38823
+ stringUtils.camelToKebab(k);
38824
+ tags2.push({
38825
+ type: "group",
38826
+ key: k
38827
+ });
38828
+ return tags2;
38829
+ }
38830
+ if (Array.isArray(tag.chain) && tag.chain.length > 0) {
38831
+ const chainTags = [];
38832
+ for (const [_tagKey, chainTag] of tag.chain.entries()) {
38833
+ chainTags.push(...processTagEntries(chainTag));
38834
+ }
38835
+ chain = chainTags;
38836
+ }
38837
+ const t = {
38838
+ key: tagName,
38839
+ format,
38840
+ default: null,
38841
+ alwaysInclude: false,
38842
+ min: tag.minCount == null ? 0 : tag.minCount,
38843
+ max: tag.maxCount == null ? 1 : tag.maxCount,
38844
+ description: tag.description ?? "",
38845
+ chain
38846
+ // raw: {
38847
+ // ...tag,
38848
+ // },
38849
+ };
38850
+ tags2.push(t);
38851
+ return tags2;
38852
+ };
38695
38853
  for (const b of bitConfigs) {
38696
- const inherits = [];
38697
38854
  const tags2 = [];
38698
38855
  const tagEntriesTypeOrder = [
38699
38856
  BitTagConfigKeyType.tag,
@@ -38710,103 +38867,8 @@ var ConfigBuilder = class {
38710
38867
  const typeOrder = tagEntriesTypeOrder.indexOf(typeA) - tagEntriesTypeOrder.indexOf(typeB);
38711
38868
  return typeOrder;
38712
38869
  });
38713
- for (const [tagKey, tag] of tagEntries) {
38714
- let tagName = tagKey;
38715
- let tagKeyPrefix = "";
38716
- let format = "";
38717
- let description = "";
38718
- let chain = void 0;
38719
- if (tag.type === BitTagConfigKeyType.tag) {
38720
- tagName = tag.tag;
38721
- if (tagName === "%") {
38722
- description = "Item";
38723
- chain = {
38724
- key: "%",
38725
- format,
38726
- min: tag.minCount,
38727
- max: tag.maxCount,
38728
- description: "Lead",
38729
- chain: {
38730
- key: "%",
38731
- format,
38732
- min: tag.minCount,
38733
- max: tag.maxCount,
38734
- description: "Page number",
38735
- chain: {
38736
- key: "%",
38737
- format,
38738
- min: tag.minCount,
38739
- max: tag.maxCount,
38740
- description: "Margin number"
38741
- }
38742
- }
38743
- };
38744
- } else if (tagName === "!") {
38745
- description = "Instruction";
38746
- } else if (tagName === "?") {
38747
- description = "Hint";
38748
- } else if (tagName === "#") {
38749
- description = "Title";
38750
- } else if (tagName === "##") {
38751
- description = "Sub-title";
38752
- } else if (tagName === "\u25BC") {
38753
- description = "Anchor";
38754
- } else if (tagName === "\u25BA") {
38755
- description = "Reference";
38756
- } else if (tagName === "$") {
38757
- description = "Sample solution";
38758
- } else if (tagName === "&") {
38759
- description = "Resource";
38760
- } else if (tagName === "+") {
38761
- description = "True statement";
38762
- } else if (tagName === "-") {
38763
- description = "False statement";
38764
- } else if (tagName === "_") {
38765
- description = "Gap";
38766
- } else if (tagName === "=") {
38767
- description = "Mark";
38768
- }
38769
- format = "bitmark--";
38770
- } else if (tag.type === BitTagConfigKeyType.property) {
38771
- tagName = tag.tag;
38772
- tagKeyPrefix = "@";
38773
- const property = tag;
38774
- if (property.format === TagFormat.plainText) {
38775
- format = "string";
38776
- } else if (property.format === TagFormat.boolean) {
38777
- format = "bool";
38778
- } else if (property.format === TagFormat.bitmarkText) {
38779
- format = "bitmark";
38780
- } else if (property.format === TagFormat.number) {
38781
- format = "number";
38782
- }
38783
- } else if (tag.type === BitTagConfigKeyType.resource) {
38784
- tagKeyPrefix = "&";
38785
- } else if (tag.type === BitTagConfigKeyType.group) {
38786
- tagKeyPrefix = "@";
38787
- let k = tag.configKey;
38788
- if (k.startsWith("group_")) k = k.substring(6);
38789
- k = "_" + k;
38790
- inherits.push({
38791
- type: "group",
38792
- name: k
38793
- });
38794
- continue;
38795
- }
38796
- const t = {
38797
- key: tagKeyPrefix + tagName,
38798
- format,
38799
- default: null,
38800
- alwaysInclude: false,
38801
- min: tag.minCount == null ? 0 : tag.minCount,
38802
- max: tag.maxCount == null ? 1 : tag.maxCount,
38803
- description,
38804
- chain
38805
- // raw: {
38806
- // ...tag,
38807
- // },
38808
- };
38809
- tags2.push(t);
38870
+ for (const [_tagKey, tag] of tagEntries) {
38871
+ tags2.push(...processTagEntries(tag));
38810
38872
  }
38811
38873
  const bitJson = {
38812
38874
  name: b.bitType,