@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.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",
@@ -3395,6 +3403,12 @@ var GROUPS = {
3395
3403
  key: ConfigKey.property_search,
3396
3404
  description: "The search text for the resource",
3397
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
3398
3412
  }
3399
3413
  ]
3400
3414
  },
@@ -9116,7 +9130,7 @@ var instance2 = new Config();
9116
9130
  // src/generated/package_info.ts
9117
9131
  var PACKAGE_INFO = {
9118
9132
  "name": "@gmb/bitmark-parser-generator",
9119
- "version": "4.6.0",
9133
+ "version": "4.7.0",
9120
9134
  "author": "Get More Brain Ltd",
9121
9135
  "license": "ISC",
9122
9136
  "description": "A bitmark parser and generator using Peggy.js"
@@ -9524,6 +9538,8 @@ var NodeType = (0, import_superenum20.superenum)({
9524
9538
  botValue: "botValue",
9525
9539
  bubbleTag: "bubbleTag",
9526
9540
  bubbleTagValue: "bubbleTagValue",
9541
+ extractorTag: "extractorTag",
9542
+ extractorTagValue: "extractorTagValue",
9527
9543
  buttonCaption: "buttonCaption",
9528
9544
  buttonCaptionValue: "buttonCaptionValue",
9529
9545
  callToActionUrl: "callToActionUrl",
@@ -9904,6 +9920,8 @@ var NodeType = (0, import_superenum20.superenum)({
9904
9920
  spaceId: "spaceId",
9905
9921
  spaceIdValue: "spaceIdValue",
9906
9922
  src: "src",
9923
+ srcAlt: "srcAlt",
9924
+ srcAltValue: "srcAltValue",
9907
9925
  src1x: "src1x",
9908
9926
  src2x: "src2x",
9909
9927
  src3x: "src3x",
@@ -21086,6 +21104,8 @@ var ResourceBuilder = class extends BaseBuilder {
21086
21104
  type,
21087
21105
  // Generic (except Article / Document)
21088
21106
  value: url,
21107
+ // Alternative source
21108
+ srcAlt: data.srcAlt,
21089
21109
  // ImageLikeResource / AudioLikeResource / VideoLikeResource / Article / Document
21090
21110
  format: data.format,
21091
21111
  // ImageLikeResource
@@ -21260,6 +21280,7 @@ var ResourceBuilder = class extends BaseBuilder {
21260
21280
  imageResource(context, data, __typeAlias) {
21261
21281
  const {
21262
21282
  value,
21283
+ srcAlt,
21263
21284
  src1x,
21264
21285
  src2x,
21265
21286
  src3x,
@@ -21292,6 +21313,7 @@ var ResourceBuilder = class extends BaseBuilder {
21292
21313
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21293
21314
  provider: instance8.domainFromUrl(value) ?? void 0,
21294
21315
  src: value ?? "",
21316
+ srcAlt: srcAlt ?? void 0,
21295
21317
  src1x: src1x ?? void 0,
21296
21318
  src2x: src2x ?? void 0,
21297
21319
  src3x: src3x ?? void 0,
@@ -21324,6 +21346,7 @@ var ResourceBuilder = class extends BaseBuilder {
21324
21346
  imageLinkResource(context, data) {
21325
21347
  const {
21326
21348
  value,
21349
+ srcAlt,
21327
21350
  src1x,
21328
21351
  src2x,
21329
21352
  src3x,
@@ -21347,6 +21370,7 @@ var ResourceBuilder = class extends BaseBuilder {
21347
21370
  provider: instance8.domainFromUrl(value) ?? void 0,
21348
21371
  // src: value ?? '',
21349
21372
  url: value ?? "",
21373
+ srcAlt: srcAlt ?? void 0,
21350
21374
  src1x: src1x ?? void 0,
21351
21375
  src2x: src2x ?? void 0,
21352
21376
  src3x: src3x ?? void 0,
@@ -21378,7 +21402,18 @@ var ResourceBuilder = class extends BaseBuilder {
21378
21402
  * @returns
21379
21403
  */
21380
21404
  audioResource(context, data) {
21381
- 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;
21382
21417
  const node = {
21383
21418
  type: ResourceType.audio,
21384
21419
  __typeAlias: ResourceType.audio,
@@ -21387,6 +21422,7 @@ var ResourceBuilder = class extends BaseBuilder {
21387
21422
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21388
21423
  provider: instance8.domainFromUrl(value) ?? void 0,
21389
21424
  src: value ?? "",
21425
+ srcAlt: srcAlt ?? void 0,
21390
21426
  duration: duration ?? void 0,
21391
21427
  mute: mute ?? void 0,
21392
21428
  autoplay: autoplay ?? void 0,
@@ -21411,7 +21447,18 @@ var ResourceBuilder = class extends BaseBuilder {
21411
21447
  * @returns
21412
21448
  */
21413
21449
  audioEmbedResource(context, data) {
21414
- 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;
21415
21462
  const node = {
21416
21463
  type: ResourceType.audioEmbed,
21417
21464
  __typeAlias: ResourceType.audioEmbed,
@@ -21420,6 +21467,7 @@ var ResourceBuilder = class extends BaseBuilder {
21420
21467
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21421
21468
  provider: instance8.domainFromUrl(value) ?? void 0,
21422
21469
  src: value ?? "",
21470
+ srcAlt: srcAlt ?? void 0,
21423
21471
  duration: duration ?? void 0,
21424
21472
  mute: mute ?? void 0,
21425
21473
  autoplay: autoplay ?? void 0,
@@ -21449,7 +21497,18 @@ var ResourceBuilder = class extends BaseBuilder {
21449
21497
  * @returns
21450
21498
  */
21451
21499
  audioLinkResource(context, data) {
21452
- 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;
21453
21512
  const node = {
21454
21513
  type: ResourceType.audioLink,
21455
21514
  __typeAlias: ResourceType.audioLink,
@@ -21459,6 +21518,7 @@ var ResourceBuilder = class extends BaseBuilder {
21459
21518
  provider: instance8.domainFromUrl(value) ?? void 0,
21460
21519
  // src: value ?? '',
21461
21520
  url: value ?? "",
21521
+ srcAlt: srcAlt ?? void 0,
21462
21522
  duration: duration ?? void 0,
21463
21523
  mute: mute ?? void 0,
21464
21524
  autoplay: autoplay ?? void 0,
@@ -21487,6 +21547,7 @@ var ResourceBuilder = class extends BaseBuilder {
21487
21547
  videoResource(context, data) {
21488
21548
  const {
21489
21549
  value,
21550
+ srcAlt,
21490
21551
  width,
21491
21552
  height,
21492
21553
  duration,
@@ -21511,6 +21572,7 @@ var ResourceBuilder = class extends BaseBuilder {
21511
21572
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21512
21573
  provider: instance8.domainFromUrl(value) ?? void 0,
21513
21574
  src: value ?? "",
21575
+ srcAlt: srcAlt ?? void 0,
21514
21576
  width: width ?? null,
21515
21577
  height: height ?? null,
21516
21578
  duration: duration ?? void 0,
@@ -21551,6 +21613,7 @@ var ResourceBuilder = class extends BaseBuilder {
21551
21613
  videoEmbedResource(context, data) {
21552
21614
  const {
21553
21615
  value,
21616
+ srcAlt,
21554
21617
  width,
21555
21618
  height,
21556
21619
  duration,
@@ -21576,6 +21639,7 @@ var ResourceBuilder = class extends BaseBuilder {
21576
21639
  provider: instance8.domainFromUrl(value) ?? void 0,
21577
21640
  // src: value ?? '',
21578
21641
  url: value ?? "",
21642
+ srcAlt: srcAlt ?? void 0,
21579
21643
  width: width ?? null,
21580
21644
  height: height ?? null,
21581
21645
  duration: duration ?? void 0,
@@ -21615,6 +21679,7 @@ var ResourceBuilder = class extends BaseBuilder {
21615
21679
  videoLinkResource(context, data) {
21616
21680
  const {
21617
21681
  value,
21682
+ srcAlt,
21618
21683
  width,
21619
21684
  height,
21620
21685
  duration,
@@ -21640,6 +21705,7 @@ var ResourceBuilder = class extends BaseBuilder {
21640
21705
  provider: instance8.domainFromUrl(value) ?? void 0,
21641
21706
  // src: value ?? '',
21642
21707
  url: value ?? "",
21708
+ srcAlt: srcAlt ?? void 0,
21643
21709
  width: width ?? null,
21644
21710
  height: height ?? null,
21645
21711
  duration: duration ?? void 0,
@@ -21699,6 +21765,7 @@ var ResourceBuilder = class extends BaseBuilder {
21699
21765
  stillImageFilmEmbedResource(context, data) {
21700
21766
  const {
21701
21767
  value,
21768
+ srcAlt,
21702
21769
  width,
21703
21770
  height,
21704
21771
  duration,
@@ -21724,6 +21791,7 @@ var ResourceBuilder = class extends BaseBuilder {
21724
21791
  provider: instance8.domainFromUrl(value) ?? void 0,
21725
21792
  // src: value ?? '',
21726
21793
  url: value ?? "",
21794
+ srcAlt: srcAlt ?? void 0,
21727
21795
  width: width ?? null,
21728
21796
  height: height ?? null,
21729
21797
  duration: duration ?? void 0,
@@ -21763,6 +21831,7 @@ var ResourceBuilder = class extends BaseBuilder {
21763
21831
  stillImageFilmLinkResource(context, data) {
21764
21832
  const {
21765
21833
  value,
21834
+ srcAlt,
21766
21835
  width,
21767
21836
  height,
21768
21837
  duration,
@@ -21788,6 +21857,7 @@ var ResourceBuilder = class extends BaseBuilder {
21788
21857
  provider: instance8.domainFromUrl(value) ?? void 0,
21789
21858
  // src: value ?? '',
21790
21859
  url: value ?? "",
21860
+ srcAlt: srcAlt ?? void 0,
21791
21861
  width: width ?? null,
21792
21862
  height: height ?? null,
21793
21863
  duration: duration ?? void 0,
@@ -21825,7 +21895,7 @@ var ResourceBuilder = class extends BaseBuilder {
21825
21895
  * @returns
21826
21896
  */
21827
21897
  articleResource(context, data) {
21828
- const { value, license, copyright, showInIndex, caption, search } = data;
21898
+ const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
21829
21899
  const node = {
21830
21900
  type: ResourceType.article,
21831
21901
  __typeAlias: ResourceType.article,
@@ -21834,6 +21904,7 @@ var ResourceBuilder = class extends BaseBuilder {
21834
21904
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21835
21905
  provider: instance8.domainFromUrl(value) ?? void 0,
21836
21906
  body: value ?? "",
21907
+ srcAlt: srcAlt ?? void 0,
21837
21908
  license: license ?? "",
21838
21909
  copyright: copyright ?? "",
21839
21910
  showInIndex: showInIndex ?? false,
@@ -21854,7 +21925,7 @@ var ResourceBuilder = class extends BaseBuilder {
21854
21925
  * @returns
21855
21926
  */
21856
21927
  documentResource(context, data) {
21857
- const { value, license, copyright, showInIndex, caption, search } = data;
21928
+ const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
21858
21929
  const node = {
21859
21930
  type: ResourceType.document,
21860
21931
  __typeAlias: ResourceType.document,
@@ -21863,6 +21934,7 @@ var ResourceBuilder = class extends BaseBuilder {
21863
21934
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21864
21935
  provider: instance8.domainFromUrl(value) ?? void 0,
21865
21936
  url: value ?? "",
21937
+ srcAlt: srcAlt ?? void 0,
21866
21938
  license: license ?? "",
21867
21939
  copyright: copyright ?? "",
21868
21940
  showInIndex: showInIndex ?? false,
@@ -21884,7 +21956,7 @@ var ResourceBuilder = class extends BaseBuilder {
21884
21956
  * @returns
21885
21957
  */
21886
21958
  documentEmbedResource(context, data) {
21887
- const { value, license, copyright, showInIndex, caption, search } = data;
21959
+ const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
21888
21960
  const node = {
21889
21961
  type: ResourceType.documentEmbed,
21890
21962
  __typeAlias: ResourceType.documentEmbed,
@@ -21893,6 +21965,7 @@ var ResourceBuilder = class extends BaseBuilder {
21893
21965
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21894
21966
  provider: instance8.domainFromUrl(value) ?? void 0,
21895
21967
  url: value ?? "",
21968
+ srcAlt: srcAlt ?? void 0,
21896
21969
  license: license ?? "",
21897
21970
  copyright: copyright ?? "",
21898
21971
  showInIndex: showInIndex ?? false,
@@ -21914,7 +21987,7 @@ var ResourceBuilder = class extends BaseBuilder {
21914
21987
  * @returns
21915
21988
  */
21916
21989
  documentLinkResource(context, data) {
21917
- const { value, license, copyright, showInIndex, caption, search } = data;
21990
+ const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
21918
21991
  const node = {
21919
21992
  type: ResourceType.documentLink,
21920
21993
  __typeAlias: ResourceType.documentLink,
@@ -21923,6 +21996,7 @@ var ResourceBuilder = class extends BaseBuilder {
21923
21996
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21924
21997
  provider: instance8.domainFromUrl(value) ?? void 0,
21925
21998
  url: value ?? "",
21999
+ srcAlt: srcAlt ?? void 0,
21926
22000
  license: license ?? "",
21927
22001
  copyright: copyright ?? "",
21928
22002
  showInIndex: showInIndex ?? false,
@@ -21944,7 +22018,7 @@ var ResourceBuilder = class extends BaseBuilder {
21944
22018
  * @returns
21945
22019
  */
21946
22020
  documentDownloadResource(context, data) {
21947
- const { value, license, copyright, showInIndex, caption, search } = data;
22021
+ const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
21948
22022
  const node = {
21949
22023
  type: ResourceType.documentDownload,
21950
22024
  __typeAlias: ResourceType.documentDownload,
@@ -21953,6 +22027,7 @@ var ResourceBuilder = class extends BaseBuilder {
21953
22027
  format: instance8.fileExtensionFromUrl(value) ?? void 0,
21954
22028
  provider: instance8.domainFromUrl(value) ?? void 0,
21955
22029
  url: value ?? "",
22030
+ srcAlt: srcAlt ?? void 0,
21956
22031
  license: license ?? "",
21957
22032
  copyright: copyright ?? "",
21958
22033
  showInIndex: showInIndex ?? false,
@@ -21974,7 +22049,7 @@ var ResourceBuilder = class extends BaseBuilder {
21974
22049
  * @returns
21975
22050
  */
21976
22051
  appLinkResource(context, data) {
21977
- const { value, license, copyright, showInIndex, caption, search } = data;
22052
+ const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
21978
22053
  const node = {
21979
22054
  type: ResourceType.appLink,
21980
22055
  __typeAlias: ResourceType.appLink,
@@ -21984,6 +22059,7 @@ var ResourceBuilder = class extends BaseBuilder {
21984
22059
  // provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,
21985
22060
  provider: void 0,
21986
22061
  url: value ?? "",
22062
+ srcAlt: srcAlt ?? void 0,
21987
22063
  license: license ?? "",
21988
22064
  copyright: copyright ?? "",
21989
22065
  showInIndex: showInIndex ?? false,
@@ -22012,6 +22088,7 @@ var ResourceBuilder = class extends BaseBuilder {
22012
22088
  websiteLinkResource(context, data) {
22013
22089
  const {
22014
22090
  value,
22091
+ srcAlt,
22015
22092
  /*siteName,*/
22016
22093
  license,
22017
22094
  copyright,
@@ -22027,6 +22104,7 @@ var ResourceBuilder = class extends BaseBuilder {
22027
22104
  // provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,
22028
22105
  provider: void 0,
22029
22106
  url: value ?? "",
22107
+ srcAlt: srcAlt ?? void 0,
22030
22108
  // siteName,
22031
22109
  license: license ?? "",
22032
22110
  copyright: copyright ?? "",
@@ -22274,6 +22352,12 @@ var Builder = class extends BaseBuilder {
22274
22352
  options
22275
22353
  ),
22276
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
+ ),
22277
22361
  levelCEFRp: this.toAstProperty(
22278
22362
  bitType,
22279
22363
  ConfigKey.property_levelCEFRp,
@@ -26185,7 +26269,12 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
26185
26269
  // bitmarkAst -> bits -> bitsValue -> resource -> ...
26186
26270
  // bitmarkAst -> bits -> bitsValue -> resource -> posterImage -> ...
26187
26271
  // bitmarkAst -> bits -> bitsValue -> resource -> thumbnails -> thumbnailsValue -> ...
26188
- // [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
+ }
26189
26278
  leaf_src1x(node, route) {
26190
26279
  this.writeProperty("src1x", node.value, route, {
26191
26280
  format: TagFormat.plainText