@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.
@@ -11,7 +11,24 @@ var BitType = superenum({
11
11
  // Used to indicate a bit is commented out
12
12
  _standard: "_standard",
13
13
  // Not to be used as a bit, but as a base for other bit types
14
+ advertising: "advertising",
15
+ advertisingAdvertorial: "advertising-advertorial",
16
+ advertisingCallToAction: "advertising-call-to-action",
17
+ advertisingCallToActionMeeting: "advertising-call-to-action-meeting",
18
+ advertisingBanner: "advertising-banner",
19
+ advertisingSkyscraper: "advertising-skyscraper",
20
+ advertisingRectangle: "advertising-rectangle",
21
+ advertisingFullPage: "advertising-full-page",
22
+ advertisingHalfPage: "advertising-half-page",
23
+ advertisingQuarterPage: "advertising-quarter-page",
24
+ advertisingClassifiedPage: "advertising-classified-page",
25
+ advertisingLandscape: "advertising-landscape",
26
+ advertisingPortrait: "advertising-portrait",
27
+ aiChat: "ai-chat",
28
+ aiEditor: "ai-editor",
14
29
  aiPrompt: "ai-prompt",
30
+ aiTutor: "ai-tutor",
31
+ aiWbt: "ai-wbt",
15
32
  anchor: "anchor",
16
33
  appAiPrompt: "app-ai-prompt",
17
34
  appBitmarkFromEditor: "app-bitmark-from-editor",
@@ -29,6 +46,7 @@ var BitType = superenum({
29
46
  articleAi: "article-ai",
30
47
  articleAlt: "article-alt",
31
48
  articleAttachment: "article-attachment",
49
+ articleAuthor: "article-author",
32
50
  articleEmbed: "article-embed",
33
51
  articleLink: "article-link",
34
52
  articleResponsive: "article-responsive",
@@ -39,6 +57,8 @@ var BitType = superenum({
39
57
  audioEmbed: "audio-embed",
40
58
  audioLink: "audio-link",
41
59
  audioTranscript: "audio-transcript",
60
+ author: "author",
61
+ authorContentBitGenerator: "author-content-bit-generator",
42
62
  bitAlias: "bit-alias",
43
63
  bitBookEnding: "bit-book-ending",
44
64
  bitBookSummary: "bit-book-summary",
@@ -51,6 +71,7 @@ var BitType = superenum({
51
71
  bookAlias: "book-alias",
52
72
  bookAppendix: "book-appendix",
53
73
  bookArticle: "book-article",
74
+ bookAuthor: "book-author",
54
75
  bookAutherBio: "book-author-bio",
55
76
  bookBibliography: "book-bibliography",
56
77
  bookClose: "book-close",
@@ -219,6 +240,8 @@ var BitType = superenum({
219
240
  extractorAiChat: "extractor-ai-chat",
220
241
  extractorBlock: "extractor-block",
221
242
  extractorConfiguration: "extractor-configuration",
243
+ extractorEmbeddedImage: "extractor-embedded-image",
244
+ extractorEmbeddedImageCollapsible: "extractor-embedded-image-collapsible",
222
245
  extractorInformation: "extractor-information",
223
246
  extractorPage: "extractor-page",
224
247
  extractorPageCollapsible: "extractor-page-collapsible",
@@ -1117,6 +1140,7 @@ var propertyKeys = {
1117
1140
  property_disableCalculation: "@disableCalculation",
1118
1141
  property_disableFeedback: "@disableFeedback",
1119
1142
  property_duration: "@duration",
1143
+ property_isEditable: "@isEditable",
1120
1144
  property_emphasis: "@emphasis",
1121
1145
  property_example: "@example",
1122
1146
  property_externalId: "@externalId",
@@ -1128,6 +1152,7 @@ var propertyKeys = {
1128
1152
  property_focusX: "@focusX",
1129
1153
  property_focusY: "@focusY",
1130
1154
  property_format: "@format",
1155
+ property_fullName: "@fullName",
1131
1156
  property_groupTag: "@groupTag",
1132
1157
  property_handInAcceptFileType: "@handInAcceptFileType",
1133
1158
  property_handInInstruction: "@handInInstruction",
@@ -1148,6 +1173,7 @@ var propertyKeys = {
1148
1173
  property_isTemplate: "@isTemplate",
1149
1174
  property_isTemplateStripTheme: "@isTemplateStripTheme",
1150
1175
  property_isTracked: "@isTracked",
1176
+ property_jobTitle: "@jobTitle",
1151
1177
  property_jupyterExecutionCount: "@jupyterExecutionCount",
1152
1178
  property_jupyterId: "@jupyterId",
1153
1179
  property_kind: "@kind",
@@ -1192,6 +1218,7 @@ var propertyKeys = {
1192
1218
  property_productId: "@productId",
1193
1219
  property_productVideo: "@productVideo",
1194
1220
  property_progress: "@progress",
1221
+ property_pseudonym: "@pseudonym",
1195
1222
  property_publications: "@publications",
1196
1223
  property_publisher: "@publisher",
1197
1224
  property_publisherName: "@publisherName",
@@ -3094,6 +3121,12 @@ var GROUPS = {
3094
3121
  format: TagFormat.boolean,
3095
3122
  defaultValue: "false"
3096
3123
  },
3124
+ {
3125
+ key: ConfigKey.property_isEditable,
3126
+ description: "If true, the book is editable",
3127
+ format: TagFormat.boolean,
3128
+ defaultValue: "false"
3129
+ },
3097
3130
  {
3098
3131
  key: ConfigKey.property_chatWithBook,
3099
3132
  description: "If true, the user can chat about the book with an AI assistant",
@@ -4106,6 +4139,40 @@ var BITS = {
4106
4139
  ],
4107
4140
  resourceAttachmentAllowed: false
4108
4141
  },
4142
+ [BitType.author]: {
4143
+ since: "4.2.0",
4144
+ baseBitType: BitType._standard,
4145
+ description: "Represents an author of something",
4146
+ tags: [
4147
+ {
4148
+ key: ConfigKey.property_fullName,
4149
+ description: "Full name of the author"
4150
+ },
4151
+ {
4152
+ key: ConfigKey.property_pseudonym,
4153
+ description: "A pseudonym of the author, if any"
4154
+ },
4155
+ {
4156
+ key: ConfigKey.property_title,
4157
+ description: 'The title of the author, e.g. "Dr.", "Prof.", etc.',
4158
+ jsonKey: "title"
4159
+ },
4160
+ {
4161
+ key: ConfigKey.property_jobTitle,
4162
+ description: 'The job title of the author, e.g. "Software Engineer", "Professor", etc.'
4163
+ }
4164
+ ]
4165
+ },
4166
+ [BitType.bookAuthor]: {
4167
+ since: "4.2.0",
4168
+ baseBitType: BitType.author,
4169
+ description: "Represents an author of a book"
4170
+ },
4171
+ [BitType.articleAuthor]: {
4172
+ since: "4.2.0",
4173
+ baseBitType: BitType.author,
4174
+ description: "Represents an author of a book"
4175
+ },
4109
4176
  [BitType.article]: {
4110
4177
  since: "1.3.0",
4111
4178
  baseBitType: BitType._standard,
@@ -5081,6 +5148,71 @@ var BITS = {
5081
5148
  baseBitType: BitType.conversationLeft1,
5082
5149
  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"
5083
5150
  },
5151
+ [BitType.advertising]: {
5152
+ since: "4.2.0",
5153
+ baseBitType: BitType.article,
5154
+ description: "General advertising content bit"
5155
+ },
5156
+ [BitType.advertisingAdvertorial]: {
5157
+ since: "4.2.0",
5158
+ baseBitType: BitType.article,
5159
+ description: "Advertorial content bit (sponsored article)"
5160
+ },
5161
+ [BitType.advertisingCallToAction]: {
5162
+ since: "4.2.0",
5163
+ baseBitType: BitType.callToAction,
5164
+ description: "Call-to-action for advertising"
5165
+ },
5166
+ [BitType.advertisingCallToActionMeeting]: {
5167
+ since: "4.2.0",
5168
+ baseBitType: BitType.callToAction,
5169
+ description: "Call-to-action for meeting or appointment"
5170
+ },
5171
+ [BitType.advertisingBanner]: {
5172
+ since: "4.2.0",
5173
+ baseBitType: BitType.image,
5174
+ description: "Banner advertisement bit"
5175
+ },
5176
+ [BitType.advertisingSkyscraper]: {
5177
+ since: "4.2.0",
5178
+ baseBitType: BitType.image,
5179
+ description: "Skyscraper (vertical) advertisement bit"
5180
+ },
5181
+ [BitType.advertisingRectangle]: {
5182
+ since: "4.2.0",
5183
+ baseBitType: BitType.image,
5184
+ description: "Rectangle advertisement bit"
5185
+ },
5186
+ [BitType.advertisingFullPage]: {
5187
+ since: "4.2.0",
5188
+ baseBitType: BitType.image,
5189
+ description: "Full-page advertisement bit"
5190
+ },
5191
+ [BitType.advertisingHalfPage]: {
5192
+ since: "4.2.0",
5193
+ baseBitType: BitType.image,
5194
+ description: "Half-page advertisement bit"
5195
+ },
5196
+ [BitType.advertisingQuarterPage]: {
5197
+ since: "4.2.0",
5198
+ baseBitType: BitType.image,
5199
+ description: "Quarter-page advertisement bit"
5200
+ },
5201
+ [BitType.advertisingClassifiedPage]: {
5202
+ since: "4.2.0",
5203
+ baseBitType: BitType.image,
5204
+ description: "Classifieds advertisement page bit"
5205
+ },
5206
+ [BitType.advertisingLandscape]: {
5207
+ since: "4.2.0",
5208
+ baseBitType: BitType.image,
5209
+ description: "Landscape format advertisement bit"
5210
+ },
5211
+ [BitType.advertisingPortrait]: {
5212
+ since: "4.2.0",
5213
+ baseBitType: BitType.image,
5214
+ description: "Portrait format advertisement bit"
5215
+ },
5084
5216
  [BitType.cookPreparation]: {
5085
5217
  since: "1.3.0",
5086
5218
  baseBitType: BitType.article,
@@ -5370,6 +5502,19 @@ var BITS = {
5370
5502
  baseBitType: BitType.smartStandardExampleNonNormative,
5371
5503
  description: "Smart standard non-normative example collapsible bit, used to provide non-normative examples in smart standards that can be collapsed"
5372
5504
  },
5505
+ [BitType.authorContentBitGenerator]: {
5506
+ since: "4.2.0",
5507
+ baseBitType: BitType.article,
5508
+ description: "Body contains the content of one or more bits to be created by the bit generator",
5509
+ tags: [
5510
+ {
5511
+ key: ConfigKey.property_classification,
5512
+ description: "Classification for the created bits",
5513
+ format: TagFormat.plainText,
5514
+ maxCount: Count.infinity
5515
+ }
5516
+ ]
5517
+ },
5373
5518
  [BitType.appAiPrompt]: {
5374
5519
  since: "1.3.0",
5375
5520
  baseBitType: BitType.article,
@@ -5380,6 +5525,26 @@ var BITS = {
5380
5525
  baseBitType: BitType.article,
5381
5526
  description: "AI prompt bit, used to create AI prompts in articles or books"
5382
5527
  },
5528
+ [BitType.aiChat]: {
5529
+ since: "4.2.0",
5530
+ baseBitType: BitType.article,
5531
+ description: "AI chat bit, used to create an AI chat"
5532
+ },
5533
+ [BitType.aiEditor]: {
5534
+ since: "4.2.0",
5535
+ baseBitType: BitType.article,
5536
+ description: "AI editor bit, used to create an AI editor"
5537
+ },
5538
+ [BitType.aiTutor]: {
5539
+ since: "4.2.0",
5540
+ baseBitType: BitType.article,
5541
+ description: "AI tutor bit, used to create an AI tutor"
5542
+ },
5543
+ [BitType.aiWbt]: {
5544
+ since: "4.2.0",
5545
+ baseBitType: BitType.article,
5546
+ description: "AI WBT bit, used to create an AI WBT (Web-Based Training)"
5547
+ },
5383
5548
  [BitType.articleAi]: {
5384
5549
  since: "1.3.0",
5385
5550
  baseBitType: BitType.article,
@@ -6097,6 +6262,18 @@ var BITS = {
6097
6262
  description: "Extractor configuration bit, used to configure extractors in articles or books",
6098
6263
  textFormatDefault: TextFormat2.plainText
6099
6264
  },
6265
+ [BitType.extractorEmbeddedImage]: {
6266
+ since: "4.3.0",
6267
+ baseBitType: BitType.image,
6268
+ description: "Extractor embedded image bit, used for embedded images extracted from PDFs",
6269
+ textFormatDefault: TextFormat2.plainText
6270
+ },
6271
+ [BitType.extractorEmbeddedImageCollapsible]: {
6272
+ since: "4.3.0",
6273
+ baseBitType: BitType.extractorEmbeddedImage,
6274
+ description: "Collapsible extractor embedded image bit, used for embedded images extracted from PDFs",
6275
+ textFormatDefault: TextFormat2.plainText
6276
+ },
6100
6277
  [BitType.extractorInformation]: {
6101
6278
  since: "3.8.0",
6102
6279
  baseBitType: BitType._standard,
@@ -8880,7 +9057,7 @@ var instance2 = new Config();
8880
9057
  // src/generated/package_info.ts
8881
9058
  var PACKAGE_INFO = {
8882
9059
  "name": "@gmb/bitmark-parser-generator",
8883
- "version": "4.1.2",
9060
+ "version": "4.3.0",
8884
9061
  "author": "Get More Brain Ltd",
8885
9062
  "license": "ISC",
8886
9063
  "description": "A bitmark parser and generator using Peggy.js"
@@ -9406,6 +9583,8 @@ var NodeType = superenum20({
9406
9583
  format: "format",
9407
9584
  forValues: "forValues",
9408
9585
  forValuesValue: "forValuesValue",
9586
+ fullName: "fullName",
9587
+ fullNameValue: "fullNameValue",
9409
9588
  gap: "gap",
9410
9589
  groupTag: "groupTag",
9411
9590
  groupTagValue: "groupTagValue",
@@ -9450,6 +9629,8 @@ var NodeType = superenum20({
9450
9629
  isCaseSensitive: "isCaseSensitive",
9451
9630
  isCommented: "isCommented",
9452
9631
  isCorrect: "isCorrect",
9632
+ isEditable: "isEditable",
9633
+ isEditableValue: "isEditableValue",
9453
9634
  isExample: "isExample",
9454
9635
  isInfoOnly: "isInfoOnly",
9455
9636
  isInfoOnlyValue: "isInfoOnlyValue",
@@ -9464,6 +9645,8 @@ var NodeType = superenum20({
9464
9645
  isTrackedValue: "isTrackedValue",
9465
9646
  item: "item",
9466
9647
  itemLead: "itemLead",
9648
+ jobTitle: "jobTitle",
9649
+ jobTitleValue: "jobTitleValue",
9467
9650
  jupyterExecutionCount: "jupyterExecutionCount",
9468
9651
  jupyterExecutionCountValue: "jupyterExecutionCountValue",
9469
9652
  jupyterId: "jupyterId",
@@ -9579,6 +9762,8 @@ var NodeType = superenum20({
9579
9762
  propertyValue: "propertyValue",
9580
9763
  propertyValues: "propertyValues",
9581
9764
  provider: "provider",
9765
+ pseudonym: "pseudonym",
9766
+ pseudonymValue: "pseudonymValue",
9582
9767
  publications: "publications",
9583
9768
  publicationsValue: "publicationsValue",
9584
9769
  publisher: "publisher",
@@ -9726,6 +9911,7 @@ var NodeType = superenum20({
9726
9911
  thumbnails: "thumbnails",
9727
9912
  thumbnailsValue: "thumbnailsValue",
9728
9913
  title: "title",
9914
+ titleString: "titleString",
9729
9915
  toc: "toc",
9730
9916
  tocContent: "tocContent",
9731
9917
  tocContentValue: "tocContentValue",
@@ -20584,62 +20770,99 @@ var NodeValidator = class {
20584
20770
  validateResource(resource) {
20585
20771
  if (!resource) return void 0;
20586
20772
  const ret = resource;
20587
- let valid = false;
20773
+ let valid = true;
20588
20774
  switch (resource.type) {
20589
- case ResourceType.image:
20590
- valid = !!resource.image.src;
20775
+ case ResourceType.image: {
20776
+ const imageResource = resource.image;
20777
+ if (!stringUtils.isString(imageResource.src)) imageResource.src = "";
20591
20778
  break;
20592
- case ResourceType.imageLink:
20593
- valid = !!resource.imageLink.url;
20779
+ }
20780
+ case ResourceType.imageLink: {
20781
+ const imageLink = resource.imageLink;
20782
+ if (!stringUtils.isString(imageLink.url)) imageLink.url = "";
20594
20783
  break;
20595
- case ResourceType.audio:
20596
- valid = !!resource.audio.src;
20784
+ }
20785
+ case ResourceType.audio: {
20786
+ const audio = resource.audio;
20787
+ if (!stringUtils.isString(audio.src)) audio.src = "";
20597
20788
  break;
20598
- case ResourceType.audioEmbed:
20599
- valid = !!resource.audioEmbed.src;
20789
+ }
20790
+ case ResourceType.audioEmbed: {
20791
+ const audioEmbed = resource.audioEmbed;
20792
+ if (!stringUtils.isString(audioEmbed.src)) audioEmbed.src = "";
20600
20793
  break;
20601
- case ResourceType.audioLink:
20602
- valid = !!resource.audioLink.url;
20794
+ }
20795
+ case ResourceType.audioLink: {
20796
+ const audioLink = resource.audioLink;
20797
+ if (!stringUtils.isString(audioLink.url)) audioLink.url = "";
20603
20798
  break;
20604
- case ResourceType.video:
20605
- valid = !!resource.video.src;
20799
+ }
20800
+ case ResourceType.video: {
20801
+ const video = resource.video;
20802
+ if (!stringUtils.isString(video.src)) video.src = "";
20606
20803
  break;
20607
- case ResourceType.videoEmbed:
20608
- valid = !!resource.videoEmbed.url;
20804
+ }
20805
+ case ResourceType.videoEmbed: {
20806
+ const videoEmbed = resource.videoEmbed;
20807
+ if (!stringUtils.isString(videoEmbed.url)) videoEmbed.url = "";
20609
20808
  break;
20610
- case ResourceType.videoLink:
20611
- valid = !!resource.videoLink.url;
20809
+ }
20810
+ case ResourceType.videoLink: {
20811
+ const videoLink = resource.videoLink;
20812
+ if (!stringUtils.isString(videoLink.url)) videoLink.url = "";
20612
20813
  break;
20613
- case ResourceType.stillImageFilm:
20614
- valid = !!resource.image.src && !!resource.audio.src;
20814
+ }
20815
+ case ResourceType.stillImageFilm: {
20816
+ const stillImageFilm = resource;
20817
+ if (!stringUtils.isString(stillImageFilm.image.src)) stillImageFilm.image.src = "";
20818
+ if (!stringUtils.isString(stillImageFilm.audio.src)) stillImageFilm.audio.src = "";
20615
20819
  break;
20616
- case ResourceType.stillImageFilmEmbed:
20617
- valid = !!resource.stillImageFilmEmbed.url;
20820
+ }
20821
+ case ResourceType.stillImageFilmEmbed: {
20822
+ const stillImageFilmEmbed = resource.stillImageFilmEmbed;
20823
+ if (!stringUtils.isString(stillImageFilmEmbed.url)) stillImageFilmEmbed.url = "";
20618
20824
  break;
20619
- case ResourceType.stillImageFilmLink:
20620
- valid = !!resource.stillImageFilmLink.url;
20825
+ }
20826
+ case ResourceType.stillImageFilmLink: {
20827
+ const stillImageFilmLink = resource.stillImageFilmLink;
20828
+ if (!stringUtils.isString(stillImageFilmLink.url)) stillImageFilmLink.url = "";
20621
20829
  break;
20622
- case ResourceType.article:
20623
- valid = !!resource.article.body;
20830
+ }
20831
+ case ResourceType.article: {
20832
+ const article = resource.article;
20833
+ if (!stringUtils.isString(article.body)) article.body = "";
20624
20834
  break;
20625
- case ResourceType.document:
20626
- valid = !!resource.document.url;
20835
+ }
20836
+ case ResourceType.document: {
20837
+ const document2 = resource.document;
20838
+ if (!stringUtils.isString(document2.url)) document2.url = "";
20627
20839
  break;
20628
- case ResourceType.documentEmbed:
20629
- valid = !!resource.documentEmbed.url;
20840
+ }
20841
+ case ResourceType.documentEmbed: {
20842
+ const documentEmbed = resource.documentEmbed;
20843
+ if (!stringUtils.isString(documentEmbed.url)) documentEmbed.url = "";
20630
20844
  break;
20631
- case ResourceType.documentLink:
20632
- valid = !!resource.documentLink.url;
20845
+ }
20846
+ case ResourceType.documentLink: {
20847
+ const documentLink = resource.documentLink;
20848
+ if (!stringUtils.isString(documentLink.url)) documentLink.url = "";
20633
20849
  break;
20634
- case ResourceType.documentDownload:
20635
- valid = !!resource.documentDownload.url;
20850
+ }
20851
+ case ResourceType.documentDownload: {
20852
+ const documentDownload = resource.documentDownload;
20853
+ if (!stringUtils.isString(documentDownload.url)) documentDownload.url = "";
20636
20854
  break;
20637
- case ResourceType.appLink:
20638
- valid = !!resource.appLink.url;
20855
+ }
20856
+ case ResourceType.appLink: {
20857
+ const appLink = resource.appLink;
20858
+ if (!stringUtils.isString(appLink.url)) appLink.url = "";
20639
20859
  break;
20640
- case ResourceType.websiteLink:
20641
- valid = !!resource.websiteLink.url;
20860
+ }
20861
+ case ResourceType.websiteLink: {
20862
+ const websiteLink = resource.websiteLink;
20863
+ if (!stringUtils.isString(websiteLink.url)) websiteLink.url = "";
20642
20864
  break;
20865
+ }
20643
20866
  default:
20644
20867
  valid = false;
20645
20868
  }
@@ -21869,6 +22092,12 @@ var Builder = class extends BaseBuilder {
21869
22092
  data.isTemplateStripTheme,
21870
22093
  options
21871
22094
  ),
22095
+ isEditable: this.toAstProperty(
22096
+ bitType,
22097
+ ConfigKey.property_isEditable,
22098
+ data.isEditable,
22099
+ options
22100
+ ),
21872
22101
  aiGenerated: this.toAstProperty(
21873
22102
  bitType,
21874
22103
  ConfigKey.property_aiGenerated,
@@ -22471,6 +22700,11 @@ var Builder = class extends BaseBuilder {
22471
22700
  data.referenceProperty,
22472
22701
  options
22473
22702
  ),
22703
+ // Author data
22704
+ fullName: this.toAstProperty(bitType, ConfigKey.property_fullName, data.fullName, options),
22705
+ pseudonym: this.toAstProperty(bitType, ConfigKey.property_pseudonym, data.pseudonym, options),
22706
+ titleString: this.toAstProperty(bitType, ConfigKey.property_title, data.titleString, options),
22707
+ jobTitle: this.toAstProperty(bitType, ConfigKey.property_jobTitle, data.jobTitle, options),
22474
22708
  // Book data
22475
22709
  title: this.handleJsonText(context, TextLocation2.tag, data.title),
22476
22710
  subtitle: this.handleJsonText(context, TextLocation2.tag, data.subtitle),
@@ -25577,6 +25811,18 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
25577
25811
  }
25578
25812
  return false;
25579
25813
  }
25814
+ // bitmarkAst -> bits -> bitsValue -> titleString
25815
+ leaf_titleString(node, route) {
25816
+ const parent = this.getParentNode(route);
25817
+ if (parent?.key !== NodeType.bitsValue) return true;
25818
+ if (node.value) {
25819
+ this.writeNL();
25820
+ this.writeProperty("title", node.value, route, {
25821
+ format: TagFormat.plainText
25822
+ });
25823
+ }
25824
+ return false;
25825
+ }
25580
25826
  // bitmarkAst -> bits -> title
25581
25827
  enter_title(node, route) {
25582
25828
  const parent = this.getParentNode(route);
@@ -26785,6 +27031,15 @@ var JsonGenerator = class extends AstWalkerGenerator {
26785
27031
  enter_instruction(node, route) {
26786
27032
  return this.standardHandler(node, route, NodeType.bitsValue, { array: true });
26787
27033
  }
27034
+ // bitmarkAst -> bits -> bitsValue -> titleString
27035
+ leaf_titleString(node, route) {
27036
+ const parent = this.getParentNode(route);
27037
+ if (parent?.key !== NodeType.bitsValue) return true;
27038
+ return this.standardHandler(node, route, [NodeType.bitsValue], {
27039
+ array: false,
27040
+ keyOverride: "title"
27041
+ });
27042
+ }
26788
27043
  // bitmarkAst -> bits -> bitsValue -> title
26789
27044
  enter_title(node, route) {
26790
27045
  return this.standardHandler(node, route, [NodeType.bitsValue, NodeType.cardNode], {
@@ -27493,7 +27748,6 @@ var JsonGenerator = class extends AstWalkerGenerator {
27493
27748
  */
27494
27749
  cleanBitJson(bitJson) {
27495
27750
  const bitType = instance2.getBitType(bitJson.type);
27496
- const bitConfig = instance2.getBitConfig(bitType);
27497
27751
  if (bitJson.originalType == null) bitJson.originalType = void 0;
27498
27752
  if (!bitJson.item) bitJson.item = void 0;
27499
27753
  if (instance2.isOfBitType(bitType, [BitType._error, BitType._comment])) {
@@ -27729,9 +27983,6 @@ var JsonGenerator = class extends AstWalkerGenerator {
27729
27983
  if (instance2.isOfBitType(bitType, BitType.container)) {
27730
27984
  if (bitJson.allowedBit == null) bitJson.allowedBit = [];
27731
27985
  }
27732
- if (bitConfig.quizBit) {
27733
- if (bitJson.revealSolutions == null) bitJson.revealSolutions = false;
27734
- }
27735
27986
  if (instance2.isOfBitType(bitType, BitType.platformPath)) {
27736
27987
  if (bitJson.path == null) bitJson.path = "";
27737
27988
  }
@@ -28034,6 +28285,7 @@ var JsonParser = class {
28034
28285
  resourceType: this.getResourceType(bit.resource),
28035
28286
  isCommented,
28036
28287
  internalComment: internalComments,
28288
+ ...this.processTitle(bitType, bit.title),
28037
28289
  ...this.processReference(referenceBit),
28038
28290
  // reference and referenceProperty
28039
28291
  ...this.parseExample(bit.example),
@@ -28134,6 +28386,17 @@ var JsonParser = class {
28134
28386
  footer: footerText
28135
28387
  };
28136
28388
  }
28389
+ processTitle(bitType, title) {
28390
+ if (instance2.isOfBitType(bitType, BitType.author))
28391
+ return {
28392
+ titleString: title,
28393
+ title: void 0
28394
+ };
28395
+ return {
28396
+ titleString: void 0,
28397
+ title
28398
+ };
28399
+ }
28137
28400
  processReference(reference) {
28138
28401
  if (Array.isArray(reference) && reference.length > 0) {
28139
28402
  return {
@@ -31296,12 +31559,21 @@ function buildTitles(_context, bitType, title) {
31296
31559
  level: title.length > 0 ? title.length - 1 : void 0
31297
31560
  };
31298
31561
  } else {
31299
- return {
31300
- title: title[1]?.titleAst ?? void 0,
31301
- titleString: title[1]?.titleString ?? void 0,
31302
- subtitle: title[2]?.titleAst ?? void 0,
31303
- subtitleString: title[2]?.titleString ?? void 0
31304
- };
31562
+ if (Array.isArray(title)) {
31563
+ return {
31564
+ title: title[1]?.titleAst ?? void 0,
31565
+ titleString: title[1]?.titleString ?? void 0,
31566
+ subtitle: title[2]?.titleAst ?? void 0,
31567
+ subtitleString: title[2]?.titleString ?? void 0
31568
+ };
31569
+ } else {
31570
+ return {
31571
+ title: void 0,
31572
+ titleString: title ?? void 0,
31573
+ subtitle: void 0,
31574
+ subtitleString: void 0
31575
+ };
31576
+ }
31305
31577
  }
31306
31578
  }
31307
31579