@gmb/bitmark-parser-generator 4.1.2 → 4.2.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",
@@ -1176,6 +1197,7 @@ var propertyKeys = {
1176
1197
  property_disableCalculation: "@disableCalculation",
1177
1198
  property_disableFeedback: "@disableFeedback",
1178
1199
  property_duration: "@duration",
1200
+ property_isEditable: "@isEditable",
1179
1201
  property_emphasis: "@emphasis",
1180
1202
  property_example: "@example",
1181
1203
  property_externalId: "@externalId",
@@ -1187,6 +1209,7 @@ var propertyKeys = {
1187
1209
  property_focusX: "@focusX",
1188
1210
  property_focusY: "@focusY",
1189
1211
  property_format: "@format",
1212
+ property_fullName: "@fullName",
1190
1213
  property_groupTag: "@groupTag",
1191
1214
  property_handInAcceptFileType: "@handInAcceptFileType",
1192
1215
  property_handInInstruction: "@handInInstruction",
@@ -1207,6 +1230,7 @@ var propertyKeys = {
1207
1230
  property_isTemplate: "@isTemplate",
1208
1231
  property_isTemplateStripTheme: "@isTemplateStripTheme",
1209
1232
  property_isTracked: "@isTracked",
1233
+ property_jobTitle: "@jobTitle",
1210
1234
  property_jupyterExecutionCount: "@jupyterExecutionCount",
1211
1235
  property_jupyterId: "@jupyterId",
1212
1236
  property_kind: "@kind",
@@ -1251,6 +1275,7 @@ var propertyKeys = {
1251
1275
  property_productId: "@productId",
1252
1276
  property_productVideo: "@productVideo",
1253
1277
  property_progress: "@progress",
1278
+ property_pseudonym: "@pseudonym",
1254
1279
  property_publications: "@publications",
1255
1280
  property_publisher: "@publisher",
1256
1281
  property_publisherName: "@publisherName",
@@ -3153,6 +3178,12 @@ var GROUPS = {
3153
3178
  format: TagFormat.boolean,
3154
3179
  defaultValue: "false"
3155
3180
  },
3181
+ {
3182
+ key: ConfigKey.property_isEditable,
3183
+ description: "If true, the book is editable",
3184
+ format: TagFormat.boolean,
3185
+ defaultValue: "false"
3186
+ },
3156
3187
  {
3157
3188
  key: ConfigKey.property_chatWithBook,
3158
3189
  description: "If true, the user can chat about the book with an AI assistant",
@@ -4165,6 +4196,40 @@ var BITS = {
4165
4196
  ],
4166
4197
  resourceAttachmentAllowed: false
4167
4198
  },
4199
+ [BitType.author]: {
4200
+ since: "4.2.0",
4201
+ baseBitType: BitType._standard,
4202
+ description: "Represents an author of something",
4203
+ tags: [
4204
+ {
4205
+ key: ConfigKey.property_fullName,
4206
+ description: "Full name of the author"
4207
+ },
4208
+ {
4209
+ key: ConfigKey.property_pseudonym,
4210
+ description: "A pseudonym of the author, if any"
4211
+ },
4212
+ {
4213
+ key: ConfigKey.property_title,
4214
+ description: 'The title of the author, e.g. "Dr.", "Prof.", etc.',
4215
+ jsonKey: "title"
4216
+ },
4217
+ {
4218
+ key: ConfigKey.property_jobTitle,
4219
+ description: 'The job title of the author, e.g. "Software Engineer", "Professor", etc.'
4220
+ }
4221
+ ]
4222
+ },
4223
+ [BitType.bookAuthor]: {
4224
+ since: "4.2.0",
4225
+ baseBitType: BitType.author,
4226
+ description: "Represents an author of a book"
4227
+ },
4228
+ [BitType.articleAuthor]: {
4229
+ since: "4.2.0",
4230
+ baseBitType: BitType.author,
4231
+ description: "Represents an author of a book"
4232
+ },
4168
4233
  [BitType.article]: {
4169
4234
  since: "1.3.0",
4170
4235
  baseBitType: BitType._standard,
@@ -5140,6 +5205,71 @@ var BITS = {
5140
5205
  baseBitType: BitType.conversationLeft1,
5141
5206
  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
5207
  },
5208
+ [BitType.advertising]: {
5209
+ since: "4.2.0",
5210
+ baseBitType: BitType.article,
5211
+ description: "General advertising content bit"
5212
+ },
5213
+ [BitType.advertisingAdvertorial]: {
5214
+ since: "4.2.0",
5215
+ baseBitType: BitType.article,
5216
+ description: "Advertorial content bit (sponsored article)"
5217
+ },
5218
+ [BitType.advertisingCallToAction]: {
5219
+ since: "4.2.0",
5220
+ baseBitType: BitType.callToAction,
5221
+ description: "Call-to-action for advertising"
5222
+ },
5223
+ [BitType.advertisingCallToActionMeeting]: {
5224
+ since: "4.2.0",
5225
+ baseBitType: BitType.callToAction,
5226
+ description: "Call-to-action for meeting or appointment"
5227
+ },
5228
+ [BitType.advertisingBanner]: {
5229
+ since: "4.2.0",
5230
+ baseBitType: BitType.image,
5231
+ description: "Banner advertisement bit"
5232
+ },
5233
+ [BitType.advertisingSkyscraper]: {
5234
+ since: "4.2.0",
5235
+ baseBitType: BitType.image,
5236
+ description: "Skyscraper (vertical) advertisement bit"
5237
+ },
5238
+ [BitType.advertisingRectangle]: {
5239
+ since: "4.2.0",
5240
+ baseBitType: BitType.image,
5241
+ description: "Rectangle advertisement bit"
5242
+ },
5243
+ [BitType.advertisingFullPage]: {
5244
+ since: "4.2.0",
5245
+ baseBitType: BitType.image,
5246
+ description: "Full-page advertisement bit"
5247
+ },
5248
+ [BitType.advertisingHalfPage]: {
5249
+ since: "4.2.0",
5250
+ baseBitType: BitType.image,
5251
+ description: "Half-page advertisement bit"
5252
+ },
5253
+ [BitType.advertisingQuarterPage]: {
5254
+ since: "4.2.0",
5255
+ baseBitType: BitType.image,
5256
+ description: "Quarter-page advertisement bit"
5257
+ },
5258
+ [BitType.advertisingClassifiedPage]: {
5259
+ since: "4.2.0",
5260
+ baseBitType: BitType.image,
5261
+ description: "Classifieds advertisement page bit"
5262
+ },
5263
+ [BitType.advertisingLandscape]: {
5264
+ since: "4.2.0",
5265
+ baseBitType: BitType.image,
5266
+ description: "Landscape format advertisement bit"
5267
+ },
5268
+ [BitType.advertisingPortrait]: {
5269
+ since: "4.2.0",
5270
+ baseBitType: BitType.image,
5271
+ description: "Portrait format advertisement bit"
5272
+ },
5143
5273
  [BitType.cookPreparation]: {
5144
5274
  since: "1.3.0",
5145
5275
  baseBitType: BitType.article,
@@ -5429,6 +5559,19 @@ var BITS = {
5429
5559
  baseBitType: BitType.smartStandardExampleNonNormative,
5430
5560
  description: "Smart standard non-normative example collapsible bit, used to provide non-normative examples in smart standards that can be collapsed"
5431
5561
  },
5562
+ [BitType.authorContentBitGenerator]: {
5563
+ since: "4.2.0",
5564
+ baseBitType: BitType.article,
5565
+ description: "Body contains the content of one or more bits to be created by the bit generator",
5566
+ tags: [
5567
+ {
5568
+ key: ConfigKey.property_classification,
5569
+ description: "Classification for the created bits",
5570
+ format: TagFormat.plainText,
5571
+ maxCount: Count.infinity
5572
+ }
5573
+ ]
5574
+ },
5432
5575
  [BitType.appAiPrompt]: {
5433
5576
  since: "1.3.0",
5434
5577
  baseBitType: BitType.article,
@@ -5439,6 +5582,26 @@ var BITS = {
5439
5582
  baseBitType: BitType.article,
5440
5583
  description: "AI prompt bit, used to create AI prompts in articles or books"
5441
5584
  },
5585
+ [BitType.aiChat]: {
5586
+ since: "4.2.0",
5587
+ baseBitType: BitType.article,
5588
+ description: "AI chat bit, used to create an AI chat"
5589
+ },
5590
+ [BitType.aiEditor]: {
5591
+ since: "4.2.0",
5592
+ baseBitType: BitType.article,
5593
+ description: "AI editor bit, used to create an AI editor"
5594
+ },
5595
+ [BitType.aiTutor]: {
5596
+ since: "4.2.0",
5597
+ baseBitType: BitType.article,
5598
+ description: "AI tutor bit, used to create an AI tutor"
5599
+ },
5600
+ [BitType.aiWbt]: {
5601
+ since: "4.2.0",
5602
+ baseBitType: BitType.article,
5603
+ description: "AI WBT bit, used to create an AI WBT (Web-Based Training)"
5604
+ },
5442
5605
  [BitType.articleAi]: {
5443
5606
  since: "1.3.0",
5444
5607
  baseBitType: BitType.article,
@@ -8939,7 +9102,7 @@ var instance2 = new Config();
8939
9102
  // src/generated/package_info.ts
8940
9103
  var PACKAGE_INFO = {
8941
9104
  "name": "@gmb/bitmark-parser-generator",
8942
- "version": "4.1.2",
9105
+ "version": "4.2.0",
8943
9106
  "author": "Get More Brain Ltd",
8944
9107
  "license": "ISC",
8945
9108
  "description": "A bitmark parser and generator using Peggy.js"
@@ -9465,6 +9628,8 @@ var NodeType = (0, import_superenum20.superenum)({
9465
9628
  format: "format",
9466
9629
  forValues: "forValues",
9467
9630
  forValuesValue: "forValuesValue",
9631
+ fullName: "fullName",
9632
+ fullNameValue: "fullNameValue",
9468
9633
  gap: "gap",
9469
9634
  groupTag: "groupTag",
9470
9635
  groupTagValue: "groupTagValue",
@@ -9509,6 +9674,8 @@ var NodeType = (0, import_superenum20.superenum)({
9509
9674
  isCaseSensitive: "isCaseSensitive",
9510
9675
  isCommented: "isCommented",
9511
9676
  isCorrect: "isCorrect",
9677
+ isEditable: "isEditable",
9678
+ isEditableValue: "isEditableValue",
9512
9679
  isExample: "isExample",
9513
9680
  isInfoOnly: "isInfoOnly",
9514
9681
  isInfoOnlyValue: "isInfoOnlyValue",
@@ -9523,6 +9690,8 @@ var NodeType = (0, import_superenum20.superenum)({
9523
9690
  isTrackedValue: "isTrackedValue",
9524
9691
  item: "item",
9525
9692
  itemLead: "itemLead",
9693
+ jobTitle: "jobTitle",
9694
+ jobTitleValue: "jobTitleValue",
9526
9695
  jupyterExecutionCount: "jupyterExecutionCount",
9527
9696
  jupyterExecutionCountValue: "jupyterExecutionCountValue",
9528
9697
  jupyterId: "jupyterId",
@@ -9638,6 +9807,8 @@ var NodeType = (0, import_superenum20.superenum)({
9638
9807
  propertyValue: "propertyValue",
9639
9808
  propertyValues: "propertyValues",
9640
9809
  provider: "provider",
9810
+ pseudonym: "pseudonym",
9811
+ pseudonymValue: "pseudonymValue",
9641
9812
  publications: "publications",
9642
9813
  publicationsValue: "publicationsValue",
9643
9814
  publisher: "publisher",
@@ -9785,6 +9956,7 @@ var NodeType = (0, import_superenum20.superenum)({
9785
9956
  thumbnails: "thumbnails",
9786
9957
  thumbnailsValue: "thumbnailsValue",
9787
9958
  title: "title",
9959
+ titleString: "titleString",
9788
9960
  toc: "toc",
9789
9961
  tocContent: "tocContent",
9790
9962
  tocContentValue: "tocContentValue",
@@ -20643,62 +20815,99 @@ var NodeValidator = class {
20643
20815
  validateResource(resource) {
20644
20816
  if (!resource) return void 0;
20645
20817
  const ret = resource;
20646
- let valid = false;
20818
+ let valid = true;
20647
20819
  switch (resource.type) {
20648
- case ResourceType.image:
20649
- valid = !!resource.image.src;
20820
+ case ResourceType.image: {
20821
+ const imageResource = resource.image;
20822
+ if (!stringUtils.isString(imageResource.src)) imageResource.src = "";
20650
20823
  break;
20651
- case ResourceType.imageLink:
20652
- valid = !!resource.imageLink.url;
20824
+ }
20825
+ case ResourceType.imageLink: {
20826
+ const imageLink = resource.imageLink;
20827
+ if (!stringUtils.isString(imageLink.url)) imageLink.url = "";
20653
20828
  break;
20654
- case ResourceType.audio:
20655
- valid = !!resource.audio.src;
20829
+ }
20830
+ case ResourceType.audio: {
20831
+ const audio = resource.audio;
20832
+ if (!stringUtils.isString(audio.src)) audio.src = "";
20656
20833
  break;
20657
- case ResourceType.audioEmbed:
20658
- valid = !!resource.audioEmbed.src;
20834
+ }
20835
+ case ResourceType.audioEmbed: {
20836
+ const audioEmbed = resource.audioEmbed;
20837
+ if (!stringUtils.isString(audioEmbed.src)) audioEmbed.src = "";
20659
20838
  break;
20660
- case ResourceType.audioLink:
20661
- valid = !!resource.audioLink.url;
20839
+ }
20840
+ case ResourceType.audioLink: {
20841
+ const audioLink = resource.audioLink;
20842
+ if (!stringUtils.isString(audioLink.url)) audioLink.url = "";
20662
20843
  break;
20663
- case ResourceType.video:
20664
- valid = !!resource.video.src;
20844
+ }
20845
+ case ResourceType.video: {
20846
+ const video = resource.video;
20847
+ if (!stringUtils.isString(video.src)) video.src = "";
20665
20848
  break;
20666
- case ResourceType.videoEmbed:
20667
- valid = !!resource.videoEmbed.url;
20849
+ }
20850
+ case ResourceType.videoEmbed: {
20851
+ const videoEmbed = resource.videoEmbed;
20852
+ if (!stringUtils.isString(videoEmbed.url)) videoEmbed.url = "";
20668
20853
  break;
20669
- case ResourceType.videoLink:
20670
- valid = !!resource.videoLink.url;
20854
+ }
20855
+ case ResourceType.videoLink: {
20856
+ const videoLink = resource.videoLink;
20857
+ if (!stringUtils.isString(videoLink.url)) videoLink.url = "";
20671
20858
  break;
20672
- case ResourceType.stillImageFilm:
20673
- valid = !!resource.image.src && !!resource.audio.src;
20859
+ }
20860
+ case ResourceType.stillImageFilm: {
20861
+ const stillImageFilm = resource;
20862
+ if (!stringUtils.isString(stillImageFilm.image.src)) stillImageFilm.image.src = "";
20863
+ if (!stringUtils.isString(stillImageFilm.audio.src)) stillImageFilm.audio.src = "";
20674
20864
  break;
20675
- case ResourceType.stillImageFilmEmbed:
20676
- valid = !!resource.stillImageFilmEmbed.url;
20865
+ }
20866
+ case ResourceType.stillImageFilmEmbed: {
20867
+ const stillImageFilmEmbed = resource.stillImageFilmEmbed;
20868
+ if (!stringUtils.isString(stillImageFilmEmbed.url)) stillImageFilmEmbed.url = "";
20677
20869
  break;
20678
- case ResourceType.stillImageFilmLink:
20679
- valid = !!resource.stillImageFilmLink.url;
20870
+ }
20871
+ case ResourceType.stillImageFilmLink: {
20872
+ const stillImageFilmLink = resource.stillImageFilmLink;
20873
+ if (!stringUtils.isString(stillImageFilmLink.url)) stillImageFilmLink.url = "";
20680
20874
  break;
20681
- case ResourceType.article:
20682
- valid = !!resource.article.body;
20875
+ }
20876
+ case ResourceType.article: {
20877
+ const article = resource.article;
20878
+ if (!stringUtils.isString(article.body)) article.body = "";
20683
20879
  break;
20684
- case ResourceType.document:
20685
- valid = !!resource.document.url;
20880
+ }
20881
+ case ResourceType.document: {
20882
+ const document2 = resource.document;
20883
+ if (!stringUtils.isString(document2.url)) document2.url = "";
20686
20884
  break;
20687
- case ResourceType.documentEmbed:
20688
- valid = !!resource.documentEmbed.url;
20885
+ }
20886
+ case ResourceType.documentEmbed: {
20887
+ const documentEmbed = resource.documentEmbed;
20888
+ if (!stringUtils.isString(documentEmbed.url)) documentEmbed.url = "";
20689
20889
  break;
20690
- case ResourceType.documentLink:
20691
- valid = !!resource.documentLink.url;
20890
+ }
20891
+ case ResourceType.documentLink: {
20892
+ const documentLink = resource.documentLink;
20893
+ if (!stringUtils.isString(documentLink.url)) documentLink.url = "";
20692
20894
  break;
20693
- case ResourceType.documentDownload:
20694
- valid = !!resource.documentDownload.url;
20895
+ }
20896
+ case ResourceType.documentDownload: {
20897
+ const documentDownload = resource.documentDownload;
20898
+ if (!stringUtils.isString(documentDownload.url)) documentDownload.url = "";
20695
20899
  break;
20696
- case ResourceType.appLink:
20697
- valid = !!resource.appLink.url;
20900
+ }
20901
+ case ResourceType.appLink: {
20902
+ const appLink = resource.appLink;
20903
+ if (!stringUtils.isString(appLink.url)) appLink.url = "";
20698
20904
  break;
20699
- case ResourceType.websiteLink:
20700
- valid = !!resource.websiteLink.url;
20905
+ }
20906
+ case ResourceType.websiteLink: {
20907
+ const websiteLink = resource.websiteLink;
20908
+ if (!stringUtils.isString(websiteLink.url)) websiteLink.url = "";
20701
20909
  break;
20910
+ }
20702
20911
  default:
20703
20912
  valid = false;
20704
20913
  }
@@ -21928,6 +22137,12 @@ var Builder = class extends BaseBuilder {
21928
22137
  data.isTemplateStripTheme,
21929
22138
  options
21930
22139
  ),
22140
+ isEditable: this.toAstProperty(
22141
+ bitType,
22142
+ ConfigKey.property_isEditable,
22143
+ data.isEditable,
22144
+ options
22145
+ ),
21931
22146
  aiGenerated: this.toAstProperty(
21932
22147
  bitType,
21933
22148
  ConfigKey.property_aiGenerated,
@@ -22530,6 +22745,11 @@ var Builder = class extends BaseBuilder {
22530
22745
  data.referenceProperty,
22531
22746
  options
22532
22747
  ),
22748
+ // Author data
22749
+ fullName: this.toAstProperty(bitType, ConfigKey.property_fullName, data.fullName, options),
22750
+ pseudonym: this.toAstProperty(bitType, ConfigKey.property_pseudonym, data.pseudonym, options),
22751
+ titleString: this.toAstProperty(bitType, ConfigKey.property_title, data.titleString, options),
22752
+ jobTitle: this.toAstProperty(bitType, ConfigKey.property_jobTitle, data.jobTitle, options),
22533
22753
  // Book data
22534
22754
  title: this.handleJsonText(context, TextLocation.tag, data.title),
22535
22755
  subtitle: this.handleJsonText(context, TextLocation.tag, data.subtitle),
@@ -25636,6 +25856,18 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
25636
25856
  }
25637
25857
  return false;
25638
25858
  }
25859
+ // bitmarkAst -> bits -> bitsValue -> titleString
25860
+ leaf_titleString(node, route) {
25861
+ const parent = this.getParentNode(route);
25862
+ if (parent?.key !== NodeType.bitsValue) return true;
25863
+ if (node.value) {
25864
+ this.writeNL();
25865
+ this.writeProperty("title", node.value, route, {
25866
+ format: TagFormat.plainText
25867
+ });
25868
+ }
25869
+ return false;
25870
+ }
25639
25871
  // bitmarkAst -> bits -> title
25640
25872
  enter_title(node, route) {
25641
25873
  const parent = this.getParentNode(route);
@@ -26844,6 +27076,15 @@ var JsonGenerator = class extends AstWalkerGenerator {
26844
27076
  enter_instruction(node, route) {
26845
27077
  return this.standardHandler(node, route, NodeType.bitsValue, { array: true });
26846
27078
  }
27079
+ // bitmarkAst -> bits -> bitsValue -> titleString
27080
+ leaf_titleString(node, route) {
27081
+ const parent = this.getParentNode(route);
27082
+ if (parent?.key !== NodeType.bitsValue) return true;
27083
+ return this.standardHandler(node, route, [NodeType.bitsValue], {
27084
+ array: false,
27085
+ keyOverride: "title"
27086
+ });
27087
+ }
26847
27088
  // bitmarkAst -> bits -> bitsValue -> title
26848
27089
  enter_title(node, route) {
26849
27090
  return this.standardHandler(node, route, [NodeType.bitsValue, NodeType.cardNode], {
@@ -28093,6 +28334,7 @@ var JsonParser = class {
28093
28334
  resourceType: this.getResourceType(bit.resource),
28094
28335
  isCommented,
28095
28336
  internalComment: internalComments,
28337
+ ...this.processTitle(bitType, bit.title),
28096
28338
  ...this.processReference(referenceBit),
28097
28339
  // reference and referenceProperty
28098
28340
  ...this.parseExample(bit.example),
@@ -28193,6 +28435,17 @@ var JsonParser = class {
28193
28435
  footer: footerText
28194
28436
  };
28195
28437
  }
28438
+ processTitle(bitType, title) {
28439
+ if (instance2.isOfBitType(bitType, BitType.author))
28440
+ return {
28441
+ titleString: title,
28442
+ title: void 0
28443
+ };
28444
+ return {
28445
+ titleString: void 0,
28446
+ title
28447
+ };
28448
+ }
28196
28449
  processReference(reference) {
28197
28450
  if (Array.isArray(reference) && reference.length > 0) {
28198
28451
  return {
@@ -31373,12 +31626,21 @@ function buildTitles(_context, bitType, title) {
31373
31626
  level: title.length > 0 ? title.length - 1 : void 0
31374
31627
  };
31375
31628
  } 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
- };
31629
+ if (Array.isArray(title)) {
31630
+ return {
31631
+ title: title[1]?.titleAst ?? void 0,
31632
+ titleString: title[1]?.titleString ?? void 0,
31633
+ subtitle: title[2]?.titleAst ?? void 0,
31634
+ subtitleString: title[2]?.titleString ?? void 0
31635
+ };
31636
+ } else {
31637
+ return {
31638
+ title: void 0,
31639
+ titleString: title ?? void 0,
31640
+ subtitle: void 0,
31641
+ subtitleString: void 0
31642
+ };
31643
+ }
31382
31644
  }
31383
31645
  }
31384
31646