@gmb/bitmark-parser-generator 5.13.0 → 5.15.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 +106 -4
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +13 -0
- package/dist/browser/esm/index.d.ts +13 -0
- package/dist/browser/esm/index.js +106 -4
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/cli/main.js +106 -4
- package/dist/cli/main.js.map +1 -1
- package/dist/index.cjs +106 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +106 -4
- 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 [4 Mar 2026 at 05: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/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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=" 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":1284160,"parsedSize":562059,"gzipSize":108822,"groups":[{"label":"dist/browser/cjs","path":"./dist/browser/cjs","statSize":1278098,"groups":[{"id":922,"label":"index.cjs","path":"./dist/browser/cjs/index.cjs","statSize":1278098,"parsedSize":561955,"gzipSize":108822}],"parsedSize":561955,"gzipSize":108822},{"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}}];
|
|
35
35
|
window.entrypoints = ["main"];
|
|
36
36
|
window.defaultSizes = "stat";
|
|
37
37
|
window.compressionAlgorithm = "gzip";
|
|
@@ -94,6 +94,8 @@ var BitType = {
|
|
|
94
94
|
appFlashcardsQuiz: "app-flashcards-quiz",
|
|
95
95
|
appGetScreenshot: "app-get-screenshot",
|
|
96
96
|
appLink: "app-link",
|
|
97
|
+
appRag: "app-rag",
|
|
98
|
+
appSearch: "app-search",
|
|
97
99
|
article: "article",
|
|
98
100
|
articleAi: "article-ai",
|
|
99
101
|
articleAlt: "article-alt",
|
|
@@ -1256,6 +1258,7 @@ var propertyKeys = {
|
|
|
1256
1258
|
property_availableClassifications: "@availableClassifications",
|
|
1257
1259
|
property_brandColor: "@brandColor",
|
|
1258
1260
|
property_brandColorName: "@brandColorName",
|
|
1261
|
+
property_backgroundImage: "@backgroundImage",
|
|
1259
1262
|
property_blockId: "@blockId",
|
|
1260
1263
|
property_book: "@book",
|
|
1261
1264
|
property_bookAlias: "@bookAlias",
|
|
@@ -1552,7 +1555,8 @@ var resourceKeys = {
|
|
|
1552
1555
|
resource_imagePlaceholder: "&imagePlaceholder",
|
|
1553
1556
|
resource_previewImage: "&previewImage",
|
|
1554
1557
|
resource_previewVideo: "&previewVideo",
|
|
1555
|
-
resource_coverImage: "&coverImage"
|
|
1558
|
+
resource_coverImage: "&coverImage",
|
|
1559
|
+
resource_backgroundImage: "&backgroundImage"
|
|
1556
1560
|
};
|
|
1557
1561
|
|
|
1558
1562
|
// src/model/enum/ResourceType.ts
|
|
@@ -1782,7 +1786,8 @@ var ResourceType = {
|
|
|
1782
1786
|
platformBackgroundImage: "platformBackgroundImage",
|
|
1783
1787
|
previewImage: "previewImage",
|
|
1784
1788
|
previewVideo: "previewVideo",
|
|
1785
|
-
coverImage: "coverImage"
|
|
1789
|
+
coverImage: "coverImage",
|
|
1790
|
+
backgroundImage: "backgroundImage"
|
|
1786
1791
|
};
|
|
1787
1792
|
function resourceTypeToConfigKey(type) {
|
|
1788
1793
|
return `&${stringUtils.kebabToCamel(type)}`;
|
|
@@ -3824,6 +3829,22 @@ var GROUPS = {
|
|
|
3824
3829
|
}
|
|
3825
3830
|
]
|
|
3826
3831
|
},
|
|
3832
|
+
{
|
|
3833
|
+
key: ConfigKey.property_backgroundImage,
|
|
3834
|
+
description: "The background image(s) of the book",
|
|
3835
|
+
format: TagFormat.plainText,
|
|
3836
|
+
maxCount: Count.infinity
|
|
3837
|
+
},
|
|
3838
|
+
{
|
|
3839
|
+
key: ConfigKey.resource_backgroundImage,
|
|
3840
|
+
description: "The background image of the book",
|
|
3841
|
+
chain: [
|
|
3842
|
+
{
|
|
3843
|
+
key: ConfigKey.group_resourceImageCommon,
|
|
3844
|
+
description: "Common image properties for the background image resource"
|
|
3845
|
+
}
|
|
3846
|
+
]
|
|
3847
|
+
},
|
|
3827
3848
|
{
|
|
3828
3849
|
key: ConfigKey.property_coverColor,
|
|
3829
3850
|
description: "The cover color of the book",
|
|
@@ -5045,6 +5066,16 @@ var BITS = {
|
|
|
5045
5066
|
],
|
|
5046
5067
|
resourceAttachmentAllowed: false
|
|
5047
5068
|
},
|
|
5069
|
+
[BitType.appRag]: {
|
|
5070
|
+
since: "5.14.0",
|
|
5071
|
+
baseBitType: BitType.article,
|
|
5072
|
+
description: "App RAG (Retrieval-Augmented Generation) bit, equal to article"
|
|
5073
|
+
},
|
|
5074
|
+
[BitType.appSearch]: {
|
|
5075
|
+
since: "5.14.0",
|
|
5076
|
+
baseBitType: BitType.article,
|
|
5077
|
+
description: "App search bit, equal to article"
|
|
5078
|
+
},
|
|
5048
5079
|
[BitType.author]: {
|
|
5049
5080
|
since: "4.2.0",
|
|
5050
5081
|
baseBitType: BitType._standard,
|
|
@@ -10936,7 +10967,7 @@ var instance2 = new Config();
|
|
|
10936
10967
|
// src/generated/package_info.ts
|
|
10937
10968
|
var PACKAGE_INFO = {
|
|
10938
10969
|
"name": "@gmb/bitmark-parser-generator",
|
|
10939
|
-
"version": "5.
|
|
10970
|
+
"version": "5.15.0",
|
|
10940
10971
|
"author": "Get More Brain Ltd",
|
|
10941
10972
|
"license": "ISC",
|
|
10942
10973
|
"description": "A bitmark parser and generator using Peggy.js"
|
|
@@ -11326,6 +11357,8 @@ var NodeType = {
|
|
|
11326
11357
|
avatarImage: "avatarImage",
|
|
11327
11358
|
backgroundWallpaper: "backgroundWallpaper",
|
|
11328
11359
|
backgroundWallpaperValue: "backgroundWallpaperValue",
|
|
11360
|
+
backgroundImage: "backgroundImage",
|
|
11361
|
+
backgroundImageValue: "backgroundImageValue",
|
|
11329
11362
|
bitLevel: "bitLevel",
|
|
11330
11363
|
// bit level
|
|
11331
11364
|
bitmarkAst: "bitmarkAst",
|
|
@@ -23630,6 +23663,7 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23630
23663
|
case ResourceType.platformBackgroundImage:
|
|
23631
23664
|
case ResourceType.previewImage:
|
|
23632
23665
|
case ResourceType.coverImage:
|
|
23666
|
+
case ResourceType.backgroundImage:
|
|
23633
23667
|
node = this.imageResource(context, finalData, type);
|
|
23634
23668
|
break;
|
|
23635
23669
|
// case ResourceType.imageResponsive: {
|
|
@@ -24909,6 +24943,12 @@ var Builder = class extends BaseBuilder {
|
|
|
24909
24943
|
data.coverColor,
|
|
24910
24944
|
options
|
|
24911
24945
|
),
|
|
24946
|
+
backgroundImage: typeof data.backgroundImage === "string" || Array.isArray(data.backgroundImage) ? this.toAstProperty(
|
|
24947
|
+
bitType,
|
|
24948
|
+
ConfigKey.property_backgroundImage,
|
|
24949
|
+
instance4.asArray(data.backgroundImage),
|
|
24950
|
+
options
|
|
24951
|
+
) : this.toImageResource(context, data.backgroundImage),
|
|
24912
24952
|
publications: this.toAstProperty(
|
|
24913
24953
|
bitType,
|
|
24914
24954
|
ConfigKey.property_publications,
|
|
@@ -28982,6 +29022,62 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
28982
29022
|
ignoreTrue: propertyConfig.defaultValue === "true"
|
|
28983
29023
|
});
|
|
28984
29024
|
}
|
|
29025
|
+
// bitmarkAst -> bits -> bitsValue -> backgroundImage (when it's a resource object or property array)
|
|
29026
|
+
enter_backgroundImage(node, route) {
|
|
29027
|
+
const value = node.value;
|
|
29028
|
+
if (value && typeof value === "object" && !Array.isArray(value) && "type" in value) {
|
|
29029
|
+
const resource = value;
|
|
29030
|
+
this.writeNL();
|
|
29031
|
+
this.writePropertyStyleResource(node.key, resource);
|
|
29032
|
+
return true;
|
|
29033
|
+
}
|
|
29034
|
+
if (Array.isArray(value)) {
|
|
29035
|
+
if (value == null) return true;
|
|
29036
|
+
const parent = this.getParentNode(route);
|
|
29037
|
+
if (parent?.key !== NodeType.bitsValue) return true;
|
|
29038
|
+
const bitType = this.getBitType(route);
|
|
29039
|
+
if (!bitType) return true;
|
|
29040
|
+
const config = instance2.getBitConfig(bitType);
|
|
29041
|
+
const propertyConfig = instance2.getTagConfigForTag(
|
|
29042
|
+
config.tags,
|
|
29043
|
+
ConfigKey.property_backgroundImage
|
|
29044
|
+
);
|
|
29045
|
+
if (!propertyConfig) return true;
|
|
29046
|
+
this.writeNL_IfNotChain(route);
|
|
29047
|
+
this.writeProperty(propertyConfig.tag, value, route, {
|
|
29048
|
+
format: propertyConfig.format ?? TagFormat.plainText,
|
|
29049
|
+
array: propertyConfig.array ?? false,
|
|
29050
|
+
writeEmpty: true,
|
|
29051
|
+
ignoreFalse: propertyConfig.defaultValue === "false",
|
|
29052
|
+
ignoreTrue: propertyConfig.defaultValue === "true"
|
|
29053
|
+
});
|
|
29054
|
+
}
|
|
29055
|
+
return true;
|
|
29056
|
+
}
|
|
29057
|
+
// bitmarkAst -> bits -> bitsValue -> backgroundImage (when it's a property string)
|
|
29058
|
+
// This is called when backgroundImage is a simple string value
|
|
29059
|
+
leaf_backgroundImage(node, route) {
|
|
29060
|
+
const value = node.value;
|
|
29061
|
+
if (value == null) return;
|
|
29062
|
+
const parent = this.getParentNode(route);
|
|
29063
|
+
if (parent?.key !== NodeType.bitsValue) return;
|
|
29064
|
+
const bitType = this.getBitType(route);
|
|
29065
|
+
if (!bitType) return;
|
|
29066
|
+
const config = instance2.getBitConfig(bitType);
|
|
29067
|
+
const propertyConfig = instance2.getTagConfigForTag(
|
|
29068
|
+
config.tags,
|
|
29069
|
+
ConfigKey.property_backgroundImage
|
|
29070
|
+
);
|
|
29071
|
+
if (!propertyConfig) return;
|
|
29072
|
+
this.writeNL_IfNotChain(route);
|
|
29073
|
+
this.writeProperty(propertyConfig.tag, node.value, route, {
|
|
29074
|
+
format: propertyConfig.format ?? TagFormat.plainText,
|
|
29075
|
+
array: propertyConfig.array ?? false,
|
|
29076
|
+
writeEmpty: true,
|
|
29077
|
+
ignoreFalse: propertyConfig.defaultValue === "false",
|
|
29078
|
+
ignoreTrue: propertyConfig.defaultValue === "true"
|
|
29079
|
+
});
|
|
29080
|
+
}
|
|
28985
29081
|
exit_imagePlaceholder(_node, _route) {
|
|
28986
29082
|
}
|
|
28987
29083
|
// bitmarkAst -> bits -> bitsValue -> posterImage
|
|
@@ -30595,6 +30691,12 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
30595
30691
|
array: Array.isArray(node.value)
|
|
30596
30692
|
});
|
|
30597
30693
|
}
|
|
30694
|
+
// bitmarkAst -> bits -> bitsValue -> backgroundImage
|
|
30695
|
+
enter_backgroundImage(node, route) {
|
|
30696
|
+
return this.standardHandler(node, route, NodeType.bitsValue, {
|
|
30697
|
+
array: Array.isArray(node.value)
|
|
30698
|
+
});
|
|
30699
|
+
}
|
|
30598
30700
|
// bitmarkAst -> bits -> bitsValue -> resources
|
|
30599
30701
|
enter_resources(node, route) {
|
|
30600
30702
|
const resources = node.value;
|
|
@@ -35045,7 +35147,7 @@ function resourceContentProcessor(context, _contentDepth, tagsConfig, content, t
|
|
|
35045
35147
|
...tags2
|
|
35046
35148
|
});
|
|
35047
35149
|
if (resource) {
|
|
35048
|
-
if (configKey === ConfigKey.resource_backgroundWallpaper || configKey === ConfigKey.resource_imagePlaceholder || configKey === ConfigKey.resource_platformIcon || configKey === ConfigKey.resource_platformLogo || configKey === ConfigKey.resource_platformBackgroundImage || configKey === ConfigKey.resource_previewImage || configKey === ConfigKey.resource_previewVideo || configKey === ConfigKey.resource_coverImage) {
|
|
35150
|
+
if (configKey === ConfigKey.resource_backgroundWallpaper || configKey === ConfigKey.resource_imagePlaceholder || configKey === ConfigKey.resource_platformIcon || configKey === ConfigKey.resource_platformLogo || configKey === ConfigKey.resource_platformBackgroundImage || configKey === ConfigKey.resource_previewImage || configKey === ConfigKey.resource_previewVideo || configKey === ConfigKey.resource_coverImage || configKey === ConfigKey.resource_backgroundImage) {
|
|
35049
35151
|
if (target.propertyStyleResources) {
|
|
35050
35152
|
if (target.propertyStyleResources[resourceType]) {
|
|
35051
35153
|
if (!Array.isArray(target.propertyStyleResources[resourceType])) {
|