@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.
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8"/>
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
6
- <title>@gmb/bitmark-parser-generator [6 Aug 2025 at 05:03]</title>
6
+ <title>@gmb/bitmark-parser-generator [12 Aug 2025 at 04:39]</title>
7
7
  <link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
8
8
 
9
9
  <script>
@@ -31,7 +31,7 @@
31
31
  <body>
32
32
  <div id="app"></div>
33
33
  <script>
34
- window.chartData = [{"label":"bitmark-parser-generator.min.js","isAsset":true,"statSize":1135852,"parsedSize":492807,"gzipSize":96133,"groups":[{"label":"dist/browser/cjs","path":"./dist/browser/cjs","statSize":1128872,"groups":[{"id":922,"label":"index.cjs","path":"./dist/browser/cjs/index.cjs","statSize":1128872,"parsedSize":492703,"gzipSize":96133}],"parsedSize":492703,"gzipSize":96133},{"label":"node_modules/@ncoderz/superenum/dist/esm","path":"./node_modules/@ncoderz/superenum/dist/esm","statSize":6980,"groups":[{"id":718,"label":"superenum.js","path":"./node_modules/@ncoderz/superenum/dist/esm/superenum.js","statSize":6980}],"parsedSize":0,"gzipSize":0}],"isInitialByEntrypoint":{"main":true}}];
34
+ window.chartData = [{"label":"bitmark-parser-generator.min.js","isAsset":true,"statSize":1145090,"parsedSize":498842,"gzipSize":97298,"groups":[{"label":"dist/browser/cjs","path":"./dist/browser/cjs","statSize":1138110,"groups":[{"id":922,"label":"index.cjs","path":"./dist/browser/cjs/index.cjs","statSize":1138110,"parsedSize":498738,"gzipSize":97298}],"parsedSize":498738,"gzipSize":97298},{"label":"node_modules/@ncoderz/superenum/dist/esm","path":"./node_modules/@ncoderz/superenum/dist/esm","statSize":6980,"groups":[{"id":718,"label":"superenum.js","path":"./node_modules/@ncoderz/superenum/dist/esm/superenum.js","statSize":6980}],"parsedSize":0,"gzipSize":0}],"isInitialByEntrypoint":{"main":true}}];
35
35
  window.entrypoints = ["main"];
36
36
  window.defaultSizes = "stat";
37
37
  </script>
@@ -56,7 +56,24 @@ var BitType = (0, import_superenum.superenum)({
56
56
  // Used to indicate a bit is commented out
57
57
  _standard: "_standard",
58
58
  // Not to be used as a bit, but as a base for other bit types
59
+ advertising: "advertising",
60
+ advertisingAdvertorial: "advertising-advertorial",
61
+ advertisingCallToAction: "advertising-call-to-action",
62
+ advertisingCallToActionMeeting: "advertising-call-to-action-meeting",
63
+ advertisingBanner: "advertising-banner",
64
+ advertisingSkyscraper: "advertising-skyscraper",
65
+ advertisingRectangle: "advertising-rectangle",
66
+ advertisingFullPage: "advertising-full-page",
67
+ advertisingHalfPage: "advertising-half-page",
68
+ advertisingQuarterPage: "advertising-quarter-page",
69
+ advertisingClassifiedPage: "advertising-classified-page",
70
+ advertisingLandscape: "advertising-landscape",
71
+ advertisingPortrait: "advertising-portrait",
72
+ aiChat: "ai-chat",
73
+ aiEditor: "ai-editor",
59
74
  aiPrompt: "ai-prompt",
75
+ aiTutor: "ai-tutor",
76
+ aiWbt: "ai-wbt",
60
77
  anchor: "anchor",
61
78
  appAiPrompt: "app-ai-prompt",
62
79
  appBitmarkFromEditor: "app-bitmark-from-editor",
@@ -74,6 +91,7 @@ var BitType = (0, import_superenum.superenum)({
74
91
  articleAi: "article-ai",
75
92
  articleAlt: "article-alt",
76
93
  articleAttachment: "article-attachment",
94
+ articleAuthor: "article-author",
77
95
  articleEmbed: "article-embed",
78
96
  articleLink: "article-link",
79
97
  articleResponsive: "article-responsive",
@@ -84,6 +102,8 @@ var BitType = (0, import_superenum.superenum)({
84
102
  audioEmbed: "audio-embed",
85
103
  audioLink: "audio-link",
86
104
  audioTranscript: "audio-transcript",
105
+ author: "author",
106
+ authorContentBitGenerator: "author-content-bit-generator",
87
107
  bitAlias: "bit-alias",
88
108
  bitBookEnding: "bit-book-ending",
89
109
  bitBookSummary: "bit-book-summary",
@@ -96,6 +116,7 @@ var BitType = (0, import_superenum.superenum)({
96
116
  bookAlias: "book-alias",
97
117
  bookAppendix: "book-appendix",
98
118
  bookArticle: "book-article",
119
+ bookAuthor: "book-author",
99
120
  bookAutherBio: "book-author-bio",
100
121
  bookBibliography: "book-bibliography",
101
122
  bookClose: "book-close",
@@ -264,6 +285,8 @@ var BitType = (0, import_superenum.superenum)({
264
285
  extractorAiChat: "extractor-ai-chat",
265
286
  extractorBlock: "extractor-block",
266
287
  extractorConfiguration: "extractor-configuration",
288
+ extractorEmbeddedImage: "extractor-embedded-image",
289
+ extractorEmbeddedImageCollapsible: "extractor-embedded-image-collapsible",
267
290
  extractorInformation: "extractor-information",
268
291
  extractorPage: "extractor-page",
269
292
  extractorPageCollapsible: "extractor-page-collapsible",
@@ -1162,6 +1185,7 @@ var propertyKeys = {
1162
1185
  property_disableCalculation: "@disableCalculation",
1163
1186
  property_disableFeedback: "@disableFeedback",
1164
1187
  property_duration: "@duration",
1188
+ property_isEditable: "@isEditable",
1165
1189
  property_emphasis: "@emphasis",
1166
1190
  property_example: "@example",
1167
1191
  property_externalId: "@externalId",
@@ -1173,6 +1197,7 @@ var propertyKeys = {
1173
1197
  property_focusX: "@focusX",
1174
1198
  property_focusY: "@focusY",
1175
1199
  property_format: "@format",
1200
+ property_fullName: "@fullName",
1176
1201
  property_groupTag: "@groupTag",
1177
1202
  property_handInAcceptFileType: "@handInAcceptFileType",
1178
1203
  property_handInInstruction: "@handInInstruction",
@@ -1193,6 +1218,7 @@ var propertyKeys = {
1193
1218
  property_isTemplate: "@isTemplate",
1194
1219
  property_isTemplateStripTheme: "@isTemplateStripTheme",
1195
1220
  property_isTracked: "@isTracked",
1221
+ property_jobTitle: "@jobTitle",
1196
1222
  property_jupyterExecutionCount: "@jupyterExecutionCount",
1197
1223
  property_jupyterId: "@jupyterId",
1198
1224
  property_kind: "@kind",
@@ -1237,6 +1263,7 @@ var propertyKeys = {
1237
1263
  property_productId: "@productId",
1238
1264
  property_productVideo: "@productVideo",
1239
1265
  property_progress: "@progress",
1266
+ property_pseudonym: "@pseudonym",
1240
1267
  property_publications: "@publications",
1241
1268
  property_publisher: "@publisher",
1242
1269
  property_publisherName: "@publisherName",
@@ -3139,6 +3166,12 @@ var GROUPS = {
3139
3166
  format: TagFormat.boolean,
3140
3167
  defaultValue: "false"
3141
3168
  },
3169
+ {
3170
+ key: ConfigKey.property_isEditable,
3171
+ description: "If true, the book is editable",
3172
+ format: TagFormat.boolean,
3173
+ defaultValue: "false"
3174
+ },
3142
3175
  {
3143
3176
  key: ConfigKey.property_chatWithBook,
3144
3177
  description: "If true, the user can chat about the book with an AI assistant",
@@ -4151,6 +4184,40 @@ var BITS = {
4151
4184
  ],
4152
4185
  resourceAttachmentAllowed: false
4153
4186
  },
4187
+ [BitType.author]: {
4188
+ since: "4.2.0",
4189
+ baseBitType: BitType._standard,
4190
+ description: "Represents an author of something",
4191
+ tags: [
4192
+ {
4193
+ key: ConfigKey.property_fullName,
4194
+ description: "Full name of the author"
4195
+ },
4196
+ {
4197
+ key: ConfigKey.property_pseudonym,
4198
+ description: "A pseudonym of the author, if any"
4199
+ },
4200
+ {
4201
+ key: ConfigKey.property_title,
4202
+ description: 'The title of the author, e.g. "Dr.", "Prof.", etc.',
4203
+ jsonKey: "title"
4204
+ },
4205
+ {
4206
+ key: ConfigKey.property_jobTitle,
4207
+ description: 'The job title of the author, e.g. "Software Engineer", "Professor", etc.'
4208
+ }
4209
+ ]
4210
+ },
4211
+ [BitType.bookAuthor]: {
4212
+ since: "4.2.0",
4213
+ baseBitType: BitType.author,
4214
+ description: "Represents an author of a book"
4215
+ },
4216
+ [BitType.articleAuthor]: {
4217
+ since: "4.2.0",
4218
+ baseBitType: BitType.author,
4219
+ description: "Represents an author of a book"
4220
+ },
4154
4221
  [BitType.article]: {
4155
4222
  since: "1.3.0",
4156
4223
  baseBitType: BitType._standard,
@@ -5126,6 +5193,71 @@ var BITS = {
5126
5193
  baseBitType: BitType.conversationLeft1,
5127
5194
  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"
5128
5195
  },
5196
+ [BitType.advertising]: {
5197
+ since: "4.2.0",
5198
+ baseBitType: BitType.article,
5199
+ description: "General advertising content bit"
5200
+ },
5201
+ [BitType.advertisingAdvertorial]: {
5202
+ since: "4.2.0",
5203
+ baseBitType: BitType.article,
5204
+ description: "Advertorial content bit (sponsored article)"
5205
+ },
5206
+ [BitType.advertisingCallToAction]: {
5207
+ since: "4.2.0",
5208
+ baseBitType: BitType.callToAction,
5209
+ description: "Call-to-action for advertising"
5210
+ },
5211
+ [BitType.advertisingCallToActionMeeting]: {
5212
+ since: "4.2.0",
5213
+ baseBitType: BitType.callToAction,
5214
+ description: "Call-to-action for meeting or appointment"
5215
+ },
5216
+ [BitType.advertisingBanner]: {
5217
+ since: "4.2.0",
5218
+ baseBitType: BitType.image,
5219
+ description: "Banner advertisement bit"
5220
+ },
5221
+ [BitType.advertisingSkyscraper]: {
5222
+ since: "4.2.0",
5223
+ baseBitType: BitType.image,
5224
+ description: "Skyscraper (vertical) advertisement bit"
5225
+ },
5226
+ [BitType.advertisingRectangle]: {
5227
+ since: "4.2.0",
5228
+ baseBitType: BitType.image,
5229
+ description: "Rectangle advertisement bit"
5230
+ },
5231
+ [BitType.advertisingFullPage]: {
5232
+ since: "4.2.0",
5233
+ baseBitType: BitType.image,
5234
+ description: "Full-page advertisement bit"
5235
+ },
5236
+ [BitType.advertisingHalfPage]: {
5237
+ since: "4.2.0",
5238
+ baseBitType: BitType.image,
5239
+ description: "Half-page advertisement bit"
5240
+ },
5241
+ [BitType.advertisingQuarterPage]: {
5242
+ since: "4.2.0",
5243
+ baseBitType: BitType.image,
5244
+ description: "Quarter-page advertisement bit"
5245
+ },
5246
+ [BitType.advertisingClassifiedPage]: {
5247
+ since: "4.2.0",
5248
+ baseBitType: BitType.image,
5249
+ description: "Classifieds advertisement page bit"
5250
+ },
5251
+ [BitType.advertisingLandscape]: {
5252
+ since: "4.2.0",
5253
+ baseBitType: BitType.image,
5254
+ description: "Landscape format advertisement bit"
5255
+ },
5256
+ [BitType.advertisingPortrait]: {
5257
+ since: "4.2.0",
5258
+ baseBitType: BitType.image,
5259
+ description: "Portrait format advertisement bit"
5260
+ },
5129
5261
  [BitType.cookPreparation]: {
5130
5262
  since: "1.3.0",
5131
5263
  baseBitType: BitType.article,
@@ -5415,6 +5547,19 @@ var BITS = {
5415
5547
  baseBitType: BitType.smartStandardExampleNonNormative,
5416
5548
  description: "Smart standard non-normative example collapsible bit, used to provide non-normative examples in smart standards that can be collapsed"
5417
5549
  },
5550
+ [BitType.authorContentBitGenerator]: {
5551
+ since: "4.2.0",
5552
+ baseBitType: BitType.article,
5553
+ description: "Body contains the content of one or more bits to be created by the bit generator",
5554
+ tags: [
5555
+ {
5556
+ key: ConfigKey.property_classification,
5557
+ description: "Classification for the created bits",
5558
+ format: TagFormat.plainText,
5559
+ maxCount: Count.infinity
5560
+ }
5561
+ ]
5562
+ },
5418
5563
  [BitType.appAiPrompt]: {
5419
5564
  since: "1.3.0",
5420
5565
  baseBitType: BitType.article,
@@ -5425,6 +5570,26 @@ var BITS = {
5425
5570
  baseBitType: BitType.article,
5426
5571
  description: "AI prompt bit, used to create AI prompts in articles or books"
5427
5572
  },
5573
+ [BitType.aiChat]: {
5574
+ since: "4.2.0",
5575
+ baseBitType: BitType.article,
5576
+ description: "AI chat bit, used to create an AI chat"
5577
+ },
5578
+ [BitType.aiEditor]: {
5579
+ since: "4.2.0",
5580
+ baseBitType: BitType.article,
5581
+ description: "AI editor bit, used to create an AI editor"
5582
+ },
5583
+ [BitType.aiTutor]: {
5584
+ since: "4.2.0",
5585
+ baseBitType: BitType.article,
5586
+ description: "AI tutor bit, used to create an AI tutor"
5587
+ },
5588
+ [BitType.aiWbt]: {
5589
+ since: "4.2.0",
5590
+ baseBitType: BitType.article,
5591
+ description: "AI WBT bit, used to create an AI WBT (Web-Based Training)"
5592
+ },
5428
5593
  [BitType.articleAi]: {
5429
5594
  since: "1.3.0",
5430
5595
  baseBitType: BitType.article,
@@ -6142,6 +6307,18 @@ var BITS = {
6142
6307
  description: "Extractor configuration bit, used to configure extractors in articles or books",
6143
6308
  textFormatDefault: TextFormat2.plainText
6144
6309
  },
6310
+ [BitType.extractorEmbeddedImage]: {
6311
+ since: "4.3.0",
6312
+ baseBitType: BitType.image,
6313
+ description: "Extractor embedded image bit, used for embedded images extracted from PDFs",
6314
+ textFormatDefault: TextFormat2.plainText
6315
+ },
6316
+ [BitType.extractorEmbeddedImageCollapsible]: {
6317
+ since: "4.3.0",
6318
+ baseBitType: BitType.extractorEmbeddedImage,
6319
+ description: "Collapsible extractor embedded image bit, used for embedded images extracted from PDFs",
6320
+ textFormatDefault: TextFormat2.plainText
6321
+ },
6145
6322
  [BitType.extractorInformation]: {
6146
6323
  since: "3.8.0",
6147
6324
  baseBitType: BitType._standard,
@@ -8925,7 +9102,7 @@ var instance2 = new Config();
8925
9102
  // src/generated/package_info.ts
8926
9103
  var PACKAGE_INFO = {
8927
9104
  "name": "@gmb/bitmark-parser-generator",
8928
- "version": "4.1.2",
9105
+ "version": "4.3.0",
8929
9106
  "author": "Get More Brain Ltd",
8930
9107
  "license": "ISC",
8931
9108
  "description": "A bitmark parser and generator using Peggy.js"
@@ -9451,6 +9628,8 @@ var NodeType = (0, import_superenum20.superenum)({
9451
9628
  format: "format",
9452
9629
  forValues: "forValues",
9453
9630
  forValuesValue: "forValuesValue",
9631
+ fullName: "fullName",
9632
+ fullNameValue: "fullNameValue",
9454
9633
  gap: "gap",
9455
9634
  groupTag: "groupTag",
9456
9635
  groupTagValue: "groupTagValue",
@@ -9495,6 +9674,8 @@ var NodeType = (0, import_superenum20.superenum)({
9495
9674
  isCaseSensitive: "isCaseSensitive",
9496
9675
  isCommented: "isCommented",
9497
9676
  isCorrect: "isCorrect",
9677
+ isEditable: "isEditable",
9678
+ isEditableValue: "isEditableValue",
9498
9679
  isExample: "isExample",
9499
9680
  isInfoOnly: "isInfoOnly",
9500
9681
  isInfoOnlyValue: "isInfoOnlyValue",
@@ -9509,6 +9690,8 @@ var NodeType = (0, import_superenum20.superenum)({
9509
9690
  isTrackedValue: "isTrackedValue",
9510
9691
  item: "item",
9511
9692
  itemLead: "itemLead",
9693
+ jobTitle: "jobTitle",
9694
+ jobTitleValue: "jobTitleValue",
9512
9695
  jupyterExecutionCount: "jupyterExecutionCount",
9513
9696
  jupyterExecutionCountValue: "jupyterExecutionCountValue",
9514
9697
  jupyterId: "jupyterId",
@@ -9624,6 +9807,8 @@ var NodeType = (0, import_superenum20.superenum)({
9624
9807
  propertyValue: "propertyValue",
9625
9808
  propertyValues: "propertyValues",
9626
9809
  provider: "provider",
9810
+ pseudonym: "pseudonym",
9811
+ pseudonymValue: "pseudonymValue",
9627
9812
  publications: "publications",
9628
9813
  publicationsValue: "publicationsValue",
9629
9814
  publisher: "publisher",
@@ -9771,6 +9956,7 @@ var NodeType = (0, import_superenum20.superenum)({
9771
9956
  thumbnails: "thumbnails",
9772
9957
  thumbnailsValue: "thumbnailsValue",
9773
9958
  title: "title",
9959
+ titleString: "titleString",
9774
9960
  toc: "toc",
9775
9961
  tocContent: "tocContent",
9776
9962
  tocContentValue: "tocContentValue",
@@ -20629,62 +20815,99 @@ var NodeValidator = class {
20629
20815
  validateResource(resource) {
20630
20816
  if (!resource) return void 0;
20631
20817
  const ret = resource;
20632
- let valid = false;
20818
+ let valid = true;
20633
20819
  switch (resource.type) {
20634
- case ResourceType.image:
20635
- valid = !!resource.image.src;
20820
+ case ResourceType.image: {
20821
+ const imageResource = resource.image;
20822
+ if (!stringUtils.isString(imageResource.src)) imageResource.src = "";
20636
20823
  break;
20637
- case ResourceType.imageLink:
20638
- valid = !!resource.imageLink.url;
20824
+ }
20825
+ case ResourceType.imageLink: {
20826
+ const imageLink = resource.imageLink;
20827
+ if (!stringUtils.isString(imageLink.url)) imageLink.url = "";
20639
20828
  break;
20640
- case ResourceType.audio:
20641
- valid = !!resource.audio.src;
20829
+ }
20830
+ case ResourceType.audio: {
20831
+ const audio = resource.audio;
20832
+ if (!stringUtils.isString(audio.src)) audio.src = "";
20642
20833
  break;
20643
- case ResourceType.audioEmbed:
20644
- valid = !!resource.audioEmbed.src;
20834
+ }
20835
+ case ResourceType.audioEmbed: {
20836
+ const audioEmbed = resource.audioEmbed;
20837
+ if (!stringUtils.isString(audioEmbed.src)) audioEmbed.src = "";
20645
20838
  break;
20646
- case ResourceType.audioLink:
20647
- valid = !!resource.audioLink.url;
20839
+ }
20840
+ case ResourceType.audioLink: {
20841
+ const audioLink = resource.audioLink;
20842
+ if (!stringUtils.isString(audioLink.url)) audioLink.url = "";
20648
20843
  break;
20649
- case ResourceType.video:
20650
- valid = !!resource.video.src;
20844
+ }
20845
+ case ResourceType.video: {
20846
+ const video = resource.video;
20847
+ if (!stringUtils.isString(video.src)) video.src = "";
20651
20848
  break;
20652
- case ResourceType.videoEmbed:
20653
- valid = !!resource.videoEmbed.url;
20849
+ }
20850
+ case ResourceType.videoEmbed: {
20851
+ const videoEmbed = resource.videoEmbed;
20852
+ if (!stringUtils.isString(videoEmbed.url)) videoEmbed.url = "";
20654
20853
  break;
20655
- case ResourceType.videoLink:
20656
- valid = !!resource.videoLink.url;
20854
+ }
20855
+ case ResourceType.videoLink: {
20856
+ const videoLink = resource.videoLink;
20857
+ if (!stringUtils.isString(videoLink.url)) videoLink.url = "";
20657
20858
  break;
20658
- case ResourceType.stillImageFilm:
20659
- 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 = "";
20660
20864
  break;
20661
- case ResourceType.stillImageFilmEmbed:
20662
- valid = !!resource.stillImageFilmEmbed.url;
20865
+ }
20866
+ case ResourceType.stillImageFilmEmbed: {
20867
+ const stillImageFilmEmbed = resource.stillImageFilmEmbed;
20868
+ if (!stringUtils.isString(stillImageFilmEmbed.url)) stillImageFilmEmbed.url = "";
20663
20869
  break;
20664
- case ResourceType.stillImageFilmLink:
20665
- valid = !!resource.stillImageFilmLink.url;
20870
+ }
20871
+ case ResourceType.stillImageFilmLink: {
20872
+ const stillImageFilmLink = resource.stillImageFilmLink;
20873
+ if (!stringUtils.isString(stillImageFilmLink.url)) stillImageFilmLink.url = "";
20666
20874
  break;
20667
- case ResourceType.article:
20668
- valid = !!resource.article.body;
20875
+ }
20876
+ case ResourceType.article: {
20877
+ const article = resource.article;
20878
+ if (!stringUtils.isString(article.body)) article.body = "";
20669
20879
  break;
20670
- case ResourceType.document:
20671
- valid = !!resource.document.url;
20880
+ }
20881
+ case ResourceType.document: {
20882
+ const document2 = resource.document;
20883
+ if (!stringUtils.isString(document2.url)) document2.url = "";
20672
20884
  break;
20673
- case ResourceType.documentEmbed:
20674
- valid = !!resource.documentEmbed.url;
20885
+ }
20886
+ case ResourceType.documentEmbed: {
20887
+ const documentEmbed = resource.documentEmbed;
20888
+ if (!stringUtils.isString(documentEmbed.url)) documentEmbed.url = "";
20675
20889
  break;
20676
- case ResourceType.documentLink:
20677
- valid = !!resource.documentLink.url;
20890
+ }
20891
+ case ResourceType.documentLink: {
20892
+ const documentLink = resource.documentLink;
20893
+ if (!stringUtils.isString(documentLink.url)) documentLink.url = "";
20678
20894
  break;
20679
- case ResourceType.documentDownload:
20680
- valid = !!resource.documentDownload.url;
20895
+ }
20896
+ case ResourceType.documentDownload: {
20897
+ const documentDownload = resource.documentDownload;
20898
+ if (!stringUtils.isString(documentDownload.url)) documentDownload.url = "";
20681
20899
  break;
20682
- case ResourceType.appLink:
20683
- valid = !!resource.appLink.url;
20900
+ }
20901
+ case ResourceType.appLink: {
20902
+ const appLink = resource.appLink;
20903
+ if (!stringUtils.isString(appLink.url)) appLink.url = "";
20684
20904
  break;
20685
- case ResourceType.websiteLink:
20686
- valid = !!resource.websiteLink.url;
20905
+ }
20906
+ case ResourceType.websiteLink: {
20907
+ const websiteLink = resource.websiteLink;
20908
+ if (!stringUtils.isString(websiteLink.url)) websiteLink.url = "";
20687
20909
  break;
20910
+ }
20688
20911
  default:
20689
20912
  valid = false;
20690
20913
  }
@@ -21914,6 +22137,12 @@ var Builder = class extends BaseBuilder {
21914
22137
  data.isTemplateStripTheme,
21915
22138
  options
21916
22139
  ),
22140
+ isEditable: this.toAstProperty(
22141
+ bitType,
22142
+ ConfigKey.property_isEditable,
22143
+ data.isEditable,
22144
+ options
22145
+ ),
21917
22146
  aiGenerated: this.toAstProperty(
21918
22147
  bitType,
21919
22148
  ConfigKey.property_aiGenerated,
@@ -22516,6 +22745,11 @@ var Builder = class extends BaseBuilder {
22516
22745
  data.referenceProperty,
22517
22746
  options
22518
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),
22519
22753
  // Book data
22520
22754
  title: this.handleJsonText(context, TextLocation2.tag, data.title),
22521
22755
  subtitle: this.handleJsonText(context, TextLocation2.tag, data.subtitle),
@@ -25622,6 +25856,18 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
25622
25856
  }
25623
25857
  return false;
25624
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
+ }
25625
25871
  // bitmarkAst -> bits -> title
25626
25872
  enter_title(node, route) {
25627
25873
  const parent = this.getParentNode(route);
@@ -26830,6 +27076,15 @@ var JsonGenerator = class extends AstWalkerGenerator {
26830
27076
  enter_instruction(node, route) {
26831
27077
  return this.standardHandler(node, route, NodeType.bitsValue, { array: true });
26832
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
+ }
26833
27088
  // bitmarkAst -> bits -> bitsValue -> title
26834
27089
  enter_title(node, route) {
26835
27090
  return this.standardHandler(node, route, [NodeType.bitsValue, NodeType.cardNode], {
@@ -27538,7 +27793,6 @@ var JsonGenerator = class extends AstWalkerGenerator {
27538
27793
  */
27539
27794
  cleanBitJson(bitJson) {
27540
27795
  const bitType = instance2.getBitType(bitJson.type);
27541
- const bitConfig = instance2.getBitConfig(bitType);
27542
27796
  if (bitJson.originalType == null) bitJson.originalType = void 0;
27543
27797
  if (!bitJson.item) bitJson.item = void 0;
27544
27798
  if (instance2.isOfBitType(bitType, [BitType._error, BitType._comment])) {
@@ -27774,9 +28028,6 @@ var JsonGenerator = class extends AstWalkerGenerator {
27774
28028
  if (instance2.isOfBitType(bitType, BitType.container)) {
27775
28029
  if (bitJson.allowedBit == null) bitJson.allowedBit = [];
27776
28030
  }
27777
- if (bitConfig.quizBit) {
27778
- if (bitJson.revealSolutions == null) bitJson.revealSolutions = false;
27779
- }
27780
28031
  if (instance2.isOfBitType(bitType, BitType.platformPath)) {
27781
28032
  if (bitJson.path == null) bitJson.path = "";
27782
28033
  }
@@ -28079,6 +28330,7 @@ var JsonParser = class {
28079
28330
  resourceType: this.getResourceType(bit.resource),
28080
28331
  isCommented,
28081
28332
  internalComment: internalComments,
28333
+ ...this.processTitle(bitType, bit.title),
28082
28334
  ...this.processReference(referenceBit),
28083
28335
  // reference and referenceProperty
28084
28336
  ...this.parseExample(bit.example),
@@ -28179,6 +28431,17 @@ var JsonParser = class {
28179
28431
  footer: footerText
28180
28432
  };
28181
28433
  }
28434
+ processTitle(bitType, title) {
28435
+ if (instance2.isOfBitType(bitType, BitType.author))
28436
+ return {
28437
+ titleString: title,
28438
+ title: void 0
28439
+ };
28440
+ return {
28441
+ titleString: void 0,
28442
+ title
28443
+ };
28444
+ }
28182
28445
  processReference(reference) {
28183
28446
  if (Array.isArray(reference) && reference.length > 0) {
28184
28447
  return {
@@ -31341,12 +31604,21 @@ function buildTitles(_context, bitType, title) {
31341
31604
  level: title.length > 0 ? title.length - 1 : void 0
31342
31605
  };
31343
31606
  } else {
31344
- return {
31345
- title: title[1]?.titleAst ?? void 0,
31346
- titleString: title[1]?.titleString ?? void 0,
31347
- subtitle: title[2]?.titleAst ?? void 0,
31348
- subtitleString: title[2]?.titleString ?? void 0
31349
- };
31607
+ if (Array.isArray(title)) {
31608
+ return {
31609
+ title: title[1]?.titleAst ?? void 0,
31610
+ titleString: title[1]?.titleString ?? void 0,
31611
+ subtitle: title[2]?.titleAst ?? void 0,
31612
+ subtitleString: title[2]?.titleString ?? void 0
31613
+ };
31614
+ } else {
31615
+ return {
31616
+ title: void 0,
31617
+ titleString: title ?? void 0,
31618
+ subtitle: void 0,
31619
+ subtitleString: void 0
31620
+ };
31621
+ }
31350
31622
  }
31351
31623
  }
31352
31624