@gmb/bitmark-parser-generator 4.2.0 → 4.5.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 +39 -31
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +7 -2
- package/dist/browser/esm/index.d.ts +7 -2
- package/dist/browser/esm/index.js +39 -31
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/index.cjs +39 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +39 -31
- 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 [18 Aug 2025 at 21:35]</title>
|
|
7
7
|
<link rel="shortcut icon" 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+v2dx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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=" type="image/x-icon" />
|
|
8
8
|
|
|
9
9
|
<script>
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<body>
|
|
32
32
|
<div id="app"></div>
|
|
33
33
|
<script>
|
|
34
|
-
window.chartData = [{"label":"bitmark-parser-generator.min.js","isAsset":true,"statSize":
|
|
34
|
+
window.chartData = [{"label":"bitmark-parser-generator.min.js","isAsset":true,"statSize":1145123,"parsedSize":498962,"gzipSize":97351,"groups":[{"label":"dist/browser/cjs","path":"./dist/browser/cjs","statSize":1138143,"groups":[{"id":922,"label":"index.cjs","path":"./dist/browser/cjs/index.cjs","statSize":1138143,"parsedSize":498858,"gzipSize":97351}],"parsedSize":498858,"gzipSize":97351},{"label":"node_modules/@ncoderz/superenum/dist/esm","path":"./node_modules/@ncoderz/superenum/dist/esm","statSize":6980,"groups":[{"id":718,"label":"superenum.js","path":"./node_modules/@ncoderz/superenum/dist/esm/superenum.js","statSize":6980}],"parsedSize":0,"gzipSize":0}],"isInitialByEntrypoint":{"main":true}}];
|
|
35
35
|
window.entrypoints = ["main"];
|
|
36
36
|
window.defaultSizes = "stat";
|
|
37
37
|
</script>
|
|
@@ -58,6 +58,7 @@ var BitType = (0, import_superenum.superenum)({
|
|
|
58
58
|
// Not to be used as a bit, but as a base for other bit types
|
|
59
59
|
advertising: "advertising",
|
|
60
60
|
advertisingAdvertorial: "advertising-advertorial",
|
|
61
|
+
advertisingAdvertorialPage: "advertising-advertorial-page",
|
|
61
62
|
advertisingCallToAction: "advertising-call-to-action",
|
|
62
63
|
advertisingCallToActionMeeting: "advertising-call-to-action-meeting",
|
|
63
64
|
advertisingBanner: "advertising-banner",
|
|
@@ -285,6 +286,8 @@ var BitType = (0, import_superenum.superenum)({
|
|
|
285
286
|
extractorAiChat: "extractor-ai-chat",
|
|
286
287
|
extractorBlock: "extractor-block",
|
|
287
288
|
extractorConfiguration: "extractor-configuration",
|
|
289
|
+
extractorImage: "extractor-image",
|
|
290
|
+
extractorImageCollapsible: "extractor-image-collapsible",
|
|
288
291
|
extractorInformation: "extractor-information",
|
|
289
292
|
extractorPage: "extractor-page",
|
|
290
293
|
extractorPageCollapsible: "extractor-page-collapsible",
|
|
@@ -6305,6 +6308,18 @@ var BITS = {
|
|
|
6305
6308
|
description: "Extractor configuration bit, used to configure extractors in articles or books",
|
|
6306
6309
|
textFormatDefault: TextFormat2.plainText
|
|
6307
6310
|
},
|
|
6311
|
+
[BitType.extractorImage]: {
|
|
6312
|
+
since: "4.3.0",
|
|
6313
|
+
baseBitType: BitType.image,
|
|
6314
|
+
description: "Extractor embedded image bit, used for embedded images extracted from PDFs",
|
|
6315
|
+
textFormatDefault: TextFormat2.plainText
|
|
6316
|
+
},
|
|
6317
|
+
[BitType.extractorImageCollapsible]: {
|
|
6318
|
+
since: "4.3.0",
|
|
6319
|
+
baseBitType: BitType.extractorImage,
|
|
6320
|
+
description: "Collapsible extractor embedded image bit, used for embedded images extracted from PDFs",
|
|
6321
|
+
textFormatDefault: TextFormat2.plainText
|
|
6322
|
+
},
|
|
6308
6323
|
[BitType.extractorInformation]: {
|
|
6309
6324
|
since: "3.8.0",
|
|
6310
6325
|
baseBitType: BitType._standard,
|
|
@@ -7541,6 +7556,11 @@ var BITS = {
|
|
|
7541
7556
|
baseBitType: BitType.page,
|
|
7542
7557
|
description: "Page cover image bit, used to create cover images for pages"
|
|
7543
7558
|
},
|
|
7559
|
+
[BitType.advertisingAdvertorialPage]: {
|
|
7560
|
+
since: "4.5.0",
|
|
7561
|
+
baseBitType: BitType.page,
|
|
7562
|
+
description: "Advertorial Page bit, used to create advertorial pages"
|
|
7563
|
+
},
|
|
7544
7564
|
[BitType.pageBuyButton]: {
|
|
7545
7565
|
since: "1.4.3",
|
|
7546
7566
|
baseBitType: BitType._standard,
|
|
@@ -9088,7 +9108,7 @@ var instance2 = new Config();
|
|
|
9088
9108
|
// src/generated/package_info.ts
|
|
9089
9109
|
var PACKAGE_INFO = {
|
|
9090
9110
|
"name": "@gmb/bitmark-parser-generator",
|
|
9091
|
-
"version": "4.
|
|
9111
|
+
"version": "4.5.0",
|
|
9092
9112
|
"author": "Get More Brain Ltd",
|
|
9093
9113
|
"license": "ISC",
|
|
9094
9114
|
"description": "A bitmark parser and generator using Peggy.js"
|
|
@@ -10495,14 +10515,17 @@ var ArrayUtils = class {
|
|
|
10495
10515
|
*/
|
|
10496
10516
|
removeDuplicates(arr, keyFunc) {
|
|
10497
10517
|
const seen = /* @__PURE__ */ new Set();
|
|
10498
|
-
|
|
10518
|
+
let write = 0;
|
|
10519
|
+
for (let read = 0; read < arr.length; read++) {
|
|
10520
|
+
const item = arr[read];
|
|
10499
10521
|
const k = keyFunc ? keyFunc(item) : item;
|
|
10500
|
-
if (seen.has(k)) {
|
|
10501
|
-
|
|
10502
|
-
if (
|
|
10522
|
+
if (!seen.has(k)) {
|
|
10523
|
+
seen.add(k);
|
|
10524
|
+
if (write !== read) arr[write] = item;
|
|
10525
|
+
write++;
|
|
10503
10526
|
}
|
|
10504
|
-
seen.add(k);
|
|
10505
10527
|
}
|
|
10528
|
+
if (write < arr.length) arr.length = write;
|
|
10506
10529
|
return arr;
|
|
10507
10530
|
}
|
|
10508
10531
|
};
|
|
@@ -27434,22 +27457,9 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
27434
27457
|
const bitType = this.getBitType(route);
|
|
27435
27458
|
const parent = this.getParentNode(route);
|
|
27436
27459
|
if (parser2 && bitType) {
|
|
27437
|
-
const {
|
|
27438
|
-
version,
|
|
27439
|
-
excessResources: parserExcessResources,
|
|
27440
|
-
warnings,
|
|
27441
|
-
errors,
|
|
27442
|
-
...parserRest
|
|
27443
|
-
} = parser2;
|
|
27460
|
+
const { version, warnings, errors, ...parserRest } = parser2;
|
|
27444
27461
|
const bitmarkVersion = `${this.bitmarkVersion}`;
|
|
27445
27462
|
const textParserVersion = this.textParserVersion;
|
|
27446
|
-
let excessResources;
|
|
27447
|
-
if (Array.isArray(parserExcessResources) && parserExcessResources.length > 0) {
|
|
27448
|
-
excessResources = [];
|
|
27449
|
-
for (const r of parserExcessResources) {
|
|
27450
|
-
excessResources.push(r);
|
|
27451
|
-
}
|
|
27452
|
-
}
|
|
27453
27463
|
const internalComments = this.getInternalComments(route);
|
|
27454
27464
|
if (parent?.key === NodeType.bitsValue) {
|
|
27455
27465
|
this.bitWrapperJson.parser = {
|
|
@@ -27459,8 +27469,7 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
27459
27469
|
internalComments,
|
|
27460
27470
|
...parserRest,
|
|
27461
27471
|
warnings,
|
|
27462
|
-
errors
|
|
27463
|
-
excessResources
|
|
27472
|
+
errors
|
|
27464
27473
|
};
|
|
27465
27474
|
if (!this.options.enableWarnings) {
|
|
27466
27475
|
delete this.bitWrapperJson.parser.warnings;
|
|
@@ -27779,7 +27788,6 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
27779
27788
|
*/
|
|
27780
27789
|
cleanBitJson(bitJson) {
|
|
27781
27790
|
const bitType = instance2.getBitType(bitJson.type);
|
|
27782
|
-
const bitConfig = instance2.getBitConfig(bitType);
|
|
27783
27791
|
if (bitJson.originalType == null) bitJson.originalType = void 0;
|
|
27784
27792
|
if (!bitJson.item) bitJson.item = void 0;
|
|
27785
27793
|
if (instance2.isOfBitType(bitType, [BitType._error, BitType._comment])) {
|
|
@@ -28015,9 +28023,6 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
28015
28023
|
if (instance2.isOfBitType(bitType, BitType.container)) {
|
|
28016
28024
|
if (bitJson.allowedBit == null) bitJson.allowedBit = [];
|
|
28017
28025
|
}
|
|
28018
|
-
if (bitConfig.quizBit) {
|
|
28019
|
-
if (bitJson.revealSolutions == null) bitJson.revealSolutions = false;
|
|
28020
|
-
}
|
|
28021
28026
|
if (instance2.isOfBitType(bitType, BitType.platformPath)) {
|
|
28022
28027
|
if (bitJson.path == null) bitJson.path = "";
|
|
28023
28028
|
}
|
|
@@ -29448,7 +29453,10 @@ var BitmarkPegParserValidator = class {
|
|
|
29448
29453
|
if (warning.invalid || warning.excessResource) {
|
|
29449
29454
|
warningStr = `${keyStr} is not valid here (incorrectly chained?).${ignoredStr}`;
|
|
29450
29455
|
} else if (warning.tooMany != null) {
|
|
29451
|
-
warningStr = `${keyStr} is included more than ${warning.tooMany} time(s).`;
|
|
29456
|
+
warningStr = `${keyStr} is included more than the required ${warning.tooMany} time(s).`;
|
|
29457
|
+
if (warning.tooMany === 0 && typeKey === TypeKey.Resource) {
|
|
29458
|
+
warningStr += ` Did you forget the '${key}' in the bit header?`;
|
|
29459
|
+
}
|
|
29452
29460
|
if (warning.tooMany > 0) warningStr += " The earlier ones will be ignored";
|
|
29453
29461
|
} else if (warning.extraProperty) {
|
|
29454
29462
|
warningStr = `${keyStr} is an unknown property. It can be excluded from the output using the 'excludeUnknownProperties' flag`;
|
|
@@ -31221,7 +31229,6 @@ function extractAvatarImage(context, resources) {
|
|
|
31221
31229
|
}
|
|
31222
31230
|
}
|
|
31223
31231
|
if (excessResources.length > 0) {
|
|
31224
|
-
context.parser.excessResources = excessResources;
|
|
31225
31232
|
context.addWarning(
|
|
31226
31233
|
`${excessResources.length} excess resource(s) present in the [@person] chain.`
|
|
31227
31234
|
);
|
|
@@ -31494,9 +31501,10 @@ function buildResources(context, resourceTypeAttachment, resources) {
|
|
|
31494
31501
|
`Resource type [&${resourceTypeAttachment}] is specified in the bit header, but no such resource is present`
|
|
31495
31502
|
);
|
|
31496
31503
|
}
|
|
31497
|
-
|
|
31498
|
-
|
|
31499
|
-
|
|
31504
|
+
excessResources.forEach((r) => {
|
|
31505
|
+
r.__excessResource = true;
|
|
31506
|
+
filteredResources.push(r);
|
|
31507
|
+
});
|
|
31500
31508
|
return filteredResources;
|
|
31501
31509
|
}
|
|
31502
31510
|
function resourceContentProcessor(context, _contentDepth, tagsConfig, content, target) {
|