@gmb/bitmark-parser-generator 5.37.0 → 5.38.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/browser/bitmark-parser-generator.min.js +1 -1
- package/dist/browser/bundle-report.html +2 -2
- package/dist/browser/cjs/index.cjs +223 -19
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +411 -380
- package/dist/browser/esm/index.d.ts +411 -380
- package/dist/browser/esm/index.js +223 -19
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/cli/main.js +226 -19
- package/dist/cli/main.js.map +1 -1
- package/dist/index.cjs +226 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +411 -380
- package/dist/index.d.ts +411 -380
- package/dist/index.js +226 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<title>@gmb/bitmark-parser-generator [
|
|
6
|
+
<title>@gmb/bitmark-parser-generator [26 Aug 2026 at 00:08]</title>
|
|
7
7
|
<link
|
|
8
8
|
rel="shortcut icon"
|
|
9
9
|
href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII="
|
|
@@ -86,7 +86,7 @@ function(){var e="function"==typeof Object.defineProperties?Object.definePropert
|
|
|
86
86
|
<body>
|
|
87
87
|
<div id="app"></div>
|
|
88
88
|
<script>
|
|
89
|
-
window.chartData = [{"label":"bitmark-parser-generator.min.js","isAsset":true,"statSize":
|
|
89
|
+
window.chartData = [{"label":"bitmark-parser-generator.min.js","isAsset":true,"statSize":1537364,"parsedSize":670397,"gzipSize":126050,"groups":[{"label":"dist/browser/cjs","path":"./dist/browser/cjs","statSize":1531302,"groups":[{"id":922,"label":"index.cjs","path":"./dist/browser/cjs/index.cjs","statSize":1531302,"parsedSize":670254,"gzipSize":126050}],"parsedSize":670254,"gzipSize":126050},{"label":"node_modules/@ncoderz/superenum/dist","path":"./node_modules/@ncoderz/superenum/dist","statSize":6062,"groups":[{"id":722,"label":"index.cjs","path":"./node_modules/@ncoderz/superenum/dist/index.cjs","statSize":6062}],"parsedSize":0,"gzipSize":0}],"isInitialByEntrypoint":{"main":true}}];
|
|
90
90
|
window.entrypoints = ["main"];
|
|
91
91
|
window.defaultSizes = "stat";
|
|
92
92
|
window.compressionAlgorithm = "gzip";
|
|
@@ -1263,6 +1263,7 @@ var import_superenum14 = require("@ncoderz/superenum");
|
|
|
1263
1263
|
// src/model/enum/GroupKey.ts
|
|
1264
1264
|
var import_superenum10 = require("@ncoderz/superenum");
|
|
1265
1265
|
var groupKeys = {
|
|
1266
|
+
group_accessibilityDecorative: "group_accessibilityDecorative",
|
|
1266
1267
|
group_standardAllBits: "group_standardAllBits",
|
|
1267
1268
|
group_standardItemLead: "group_standardItemLead",
|
|
1268
1269
|
group_standardItemLeadInstructionHint: "group_standardItemLeadInstructionHint",
|
|
@@ -1328,6 +1329,8 @@ var groupKeys = {
|
|
|
1328
1329
|
// src/model/enum/PropertyKey.ts
|
|
1329
1330
|
var import_superenum11 = require("@ncoderz/superenum");
|
|
1330
1331
|
var propertyKeys = {
|
|
1332
|
+
property_accessibilityGroupTag: "@accessibilityGroupTag",
|
|
1333
|
+
property_accessibilityTag: "@accessibilityTag",
|
|
1331
1334
|
property_action: "@action",
|
|
1332
1335
|
property_activityType: "@activityType",
|
|
1333
1336
|
property_additionalSolutions: "@additionalSolutions",
|
|
@@ -4518,6 +4521,7 @@ var CARDSETS = {
|
|
|
4518
4521
|
};
|
|
4519
4522
|
|
|
4520
4523
|
// src/config/raw/groups.ts
|
|
4524
|
+
var ACCESSIBILITY_TAG_VALUES = ["complex", "functional", "decorative", "standard"];
|
|
4521
4525
|
var GROUPS = {
|
|
4522
4526
|
[ConfigKey.group_standardAllBits]: {
|
|
4523
4527
|
name: "Standard",
|
|
@@ -4624,7 +4628,8 @@ var GROUPS = {
|
|
|
4624
4628
|
{
|
|
4625
4629
|
key: ConfigKey.property_isCollapsible,
|
|
4626
4630
|
description: "If true, the bit is collapsible",
|
|
4627
|
-
format: TagFormat.boolean
|
|
4631
|
+
format: TagFormat.boolean,
|
|
4632
|
+
nullable: true
|
|
4628
4633
|
},
|
|
4629
4634
|
{
|
|
4630
4635
|
key: ConfigKey.property_spansPageBreak,
|
|
@@ -4789,6 +4794,36 @@ var GROUPS = {
|
|
|
4789
4794
|
}
|
|
4790
4795
|
]
|
|
4791
4796
|
},
|
|
4797
|
+
{
|
|
4798
|
+
key: ConfigKey.property_accessibilityTag,
|
|
4799
|
+
description: "The accessibility classification(s) for the bit",
|
|
4800
|
+
format: TagFormat.enumeration,
|
|
4801
|
+
values: ACCESSIBILITY_TAG_VALUES,
|
|
4802
|
+
nullable: true,
|
|
4803
|
+
maxCount: Count.infinity
|
|
4804
|
+
},
|
|
4805
|
+
{
|
|
4806
|
+
key: ConfigKey.property_accessibilityGroupTag,
|
|
4807
|
+
jsonKey: "accessibilityGroupTag.name",
|
|
4808
|
+
// Entity-merge semantics, as for `@groupTag`: repeated
|
|
4809
|
+
// `[@accessibilityGroupTag: name]` occurrences with the same value fold
|
|
4810
|
+
// into one entry; chained `@accessibilityTag` children's arrays merge as sets.
|
|
4811
|
+
exportJsonKey: { accessibilityGroupTag: [{ "@id": "name", name: "$" }] },
|
|
4812
|
+
description: "The accessibility group tag(s) for the bit",
|
|
4813
|
+
format: TagFormat.plainText,
|
|
4814
|
+
maxCount: Count.infinity,
|
|
4815
|
+
chain: [
|
|
4816
|
+
{
|
|
4817
|
+
key: ConfigKey.property_accessibilityTag,
|
|
4818
|
+
exportJsonKey: { tags: ["$"] },
|
|
4819
|
+
description: "The accessibility classification(s) for the group",
|
|
4820
|
+
format: TagFormat.enumeration,
|
|
4821
|
+
values: ACCESSIBILITY_TAG_VALUES,
|
|
4822
|
+
nullable: true,
|
|
4823
|
+
maxCount: Count.infinity
|
|
4824
|
+
}
|
|
4825
|
+
]
|
|
4826
|
+
},
|
|
4792
4827
|
{
|
|
4793
4828
|
key: ConfigKey.property_reviewTag,
|
|
4794
4829
|
description: "The review tag(s) for the bit",
|
|
@@ -4919,6 +4954,37 @@ var GROUPS = {
|
|
|
4919
4954
|
}
|
|
4920
4955
|
]
|
|
4921
4956
|
},
|
|
4957
|
+
[ConfigKey.group_accessibilityDecorative]: {
|
|
4958
|
+
name: "Accessibility (decorative)",
|
|
4959
|
+
description: "Accessibility tags defaulting to a decorative image, for bits that are decorative by definition",
|
|
4960
|
+
type: GroupConfigType.standard,
|
|
4961
|
+
// Re-declares `@accessibilityGroupTag` (in full — tag hydration is last-wins
|
|
4962
|
+
// per config key, it does not merge) with the decorative defaults. The
|
|
4963
|
+
// standalone `@accessibilityTag` is deliberately NOT re-declared: the default
|
|
4964
|
+
// belongs to the group structure only.
|
|
4965
|
+
tags: [
|
|
4966
|
+
{
|
|
4967
|
+
key: ConfigKey.property_accessibilityGroupTag,
|
|
4968
|
+
jsonKey: "accessibilityGroupTag.name",
|
|
4969
|
+
exportJsonKey: { accessibilityGroupTag: [{ "@id": "name", name: "$" }] },
|
|
4970
|
+
description: "The accessibility group tag(s) for the bit",
|
|
4971
|
+
format: TagFormat.plainText,
|
|
4972
|
+
defaultValue: "image",
|
|
4973
|
+
maxCount: Count.infinity,
|
|
4974
|
+
chain: [
|
|
4975
|
+
{
|
|
4976
|
+
key: ConfigKey.property_accessibilityTag,
|
|
4977
|
+
exportJsonKey: { tags: ["$"] },
|
|
4978
|
+
description: "The accessibility classification(s) for the group",
|
|
4979
|
+
format: TagFormat.enumeration,
|
|
4980
|
+
values: ACCESSIBILITY_TAG_VALUES,
|
|
4981
|
+
defaultValue: "decorative",
|
|
4982
|
+
maxCount: Count.infinity
|
|
4983
|
+
}
|
|
4984
|
+
]
|
|
4985
|
+
}
|
|
4986
|
+
]
|
|
4987
|
+
},
|
|
4922
4988
|
[ConfigKey.group_standardItemLead]: {
|
|
4923
4989
|
type: GroupConfigType.standard,
|
|
4924
4990
|
description: "Standard group for item, lead, page number, and margin number tags",
|
|
@@ -8822,6 +8888,12 @@ var BITS = {
|
|
|
8822
8888
|
description: "The progress of the chapter, used for tracking reading progress",
|
|
8823
8889
|
format: TagFormat.boolean,
|
|
8824
8890
|
defaultValue: "true"
|
|
8891
|
+
},
|
|
8892
|
+
{
|
|
8893
|
+
key: ConfigKey.property_isCollapsible,
|
|
8894
|
+
description: "If true, the chapter is collapsible (always emitted; defaults false)",
|
|
8895
|
+
format: TagFormat.boolean,
|
|
8896
|
+
defaultValue: "false"
|
|
8825
8897
|
}
|
|
8826
8898
|
]
|
|
8827
8899
|
},
|
|
@@ -10231,7 +10303,9 @@ var BITS = {
|
|
|
10231
10303
|
},
|
|
10232
10304
|
[BitType2.printPageBreak]: {
|
|
10233
10305
|
since: "5.4.0",
|
|
10234
|
-
|
|
10306
|
+
// Based on `article`, not `separator`: `separator` adds nothing over `article`,
|
|
10307
|
+
// and basing on it would inherit the decorative accessibility defaults.
|
|
10308
|
+
baseBitType: BitType2.article,
|
|
10235
10309
|
description: "Print page break bit, used to create page breaks for printing in articles or books"
|
|
10236
10310
|
},
|
|
10237
10311
|
[BitType2.releaseNotesSummary]: {
|
|
@@ -10317,12 +10391,24 @@ var BITS = {
|
|
|
10317
10391
|
[BitType2.separator]: {
|
|
10318
10392
|
since: "1.4.15",
|
|
10319
10393
|
baseBitType: BitType2.article,
|
|
10320
|
-
description: "Separator bit, used to create visual separators in articles or books"
|
|
10394
|
+
description: "Separator bit, used to create visual separators in articles or books",
|
|
10395
|
+
tags: [
|
|
10396
|
+
{
|
|
10397
|
+
key: ConfigKey.group_accessibilityDecorative,
|
|
10398
|
+
description: "Accessibility tags, defaulting to a decorative image"
|
|
10399
|
+
}
|
|
10400
|
+
]
|
|
10321
10401
|
},
|
|
10322
10402
|
[BitType2.separatorAlt]: {
|
|
10323
10403
|
since: "1.16.0",
|
|
10324
10404
|
baseBitType: BitType2.separator,
|
|
10325
|
-
description: "Alternative separator bit, used to create visual separators in articles or books with alternative styling"
|
|
10405
|
+
description: "Alternative separator bit, used to create visual separators in articles or books with alternative styling",
|
|
10406
|
+
tags: [
|
|
10407
|
+
{
|
|
10408
|
+
key: ConfigKey.group_accessibilityDecorative,
|
|
10409
|
+
description: "Accessibility tags, defaulting to a decorative image"
|
|
10410
|
+
}
|
|
10411
|
+
]
|
|
10326
10412
|
},
|
|
10327
10413
|
[BitType2.sticker]: {
|
|
10328
10414
|
since: "1.5.28",
|
|
@@ -11558,7 +11644,13 @@ var BITS = {
|
|
|
11558
11644
|
[BitType2.imageMood]: {
|
|
11559
11645
|
since: "1.3.0",
|
|
11560
11646
|
baseBitType: BitType2.image,
|
|
11561
|
-
description: "Image mood bit, used to create mood images in articles or books"
|
|
11647
|
+
description: "Image mood bit, used to create mood images in articles or books",
|
|
11648
|
+
tags: [
|
|
11649
|
+
{
|
|
11650
|
+
key: ConfigKey.group_accessibilityDecorative,
|
|
11651
|
+
description: "Accessibility tags, defaulting to a decorative image"
|
|
11652
|
+
}
|
|
11653
|
+
]
|
|
11562
11654
|
},
|
|
11563
11655
|
[BitType2.imagePortrait]: {
|
|
11564
11656
|
since: "1.3.0",
|
|
@@ -11578,6 +11670,10 @@ var BITS = {
|
|
|
11578
11670
|
{
|
|
11579
11671
|
key: ConfigKey.group_imageNoZoom,
|
|
11580
11672
|
description: "Image no zoom tags for images, used to define whether images should have zoom functionality"
|
|
11673
|
+
},
|
|
11674
|
+
{
|
|
11675
|
+
key: ConfigKey.group_accessibilityDecorative,
|
|
11676
|
+
description: "Accessibility tags, defaulting to a decorative image"
|
|
11581
11677
|
}
|
|
11582
11678
|
],
|
|
11583
11679
|
resourceAttachmentAllowed: false
|
|
@@ -11585,7 +11681,13 @@ var BITS = {
|
|
|
11585
11681
|
[BitType2.imageSeparatorAlt]: {
|
|
11586
11682
|
since: "1.16.0",
|
|
11587
11683
|
baseBitType: BitType2.imageSeparator,
|
|
11588
|
-
description: "Alternative image separator bit, used to create alternative separators in articles or books"
|
|
11684
|
+
description: "Alternative image separator bit, used to create alternative separators in articles or books",
|
|
11685
|
+
tags: [
|
|
11686
|
+
{
|
|
11687
|
+
key: ConfigKey.group_accessibilityDecorative,
|
|
11688
|
+
description: "Accessibility tags, defaulting to a decorative image"
|
|
11689
|
+
}
|
|
11690
|
+
]
|
|
11589
11691
|
},
|
|
11590
11692
|
[BitType2.imageScreenshot]: {
|
|
11591
11693
|
since: "1.3.0",
|
|
@@ -14864,7 +14966,7 @@ var instance2 = new Config();
|
|
|
14864
14966
|
// src/generated/package_info.ts
|
|
14865
14967
|
var PACKAGE_INFO = {
|
|
14866
14968
|
"name": "@gmb/bitmark-parser-generator",
|
|
14867
|
-
"version": "5.
|
|
14969
|
+
"version": "5.38.0",
|
|
14868
14970
|
"author": "Get More Brain Ltd",
|
|
14869
14971
|
"license": "ISC",
|
|
14870
14972
|
"description": "A bitmark parser and generator using Peggy.js"
|
|
@@ -15218,6 +15320,10 @@ var NodeType = {
|
|
|
15218
15320
|
// unknown
|
|
15219
15321
|
__isDefaultExample: "__isDefaultExample",
|
|
15220
15322
|
__typeAlias: "__typeAlias",
|
|
15323
|
+
accessibilityGroupTag: "accessibilityGroupTag",
|
|
15324
|
+
accessibilityGroupTagValue: "accessibilityGroupTagValue",
|
|
15325
|
+
accessibilityTag: "accessibilityTag",
|
|
15326
|
+
accessibilityTagValue: "accessibilityTagValue",
|
|
15221
15327
|
action: "action",
|
|
15222
15328
|
actionValue: "actionValue",
|
|
15223
15329
|
activityType: "activityType",
|
|
@@ -27542,6 +27648,12 @@ var BaseBuilder = class {
|
|
|
27542
27648
|
case TagFormat.plainText:
|
|
27543
27649
|
if (instance6.asNumber(v) != null) v = `${v}`;
|
|
27544
27650
|
return stringUtils.isString(v) ? stringUtils.trimmedString(v) : void 0;
|
|
27651
|
+
case TagFormat.enumeration: {
|
|
27652
|
+
if (instance6.asNumber(v) != null) v = `${v}`;
|
|
27653
|
+
const enumValue = stringUtils.isString(v) ? stringUtils.trimmedString(v) : void 0;
|
|
27654
|
+
if (enumValue == null || enumValue === "") return propertyConfig?.defaultValue ?? "";
|
|
27655
|
+
return enumValue;
|
|
27656
|
+
}
|
|
27545
27657
|
case TagFormat.number:
|
|
27546
27658
|
return instance6.asNumber(v);
|
|
27547
27659
|
case TagFormat.boolean:
|
|
@@ -29108,6 +29220,10 @@ var Builder = class extends BaseBuilder {
|
|
|
29108
29220
|
const bitType = data.bitType;
|
|
29109
29221
|
const bitConfig = instance2.getBitConfig(bitType);
|
|
29110
29222
|
const isCollapsibleDefaultsTrue = bitConfig.tags[ConfigKey.property_isCollapsible]?.defaultValue === "true";
|
|
29223
|
+
const accessibilityGroupTag = this.resolveAccessibilityGroupTag(
|
|
29224
|
+
bitConfig,
|
|
29225
|
+
data.accessibilityGroupTag
|
|
29226
|
+
);
|
|
29111
29227
|
const deprecatedTextFormat = (0, import_superenum30.Enum)(DeprecatedTextFormat).fromValue(data.textFormat);
|
|
29112
29228
|
let textFormat = (0, import_superenum30.Enum)(TextFormat2).fromValue(data.textFormat) ?? bitConfig.textFormatDefault;
|
|
29113
29229
|
if (deprecatedTextFormat === DeprecatedTextFormat.bitmarkMinusMinus) {
|
|
@@ -29343,6 +29459,13 @@ var Builder = class extends BaseBuilder {
|
|
|
29343
29459
|
slug: this.toAstProperty(bitType, ConfigKey.property_slug, data.slug, options),
|
|
29344
29460
|
tag: this.toAstProperty(bitType, ConfigKey.property_tag, data.tag, options),
|
|
29345
29461
|
groupTag: this.buildGroupTags(context, data.groupTag),
|
|
29462
|
+
accessibilityTag: this.toAstProperty(
|
|
29463
|
+
bitType,
|
|
29464
|
+
ConfigKey.property_accessibilityTag,
|
|
29465
|
+
data.accessibilityTag,
|
|
29466
|
+
options
|
|
29467
|
+
),
|
|
29468
|
+
accessibilityGroupTag: this.buildGroupTags(context, accessibilityGroupTag),
|
|
29346
29469
|
reviewTag: this.toAstProperty(bitType, ConfigKey.property_reviewTag, data.reviewTag, options),
|
|
29347
29470
|
reviewerTag: this.toAstProperty(
|
|
29348
29471
|
bitType,
|
|
@@ -30395,6 +30518,26 @@ var Builder = class extends BaseBuilder {
|
|
|
30395
30518
|
});
|
|
30396
30519
|
return node;
|
|
30397
30520
|
}
|
|
30521
|
+
/**
|
|
30522
|
+
* Resolve the accessibilityGroupTag data, materialising the bit type's default when absent.
|
|
30523
|
+
*
|
|
30524
|
+
* PLAN-019: `group_accessibilityDecorative` re-declares `@accessibilityGroupTag` with a
|
|
30525
|
+
* `defaultValue`, and its chained `@accessibilityTag` likewise. When the bit carries no
|
|
30526
|
+
* authored value, synthesize the default group so it reaches both generators. An authored
|
|
30527
|
+
* value always wins.
|
|
30528
|
+
*
|
|
30529
|
+
* @param bitConfig - the resolved config for the bit
|
|
30530
|
+
* @param data - authored data for the node, if any
|
|
30531
|
+
* @returns
|
|
30532
|
+
*/
|
|
30533
|
+
resolveAccessibilityGroupTag(bitConfig, data) {
|
|
30534
|
+
if (data != null && (!Array.isArray(data) || data.length > 0)) return data;
|
|
30535
|
+
const groupConfig = bitConfig.tags[ConfigKey.property_accessibilityGroupTag];
|
|
30536
|
+
const name = groupConfig?.defaultValue;
|
|
30537
|
+
if (name == null) return data;
|
|
30538
|
+
const tag = groupConfig?.chain?.[ConfigKey.property_accessibilityTag]?.defaultValue;
|
|
30539
|
+
return [{ name, tags: tag != null ? [tag] : [] }];
|
|
30540
|
+
}
|
|
30398
30541
|
/**
|
|
30399
30542
|
* Build groupTag[] node
|
|
30400
30543
|
*
|
|
@@ -32477,6 +32620,29 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
32477
32620
|
}
|
|
32478
32621
|
return false;
|
|
32479
32622
|
}
|
|
32623
|
+
// bitmarkAst -> bits -> bitsValue -> accessibilityGroupTag
|
|
32624
|
+
enter_accessibilityGroupTag(node, route) {
|
|
32625
|
+
const accessibilityGroupTag = node.value;
|
|
32626
|
+
const parent = this.getParentNode(route);
|
|
32627
|
+
if (parent?.key !== NodeType.bitsValue) return true;
|
|
32628
|
+
for (const gt of accessibilityGroupTag) {
|
|
32629
|
+
const { name, tags: tags2 } = gt;
|
|
32630
|
+
this.writeProperty("accessibilityGroupTag", name, route, {
|
|
32631
|
+
format: TagFormat.plainText,
|
|
32632
|
+
writeEmpty: true
|
|
32633
|
+
});
|
|
32634
|
+
if (tags2 && tags2.length > 0) {
|
|
32635
|
+
for (const t of tags2) {
|
|
32636
|
+
this.writeProperty("accessibilityTag", t, route, {
|
|
32637
|
+
format: TagFormat.plainText,
|
|
32638
|
+
writeEmpty: true,
|
|
32639
|
+
forceChain: true
|
|
32640
|
+
});
|
|
32641
|
+
}
|
|
32642
|
+
}
|
|
32643
|
+
}
|
|
32644
|
+
return false;
|
|
32645
|
+
}
|
|
32480
32646
|
// bitmarkAst -> bits -> bitsValue -> labelTrue / labelFalse
|
|
32481
32647
|
leaf_labelTrue(node, route) {
|
|
32482
32648
|
const value = node.value;
|
|
@@ -35235,10 +35401,14 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
35235
35401
|
}
|
|
35236
35402
|
// bitmarkAst -> bits -> bitsValue -> isCollapsible
|
|
35237
35403
|
/**
|
|
35238
|
-
*
|
|
35239
|
-
*
|
|
35240
|
-
*
|
|
35241
|
-
*
|
|
35404
|
+
* `isCollapsible` is emitted only when explicitly set on the bit — an explicit
|
|
35405
|
+
* `true`/`false` in the source is emitted as-is, and an absent tag yields no
|
|
35406
|
+
* JSON key (the tag is nullable in the config: no default, unset when absent).
|
|
35407
|
+
*
|
|
35408
|
+
* Two exceptions always carry a value: chapter bits default to `false`
|
|
35409
|
+
* (`defaultValue: 'false'` in the bit config, applied in `cleanBitJson()`),
|
|
35410
|
+
* and the deprecated `*-collapsible` bit types default to `true` (materialised
|
|
35411
|
+
* into the AST by the Builder).
|
|
35242
35412
|
*
|
|
35243
35413
|
* Defining these handlers suppresses the generic property handlers that
|
|
35244
35414
|
* `generatePropertyHandlers()` would otherwise install for this tag.
|
|
@@ -35246,7 +35416,7 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
35246
35416
|
leaf_isCollapsible(node, route) {
|
|
35247
35417
|
const parent = this.getParentNode(route);
|
|
35248
35418
|
if (parent?.key !== NodeType.bitsValue) return false;
|
|
35249
|
-
if (node.value
|
|
35419
|
+
if (node.value != null) this.bitJson.isCollapsible = node.value === true;
|
|
35250
35420
|
return false;
|
|
35251
35421
|
}
|
|
35252
35422
|
enter_isCollapsible(node, route) {
|
|
@@ -36125,6 +36295,7 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
36125
36295
|
if (instance2.isOfBitType(bitType, BitType2.chapter)) {
|
|
36126
36296
|
if (bitJson.toc == null) bitJson.toc = true;
|
|
36127
36297
|
if (bitJson.progress == null) bitJson.progress = true;
|
|
36298
|
+
if (bitJson.isCollapsible == null) bitJson.isCollapsible = false;
|
|
36128
36299
|
if (bitJson.level == null) bitJson.level = 1;
|
|
36129
36300
|
if (bitJson.body == null) bitJson.body = this.bodyDefault;
|
|
36130
36301
|
}
|
|
@@ -39621,19 +39792,25 @@ function handleStandardStringExample(context, _content, example, target) {
|
|
|
39621
39792
|
}
|
|
39622
39793
|
|
|
39623
39794
|
// src/parser/bitmark/peg/contentProcessors/GroupTagChainContentProcessor.ts
|
|
39624
|
-
|
|
39795
|
+
var GROUP_TAG = { groupKey: "groupTag", memberKey: "tag" };
|
|
39796
|
+
var ACCESSIBILITY_GROUP_TAG = {
|
|
39797
|
+
groupKey: "accessibilityGroupTag",
|
|
39798
|
+
memberKey: "accessibilityTag"
|
|
39799
|
+
};
|
|
39800
|
+
function groupTagChainContentProcessor(context, _contentDepth, tagsConfig, content, target, keys = GROUP_TAG) {
|
|
39625
39801
|
const { value } = content;
|
|
39626
|
-
|
|
39802
|
+
const { groupKey, memberKey } = keys;
|
|
39803
|
+
if (context.DEBUG_CHAIN_CONTENT) context.debugPrint(`${groupKey} content`, content);
|
|
39627
39804
|
const tags2 = context.bitContentProcessor(ContentDepth.Chain, tagsConfig, content.chain);
|
|
39628
|
-
if (context.DEBUG_CHAIN_TAGS) context.debugPrint(
|
|
39629
|
-
const
|
|
39805
|
+
if (context.DEBUG_CHAIN_TAGS) context.debugPrint(`${groupKey} TAGS`, tags2);
|
|
39806
|
+
const memberTags = tags2[memberKey];
|
|
39630
39807
|
const name = stringUtils.trimmedString(value) ?? "";
|
|
39631
39808
|
const node = {
|
|
39632
39809
|
name,
|
|
39633
|
-
tags:
|
|
39810
|
+
tags: memberTags ?? []
|
|
39634
39811
|
};
|
|
39635
|
-
if (!Array.isArray(target
|
|
39636
|
-
target.
|
|
39812
|
+
if (!Array.isArray(target[groupKey])) target[groupKey] = [];
|
|
39813
|
+
target[groupKey].push(node);
|
|
39637
39814
|
}
|
|
39638
39815
|
|
|
39639
39816
|
// src/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.ts
|
|
@@ -39853,6 +40030,16 @@ function propertyContentProcessor(context, contentDepth, tagsConfig, content, ta
|
|
|
39853
40030
|
} else if (configKey === ConfigKey.property_groupTag) {
|
|
39854
40031
|
groupTagChainContentProcessor(context, contentDepth, propertyConfig.chain, content, target);
|
|
39855
40032
|
return;
|
|
40033
|
+
} else if (configKey === ConfigKey.property_accessibilityGroupTag) {
|
|
40034
|
+
groupTagChainContentProcessor(
|
|
40035
|
+
context,
|
|
40036
|
+
contentDepth,
|
|
40037
|
+
propertyConfig.chain,
|
|
40038
|
+
content,
|
|
40039
|
+
target,
|
|
40040
|
+
ACCESSIBILITY_GROUP_TAG
|
|
40041
|
+
);
|
|
40042
|
+
return;
|
|
39856
40043
|
} else if (configKey === ConfigKey.property_ratingLevelStart || configKey === ConfigKey.property_ratingLevelEnd) {
|
|
39857
40044
|
ratingLevelChainContentProcessor(
|
|
39858
40045
|
context,
|
|
@@ -39905,6 +40092,23 @@ function propertyContentProcessor(context, contentDepth, tagsConfig, content, ta
|
|
|
39905
40092
|
location: TextLocation2.tag
|
|
39906
40093
|
}
|
|
39907
40094
|
);
|
|
40095
|
+
case TagFormat.enumeration: {
|
|
40096
|
+
const enumValue = instance3.unbreakscape(
|
|
40097
|
+
stringUtils.isString(v2) ? stringUtils.trimmedString(v2) : void 0,
|
|
40098
|
+
{
|
|
40099
|
+
format: TextFormat2.plainText,
|
|
40100
|
+
location: TextLocation2.tag
|
|
40101
|
+
}
|
|
40102
|
+
);
|
|
40103
|
+
if (enumValue == null || enumValue === "") return c.defaultValue ?? "";
|
|
40104
|
+
if (c.values && !c.values.includes(enumValue)) {
|
|
40105
|
+
context.addWarning(
|
|
40106
|
+
`Invalid value '${enumValue}' for property [@${tag}]. Valid values: ${c.values.join(" | ")}`,
|
|
40107
|
+
content
|
|
40108
|
+
);
|
|
40109
|
+
}
|
|
40110
|
+
return enumValue;
|
|
40111
|
+
}
|
|
39908
40112
|
case TagFormat.number:
|
|
39909
40113
|
return instance6.asNumber(
|
|
39910
40114
|
instance3.unbreakscape(v2, {
|