@gmb/bitmark-parser-generator 4.1.2 → 4.3.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
@@ -70,7 +70,24 @@ var BitType = (0, import_superenum.superenum)({
70
70
  // Used to indicate a bit is commented out
71
71
  _standard: "_standard",
72
72
  // Not to be used as a bit, but as a base for other bit types
73
+ advertising: "advertising",
74
+ advertisingAdvertorial: "advertising-advertorial",
75
+ advertisingCallToAction: "advertising-call-to-action",
76
+ advertisingCallToActionMeeting: "advertising-call-to-action-meeting",
77
+ advertisingBanner: "advertising-banner",
78
+ advertisingSkyscraper: "advertising-skyscraper",
79
+ advertisingRectangle: "advertising-rectangle",
80
+ advertisingFullPage: "advertising-full-page",
81
+ advertisingHalfPage: "advertising-half-page",
82
+ advertisingQuarterPage: "advertising-quarter-page",
83
+ advertisingClassifiedPage: "advertising-classified-page",
84
+ advertisingLandscape: "advertising-landscape",
85
+ advertisingPortrait: "advertising-portrait",
86
+ aiChat: "ai-chat",
87
+ aiEditor: "ai-editor",
73
88
  aiPrompt: "ai-prompt",
89
+ aiTutor: "ai-tutor",
90
+ aiWbt: "ai-wbt",
74
91
  anchor: "anchor",
75
92
  appAiPrompt: "app-ai-prompt",
76
93
  appBitmarkFromEditor: "app-bitmark-from-editor",
@@ -88,6 +105,7 @@ var BitType = (0, import_superenum.superenum)({
88
105
  articleAi: "article-ai",
89
106
  articleAlt: "article-alt",
90
107
  articleAttachment: "article-attachment",
108
+ articleAuthor: "article-author",
91
109
  articleEmbed: "article-embed",
92
110
  articleLink: "article-link",
93
111
  articleResponsive: "article-responsive",
@@ -98,6 +116,8 @@ var BitType = (0, import_superenum.superenum)({
98
116
  audioEmbed: "audio-embed",
99
117
  audioLink: "audio-link",
100
118
  audioTranscript: "audio-transcript",
119
+ author: "author",
120
+ authorContentBitGenerator: "author-content-bit-generator",
101
121
  bitAlias: "bit-alias",
102
122
  bitBookEnding: "bit-book-ending",
103
123
  bitBookSummary: "bit-book-summary",
@@ -110,6 +130,7 @@ var BitType = (0, import_superenum.superenum)({
110
130
  bookAlias: "book-alias",
111
131
  bookAppendix: "book-appendix",
112
132
  bookArticle: "book-article",
133
+ bookAuthor: "book-author",
113
134
  bookAutherBio: "book-author-bio",
114
135
  bookBibliography: "book-bibliography",
115
136
  bookClose: "book-close",
@@ -278,6 +299,8 @@ var BitType = (0, import_superenum.superenum)({
278
299
  extractorAiChat: "extractor-ai-chat",
279
300
  extractorBlock: "extractor-block",
280
301
  extractorConfiguration: "extractor-configuration",
302
+ extractorEmbeddedImage: "extractor-embedded-image",
303
+ extractorEmbeddedImageCollapsible: "extractor-embedded-image-collapsible",
281
304
  extractorInformation: "extractor-information",
282
305
  extractorPage: "extractor-page",
283
306
  extractorPageCollapsible: "extractor-page-collapsible",
@@ -1176,6 +1199,7 @@ var propertyKeys = {
1176
1199
  property_disableCalculation: "@disableCalculation",
1177
1200
  property_disableFeedback: "@disableFeedback",
1178
1201
  property_duration: "@duration",
1202
+ property_isEditable: "@isEditable",
1179
1203
  property_emphasis: "@emphasis",
1180
1204
  property_example: "@example",
1181
1205
  property_externalId: "@externalId",
@@ -1187,6 +1211,7 @@ var propertyKeys = {
1187
1211
  property_focusX: "@focusX",
1188
1212
  property_focusY: "@focusY",
1189
1213
  property_format: "@format",
1214
+ property_fullName: "@fullName",
1190
1215
  property_groupTag: "@groupTag",
1191
1216
  property_handInAcceptFileType: "@handInAcceptFileType",
1192
1217
  property_handInInstruction: "@handInInstruction",
@@ -1207,6 +1232,7 @@ var propertyKeys = {
1207
1232
  property_isTemplate: "@isTemplate",
1208
1233
  property_isTemplateStripTheme: "@isTemplateStripTheme",
1209
1234
  property_isTracked: "@isTracked",
1235
+ property_jobTitle: "@jobTitle",
1210
1236
  property_jupyterExecutionCount: "@jupyterExecutionCount",
1211
1237
  property_jupyterId: "@jupyterId",
1212
1238
  property_kind: "@kind",
@@ -1251,6 +1277,7 @@ var propertyKeys = {
1251
1277
  property_productId: "@productId",
1252
1278
  property_productVideo: "@productVideo",
1253
1279
  property_progress: "@progress",
1280
+ property_pseudonym: "@pseudonym",
1254
1281
  property_publications: "@publications",
1255
1282
  property_publisher: "@publisher",
1256
1283
  property_publisherName: "@publisherName",
@@ -3153,6 +3180,12 @@ var GROUPS = {
3153
3180
  format: TagFormat.boolean,
3154
3181
  defaultValue: "false"
3155
3182
  },
3183
+ {
3184
+ key: ConfigKey.property_isEditable,
3185
+ description: "If true, the book is editable",
3186
+ format: TagFormat.boolean,
3187
+ defaultValue: "false"
3188
+ },
3156
3189
  {
3157
3190
  key: ConfigKey.property_chatWithBook,
3158
3191
  description: "If true, the user can chat about the book with an AI assistant",
@@ -4165,6 +4198,40 @@ var BITS = {
4165
4198
  ],
4166
4199
  resourceAttachmentAllowed: false
4167
4200
  },
4201
+ [BitType.author]: {
4202
+ since: "4.2.0",
4203
+ baseBitType: BitType._standard,
4204
+ description: "Represents an author of something",
4205
+ tags: [
4206
+ {
4207
+ key: ConfigKey.property_fullName,
4208
+ description: "Full name of the author"
4209
+ },
4210
+ {
4211
+ key: ConfigKey.property_pseudonym,
4212
+ description: "A pseudonym of the author, if any"
4213
+ },
4214
+ {
4215
+ key: ConfigKey.property_title,
4216
+ description: 'The title of the author, e.g. "Dr.", "Prof.", etc.',
4217
+ jsonKey: "title"
4218
+ },
4219
+ {
4220
+ key: ConfigKey.property_jobTitle,
4221
+ description: 'The job title of the author, e.g. "Software Engineer", "Professor", etc.'
4222
+ }
4223
+ ]
4224
+ },
4225
+ [BitType.bookAuthor]: {
4226
+ since: "4.2.0",
4227
+ baseBitType: BitType.author,
4228
+ description: "Represents an author of a book"
4229
+ },
4230
+ [BitType.articleAuthor]: {
4231
+ since: "4.2.0",
4232
+ baseBitType: BitType.author,
4233
+ description: "Represents an author of a book"
4234
+ },
4168
4235
  [BitType.article]: {
4169
4236
  since: "1.3.0",
4170
4237
  baseBitType: BitType._standard,
@@ -5140,6 +5207,71 @@ var BITS = {
5140
5207
  baseBitType: BitType.conversationLeft1,
5141
5208
  description: "Cloze and multiple choice text conversation right thought bit, used for conversations with cloze and multiple choice text and a thought on the right side of the screen"
5142
5209
  },
5210
+ [BitType.advertising]: {
5211
+ since: "4.2.0",
5212
+ baseBitType: BitType.article,
5213
+ description: "General advertising content bit"
5214
+ },
5215
+ [BitType.advertisingAdvertorial]: {
5216
+ since: "4.2.0",
5217
+ baseBitType: BitType.article,
5218
+ description: "Advertorial content bit (sponsored article)"
5219
+ },
5220
+ [BitType.advertisingCallToAction]: {
5221
+ since: "4.2.0",
5222
+ baseBitType: BitType.callToAction,
5223
+ description: "Call-to-action for advertising"
5224
+ },
5225
+ [BitType.advertisingCallToActionMeeting]: {
5226
+ since: "4.2.0",
5227
+ baseBitType: BitType.callToAction,
5228
+ description: "Call-to-action for meeting or appointment"
5229
+ },
5230
+ [BitType.advertisingBanner]: {
5231
+ since: "4.2.0",
5232
+ baseBitType: BitType.image,
5233
+ description: "Banner advertisement bit"
5234
+ },
5235
+ [BitType.advertisingSkyscraper]: {
5236
+ since: "4.2.0",
5237
+ baseBitType: BitType.image,
5238
+ description: "Skyscraper (vertical) advertisement bit"
5239
+ },
5240
+ [BitType.advertisingRectangle]: {
5241
+ since: "4.2.0",
5242
+ baseBitType: BitType.image,
5243
+ description: "Rectangle advertisement bit"
5244
+ },
5245
+ [BitType.advertisingFullPage]: {
5246
+ since: "4.2.0",
5247
+ baseBitType: BitType.image,
5248
+ description: "Full-page advertisement bit"
5249
+ },
5250
+ [BitType.advertisingHalfPage]: {
5251
+ since: "4.2.0",
5252
+ baseBitType: BitType.image,
5253
+ description: "Half-page advertisement bit"
5254
+ },
5255
+ [BitType.advertisingQuarterPage]: {
5256
+ since: "4.2.0",
5257
+ baseBitType: BitType.image,
5258
+ description: "Quarter-page advertisement bit"
5259
+ },
5260
+ [BitType.advertisingClassifiedPage]: {
5261
+ since: "4.2.0",
5262
+ baseBitType: BitType.image,
5263
+ description: "Classifieds advertisement page bit"
5264
+ },
5265
+ [BitType.advertisingLandscape]: {
5266
+ since: "4.2.0",
5267
+ baseBitType: BitType.image,
5268
+ description: "Landscape format advertisement bit"
5269
+ },
5270
+ [BitType.advertisingPortrait]: {
5271
+ since: "4.2.0",
5272
+ baseBitType: BitType.image,
5273
+ description: "Portrait format advertisement bit"
5274
+ },
5143
5275
  [BitType.cookPreparation]: {
5144
5276
  since: "1.3.0",
5145
5277
  baseBitType: BitType.article,
@@ -5429,6 +5561,19 @@ var BITS = {
5429
5561
  baseBitType: BitType.smartStandardExampleNonNormative,
5430
5562
  description: "Smart standard non-normative example collapsible bit, used to provide non-normative examples in smart standards that can be collapsed"
5431
5563
  },
5564
+ [BitType.authorContentBitGenerator]: {
5565
+ since: "4.2.0",
5566
+ baseBitType: BitType.article,
5567
+ description: "Body contains the content of one or more bits to be created by the bit generator",
5568
+ tags: [
5569
+ {
5570
+ key: ConfigKey.property_classification,
5571
+ description: "Classification for the created bits",
5572
+ format: TagFormat.plainText,
5573
+ maxCount: Count.infinity
5574
+ }
5575
+ ]
5576
+ },
5432
5577
  [BitType.appAiPrompt]: {
5433
5578
  since: "1.3.0",
5434
5579
  baseBitType: BitType.article,
@@ -5439,6 +5584,26 @@ var BITS = {
5439
5584
  baseBitType: BitType.article,
5440
5585
  description: "AI prompt bit, used to create AI prompts in articles or books"
5441
5586
  },
5587
+ [BitType.aiChat]: {
5588
+ since: "4.2.0",
5589
+ baseBitType: BitType.article,
5590
+ description: "AI chat bit, used to create an AI chat"
5591
+ },
5592
+ [BitType.aiEditor]: {
5593
+ since: "4.2.0",
5594
+ baseBitType: BitType.article,
5595
+ description: "AI editor bit, used to create an AI editor"
5596
+ },
5597
+ [BitType.aiTutor]: {
5598
+ since: "4.2.0",
5599
+ baseBitType: BitType.article,
5600
+ description: "AI tutor bit, used to create an AI tutor"
5601
+ },
5602
+ [BitType.aiWbt]: {
5603
+ since: "4.2.0",
5604
+ baseBitType: BitType.article,
5605
+ description: "AI WBT bit, used to create an AI WBT (Web-Based Training)"
5606
+ },
5442
5607
  [BitType.articleAi]: {
5443
5608
  since: "1.3.0",
5444
5609
  baseBitType: BitType.article,
@@ -6156,6 +6321,18 @@ var BITS = {
6156
6321
  description: "Extractor configuration bit, used to configure extractors in articles or books",
6157
6322
  textFormatDefault: TextFormat.plainText
6158
6323
  },
6324
+ [BitType.extractorEmbeddedImage]: {
6325
+ since: "4.3.0",
6326
+ baseBitType: BitType.image,
6327
+ description: "Extractor embedded image bit, used for embedded images extracted from PDFs",
6328
+ textFormatDefault: TextFormat.plainText
6329
+ },
6330
+ [BitType.extractorEmbeddedImageCollapsible]: {
6331
+ since: "4.3.0",
6332
+ baseBitType: BitType.extractorEmbeddedImage,
6333
+ description: "Collapsible extractor embedded image bit, used for embedded images extracted from PDFs",
6334
+ textFormatDefault: TextFormat.plainText
6335
+ },
6159
6336
  [BitType.extractorInformation]: {
6160
6337
  since: "3.8.0",
6161
6338
  baseBitType: BitType._standard,
@@ -8939,7 +9116,7 @@ var instance2 = new Config();
8939
9116
  // src/generated/package_info.ts
8940
9117
  var PACKAGE_INFO = {
8941
9118
  "name": "@gmb/bitmark-parser-generator",
8942
- "version": "4.1.2",
9119
+ "version": "4.3.0",
8943
9120
  "author": "Get More Brain Ltd",
8944
9121
  "license": "ISC",
8945
9122
  "description": "A bitmark parser and generator using Peggy.js"
@@ -9465,6 +9642,8 @@ var NodeType = (0, import_superenum20.superenum)({
9465
9642
  format: "format",
9466
9643
  forValues: "forValues",
9467
9644
  forValuesValue: "forValuesValue",
9645
+ fullName: "fullName",
9646
+ fullNameValue: "fullNameValue",
9468
9647
  gap: "gap",
9469
9648
  groupTag: "groupTag",
9470
9649
  groupTagValue: "groupTagValue",
@@ -9509,6 +9688,8 @@ var NodeType = (0, import_superenum20.superenum)({
9509
9688
  isCaseSensitive: "isCaseSensitive",
9510
9689
  isCommented: "isCommented",
9511
9690
  isCorrect: "isCorrect",
9691
+ isEditable: "isEditable",
9692
+ isEditableValue: "isEditableValue",
9512
9693
  isExample: "isExample",
9513
9694
  isInfoOnly: "isInfoOnly",
9514
9695
  isInfoOnlyValue: "isInfoOnlyValue",
@@ -9523,6 +9704,8 @@ var NodeType = (0, import_superenum20.superenum)({
9523
9704
  isTrackedValue: "isTrackedValue",
9524
9705
  item: "item",
9525
9706
  itemLead: "itemLead",
9707
+ jobTitle: "jobTitle",
9708
+ jobTitleValue: "jobTitleValue",
9526
9709
  jupyterExecutionCount: "jupyterExecutionCount",
9527
9710
  jupyterExecutionCountValue: "jupyterExecutionCountValue",
9528
9711
  jupyterId: "jupyterId",
@@ -9638,6 +9821,8 @@ var NodeType = (0, import_superenum20.superenum)({
9638
9821
  propertyValue: "propertyValue",
9639
9822
  propertyValues: "propertyValues",
9640
9823
  provider: "provider",
9824
+ pseudonym: "pseudonym",
9825
+ pseudonymValue: "pseudonymValue",
9641
9826
  publications: "publications",
9642
9827
  publicationsValue: "publicationsValue",
9643
9828
  publisher: "publisher",
@@ -9785,6 +9970,7 @@ var NodeType = (0, import_superenum20.superenum)({
9785
9970
  thumbnails: "thumbnails",
9786
9971
  thumbnailsValue: "thumbnailsValue",
9787
9972
  title: "title",
9973
+ titleString: "titleString",
9788
9974
  toc: "toc",
9789
9975
  tocContent: "tocContent",
9790
9976
  tocContentValue: "tocContentValue",
@@ -20643,62 +20829,99 @@ var NodeValidator = class {
20643
20829
  validateResource(resource) {
20644
20830
  if (!resource) return void 0;
20645
20831
  const ret = resource;
20646
- let valid = false;
20832
+ let valid = true;
20647
20833
  switch (resource.type) {
20648
- case ResourceType.image:
20649
- valid = !!resource.image.src;
20834
+ case ResourceType.image: {
20835
+ const imageResource = resource.image;
20836
+ if (!stringUtils.isString(imageResource.src)) imageResource.src = "";
20650
20837
  break;
20651
- case ResourceType.imageLink:
20652
- valid = !!resource.imageLink.url;
20838
+ }
20839
+ case ResourceType.imageLink: {
20840
+ const imageLink = resource.imageLink;
20841
+ if (!stringUtils.isString(imageLink.url)) imageLink.url = "";
20653
20842
  break;
20654
- case ResourceType.audio:
20655
- valid = !!resource.audio.src;
20843
+ }
20844
+ case ResourceType.audio: {
20845
+ const audio = resource.audio;
20846
+ if (!stringUtils.isString(audio.src)) audio.src = "";
20656
20847
  break;
20657
- case ResourceType.audioEmbed:
20658
- valid = !!resource.audioEmbed.src;
20848
+ }
20849
+ case ResourceType.audioEmbed: {
20850
+ const audioEmbed = resource.audioEmbed;
20851
+ if (!stringUtils.isString(audioEmbed.src)) audioEmbed.src = "";
20659
20852
  break;
20660
- case ResourceType.audioLink:
20661
- valid = !!resource.audioLink.url;
20853
+ }
20854
+ case ResourceType.audioLink: {
20855
+ const audioLink = resource.audioLink;
20856
+ if (!stringUtils.isString(audioLink.url)) audioLink.url = "";
20662
20857
  break;
20663
- case ResourceType.video:
20664
- valid = !!resource.video.src;
20858
+ }
20859
+ case ResourceType.video: {
20860
+ const video = resource.video;
20861
+ if (!stringUtils.isString(video.src)) video.src = "";
20665
20862
  break;
20666
- case ResourceType.videoEmbed:
20667
- valid = !!resource.videoEmbed.url;
20863
+ }
20864
+ case ResourceType.videoEmbed: {
20865
+ const videoEmbed = resource.videoEmbed;
20866
+ if (!stringUtils.isString(videoEmbed.url)) videoEmbed.url = "";
20668
20867
  break;
20669
- case ResourceType.videoLink:
20670
- valid = !!resource.videoLink.url;
20868
+ }
20869
+ case ResourceType.videoLink: {
20870
+ const videoLink = resource.videoLink;
20871
+ if (!stringUtils.isString(videoLink.url)) videoLink.url = "";
20671
20872
  break;
20672
- case ResourceType.stillImageFilm:
20673
- valid = !!resource.image.src && !!resource.audio.src;
20873
+ }
20874
+ case ResourceType.stillImageFilm: {
20875
+ const stillImageFilm = resource;
20876
+ if (!stringUtils.isString(stillImageFilm.image.src)) stillImageFilm.image.src = "";
20877
+ if (!stringUtils.isString(stillImageFilm.audio.src)) stillImageFilm.audio.src = "";
20674
20878
  break;
20675
- case ResourceType.stillImageFilmEmbed:
20676
- valid = !!resource.stillImageFilmEmbed.url;
20879
+ }
20880
+ case ResourceType.stillImageFilmEmbed: {
20881
+ const stillImageFilmEmbed = resource.stillImageFilmEmbed;
20882
+ if (!stringUtils.isString(stillImageFilmEmbed.url)) stillImageFilmEmbed.url = "";
20677
20883
  break;
20678
- case ResourceType.stillImageFilmLink:
20679
- valid = !!resource.stillImageFilmLink.url;
20884
+ }
20885
+ case ResourceType.stillImageFilmLink: {
20886
+ const stillImageFilmLink = resource.stillImageFilmLink;
20887
+ if (!stringUtils.isString(stillImageFilmLink.url)) stillImageFilmLink.url = "";
20680
20888
  break;
20681
- case ResourceType.article:
20682
- valid = !!resource.article.body;
20889
+ }
20890
+ case ResourceType.article: {
20891
+ const article = resource.article;
20892
+ if (!stringUtils.isString(article.body)) article.body = "";
20683
20893
  break;
20684
- case ResourceType.document:
20685
- valid = !!resource.document.url;
20894
+ }
20895
+ case ResourceType.document: {
20896
+ const document2 = resource.document;
20897
+ if (!stringUtils.isString(document2.url)) document2.url = "";
20686
20898
  break;
20687
- case ResourceType.documentEmbed:
20688
- valid = !!resource.documentEmbed.url;
20899
+ }
20900
+ case ResourceType.documentEmbed: {
20901
+ const documentEmbed = resource.documentEmbed;
20902
+ if (!stringUtils.isString(documentEmbed.url)) documentEmbed.url = "";
20689
20903
  break;
20690
- case ResourceType.documentLink:
20691
- valid = !!resource.documentLink.url;
20904
+ }
20905
+ case ResourceType.documentLink: {
20906
+ const documentLink = resource.documentLink;
20907
+ if (!stringUtils.isString(documentLink.url)) documentLink.url = "";
20692
20908
  break;
20693
- case ResourceType.documentDownload:
20694
- valid = !!resource.documentDownload.url;
20909
+ }
20910
+ case ResourceType.documentDownload: {
20911
+ const documentDownload = resource.documentDownload;
20912
+ if (!stringUtils.isString(documentDownload.url)) documentDownload.url = "";
20695
20913
  break;
20696
- case ResourceType.appLink:
20697
- valid = !!resource.appLink.url;
20914
+ }
20915
+ case ResourceType.appLink: {
20916
+ const appLink = resource.appLink;
20917
+ if (!stringUtils.isString(appLink.url)) appLink.url = "";
20698
20918
  break;
20699
- case ResourceType.websiteLink:
20700
- valid = !!resource.websiteLink.url;
20919
+ }
20920
+ case ResourceType.websiteLink: {
20921
+ const websiteLink = resource.websiteLink;
20922
+ if (!stringUtils.isString(websiteLink.url)) websiteLink.url = "";
20701
20923
  break;
20924
+ }
20702
20925
  default:
20703
20926
  valid = false;
20704
20927
  }
@@ -21928,6 +22151,12 @@ var Builder = class extends BaseBuilder {
21928
22151
  data.isTemplateStripTheme,
21929
22152
  options
21930
22153
  ),
22154
+ isEditable: this.toAstProperty(
22155
+ bitType,
22156
+ ConfigKey.property_isEditable,
22157
+ data.isEditable,
22158
+ options
22159
+ ),
21931
22160
  aiGenerated: this.toAstProperty(
21932
22161
  bitType,
21933
22162
  ConfigKey.property_aiGenerated,
@@ -22530,6 +22759,11 @@ var Builder = class extends BaseBuilder {
22530
22759
  data.referenceProperty,
22531
22760
  options
22532
22761
  ),
22762
+ // Author data
22763
+ fullName: this.toAstProperty(bitType, ConfigKey.property_fullName, data.fullName, options),
22764
+ pseudonym: this.toAstProperty(bitType, ConfigKey.property_pseudonym, data.pseudonym, options),
22765
+ titleString: this.toAstProperty(bitType, ConfigKey.property_title, data.titleString, options),
22766
+ jobTitle: this.toAstProperty(bitType, ConfigKey.property_jobTitle, data.jobTitle, options),
22533
22767
  // Book data
22534
22768
  title: this.handleJsonText(context, TextLocation.tag, data.title),
22535
22769
  subtitle: this.handleJsonText(context, TextLocation.tag, data.subtitle),
@@ -25636,6 +25870,18 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
25636
25870
  }
25637
25871
  return false;
25638
25872
  }
25873
+ // bitmarkAst -> bits -> bitsValue -> titleString
25874
+ leaf_titleString(node, route) {
25875
+ const parent = this.getParentNode(route);
25876
+ if (parent?.key !== NodeType.bitsValue) return true;
25877
+ if (node.value) {
25878
+ this.writeNL();
25879
+ this.writeProperty("title", node.value, route, {
25880
+ format: TagFormat.plainText
25881
+ });
25882
+ }
25883
+ return false;
25884
+ }
25639
25885
  // bitmarkAst -> bits -> title
25640
25886
  enter_title(node, route) {
25641
25887
  const parent = this.getParentNode(route);
@@ -26844,6 +27090,15 @@ var JsonGenerator = class extends AstWalkerGenerator {
26844
27090
  enter_instruction(node, route) {
26845
27091
  return this.standardHandler(node, route, NodeType.bitsValue, { array: true });
26846
27092
  }
27093
+ // bitmarkAst -> bits -> bitsValue -> titleString
27094
+ leaf_titleString(node, route) {
27095
+ const parent = this.getParentNode(route);
27096
+ if (parent?.key !== NodeType.bitsValue) return true;
27097
+ return this.standardHandler(node, route, [NodeType.bitsValue], {
27098
+ array: false,
27099
+ keyOverride: "title"
27100
+ });
27101
+ }
26847
27102
  // bitmarkAst -> bits -> bitsValue -> title
26848
27103
  enter_title(node, route) {
26849
27104
  return this.standardHandler(node, route, [NodeType.bitsValue, NodeType.cardNode], {
@@ -27552,7 +27807,6 @@ var JsonGenerator = class extends AstWalkerGenerator {
27552
27807
  */
27553
27808
  cleanBitJson(bitJson) {
27554
27809
  const bitType = instance2.getBitType(bitJson.type);
27555
- const bitConfig = instance2.getBitConfig(bitType);
27556
27810
  if (bitJson.originalType == null) bitJson.originalType = void 0;
27557
27811
  if (!bitJson.item) bitJson.item = void 0;
27558
27812
  if (instance2.isOfBitType(bitType, [BitType._error, BitType._comment])) {
@@ -27788,9 +28042,6 @@ var JsonGenerator = class extends AstWalkerGenerator {
27788
28042
  if (instance2.isOfBitType(bitType, BitType.container)) {
27789
28043
  if (bitJson.allowedBit == null) bitJson.allowedBit = [];
27790
28044
  }
27791
- if (bitConfig.quizBit) {
27792
- if (bitJson.revealSolutions == null) bitJson.revealSolutions = false;
27793
- }
27794
28045
  if (instance2.isOfBitType(bitType, BitType.platformPath)) {
27795
28046
  if (bitJson.path == null) bitJson.path = "";
27796
28047
  }
@@ -28093,6 +28344,7 @@ var JsonParser = class {
28093
28344
  resourceType: this.getResourceType(bit.resource),
28094
28345
  isCommented,
28095
28346
  internalComment: internalComments,
28347
+ ...this.processTitle(bitType, bit.title),
28096
28348
  ...this.processReference(referenceBit),
28097
28349
  // reference and referenceProperty
28098
28350
  ...this.parseExample(bit.example),
@@ -28193,6 +28445,17 @@ var JsonParser = class {
28193
28445
  footer: footerText
28194
28446
  };
28195
28447
  }
28448
+ processTitle(bitType, title) {
28449
+ if (instance2.isOfBitType(bitType, BitType.author))
28450
+ return {
28451
+ titleString: title,
28452
+ title: void 0
28453
+ };
28454
+ return {
28455
+ titleString: void 0,
28456
+ title
28457
+ };
28458
+ }
28196
28459
  processReference(reference) {
28197
28460
  if (Array.isArray(reference) && reference.length > 0) {
28198
28461
  return {
@@ -31373,12 +31636,21 @@ function buildTitles(_context, bitType, title) {
31373
31636
  level: title.length > 0 ? title.length - 1 : void 0
31374
31637
  };
31375
31638
  } else {
31376
- return {
31377
- title: title[1]?.titleAst ?? void 0,
31378
- titleString: title[1]?.titleString ?? void 0,
31379
- subtitle: title[2]?.titleAst ?? void 0,
31380
- subtitleString: title[2]?.titleString ?? void 0
31381
- };
31639
+ if (Array.isArray(title)) {
31640
+ return {
31641
+ title: title[1]?.titleAst ?? void 0,
31642
+ titleString: title[1]?.titleString ?? void 0,
31643
+ subtitle: title[2]?.titleAst ?? void 0,
31644
+ subtitleString: title[2]?.titleString ?? void 0
31645
+ };
31646
+ } else {
31647
+ return {
31648
+ title: void 0,
31649
+ titleString: title ?? void 0,
31650
+ subtitle: void 0,
31651
+ subtitleString: void 0
31652
+ };
31653
+ }
31382
31654
  }
31383
31655
  }
31384
31656