@gmb/bitmark-parser-generator 5.19.0 → 5.21.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
@@ -850,8 +850,6 @@ var AbstractTagConfig = class {
850
850
  __publicField(this, "chain");
851
851
  __publicField(this, "jsonKey");
852
852
  // If the json key is different from the tag
853
- __publicField(this, "secondaryJsonKey");
854
- // Heading card alternate path
855
853
  __publicField(this, "deprecated");
856
854
  this.type = params.type;
857
855
  this.configKey = params.configKey;
@@ -860,7 +858,6 @@ var AbstractTagConfig = class {
860
858
  this.minCount = params.minCount;
861
859
  this.chain = params.chain;
862
860
  this.jsonKey = params.jsonKey;
863
- this.secondaryJsonKey = params.secondaryJsonKey;
864
861
  this.deprecated = params.deprecated;
865
862
  }
866
863
  };
@@ -1021,12 +1018,14 @@ ${tag.toString(opts)}`;
1021
1018
 
1022
1019
  // src/model/config/CardSideConfig.ts
1023
1020
  var CardSideConfig = class {
1024
- constructor(name, repeat, variants) {
1021
+ constructor(name, repeat, variants, jsonKey) {
1025
1022
  __publicField(this, "name");
1026
1023
  __publicField(this, "repeat");
1024
+ __publicField(this, "jsonKey");
1027
1025
  __publicField(this, "variants");
1028
1026
  this.name = name;
1029
1027
  this.repeat = repeat;
1028
+ this.jsonKey = jsonKey;
1030
1029
  this.variants = variants;
1031
1030
  }
1032
1031
  toString(options) {
@@ -1048,15 +1047,13 @@ var CardSideConfig = class {
1048
1047
 
1049
1048
  // src/model/config/CardSetConfig.ts
1050
1049
  var CardSetConfig = class {
1051
- constructor(configKey, jsonKey, itemType, sections, sides) {
1050
+ constructor(configKey, jsonKey, sections, sides) {
1052
1051
  __publicField(this, "configKey");
1053
1052
  __publicField(this, "jsonKey");
1054
- __publicField(this, "itemType");
1055
1053
  __publicField(this, "sections");
1056
1054
  __publicField(this, "sides");
1057
1055
  this.configKey = configKey;
1058
1056
  this.jsonKey = jsonKey;
1059
- this.itemType = itemType;
1060
1057
  this.sections = sections;
1061
1058
  this.sides = sides;
1062
1059
  }
@@ -1071,8 +1068,6 @@ var CardSetConfig = class {
1071
1068
  s += `[CardSet: ${this.configKey}]`;
1072
1069
  s += `
1073
1070
  jsonKey: ${this.jsonKey}`;
1074
- s += `
1075
- itemType: ${this.itemType}`;
1076
1071
  for (const side of this.sides) {
1077
1072
  s += `
1078
1073
  ${side.toString(opts)}`;
@@ -1200,6 +1195,7 @@ var import_superenum14 = require("@ncoderz/superenum");
1200
1195
  var import_superenum10 = require("@ncoderz/superenum");
1201
1196
  var groupKeys = {
1202
1197
  group_standardAllBits: "group_standardAllBits",
1198
+ group_standardItemLead: "group_standardItemLead",
1203
1199
  group_standardItemLeadInstructionHint: "group_standardItemLeadInstructionHint",
1204
1200
  group_standardTags: "group_standardTags",
1205
1201
  group_imageSource: "group_imageSource",
@@ -1283,6 +1279,7 @@ var propertyKeys = {
1283
1279
  property_bot: "@bot",
1284
1280
  property_bubbleTag: "@bubbleTag",
1285
1281
  property_extractorTag: "@extractorTag",
1282
+ property_extractorInternal: "@extractorInternal",
1286
1283
  property_buttonCaption: "@buttonCaption",
1287
1284
  property_callToActionUrl: "@callToActionUrl",
1288
1285
  property_caption: "@caption",
@@ -1497,6 +1494,7 @@ var propertyKeys = {
1497
1494
  property_subject: "@subject",
1498
1495
  property_subtype: "@subtype",
1499
1496
  property_tableAutoWidth: "@tableAutoWidth",
1497
+ property_tableColWidth: "@tableColWidth",
1500
1498
  property_tableColumnMinWidth: "@tableColumnMinWidth",
1501
1499
  property_tableFixedHeader: "@tableFixedHeader",
1502
1500
  property_tableHeaderWhitespaceNoWrap: "@tableHeaderWhitespaceNoWrap",
@@ -2322,7 +2320,7 @@ var CARDSETS = {
2322
2320
  {
2323
2321
  key: ConfigKey.tag_title,
2324
2322
  description: "Title of the definition.",
2325
- secondaryJsonKey: "heading.forKeys"
2323
+ jsonKey: "^heading.forKeys"
2326
2324
  },
2327
2325
  {
2328
2326
  key: ConfigKey.group_resourceIcon,
@@ -2346,7 +2344,7 @@ var CARDSETS = {
2346
2344
  {
2347
2345
  key: ConfigKey.tag_title,
2348
2346
  description: "Title of the definition.",
2349
- secondaryJsonKey: "heading.forValues"
2347
+ jsonKey: "^heading.forValues"
2350
2348
  },
2351
2349
  {
2352
2350
  key: ConfigKey.group_resourceIcon,
@@ -2396,7 +2394,7 @@ var CARDSETS = {
2396
2394
  {
2397
2395
  key: ConfigKey.tag_title,
2398
2396
  description: "Title of the match pair.",
2399
- secondaryJsonKey: "heading.forKeys"
2397
+ jsonKey: "^heading.forKeys"
2400
2398
  },
2401
2399
  {
2402
2400
  key: ConfigKey.property_isCaseSensitive,
@@ -2431,7 +2429,7 @@ var CARDSETS = {
2431
2429
  {
2432
2430
  key: ConfigKey.tag_title,
2433
2431
  description: "Title of the match pair.",
2434
- secondaryJsonKey: "heading.forValues"
2432
+ jsonKey: "^heading.forValues"
2435
2433
  },
2436
2434
  {
2437
2435
  key: ConfigKey.property_isCaseSensitive,
@@ -2464,7 +2462,7 @@ var CARDSETS = {
2464
2462
  {
2465
2463
  key: ConfigKey.tag_title,
2466
2464
  description: "Title of the audio match pair.",
2467
- secondaryJsonKey: "heading.forKeys"
2465
+ jsonKey: "^heading.forKeys"
2468
2466
  },
2469
2467
  {
2470
2468
  key: ConfigKey.resource_audio,
@@ -2489,7 +2487,7 @@ var CARDSETS = {
2489
2487
  {
2490
2488
  key: ConfigKey.tag_title,
2491
2489
  description: "Title of the audio match pair.",
2492
- secondaryJsonKey: "heading.forValues"
2490
+ jsonKey: "^heading.forValues"
2493
2491
  },
2494
2492
  {
2495
2493
  key: ConfigKey.resource_audio,
@@ -2521,7 +2519,7 @@ var CARDSETS = {
2521
2519
  {
2522
2520
  key: ConfigKey.tag_title,
2523
2521
  description: "Title of the image match pair.",
2524
- secondaryJsonKey: "heading.forKeys"
2522
+ jsonKey: "^heading.forKeys"
2525
2523
  },
2526
2524
  {
2527
2525
  key: ConfigKey.resource_image,
@@ -2546,7 +2544,7 @@ var CARDSETS = {
2546
2544
  {
2547
2545
  key: ConfigKey.tag_title,
2548
2546
  description: "Title of the image match pair.",
2549
- secondaryJsonKey: "heading.forValues"
2547
+ jsonKey: "^heading.forValues"
2550
2548
  },
2551
2549
  {
2552
2550
  key: ConfigKey.resource_image,
@@ -2583,7 +2581,7 @@ var CARDSETS = {
2583
2581
  {
2584
2582
  key: ConfigKey.tag_title,
2585
2583
  description: "Title of the match matrix.",
2586
- secondaryJsonKey: "heading.forKeys"
2584
+ jsonKey: "^heading.forKeys"
2587
2585
  },
2588
2586
  {
2589
2587
  key: ConfigKey.property_isCaseSensitive,
@@ -2613,7 +2611,7 @@ var CARDSETS = {
2613
2611
  {
2614
2612
  key: ConfigKey.tag_title,
2615
2613
  description: "Title of the match matrix.",
2616
- secondaryJsonKey: "heading.forValues"
2614
+ jsonKey: "^heading.forValues"
2617
2615
  },
2618
2616
  {
2619
2617
  key: ConfigKey.property_isCaseSensitive,
@@ -2642,11 +2640,13 @@ var CARDSETS = {
2642
2640
  {
2643
2641
  key: ConfigKey.tag_true,
2644
2642
  description: "Tag for true statements.",
2643
+ jsonKey: "statement|set(isCorrect=true)",
2645
2644
  maxCount: 1
2646
2645
  },
2647
2646
  {
2648
2647
  key: ConfigKey.tag_false,
2649
2648
  description: "Tag for false statements.",
2649
+ jsonKey: "statement|set(isCorrect=false)",
2650
2650
  maxCount: 1
2651
2651
  },
2652
2652
  {
@@ -2710,7 +2710,7 @@ var CARDSETS = {
2710
2710
  {
2711
2711
  key: ConfigKey.tag_title,
2712
2712
  description: "Title of the feedback.",
2713
- secondaryJsonKey: "heading.forKeys"
2713
+ jsonKey: "^heading.forKeys"
2714
2714
  }
2715
2715
  ],
2716
2716
  bodyAllowed: false
@@ -2740,7 +2740,7 @@ var CARDSETS = {
2740
2740
  {
2741
2741
  key: ConfigKey.tag_title,
2742
2742
  description: "Title of the feedback.",
2743
- secondaryJsonKey: "heading.forValues"
2743
+ jsonKey: "^heading.forValues"
2744
2744
  }
2745
2745
  ],
2746
2746
  bodyAllowed: true
@@ -2830,7 +2830,6 @@ var CARDSETS = {
2830
2830
  //
2831
2831
  [CardSetConfigKey.table]: {
2832
2832
  jsonKey: "table.data",
2833
- itemType: "array",
2834
2833
  sides: [
2835
2834
  {
2836
2835
  name: "cell",
@@ -2845,8 +2844,8 @@ var CARDSETS = {
2845
2844
  },
2846
2845
  {
2847
2846
  key: ConfigKey.tag_title,
2848
- description: "Title of the table.",
2849
- secondaryJsonKey: "table.columns[]"
2847
+ jsonKey: "^table.columns[]",
2848
+ description: "Title of the table."
2850
2849
  },
2851
2850
  {
2852
2851
  key: ConfigKey.property_tableCellType,
@@ -2867,6 +2866,11 @@ var CARDSETS = {
2867
2866
  key: ConfigKey.property_tableScope,
2868
2867
  description: "Scope attribute for header cells.",
2869
2868
  format: TagFormat.plainText
2869
+ },
2870
+ {
2871
+ key: ConfigKey.property_tableColWidth,
2872
+ description: "Width for the column.",
2873
+ format: TagFormat.number
2870
2874
  }
2871
2875
  ],
2872
2876
  repeatCount: Count.infinity
@@ -2881,14 +2885,15 @@ var CARDSETS = {
2881
2885
  [CardSetConfigKey.tableExtended]: {
2882
2886
  jsonKey: null,
2883
2887
  sections: {
2884
- default: { jsonKey: "tableExtended.body.rows" },
2885
- "table-header": { jsonKey: "tableExtended.header.rows" },
2886
- "table-footer": { jsonKey: "tableExtended.footer.rows" }
2888
+ "table-header": { jsonKey: "table.header.rows", sideJsonKey: "cells[{s}]|set(title=true)" },
2889
+ "table-body": { jsonKey: "table.body.rows", isDefault: true },
2890
+ "table-footer": { jsonKey: "table.footer.rows", sideJsonKey: "cells[{s}]|set(title=true)" }
2887
2891
  },
2888
2892
  sides: [
2889
2893
  {
2890
2894
  name: "cell",
2891
2895
  repeat: true,
2896
+ jsonKey: "cells[{s}]",
2892
2897
  variants: [
2893
2898
  {
2894
2899
  jsonKey: "content",
@@ -2899,27 +2904,37 @@ var CARDSETS = {
2899
2904
  },
2900
2905
  {
2901
2906
  key: ConfigKey.tag_title,
2907
+ jsonKey: ".",
2902
2908
  description: "Title of the table cell."
2903
2909
  },
2904
2910
  {
2905
2911
  key: ConfigKey.property_tableCellType,
2912
+ jsonKey: "title|bool(th)",
2906
2913
  description: "Table cell type (th/td).",
2907
2914
  format: TagFormat.plainText
2908
2915
  },
2909
2916
  {
2910
2917
  key: ConfigKey.property_tableRowSpan,
2918
+ jsonKey: "rowspan",
2911
2919
  description: "Number of rows the cell spans.",
2912
2920
  format: TagFormat.number
2913
2921
  },
2914
2922
  {
2915
2923
  key: ConfigKey.property_tableColSpan,
2924
+ jsonKey: "colspan",
2916
2925
  description: "Number of columns the cell spans.",
2917
2926
  format: TagFormat.number
2918
2927
  },
2919
2928
  {
2920
2929
  key: ConfigKey.property_tableScope,
2930
+ jsonKey: "scope",
2921
2931
  description: "Scope attribute for header cells.",
2922
2932
  format: TagFormat.plainText
2933
+ },
2934
+ {
2935
+ key: ConfigKey.property_tableColWidth,
2936
+ description: "Width for the column.",
2937
+ format: TagFormat.number
2923
2938
  }
2924
2939
  ],
2925
2940
  repeatCount: Count.infinity
@@ -2933,7 +2948,6 @@ var CARDSETS = {
2933
2948
  //
2934
2949
  [CardSetConfigKey.pronunciationTable]: {
2935
2950
  jsonKey: "pronunciationTable.data",
2936
- itemType: "array",
2937
2951
  sides: [
2938
2952
  {
2939
2953
  name: "cell",
@@ -2980,15 +2994,8 @@ var CARDSETS = {
2980
2994
  format: TagFormat.plainText
2981
2995
  },
2982
2996
  {
2983
- key: ConfigKey.tag_item,
2984
- description: "The item for the bot action response.",
2985
- chain: [
2986
- {
2987
- key: ConfigKey.tag_item,
2988
- description: "The lead, page number, source page number, and margin number.",
2989
- maxCount: 4
2990
- }
2991
- ]
2997
+ key: ConfigKey.group_standardItemLead,
2998
+ description: "Item, lead, page number, and margin number for the bot action response."
2992
2999
  },
2993
3000
  {
2994
3001
  key: ConfigKey.tag_instruction,
@@ -3075,19 +3082,20 @@ var CARDSETS = {
3075
3082
  description: "Title of the ingredient."
3076
3083
  },
3077
3084
  {
3078
- key: ConfigKey.group_trueFalse,
3079
- description: "Group for true/false properties of the ingredient."
3085
+ key: ConfigKey.tag_true,
3086
+ description: "Checked state for the ingredient.",
3087
+ jsonKey: "ingredient|set(checked=true)",
3088
+ maxCount: 1
3080
3089
  },
3081
3090
  {
3082
- key: ConfigKey.tag_item,
3083
- description: "The item for the ingredient.",
3084
- chain: [
3085
- {
3086
- key: ConfigKey.tag_item,
3087
- description: "Lead, page number, source page number, and margin number.",
3088
- maxCount: 4
3089
- }
3090
- ]
3091
+ key: ConfigKey.tag_false,
3092
+ description: "Unchecked state for the ingredient.",
3093
+ jsonKey: "ingredient|set(checked=false)",
3094
+ maxCount: 1
3095
+ },
3096
+ {
3097
+ key: ConfigKey.group_standardItemLead,
3098
+ description: "Item, lead, page number, and margin number for the ingredient."
3091
3099
  },
3092
3100
  {
3093
3101
  key: ConfigKey.tag_instruction,
@@ -3226,8 +3234,7 @@ var GROUPS = {
3226
3234
  {
3227
3235
  key: ConfigKey.property_validationDate,
3228
3236
  description: "The date when the bit was validated",
3229
- format: TagFormat.plainText,
3230
- defaultValue: ""
3237
+ format: TagFormat.plainText
3231
3238
  },
3232
3239
  {
3233
3240
  key: ConfigKey.property_aiGenerated,
@@ -3372,6 +3379,7 @@ var GROUPS = {
3372
3379
  },
3373
3380
  {
3374
3381
  key: ConfigKey.property_groupTag,
3382
+ jsonKey: "groupTag.name",
3375
3383
  description: "The group tag(s) for the bit",
3376
3384
  format: TagFormat.plainText,
3377
3385
  maxCount: Count.infinity,
@@ -3402,6 +3410,12 @@ var GROUPS = {
3402
3410
  format: TagFormat.plainText,
3403
3411
  maxCount: Count.infinity
3404
3412
  },
3413
+ {
3414
+ key: ConfigKey.property_extractorInternal,
3415
+ description: "Internal metadata used by the extractor for processing purposes",
3416
+ format: TagFormat.plainText,
3417
+ maxCount: Count.infinity
3418
+ },
3405
3419
  {
3406
3420
  key: ConfigKey.property_levelCEFRp,
3407
3421
  description: "The CEFRp level for the bit",
@@ -3468,20 +3482,48 @@ var GROUPS = {
3468
3482
  }
3469
3483
  ]
3470
3484
  },
3471
- [ConfigKey.group_standardItemLeadInstructionHint]: {
3485
+ [ConfigKey.group_standardItemLead]: {
3472
3486
  type: GroupConfigType.standard,
3473
- description: "Standard group for item, lead, page number, source page number, margin number, instruction and hint tags",
3487
+ description: "Standard group for item, lead, page number, and margin number tags",
3474
3488
  tags: [
3475
3489
  {
3476
3490
  key: ConfigKey.tag_item,
3491
+ jsonKey: "item",
3477
3492
  description: "The item for the bit",
3478
3493
  chain: [
3479
3494
  {
3480
3495
  key: ConfigKey.tag_item,
3481
- description: "The lead, page number, source page number, and margin number for the bit",
3482
- maxCount: 4
3496
+ jsonKey: "lead",
3497
+ description: "The lead for the bit",
3498
+ maxCount: 1,
3499
+ chain: [
3500
+ {
3501
+ key: ConfigKey.tag_item,
3502
+ jsonKey: "pageNumber",
3503
+ description: "The page number for the bit",
3504
+ maxCount: 1,
3505
+ chain: [
3506
+ {
3507
+ key: ConfigKey.tag_item,
3508
+ jsonKey: "marginNumber",
3509
+ description: "The margin number for the bit",
3510
+ maxCount: 1
3511
+ }
3512
+ ]
3513
+ }
3514
+ ]
3483
3515
  }
3484
3516
  ]
3517
+ }
3518
+ ]
3519
+ },
3520
+ [ConfigKey.group_standardItemLeadInstructionHint]: {
3521
+ type: GroupConfigType.standard,
3522
+ description: "Standard group for item, lead, page number, margin number, instruction and hint tags",
3523
+ tags: [
3524
+ {
3525
+ key: ConfigKey.group_standardItemLead,
3526
+ description: "Item, lead, page number, and margin number tags"
3485
3527
  },
3486
3528
  {
3487
3529
  key: ConfigKey.tag_instruction,
@@ -3520,6 +3562,7 @@ var GROUPS = {
3520
3562
  tags: [
3521
3563
  {
3522
3564
  key: ConfigKey.property_imageSource,
3565
+ jsonKey: "imageSource.url",
3523
3566
  description: "The source of an image",
3524
3567
  format: TagFormat.plainText,
3525
3568
  chain: [
@@ -3553,6 +3596,7 @@ var GROUPS = {
3553
3596
  tags: [
3554
3597
  {
3555
3598
  key: ConfigKey.property_technicalTerm,
3599
+ jsonKey: "technicalTerm.technicalTerm",
3556
3600
  description: "The technical term",
3557
3601
  format: TagFormat.plainText,
3558
3602
  chain: [
@@ -3571,6 +3615,7 @@ var GROUPS = {
3571
3615
  tags: [
3572
3616
  {
3573
3617
  key: ConfigKey.property_person,
3618
+ jsonKey: "person.name",
3574
3619
  description: "A person",
3575
3620
  format: TagFormat.plainText,
3576
3621
  chain: [
@@ -3588,6 +3633,7 @@ var GROUPS = {
3588
3633
  {
3589
3634
  // Deprecated (parter renamed to person)
3590
3635
  key: ConfigKey.property_partner,
3636
+ jsonKey: "partner.name",
3591
3637
  description: "A partner",
3592
3638
  format: TagFormat.plainText,
3593
3639
  chain: [
@@ -3615,6 +3661,7 @@ var GROUPS = {
3615
3661
  chain: [
3616
3662
  {
3617
3663
  key: ConfigKey.tag_gap,
3664
+ jsonKey: "solutions[]",
3618
3665
  description: "Alternative values for the gaps in the content",
3619
3666
  maxCount: Count.infinity
3620
3667
  },
@@ -3624,13 +3671,16 @@ var GROUPS = {
3624
3671
  },
3625
3672
  {
3626
3673
  key: ConfigKey.property_example,
3674
+ jsonKey: "example",
3627
3675
  description: "An example for the gap",
3628
3676
  format: TagFormat.plainText
3629
3677
  },
3630
3678
  {
3631
3679
  key: ConfigKey.property_isCaseSensitive,
3680
+ jsonKey: "isCaseSensitive",
3632
3681
  description: "If true, the gap text is case sensitive",
3633
- format: TagFormat.boolean
3682
+ format: TagFormat.boolean,
3683
+ defaultValue: "true"
3634
3684
  }
3635
3685
  ]
3636
3686
  }
@@ -3647,11 +3697,13 @@ var GROUPS = {
3647
3697
  chain: [
3648
3698
  {
3649
3699
  key: ConfigKey.tag_true,
3700
+ jsonKey: "choices[]|set(isCorrect=true)",
3650
3701
  description: "True values for a true/false statement/question",
3651
3702
  maxCount: Count.infinity
3652
3703
  },
3653
3704
  {
3654
3705
  key: ConfigKey.tag_false,
3706
+ jsonKey: "choices[]|set(isCorrect=false)",
3655
3707
  description: "False values for a true/false statement/question",
3656
3708
  maxCount: Count.infinity
3657
3709
  },
@@ -3661,6 +3713,7 @@ var GROUPS = {
3661
3713
  },
3662
3714
  {
3663
3715
  key: ConfigKey.property_example,
3716
+ jsonKey: "example",
3664
3717
  description: "An example for the true/false statement/question",
3665
3718
  format: TagFormat.plainText
3666
3719
  }
@@ -3673,11 +3726,13 @@ var GROUPS = {
3673
3726
  chain: [
3674
3727
  {
3675
3728
  key: ConfigKey.tag_true,
3729
+ jsonKey: "choices[]|set(isCorrect=true)",
3676
3730
  description: "True values for a true/false statement/question",
3677
3731
  maxCount: Count.infinity
3678
3732
  },
3679
3733
  {
3680
3734
  key: ConfigKey.tag_false,
3735
+ jsonKey: "choices[]|set(isCorrect=false)",
3681
3736
  description: "False values for a true/false statement/question",
3682
3737
  maxCount: Count.infinity
3683
3738
  },
@@ -3687,6 +3742,7 @@ var GROUPS = {
3687
3742
  },
3688
3743
  {
3689
3744
  key: ConfigKey.property_example,
3745
+ jsonKey: "example",
3690
3746
  description: "An example for the true/false statement/question",
3691
3747
  format: TagFormat.plainText
3692
3748
  }
@@ -3700,6 +3756,7 @@ var GROUPS = {
3700
3756
  tags: [
3701
3757
  {
3702
3758
  key: ConfigKey.property_mark,
3759
+ jsonKey: "marks.mark",
3703
3760
  description: "The mark configuration",
3704
3761
  format: TagFormat.plainText,
3705
3762
  maxCount: Count.infinity,
@@ -3729,11 +3786,13 @@ var GROUPS = {
3729
3786
  chain: [
3730
3787
  {
3731
3788
  key: ConfigKey.property_mark,
3789
+ jsonKey: "mark",
3732
3790
  description: "The mark configuration",
3733
3791
  format: TagFormat.plainText
3734
3792
  },
3735
3793
  {
3736
3794
  key: ConfigKey.property_example,
3795
+ jsonKey: "example",
3737
3796
  description: "An example for the marked content",
3738
3797
  format: TagFormat.plainText
3739
3798
  }
@@ -3904,7 +3963,8 @@ var GROUPS = {
3904
3963
  {
3905
3964
  key: ConfigKey.property_maxTocChapterLevel,
3906
3965
  description: "The maximum table of contents chapter level",
3907
- format: TagFormat.number
3966
+ format: TagFormat.number,
3967
+ defaultValue: "-1"
3908
3968
  },
3909
3969
  {
3910
3970
  key: ConfigKey.property_sourceDocument,
@@ -3986,12 +4046,14 @@ var GROUPS = {
3986
4046
  {
3987
4047
  key: ConfigKey.property_isTracked,
3988
4048
  description: "If true, the learning path is tracked",
3989
- format: TagFormat.boolean
4049
+ format: TagFormat.boolean,
4050
+ defaultValue: "true"
3990
4051
  },
3991
4052
  {
3992
4053
  key: ConfigKey.property_isInfoOnly,
3993
4054
  description: "If true, the learning path is info only",
3994
- format: TagFormat.boolean
4055
+ format: TagFormat.boolean,
4056
+ defaultValue: "false"
3995
4057
  },
3996
4058
  {
3997
4059
  key: ConfigKey.property_deeplink,
@@ -4335,6 +4397,7 @@ var GROUPS = {
4335
4397
  },
4336
4398
  {
4337
4399
  key: ConfigKey.property_posterImage,
4400
+ jsonKey: "posterImage.src",
4338
4401
  description: "The poster image for the video",
4339
4402
  format: TagFormat.plainText,
4340
4403
  chain: [
@@ -4860,27 +4923,24 @@ var ConfigHydrator = class {
4860
4923
  const v = this.hydrateCardVariantConfig(_variant);
4861
4924
  variantsOfSide.push(v);
4862
4925
  }
4863
- const sideConfig = new CardSideConfig(_side.name, _side.repeat ?? false, variantsOfSide);
4926
+ const sideConfig = new CardSideConfig(
4927
+ _side.name,
4928
+ _side.repeat ?? false,
4929
+ variantsOfSide,
4930
+ _side.jsonKey
4931
+ );
4864
4932
  sides.push(sideConfig);
4865
4933
  }
4866
4934
  const cardSetConfig = new CardSetConfig(
4867
4935
  _cardSet,
4868
4936
  _cardSetConfig.jsonKey,
4869
- _cardSetConfig.itemType ?? "object",
4870
4937
  _cardSetConfig.sections,
4871
4938
  sides
4872
4939
  );
4873
4940
  return cardSetConfig;
4874
4941
  }
4875
4942
  hydrateTagConfig(_tag) {
4876
- const {
4877
- key: _configKey,
4878
- maxCount,
4879
- minCount,
4880
- chain: _chain,
4881
- secondaryJsonKey,
4882
- deprecated
4883
- } = _tag;
4943
+ const { key: _configKey, maxCount, minCount, chain: _chain, deprecated } = _tag;
4884
4944
  const configKey = (0, import_superenum15.Enum)(ConfigKey).fromValue(_configKey) || ConfigKey._unknown;
4885
4945
  if (!configKey) throw new Error(`No tag key found for config key '${configKey}'`);
4886
4946
  const tag = (0, import_superenum15.Enum)(Tag).fromValue(configKey);
@@ -4895,7 +4955,6 @@ var ConfigHydrator = class {
4895
4955
  maxCount: maxCount ?? MAX_COUNT_DEFAULT,
4896
4956
  minCount: minCount ?? MIN_COUNT_DEFAULT,
4897
4957
  chain,
4898
- secondaryJsonKey,
4899
4958
  deprecated
4900
4959
  });
4901
4960
  return {
@@ -4914,8 +4973,7 @@ var ConfigHydrator = class {
4914
4973
  format,
4915
4974
  values,
4916
4975
  defaultValue,
4917
- jsonKey,
4918
- secondaryJsonKey
4976
+ jsonKey
4919
4977
  } = _tag;
4920
4978
  const configKey = (0, import_superenum15.Enum)(ConfigKey).fromValue(_configKey) || ConfigKey._unknown;
4921
4979
  if (!configKey) throw new Error(`No property key found for config key '${configKey}'`);
@@ -4931,7 +4989,6 @@ var ConfigHydrator = class {
4931
4989
  minCount: minCount ?? MIN_COUNT_DEFAULT,
4932
4990
  chain,
4933
4991
  jsonKey,
4934
- secondaryJsonKey,
4935
4992
  format,
4936
4993
  values,
4937
4994
  defaultValue,
@@ -4944,15 +5001,7 @@ var ConfigHydrator = class {
4944
5001
  };
4945
5002
  }
4946
5003
  hydrateResourceTagConfig(_tag) {
4947
- const {
4948
- key: _configKey,
4949
- maxCount,
4950
- minCount,
4951
- chain: _chain,
4952
- deprecated,
4953
- jsonKey,
4954
- secondaryJsonKey
4955
- } = _tag;
5004
+ const { key: _configKey, maxCount, minCount, chain: _chain, deprecated, jsonKey } = _tag;
4956
5005
  const configKey = (0, import_superenum15.Enum)(ConfigKey).fromValue(_configKey) || ConfigKey._unknown;
4957
5006
  if (!configKey) throw new Error(`No resource key found for config key '${configKey}'`);
4958
5007
  const tag = _configKey.substring(1);
@@ -4967,7 +5016,6 @@ var ConfigHydrator = class {
4967
5016
  minCount: minCount ?? MIN_COUNT_DEFAULT,
4968
5017
  chain,
4969
5018
  jsonKey,
4970
- secondaryJsonKey,
4971
5019
  deprecated
4972
5020
  });
4973
5021
  return {
@@ -6268,7 +6316,8 @@ var BITS = {
6268
6316
  {
6269
6317
  key: ConfigKey.property_isCaseSensitive,
6270
6318
  description: "If the cloze answers are case sensitive",
6271
- format: TagFormat.boolean
6319
+ format: TagFormat.boolean,
6320
+ defaultValue: "true"
6272
6321
  },
6273
6322
  {
6274
6323
  key: ConfigKey.property_quizCountItems,
@@ -6714,6 +6763,7 @@ var BITS = {
6714
6763
  },
6715
6764
  {
6716
6765
  key: ConfigKey.property_servings,
6766
+ jsonKey: "servings.servings",
6717
6767
  description: "The number of servings for the ingredients",
6718
6768
  format: TagFormat.number,
6719
6769
  chain: [
@@ -8969,7 +9019,8 @@ var BITS = {
8969
9019
  {
8970
9020
  key: ConfigKey.property_isCaseSensitive,
8971
9021
  description: "Case sensitivity for matching pairs, used to define if matches are case-sensitive",
8972
- format: TagFormat.boolean
9022
+ format: TagFormat.boolean,
9023
+ defaultValue: "true"
8973
9024
  }
8974
9025
  ],
8975
9026
  cardSet: CardSetConfigKey.matchPairs
@@ -9419,7 +9470,8 @@ var BITS = {
9419
9470
  {
9420
9471
  key: ConfigKey.property_platformBrandTarget,
9421
9472
  description: 'The platform brand target (typically "light", "dark" or "none")',
9422
- format: TagFormat.plainText
9473
+ format: TagFormat.plainText,
9474
+ defaultValue: "none"
9423
9475
  }
9424
9476
  ]
9425
9477
  },
@@ -9442,7 +9494,8 @@ var BITS = {
9442
9494
  {
9443
9495
  key: ConfigKey.property_platformLogoMaxHeight,
9444
9496
  description: "Maximum height for the platform logo",
9445
- format: TagFormat.number
9497
+ format: TagFormat.number,
9498
+ defaultValue: "40"
9446
9499
  },
9447
9500
  {
9448
9501
  key: ConfigKey.group_platformStylesCommon,
@@ -9615,7 +9668,8 @@ var BITS = {
9615
9668
  {
9616
9669
  key: ConfigKey.property_resolved,
9617
9670
  description: "Resolved status for the review note, used to indicate if the note is resolved",
9618
- format: TagFormat.boolean
9671
+ format: TagFormat.boolean,
9672
+ defaultValue: "false"
9619
9673
  },
9620
9674
  {
9621
9675
  key: ConfigKey.property_resolvedDate,
@@ -9802,6 +9856,7 @@ var BITS = {
9802
9856
  tags: [
9803
9857
  {
9804
9858
  key: ConfigKey.property_ratingLevelStart,
9859
+ jsonKey: "ratingLevelStart.level",
9805
9860
  description: "Start level for the rating survey, used to define the lowest rating",
9806
9861
  format: TagFormat.number,
9807
9862
  chain: [
@@ -9814,6 +9869,7 @@ var BITS = {
9814
9869
  },
9815
9870
  {
9816
9871
  key: ConfigKey.property_ratingLevelEnd,
9872
+ jsonKey: "ratingLevelEnd.level",
9817
9873
  description: "End level for the rating survey, used to define the highest rating",
9818
9874
  format: TagFormat.number,
9819
9875
  chain: [
@@ -9882,28 +9938,32 @@ var BITS = {
9882
9938
  {
9883
9939
  key: ConfigKey.property_tableFixedHeader,
9884
9940
  description: "Fixed header for the table, used to keep the header visible while scrolling",
9885
- format: TagFormat.boolean
9941
+ format: TagFormat.boolean,
9942
+ defaultValue: "false"
9886
9943
  },
9887
9944
  {
9888
9945
  key: ConfigKey.property_tableHeaderWhitespaceNoWrap,
9889
9946
  description: "No wrap for table header whitespace, used to prevent header text wrapping",
9890
- format: TagFormat.boolean
9891
- // defaultValue: 'false',
9947
+ format: TagFormat.boolean,
9948
+ defaultValue: "false"
9892
9949
  },
9893
9950
  {
9894
9951
  key: ConfigKey.property_tableSearch,
9895
9952
  description: "Search functionality for the table, used to enable searching within the table",
9896
- format: TagFormat.boolean
9953
+ format: TagFormat.boolean,
9954
+ defaultValue: "false"
9897
9955
  },
9898
9956
  {
9899
9957
  key: ConfigKey.property_tableSort,
9900
9958
  description: "Sorting functionality for the table, used to enable sorting of table columns",
9901
- format: TagFormat.boolean
9959
+ format: TagFormat.boolean,
9960
+ defaultValue: "false"
9902
9961
  },
9903
9962
  {
9904
9963
  key: ConfigKey.property_tablePagination,
9905
9964
  description: "Pagination for the table, used to limit the number of rows displayed at once",
9906
- format: TagFormat.boolean
9965
+ format: TagFormat.boolean,
9966
+ defaultValue: "false"
9907
9967
  },
9908
9968
  {
9909
9969
  key: ConfigKey.property_tablePaginationLimit,
@@ -9920,24 +9980,26 @@ var BITS = {
9920
9980
  {
9921
9981
  key: ConfigKey.property_tableWhitespaceNoWrap,
9922
9982
  description: "No wrap for table whitespace, used to prevent text wrapping in table cells",
9923
- format: TagFormat.boolean
9924
- // defaultValue: 'false',
9983
+ format: TagFormat.boolean,
9984
+ defaultValue: "false"
9925
9985
  },
9926
9986
  {
9927
9987
  key: ConfigKey.property_tableAutoWidth,
9928
9988
  description: "Auto width for table columns, used to automatically adjust column widths",
9929
- format: TagFormat.boolean
9930
- // defaultValue: 'true',
9989
+ format: TagFormat.boolean,
9990
+ defaultValue: "true"
9931
9991
  },
9932
9992
  {
9933
9993
  key: ConfigKey.property_tableResizableColumns,
9934
9994
  description: "Resizable columns for the table, used to allow users to resize table columns",
9935
- format: TagFormat.boolean
9995
+ format: TagFormat.boolean,
9996
+ defaultValue: "false"
9936
9997
  },
9937
9998
  {
9938
9999
  key: ConfigKey.property_tableColumnMinWidth,
9939
10000
  description: "Minimum width for table columns, used to define the minimum width of columns",
9940
- format: TagFormat.number
10001
+ format: TagFormat.number,
10002
+ defaultValue: "0"
9941
10003
  }
9942
10004
  ],
9943
10005
  cardSet: CardSetConfigKey.table
@@ -9945,7 +10007,8 @@ var BITS = {
9945
10007
  [BitType.tableExtended]: {
9946
10008
  since: "4.14.0",
9947
10009
  baseBitType: BitType.table,
9948
- description: "Extended table bit, used to create complex tables with all HTML table features"
10010
+ description: "Extended table bit, used to create complex tables with all HTML table features",
10011
+ cardSet: CardSetConfigKey.tableExtended
9949
10012
  },
9950
10013
  [BitType.tableExtendedImage]: {
9951
10014
  since: "5.13.0",
@@ -10911,7 +10974,6 @@ var Config = class {
10911
10974
  maxCount: 1,
10912
10975
  chain: tag.chain,
10913
10976
  jsonKey: tag.jsonKey,
10914
- secondaryJsonKey: tag.secondaryJsonKey,
10915
10977
  deprecated: tag.deprecated
10916
10978
  });
10917
10979
  finalResourceTags[k] = newTag;
@@ -11016,7 +11078,7 @@ var instance2 = new Config();
11016
11078
  // src/generated/package_info.ts
11017
11079
  var PACKAGE_INFO = {
11018
11080
  "name": "@gmb/bitmark-parser-generator",
11019
- "version": "5.19.0",
11081
+ "version": "5.21.0",
11020
11082
  "author": "Get More Brain Ltd",
11021
11083
  "license": "ISC",
11022
11084
  "description": "A bitmark parser and generator using Peggy.js"
@@ -11577,6 +11639,8 @@ var NodeType = {
11577
11639
  extractorExtractionTimestampValue: "extractorExtractionTimestampValue",
11578
11640
  extractorTag: "extractorTag",
11579
11641
  extractorTagValue: "extractorTagValue",
11642
+ extractorInternal: "extractorInternal",
11643
+ extractorInternalValue: "extractorInternalValue",
11580
11644
  extraProperties: "extraProperties",
11581
11645
  feedback: "feedback",
11582
11646
  feedbackEngine: "feedbackEngine",
@@ -11982,6 +12046,8 @@ var NodeType = {
11982
12046
  table: "table",
11983
12047
  tableAutoWidth: "tableAutoWidth",
11984
12048
  tableAutoWidthValue: "tableAutoWidthValue",
12049
+ tableColWidth: "tableColWidth",
12050
+ tableColWidthValue: "tableColWidthValue",
11985
12051
  tableColumnMinWidth: "tableColumnMinWidth",
11986
12052
  tableColumnMinWidthValue: "tableColumnMinWidthValue",
11987
12053
  tableFixedHeader: "tableFixedHeader",
@@ -12767,6 +12833,31 @@ var AstWalkerGenerator = class {
12767
12833
  }
12768
12834
  return void 0;
12769
12835
  }
12836
+ getSiblingNodes(route) {
12837
+ const parentNode = this.getParentNode(route);
12838
+ if (!parentNode || !parentNode.value || !Array.isArray(parentNode.value)) {
12839
+ return {};
12840
+ }
12841
+ const siblings = parentNode.value;
12842
+ const index = siblings.findIndex((s) => s === route[route.length - 1]?.value);
12843
+ if (index === -1) {
12844
+ return {};
12845
+ }
12846
+ return {
12847
+ left: index > 0 ? siblings[index - 1] : void 0,
12848
+ right: index < siblings.length - 1 ? siblings[index + 1] : void 0
12849
+ };
12850
+ }
12851
+ isEmptyParagraph(node) {
12852
+ if (!node) return false;
12853
+ if (node.type !== TextNodeType.paragraph) return false;
12854
+ if (!node.content || !Array.isArray(node.content)) return true;
12855
+ for (const contentNode of node.content) {
12856
+ if (contentNode.type !== TextNodeType.text) return false;
12857
+ if (contentNode.text && contentNode.text.trim() !== "") return false;
12858
+ }
12859
+ return true;
12860
+ }
12770
12861
  };
12771
12862
 
12772
12863
  // src/generator/text/TextGenerator.ts
@@ -12892,7 +12983,6 @@ var TextGenerator = class _TextGenerator extends AstWalkerGenerator {
12892
12983
  __publicField(this, "inParagraph", false);
12893
12984
  __publicField(this, "inHeading", false);
12894
12985
  __publicField(this, "inCodeBlock", false);
12895
- __publicField(this, "exitedCodeBlock", false);
12896
12986
  __publicField(this, "inBulletList", false);
12897
12987
  __publicField(this, "inInline", false);
12898
12988
  __publicField(this, "markDepth", 0);
@@ -12981,7 +13071,6 @@ var TextGenerator = class _TextGenerator extends AstWalkerGenerator {
12981
13071
  this.inParagraph = false;
12982
13072
  this.inHeading = false;
12983
13073
  this.inCodeBlock = false;
12984
- this.exitedCodeBlock = false;
12985
13074
  this.inBulletList = false;
12986
13075
  this.inInline = false;
12987
13076
  this.markDepth = 0;
@@ -13047,7 +13136,7 @@ var TextGenerator = class _TextGenerator extends AstWalkerGenerator {
13047
13136
  switch (node.type) {
13048
13137
  case TextNodeType.paragraph:
13049
13138
  this.inParagraph = true;
13050
- this.writeParagraph(node);
13139
+ this.writeParagraph(node, route);
13051
13140
  break;
13052
13141
  case TextNodeType.hardBreak:
13053
13142
  this.writeHardBreak(node);
@@ -13104,7 +13193,6 @@ var TextGenerator = class _TextGenerator extends AstWalkerGenerator {
13104
13193
  return false;
13105
13194
  default:
13106
13195
  }
13107
- this.exitedCodeBlock = false;
13108
13196
  }
13109
13197
  handleBetweenNode(node, _left, _right, _route) {
13110
13198
  switch (node.type) {
@@ -13138,7 +13226,6 @@ var TextGenerator = class _TextGenerator extends AstWalkerGenerator {
13138
13226
  this.writeNL();
13139
13227
  this.writeNL();
13140
13228
  this.inCodeBlock = false;
13141
- this.exitedCodeBlock = true;
13142
13229
  break;
13143
13230
  case TextNodeType.noBulletList:
13144
13231
  case TextNodeType.bulletList:
@@ -13502,21 +13589,19 @@ var TextGenerator = class _TextGenerator extends AstWalkerGenerator {
13502
13589
  }
13503
13590
  }
13504
13591
  }
13505
- writeParagraph(node) {
13592
+ writeParagraph(node, route) {
13506
13593
  if (this.textFormat === TextFormat.bitmarkText) {
13507
13594
  if (this.inBulletList) return;
13508
- const nodeContentLength = node.content?.length ?? 0;
13509
- if (this.nodeIndex === 0) {
13510
- if (nodeContentLength === 1) {
13511
- const isTextNode = node.content?.[0].type === TextNodeType.text;
13512
- const text = node.content?.[0].text ?? "";
13513
- if (!isTextNode || text !== "") return;
13514
- }
13515
- if (nodeContentLength > 1) return;
13595
+ const siblingNodes = this.getSiblingNodes(route);
13596
+ const prevSiblingNodeType = siblingNodes.left?.type;
13597
+ const inBody = this.textLocation === TextLocation.body;
13598
+ const isEmptyParagraph = this.isEmptyParagraph(node);
13599
+ if (!inBody || !isEmptyParagraph && !(prevSiblingNodeType === TextNodeType.codeBlock || prevSiblingNodeType === TextNodeType.paragraph)) {
13600
+ return;
13516
13601
  }
13517
13602
  this.write("|");
13518
13603
  this.writeNL();
13519
- if (this.exitedCodeBlock) {
13604
+ if (prevSiblingNodeType === TextNodeType.codeBlock) {
13520
13605
  this.writeNL();
13521
13606
  }
13522
13607
  }
@@ -24974,6 +25059,12 @@ var Builder = class extends BaseBuilder {
24974
25059
  data.extractorTag,
24975
25060
  options
24976
25061
  ),
25062
+ extractorInternal: this.toAstProperty(
25063
+ bitType,
25064
+ ConfigKey.property_extractorInternal,
25065
+ data.extractorInternal,
25066
+ options
25067
+ ),
24977
25068
  levelCEFRp: this.toAstProperty(
24978
25069
  bitType,
24979
25070
  ConfigKey.property_levelCEFRp,
@@ -26461,6 +26552,7 @@ var Builder = class extends BaseBuilder {
26461
26552
  if (cell.rowspan != null) tableCell.rowspan = cell.rowspan;
26462
26553
  if (cell.colspan != null) tableCell.colspan = cell.colspan;
26463
26554
  if (cell.scope) tableCell.scope = cell.scope;
26555
+ if (cell.colwidth != null) tableCell.colwidth = cell.colwidth;
26464
26556
  return tableCell;
26465
26557
  });
26466
26558
  return {
@@ -28756,6 +28848,10 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
28756
28848
  this.writeTableCellProperty("tableScope", cell.scope);
28757
28849
  this.writeNL();
28758
28850
  }
28851
+ if (cell.colwidth && cell.colwidth > 0) {
28852
+ this.writeTableCellProperty("tableColWidth", cell.colwidth);
28853
+ this.writeNL();
28854
+ }
28759
28855
  const content = cell.content ?? instance3.EMPTY_STRING;
28760
28856
  this.writeTextOrValue(content, this.textFormat, TextLocation.body);
28761
28857
  }
@@ -31318,7 +31414,8 @@ var JsonGenerator = class extends AstWalkerGenerator {
31318
31414
  if (bitJson.isTracked == null) bitJson.isTracked = true;
31319
31415
  if (bitJson.isInfoOnly == null) bitJson.isInfoOnly = false;
31320
31416
  }
31321
- if (instance2.isOfBitType(bitType, BitType.table) && !instance2.isOfBitType(bitType, BitType.tableImage)) {
31417
+ const tableImageHasTable = instance2.isOfBitType(bitType, BitType.tableImage) && !this.tableIsEmpty(bitJson.table);
31418
+ if (instance2.isOfBitType(bitType, BitType.table) && !instance2.isOfBitType(bitType, BitType.tableImage) || tableImageHasTable) {
31322
31419
  if (bitJson.tableFixedHeader == null) bitJson.tableFixedHeader = false;
31323
31420
  if (bitJson.tableHeaderWhitespaceNoWrap == null) {
31324
31421
  bitJson.tableHeaderWhitespaceNoWrap = false;
@@ -31333,10 +31430,8 @@ var JsonGenerator = class extends AstWalkerGenerator {
31333
31430
  if (bitJson.tableResizableColumns == null) bitJson.tableResizableColumns = false;
31334
31431
  if (bitJson.tableColumnMinWidth == null) bitJson.tableColumnMinWidth = 0;
31335
31432
  }
31336
- if (instance2.isOfBitType(bitType, BitType.tableImage)) {
31337
- if (this.tableIsEmpty(bitJson.table)) {
31338
- delete bitJson.table;
31339
- }
31433
+ if (instance2.isOfBitType(bitType, BitType.tableImage) && !tableImageHasTable) {
31434
+ delete bitJson.table;
31340
31435
  }
31341
31436
  if (instance2.isOfBitType(bitType, BitType.bookReference)) {
31342
31437
  if (bitJson.refAuthor == null) bitJson.refAuthor = [];
@@ -34154,11 +34249,19 @@ function parseTable(context, _bitType, cardSet) {
34154
34249
  const rowSpanRaw = tags2.tableRowSpan ?? readExtraProperty(tags2.extraProperties, "tableRowSpan");
34155
34250
  const colSpanRaw = tags2.tableColSpan ?? readExtraProperty(tags2.extraProperties, "tableColSpan");
34156
34251
  const scopeRaw = tags2.tableScope ?? readExtraProperty(tags2.extraProperties, "tableScope");
34157
- cleanupExtraProperties(tags2, ["tableCellType", "tableRowSpan", "tableColSpan", "tableScope"]);
34252
+ const colWidthRaw = tags2.tableColWidth ?? readExtraProperty(tags2.extraProperties, "tableColWidth");
34253
+ cleanupExtraProperties(tags2, [
34254
+ "tableCellType",
34255
+ "tableRowSpan",
34256
+ "tableColSpan",
34257
+ "tableScope",
34258
+ "tableColWidth"
34259
+ ]);
34158
34260
  const cellType = normalizeCellType(cellTypeRaw, section);
34159
34261
  const rowspan = normalizeSpan(rowSpanRaw, "rowspan");
34160
34262
  const colspan = normalizeSpan(colSpanRaw, "colspan");
34161
34263
  const scope = normalizeScope(scopeRaw);
34264
+ const colwidth = instance6.asNumber(colWidthRaw) ?? 0;
34162
34265
  const cell = {
34163
34266
  content
34164
34267
  };
@@ -34166,6 +34269,7 @@ function parseTable(context, _bitType, cardSet) {
34166
34269
  if (rowspan > 1) cell.rowspan = rowspan;
34167
34270
  if (colspan > 1) cell.colspan = colspan;
34168
34271
  if (scope) cell.scope = scope;
34272
+ if (colwidth > 0) cell.colwidth = colwidth;
34169
34273
  return cell;
34170
34274
  };
34171
34275
  const resolveSectionQualifier = (card) => {
@@ -34552,6 +34656,15 @@ function itemLeadTagContentProcessor(context, _contentDepth, _tagsConfig, conten
34552
34656
  }
34553
34657
 
34554
34658
  // src/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.ts
34659
+ function flattenChainContent(content) {
34660
+ const result = [content];
34661
+ if (content.chain) {
34662
+ for (const child of content.chain) {
34663
+ result.push(...flattenChainContent(child));
34664
+ }
34665
+ }
34666
+ return result;
34667
+ }
34555
34668
  function itemLeadChainContentProcessor(context, contentDepth, tagsConfig, content, target) {
34556
34669
  if (contentDepth === ContentDepth.Chain) {
34557
34670
  itemLeadTagContentProcessor(context, contentDepth, tagsConfig, content, target);
@@ -34562,7 +34675,7 @@ function itemLeadChainContentProcessor(context, contentDepth, tagsConfig, conten
34562
34675
  function buildItemLead(context, _contentDepth, tagsConfig, content, target) {
34563
34676
  if (context.DEBUG_CHAIN_CONTENT) context.debugPrint("item lead content", content);
34564
34677
  const itemLeadConfig = instance2.getTagConfigForTag(tagsConfig, (0, import_superenum43.Enum)(Tag).fromValue(content.type));
34565
- const chainContent = [content, ...content.chain ?? []];
34678
+ const chainContent = flattenChainContent(content);
34566
34679
  const chainTags = context.bitContentProcessor(
34567
34680
  ContentDepth.Chain,
34568
34681
  itemLeadConfig?.chain,
@@ -35119,7 +35232,6 @@ function propertyContentProcessor(context, contentDepth, tagsConfig, content, ta
35119
35232
  minCount: 1,
35120
35233
  chain: void 0,
35121
35234
  jsonKey: void 0,
35122
- secondaryJsonKey: void 0,
35123
35235
  format: TagFormat.bitmarkText,
35124
35236
  values: void 0,
35125
35237
  defaultValue: void 0,
@@ -40126,7 +40238,6 @@ var normalizeCardKey = (cardSetKey) => stringUtils.camelToKebab(cardSetKey);
40126
40238
  var ConfigBuilder = class {
40127
40239
  build(options) {
40128
40240
  const opts = Object.assign({}, options);
40129
- this.buildFlat(opts);
40130
40241
  const bitConfigs = [];
40131
40242
  const groupConfigs = [];
40132
40243
  const bitGroupConfigKeys = /* @__PURE__ */ new Set();
@@ -40197,7 +40308,7 @@ var ConfigBuilder = class {
40197
40308
  const keyToJsonKey = (key, tagNameChain) => {
40198
40309
  let jsonKey = key;
40199
40310
  if (key === "%") {
40200
- jsonKey = "item_todo";
40311
+ jsonKey = "item";
40201
40312
  } else if (key === "!") {
40202
40313
  jsonKey = "instruction";
40203
40314
  } else if (key === "?") {
@@ -40213,13 +40324,13 @@ var ConfigBuilder = class {
40213
40324
  } else if (key === "$") {
40214
40325
  jsonKey = "sampleSolution";
40215
40326
  } else if (key === "+") {
40216
- jsonKey = "true_todo";
40327
+ jsonKey = "choices[]|set(isCorrect=true)";
40217
40328
  } else if (key === "-") {
40218
- jsonKey = "false_todo";
40329
+ jsonKey = "choices[]|set(isCorrect=false)";
40219
40330
  } else if (key === "_") {
40220
- jsonKey = "gap_todo";
40331
+ jsonKey = "solutions[]";
40221
40332
  } else if (key === "=") {
40222
- jsonKey = "mark_todo";
40333
+ jsonKey = "solution";
40223
40334
  } else if (key.startsWith("@")) {
40224
40335
  jsonKey = key.substring(1);
40225
40336
  } else if (key.startsWith("&")) {
@@ -40270,7 +40381,7 @@ var ConfigBuilder = class {
40270
40381
  if (Array.isArray(tag.chain) && tag.chain.length > 0) {
40271
40382
  const chainTags = [];
40272
40383
  for (const [_tagKey, chainTag] of tag.chain.entries()) {
40273
- chainTags.push(...processTagEntries(chainTag, [...tagNameChain, jsonKey]));
40384
+ chainTags.push(...processTagEntries(chainTag, []));
40274
40385
  }
40275
40386
  chain = chainTags;
40276
40387
  }
@@ -40278,10 +40389,8 @@ var ConfigBuilder = class {
40278
40389
  type: "tag",
40279
40390
  key: tagName,
40280
40391
  jsonKey,
40281
- ...tag.secondaryJsonKey ? { secondaryJsonKey: tag.secondaryJsonKey } : {},
40282
40392
  format,
40283
- default: null,
40284
- alwaysInclude: false,
40393
+ default: tag.defaultValue ?? null,
40285
40394
  min: tag.minCount == null ? 0 : tag.minCount,
40286
40395
  max: tag.maxCount == null ? 1 : tag.maxCount,
40287
40396
  description: tag.description ?? "",
@@ -40315,22 +40424,51 @@ var ConfigBuilder = class {
40315
40424
  ...variant.jsonKey !== void 0 ? { jsonKey: variant.jsonKey } : {},
40316
40425
  tags: variantTags,
40317
40426
  repeatCount: variant.repeatCount ?? 1,
40318
- bodyAllowed: variant.bodyAllowed ?? true,
40319
- bodyRequired: variant.bodyRequired ?? false
40427
+ ...variant.bodyRequired ? { bodyRequired: true } : {},
40428
+ ...variant.bodyAllowed === false ? { bodyForbidden: true } : {}
40320
40429
  };
40321
40430
  });
40322
40431
  return {
40323
40432
  name: side.name,
40324
40433
  ...side.repeat ? { repeat: side.repeat } : {},
40434
+ ...side.jsonKey != null ? { jsonKey: side.jsonKey } : {},
40325
40435
  variants
40326
40436
  };
40327
40437
  });
40438
+ if (cardSetConfig.sections) {
40439
+ const cards = Object.entries(cardSetConfig.sections).map(([sectionName, section]) => {
40440
+ let cardSides = section.sideJsonKey ? sides.map((s) => ({ ...s, jsonKey: section.sideJsonKey })) : sides;
40441
+ if (normalizedKey === "table-extended" && sectionName !== "table-header") {
40442
+ cardSides = JSON.parse(JSON.stringify(cardSides));
40443
+ for (const side of cardSides) {
40444
+ for (const variant of side.variants) {
40445
+ for (const tag of variant.tags) {
40446
+ if (tag.type === "tag" && tag.key === "#" && tag.jsonKey === ".") {
40447
+ tag.jsonKey = "^table.header.rows.cells[{s}].content";
40448
+ }
40449
+ }
40450
+ }
40451
+ }
40452
+ }
40453
+ return {
40454
+ name: sectionName,
40455
+ ...section.isDefault ? { isDefault: true } : {},
40456
+ jsonKey: section.jsonKey,
40457
+ sides: cardSides
40458
+ };
40459
+ });
40460
+ return { name: normalizedKey, cards };
40461
+ }
40328
40462
  return {
40329
- key: normalizedKey,
40330
- jsonKey: cardSetConfig.jsonKey,
40331
- ...cardSetConfig.itemType && cardSetConfig.itemType !== "object" ? { itemType: cardSetConfig.itemType } : {},
40332
- ...cardSetConfig.sections ? { sections: cardSetConfig.sections } : {},
40333
- sides
40463
+ name: normalizedKey,
40464
+ cards: [
40465
+ {
40466
+ name: "default",
40467
+ isDefault: true,
40468
+ jsonKey: cardSetConfig.jsonKey,
40469
+ sides
40470
+ }
40471
+ ]
40334
40472
  };
40335
40473
  };
40336
40474
  for (const bt of bitGroupConfigKeys) {
@@ -40397,8 +40535,13 @@ var ConfigBuilder = class {
40397
40535
  }
40398
40536
  }
40399
40537
  let cardRef;
40400
- if (b.cardSet && CARDSETS[b.cardSet]) {
40401
- cardRef = normalizeCardKey(b.cardSet);
40538
+ let current = b;
40539
+ while (current) {
40540
+ if (current.cardSet && CARDSETS[current.cardSet]) {
40541
+ cardRef = normalizeCardKey(current.cardSet);
40542
+ break;
40543
+ }
40544
+ current = current.baseBitType ? BITS[current.baseBitType] : void 0;
40402
40545
  }
40403
40546
  const bitJson = {
40404
40547
  name: b.bitType,
@@ -40412,10 +40555,10 @@ var ConfigBuilder = class {
40412
40555
  }
40413
40556
  ],
40414
40557
  format: resolvedBitConfig.textFormatDefault ?? "bitmark--",
40415
- bodyAllowed: resolvedBitConfig.bodyAllowed ?? true,
40416
40558
  bodyRequired: resolvedBitConfig.bodyRequired ?? false,
40417
- footerAllowed: resolvedBitConfig.footerAllowed ?? true,
40559
+ bodyForbidden: !(resolvedBitConfig.bodyAllowed ?? true),
40418
40560
  footerRequired: resolvedBitConfig.footerRequired ?? false,
40561
+ footerForbidden: !(resolvedBitConfig.footerAllowed ?? true),
40419
40562
  resourceAttachmentAllowed: resolvedBitConfig.resourceAttachmentAllowed ?? true,
40420
40563
  tags: tags2,
40421
40564
  ...cardRef ? { card: cardRef } : {}
@@ -40489,7 +40632,7 @@ var ConfigBuilder = class {
40489
40632
  for (const cardSetKey of Object.keys(CARDSETS)) {
40490
40633
  const cardJson = serializeCardSet(cardSetKey);
40491
40634
  if (!cardJson) continue;
40492
- const output = import_node_path3.default.join(outputFolderCards, `${cardJson.key}.jsonc`);
40635
+ const output = import_node_path3.default.join(outputFolderCards, `${cardJson.name}.jsonc`);
40493
40636
  const str = JSON.stringify(cardJson, null, 2);
40494
40637
  fileWrites.push(import_fs_extra3.default.writeFile(output, str));
40495
40638
  }
@@ -40656,22 +40799,26 @@ var ConfigBuilder = class {
40656
40799
  if (config.key && config.key !== expectedKey) {
40657
40800
  errors.push(`Card key mismatch in cards/${file}: expected '${expectedKey}'`);
40658
40801
  }
40659
- if (Array.isArray(config.sides)) {
40660
- config.sides.forEach((side, sideIdx) => {
40661
- const variants = side.variants;
40662
- if (Array.isArray(variants)) {
40663
- variants.forEach((variant, variantIdx) => {
40664
- const variantTags = variant.tags;
40665
- if (Array.isArray(variantTags)) {
40666
- checkTags(
40667
- variantTags,
40668
- `cards/${file} (side ${sideIdx}, variant ${variantIdx})`,
40669
- 10
40670
- );
40802
+ if (Array.isArray(config.cards)) {
40803
+ for (const cardNode of config.cards) {
40804
+ if (cardNode && Array.isArray(cardNode.sides)) {
40805
+ cardNode.sides.forEach((side, sideIdx) => {
40806
+ const variants = side.variants;
40807
+ if (Array.isArray(variants)) {
40808
+ variants.forEach((variant, variantIdx) => {
40809
+ const variantTags = variant.tags;
40810
+ if (Array.isArray(variantTags)) {
40811
+ checkTags(
40812
+ variantTags,
40813
+ `cards/${file} (side ${sideIdx}, variant ${variantIdx})`,
40814
+ 10
40815
+ );
40816
+ }
40817
+ });
40671
40818
  }
40672
40819
  });
40673
40820
  }
40674
- });
40821
+ }
40675
40822
  }
40676
40823
  } catch (err) {
40677
40824
  errors.push(`Failed to parse cards/${file}: ${err}`);
@@ -40680,128 +40827,6 @@ var ConfigBuilder = class {
40680
40827
  }
40681
40828
  return errors;
40682
40829
  }
40683
- // Build flat bit configs
40684
- buildFlat(options) {
40685
- const opts = Object.assign({}, options);
40686
- const bitConfigs = [];
40687
- for (const bt of (0, import_superenum50.Enum)(BitType).values()) {
40688
- const bitType = instance2.getBitType(bt);
40689
- const bitConfig = instance2.getBitConfig(bitType);
40690
- if (bitConfig) bitConfigs.push(bitConfig);
40691
- }
40692
- const outputFolder = opts.outputDir ?? "assets/config";
40693
- const outputFolderBits = import_node_path3.default.join(outputFolder, "bits_flat");
40694
- import_fs_extra3.default.ensureDirSync(outputFolderBits);
40695
- const existingFiles = import_fs_extra3.default.readdirSync(outputFolderBits).filter((f) => f.endsWith(".jsonc"));
40696
- for (const file of existingFiles) {
40697
- import_fs_extra3.default.removeSync(import_node_path3.default.join(outputFolderBits, file));
40698
- }
40699
- const processTagEntries = (tag) => {
40700
- const tags2 = [];
40701
- let tagName = tag.key;
40702
- const tagType = typeFromConfigKey(tag.key);
40703
- let format = "";
40704
- let chain = void 0;
40705
- if (tagType === BitTagConfigKeyType.tag) {
40706
- tagName = tag.name;
40707
- format = "bitmark--";
40708
- } else if (tagType === BitTagConfigKeyType.property) {
40709
- tagName = tag.key;
40710
- if (tag.format === TagFormat.plainText) {
40711
- format = "string";
40712
- } else if (tag.format === TagFormat.boolean) {
40713
- format = "bool";
40714
- } else if (tag.format === TagFormat.bitmarkText) {
40715
- format = "bitmark";
40716
- } else if (tag.format === TagFormat.number) {
40717
- format = "number";
40718
- }
40719
- } else if (tagType === BitTagConfigKeyType.resource) {
40720
- format = "string";
40721
- } else if (tagType === BitTagConfigKeyType.group) {
40722
- let k = tag.key;
40723
- if (k.startsWith("group_")) k = k.substring(6);
40724
- k = /*'_' +*/
40725
- stringUtils.camelToKebab(k);
40726
- tags2.push({
40727
- type: "group",
40728
- key: k
40729
- });
40730
- return tags2;
40731
- }
40732
- if (Array.isArray(tag.chain) && tag.chain.length > 0) {
40733
- const chainTags = [];
40734
- for (const [_tagKey, chainTag] of tag.chain.entries()) {
40735
- chainTags.push(...processTagEntries(chainTag));
40736
- }
40737
- chain = chainTags;
40738
- }
40739
- const t = {
40740
- key: tagName,
40741
- format,
40742
- default: null,
40743
- alwaysInclude: false,
40744
- min: tag.minCount == null ? 0 : tag.minCount,
40745
- max: tag.maxCount == null ? 1 : tag.maxCount,
40746
- description: tag.description ?? "",
40747
- chain
40748
- // raw: {
40749
- // ...tag,
40750
- // },
40751
- };
40752
- tags2.push(t);
40753
- return tags2;
40754
- };
40755
- for (const b of bitConfigs) {
40756
- const tags2 = [];
40757
- const tagEntriesTypeOrder = [
40758
- BitTagConfigKeyType.tag,
40759
- BitTagConfigKeyType.property,
40760
- BitTagConfigKeyType.resource,
40761
- BitTagConfigKeyType.group,
40762
- BitTagConfigKeyType.unknown
40763
- ];
40764
- const tagEntries = Object.entries(b.tags ?? []).sort((a, b2) => {
40765
- const tagA = a[1];
40766
- const tagB = b2[1];
40767
- const typeA = typeFromConfigKey(tagA.configKey);
40768
- const typeB = typeFromConfigKey(tagB.configKey);
40769
- const typeOrder = tagEntriesTypeOrder.indexOf(typeA) - tagEntriesTypeOrder.indexOf(typeB);
40770
- return typeOrder;
40771
- });
40772
- for (const [_tagKey, tag] of tagEntries) {
40773
- tags2.push(...processTagEntries(tag));
40774
- }
40775
- let cardRef;
40776
- const cardSetKey = b.cardSet?.configKey;
40777
- if (cardSetKey && CARDSETS[cardSetKey]) {
40778
- cardRef = normalizeCardKey(cardSetKey);
40779
- }
40780
- const bitJson = {
40781
- name: b.bitType,
40782
- description: "",
40783
- since: b.since,
40784
- deprecated: b.deprecated,
40785
- history: [
40786
- {
40787
- version: b.since,
40788
- changes: ["Initial version"]
40789
- }
40790
- ],
40791
- format: b.textFormatDefault ?? "bitmark--",
40792
- bodyAllowed: b.bodyAllowed ?? true,
40793
- bodyRequired: b.bodyRequired ?? false,
40794
- footerAllowed: b.footerAllowed ?? true,
40795
- footerRequired: b.footerRequired ?? false,
40796
- resourceAttachmentAllowed: b.resourceAttachmentAllowed ?? true,
40797
- tags: tags2,
40798
- ...cardRef ? { card: cardRef } : {}
40799
- };
40800
- const output = import_node_path3.default.join(outputFolderBits, `${b.bitType}.jsonc`);
40801
- const str = JSON.stringify(bitJson, null, 2);
40802
- import_fs_extra3.default.writeFileSync(output, str);
40803
- }
40804
- }
40805
40830
  };
40806
40831
 
40807
40832
  // src/BitmarkParserGenerator.ts