bruce-cesium 7.8.5 → 7.8.6
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/bruce-cesium.es5.js +46 -7
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +44 -5
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/render-managers/common/entity-label-group.js +43 -4
- package/dist/lib/rendering/render-managers/common/entity-label-group.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/render-managers/common/entity-label-group.d.ts +10 -1
- package/package.json +1 -1
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -11172,6 +11172,35 @@
|
|
|
11172
11172
|
})(exports.EntityLabel || (exports.EntityLabel = {}));
|
|
11173
11173
|
|
|
11174
11174
|
(function (EntityLabelGroup) {
|
|
11175
|
+
// Prefixes that make an icon value name its kind, so one mapping can send Entities to icons of different kinds.
|
|
11176
|
+
EntityLabelGroup.ICON_PREFIX = {
|
|
11177
|
+
// A Font Awesome class, "FA:fas fa-cube".
|
|
11178
|
+
FontAwesome: "FA:",
|
|
11179
|
+
// A client file by id, or an image by URL, "CF:<file id or URL>".
|
|
11180
|
+
ClientFile: "CF:"
|
|
11181
|
+
};
|
|
11182
|
+
/*
|
|
11183
|
+
* The icon a prefixed value names, as a class or an image URL, or null for a value with no known prefix.
|
|
11184
|
+
*/
|
|
11185
|
+
function ParseIcon(value, api) {
|
|
11186
|
+
if (typeof value !== "string") {
|
|
11187
|
+
return null;
|
|
11188
|
+
}
|
|
11189
|
+
const named = value.trim();
|
|
11190
|
+
if (named.startsWith(EntityLabelGroup.ICON_PREFIX.FontAwesome)) {
|
|
11191
|
+
const iconClass = named.slice(EntityLabelGroup.ICON_PREFIX.FontAwesome.length).trim();
|
|
11192
|
+
return iconClass ? { iconClass } : null;
|
|
11193
|
+
}
|
|
11194
|
+
if (named.startsWith(EntityLabelGroup.ICON_PREFIX.ClientFile)) {
|
|
11195
|
+
const file = named.slice(EntityLabelGroup.ICON_PREFIX.ClientFile.length).trim();
|
|
11196
|
+
if (!file) {
|
|
11197
|
+
return null;
|
|
11198
|
+
}
|
|
11199
|
+
return { iconUrl: /^[a-z][a-z0-9+.-]*:/i.test(file) ? file : BModels.ClientFile.GetUrl({ api, fileId: file, viaCdn: true }) };
|
|
11200
|
+
}
|
|
11201
|
+
return null;
|
|
11202
|
+
}
|
|
11203
|
+
EntityLabelGroup.ParseIcon = ParseIcon;
|
|
11175
11204
|
// The glow a selected place is drawn with.
|
|
11176
11205
|
const PLACE_SELECTED_COLOR = "#33B1FF";
|
|
11177
11206
|
// Keys places share the entity bookkeeping under, scoped to their group so a copied group keeps its own.
|
|
@@ -11647,7 +11676,7 @@
|
|
|
11647
11676
|
* One member's label settings, with any image its own text links to but before its default image.
|
|
11648
11677
|
*/
|
|
11649
11678
|
compose(group, entityId, menuItemId) {
|
|
11650
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
11679
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
11651
11680
|
const item = group.items.get(entityId);
|
|
11652
11681
|
const entity = (_a = item.entity) !== null && _a !== void 0 ? _a : { Bruce: { ID: entityId, Name: item.text } };
|
|
11653
11682
|
let iconPriority = (_b = group.definition.options) === null || _b === void 0 ? void 0 : _b.iconPriority;
|
|
@@ -11698,6 +11727,13 @@
|
|
|
11698
11727
|
iconPriority: Number.isFinite(iconPriority) ? iconPriority : item.iconPriority,
|
|
11699
11728
|
iconStatus: (_p = resolveIcon((_o = group.definition.options) === null || _o === void 0 ? void 0 : _o.iconStatus, entity)) !== null && _p !== void 0 ? _p : item.iconStatus
|
|
11700
11729
|
};
|
|
11730
|
+
// A prefixed icon names its kind and replaces the group's others; an unprefixed one stays the glyph it was.
|
|
11731
|
+
const named = ParseIcon(options.icon, (_q = this.register.ApiGetters) === null || _q === void 0 ? void 0 : _q.GetBruceApi());
|
|
11732
|
+
if (named) {
|
|
11733
|
+
options.icon = undefined;
|
|
11734
|
+
options.iconClass = named.iconClass;
|
|
11735
|
+
options.iconUrl = named.iconUrl;
|
|
11736
|
+
}
|
|
11701
11737
|
if (item.placeId) {
|
|
11702
11738
|
// Clickable only when the app asks, and reported then, as there is no Entity to select.
|
|
11703
11739
|
options.selectOnClick = this.placesInteractive;
|
|
@@ -11708,16 +11744,19 @@
|
|
|
11708
11744
|
options.iconUrl = look.iconUrl || undefined;
|
|
11709
11745
|
options.iconClass = look.iconUrl ? undefined : look.iconClass;
|
|
11710
11746
|
}
|
|
11711
|
-
if (look === null || look === void 0 ? void 0 : look.iconColor) {
|
|
11712
|
-
options.iconColor = look.iconColor;
|
|
11747
|
+
if ((look === null || look === void 0 ? void 0 : look.iconColor) != null) {
|
|
11748
|
+
options.iconColor = look.iconColor || undefined;
|
|
11713
11749
|
}
|
|
11714
11750
|
if ((look === null || look === void 0 ? void 0 : look.iconBackground) != null) {
|
|
11715
11751
|
options.iconBackground = look.iconBackground;
|
|
11716
11752
|
}
|
|
11753
|
+
if ((look === null || look === void 0 ? void 0 : look.iconScale) > 0) {
|
|
11754
|
+
options.iconScale = look.iconScale;
|
|
11755
|
+
}
|
|
11717
11756
|
}
|
|
11718
11757
|
if (options.attributes && item.entity && !(expression && resolvedText != null)) {
|
|
11719
11758
|
options.text = [
|
|
11720
|
-
(
|
|
11759
|
+
(_t = (_r = options.text) !== null && _r !== void 0 ? _r : (_s = item.entity.Bruce) === null || _s === void 0 ? void 0 : _s.Name) !== null && _t !== void 0 ? _t : entityId,
|
|
11721
11760
|
...options.attributes.map(path => BModels.Entity.GetValue({ entity: item.entity, path })).filter(value => value != null).map(String)
|
|
11722
11761
|
].join("\n");
|
|
11723
11762
|
}
|
|
@@ -60859,7 +60898,7 @@ void main() {
|
|
|
60859
60898
|
StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
|
|
60860
60899
|
})(exports.StyleUtils || (exports.StyleUtils = {}));
|
|
60861
60900
|
|
|
60862
|
-
const VERSION = "7.8.
|
|
60901
|
+
const VERSION = "7.8.6";
|
|
60863
60902
|
/**
|
|
60864
60903
|
* Updates the environment instance used by bruce-cesium to one specified.
|
|
60865
60904
|
* This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
|