@gmb/bitmark-parser-generator 5.14.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 +94 -4
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +11 -0
- package/dist/browser/esm/index.d.ts +11 -0
- package/dist/browser/esm/index.js +94 -4
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/cli/main.js +94 -4
- package/dist/cli/main.js.map +1 -1
- package/dist/index.cjs +94 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +94 -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";
|
|
@@ -1258,6 +1258,7 @@ var propertyKeys = {
|
|
|
1258
1258
|
property_availableClassifications: "@availableClassifications",
|
|
1259
1259
|
property_brandColor: "@brandColor",
|
|
1260
1260
|
property_brandColorName: "@brandColorName",
|
|
1261
|
+
property_backgroundImage: "@backgroundImage",
|
|
1261
1262
|
property_blockId: "@blockId",
|
|
1262
1263
|
property_book: "@book",
|
|
1263
1264
|
property_bookAlias: "@bookAlias",
|
|
@@ -1554,7 +1555,8 @@ var resourceKeys = {
|
|
|
1554
1555
|
resource_imagePlaceholder: "&imagePlaceholder",
|
|
1555
1556
|
resource_previewImage: "&previewImage",
|
|
1556
1557
|
resource_previewVideo: "&previewVideo",
|
|
1557
|
-
resource_coverImage: "&coverImage"
|
|
1558
|
+
resource_coverImage: "&coverImage",
|
|
1559
|
+
resource_backgroundImage: "&backgroundImage"
|
|
1558
1560
|
};
|
|
1559
1561
|
|
|
1560
1562
|
// src/model/enum/ResourceType.ts
|
|
@@ -1784,7 +1786,8 @@ var ResourceType = {
|
|
|
1784
1786
|
platformBackgroundImage: "platformBackgroundImage",
|
|
1785
1787
|
previewImage: "previewImage",
|
|
1786
1788
|
previewVideo: "previewVideo",
|
|
1787
|
-
coverImage: "coverImage"
|
|
1789
|
+
coverImage: "coverImage",
|
|
1790
|
+
backgroundImage: "backgroundImage"
|
|
1788
1791
|
};
|
|
1789
1792
|
function resourceTypeToConfigKey(type) {
|
|
1790
1793
|
return `&${stringUtils.kebabToCamel(type)}`;
|
|
@@ -3826,6 +3829,22 @@ var GROUPS = {
|
|
|
3826
3829
|
}
|
|
3827
3830
|
]
|
|
3828
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
|
+
},
|
|
3829
3848
|
{
|
|
3830
3849
|
key: ConfigKey.property_coverColor,
|
|
3831
3850
|
description: "The cover color of the book",
|
|
@@ -10948,7 +10967,7 @@ var instance2 = new Config();
|
|
|
10948
10967
|
// src/generated/package_info.ts
|
|
10949
10968
|
var PACKAGE_INFO = {
|
|
10950
10969
|
"name": "@gmb/bitmark-parser-generator",
|
|
10951
|
-
"version": "5.
|
|
10970
|
+
"version": "5.15.0",
|
|
10952
10971
|
"author": "Get More Brain Ltd",
|
|
10953
10972
|
"license": "ISC",
|
|
10954
10973
|
"description": "A bitmark parser and generator using Peggy.js"
|
|
@@ -11338,6 +11357,8 @@ var NodeType = {
|
|
|
11338
11357
|
avatarImage: "avatarImage",
|
|
11339
11358
|
backgroundWallpaper: "backgroundWallpaper",
|
|
11340
11359
|
backgroundWallpaperValue: "backgroundWallpaperValue",
|
|
11360
|
+
backgroundImage: "backgroundImage",
|
|
11361
|
+
backgroundImageValue: "backgroundImageValue",
|
|
11341
11362
|
bitLevel: "bitLevel",
|
|
11342
11363
|
// bit level
|
|
11343
11364
|
bitmarkAst: "bitmarkAst",
|
|
@@ -23642,6 +23663,7 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23642
23663
|
case ResourceType.platformBackgroundImage:
|
|
23643
23664
|
case ResourceType.previewImage:
|
|
23644
23665
|
case ResourceType.coverImage:
|
|
23666
|
+
case ResourceType.backgroundImage:
|
|
23645
23667
|
node = this.imageResource(context, finalData, type);
|
|
23646
23668
|
break;
|
|
23647
23669
|
// case ResourceType.imageResponsive: {
|
|
@@ -24921,6 +24943,12 @@ var Builder = class extends BaseBuilder {
|
|
|
24921
24943
|
data.coverColor,
|
|
24922
24944
|
options
|
|
24923
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),
|
|
24924
24952
|
publications: this.toAstProperty(
|
|
24925
24953
|
bitType,
|
|
24926
24954
|
ConfigKey.property_publications,
|
|
@@ -28994,6 +29022,62 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
28994
29022
|
ignoreTrue: propertyConfig.defaultValue === "true"
|
|
28995
29023
|
});
|
|
28996
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
|
+
}
|
|
28997
29081
|
exit_imagePlaceholder(_node, _route) {
|
|
28998
29082
|
}
|
|
28999
29083
|
// bitmarkAst -> bits -> bitsValue -> posterImage
|
|
@@ -30607,6 +30691,12 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
30607
30691
|
array: Array.isArray(node.value)
|
|
30608
30692
|
});
|
|
30609
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
|
+
}
|
|
30610
30700
|
// bitmarkAst -> bits -> bitsValue -> resources
|
|
30611
30701
|
enter_resources(node, route) {
|
|
30612
30702
|
const resources = node.value;
|
|
@@ -35057,7 +35147,7 @@ function resourceContentProcessor(context, _contentDepth, tagsConfig, content, t
|
|
|
35057
35147
|
...tags2
|
|
35058
35148
|
});
|
|
35059
35149
|
if (resource) {
|
|
35060
|
-
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) {
|
|
35061
35151
|
if (target.propertyStyleResources) {
|
|
35062
35152
|
if (target.propertyStyleResources[resourceType]) {
|
|
35063
35153
|
if (!Array.isArray(target.propertyStyleResources[resourceType])) {
|