@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.
@@ -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 [11 Aug 2025 at 05:19]</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":1144621,"parsedSize":498394,"gzipSize":97252,"groups":[{"label":"dist/browser/cjs","path":"./dist/browser/cjs","statSize":1137641,"groups":[{"id":922,"label":"index.cjs","path":"./dist/browser/cjs/index.cjs","statSize":1137641,"parsedSize":498290,"gzipSize":97252}],"parsedSize":498290,"gzipSize":97252},{"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",
@@ -1162,6 +1183,7 @@ var propertyKeys = {
1162
1183
  property_disableCalculation: "@disableCalculation",
1163
1184
  property_disableFeedback: "@disableFeedback",
1164
1185
  property_duration: "@duration",
1186
+ property_isEditable: "@isEditable",
1165
1187
  property_emphasis: "@emphasis",
1166
1188
  property_example: "@example",
1167
1189
  property_externalId: "@externalId",
@@ -1173,6 +1195,7 @@ var propertyKeys = {
1173
1195
  property_focusX: "@focusX",
1174
1196
  property_focusY: "@focusY",
1175
1197
  property_format: "@format",
1198
+ property_fullName: "@fullName",
1176
1199
  property_groupTag: "@groupTag",
1177
1200
  property_handInAcceptFileType: "@handInAcceptFileType",
1178
1201
  property_handInInstruction: "@handInInstruction",
@@ -1193,6 +1216,7 @@ var propertyKeys = {
1193
1216
  property_isTemplate: "@isTemplate",
1194
1217
  property_isTemplateStripTheme: "@isTemplateStripTheme",
1195
1218
  property_isTracked: "@isTracked",
1219
+ property_jobTitle: "@jobTitle",
1196
1220
  property_jupyterExecutionCount: "@jupyterExecutionCount",
1197
1221
  property_jupyterId: "@jupyterId",
1198
1222
  property_kind: "@kind",
@@ -1237,6 +1261,7 @@ var propertyKeys = {
1237
1261
  property_productId: "@productId",
1238
1262
  property_productVideo: "@productVideo",
1239
1263
  property_progress: "@progress",
1264
+ property_pseudonym: "@pseudonym",
1240
1265
  property_publications: "@publications",
1241
1266
  property_publisher: "@publisher",
1242
1267
  property_publisherName: "@publisherName",
@@ -3139,6 +3164,12 @@ var GROUPS = {
3139
3164
  format: TagFormat.boolean,
3140
3165
  defaultValue: "false"
3141
3166
  },
3167
+ {
3168
+ key: ConfigKey.property_isEditable,
3169
+ description: "If true, the book is editable",
3170
+ format: TagFormat.boolean,
3171
+ defaultValue: "false"
3172
+ },
3142
3173
  {
3143
3174
  key: ConfigKey.property_chatWithBook,
3144
3175
  description: "If true, the user can chat about the book with an AI assistant",
@@ -4151,6 +4182,40 @@ var BITS = {
4151
4182
  ],
4152
4183
  resourceAttachmentAllowed: false
4153
4184
  },
4185
+ [BitType.author]: {
4186
+ since: "4.2.0",
4187
+ baseBitType: BitType._standard,
4188
+ description: "Represents an author of something",
4189
+ tags: [
4190
+ {
4191
+ key: ConfigKey.property_fullName,
4192
+ description: "Full name of the author"
4193
+ },
4194
+ {
4195
+ key: ConfigKey.property_pseudonym,
4196
+ description: "A pseudonym of the author, if any"
4197
+ },
4198
+ {
4199
+ key: ConfigKey.property_title,
4200
+ description: 'The title of the author, e.g. "Dr.", "Prof.", etc.',
4201
+ jsonKey: "title"
4202
+ },
4203
+ {
4204
+ key: ConfigKey.property_jobTitle,
4205
+ description: 'The job title of the author, e.g. "Software Engineer", "Professor", etc.'
4206
+ }
4207
+ ]
4208
+ },
4209
+ [BitType.bookAuthor]: {
4210
+ since: "4.2.0",
4211
+ baseBitType: BitType.author,
4212
+ description: "Represents an author of a book"
4213
+ },
4214
+ [BitType.articleAuthor]: {
4215
+ since: "4.2.0",
4216
+ baseBitType: BitType.author,
4217
+ description: "Represents an author of a book"
4218
+ },
4154
4219
  [BitType.article]: {
4155
4220
  since: "1.3.0",
4156
4221
  baseBitType: BitType._standard,
@@ -5126,6 +5191,71 @@ var BITS = {
5126
5191
  baseBitType: BitType.conversationLeft1,
5127
5192
  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
5193
  },
5194
+ [BitType.advertising]: {
5195
+ since: "4.2.0",
5196
+ baseBitType: BitType.article,
5197
+ description: "General advertising content bit"
5198
+ },
5199
+ [BitType.advertisingAdvertorial]: {
5200
+ since: "4.2.0",
5201
+ baseBitType: BitType.article,
5202
+ description: "Advertorial content bit (sponsored article)"
5203
+ },
5204
+ [BitType.advertisingCallToAction]: {
5205
+ since: "4.2.0",
5206
+ baseBitType: BitType.callToAction,
5207
+ description: "Call-to-action for advertising"
5208
+ },
5209
+ [BitType.advertisingCallToActionMeeting]: {
5210
+ since: "4.2.0",
5211
+ baseBitType: BitType.callToAction,
5212
+ description: "Call-to-action for meeting or appointment"
5213
+ },
5214
+ [BitType.advertisingBanner]: {
5215
+ since: "4.2.0",
5216
+ baseBitType: BitType.image,
5217
+ description: "Banner advertisement bit"
5218
+ },
5219
+ [BitType.advertisingSkyscraper]: {
5220
+ since: "4.2.0",
5221
+ baseBitType: BitType.image,
5222
+ description: "Skyscraper (vertical) advertisement bit"
5223
+ },
5224
+ [BitType.advertisingRectangle]: {
5225
+ since: "4.2.0",
5226
+ baseBitType: BitType.image,
5227
+ description: "Rectangle advertisement bit"
5228
+ },
5229
+ [BitType.advertisingFullPage]: {
5230
+ since: "4.2.0",
5231
+ baseBitType: BitType.image,
5232
+ description: "Full-page advertisement bit"
5233
+ },
5234
+ [BitType.advertisingHalfPage]: {
5235
+ since: "4.2.0",
5236
+ baseBitType: BitType.image,
5237
+ description: "Half-page advertisement bit"
5238
+ },
5239
+ [BitType.advertisingQuarterPage]: {
5240
+ since: "4.2.0",
5241
+ baseBitType: BitType.image,
5242
+ description: "Quarter-page advertisement bit"
5243
+ },
5244
+ [BitType.advertisingClassifiedPage]: {
5245
+ since: "4.2.0",
5246
+ baseBitType: BitType.image,
5247
+ description: "Classifieds advertisement page bit"
5248
+ },
5249
+ [BitType.advertisingLandscape]: {
5250
+ since: "4.2.0",
5251
+ baseBitType: BitType.image,
5252
+ description: "Landscape format advertisement bit"
5253
+ },
5254
+ [BitType.advertisingPortrait]: {
5255
+ since: "4.2.0",
5256
+ baseBitType: BitType.image,
5257
+ description: "Portrait format advertisement bit"
5258
+ },
5129
5259
  [BitType.cookPreparation]: {
5130
5260
  since: "1.3.0",
5131
5261
  baseBitType: BitType.article,
@@ -5415,6 +5545,19 @@ var BITS = {
5415
5545
  baseBitType: BitType.smartStandardExampleNonNormative,
5416
5546
  description: "Smart standard non-normative example collapsible bit, used to provide non-normative examples in smart standards that can be collapsed"
5417
5547
  },
5548
+ [BitType.authorContentBitGenerator]: {
5549
+ since: "4.2.0",
5550
+ baseBitType: BitType.article,
5551
+ description: "Body contains the content of one or more bits to be created by the bit generator",
5552
+ tags: [
5553
+ {
5554
+ key: ConfigKey.property_classification,
5555
+ description: "Classification for the created bits",
5556
+ format: TagFormat.plainText,
5557
+ maxCount: Count.infinity
5558
+ }
5559
+ ]
5560
+ },
5418
5561
  [BitType.appAiPrompt]: {
5419
5562
  since: "1.3.0",
5420
5563
  baseBitType: BitType.article,
@@ -5425,6 +5568,26 @@ var BITS = {
5425
5568
  baseBitType: BitType.article,
5426
5569
  description: "AI prompt bit, used to create AI prompts in articles or books"
5427
5570
  },
5571
+ [BitType.aiChat]: {
5572
+ since: "4.2.0",
5573
+ baseBitType: BitType.article,
5574
+ description: "AI chat bit, used to create an AI chat"
5575
+ },
5576
+ [BitType.aiEditor]: {
5577
+ since: "4.2.0",
5578
+ baseBitType: BitType.article,
5579
+ description: "AI editor bit, used to create an AI editor"
5580
+ },
5581
+ [BitType.aiTutor]: {
5582
+ since: "4.2.0",
5583
+ baseBitType: BitType.article,
5584
+ description: "AI tutor bit, used to create an AI tutor"
5585
+ },
5586
+ [BitType.aiWbt]: {
5587
+ since: "4.2.0",
5588
+ baseBitType: BitType.article,
5589
+ description: "AI WBT bit, used to create an AI WBT (Web-Based Training)"
5590
+ },
5428
5591
  [BitType.articleAi]: {
5429
5592
  since: "1.3.0",
5430
5593
  baseBitType: BitType.article,
@@ -8925,7 +9088,7 @@ var instance2 = new Config();
8925
9088
  // src/generated/package_info.ts
8926
9089
  var PACKAGE_INFO = {
8927
9090
  "name": "@gmb/bitmark-parser-generator",
8928
- "version": "4.1.2",
9091
+ "version": "4.2.0",
8929
9092
  "author": "Get More Brain Ltd",
8930
9093
  "license": "ISC",
8931
9094
  "description": "A bitmark parser and generator using Peggy.js"
@@ -9451,6 +9614,8 @@ var NodeType = (0, import_superenum20.superenum)({
9451
9614
  format: "format",
9452
9615
  forValues: "forValues",
9453
9616
  forValuesValue: "forValuesValue",
9617
+ fullName: "fullName",
9618
+ fullNameValue: "fullNameValue",
9454
9619
  gap: "gap",
9455
9620
  groupTag: "groupTag",
9456
9621
  groupTagValue: "groupTagValue",
@@ -9495,6 +9660,8 @@ var NodeType = (0, import_superenum20.superenum)({
9495
9660
  isCaseSensitive: "isCaseSensitive",
9496
9661
  isCommented: "isCommented",
9497
9662
  isCorrect: "isCorrect",
9663
+ isEditable: "isEditable",
9664
+ isEditableValue: "isEditableValue",
9498
9665
  isExample: "isExample",
9499
9666
  isInfoOnly: "isInfoOnly",
9500
9667
  isInfoOnlyValue: "isInfoOnlyValue",
@@ -9509,6 +9676,8 @@ var NodeType = (0, import_superenum20.superenum)({
9509
9676
  isTrackedValue: "isTrackedValue",
9510
9677
  item: "item",
9511
9678
  itemLead: "itemLead",
9679
+ jobTitle: "jobTitle",
9680
+ jobTitleValue: "jobTitleValue",
9512
9681
  jupyterExecutionCount: "jupyterExecutionCount",
9513
9682
  jupyterExecutionCountValue: "jupyterExecutionCountValue",
9514
9683
  jupyterId: "jupyterId",
@@ -9624,6 +9793,8 @@ var NodeType = (0, import_superenum20.superenum)({
9624
9793
  propertyValue: "propertyValue",
9625
9794
  propertyValues: "propertyValues",
9626
9795
  provider: "provider",
9796
+ pseudonym: "pseudonym",
9797
+ pseudonymValue: "pseudonymValue",
9627
9798
  publications: "publications",
9628
9799
  publicationsValue: "publicationsValue",
9629
9800
  publisher: "publisher",
@@ -9771,6 +9942,7 @@ var NodeType = (0, import_superenum20.superenum)({
9771
9942
  thumbnails: "thumbnails",
9772
9943
  thumbnailsValue: "thumbnailsValue",
9773
9944
  title: "title",
9945
+ titleString: "titleString",
9774
9946
  toc: "toc",
9775
9947
  tocContent: "tocContent",
9776
9948
  tocContentValue: "tocContentValue",
@@ -20629,62 +20801,99 @@ var NodeValidator = class {
20629
20801
  validateResource(resource) {
20630
20802
  if (!resource) return void 0;
20631
20803
  const ret = resource;
20632
- let valid = false;
20804
+ let valid = true;
20633
20805
  switch (resource.type) {
20634
- case ResourceType.image:
20635
- valid = !!resource.image.src;
20806
+ case ResourceType.image: {
20807
+ const imageResource = resource.image;
20808
+ if (!stringUtils.isString(imageResource.src)) imageResource.src = "";
20636
20809
  break;
20637
- case ResourceType.imageLink:
20638
- valid = !!resource.imageLink.url;
20810
+ }
20811
+ case ResourceType.imageLink: {
20812
+ const imageLink = resource.imageLink;
20813
+ if (!stringUtils.isString(imageLink.url)) imageLink.url = "";
20639
20814
  break;
20640
- case ResourceType.audio:
20641
- valid = !!resource.audio.src;
20815
+ }
20816
+ case ResourceType.audio: {
20817
+ const audio = resource.audio;
20818
+ if (!stringUtils.isString(audio.src)) audio.src = "";
20642
20819
  break;
20643
- case ResourceType.audioEmbed:
20644
- valid = !!resource.audioEmbed.src;
20820
+ }
20821
+ case ResourceType.audioEmbed: {
20822
+ const audioEmbed = resource.audioEmbed;
20823
+ if (!stringUtils.isString(audioEmbed.src)) audioEmbed.src = "";
20645
20824
  break;
20646
- case ResourceType.audioLink:
20647
- valid = !!resource.audioLink.url;
20825
+ }
20826
+ case ResourceType.audioLink: {
20827
+ const audioLink = resource.audioLink;
20828
+ if (!stringUtils.isString(audioLink.url)) audioLink.url = "";
20648
20829
  break;
20649
- case ResourceType.video:
20650
- valid = !!resource.video.src;
20830
+ }
20831
+ case ResourceType.video: {
20832
+ const video = resource.video;
20833
+ if (!stringUtils.isString(video.src)) video.src = "";
20651
20834
  break;
20652
- case ResourceType.videoEmbed:
20653
- valid = !!resource.videoEmbed.url;
20835
+ }
20836
+ case ResourceType.videoEmbed: {
20837
+ const videoEmbed = resource.videoEmbed;
20838
+ if (!stringUtils.isString(videoEmbed.url)) videoEmbed.url = "";
20654
20839
  break;
20655
- case ResourceType.videoLink:
20656
- valid = !!resource.videoLink.url;
20840
+ }
20841
+ case ResourceType.videoLink: {
20842
+ const videoLink = resource.videoLink;
20843
+ if (!stringUtils.isString(videoLink.url)) videoLink.url = "";
20657
20844
  break;
20658
- case ResourceType.stillImageFilm:
20659
- valid = !!resource.image.src && !!resource.audio.src;
20845
+ }
20846
+ case ResourceType.stillImageFilm: {
20847
+ const stillImageFilm = resource;
20848
+ if (!stringUtils.isString(stillImageFilm.image.src)) stillImageFilm.image.src = "";
20849
+ if (!stringUtils.isString(stillImageFilm.audio.src)) stillImageFilm.audio.src = "";
20660
20850
  break;
20661
- case ResourceType.stillImageFilmEmbed:
20662
- valid = !!resource.stillImageFilmEmbed.url;
20851
+ }
20852
+ case ResourceType.stillImageFilmEmbed: {
20853
+ const stillImageFilmEmbed = resource.stillImageFilmEmbed;
20854
+ if (!stringUtils.isString(stillImageFilmEmbed.url)) stillImageFilmEmbed.url = "";
20663
20855
  break;
20664
- case ResourceType.stillImageFilmLink:
20665
- valid = !!resource.stillImageFilmLink.url;
20856
+ }
20857
+ case ResourceType.stillImageFilmLink: {
20858
+ const stillImageFilmLink = resource.stillImageFilmLink;
20859
+ if (!stringUtils.isString(stillImageFilmLink.url)) stillImageFilmLink.url = "";
20666
20860
  break;
20667
- case ResourceType.article:
20668
- valid = !!resource.article.body;
20861
+ }
20862
+ case ResourceType.article: {
20863
+ const article = resource.article;
20864
+ if (!stringUtils.isString(article.body)) article.body = "";
20669
20865
  break;
20670
- case ResourceType.document:
20671
- valid = !!resource.document.url;
20866
+ }
20867
+ case ResourceType.document: {
20868
+ const document2 = resource.document;
20869
+ if (!stringUtils.isString(document2.url)) document2.url = "";
20672
20870
  break;
20673
- case ResourceType.documentEmbed:
20674
- valid = !!resource.documentEmbed.url;
20871
+ }
20872
+ case ResourceType.documentEmbed: {
20873
+ const documentEmbed = resource.documentEmbed;
20874
+ if (!stringUtils.isString(documentEmbed.url)) documentEmbed.url = "";
20675
20875
  break;
20676
- case ResourceType.documentLink:
20677
- valid = !!resource.documentLink.url;
20876
+ }
20877
+ case ResourceType.documentLink: {
20878
+ const documentLink = resource.documentLink;
20879
+ if (!stringUtils.isString(documentLink.url)) documentLink.url = "";
20678
20880
  break;
20679
- case ResourceType.documentDownload:
20680
- valid = !!resource.documentDownload.url;
20881
+ }
20882
+ case ResourceType.documentDownload: {
20883
+ const documentDownload = resource.documentDownload;
20884
+ if (!stringUtils.isString(documentDownload.url)) documentDownload.url = "";
20681
20885
  break;
20682
- case ResourceType.appLink:
20683
- valid = !!resource.appLink.url;
20886
+ }
20887
+ case ResourceType.appLink: {
20888
+ const appLink = resource.appLink;
20889
+ if (!stringUtils.isString(appLink.url)) appLink.url = "";
20684
20890
  break;
20685
- case ResourceType.websiteLink:
20686
- valid = !!resource.websiteLink.url;
20891
+ }
20892
+ case ResourceType.websiteLink: {
20893
+ const websiteLink = resource.websiteLink;
20894
+ if (!stringUtils.isString(websiteLink.url)) websiteLink.url = "";
20687
20895
  break;
20896
+ }
20688
20897
  default:
20689
20898
  valid = false;
20690
20899
  }
@@ -21914,6 +22123,12 @@ var Builder = class extends BaseBuilder {
21914
22123
  data.isTemplateStripTheme,
21915
22124
  options
21916
22125
  ),
22126
+ isEditable: this.toAstProperty(
22127
+ bitType,
22128
+ ConfigKey.property_isEditable,
22129
+ data.isEditable,
22130
+ options
22131
+ ),
21917
22132
  aiGenerated: this.toAstProperty(
21918
22133
  bitType,
21919
22134
  ConfigKey.property_aiGenerated,
@@ -22516,6 +22731,11 @@ var Builder = class extends BaseBuilder {
22516
22731
  data.referenceProperty,
22517
22732
  options
22518
22733
  ),
22734
+ // Author data
22735
+ fullName: this.toAstProperty(bitType, ConfigKey.property_fullName, data.fullName, options),
22736
+ pseudonym: this.toAstProperty(bitType, ConfigKey.property_pseudonym, data.pseudonym, options),
22737
+ titleString: this.toAstProperty(bitType, ConfigKey.property_title, data.titleString, options),
22738
+ jobTitle: this.toAstProperty(bitType, ConfigKey.property_jobTitle, data.jobTitle, options),
22519
22739
  // Book data
22520
22740
  title: this.handleJsonText(context, TextLocation2.tag, data.title),
22521
22741
  subtitle: this.handleJsonText(context, TextLocation2.tag, data.subtitle),
@@ -25622,6 +25842,18 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
25622
25842
  }
25623
25843
  return false;
25624
25844
  }
25845
+ // bitmarkAst -> bits -> bitsValue -> titleString
25846
+ leaf_titleString(node, route) {
25847
+ const parent = this.getParentNode(route);
25848
+ if (parent?.key !== NodeType.bitsValue) return true;
25849
+ if (node.value) {
25850
+ this.writeNL();
25851
+ this.writeProperty("title", node.value, route, {
25852
+ format: TagFormat.plainText
25853
+ });
25854
+ }
25855
+ return false;
25856
+ }
25625
25857
  // bitmarkAst -> bits -> title
25626
25858
  enter_title(node, route) {
25627
25859
  const parent = this.getParentNode(route);
@@ -26830,6 +27062,15 @@ var JsonGenerator = class extends AstWalkerGenerator {
26830
27062
  enter_instruction(node, route) {
26831
27063
  return this.standardHandler(node, route, NodeType.bitsValue, { array: true });
26832
27064
  }
27065
+ // bitmarkAst -> bits -> bitsValue -> titleString
27066
+ leaf_titleString(node, route) {
27067
+ const parent = this.getParentNode(route);
27068
+ if (parent?.key !== NodeType.bitsValue) return true;
27069
+ return this.standardHandler(node, route, [NodeType.bitsValue], {
27070
+ array: false,
27071
+ keyOverride: "title"
27072
+ });
27073
+ }
26833
27074
  // bitmarkAst -> bits -> bitsValue -> title
26834
27075
  enter_title(node, route) {
26835
27076
  return this.standardHandler(node, route, [NodeType.bitsValue, NodeType.cardNode], {
@@ -28079,6 +28320,7 @@ var JsonParser = class {
28079
28320
  resourceType: this.getResourceType(bit.resource),
28080
28321
  isCommented,
28081
28322
  internalComment: internalComments,
28323
+ ...this.processTitle(bitType, bit.title),
28082
28324
  ...this.processReference(referenceBit),
28083
28325
  // reference and referenceProperty
28084
28326
  ...this.parseExample(bit.example),
@@ -28179,6 +28421,17 @@ var JsonParser = class {
28179
28421
  footer: footerText
28180
28422
  };
28181
28423
  }
28424
+ processTitle(bitType, title) {
28425
+ if (instance2.isOfBitType(bitType, BitType.author))
28426
+ return {
28427
+ titleString: title,
28428
+ title: void 0
28429
+ };
28430
+ return {
28431
+ titleString: void 0,
28432
+ title
28433
+ };
28434
+ }
28182
28435
  processReference(reference) {
28183
28436
  if (Array.isArray(reference) && reference.length > 0) {
28184
28437
  return {
@@ -31341,12 +31594,21 @@ function buildTitles(_context, bitType, title) {
31341
31594
  level: title.length > 0 ? title.length - 1 : void 0
31342
31595
  };
31343
31596
  } 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
- };
31597
+ if (Array.isArray(title)) {
31598
+ return {
31599
+ title: title[1]?.titleAst ?? void 0,
31600
+ titleString: title[1]?.titleString ?? void 0,
31601
+ subtitle: title[2]?.titleAst ?? void 0,
31602
+ subtitleString: title[2]?.titleString ?? void 0
31603
+ };
31604
+ } else {
31605
+ return {
31606
+ title: void 0,
31607
+ titleString: title ?? void 0,
31608
+ subtitle: void 0,
31609
+ subtitleString: void 0
31610
+ };
31611
+ }
31350
31612
  }
31351
31613
  }
31352
31614