@gmb/bitmark-parser-generator 4.16.0 → 4.17.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 +151 -62
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +55 -4
- package/dist/browser/esm/index.d.ts +55 -4
- package/dist/browser/esm/index.js +151 -62
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/index.cjs +363 -301
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +55 -4
- package/dist/index.d.ts +55 -4
- package/dist/index.js +363 -301
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -246,8 +246,8 @@ var BitType = superenum({
|
|
|
246
246
|
extractorAiChat: "extractor-ai-chat",
|
|
247
247
|
extractorBlock: "extractor-block",
|
|
248
248
|
extractorConfiguration: "extractor-configuration",
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
extractorImage: "extractor-image",
|
|
250
|
+
extractorImageCollapsible: "extractor-image-collapsible",
|
|
251
251
|
extractorInformation: "extractor-information",
|
|
252
252
|
extractorPage: "extractor-page",
|
|
253
253
|
extractorPageCollapsible: "extractor-page-collapsible",
|
|
@@ -1269,6 +1269,7 @@ var propertyKeys = {
|
|
|
1269
1269
|
// Deprecated, replaced by person
|
|
1270
1270
|
property_path: "@path",
|
|
1271
1271
|
property_platformBackgroundColor: "@platformBackgroundColor",
|
|
1272
|
+
property_platformBorderColor: "@platformBorderColor",
|
|
1272
1273
|
property_platformBrandTarget: "@platformBrandTarget",
|
|
1273
1274
|
property_platformButtonBackgroundColor: "@platformButtonBackgroundColor",
|
|
1274
1275
|
property_platformButtonPrimaryColor: "@platformButtonPrimaryColor",
|
|
@@ -1279,6 +1280,8 @@ var propertyKeys = {
|
|
|
1279
1280
|
property_platformScrollbarColor: "@platformScrollbarColor",
|
|
1280
1281
|
property_platformSecondaryColor: "@platformSecondaryColor",
|
|
1281
1282
|
property_platformSelectionColor: "@platformSelectionColor",
|
|
1283
|
+
property_platformSelectionTextColor: "@platformSelectionTextColor",
|
|
1284
|
+
property_platformBaseLayerColor: "@platformBaseLayerColor",
|
|
1282
1285
|
property_platformSeparatorColor: "@platformSeparatorColor",
|
|
1283
1286
|
property_platformTextSelectionColor: "@platformTextSelectionColor",
|
|
1284
1287
|
property_person: "@person",
|
|
@@ -1323,6 +1326,7 @@ var propertyKeys = {
|
|
|
1323
1326
|
property_scormSource: "@scormSource",
|
|
1324
1327
|
property_search: "@search",
|
|
1325
1328
|
property_searchIndex: "@searchIndex",
|
|
1329
|
+
property_selected: "@selected",
|
|
1326
1330
|
property_servings: "@servings",
|
|
1327
1331
|
property_showInIndex: "@showInIndex",
|
|
1328
1332
|
property_showSubtitles: "@showSubtitles",
|
|
@@ -3527,6 +3531,21 @@ var GROUPS = {
|
|
|
3527
3531
|
key: ConfigKey.property_platformMessageBackgroundColor,
|
|
3528
3532
|
description: "The platform section chat message background color",
|
|
3529
3533
|
format: TagFormat.plainText
|
|
3534
|
+
},
|
|
3535
|
+
{
|
|
3536
|
+
key: ConfigKey.property_platformBorderColor,
|
|
3537
|
+
description: "The platform border color",
|
|
3538
|
+
format: TagFormat.plainText
|
|
3539
|
+
},
|
|
3540
|
+
{
|
|
3541
|
+
key: ConfigKey.property_platformSelectionTextColor,
|
|
3542
|
+
description: "The platform selection text color",
|
|
3543
|
+
format: TagFormat.plainText
|
|
3544
|
+
},
|
|
3545
|
+
{
|
|
3546
|
+
key: ConfigKey.property_platformBaseLayerColor,
|
|
3547
|
+
description: "The platform base layer color",
|
|
3548
|
+
format: TagFormat.plainText
|
|
3530
3549
|
}
|
|
3531
3550
|
]
|
|
3532
3551
|
},
|
|
@@ -3601,6 +3620,12 @@ var GROUPS = {
|
|
|
3601
3620
|
description: "The search text for the resource",
|
|
3602
3621
|
format: TagFormat.plainText
|
|
3603
3622
|
},
|
|
3623
|
+
{
|
|
3624
|
+
key: ConfigKey.property_selected,
|
|
3625
|
+
description: "If true, the resource is selected",
|
|
3626
|
+
format: TagFormat.boolean,
|
|
3627
|
+
defaultValue: "false"
|
|
3628
|
+
},
|
|
3604
3629
|
{
|
|
3605
3630
|
key: ConfigKey.property_srcAlt,
|
|
3606
3631
|
description: "An alternative source for the resource",
|
|
@@ -7103,7 +7128,7 @@ var BITS = {
|
|
|
7103
7128
|
description: "Extractor configuration bit, used to configure extractors in articles or books",
|
|
7104
7129
|
textFormatDefault: TextFormat.plainText
|
|
7105
7130
|
},
|
|
7106
|
-
[BitType.
|
|
7131
|
+
[BitType.extractorImage]: {
|
|
7107
7132
|
since: "4.3.0",
|
|
7108
7133
|
baseBitType: BitType._standard,
|
|
7109
7134
|
description: "Extractor images bit, used for images extracted from PDFs",
|
|
@@ -7123,9 +7148,9 @@ var BITS = {
|
|
|
7123
7148
|
resourceAttachmentAllowed: false,
|
|
7124
7149
|
textFormatDefault: TextFormat.plainText
|
|
7125
7150
|
},
|
|
7126
|
-
[BitType.
|
|
7151
|
+
[BitType.extractorImageCollapsible]: {
|
|
7127
7152
|
since: "4.3.0",
|
|
7128
|
-
baseBitType: BitType.
|
|
7153
|
+
baseBitType: BitType.extractorImage,
|
|
7129
7154
|
description: "Collapsible extractor images bit, used for images extracted from PDFs"
|
|
7130
7155
|
},
|
|
7131
7156
|
[BitType.extractorInformation]: {
|
|
@@ -10130,7 +10155,7 @@ var instance2 = new Config();
|
|
|
10130
10155
|
// src/generated/package_info.ts
|
|
10131
10156
|
var PACKAGE_INFO = {
|
|
10132
10157
|
"name": "@gmb/bitmark-parser-generator",
|
|
10133
|
-
"version": "4.
|
|
10158
|
+
"version": "4.17.0",
|
|
10134
10159
|
"author": "Get More Brain Ltd",
|
|
10135
10160
|
"license": "ISC",
|
|
10136
10161
|
"description": "A bitmark parser and generator using Peggy.js"
|
|
@@ -10886,6 +10911,12 @@ var NodeType = superenum20({
|
|
|
10886
10911
|
platformMessageBackgroundColorValue: "platformMessageBackgroundColorValue",
|
|
10887
10912
|
platformBackgroundImage: "platformBackgroundImage",
|
|
10888
10913
|
platformBackgroundImageValue: "platformBackgroundImageValue",
|
|
10914
|
+
platformBorderColor: "platformBorderColor",
|
|
10915
|
+
platformBorderColorValue: "platformBorderColorValue",
|
|
10916
|
+
platformSelectionTextColor: "platformSelectionTextColor",
|
|
10917
|
+
platformSelectionTextColorValue: "platformSelectionTextColorValue",
|
|
10918
|
+
platformBaseLayerColor: "platformBaseLayerColor",
|
|
10919
|
+
platformBaseLayerColorValue: "platformBaseLayerColorValue",
|
|
10889
10920
|
person: "person",
|
|
10890
10921
|
pointerLeft: "pointerLeft",
|
|
10891
10922
|
pointerLeftValue: "pointerLeftValue",
|
|
@@ -11001,6 +11032,7 @@ var NodeType = superenum20({
|
|
|
11001
11032
|
searchValue: "searchValue",
|
|
11002
11033
|
section: "section",
|
|
11003
11034
|
select: "select",
|
|
11035
|
+
selected: "selected",
|
|
11004
11036
|
servings: "servings",
|
|
11005
11037
|
servingsValue: "servingsValue",
|
|
11006
11038
|
showInIndex: "showInIndex",
|
|
@@ -22463,7 +22495,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22463
22495
|
license: data.license,
|
|
22464
22496
|
copyright: data.copyright,
|
|
22465
22497
|
showInIndex: data.showInIndex,
|
|
22466
|
-
search: data.search
|
|
22498
|
+
search: data.search,
|
|
22499
|
+
selected: data.selected
|
|
22467
22500
|
});
|
|
22468
22501
|
return node;
|
|
22469
22502
|
}
|
|
@@ -22628,7 +22661,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22628
22661
|
copyright,
|
|
22629
22662
|
showInIndex,
|
|
22630
22663
|
caption,
|
|
22631
|
-
search
|
|
22664
|
+
search,
|
|
22665
|
+
selected
|
|
22632
22666
|
} = data;
|
|
22633
22667
|
const { bitType } = context;
|
|
22634
22668
|
let zoomDisabledDefault = false;
|
|
@@ -22637,7 +22671,7 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22637
22671
|
BitType.pageBanner,
|
|
22638
22672
|
BitType.imagesLogoGrave,
|
|
22639
22673
|
BitType.prototypeImages,
|
|
22640
|
-
BitType.
|
|
22674
|
+
BitType.extractorImage
|
|
22641
22675
|
])) {
|
|
22642
22676
|
zoomDisabledDefault = true;
|
|
22643
22677
|
}
|
|
@@ -22662,11 +22696,12 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22662
22696
|
copyright: copyright ?? "",
|
|
22663
22697
|
showInIndex: showInIndex ?? false,
|
|
22664
22698
|
caption: this.handleJsonText(context, TextLocation.tag, caption),
|
|
22665
|
-
search: search ?? void 0
|
|
22699
|
+
search: search ?? void 0,
|
|
22700
|
+
selected: selected ?? false
|
|
22666
22701
|
}
|
|
22667
22702
|
};
|
|
22668
22703
|
objectUtils.removeUnwantedProperties(node.image, {
|
|
22669
|
-
ignoreFalse: ["zoomDisabled", "showInIndex"],
|
|
22704
|
+
ignoreFalse: ["zoomDisabled", "showInIndex", "selected"],
|
|
22670
22705
|
ignoreEmptyArrays: ["caption"],
|
|
22671
22706
|
ignoreUndefined: ["width", "height"],
|
|
22672
22707
|
ignoreEmptyString: ["src", "alt", "license", "copyright"]
|
|
@@ -22695,7 +22730,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22695
22730
|
copyright,
|
|
22696
22731
|
showInIndex,
|
|
22697
22732
|
caption,
|
|
22698
|
-
search
|
|
22733
|
+
search,
|
|
22734
|
+
selected
|
|
22699
22735
|
} = data;
|
|
22700
22736
|
const node = {
|
|
22701
22737
|
type: ResourceType.imageLink,
|
|
@@ -22720,11 +22756,12 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22720
22756
|
copyright: copyright ?? "",
|
|
22721
22757
|
showInIndex: showInIndex ?? false,
|
|
22722
22758
|
caption: this.handleJsonText(context, TextLocation.tag, caption),
|
|
22723
|
-
search: search ?? void 0
|
|
22759
|
+
search: search ?? void 0,
|
|
22760
|
+
selected: selected ?? false
|
|
22724
22761
|
}
|
|
22725
22762
|
};
|
|
22726
22763
|
objectUtils.removeUnwantedProperties(node.imageLink, {
|
|
22727
|
-
ignoreFalse: ["zoomDisabled", "showInIndex"],
|
|
22764
|
+
ignoreFalse: ["zoomDisabled", "showInIndex", "selected"],
|
|
22728
22765
|
ignoreEmptyArrays: ["caption"],
|
|
22729
22766
|
ignoreUndefined: ["width", "height"],
|
|
22730
22767
|
ignoreEmptyString: ["url", "alt", "license", "copyright"]
|
|
@@ -22748,7 +22785,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22748
22785
|
copyright,
|
|
22749
22786
|
showInIndex,
|
|
22750
22787
|
caption,
|
|
22751
|
-
search
|
|
22788
|
+
search,
|
|
22789
|
+
selected
|
|
22752
22790
|
} = data;
|
|
22753
22791
|
const node = {
|
|
22754
22792
|
type: ResourceType.audio,
|
|
@@ -22766,13 +22804,14 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22766
22804
|
copyright: copyright ?? "",
|
|
22767
22805
|
showInIndex: showInIndex ?? false,
|
|
22768
22806
|
caption: this.handleJsonText(context, TextLocation.tag, caption),
|
|
22769
|
-
search: search ?? void 0
|
|
22807
|
+
search: search ?? void 0,
|
|
22808
|
+
selected: selected ?? false
|
|
22770
22809
|
}
|
|
22771
22810
|
};
|
|
22772
22811
|
objectUtils.removeUnwantedProperties(node.audio, {
|
|
22773
22812
|
ignoreEmptyArrays: ["caption"],
|
|
22774
22813
|
ignoreEmptyString: ["src", "alt", "license", "copyright"],
|
|
22775
|
-
ignoreFalse: ["showInIndex"]
|
|
22814
|
+
ignoreFalse: ["showInIndex", "selected"]
|
|
22776
22815
|
});
|
|
22777
22816
|
return nodeValidator.validateResource(node);
|
|
22778
22817
|
}
|
|
@@ -22793,7 +22832,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22793
22832
|
copyright,
|
|
22794
22833
|
showInIndex,
|
|
22795
22834
|
caption,
|
|
22796
|
-
search
|
|
22835
|
+
search,
|
|
22836
|
+
selected
|
|
22797
22837
|
} = data;
|
|
22798
22838
|
const node = {
|
|
22799
22839
|
type: ResourceType.audioEmbed,
|
|
@@ -22811,7 +22851,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22811
22851
|
copyright: copyright ?? "",
|
|
22812
22852
|
showInIndex: showInIndex ?? false,
|
|
22813
22853
|
caption: this.handleJsonText(context, TextLocation.tag, caption),
|
|
22814
|
-
search: search ?? void 0
|
|
22854
|
+
search: search ?? void 0,
|
|
22855
|
+
selected: selected ?? false
|
|
22815
22856
|
}
|
|
22816
22857
|
};
|
|
22817
22858
|
objectUtils.removeUnwantedProperties(node.audioEmbed, {
|
|
@@ -22822,7 +22863,7 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22822
22863
|
"license",
|
|
22823
22864
|
"copyright"
|
|
22824
22865
|
],
|
|
22825
|
-
ignoreFalse: ["showInIndex"]
|
|
22866
|
+
ignoreFalse: ["showInIndex", "selected"]
|
|
22826
22867
|
});
|
|
22827
22868
|
return nodeValidator.validateResource(node);
|
|
22828
22869
|
}
|
|
@@ -22843,7 +22884,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22843
22884
|
copyright,
|
|
22844
22885
|
showInIndex,
|
|
22845
22886
|
caption,
|
|
22846
|
-
search
|
|
22887
|
+
search,
|
|
22888
|
+
selected
|
|
22847
22889
|
} = data;
|
|
22848
22890
|
const node = {
|
|
22849
22891
|
type: ResourceType.audioLink,
|
|
@@ -22862,7 +22904,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22862
22904
|
copyright: copyright ?? "",
|
|
22863
22905
|
showInIndex: showInIndex ?? false,
|
|
22864
22906
|
caption: this.handleJsonText(context, TextLocation.tag, caption),
|
|
22865
|
-
search: search ?? void 0
|
|
22907
|
+
search: search ?? void 0,
|
|
22908
|
+
selected: selected ?? false
|
|
22866
22909
|
}
|
|
22867
22910
|
};
|
|
22868
22911
|
objectUtils.removeUnwantedProperties(node.audioLink, {
|
|
@@ -22870,7 +22913,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22870
22913
|
ignoreEmptyString: [
|
|
22871
22914
|
"url"
|
|
22872
22915
|
/*'alt', 'license', 'copyright'*/
|
|
22873
|
-
]
|
|
22916
|
+
],
|
|
22917
|
+
ignoreFalse: ["selected"]
|
|
22874
22918
|
});
|
|
22875
22919
|
return nodeValidator.validateResource(node);
|
|
22876
22920
|
}
|
|
@@ -22898,7 +22942,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22898
22942
|
copyright,
|
|
22899
22943
|
showInIndex,
|
|
22900
22944
|
caption,
|
|
22901
|
-
search
|
|
22945
|
+
search,
|
|
22946
|
+
selected
|
|
22902
22947
|
} = data;
|
|
22903
22948
|
const node = {
|
|
22904
22949
|
type: ResourceType.video,
|
|
@@ -22922,6 +22967,7 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22922
22967
|
showInIndex: showInIndex ?? false,
|
|
22923
22968
|
caption: this.handleJsonText(context, TextLocation.tag, caption),
|
|
22924
22969
|
search: search ?? void 0,
|
|
22970
|
+
selected: selected ?? false,
|
|
22925
22971
|
// Have sub-chains so must be at end of chain
|
|
22926
22972
|
posterImage: posterImage ?? void 0,
|
|
22927
22973
|
thumbnails: thumbnails ?? void 0
|
|
@@ -22936,7 +22982,7 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22936
22982
|
"license",
|
|
22937
22983
|
"copyright"
|
|
22938
22984
|
],
|
|
22939
|
-
ignoreFalse: ["showInIndex"]
|
|
22985
|
+
ignoreFalse: ["showInIndex", "selected"]
|
|
22940
22986
|
});
|
|
22941
22987
|
return nodeValidator.validateResource(node);
|
|
22942
22988
|
}
|
|
@@ -22964,7 +23010,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22964
23010
|
copyright,
|
|
22965
23011
|
showInIndex,
|
|
22966
23012
|
caption,
|
|
22967
|
-
search
|
|
23013
|
+
search,
|
|
23014
|
+
selected
|
|
22968
23015
|
} = data;
|
|
22969
23016
|
const node = {
|
|
22970
23017
|
type: ResourceType.videoEmbed,
|
|
@@ -22990,7 +23037,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
22990
23037
|
copyright: copyright ?? "",
|
|
22991
23038
|
showInIndex: showInIndex ?? false,
|
|
22992
23039
|
caption: this.handleJsonText(context, TextLocation.tag, caption),
|
|
22993
|
-
search: search ?? void 0
|
|
23040
|
+
search: search ?? void 0,
|
|
23041
|
+
selected: selected ?? false
|
|
22994
23042
|
}
|
|
22995
23043
|
};
|
|
22996
23044
|
objectUtils.removeUnwantedProperties(node.videoEmbed, {
|
|
@@ -23002,7 +23050,7 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23002
23050
|
"license",
|
|
23003
23051
|
"copyright"
|
|
23004
23052
|
],
|
|
23005
|
-
ignoreFalse: ["showInIndex"]
|
|
23053
|
+
ignoreFalse: ["showInIndex", "selected"]
|
|
23006
23054
|
});
|
|
23007
23055
|
return nodeValidator.validateResource(node);
|
|
23008
23056
|
}
|
|
@@ -23030,7 +23078,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23030
23078
|
copyright,
|
|
23031
23079
|
showInIndex,
|
|
23032
23080
|
caption,
|
|
23033
|
-
search
|
|
23081
|
+
search,
|
|
23082
|
+
selected
|
|
23034
23083
|
} = data;
|
|
23035
23084
|
const node = {
|
|
23036
23085
|
type: ResourceType.videoLink,
|
|
@@ -23056,7 +23105,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23056
23105
|
copyright: copyright ?? "",
|
|
23057
23106
|
showInIndex: showInIndex ?? false,
|
|
23058
23107
|
caption: this.handleJsonText(context, TextLocation.tag, caption),
|
|
23059
|
-
search: search ?? void 0
|
|
23108
|
+
search: search ?? void 0,
|
|
23109
|
+
selected: selected ?? false
|
|
23060
23110
|
}
|
|
23061
23111
|
};
|
|
23062
23112
|
objectUtils.removeUnwantedProperties(node.videoLink, {
|
|
@@ -23068,7 +23118,7 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23068
23118
|
"license",
|
|
23069
23119
|
"copyright"
|
|
23070
23120
|
],
|
|
23071
|
-
ignoreFalse: ["showInIndex"]
|
|
23121
|
+
ignoreFalse: ["showInIndex", "selected"]
|
|
23072
23122
|
});
|
|
23073
23123
|
return nodeValidator.validateResource(node);
|
|
23074
23124
|
}
|
|
@@ -23116,7 +23166,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23116
23166
|
copyright,
|
|
23117
23167
|
showInIndex,
|
|
23118
23168
|
caption,
|
|
23119
|
-
search
|
|
23169
|
+
search,
|
|
23170
|
+
selected
|
|
23120
23171
|
} = data;
|
|
23121
23172
|
const node = {
|
|
23122
23173
|
type: ResourceType.stillImageFilmEmbed,
|
|
@@ -23142,7 +23193,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23142
23193
|
copyright: copyright ?? "",
|
|
23143
23194
|
showInIndex: showInIndex ?? false,
|
|
23144
23195
|
caption: this.handleJsonText(context, TextLocation.tag, caption),
|
|
23145
|
-
search: search ?? void 0
|
|
23196
|
+
search: search ?? void 0,
|
|
23197
|
+
selected: selected ?? false
|
|
23146
23198
|
}
|
|
23147
23199
|
};
|
|
23148
23200
|
objectUtils.removeUnwantedProperties(node.stillImageFilmEmbed, {
|
|
@@ -23154,7 +23206,7 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23154
23206
|
"license",
|
|
23155
23207
|
"copyright"
|
|
23156
23208
|
],
|
|
23157
|
-
ignoreFalse: ["showInIndex"]
|
|
23209
|
+
ignoreFalse: ["showInIndex", "selected"]
|
|
23158
23210
|
});
|
|
23159
23211
|
return nodeValidator.validateResource(node);
|
|
23160
23212
|
}
|
|
@@ -23182,7 +23234,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23182
23234
|
copyright,
|
|
23183
23235
|
showInIndex,
|
|
23184
23236
|
caption,
|
|
23185
|
-
search
|
|
23237
|
+
search,
|
|
23238
|
+
selected
|
|
23186
23239
|
} = data;
|
|
23187
23240
|
const node = {
|
|
23188
23241
|
type: ResourceType.stillImageFilmLink,
|
|
@@ -23208,7 +23261,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23208
23261
|
copyright: copyright ?? "",
|
|
23209
23262
|
showInIndex: showInIndex ?? false,
|
|
23210
23263
|
caption: this.handleJsonText(context, TextLocation.tag, caption),
|
|
23211
|
-
search: search ?? void 0
|
|
23264
|
+
search: search ?? void 0,
|
|
23265
|
+
selected: selected ?? false
|
|
23212
23266
|
}
|
|
23213
23267
|
};
|
|
23214
23268
|
objectUtils.removeUnwantedProperties(node.stillImageFilmLink, {
|
|
@@ -23220,7 +23274,7 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23220
23274
|
"license",
|
|
23221
23275
|
"copyright"
|
|
23222
23276
|
],
|
|
23223
|
-
ignoreFalse: ["showInIndex"]
|
|
23277
|
+
ignoreFalse: ["showInIndex", "selected"]
|
|
23224
23278
|
});
|
|
23225
23279
|
return nodeValidator.validateResource(node);
|
|
23226
23280
|
}
|
|
@@ -23231,7 +23285,7 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23231
23285
|
* @returns
|
|
23232
23286
|
*/
|
|
23233
23287
|
articleResource(context, data) {
|
|
23234
|
-
const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
|
|
23288
|
+
const { value, srcAlt, license, copyright, showInIndex, caption, search, selected } = data;
|
|
23235
23289
|
const node = {
|
|
23236
23290
|
type: ResourceType.article,
|
|
23237
23291
|
__typeAlias: ResourceType.article,
|
|
@@ -23245,12 +23299,14 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23245
23299
|
copyright: copyright ?? "",
|
|
23246
23300
|
showInIndex: showInIndex ?? false,
|
|
23247
23301
|
caption: this.handleJsonText(context, TextLocation.tag, caption),
|
|
23248
|
-
search: search ?? void 0
|
|
23302
|
+
search: search ?? void 0,
|
|
23303
|
+
selected: selected ?? false
|
|
23249
23304
|
}
|
|
23250
23305
|
};
|
|
23251
23306
|
objectUtils.removeUnwantedProperties(node.article, {
|
|
23252
23307
|
ignoreEmptyArrays: ["caption"],
|
|
23253
|
-
ignoreEmptyString: ["body", "alt", "license", "copyright"]
|
|
23308
|
+
ignoreEmptyString: ["body", "alt", "license", "copyright"],
|
|
23309
|
+
ignoreFalse: ["selected"]
|
|
23254
23310
|
});
|
|
23255
23311
|
return nodeValidator.validateResource(node);
|
|
23256
23312
|
}
|
|
@@ -23261,7 +23317,7 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23261
23317
|
* @returns
|
|
23262
23318
|
*/
|
|
23263
23319
|
documentResource(context, data) {
|
|
23264
|
-
const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
|
|
23320
|
+
const { value, srcAlt, license, copyright, showInIndex, caption, search, selected } = data;
|
|
23265
23321
|
const node = {
|
|
23266
23322
|
type: ResourceType.document,
|
|
23267
23323
|
__typeAlias: ResourceType.document,
|
|
@@ -23275,13 +23331,14 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23275
23331
|
copyright: copyright ?? "",
|
|
23276
23332
|
showInIndex: showInIndex ?? false,
|
|
23277
23333
|
caption: this.handleJsonText(context, TextLocation.tag, caption),
|
|
23278
|
-
search: search ?? void 0
|
|
23334
|
+
search: search ?? void 0,
|
|
23335
|
+
selected: selected ?? false
|
|
23279
23336
|
}
|
|
23280
23337
|
};
|
|
23281
23338
|
objectUtils.removeUnwantedProperties(node.document, {
|
|
23282
23339
|
ignoreEmptyArrays: ["caption"],
|
|
23283
23340
|
ignoreEmptyString: ["url", "alt", "license", "copyright"],
|
|
23284
|
-
ignoreFalse: ["showInIndex"]
|
|
23341
|
+
ignoreFalse: ["showInIndex", "selected"]
|
|
23285
23342
|
});
|
|
23286
23343
|
return nodeValidator.validateResource(node);
|
|
23287
23344
|
}
|
|
@@ -23292,7 +23349,7 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23292
23349
|
* @returns
|
|
23293
23350
|
*/
|
|
23294
23351
|
documentEmbedResource(context, data) {
|
|
23295
|
-
const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
|
|
23352
|
+
const { value, srcAlt, license, copyright, showInIndex, caption, search, selected } = data;
|
|
23296
23353
|
const node = {
|
|
23297
23354
|
type: ResourceType.documentEmbed,
|
|
23298
23355
|
__typeAlias: ResourceType.documentEmbed,
|
|
@@ -23306,13 +23363,14 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23306
23363
|
copyright: copyright ?? "",
|
|
23307
23364
|
showInIndex: showInIndex ?? false,
|
|
23308
23365
|
caption: this.handleJsonText(context, TextLocation.tag, caption),
|
|
23309
|
-
search: search ?? void 0
|
|
23366
|
+
search: search ?? void 0,
|
|
23367
|
+
selected: selected ?? false
|
|
23310
23368
|
}
|
|
23311
23369
|
};
|
|
23312
23370
|
objectUtils.removeUnwantedProperties(node.documentEmbed, {
|
|
23313
23371
|
ignoreEmptyArrays: ["caption"],
|
|
23314
23372
|
ignoreEmptyString: ["url", "alt", "license", "copyright"],
|
|
23315
|
-
ignoreFalse: ["showInIndex"]
|
|
23373
|
+
ignoreFalse: ["showInIndex", "selected"]
|
|
23316
23374
|
});
|
|
23317
23375
|
return nodeValidator.validateResource(node);
|
|
23318
23376
|
}
|
|
@@ -23323,7 +23381,7 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23323
23381
|
* @returns
|
|
23324
23382
|
*/
|
|
23325
23383
|
documentLinkResource(context, data) {
|
|
23326
|
-
const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
|
|
23384
|
+
const { value, srcAlt, license, copyright, showInIndex, caption, search, selected } = data;
|
|
23327
23385
|
const node = {
|
|
23328
23386
|
type: ResourceType.documentLink,
|
|
23329
23387
|
__typeAlias: ResourceType.documentLink,
|
|
@@ -23337,13 +23395,14 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23337
23395
|
copyright: copyright ?? "",
|
|
23338
23396
|
showInIndex: showInIndex ?? false,
|
|
23339
23397
|
caption: this.handleJsonText(context, TextLocation.tag, caption),
|
|
23340
|
-
search: search ?? void 0
|
|
23398
|
+
search: search ?? void 0,
|
|
23399
|
+
selected: selected ?? false
|
|
23341
23400
|
}
|
|
23342
23401
|
};
|
|
23343
23402
|
objectUtils.removeUnwantedProperties(node.documentLink, {
|
|
23344
23403
|
ignoreEmptyArrays: ["caption"],
|
|
23345
23404
|
ignoreEmptyString: ["url", "alt", "license", "copyright"],
|
|
23346
|
-
ignoreFalse: ["showInIndex"]
|
|
23405
|
+
ignoreFalse: ["showInIndex", "selected"]
|
|
23347
23406
|
});
|
|
23348
23407
|
return nodeValidator.validateResource(node);
|
|
23349
23408
|
}
|
|
@@ -23354,7 +23413,7 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23354
23413
|
* @returns
|
|
23355
23414
|
*/
|
|
23356
23415
|
documentDownloadResource(context, data) {
|
|
23357
|
-
const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
|
|
23416
|
+
const { value, srcAlt, license, copyright, showInIndex, caption, search, selected } = data;
|
|
23358
23417
|
const node = {
|
|
23359
23418
|
type: ResourceType.documentDownload,
|
|
23360
23419
|
__typeAlias: ResourceType.documentDownload,
|
|
@@ -23368,13 +23427,14 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23368
23427
|
copyright: copyright ?? "",
|
|
23369
23428
|
showInIndex: showInIndex ?? false,
|
|
23370
23429
|
caption: this.handleJsonText(context, TextLocation.tag, caption),
|
|
23371
|
-
search: search ?? void 0
|
|
23430
|
+
search: search ?? void 0,
|
|
23431
|
+
selected: selected ?? false
|
|
23372
23432
|
}
|
|
23373
23433
|
};
|
|
23374
23434
|
objectUtils.removeUnwantedProperties(node.documentDownload, {
|
|
23375
23435
|
ignoreEmptyArrays: ["caption"],
|
|
23376
23436
|
ignoreEmptyString: ["url", "alt", "license", "copyright"],
|
|
23377
|
-
ignoreFalse: ["showInIndex"]
|
|
23437
|
+
ignoreFalse: ["showInIndex", "selected"]
|
|
23378
23438
|
});
|
|
23379
23439
|
return nodeValidator.validateResource(node);
|
|
23380
23440
|
}
|
|
@@ -23385,7 +23445,7 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23385
23445
|
* @returns
|
|
23386
23446
|
*/
|
|
23387
23447
|
appLinkResource(context, data) {
|
|
23388
|
-
const { value, srcAlt, license, copyright, showInIndex, caption, search } = data;
|
|
23448
|
+
const { value, srcAlt, license, copyright, showInIndex, caption, search, selected } = data;
|
|
23389
23449
|
const node = {
|
|
23390
23450
|
type: ResourceType.appLink,
|
|
23391
23451
|
__typeAlias: ResourceType.appLink,
|
|
@@ -23400,7 +23460,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23400
23460
|
copyright: copyright ?? "",
|
|
23401
23461
|
showInIndex: showInIndex ?? false,
|
|
23402
23462
|
caption: this.handleJsonText(context, TextLocation.tag, caption),
|
|
23403
|
-
search: search ?? void 0
|
|
23463
|
+
search: search ?? void 0,
|
|
23464
|
+
selected: selected ?? false
|
|
23404
23465
|
}
|
|
23405
23466
|
};
|
|
23406
23467
|
objectUtils.removeUnwantedProperties(node.appLink, {
|
|
@@ -23411,7 +23472,7 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23411
23472
|
"license",
|
|
23412
23473
|
"copyright"
|
|
23413
23474
|
],
|
|
23414
|
-
ignoreFalse: ["showInIndex"]
|
|
23475
|
+
ignoreFalse: ["showInIndex", "selected"]
|
|
23415
23476
|
});
|
|
23416
23477
|
return nodeValidator.validateResource(node);
|
|
23417
23478
|
}
|
|
@@ -23430,7 +23491,8 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23430
23491
|
copyright,
|
|
23431
23492
|
showInIndex,
|
|
23432
23493
|
caption,
|
|
23433
|
-
search
|
|
23494
|
+
search,
|
|
23495
|
+
selected
|
|
23434
23496
|
} = data;
|
|
23435
23497
|
const node = {
|
|
23436
23498
|
type: ResourceType.websiteLink,
|
|
@@ -23446,13 +23508,14 @@ var ResourceBuilder = class extends BaseBuilder {
|
|
|
23446
23508
|
copyright: copyright ?? "",
|
|
23447
23509
|
showInIndex: showInIndex ?? false,
|
|
23448
23510
|
caption: this.handleJsonText(context, TextLocation.tag, caption),
|
|
23449
|
-
search: search ?? void 0
|
|
23511
|
+
search: search ?? void 0,
|
|
23512
|
+
selected: selected ?? false
|
|
23450
23513
|
}
|
|
23451
23514
|
};
|
|
23452
23515
|
objectUtils.removeUnwantedProperties(node.websiteLink, {
|
|
23453
23516
|
ignoreEmptyArrays: ["caption"],
|
|
23454
23517
|
ignoreEmptyString: ["url", "alt", "license", "copyright"],
|
|
23455
|
-
ignoreFalse: ["showInIndex"]
|
|
23518
|
+
ignoreFalse: ["showInIndex", "selected"]
|
|
23456
23519
|
});
|
|
23457
23520
|
return nodeValidator.validateResource(node);
|
|
23458
23521
|
}
|
|
@@ -24391,6 +24454,24 @@ var Builder = class extends BaseBuilder {
|
|
|
24391
24454
|
options
|
|
24392
24455
|
),
|
|
24393
24456
|
platformBackgroundImage: this.toImageResource(context, data.platformBackgroundImage),
|
|
24457
|
+
platformBorderColor: this.toAstProperty(
|
|
24458
|
+
bitType,
|
|
24459
|
+
ConfigKey.property_platformBorderColor,
|
|
24460
|
+
data.platformBorderColor,
|
|
24461
|
+
options
|
|
24462
|
+
),
|
|
24463
|
+
platformSelectionTextColor: this.toAstProperty(
|
|
24464
|
+
bitType,
|
|
24465
|
+
ConfigKey.property_platformSelectionTextColor,
|
|
24466
|
+
data.platformSelectionTextColor,
|
|
24467
|
+
options
|
|
24468
|
+
),
|
|
24469
|
+
platformBaseLayerColor: this.toAstProperty(
|
|
24470
|
+
bitType,
|
|
24471
|
+
ConfigKey.property_platformBaseLayerColor,
|
|
24472
|
+
data.platformBaseLayerColor,
|
|
24473
|
+
options
|
|
24474
|
+
),
|
|
24394
24475
|
productId: this.toAstProperty(bitType, ConfigKey.property_productId, data.productId, options),
|
|
24395
24476
|
product: this.toAstProperty(bitType, ConfigKey.property_product, data.product, options),
|
|
24396
24477
|
// productList: this.toAstProperty(
|
|
@@ -28146,7 +28227,7 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
28146
28227
|
BitType.pageBanner,
|
|
28147
28228
|
BitType.imagesLogoGrave,
|
|
28148
28229
|
BitType.prototypeImages,
|
|
28149
|
-
BitType.
|
|
28230
|
+
BitType.extractorImage
|
|
28150
28231
|
])) {
|
|
28151
28232
|
this.writeProperty("zoomDisabled", node.value, route, {
|
|
28152
28233
|
format: TagFormat.boolean,
|
|
@@ -28199,6 +28280,14 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
|
|
|
28199
28280
|
format: TagFormat.plainText
|
|
28200
28281
|
});
|
|
28201
28282
|
}
|
|
28283
|
+
leaf_selected(node, route) {
|
|
28284
|
+
if (node.value == null) return;
|
|
28285
|
+
this.writeNL_IfNotChain(route);
|
|
28286
|
+
this.writeProperty("selected", node.value, route, {
|
|
28287
|
+
format: TagFormat.boolean,
|
|
28288
|
+
ignoreFalse: true
|
|
28289
|
+
});
|
|
28290
|
+
}
|
|
28202
28291
|
// bitmarkAst -> bits -> bitsValue -> resource -> ...
|
|
28203
28292
|
// bitmarkAst -> bits -> bitsValue -> resource -> posterImage -> ...
|
|
28204
28293
|
// bitmarkAst -> bits -> bitsValue -> resource -> thumbnails -> thumbnailsValue -> ...
|
|
@@ -29371,7 +29460,7 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
29371
29460
|
} else if (instance2.isOfBitType(bitType, [
|
|
29372
29461
|
BitType.imagesLogoGrave,
|
|
29373
29462
|
BitType.prototypeImages,
|
|
29374
|
-
BitType.
|
|
29463
|
+
BitType.extractorImage
|
|
29375
29464
|
])) {
|
|
29376
29465
|
const images = [];
|
|
29377
29466
|
for (const r of resources) {
|
|
@@ -29952,7 +30041,7 @@ var JsonGenerator = class extends AstWalkerGenerator {
|
|
|
29952
30041
|
if (instance2.isOfBitType(bitType, [
|
|
29953
30042
|
BitType.imagesLogoGrave,
|
|
29954
30043
|
BitType.prototypeImages,
|
|
29955
|
-
BitType.
|
|
30044
|
+
BitType.extractorImage
|
|
29956
30045
|
])) {
|
|
29957
30046
|
if (bitType === BitType.imagesLogoGrave) {
|
|
29958
30047
|
if (bitJson.logos == null) {
|
|
@@ -30384,7 +30473,7 @@ var JsonParser = class {
|
|
|
30384
30473
|
processResources(bitType, resource, images, logos) {
|
|
30385
30474
|
const nodes = [];
|
|
30386
30475
|
if (resource) nodes.push(resource);
|
|
30387
|
-
if (instance2.isOfBitType(bitType, [BitType.prototypeImages, BitType.
|
|
30476
|
+
if (instance2.isOfBitType(bitType, [BitType.prototypeImages, BitType.extractorImage])) {
|
|
30388
30477
|
if (Array.isArray(images)) {
|
|
30389
30478
|
for (const image of images) {
|
|
30390
30479
|
if (image) nodes.push(image);
|
|
@@ -38354,6 +38443,8 @@ var ConfigBuilder = class {
|
|
|
38354
38443
|
this.buildFlat(opts);
|
|
38355
38444
|
const bitConfigs = [];
|
|
38356
38445
|
const groupConfigs = [];
|
|
38446
|
+
const bitGroupConfigKeys = [];
|
|
38447
|
+
const bitGroupConfigs = [];
|
|
38357
38448
|
for (const bt of BitType.values()) {
|
|
38358
38449
|
const bitType = instance2.getBitType(bt);
|
|
38359
38450
|
const _bitConfig = BITS[bitType];
|
|
@@ -38377,8 +38468,101 @@ var ConfigBuilder = class {
|
|
|
38377
38468
|
fs3.ensureDirSync(outputFolderBits);
|
|
38378
38469
|
fs3.ensureDirSync(outputFolderGroups);
|
|
38379
38470
|
const fileWrites = [];
|
|
38471
|
+
const keyToJsonKey = (key, tagNameChain) => {
|
|
38472
|
+
let jsonKey = key;
|
|
38473
|
+
if (key === "%") {
|
|
38474
|
+
jsonKey = "item_todo";
|
|
38475
|
+
} else if (key === "!") {
|
|
38476
|
+
jsonKey = "instruction";
|
|
38477
|
+
} else if (key === "?") {
|
|
38478
|
+
jsonKey = "hint";
|
|
38479
|
+
} else if (key === "#") {
|
|
38480
|
+
jsonKey = "title";
|
|
38481
|
+
} else if (key === "##") {
|
|
38482
|
+
jsonKey = "subTitle";
|
|
38483
|
+
} else if (key === "\u25BC") {
|
|
38484
|
+
jsonKey = "anchor";
|
|
38485
|
+
} else if (key === "\u25BA") {
|
|
38486
|
+
jsonKey = "reference";
|
|
38487
|
+
} else if (key === "$") {
|
|
38488
|
+
jsonKey = "sampleSolution";
|
|
38489
|
+
} else if (key === "+") {
|
|
38490
|
+
jsonKey = "true_todo";
|
|
38491
|
+
} else if (key === "-") {
|
|
38492
|
+
jsonKey = "false_todo";
|
|
38493
|
+
} else if (key === "_") {
|
|
38494
|
+
jsonKey = "gap_todo";
|
|
38495
|
+
} else if (key === "=") {
|
|
38496
|
+
jsonKey = "mark_todo";
|
|
38497
|
+
} else if (key.startsWith("@")) {
|
|
38498
|
+
jsonKey = key.substring(1);
|
|
38499
|
+
} else if (key.startsWith("&")) {
|
|
38500
|
+
jsonKey = key.substring(1);
|
|
38501
|
+
}
|
|
38502
|
+
const thisChain = [...tagNameChain, jsonKey];
|
|
38503
|
+
jsonKey = thisChain.join(".");
|
|
38504
|
+
return jsonKey;
|
|
38505
|
+
};
|
|
38506
|
+
const processTagEntries = (tag, tagNameChain) => {
|
|
38507
|
+
const tags2 = [];
|
|
38508
|
+
let tagName = tag.key;
|
|
38509
|
+
const jsonKey = keyToJsonKey(tagName, tagNameChain);
|
|
38510
|
+
const tagType = typeFromConfigKey(tag.key);
|
|
38511
|
+
let format = "";
|
|
38512
|
+
let chain = void 0;
|
|
38513
|
+
if (tagType === BitTagConfigKeyType.tag) {
|
|
38514
|
+
tagName = tag.key;
|
|
38515
|
+
format = "bitmark--";
|
|
38516
|
+
} else if (tagType === BitTagConfigKeyType.property) {
|
|
38517
|
+
tagName = tag.key;
|
|
38518
|
+
if (tag.format === TagFormat.plainText) {
|
|
38519
|
+
format = "string";
|
|
38520
|
+
} else if (tag.format === TagFormat.boolean) {
|
|
38521
|
+
format = "bool";
|
|
38522
|
+
} else if (tag.format === TagFormat.bitmarkText) {
|
|
38523
|
+
format = "bitmark";
|
|
38524
|
+
} else if (tag.format === TagFormat.number) {
|
|
38525
|
+
format = "number";
|
|
38526
|
+
}
|
|
38527
|
+
} else if (tagType === BitTagConfigKeyType.resource) {
|
|
38528
|
+
format = "string";
|
|
38529
|
+
} else if (tagType === BitTagConfigKeyType.group) {
|
|
38530
|
+
let k = tag.key;
|
|
38531
|
+
if (k.startsWith("group_")) k = k.substring(6);
|
|
38532
|
+
k = /*'_' +*/
|
|
38533
|
+
stringUtils.camelToKebab(k);
|
|
38534
|
+
tags2.push({
|
|
38535
|
+
type: "group",
|
|
38536
|
+
key: k
|
|
38537
|
+
});
|
|
38538
|
+
return tags2;
|
|
38539
|
+
}
|
|
38540
|
+
if (Array.isArray(tag.chain) && tag.chain.length > 0) {
|
|
38541
|
+
const chainTags = [];
|
|
38542
|
+
for (const [_tagKey, chainTag] of tag.chain.entries()) {
|
|
38543
|
+
chainTags.push(...processTagEntries(chainTag, [...tagNameChain, jsonKey]));
|
|
38544
|
+
}
|
|
38545
|
+
chain = chainTags;
|
|
38546
|
+
}
|
|
38547
|
+
const t = {
|
|
38548
|
+
type: "tag",
|
|
38549
|
+
key: tagName,
|
|
38550
|
+
jsonKey,
|
|
38551
|
+
format,
|
|
38552
|
+
default: null,
|
|
38553
|
+
alwaysInclude: false,
|
|
38554
|
+
min: tag.minCount == null ? 0 : tag.minCount,
|
|
38555
|
+
max: tag.maxCount == null ? 1 : tag.maxCount,
|
|
38556
|
+
description: tag.description ?? "",
|
|
38557
|
+
tags: chain
|
|
38558
|
+
// raw: {
|
|
38559
|
+
// ...tag,
|
|
38560
|
+
// },
|
|
38561
|
+
};
|
|
38562
|
+
tags2.push(t);
|
|
38563
|
+
return tags2;
|
|
38564
|
+
};
|
|
38380
38565
|
for (const b of bitConfigs) {
|
|
38381
|
-
const inherits = [];
|
|
38382
38566
|
const tags2 = [];
|
|
38383
38567
|
const tagEntriesTypeOrder = [
|
|
38384
38568
|
BitTagConfigKeyType.tag,
|
|
@@ -38395,77 +38579,15 @@ var ConfigBuilder = class {
|
|
|
38395
38579
|
const typeOrder = tagEntriesTypeOrder.indexOf(typeA) - tagEntriesTypeOrder.indexOf(typeB);
|
|
38396
38580
|
return typeOrder;
|
|
38397
38581
|
});
|
|
38398
|
-
if (b.baseBitType)
|
|
38399
|
-
|
|
38400
|
-
type: "
|
|
38401
|
-
|
|
38582
|
+
if (b.baseBitType) {
|
|
38583
|
+
tags2.push({
|
|
38584
|
+
type: "group",
|
|
38585
|
+
key: `group-${b.baseBitType}`
|
|
38402
38586
|
});
|
|
38587
|
+
bitGroupConfigKeys.push(b.baseBitType);
|
|
38588
|
+
}
|
|
38403
38589
|
for (const [_tagKey, tag] of tagEntries) {
|
|
38404
|
-
|
|
38405
|
-
let format = "";
|
|
38406
|
-
let chain = void 0;
|
|
38407
|
-
const tagType = typeFromConfigKey(tag.key);
|
|
38408
|
-
if (tagType === BitTagConfigKeyType.tag) {
|
|
38409
|
-
if (tagName === "%") {
|
|
38410
|
-
chain = {
|
|
38411
|
-
key: "%",
|
|
38412
|
-
format,
|
|
38413
|
-
min: tag.minCount,
|
|
38414
|
-
max: tag.maxCount,
|
|
38415
|
-
description: "Lead",
|
|
38416
|
-
chain: {
|
|
38417
|
-
key: "%",
|
|
38418
|
-
format,
|
|
38419
|
-
min: tag.minCount,
|
|
38420
|
-
max: tag.maxCount,
|
|
38421
|
-
description: "Page number",
|
|
38422
|
-
chain: {
|
|
38423
|
-
key: "%",
|
|
38424
|
-
format,
|
|
38425
|
-
min: tag.minCount,
|
|
38426
|
-
max: tag.maxCount,
|
|
38427
|
-
description: "Margin number"
|
|
38428
|
-
}
|
|
38429
|
-
}
|
|
38430
|
-
};
|
|
38431
|
-
}
|
|
38432
|
-
format = "bitmark--";
|
|
38433
|
-
} else if (tagType === BitTagConfigKeyType.property) {
|
|
38434
|
-
if (tag.format === TagFormat.plainText) {
|
|
38435
|
-
format = "string";
|
|
38436
|
-
} else if (tag.format === TagFormat.boolean) {
|
|
38437
|
-
format = "bool";
|
|
38438
|
-
} else if (tag.format === TagFormat.bitmarkText) {
|
|
38439
|
-
format = "bitmark";
|
|
38440
|
-
} else if (tag.format === TagFormat.number) {
|
|
38441
|
-
format = "number";
|
|
38442
|
-
}
|
|
38443
|
-
} else if (tagType === BitTagConfigKeyType.resource) {
|
|
38444
|
-
} else if (tagType === BitTagConfigKeyType.group) {
|
|
38445
|
-
let k = tag.key;
|
|
38446
|
-
if (k.startsWith("group_")) k = k.substring(6);
|
|
38447
|
-
k = /*'_' +*/
|
|
38448
|
-
stringUtils.camelToKebab(k);
|
|
38449
|
-
inherits.push({
|
|
38450
|
-
type: "group",
|
|
38451
|
-
name: k
|
|
38452
|
-
});
|
|
38453
|
-
continue;
|
|
38454
|
-
}
|
|
38455
|
-
const t = {
|
|
38456
|
-
key: tagName,
|
|
38457
|
-
format,
|
|
38458
|
-
default: null,
|
|
38459
|
-
alwaysInclude: false,
|
|
38460
|
-
min: tag.minCount == null ? 0 : tag.minCount,
|
|
38461
|
-
max: tag.maxCount == null ? 1 : tag.maxCount,
|
|
38462
|
-
description: tag.description ?? "",
|
|
38463
|
-
chain
|
|
38464
|
-
// raw: {
|
|
38465
|
-
// ...tag,
|
|
38466
|
-
// },
|
|
38467
|
-
};
|
|
38468
|
-
tags2.push(t);
|
|
38590
|
+
tags2.push(...processTagEntries(tag, []));
|
|
38469
38591
|
}
|
|
38470
38592
|
const bitJson = {
|
|
38471
38593
|
name: b.bitType,
|
|
@@ -38484,16 +38606,22 @@ var ConfigBuilder = class {
|
|
|
38484
38606
|
footerAllowed: b.footerAllowed ?? true,
|
|
38485
38607
|
footerRequired: b.footerRequired ?? false,
|
|
38486
38608
|
resourceAttachmentAllowed: b.resourceAttachmentAllowed ?? true,
|
|
38487
|
-
inherits,
|
|
38488
38609
|
tags: tags2
|
|
38489
38610
|
};
|
|
38490
38611
|
const output = path3.join(outputFolderBits, `${b.bitType}.jsonc`);
|
|
38491
38612
|
const str = JSON.stringify(bitJson, null, 2);
|
|
38492
38613
|
fileWrites.push(fs3.writeFile(output, str));
|
|
38493
38614
|
}
|
|
38615
|
+
for (const bt of bitGroupConfigKeys) {
|
|
38616
|
+
const bitType = instance2.getBitType(bt);
|
|
38617
|
+
const _bitConfig = BITS[bitType];
|
|
38618
|
+
if (_bitConfig) {
|
|
38619
|
+
_bitConfig.bitType = bitType;
|
|
38620
|
+
bitGroupConfigs.push(_bitConfig);
|
|
38621
|
+
}
|
|
38622
|
+
}
|
|
38494
38623
|
const writeGroupConfigs = (groupConfigs2) => {
|
|
38495
38624
|
for (const g of groupConfigs2) {
|
|
38496
|
-
const inherits = [];
|
|
38497
38625
|
const tags2 = [];
|
|
38498
38626
|
const groupKey = stringUtils.camelToKebab(g.key);
|
|
38499
38627
|
const tagEntriesTypeOrder = [
|
|
@@ -38509,74 +38637,7 @@ var ConfigBuilder = class {
|
|
|
38509
38637
|
return typeOrder;
|
|
38510
38638
|
});
|
|
38511
38639
|
for (const [_tagKey, tag] of tagEntries) {
|
|
38512
|
-
|
|
38513
|
-
const tagType = typeFromConfigKey(tag.key);
|
|
38514
|
-
let format = "";
|
|
38515
|
-
let chain = void 0;
|
|
38516
|
-
if (tagType === BitTagConfigKeyType.tag) {
|
|
38517
|
-
tagName = tag.name;
|
|
38518
|
-
if (tagName === "%") {
|
|
38519
|
-
chain = {
|
|
38520
|
-
key: "%",
|
|
38521
|
-
format,
|
|
38522
|
-
min: tag.minCount,
|
|
38523
|
-
max: tag.maxCount,
|
|
38524
|
-
description: "Lead",
|
|
38525
|
-
chain: {
|
|
38526
|
-
key: "%",
|
|
38527
|
-
format,
|
|
38528
|
-
min: tag.minCount,
|
|
38529
|
-
max: tag.maxCount,
|
|
38530
|
-
description: "Page number",
|
|
38531
|
-
chain: {
|
|
38532
|
-
key: "%",
|
|
38533
|
-
format,
|
|
38534
|
-
min: tag.minCount,
|
|
38535
|
-
max: tag.maxCount,
|
|
38536
|
-
description: "Margin number"
|
|
38537
|
-
}
|
|
38538
|
-
}
|
|
38539
|
-
};
|
|
38540
|
-
}
|
|
38541
|
-
format = "bitmark--";
|
|
38542
|
-
} else if (tagType === BitTagConfigKeyType.property) {
|
|
38543
|
-
tagName = tag.key;
|
|
38544
|
-
if (tag.format === TagFormat.plainText) {
|
|
38545
|
-
format = "string";
|
|
38546
|
-
} else if (tag.format === TagFormat.boolean) {
|
|
38547
|
-
format = "bool";
|
|
38548
|
-
} else if (tag.format === TagFormat.bitmarkText) {
|
|
38549
|
-
format = "bitmark";
|
|
38550
|
-
} else if (tag.format === TagFormat.number) {
|
|
38551
|
-
format = "number";
|
|
38552
|
-
}
|
|
38553
|
-
} else if (tagType === BitTagConfigKeyType.resource) {
|
|
38554
|
-
format = "string";
|
|
38555
|
-
} else if (tagType === BitTagConfigKeyType.group) {
|
|
38556
|
-
let k = tag.key;
|
|
38557
|
-
if (k.startsWith("group_")) k = k.substring(6);
|
|
38558
|
-
k = /*'_' +*/
|
|
38559
|
-
stringUtils.camelToKebab(k);
|
|
38560
|
-
inherits.push({
|
|
38561
|
-
type: "group",
|
|
38562
|
-
name: k
|
|
38563
|
-
});
|
|
38564
|
-
continue;
|
|
38565
|
-
}
|
|
38566
|
-
const t = {
|
|
38567
|
-
key: tagName,
|
|
38568
|
-
format,
|
|
38569
|
-
default: null,
|
|
38570
|
-
alwaysInclude: false,
|
|
38571
|
-
min: tag.minCount == null ? 0 : tag.minCount,
|
|
38572
|
-
max: tag.maxCount == null ? 1 : tag.maxCount,
|
|
38573
|
-
description: tag.description ?? "",
|
|
38574
|
-
chain
|
|
38575
|
-
// raw: {
|
|
38576
|
-
// ...tag,
|
|
38577
|
-
// },
|
|
38578
|
-
};
|
|
38579
|
-
tags2.push(t);
|
|
38640
|
+
tags2.push(...processTagEntries(tag, []));
|
|
38580
38641
|
}
|
|
38581
38642
|
const bitJson = {
|
|
38582
38643
|
name: groupKey,
|
|
@@ -38589,7 +38650,6 @@ var ConfigBuilder = class {
|
|
|
38589
38650
|
changes: ["Initial version"]
|
|
38590
38651
|
}
|
|
38591
38652
|
],
|
|
38592
|
-
inherits,
|
|
38593
38653
|
tags: tags2
|
|
38594
38654
|
// cards: [
|
|
38595
38655
|
// {
|
|
@@ -38621,7 +38681,49 @@ var ConfigBuilder = class {
|
|
|
38621
38681
|
}
|
|
38622
38682
|
};
|
|
38623
38683
|
writeGroupConfigs(groupConfigs);
|
|
38684
|
+
const writeBitsAsGroupConfigs = (bitsAsGroupConfigs) => {
|
|
38685
|
+
for (const b of bitsAsGroupConfigs) {
|
|
38686
|
+
const groupKey = `group-${b.bitType}`;
|
|
38687
|
+
const tags2 = [];
|
|
38688
|
+
const tagEntriesTypeOrder = [
|
|
38689
|
+
BitTagConfigKeyType.tag,
|
|
38690
|
+
BitTagConfigKeyType.property,
|
|
38691
|
+
BitTagConfigKeyType.resource,
|
|
38692
|
+
BitTagConfigKeyType.group,
|
|
38693
|
+
BitTagConfigKeyType.unknown
|
|
38694
|
+
];
|
|
38695
|
+
const tagEntries = Object.entries(b.tags ?? []).sort((a, b2) => {
|
|
38696
|
+
const tagA = a[1];
|
|
38697
|
+
const tagB = b2[1];
|
|
38698
|
+
const typeA = typeFromConfigKey(tagA.key);
|
|
38699
|
+
const typeB = typeFromConfigKey(tagB.key);
|
|
38700
|
+
const typeOrder = tagEntriesTypeOrder.indexOf(typeA) - tagEntriesTypeOrder.indexOf(typeB);
|
|
38701
|
+
return typeOrder;
|
|
38702
|
+
});
|
|
38703
|
+
for (const [_tagKey, tag] of tagEntries) {
|
|
38704
|
+
tags2.push(...processTagEntries(tag, []));
|
|
38705
|
+
}
|
|
38706
|
+
const bitJson = {
|
|
38707
|
+
name: groupKey,
|
|
38708
|
+
description: b.description ?? "",
|
|
38709
|
+
since: "UNKNOWN",
|
|
38710
|
+
deprecated: b.deprecated,
|
|
38711
|
+
history: [
|
|
38712
|
+
{
|
|
38713
|
+
version: "UNKNOWN",
|
|
38714
|
+
changes: ["Initial version"]
|
|
38715
|
+
}
|
|
38716
|
+
],
|
|
38717
|
+
tags: tags2
|
|
38718
|
+
};
|
|
38719
|
+
const output = path3.join(outputFolderGroups, `${groupKey}.jsonc`);
|
|
38720
|
+
const str = JSON.stringify(bitJson, null, 2);
|
|
38721
|
+
fs3.writeFileSync(output, str);
|
|
38722
|
+
}
|
|
38723
|
+
};
|
|
38724
|
+
writeBitsAsGroupConfigs(bitGroupConfigs);
|
|
38624
38725
|
}
|
|
38726
|
+
// Build flat bit configs
|
|
38625
38727
|
buildFlat(options) {
|
|
38626
38728
|
const opts = Object.assign({}, options);
|
|
38627
38729
|
const bitConfigs = [];
|
|
@@ -38633,8 +38735,63 @@ var ConfigBuilder = class {
|
|
|
38633
38735
|
const outputFolder = opts.outputDir ?? "assets/config";
|
|
38634
38736
|
const outputFolderBits = path3.join(outputFolder, "bits_flat");
|
|
38635
38737
|
fs3.ensureDirSync(outputFolderBits);
|
|
38738
|
+
const processTagEntries = (tag) => {
|
|
38739
|
+
const tags2 = [];
|
|
38740
|
+
let tagName = tag.key;
|
|
38741
|
+
const tagType = typeFromConfigKey(tag.key);
|
|
38742
|
+
let format = "";
|
|
38743
|
+
let chain = void 0;
|
|
38744
|
+
if (tagType === BitTagConfigKeyType.tag) {
|
|
38745
|
+
tagName = tag.name;
|
|
38746
|
+
format = "bitmark--";
|
|
38747
|
+
} else if (tagType === BitTagConfigKeyType.property) {
|
|
38748
|
+
tagName = tag.key;
|
|
38749
|
+
if (tag.format === TagFormat.plainText) {
|
|
38750
|
+
format = "string";
|
|
38751
|
+
} else if (tag.format === TagFormat.boolean) {
|
|
38752
|
+
format = "bool";
|
|
38753
|
+
} else if (tag.format === TagFormat.bitmarkText) {
|
|
38754
|
+
format = "bitmark";
|
|
38755
|
+
} else if (tag.format === TagFormat.number) {
|
|
38756
|
+
format = "number";
|
|
38757
|
+
}
|
|
38758
|
+
} else if (tagType === BitTagConfigKeyType.resource) {
|
|
38759
|
+
format = "string";
|
|
38760
|
+
} else if (tagType === BitTagConfigKeyType.group) {
|
|
38761
|
+
let k = tag.key;
|
|
38762
|
+
if (k.startsWith("group_")) k = k.substring(6);
|
|
38763
|
+
k = /*'_' +*/
|
|
38764
|
+
stringUtils.camelToKebab(k);
|
|
38765
|
+
tags2.push({
|
|
38766
|
+
type: "group",
|
|
38767
|
+
key: k
|
|
38768
|
+
});
|
|
38769
|
+
return tags2;
|
|
38770
|
+
}
|
|
38771
|
+
if (Array.isArray(tag.chain) && tag.chain.length > 0) {
|
|
38772
|
+
const chainTags = [];
|
|
38773
|
+
for (const [_tagKey, chainTag] of tag.chain.entries()) {
|
|
38774
|
+
chainTags.push(...processTagEntries(chainTag));
|
|
38775
|
+
}
|
|
38776
|
+
chain = chainTags;
|
|
38777
|
+
}
|
|
38778
|
+
const t = {
|
|
38779
|
+
key: tagName,
|
|
38780
|
+
format,
|
|
38781
|
+
default: null,
|
|
38782
|
+
alwaysInclude: false,
|
|
38783
|
+
min: tag.minCount == null ? 0 : tag.minCount,
|
|
38784
|
+
max: tag.maxCount == null ? 1 : tag.maxCount,
|
|
38785
|
+
description: tag.description ?? "",
|
|
38786
|
+
chain
|
|
38787
|
+
// raw: {
|
|
38788
|
+
// ...tag,
|
|
38789
|
+
// },
|
|
38790
|
+
};
|
|
38791
|
+
tags2.push(t);
|
|
38792
|
+
return tags2;
|
|
38793
|
+
};
|
|
38636
38794
|
for (const b of bitConfigs) {
|
|
38637
|
-
const inherits = [];
|
|
38638
38795
|
const tags2 = [];
|
|
38639
38796
|
const tagEntriesTypeOrder = [
|
|
38640
38797
|
BitTagConfigKeyType.tag,
|
|
@@ -38651,103 +38808,8 @@ var ConfigBuilder = class {
|
|
|
38651
38808
|
const typeOrder = tagEntriesTypeOrder.indexOf(typeA) - tagEntriesTypeOrder.indexOf(typeB);
|
|
38652
38809
|
return typeOrder;
|
|
38653
38810
|
});
|
|
38654
|
-
for (const [
|
|
38655
|
-
|
|
38656
|
-
let tagKeyPrefix = "";
|
|
38657
|
-
let format = "";
|
|
38658
|
-
let description = "";
|
|
38659
|
-
let chain = void 0;
|
|
38660
|
-
if (tag.type === BitTagConfigKeyType.tag) {
|
|
38661
|
-
tagName = tag.tag;
|
|
38662
|
-
if (tagName === "%") {
|
|
38663
|
-
description = "Item";
|
|
38664
|
-
chain = {
|
|
38665
|
-
key: "%",
|
|
38666
|
-
format,
|
|
38667
|
-
min: tag.minCount,
|
|
38668
|
-
max: tag.maxCount,
|
|
38669
|
-
description: "Lead",
|
|
38670
|
-
chain: {
|
|
38671
|
-
key: "%",
|
|
38672
|
-
format,
|
|
38673
|
-
min: tag.minCount,
|
|
38674
|
-
max: tag.maxCount,
|
|
38675
|
-
description: "Page number",
|
|
38676
|
-
chain: {
|
|
38677
|
-
key: "%",
|
|
38678
|
-
format,
|
|
38679
|
-
min: tag.minCount,
|
|
38680
|
-
max: tag.maxCount,
|
|
38681
|
-
description: "Margin number"
|
|
38682
|
-
}
|
|
38683
|
-
}
|
|
38684
|
-
};
|
|
38685
|
-
} else if (tagName === "!") {
|
|
38686
|
-
description = "Instruction";
|
|
38687
|
-
} else if (tagName === "?") {
|
|
38688
|
-
description = "Hint";
|
|
38689
|
-
} else if (tagName === "#") {
|
|
38690
|
-
description = "Title";
|
|
38691
|
-
} else if (tagName === "##") {
|
|
38692
|
-
description = "Sub-title";
|
|
38693
|
-
} else if (tagName === "\u25BC") {
|
|
38694
|
-
description = "Anchor";
|
|
38695
|
-
} else if (tagName === "\u25BA") {
|
|
38696
|
-
description = "Reference";
|
|
38697
|
-
} else if (tagName === "$") {
|
|
38698
|
-
description = "Sample solution";
|
|
38699
|
-
} else if (tagName === "&") {
|
|
38700
|
-
description = "Resource";
|
|
38701
|
-
} else if (tagName === "+") {
|
|
38702
|
-
description = "True statement";
|
|
38703
|
-
} else if (tagName === "-") {
|
|
38704
|
-
description = "False statement";
|
|
38705
|
-
} else if (tagName === "_") {
|
|
38706
|
-
description = "Gap";
|
|
38707
|
-
} else if (tagName === "=") {
|
|
38708
|
-
description = "Mark";
|
|
38709
|
-
}
|
|
38710
|
-
format = "bitmark--";
|
|
38711
|
-
} else if (tag.type === BitTagConfigKeyType.property) {
|
|
38712
|
-
tagName = tag.tag;
|
|
38713
|
-
tagKeyPrefix = "@";
|
|
38714
|
-
const property = tag;
|
|
38715
|
-
if (property.format === TagFormat.plainText) {
|
|
38716
|
-
format = "string";
|
|
38717
|
-
} else if (property.format === TagFormat.boolean) {
|
|
38718
|
-
format = "bool";
|
|
38719
|
-
} else if (property.format === TagFormat.bitmarkText) {
|
|
38720
|
-
format = "bitmark";
|
|
38721
|
-
} else if (property.format === TagFormat.number) {
|
|
38722
|
-
format = "number";
|
|
38723
|
-
}
|
|
38724
|
-
} else if (tag.type === BitTagConfigKeyType.resource) {
|
|
38725
|
-
tagKeyPrefix = "&";
|
|
38726
|
-
} else if (tag.type === BitTagConfigKeyType.group) {
|
|
38727
|
-
tagKeyPrefix = "@";
|
|
38728
|
-
let k = tag.configKey;
|
|
38729
|
-
if (k.startsWith("group_")) k = k.substring(6);
|
|
38730
|
-
k = "_" + k;
|
|
38731
|
-
inherits.push({
|
|
38732
|
-
type: "group",
|
|
38733
|
-
name: k
|
|
38734
|
-
});
|
|
38735
|
-
continue;
|
|
38736
|
-
}
|
|
38737
|
-
const t = {
|
|
38738
|
-
key: tagKeyPrefix + tagName,
|
|
38739
|
-
format,
|
|
38740
|
-
default: null,
|
|
38741
|
-
alwaysInclude: false,
|
|
38742
|
-
min: tag.minCount == null ? 0 : tag.minCount,
|
|
38743
|
-
max: tag.maxCount == null ? 1 : tag.maxCount,
|
|
38744
|
-
description,
|
|
38745
|
-
chain
|
|
38746
|
-
// raw: {
|
|
38747
|
-
// ...tag,
|
|
38748
|
-
// },
|
|
38749
|
-
};
|
|
38750
|
-
tags2.push(t);
|
|
38811
|
+
for (const [_tagKey, tag] of tagEntries) {
|
|
38812
|
+
tags2.push(...processTagEntries(tag));
|
|
38751
38813
|
}
|
|
38752
38814
|
const bitJson = {
|
|
38753
38815
|
name: b.bitType,
|