@gmb/bitmark-parser-generator 5.39.0 → 5.40.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.
@@ -6,6 +6,7 @@ declare const BitType: {
6
6
  readonly _error: "_error";
7
7
  readonly _comment: "_comment";
8
8
  readonly _standard: "_standard";
9
+ readonly _standardLight: "_standard-light";
9
10
  readonly advertising: "advertising";
10
11
  readonly advertisingAdvertorial: "advertising-advertorial";
11
12
  readonly advertisingAdvertorialPage: "advertising-advertorial-page";
@@ -293,6 +294,7 @@ declare const BitType: {
293
294
  readonly handInSystemMedia: "hand-in-system-media";
294
295
  readonly handInVideo: "hand-in-video";
295
296
  readonly handInVoice: "hand-in-voice";
297
+ readonly h: "h";
296
298
  readonly help: "help";
297
299
  readonly helpAlt: "help-alt";
298
300
  readonly highlightText: "highlight-text";
@@ -378,6 +380,7 @@ declare const BitType: {
378
380
  readonly leWatchVideoEmbed: "le-watch-video-embed";
379
381
  readonly lifeSkillSticker: "life-skill-sticker";
380
382
  readonly list: "list";
383
+ readonly listAlt: "list-alt";
381
384
  readonly listItem: "list-item";
382
385
  readonly mark: "mark";
383
386
  readonly match: "match";
@@ -408,6 +411,8 @@ declare const BitType: {
408
411
  readonly notebookArticle: "notebook-article";
409
412
  readonly noteCollapsible: "note-collapsible";
410
413
  readonly output: "output";
414
+ readonly p: "p";
415
+ readonly pAlt: "p-alt";
411
416
  readonly page: "page";
412
417
  readonly pageAcademy: "page-academy";
413
418
  readonly pageArticle: "page-article";
@@ -530,6 +535,7 @@ declare const BitType: {
530
535
  readonly smartStandardNoteNonNormativeCollapsible: "smart-standard-note-non-normative-collapsible";
531
536
  readonly smartStandardNoteNormative: "smart-standard-note-normative";
532
537
  readonly smartStandardNoteNormativeCollapsible: "smart-standard-note-normative-collapsible";
538
+ readonly smartStandardP: "smart-standard-p";
533
539
  readonly smartStandardRemarkLegend: "smart-standard-remark-legend";
534
540
  readonly smartStandardRemarkLegendNonNormative: "smart-standard-remark-legend-non-normative";
535
541
  readonly smartStandardRemarkLegendNormative: "smart-standard-remark-legend-normative";
@@ -708,6 +714,8 @@ type BitTagConfigKeyTypeType = EnumType<typeof BitTagConfigKeyType>;
708
714
  declare const ConfigKey: {
709
715
  readonly group_accessibilityDecorative: "group_accessibilityDecorative";
710
716
  readonly group_standardAllBits: "group_standardAllBits";
717
+ readonly group_standardExample: "group_standardExample";
718
+ readonly group_standardItem: "group_standardItem";
711
719
  readonly group_standardItemLead: "group_standardItemLead";
712
720
  readonly group_standardItemLeadInstructionHint: "group_standardItemLeadInstructionHint";
713
721
  readonly group_standardInstructionHint: "group_standardInstructionHint";
@@ -6,6 +6,7 @@ declare const BitType: {
6
6
  readonly _error: "_error";
7
7
  readonly _comment: "_comment";
8
8
  readonly _standard: "_standard";
9
+ readonly _standardLight: "_standard-light";
9
10
  readonly advertising: "advertising";
10
11
  readonly advertisingAdvertorial: "advertising-advertorial";
11
12
  readonly advertisingAdvertorialPage: "advertising-advertorial-page";
@@ -293,6 +294,7 @@ declare const BitType: {
293
294
  readonly handInSystemMedia: "hand-in-system-media";
294
295
  readonly handInVideo: "hand-in-video";
295
296
  readonly handInVoice: "hand-in-voice";
297
+ readonly h: "h";
296
298
  readonly help: "help";
297
299
  readonly helpAlt: "help-alt";
298
300
  readonly highlightText: "highlight-text";
@@ -378,6 +380,7 @@ declare const BitType: {
378
380
  readonly leWatchVideoEmbed: "le-watch-video-embed";
379
381
  readonly lifeSkillSticker: "life-skill-sticker";
380
382
  readonly list: "list";
383
+ readonly listAlt: "list-alt";
381
384
  readonly listItem: "list-item";
382
385
  readonly mark: "mark";
383
386
  readonly match: "match";
@@ -408,6 +411,8 @@ declare const BitType: {
408
411
  readonly notebookArticle: "notebook-article";
409
412
  readonly noteCollapsible: "note-collapsible";
410
413
  readonly output: "output";
414
+ readonly p: "p";
415
+ readonly pAlt: "p-alt";
411
416
  readonly page: "page";
412
417
  readonly pageAcademy: "page-academy";
413
418
  readonly pageArticle: "page-article";
@@ -530,6 +535,7 @@ declare const BitType: {
530
535
  readonly smartStandardNoteNonNormativeCollapsible: "smart-standard-note-non-normative-collapsible";
531
536
  readonly smartStandardNoteNormative: "smart-standard-note-normative";
532
537
  readonly smartStandardNoteNormativeCollapsible: "smart-standard-note-normative-collapsible";
538
+ readonly smartStandardP: "smart-standard-p";
533
539
  readonly smartStandardRemarkLegend: "smart-standard-remark-legend";
534
540
  readonly smartStandardRemarkLegendNonNormative: "smart-standard-remark-legend-non-normative";
535
541
  readonly smartStandardRemarkLegendNormative: "smart-standard-remark-legend-normative";
@@ -708,6 +714,8 @@ type BitTagConfigKeyTypeType = EnumType<typeof BitTagConfigKeyType>;
708
714
  declare const ConfigKey: {
709
715
  readonly group_accessibilityDecorative: "group_accessibilityDecorative";
710
716
  readonly group_standardAllBits: "group_standardAllBits";
717
+ readonly group_standardExample: "group_standardExample";
718
+ readonly group_standardItem: "group_standardItem";
711
719
  readonly group_standardItemLead: "group_standardItemLead";
712
720
  readonly group_standardItemLeadInstructionHint: "group_standardItemLeadInstructionHint";
713
721
  readonly group_standardInstructionHint: "group_standardInstructionHint";
@@ -14,6 +14,8 @@ var BitType2 = {
14
14
  // Used to indicate a bit is commented out
15
15
  _standard: "_standard",
16
16
  // Not to be used as a bit, but as a base for other bit types
17
+ _standardLight: "_standard-light",
18
+ // PLAN-021: lightweight base (minimal tag set), not to be used as a bit
17
19
  advertising: "advertising",
18
20
  advertisingAdvertorial: "advertising-advertorial",
19
21
  advertisingAdvertorialPage: "advertising-advertorial-page",
@@ -301,6 +303,7 @@ var BitType2 = {
301
303
  handInSystemMedia: "hand-in-system-media",
302
304
  handInVideo: "hand-in-video",
303
305
  handInVoice: "hand-in-voice",
306
+ h: "h",
304
307
  help: "help",
305
308
  helpAlt: "help-alt",
306
309
  highlightText: "highlight-text",
@@ -386,6 +389,7 @@ var BitType2 = {
386
389
  leWatchVideoEmbed: "le-watch-video-embed",
387
390
  lifeSkillSticker: "life-skill-sticker",
388
391
  list: "list",
392
+ listAlt: "list-alt",
389
393
  listItem: "list-item",
390
394
  mark: "mark",
391
395
  match: "match",
@@ -416,6 +420,8 @@ var BitType2 = {
416
420
  notebookArticle: "notebook-article",
417
421
  noteCollapsible: "note-collapsible",
418
422
  output: "output",
423
+ p: "p",
424
+ pAlt: "p-alt",
419
425
  page: "page",
420
426
  pageAcademy: "page-academy",
421
427
  pageArticle: "page-article",
@@ -538,6 +544,7 @@ var BitType2 = {
538
544
  smartStandardNoteNonNormativeCollapsible: "smart-standard-note-non-normative-collapsible",
539
545
  smartStandardNoteNormative: "smart-standard-note-normative",
540
546
  smartStandardNoteNormativeCollapsible: "smart-standard-note-normative-collapsible",
547
+ smartStandardP: "smart-standard-p",
541
548
  smartStandardRemarkLegend: "smart-standard-remark-legend",
542
549
  smartStandardRemarkLegendNonNormative: "smart-standard-remark-legend-non-normative",
543
550
  smartStandardRemarkLegendNormative: "smart-standard-remark-legend-normative",
@@ -1507,6 +1514,8 @@ import "@ncoderz/superenum";
1507
1514
  var groupKeys = {
1508
1515
  group_accessibilityDecorative: "group_accessibilityDecorative",
1509
1516
  group_standardAllBits: "group_standardAllBits",
1517
+ group_standardExample: "group_standardExample",
1518
+ group_standardItem: "group_standardItem",
1510
1519
  group_standardItemLead: "group_standardItemLead",
1511
1520
  group_standardItemLeadInstructionHint: "group_standardItemLeadInstructionHint",
1512
1521
  group_standardInstructionHint: "group_standardInstructionHint",
@@ -5006,6 +5015,31 @@ var GROUPS = {
5006
5015
  }
5007
5016
  ]
5008
5017
  },
5018
+ [ConfigKey.group_standardExample]: {
5019
+ type: GroupConfigType.standard,
5020
+ description: "PLAN-021: Standard group for the bit-level example property only. Mirror of the group_standardTags property_example entry, used by the lightweight bits (_standardLight).",
5021
+ tags: [
5022
+ {
5023
+ key: ConfigKey.property_example,
5024
+ exportJsonKey: [{ "@keyonly": {} }, { "@absent": { isExample: true } }, { example: "$" }],
5025
+ description: "The example(s) for the bit",
5026
+ format: TagFormat.bitmarkText,
5027
+ nullable: true
5028
+ }
5029
+ ]
5030
+ },
5031
+ [ConfigKey.group_standardItem]: {
5032
+ type: GroupConfigType.standard,
5033
+ description: "PLAN-021: Standard group for the item tag ONLY (no lead/pageNumber/marginNumber chain). Used by the lightweight bits (_standardLight).",
5034
+ tags: [
5035
+ {
5036
+ key: ConfigKey.tag_item,
5037
+ jsonKey: "item",
5038
+ exportJsonKey: { item: "$" },
5039
+ description: "The item for the bit"
5040
+ }
5041
+ ]
5042
+ },
5009
5043
  [ConfigKey.group_standardItemLead]: {
5010
5044
  type: GroupConfigType.standard,
5011
5045
  description: "Standard group for item, lead, page number, and margin number tags",
@@ -7809,6 +7843,25 @@ var BITS = {
7809
7843
  }
7810
7844
  ]
7811
7845
  },
7846
+ [BitType2._standardLight]: {
7847
+ since: "5.40.0",
7848
+ description: "PLAN-021: Lightweight standard base bit with a minimal tag set (item + example only \u2014 no instruction/hint/lead, no resource attachments), used as a base for other bits, should not be used directly",
7849
+ resourceAttachmentAllowed: false,
7850
+ tags: [
7851
+ {
7852
+ key: ConfigKey.group_standardAllBits,
7853
+ description: "Standard tags for all bits"
7854
+ },
7855
+ {
7856
+ key: ConfigKey.group_standardItem,
7857
+ description: "The item tag (no lead/pageNumber/marginNumber chain)"
7858
+ },
7859
+ {
7860
+ key: ConfigKey.group_standardExample,
7861
+ description: "The bit-level example property"
7862
+ }
7863
+ ]
7864
+ },
7812
7865
  [BitType2.appFlashcards]: {
7813
7866
  since: "1.3.0",
7814
7867
  title: "Flashcards",
@@ -10636,6 +10689,23 @@ var BITS = {
10636
10689
  baseBitType: BitType2.article,
10637
10690
  description: "Glossary term bit, used to define glossary terms in articles or books"
10638
10691
  },
10692
+ [BitType2.h]: {
10693
+ since: "5.40.0",
10694
+ title: "Heading",
10695
+ bitGroups: [BitGroup.static],
10696
+ baseBitType: BitType2._standardLight,
10697
+ description: "Lightweight heading bit with chapter-style title levels 1-7; title/level + item only \u2014 no body, no footer",
10698
+ bodyAllowed: false,
10699
+ footerAllowed: false,
10700
+ tags: [
10701
+ {
10702
+ key: ConfigKey.tag_title,
10703
+ description: "The title of the heading",
10704
+ jsonKey: "title|setMulti(level)",
10705
+ exportJsonKey: { title: "$", level: "$level" }
10706
+ }
10707
+ ]
10708
+ },
10639
10709
  [BitType2.help]: {
10640
10710
  since: "1.3.0",
10641
10711
  title: "Help",
@@ -10822,13 +10892,22 @@ var BITS = {
10822
10892
  since: "1.22.0",
10823
10893
  title: "List",
10824
10894
  bitGroups: [BitGroup.static],
10825
- baseBitType: BitType2.article,
10895
+ // PLAN-021: rebased from article onto the lightweight base
10896
+ baseBitType: BitType2._standardLight,
10826
10897
  description: "List bit, used to create lists in articles or books"
10827
10898
  },
10899
+ [BitType2.listAlt]: {
10900
+ since: "5.40.0",
10901
+ title: "List Alt",
10902
+ bitGroups: [BitGroup.static],
10903
+ baseBitType: BitType2.list,
10904
+ description: "Lightweight list bit (alternative), based on list"
10905
+ },
10828
10906
  [BitType2.standardList]: {
10829
10907
  since: "1.22.0",
10830
10908
  bitGroups: [BitGroup.static],
10831
- baseBitType: BitType2.article,
10909
+ // PLAN-021: re-rooted from article onto the lightweight list
10910
+ baseBitType: BitType2.list,
10832
10911
  description: "Standard list bit, used to create standard lists in articles or books"
10833
10912
  },
10834
10913
  [BitType2.smartStandardList]: {
@@ -10844,6 +10923,13 @@ var BITS = {
10844
10923
  "xml-niso-iec": { "@el": "ref-list", "@attr": { id: "$customerId" }, "\u25BC": "$anchor" }
10845
10924
  }
10846
10925
  },
10926
+ [BitType2.smartStandardP]: {
10927
+ since: "5.40.0",
10928
+ title: "Smart Standard Paragraph",
10929
+ bitGroups: [BitGroup.static],
10930
+ baseBitType: BitType2.p,
10931
+ description: "Smart standard paragraph bit, based on p"
10932
+ },
10847
10933
  [BitType2.smartStandardListCollapsible]: {
10848
10934
  since: "1.28.0",
10849
10935
  deprecated: "5.37.0",
@@ -13425,7 +13511,8 @@ var BITS = {
13425
13511
  [BitType2.listItem]: {
13426
13512
  since: "1.22.0",
13427
13513
  bitGroups: [BitGroup.static],
13428
- baseBitType: BitType2.article,
13514
+ // PLAN-021: rebased from article onto the lightweight base
13515
+ baseBitType: BitType2._standardLight,
13429
13516
  description: "List item bit, used to create list items in articles or books",
13430
13517
  tags: [
13431
13518
  {
@@ -13830,6 +13917,20 @@ var BITS = {
13830
13917
  baseBitType: BitType2.multipleResponse,
13831
13918
  description: "Coach self-reflection multiple response bit, used for self-reflection in coaching"
13832
13919
  },
13920
+ [BitType2.p]: {
13921
+ since: "5.40.0",
13922
+ title: "Paragraph",
13923
+ bitGroups: [BitGroup.static],
13924
+ baseBitType: BitType2._standardLight,
13925
+ description: "Lightweight paragraph bit with a minimal tag set"
13926
+ },
13927
+ [BitType2.pAlt]: {
13928
+ since: "5.40.0",
13929
+ title: "Paragraph Alt",
13930
+ bitGroups: [BitGroup.static],
13931
+ baseBitType: BitType2.p,
13932
+ description: "Lightweight paragraph bit (alternative), based on p"
13933
+ },
13833
13934
  [BitType2.page]: {
13834
13935
  since: "1.3.0",
13835
13936
  title: "Page",
@@ -16560,7 +16661,7 @@ var instance2 = new Config();
16560
16661
  // src/generated/package_info.ts
16561
16662
  var PACKAGE_INFO = {
16562
16663
  "name": "@gmb/bitmark-parser-generator",
16563
- "version": "5.39.0",
16664
+ "version": "5.40.0",
16564
16665
  "author": "Get More Brain Ltd",
16565
16666
  "license": "ISC",
16566
16667
  "description": "A bitmark parser and generator using Peggy.js"
@@ -35481,7 +35582,7 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
35481
35582
  leaf_level(node, route) {
35482
35583
  const parent = this.getParentNode(route);
35483
35584
  if (parent?.key !== NodeType.bitsValue) return true;
35484
- if (!instance2.isOfBitType(this.bitType, [BitType2.chapter])) return true;
35585
+ if (!instance2.isOfBitType(this.bitType, [BitType2.chapter, BitType2.h])) return true;
35485
35586
  const level = node.value;
35486
35587
  const bit = parent?.value;
35487
35588
  if (level > 0 && bit.title == null) {
@@ -42006,15 +42107,23 @@ function titleTagContentProcessor(context, _contentDepth, _tagsConfig, content,
42006
42107
  titleString: titleText ?? ""
42007
42108
  };
42008
42109
  }
42009
- function buildTitles(_context, bitType, title) {
42110
+ var H_TITLE_LEVEL_MAX = 7;
42111
+ function buildTitles(context, bitType, title) {
42010
42112
  title = title ?? [];
42011
- if (instance2.isOfBitType(bitType, BitType2.chapter)) {
42113
+ if (instance2.isOfBitType(bitType, [BitType2.chapter, BitType2.h])) {
42012
42114
  let t;
42013
42115
  if (title.length > 0) t = title[title.length - 1];
42116
+ let level = title.length > 0 ? title.length - 1 : void 0;
42117
+ if (level != null && level > H_TITLE_LEVEL_MAX && instance2.isOfBitType(bitType, BitType2.h)) {
42118
+ context.addWarning(
42119
+ `Title level of ${level} too high, setting to max value of ${H_TITLE_LEVEL_MAX}`
42120
+ );
42121
+ level = H_TITLE_LEVEL_MAX;
42122
+ }
42014
42123
  return {
42015
42124
  title: t?.titleAst ?? [],
42016
42125
  titleString: t?.titleString ?? "",
42017
- level: title.length > 0 ? title.length - 1 : void 0
42126
+ level
42018
42127
  };
42019
42128
  } else {
42020
42129
  if (Array.isArray(title)) {