@gmb/bitmark-parser-generator 4.6.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.js CHANGED
@@ -1110,6 +1110,7 @@ var propertyKeys = {
1110
1110
  property_bookDiff: "@bookDiff",
1111
1111
  property_bot: "@bot",
1112
1112
  property_bubbleTag: "@bubbleTag",
1113
+ property_extractorTag: "@extractorTag",
1113
1114
  property_buttonCaption: "@buttonCaption",
1114
1115
  property_callToActionUrl: "@callToActionUrl",
1115
1116
  property_caption: "@caption",
@@ -1260,6 +1261,7 @@ var propertyKeys = {
1260
1261
  property_src2x: "@src2x",
1261
1262
  property_src3x: "@src3x",
1262
1263
  property_src4x: "@src4x",
1264
+ property_srcAlt: "@srcAlt",
1263
1265
  property_stripePricingTableId: "@stripePricingTableId",
1264
1266
  property_stripePublishableKey: "@stripePublishableKey",
1265
1267
  property_subject: "@subject",
@@ -2722,6 +2724,12 @@ var GROUPS = {
2722
2724
  format: TagFormat.plainText,
2723
2725
  maxCount: Count.infinity
2724
2726
  },
2727
+ {
2728
+ key: ConfigKey.property_extractorTag,
2729
+ description: "The extractor tag(s) for the bit",
2730
+ format: TagFormat.plainText,
2731
+ maxCount: Count.infinity
2732
+ },
2725
2733
  {
2726
2734
  key: ConfigKey.property_levelCEFRp,
2727
2735
  description: "The CEFRp level for the bit",
@@ -3336,6 +3344,12 @@ var GROUPS = {
3336
3344
  key: ConfigKey.property_search,
3337
3345
  description: "The search text for the resource",
3338
3346
  format: TagFormat.plainText
3347
+ },
3348
+ {
3349
+ key: ConfigKey.property_srcAlt,
3350
+ description: "An alternative source for the resource",
3351
+ format: TagFormat.plainText,
3352
+ maxCount: Count.infinity
3339
3353
  }
3340
3354
  ]
3341
3355
  },
@@ -9057,7 +9071,7 @@ var instance2 = new Config();
9057
9071
  // src/generated/package_info.ts
9058
9072
  var PACKAGE_INFO = {
9059
9073
  "name": "@gmb/bitmark-parser-generator",
9060
- "version": "4.6.0",
9074
+ "version": "4.7.0",
9061
9075
  "author": "Get More Brain Ltd",
9062
9076
  "license": "ISC",
9063
9077
  "description": "A bitmark parser and generator using Peggy.js"
@@ -9465,6 +9479,8 @@ var NodeType = superenum20({
9465
9479
  botValue: "botValue",
9466
9480
  bubbleTag: "bubbleTag",
9467
9481
  bubbleTagValue: "bubbleTagValue",
9482
+ extractorTag: "extractorTag",
9483
+ extractorTagValue: "extractorTagValue",
9468
9484
  buttonCaption: "buttonCaption",
9469
9485
  buttonCaptionValue: "buttonCaptionValue",
9470
9486
  callToActionUrl: "callToActionUrl",
@@ -9845,6 +9861,8 @@ var NodeType = superenum20({
9845
9861
  spaceId: "spaceId",
9846
9862
  spaceIdValue: "spaceIdValue",
9847
9863
  src: "src",
9864
+ srcAlt: "srcAlt",
9865
+ srcAltValue: "srcAltValue",
9848
9866
  src1x: "src1x",
9849
9867
  src2x: "src2x",
9850
9868
  src3x: "src3x",
@@ -21027,6 +21045,8 @@ var ResourceBuilder = class extends BaseBuilder {
21027
21045
  type,
21028
21046
  // Generic (except Article / Document)
21029
21047
  value: url,
21048
+ // Alternative source
21049
+ srcAlt: data.srcAlt,
21030
21050
  // ImageLikeResource / AudioLikeResource / VideoLikeResource / Article / Document
21031
21051
  format: data.format,
21032
21052
  // ImageLikeResource
@@ -21201,6 +21221,7 @@ var ResourceBuilder = class extends BaseBuilder {
21201
21221
  imageResource(context, data, __typeAlias) {
21202
21222
  const {
21203
21223
  value,
21224
+ srcAlt,
21204
21225
  src1x,
21205
21226
  src2x,
21206
21227
  src3x,
@@ -21233,6 +21254,7 @@ var ResourceBuilder = class extends BaseBuilder {
21233
21254
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21234
21255
  provider: instance8.domainFromUrl(value) ?? void 0,
21235
21256
  src: value ?? "",
21257
+ srcAlt: srcAlt ?? void 0,
21236
21258
  src1x: src1x ?? void 0,
21237
21259
  src2x: src2x ?? void 0,
21238
21260
  src3x: src3x ?? void 0,
@@ -21265,6 +21287,7 @@ var ResourceBuilder = class extends BaseBuilder {
21265
21287
  imageLinkResource(context, data) {
21266
21288
  const {
21267
21289
  value,
21290
+ srcAlt,
21268
21291
  src1x,
21269
21292
  src2x,
21270
21293
  src3x,
@@ -21288,6 +21311,7 @@ var ResourceBuilder = class extends BaseBuilder {
21288
21311
  provider: instance8.domainFromUrl(value) ?? void 0,
21289
21312
  // src: value ?? '',
21290
21313
  url: value ?? "",
21314
+ srcAlt: srcAlt ?? void 0,
21291
21315
  src1x: src1x ?? void 0,
21292
21316
  src2x: src2x ?? void 0,
21293
21317
  src3x: src3x ?? void 0,
@@ -21319,7 +21343,18 @@ var ResourceBuilder = class extends BaseBuilder {
21319
21343
  * @returns
21320
21344
  */
21321
21345
  audioResource(context, data) {
21322
- const { value, duration, mute, autoplay, license, copyright, showInIndex, caption, search } = data;
21346
+ const {
21347
+ value,
21348
+ srcAlt,
21349
+ duration,
21350
+ mute,
21351
+ autoplay,
21352
+ license,
21353
+ copyright,
21354
+ showInIndex,
21355
+ caption,
21356
+ search
21357
+ } = data;
21323
21358
  const node = {
21324
21359
  type: ResourceType.audio,
21325
21360
  __typeAlias: ResourceType.audio,
@@ -21328,6 +21363,7 @@ var ResourceBuilder = class extends BaseBuilder {
21328
21363
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21329
21364
  provider: instance8.domainFromUrl(value) ?? void 0,
21330
21365
  src: value ?? "",
21366
+ srcAlt: srcAlt ?? void 0,
21331
21367
  duration: duration ?? void 0,
21332
21368
  mute: mute ?? void 0,
21333
21369
  autoplay: autoplay ?? void 0,
@@ -21352,7 +21388,18 @@ var ResourceBuilder = class extends BaseBuilder {
21352
21388
  * @returns
21353
21389
  */
21354
21390
  audioEmbedResource(context, data) {
21355
- const { value, duration, mute, autoplay, license, copyright, showInIndex, caption, search } = data;
21391
+ const {
21392
+ value,
21393
+ srcAlt,
21394
+ duration,
21395
+ mute,
21396
+ autoplay,
21397
+ license,
21398
+ copyright,
21399
+ showInIndex,
21400
+ caption,
21401
+ search
21402
+ } = data;
21356
21403
  const node = {
21357
21404
  type: ResourceType.audioEmbed,
21358
21405
  __typeAlias: ResourceType.audioEmbed,
@@ -21361,6 +21408,7 @@ var ResourceBuilder = class extends BaseBuilder {
21361
21408
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21362
21409
  provider: instance8.domainFromUrl(value) ?? void 0,
21363
21410
  src: value ?? "",
21411
+ srcAlt: srcAlt ?? void 0,
21364
21412
  duration: duration ?? void 0,
21365
21413
  mute: mute ?? void 0,
21366
21414
  autoplay: autoplay ?? void 0,
@@ -21390,7 +21438,18 @@ var ResourceBuilder = class extends BaseBuilder {
21390
21438
  * @returns
21391
21439
  */
21392
21440
  audioLinkResource(context, data) {
21393
- const { value, duration, mute, autoplay, license, copyright, showInIndex, caption, search } = data;
21441
+ const {
21442
+ value,
21443
+ srcAlt,
21444
+ duration,
21445
+ mute,
21446
+ autoplay,
21447
+ license,
21448
+ copyright,
21449
+ showInIndex,
21450
+ caption,
21451
+ search
21452
+ } = data;
21394
21453
  const node = {
21395
21454
  type: ResourceType.audioLink,
21396
21455
  __typeAlias: ResourceType.audioLink,
@@ -21400,6 +21459,7 @@ var ResourceBuilder = class extends BaseBuilder {
21400
21459
  provider: instance8.domainFromUrl(value) ?? void 0,
21401
21460
  // src: value ?? '',
21402
21461
  url: value ?? "",
21462
+ srcAlt: srcAlt ?? void 0,
21403
21463
  duration: duration ?? void 0,
21404
21464
  mute: mute ?? void 0,
21405
21465
  autoplay: autoplay ?? void 0,
@@ -21428,6 +21488,7 @@ var ResourceBuilder = class extends BaseBuilder {
21428
21488
  videoResource(context, data) {
21429
21489
  const {
21430
21490
  value,
21491
+ srcAlt,
21431
21492
  width,
21432
21493
  height,
21433
21494
  duration,
@@ -21452,6 +21513,7 @@ var ResourceBuilder = class extends BaseBuilder {
21452
21513
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21453
21514
  provider: instance8.domainFromUrl(value) ?? void 0,
21454
21515
  src: value ?? "",
21516
+ srcAlt: srcAlt ?? void 0,
21455
21517
  width: width ?? null,
21456
21518
  height: height ?? null,
21457
21519
  duration: duration ?? void 0,
@@ -21492,6 +21554,7 @@ var ResourceBuilder = class extends BaseBuilder {
21492
21554
  videoEmbedResource(context, data) {
21493
21555
  const {
21494
21556
  value,
21557
+ srcAlt,
21495
21558
  width,
21496
21559
  height,
21497
21560
  duration,
@@ -21517,6 +21580,7 @@ var ResourceBuilder = class extends BaseBuilder {
21517
21580
  provider: instance8.domainFromUrl(value) ?? void 0,
21518
21581
  // src: value ?? '',
21519
21582
  url: value ?? "",
21583
+ srcAlt: srcAlt ?? void 0,
21520
21584
  width: width ?? null,
21521
21585
  height: height ?? null,
21522
21586
  duration: duration ?? void 0,
@@ -21556,6 +21620,7 @@ var ResourceBuilder = class extends BaseBuilder {
21556
21620
  videoLinkResource(context, data) {
21557
21621
  const {
21558
21622
  value,
21623
+ srcAlt,
21559
21624
  width,
21560
21625
  height,
21561
21626
  duration,
@@ -21581,6 +21646,7 @@ var ResourceBuilder = class extends BaseBuilder {
21581
21646
  provider: instance8.domainFromUrl(value) ?? void 0,
21582
21647
  // src: value ?? '',
21583
21648
  url: value ?? "",
21649
+ srcAlt: srcAlt ?? void 0,
21584
21650
  width: width ?? null,
21585
21651
  height: height ?? null,
21586
21652
  duration: duration ?? void 0,
@@ -21640,6 +21706,7 @@ var ResourceBuilder = class extends BaseBuilder {
21640
21706
  stillImageFilmEmbedResource(context, data) {
21641
21707
  const {
21642
21708
  value,
21709
+ srcAlt,
21643
21710
  width,
21644
21711
  height,
21645
21712
  duration,
@@ -21665,6 +21732,7 @@ var ResourceBuilder = class extends BaseBuilder {
21665
21732
  provider: instance8.domainFromUrl(value) ?? void 0,
21666
21733
  // src: value ?? '',
21667
21734
  url: value ?? "",
21735
+ srcAlt: srcAlt ?? void 0,
21668
21736
  width: width ?? null,
21669
21737
  height: height ?? null,
21670
21738
  duration: duration ?? void 0,
@@ -21704,6 +21772,7 @@ var ResourceBuilder = class extends BaseBuilder {
21704
21772
  stillImageFilmLinkResource(context, data) {
21705
21773
  const {
21706
21774
  value,
21775
+ srcAlt,
21707
21776
  width,
21708
21777
  height,
21709
21778
  duration,
@@ -21729,6 +21798,7 @@ var ResourceBuilder = class extends BaseBuilder {
21729
21798
  provider: instance8.domainFromUrl(value) ?? void 0,
21730
21799
  // src: value ?? '',
21731
21800
  url: value ?? "",
21801
+ srcAlt: srcAlt ?? void 0,
21732
21802
  width: width ?? null,
21733
21803
  height: height ?? null,
21734
21804
  duration: duration ?? void 0,
@@ -21766,7 +21836,7 @@ var ResourceBuilder = class extends BaseBuilder {
21766
21836
  * @returns
21767
21837
  */
21768
21838
  articleResource(context, data) {
21769
- const { value, license, copyright, showInIndex, caption, search } = data;
21839
+ const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
21770
21840
  const node = {
21771
21841
  type: ResourceType.article,
21772
21842
  __typeAlias: ResourceType.article,
@@ -21775,6 +21845,7 @@ var ResourceBuilder = class extends BaseBuilder {
21775
21845
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21776
21846
  provider: instance8.domainFromUrl(value) ?? void 0,
21777
21847
  body: value ?? "",
21848
+ srcAlt: srcAlt ?? void 0,
21778
21849
  license: license ?? "",
21779
21850
  copyright: copyright ?? "",
21780
21851
  showInIndex: showInIndex ?? false,
@@ -21795,7 +21866,7 @@ var ResourceBuilder = class extends BaseBuilder {
21795
21866
  * @returns
21796
21867
  */
21797
21868
  documentResource(context, data) {
21798
- const { value, license, copyright, showInIndex, caption, search } = data;
21869
+ const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
21799
21870
  const node = {
21800
21871
  type: ResourceType.document,
21801
21872
  __typeAlias: ResourceType.document,
@@ -21804,6 +21875,7 @@ var ResourceBuilder = class extends BaseBuilder {
21804
21875
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21805
21876
  provider: instance8.domainFromUrl(value) ?? void 0,
21806
21877
  url: value ?? "",
21878
+ srcAlt: srcAlt ?? void 0,
21807
21879
  license: license ?? "",
21808
21880
  copyright: copyright ?? "",
21809
21881
  showInIndex: showInIndex ?? false,
@@ -21825,7 +21897,7 @@ var ResourceBuilder = class extends BaseBuilder {
21825
21897
  * @returns
21826
21898
  */
21827
21899
  documentEmbedResource(context, data) {
21828
- const { value, license, copyright, showInIndex, caption, search } = data;
21900
+ const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
21829
21901
  const node = {
21830
21902
  type: ResourceType.documentEmbed,
21831
21903
  __typeAlias: ResourceType.documentEmbed,
@@ -21834,6 +21906,7 @@ var ResourceBuilder = class extends BaseBuilder {
21834
21906
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21835
21907
  provider: instance8.domainFromUrl(value) ?? void 0,
21836
21908
  url: value ?? "",
21909
+ srcAlt: srcAlt ?? void 0,
21837
21910
  license: license ?? "",
21838
21911
  copyright: copyright ?? "",
21839
21912
  showInIndex: showInIndex ?? false,
@@ -21855,7 +21928,7 @@ var ResourceBuilder = class extends BaseBuilder {
21855
21928
  * @returns
21856
21929
  */
21857
21930
  documentLinkResource(context, data) {
21858
- const { value, license, copyright, showInIndex, caption, search } = data;
21931
+ const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
21859
21932
  const node = {
21860
21933
  type: ResourceType.documentLink,
21861
21934
  __typeAlias: ResourceType.documentLink,
@@ -21864,6 +21937,7 @@ var ResourceBuilder = class extends BaseBuilder {
21864
21937
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21865
21938
  provider: instance8.domainFromUrl(value) ?? void 0,
21866
21939
  url: value ?? "",
21940
+ srcAlt: srcAlt ?? void 0,
21867
21941
  license: license ?? "",
21868
21942
  copyright: copyright ?? "",
21869
21943
  showInIndex: showInIndex ?? false,
@@ -21885,7 +21959,7 @@ var ResourceBuilder = class extends BaseBuilder {
21885
21959
  * @returns
21886
21960
  */
21887
21961
  documentDownloadResource(context, data) {
21888
- const { value, license, copyright, showInIndex, caption, search } = data;
21962
+ const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
21889
21963
  const node = {
21890
21964
  type: ResourceType.documentDownload,
21891
21965
  __typeAlias: ResourceType.documentDownload,
@@ -21894,6 +21968,7 @@ var ResourceBuilder = class extends BaseBuilder {
21894
21968
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21895
21969
  provider: instance8.domainFromUrl(value) ?? void 0,
21896
21970
  url: value ?? "",
21971
+ srcAlt: srcAlt ?? void 0,
21897
21972
  license: license ?? "",
21898
21973
  copyright: copyright ?? "",
21899
21974
  showInIndex: showInIndex ?? false,
@@ -21915,7 +21990,7 @@ var ResourceBuilder = class extends BaseBuilder {
21915
21990
  * @returns
21916
21991
  */
21917
21992
  appLinkResource(context, data) {
21918
- const { value, license, copyright, showInIndex, caption, search } = data;
21993
+ const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
21919
21994
  const node = {
21920
21995
  type: ResourceType.appLink,
21921
21996
  __typeAlias: ResourceType.appLink,
@@ -21925,6 +22000,7 @@ var ResourceBuilder = class extends BaseBuilder {
21925
22000
  // provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,
21926
22001
  provider: void 0,
21927
22002
  url: value ?? "",
22003
+ srcAlt: srcAlt ?? void 0,
21928
22004
  license: license ?? "",
21929
22005
  copyright: copyright ?? "",
21930
22006
  showInIndex: showInIndex ?? false,
@@ -21953,6 +22029,7 @@ var ResourceBuilder = class extends BaseBuilder {
21953
22029
  websiteLinkResource(context, data) {
21954
22030
  const {
21955
22031
  value,
22032
+ srcAlt,
21956
22033
  /*siteName,*/
21957
22034
  license,
21958
22035
  copyright,
@@ -21968,6 +22045,7 @@ var ResourceBuilder = class extends BaseBuilder {
21968
22045
  // provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,
21969
22046
  provider: void 0,
21970
22047
  url: value ?? "",
22048
+ srcAlt: srcAlt ?? void 0,
21971
22049
  // siteName,
21972
22050
  license: license ?? "",
21973
22051
  copyright: copyright ?? "",
@@ -22215,6 +22293,12 @@ var Builder = class extends BaseBuilder {
22215
22293
  options
22216
22294
  ),
22217
22295
  bubbleTag: this.toAstProperty(bitType, ConfigKey.property_bubbleTag, data.bubbleTag, options),
22296
+ extractorTag: this.toAstProperty(
22297
+ bitType,
22298
+ ConfigKey.property_extractorTag,
22299
+ data.extractorTag,
22300
+ options
22301
+ ),
22218
22302
  levelCEFRp: this.toAstProperty(
22219
22303
  bitType,
22220
22304
  ConfigKey.property_levelCEFRp,
@@ -26126,7 +26210,12 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
26126
26210
  // bitmarkAst -> bits -> bitsValue -> resource -> ...
26127
26211
  // bitmarkAst -> bits -> bitsValue -> resource -> posterImage -> ...
26128
26212
  // bitmarkAst -> bits -> bitsValue -> resource -> thumbnails -> thumbnailsValue -> ...
26129
- // [src1x,src2x,src3x,src4x,width,height,alt,zoomDisabled,caption]
26213
+ // [srcAlt,src1x,src2x,src3x,src4x,width,height,alt,zoomDisabled,caption]
26214
+ leaf_srcAltValue(node, route) {
26215
+ this.writeProperty("srcAlt", node.value, route, {
26216
+ format: TagFormat.plainText
26217
+ });
26218
+ }
26130
26219
  leaf_src1x(node, route) {
26131
26220
  this.writeProperty("src1x", node.value, route, {
26132
26221
  format: TagFormat.plainText