@gmb/bitmark-parser-generator 4.5.0 → 4.7.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
@@ -1169,6 +1169,7 @@ var propertyKeys = {
1169
1169
  property_bookDiff: "@bookDiff",
1170
1170
  property_bot: "@bot",
1171
1171
  property_bubbleTag: "@bubbleTag",
1172
+ property_extractorTag: "@extractorTag",
1172
1173
  property_buttonCaption: "@buttonCaption",
1173
1174
  property_callToActionUrl: "@callToActionUrl",
1174
1175
  property_caption: "@caption",
@@ -1319,6 +1320,7 @@ var propertyKeys = {
1319
1320
  property_src2x: "@src2x",
1320
1321
  property_src3x: "@src3x",
1321
1322
  property_src4x: "@src4x",
1323
+ property_srcAlt: "@srcAlt",
1322
1324
  property_stripePricingTableId: "@stripePricingTableId",
1323
1325
  property_stripePublishableKey: "@stripePublishableKey",
1324
1326
  property_subject: "@subject",
@@ -2781,6 +2783,12 @@ var GROUPS = {
2781
2783
  format: TagFormat.plainText,
2782
2784
  maxCount: Count.infinity
2783
2785
  },
2786
+ {
2787
+ key: ConfigKey.property_extractorTag,
2788
+ description: "The extractor tag(s) for the bit",
2789
+ format: TagFormat.plainText,
2790
+ maxCount: Count.infinity
2791
+ },
2784
2792
  {
2785
2793
  key: ConfigKey.property_levelCEFRp,
2786
2794
  description: "The CEFRp level for the bit",
@@ -3334,6 +3342,12 @@ var GROUPS = {
3334
3342
  description: "If true, the quiz solutions are revealed",
3335
3343
  format: TagFormat.boolean
3336
3344
  // defaultValue: 'false',
3345
+ },
3346
+ {
3347
+ key: ConfigKey.property_additionalSolutions,
3348
+ description: "Additional solutions",
3349
+ format: TagFormat.plainText,
3350
+ maxCount: Count.infinity
3337
3351
  }
3338
3352
  ]
3339
3353
  },
@@ -3389,6 +3403,12 @@ var GROUPS = {
3389
3403
  key: ConfigKey.property_search,
3390
3404
  description: "The search text for the resource",
3391
3405
  format: TagFormat.plainText
3406
+ },
3407
+ {
3408
+ key: ConfigKey.property_srcAlt,
3409
+ description: "An alternative source for the resource",
3410
+ format: TagFormat.plainText,
3411
+ maxCount: Count.infinity
3392
3412
  }
3393
3413
  ]
3394
3414
  },
@@ -4952,12 +4972,6 @@ var BITS = {
4952
4972
  description: "If the cloze solutions should be strikethrough",
4953
4973
  format: TagFormat.boolean
4954
4974
  },
4955
- {
4956
- key: ConfigKey.property_additionalSolutions,
4957
- description: "Additional solutions for the cloze quiz",
4958
- format: TagFormat.plainText,
4959
- maxCount: Count.infinity
4960
- },
4961
4975
  {
4962
4976
  key: ConfigKey.group_gap,
4963
4977
  description: "Tags for gaps in cloze bits"
@@ -5485,12 +5499,6 @@ var BITS = {
5485
5499
  description: "Sample solution for the essay, used as a reference answer",
5486
5500
  format: TagFormat.plainText
5487
5501
  },
5488
- {
5489
- key: ConfigKey.property_additionalSolutions,
5490
- description: "Additional solutions for the essay, used for alternative answers",
5491
- format: TagFormat.plainText,
5492
- maxCount: Count.infinity
5493
- },
5494
5502
  {
5495
5503
  key: ConfigKey.property_partialAnswer,
5496
5504
  description: "Partial answer for the essay, used to indicate incomplete answers",
@@ -9122,7 +9130,7 @@ var instance2 = new Config();
9122
9130
  // src/generated/package_info.ts
9123
9131
  var PACKAGE_INFO = {
9124
9132
  "name": "@gmb/bitmark-parser-generator",
9125
- "version": "4.5.0",
9133
+ "version": "4.7.0",
9126
9134
  "author": "Get More Brain Ltd",
9127
9135
  "license": "ISC",
9128
9136
  "description": "A bitmark parser and generator using Peggy.js"
@@ -9530,6 +9538,8 @@ var NodeType = (0, import_superenum20.superenum)({
9530
9538
  botValue: "botValue",
9531
9539
  bubbleTag: "bubbleTag",
9532
9540
  bubbleTagValue: "bubbleTagValue",
9541
+ extractorTag: "extractorTag",
9542
+ extractorTagValue: "extractorTagValue",
9533
9543
  buttonCaption: "buttonCaption",
9534
9544
  buttonCaptionValue: "buttonCaptionValue",
9535
9545
  callToActionUrl: "callToActionUrl",
@@ -9910,6 +9920,8 @@ var NodeType = (0, import_superenum20.superenum)({
9910
9920
  spaceId: "spaceId",
9911
9921
  spaceIdValue: "spaceIdValue",
9912
9922
  src: "src",
9923
+ srcAlt: "srcAlt",
9924
+ srcAltValue: "srcAltValue",
9913
9925
  src1x: "src1x",
9914
9926
  src2x: "src2x",
9915
9927
  src3x: "src3x",
@@ -21092,6 +21104,8 @@ var ResourceBuilder = class extends BaseBuilder {
21092
21104
  type,
21093
21105
  // Generic (except Article / Document)
21094
21106
  value: url,
21107
+ // Alternative source
21108
+ srcAlt: data.srcAlt,
21095
21109
  // ImageLikeResource / AudioLikeResource / VideoLikeResource / Article / Document
21096
21110
  format: data.format,
21097
21111
  // ImageLikeResource
@@ -21266,6 +21280,7 @@ var ResourceBuilder = class extends BaseBuilder {
21266
21280
  imageResource(context, data, __typeAlias) {
21267
21281
  const {
21268
21282
  value,
21283
+ srcAlt,
21269
21284
  src1x,
21270
21285
  src2x,
21271
21286
  src3x,
@@ -21298,6 +21313,7 @@ var ResourceBuilder = class extends BaseBuilder {
21298
21313
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21299
21314
  provider: instance8.domainFromUrl(value) ?? void 0,
21300
21315
  src: value ?? "",
21316
+ srcAlt: srcAlt ?? void 0,
21301
21317
  src1x: src1x ?? void 0,
21302
21318
  src2x: src2x ?? void 0,
21303
21319
  src3x: src3x ?? void 0,
@@ -21330,6 +21346,7 @@ var ResourceBuilder = class extends BaseBuilder {
21330
21346
  imageLinkResource(context, data) {
21331
21347
  const {
21332
21348
  value,
21349
+ srcAlt,
21333
21350
  src1x,
21334
21351
  src2x,
21335
21352
  src3x,
@@ -21353,6 +21370,7 @@ var ResourceBuilder = class extends BaseBuilder {
21353
21370
  provider: instance8.domainFromUrl(value) ?? void 0,
21354
21371
  // src: value ?? '',
21355
21372
  url: value ?? "",
21373
+ srcAlt: srcAlt ?? void 0,
21356
21374
  src1x: src1x ?? void 0,
21357
21375
  src2x: src2x ?? void 0,
21358
21376
  src3x: src3x ?? void 0,
@@ -21384,7 +21402,18 @@ var ResourceBuilder = class extends BaseBuilder {
21384
21402
  * @returns
21385
21403
  */
21386
21404
  audioResource(context, data) {
21387
- const { value, duration, mute, autoplay, license, copyright, showInIndex, caption, search } = data;
21405
+ const {
21406
+ value,
21407
+ srcAlt,
21408
+ duration,
21409
+ mute,
21410
+ autoplay,
21411
+ license,
21412
+ copyright,
21413
+ showInIndex,
21414
+ caption,
21415
+ search
21416
+ } = data;
21388
21417
  const node = {
21389
21418
  type: ResourceType.audio,
21390
21419
  __typeAlias: ResourceType.audio,
@@ -21393,6 +21422,7 @@ var ResourceBuilder = class extends BaseBuilder {
21393
21422
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21394
21423
  provider: instance8.domainFromUrl(value) ?? void 0,
21395
21424
  src: value ?? "",
21425
+ srcAlt: srcAlt ?? void 0,
21396
21426
  duration: duration ?? void 0,
21397
21427
  mute: mute ?? void 0,
21398
21428
  autoplay: autoplay ?? void 0,
@@ -21417,7 +21447,18 @@ var ResourceBuilder = class extends BaseBuilder {
21417
21447
  * @returns
21418
21448
  */
21419
21449
  audioEmbedResource(context, data) {
21420
- const { value, duration, mute, autoplay, license, copyright, showInIndex, caption, search } = data;
21450
+ const {
21451
+ value,
21452
+ srcAlt,
21453
+ duration,
21454
+ mute,
21455
+ autoplay,
21456
+ license,
21457
+ copyright,
21458
+ showInIndex,
21459
+ caption,
21460
+ search
21461
+ } = data;
21421
21462
  const node = {
21422
21463
  type: ResourceType.audioEmbed,
21423
21464
  __typeAlias: ResourceType.audioEmbed,
@@ -21426,6 +21467,7 @@ var ResourceBuilder = class extends BaseBuilder {
21426
21467
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21427
21468
  provider: instance8.domainFromUrl(value) ?? void 0,
21428
21469
  src: value ?? "",
21470
+ srcAlt: srcAlt ?? void 0,
21429
21471
  duration: duration ?? void 0,
21430
21472
  mute: mute ?? void 0,
21431
21473
  autoplay: autoplay ?? void 0,
@@ -21455,7 +21497,18 @@ var ResourceBuilder = class extends BaseBuilder {
21455
21497
  * @returns
21456
21498
  */
21457
21499
  audioLinkResource(context, data) {
21458
- const { value, duration, mute, autoplay, license, copyright, showInIndex, caption, search } = data;
21500
+ const {
21501
+ value,
21502
+ srcAlt,
21503
+ duration,
21504
+ mute,
21505
+ autoplay,
21506
+ license,
21507
+ copyright,
21508
+ showInIndex,
21509
+ caption,
21510
+ search
21511
+ } = data;
21459
21512
  const node = {
21460
21513
  type: ResourceType.audioLink,
21461
21514
  __typeAlias: ResourceType.audioLink,
@@ -21465,6 +21518,7 @@ var ResourceBuilder = class extends BaseBuilder {
21465
21518
  provider: instance8.domainFromUrl(value) ?? void 0,
21466
21519
  // src: value ?? '',
21467
21520
  url: value ?? "",
21521
+ srcAlt: srcAlt ?? void 0,
21468
21522
  duration: duration ?? void 0,
21469
21523
  mute: mute ?? void 0,
21470
21524
  autoplay: autoplay ?? void 0,
@@ -21493,6 +21547,7 @@ var ResourceBuilder = class extends BaseBuilder {
21493
21547
  videoResource(context, data) {
21494
21548
  const {
21495
21549
  value,
21550
+ srcAlt,
21496
21551
  width,
21497
21552
  height,
21498
21553
  duration,
@@ -21517,6 +21572,7 @@ var ResourceBuilder = class extends BaseBuilder {
21517
21572
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21518
21573
  provider: instance8.domainFromUrl(value) ?? void 0,
21519
21574
  src: value ?? "",
21575
+ srcAlt: srcAlt ?? void 0,
21520
21576
  width: width ?? null,
21521
21577
  height: height ?? null,
21522
21578
  duration: duration ?? void 0,
@@ -21557,6 +21613,7 @@ var ResourceBuilder = class extends BaseBuilder {
21557
21613
  videoEmbedResource(context, data) {
21558
21614
  const {
21559
21615
  value,
21616
+ srcAlt,
21560
21617
  width,
21561
21618
  height,
21562
21619
  duration,
@@ -21582,6 +21639,7 @@ var ResourceBuilder = class extends BaseBuilder {
21582
21639
  provider: instance8.domainFromUrl(value) ?? void 0,
21583
21640
  // src: value ?? '',
21584
21641
  url: value ?? "",
21642
+ srcAlt: srcAlt ?? void 0,
21585
21643
  width: width ?? null,
21586
21644
  height: height ?? null,
21587
21645
  duration: duration ?? void 0,
@@ -21621,6 +21679,7 @@ var ResourceBuilder = class extends BaseBuilder {
21621
21679
  videoLinkResource(context, data) {
21622
21680
  const {
21623
21681
  value,
21682
+ srcAlt,
21624
21683
  width,
21625
21684
  height,
21626
21685
  duration,
@@ -21646,6 +21705,7 @@ var ResourceBuilder = class extends BaseBuilder {
21646
21705
  provider: instance8.domainFromUrl(value) ?? void 0,
21647
21706
  // src: value ?? '',
21648
21707
  url: value ?? "",
21708
+ srcAlt: srcAlt ?? void 0,
21649
21709
  width: width ?? null,
21650
21710
  height: height ?? null,
21651
21711
  duration: duration ?? void 0,
@@ -21705,6 +21765,7 @@ var ResourceBuilder = class extends BaseBuilder {
21705
21765
  stillImageFilmEmbedResource(context, data) {
21706
21766
  const {
21707
21767
  value,
21768
+ srcAlt,
21708
21769
  width,
21709
21770
  height,
21710
21771
  duration,
@@ -21730,6 +21791,7 @@ var ResourceBuilder = class extends BaseBuilder {
21730
21791
  provider: instance8.domainFromUrl(value) ?? void 0,
21731
21792
  // src: value ?? '',
21732
21793
  url: value ?? "",
21794
+ srcAlt: srcAlt ?? void 0,
21733
21795
  width: width ?? null,
21734
21796
  height: height ?? null,
21735
21797
  duration: duration ?? void 0,
@@ -21769,6 +21831,7 @@ var ResourceBuilder = class extends BaseBuilder {
21769
21831
  stillImageFilmLinkResource(context, data) {
21770
21832
  const {
21771
21833
  value,
21834
+ srcAlt,
21772
21835
  width,
21773
21836
  height,
21774
21837
  duration,
@@ -21794,6 +21857,7 @@ var ResourceBuilder = class extends BaseBuilder {
21794
21857
  provider: instance8.domainFromUrl(value) ?? void 0,
21795
21858
  // src: value ?? '',
21796
21859
  url: value ?? "",
21860
+ srcAlt: srcAlt ?? void 0,
21797
21861
  width: width ?? null,
21798
21862
  height: height ?? null,
21799
21863
  duration: duration ?? void 0,
@@ -21831,7 +21895,7 @@ var ResourceBuilder = class extends BaseBuilder {
21831
21895
  * @returns
21832
21896
  */
21833
21897
  articleResource(context, data) {
21834
- const { value, license, copyright, showInIndex, caption, search } = data;
21898
+ const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
21835
21899
  const node = {
21836
21900
  type: ResourceType.article,
21837
21901
  __typeAlias: ResourceType.article,
@@ -21840,6 +21904,7 @@ var ResourceBuilder = class extends BaseBuilder {
21840
21904
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21841
21905
  provider: instance8.domainFromUrl(value) ?? void 0,
21842
21906
  body: value ?? "",
21907
+ srcAlt: srcAlt ?? void 0,
21843
21908
  license: license ?? "",
21844
21909
  copyright: copyright ?? "",
21845
21910
  showInIndex: showInIndex ?? false,
@@ -21860,7 +21925,7 @@ var ResourceBuilder = class extends BaseBuilder {
21860
21925
  * @returns
21861
21926
  */
21862
21927
  documentResource(context, data) {
21863
- const { value, license, copyright, showInIndex, caption, search } = data;
21928
+ const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
21864
21929
  const node = {
21865
21930
  type: ResourceType.document,
21866
21931
  __typeAlias: ResourceType.document,
@@ -21869,6 +21934,7 @@ var ResourceBuilder = class extends BaseBuilder {
21869
21934
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21870
21935
  provider: instance8.domainFromUrl(value) ?? void 0,
21871
21936
  url: value ?? "",
21937
+ srcAlt: srcAlt ?? void 0,
21872
21938
  license: license ?? "",
21873
21939
  copyright: copyright ?? "",
21874
21940
  showInIndex: showInIndex ?? false,
@@ -21890,7 +21956,7 @@ var ResourceBuilder = class extends BaseBuilder {
21890
21956
  * @returns
21891
21957
  */
21892
21958
  documentEmbedResource(context, data) {
21893
- const { value, license, copyright, showInIndex, caption, search } = data;
21959
+ const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
21894
21960
  const node = {
21895
21961
  type: ResourceType.documentEmbed,
21896
21962
  __typeAlias: ResourceType.documentEmbed,
@@ -21899,6 +21965,7 @@ var ResourceBuilder = class extends BaseBuilder {
21899
21965
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21900
21966
  provider: instance8.domainFromUrl(value) ?? void 0,
21901
21967
  url: value ?? "",
21968
+ srcAlt: srcAlt ?? void 0,
21902
21969
  license: license ?? "",
21903
21970
  copyright: copyright ?? "",
21904
21971
  showInIndex: showInIndex ?? false,
@@ -21920,7 +21987,7 @@ var ResourceBuilder = class extends BaseBuilder {
21920
21987
  * @returns
21921
21988
  */
21922
21989
  documentLinkResource(context, data) {
21923
- const { value, license, copyright, showInIndex, caption, search } = data;
21990
+ const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
21924
21991
  const node = {
21925
21992
  type: ResourceType.documentLink,
21926
21993
  __typeAlias: ResourceType.documentLink,
@@ -21929,6 +21996,7 @@ var ResourceBuilder = class extends BaseBuilder {
21929
21996
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21930
21997
  provider: instance8.domainFromUrl(value) ?? void 0,
21931
21998
  url: value ?? "",
21999
+ srcAlt: srcAlt ?? void 0,
21932
22000
  license: license ?? "",
21933
22001
  copyright: copyright ?? "",
21934
22002
  showInIndex: showInIndex ?? false,
@@ -21950,7 +22018,7 @@ var ResourceBuilder = class extends BaseBuilder {
21950
22018
  * @returns
21951
22019
  */
21952
22020
  documentDownloadResource(context, data) {
21953
- const { value, license, copyright, showInIndex, caption, search } = data;
22021
+ const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
21954
22022
  const node = {
21955
22023
  type: ResourceType.documentDownload,
21956
22024
  __typeAlias: ResourceType.documentDownload,
@@ -21959,6 +22027,7 @@ var ResourceBuilder = class extends BaseBuilder {
21959
22027
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21960
22028
  provider: instance8.domainFromUrl(value) ?? void 0,
21961
22029
  url: value ?? "",
22030
+ srcAlt: srcAlt ?? void 0,
21962
22031
  license: license ?? "",
21963
22032
  copyright: copyright ?? "",
21964
22033
  showInIndex: showInIndex ?? false,
@@ -21980,7 +22049,7 @@ var ResourceBuilder = class extends BaseBuilder {
21980
22049
  * @returns
21981
22050
  */
21982
22051
  appLinkResource(context, data) {
21983
- const { value, license, copyright, showInIndex, caption, search } = data;
22052
+ const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
21984
22053
  const node = {
21985
22054
  type: ResourceType.appLink,
21986
22055
  __typeAlias: ResourceType.appLink,
@@ -21990,6 +22059,7 @@ var ResourceBuilder = class extends BaseBuilder {
21990
22059
  // provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,
21991
22060
  provider: void 0,
21992
22061
  url: value ?? "",
22062
+ srcAlt: srcAlt ?? void 0,
21993
22063
  license: license ?? "",
21994
22064
  copyright: copyright ?? "",
21995
22065
  showInIndex: showInIndex ?? false,
@@ -22018,6 +22088,7 @@ var ResourceBuilder = class extends BaseBuilder {
22018
22088
  websiteLinkResource(context, data) {
22019
22089
  const {
22020
22090
  value,
22091
+ srcAlt,
22021
22092
  /*siteName,*/
22022
22093
  license,
22023
22094
  copyright,
@@ -22033,6 +22104,7 @@ var ResourceBuilder = class extends BaseBuilder {
22033
22104
  // provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,
22034
22105
  provider: void 0,
22035
22106
  url: value ?? "",
22107
+ srcAlt: srcAlt ?? void 0,
22036
22108
  // siteName,
22037
22109
  license: license ?? "",
22038
22110
  copyright: copyright ?? "",
@@ -22280,6 +22352,12 @@ var Builder = class extends BaseBuilder {
22280
22352
  options
22281
22353
  ),
22282
22354
  bubbleTag: this.toAstProperty(bitType, ConfigKey.property_bubbleTag, data.bubbleTag, options),
22355
+ extractorTag: this.toAstProperty(
22356
+ bitType,
22357
+ ConfigKey.property_extractorTag,
22358
+ data.extractorTag,
22359
+ options
22360
+ ),
22283
22361
  levelCEFRp: this.toAstProperty(
22284
22362
  bitType,
22285
22363
  ConfigKey.property_levelCEFRp,
@@ -26191,7 +26269,12 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
26191
26269
  // bitmarkAst -> bits -> bitsValue -> resource -> ...
26192
26270
  // bitmarkAst -> bits -> bitsValue -> resource -> posterImage -> ...
26193
26271
  // bitmarkAst -> bits -> bitsValue -> resource -> thumbnails -> thumbnailsValue -> ...
26194
- // [src1x,src2x,src3x,src4x,width,height,alt,zoomDisabled,caption]
26272
+ // [srcAlt,src1x,src2x,src3x,src4x,width,height,alt,zoomDisabled,caption]
26273
+ leaf_srcAltValue(node, route) {
26274
+ this.writeProperty("srcAlt", node.value, route, {
26275
+ format: TagFormat.plainText
26276
+ });
26277
+ }
26195
26278
  leaf_src1x(node, route) {
26196
26279
  this.writeProperty("src1x", node.value, route, {
26197
26280
  format: TagFormat.plainText