@openfairygui/cli 0.2.0-alpha.35 → 0.2.0-alpha.37
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/cli.mjs +123 -15
- package/package.json +4 -4
package/dist/cli.mjs
CHANGED
|
@@ -2304,6 +2304,7 @@ var Component = class extends ExtensibleProperty {
|
|
|
2304
2304
|
wholeNumbers: false,
|
|
2305
2305
|
changeOnClick: true,
|
|
2306
2306
|
fixedGripSize: false,
|
|
2307
|
+
autoClearItems: false,
|
|
2307
2308
|
opaque: true,
|
|
2308
2309
|
customProperties: [],
|
|
2309
2310
|
childrenRenderOrder: ChildrenRenderOrder.Ascent,
|
|
@@ -2687,6 +2688,12 @@ var Component = class extends ExtensibleProperty {
|
|
|
2687
2688
|
setFixedGripSize(v) {
|
|
2688
2689
|
return this.set("fixedGripSize", v);
|
|
2689
2690
|
}
|
|
2691
|
+
getAutoClearItems() {
|
|
2692
|
+
return this.get("autoClearItems");
|
|
2693
|
+
}
|
|
2694
|
+
setAutoClearItems(v) {
|
|
2695
|
+
return this.set("autoClearItems", v);
|
|
2696
|
+
}
|
|
2690
2697
|
getOpaque() {
|
|
2691
2698
|
return this.get("opaque");
|
|
2692
2699
|
}
|
|
@@ -4937,10 +4944,12 @@ var GComponent = class extends GObject {
|
|
|
4937
4944
|
instancePromptText: "",
|
|
4938
4945
|
instanceSelectionController: "",
|
|
4939
4946
|
instanceVisibleItemCount: 0,
|
|
4947
|
+
instanceAutoClearItems: false,
|
|
4940
4948
|
instanceValue: 0,
|
|
4941
4949
|
instanceMax: 0,
|
|
4942
4950
|
instanceMin: 0,
|
|
4943
|
-
instanceComboItems: []
|
|
4951
|
+
instanceComboItems: [],
|
|
4952
|
+
propertyOverrides: []
|
|
4944
4953
|
});
|
|
4945
4954
|
}
|
|
4946
4955
|
getComponentProp(key) {
|
|
@@ -5236,6 +5245,12 @@ var GComponent = class extends GObject {
|
|
|
5236
5245
|
setInstanceVisibleItemCount(v) {
|
|
5237
5246
|
return this.setComponentProp("instanceVisibleItemCount", v);
|
|
5238
5247
|
}
|
|
5248
|
+
getInstanceAutoClearItems() {
|
|
5249
|
+
return this.getComponentProp("instanceAutoClearItems");
|
|
5250
|
+
}
|
|
5251
|
+
setInstanceAutoClearItems(v) {
|
|
5252
|
+
return this.setComponentProp("instanceAutoClearItems", v);
|
|
5253
|
+
}
|
|
5239
5254
|
getInstanceValue() {
|
|
5240
5255
|
return this.getComponentProp("instanceValue");
|
|
5241
5256
|
}
|
|
@@ -5260,6 +5275,12 @@ var GComponent = class extends GObject {
|
|
|
5260
5275
|
setInstanceComboItems(v) {
|
|
5261
5276
|
return this.set("instanceComboItems", v);
|
|
5262
5277
|
}
|
|
5278
|
+
getPropertyOverrides() {
|
|
5279
|
+
return this.getComponentProp("propertyOverrides").map((property) => ({ ...property }));
|
|
5280
|
+
}
|
|
5281
|
+
setPropertyOverrides(v) {
|
|
5282
|
+
return this.setComponentProp("propertyOverrides", v.map((property) => ({ ...property })));
|
|
5283
|
+
}
|
|
5263
5284
|
getMargin() {
|
|
5264
5285
|
return this.getComponentProp("margin");
|
|
5265
5286
|
}
|
|
@@ -5327,6 +5348,7 @@ var GListBase = class extends GObject {
|
|
|
5327
5348
|
clipSoftness: [0, 0],
|
|
5328
5349
|
scrollItemToViewOnClick: true,
|
|
5329
5350
|
foldInvisibleItems: false,
|
|
5351
|
+
autoClearItems: false,
|
|
5330
5352
|
listItems: [],
|
|
5331
5353
|
pageController: "",
|
|
5332
5354
|
controllerOverrides: "",
|
|
@@ -5619,6 +5641,12 @@ var GListBase = class extends GObject {
|
|
|
5619
5641
|
setFoldInvisibleItems(v) {
|
|
5620
5642
|
return this.setListProp("foldInvisibleItems", v);
|
|
5621
5643
|
}
|
|
5644
|
+
getAutoClearItems() {
|
|
5645
|
+
return this.getListProp("autoClearItems");
|
|
5646
|
+
}
|
|
5647
|
+
setAutoClearItems(v) {
|
|
5648
|
+
return this.setListProp("autoClearItems", v);
|
|
5649
|
+
}
|
|
5622
5650
|
getListItems() {
|
|
5623
5651
|
return this.get("listItems");
|
|
5624
5652
|
}
|
|
@@ -9475,6 +9503,11 @@ const preserveOrderParser = new XMLParser({
|
|
|
9475
9503
|
...defaultOptions,
|
|
9476
9504
|
preserveOrder: true
|
|
9477
9505
|
});
|
|
9506
|
+
const rawPreserveOrderParser = new XMLParser({
|
|
9507
|
+
...defaultOptions,
|
|
9508
|
+
preserveOrder: true,
|
|
9509
|
+
trimValues: false
|
|
9510
|
+
});
|
|
9478
9511
|
function escapeXmlAttr(value) {
|
|
9479
9512
|
return String(value).replace(/&/g, "&").replace(/\r\n/g, "
").replace(/[\r\n]/g, "
").replace(/\t/g, "	").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">");
|
|
9480
9513
|
}
|
|
@@ -9493,6 +9526,9 @@ function parseXML(xml) {
|
|
|
9493
9526
|
function parseXMLPreserveOrder(xml) {
|
|
9494
9527
|
return preserveOrderParser.parse(xml);
|
|
9495
9528
|
}
|
|
9529
|
+
function parseXMLPreserveOrderRaw(xml) {
|
|
9530
|
+
return rawPreserveOrderParser.parse(xml);
|
|
9531
|
+
}
|
|
9496
9532
|
function parseXYString(v) {
|
|
9497
9533
|
if (!v) return [0, 0];
|
|
9498
9534
|
const parts = v.split(",");
|
|
@@ -16553,7 +16589,8 @@ const COMBOBOX_EXTENSION_ATTRS = {
|
|
|
16553
16589
|
title: { canonical: "title" },
|
|
16554
16590
|
icon: { canonical: "icon" },
|
|
16555
16591
|
visibleItemCount: { canonical: "visibleItemCount" },
|
|
16556
|
-
selectionController: { canonical: "selectionController" }
|
|
16592
|
+
selectionController: { canonical: "selectionController" },
|
|
16593
|
+
autoClearItems: { canonical: "autoClearItems" }
|
|
16557
16594
|
};
|
|
16558
16595
|
const PROGRESSBAR_EXTENSION_ATTRS = {
|
|
16559
16596
|
titleType: { canonical: "titleType" },
|
|
@@ -16581,6 +16618,11 @@ const CUSTOM_PROPERTY_ATTRS = {
|
|
|
16581
16618
|
propertyId: { canonical: "propertyId" },
|
|
16582
16619
|
label: { canonical: "label" }
|
|
16583
16620
|
};
|
|
16621
|
+
const PROPERTY_OVERRIDE_ATTRS = {
|
|
16622
|
+
target: { canonical: "target" },
|
|
16623
|
+
propertyId: { canonical: "propertyId" },
|
|
16624
|
+
value: { canonical: "value" }
|
|
16625
|
+
};
|
|
16584
16626
|
const GEAR_ATTRS = {
|
|
16585
16627
|
controller: { canonical: "controller" },
|
|
16586
16628
|
pages: { canonical: "pages" },
|
|
@@ -16671,10 +16713,11 @@ const SLIDER_EXTENSION_NODE = defineNode(SLIDER_EXTENSION_ATTRS);
|
|
|
16671
16713
|
const SCROLLBAR_EXTENSION_NODE = defineNode(SCROLLBAR_EXTENSION_ATTRS);
|
|
16672
16714
|
const RELATION_NODE = defineNode(RELATION_ATTRS);
|
|
16673
16715
|
const CUSTOM_PROPERTY_NODE = defineNode(CUSTOM_PROPERTY_ATTRS);
|
|
16716
|
+
const PROPERTY_OVERRIDE_NODE = defineNode(PROPERTY_OVERRIDE_ATTRS);
|
|
16674
16717
|
const GEAR_NODE = defineNode(GEAR_ATTRS);
|
|
16675
16718
|
const CONTROLLER_ACTION_NODE = defineNode(CONTROLLER_ACTION_ATTRS);
|
|
16676
16719
|
const TRANSITION_ITEM_NODE = defineNode(TRANSITION_ITEM_ATTRS);
|
|
16677
|
-
const LIST_ITEM_NODE = defineNode(LIST_ITEM_ATTRS);
|
|
16720
|
+
const LIST_ITEM_NODE = defineNode(LIST_ITEM_ATTRS, { property: PROPERTY_OVERRIDE_NODE });
|
|
16678
16721
|
const COMBOBOX_ITEM_NODE = defineNode(COMBOBOX_ITEM_ATTRS);
|
|
16679
16722
|
const WITH_RELATION_CHILDREN = { relation: RELATION_NODE };
|
|
16680
16723
|
const WITH_GEAR_CHILDREN = {
|
|
@@ -16722,7 +16765,7 @@ const TRANSITION_NODE = defineNode(mergeAttrs(TRANSITION_ATTRS), mergeChildren(W
|
|
|
16722
16765
|
const IMAGE_NODE = defineNode(mergeAttrs(COMMON_DISPLAY_OBJECT_ATTRS, IMAGE_PANEL_ATTRS, XY_SIZE_ATTRS, LOCKED_ATTRS, ASPECT_ATTRS, PIVOT_ATTRS, ANCHOR_ATTRS, SCALE_ATTRS, SKEW_ATTRS, GROUP_REF_ATTRS, COMMON_DISPLAY_STATE_ATTRS, RESOURCE_LINK_ATTRS, FILTER_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN));
|
|
16723
16766
|
const GRAPH_NODE = defineNode(mergeAttrs(COMMON_DISPLAY_OBJECT_ATTRS, XY_SIZE_ATTRS, LOCKED_ATTRS, RESTRICT_SIZE_ATTRS, PIVOT_ATTRS, ANCHOR_ATTRS, SKEW_ATTRS, GROUP_REF_ATTRS, COMMON_DISPLAY_STATE_ATTRS, GRAPH_PANEL_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN));
|
|
16724
16767
|
const MOVIE_CLIP_NODE = defineNode(mergeAttrs(COMMON_DISPLAY_OBJECT_ATTRS, MOVIE_CLIP_PANEL_ATTRS, XY_SIZE_ATTRS, PIVOT_ATTRS, ANCHOR_ATTRS, GROUP_REF_ATTRS, COMMON_DISPLAY_STATE_ATTRS, RESOURCE_LINK_ATTRS, FILTER_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN));
|
|
16725
|
-
const COMPONENT_INSTANCE_NODE = defineNode(mergeAttrs(COMMON_DISPLAY_OBJECT_ATTRS, COMPONENT_INSTANCE_PANEL_ATTRS, XY_SIZE_ATTRS, LOCKED_ATTRS, RESTRICT_SIZE_ATTRS, ASPECT_ATTRS, PIVOT_ATTRS, ANCHOR_ATTRS, SCALE_ATTRS, GROUP_REF_ATTRS, COMMON_DISPLAY_STATE_ATTRS, INSTANCE_MISC_PANEL_ATTRS, RESOURCE_LINK_ATTRS, FILTER_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN, WITH_INSTANCE_EXTENSION_CHILDREN));
|
|
16768
|
+
const COMPONENT_INSTANCE_NODE = defineNode(mergeAttrs(COMMON_DISPLAY_OBJECT_ATTRS, COMPONENT_INSTANCE_PANEL_ATTRS, XY_SIZE_ATTRS, LOCKED_ATTRS, RESTRICT_SIZE_ATTRS, ASPECT_ATTRS, PIVOT_ATTRS, ANCHOR_ATTRS, SCALE_ATTRS, GROUP_REF_ATTRS, COMMON_DISPLAY_STATE_ATTRS, INSTANCE_MISC_PANEL_ATTRS, RESOURCE_LINK_ATTRS, FILTER_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN, WITH_INSTANCE_EXTENSION_CHILDREN, { property: PROPERTY_OVERRIDE_NODE }));
|
|
16726
16769
|
const LOADER_NODE = defineNode(mergeAttrs(COMMON_DISPLAY_OBJECT_ATTRS, XY_SIZE_ATTRS, PIVOT_ATTRS, ANCHOR_ATTRS, SCALE_ATTRS, COMMON_DISPLAY_STATE_ATTRS, LOADER_PANEL_ATTRS, FILTER_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN));
|
|
16727
16770
|
const LOADER3D_NODE = defineNode(mergeAttrs(COMMON_DISPLAY_OBJECT_ATTRS, LOADER3D_PANEL_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN));
|
|
16728
16771
|
const TEXT_NODE = defineNode(mergeAttrs(COMMON_DISPLAY_OBJECT_ATTRS, XY_SIZE_ATTRS, RESTRICT_SIZE_ATTRS, PIVOT_ATTRS, ANCHOR_ATTRS, { customData: { canonical: "customData" } }, GROUP_REF_ATTRS, COMMON_DISPLAY_STATE_ATTRS, TEXT_PANEL_ATTRS, TEXT_INPUT_PANEL_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN));
|
|
@@ -16786,6 +16829,7 @@ const PROJECT_XML_PROTOCOL = {
|
|
|
16786
16829
|
group: GROUP_NODE,
|
|
16787
16830
|
list: LIST_NODE,
|
|
16788
16831
|
listItem: LIST_ITEM_NODE,
|
|
16832
|
+
propertyOverride: PROPERTY_OVERRIDE_NODE,
|
|
16789
16833
|
comboBoxItem: COMBOBOX_ITEM_NODE
|
|
16790
16834
|
};
|
|
16791
16835
|
function readXmlAttr(source, spec) {
|
|
@@ -16944,6 +16988,24 @@ function getXmlNode$2(value) {
|
|
|
16944
16988
|
function getProtocolChildName$2(protocol, childName) {
|
|
16945
16989
|
return protocol.children?.[childName] ? childName : null;
|
|
16946
16990
|
}
|
|
16991
|
+
function parsePropertyOverrides(source, protocol) {
|
|
16992
|
+
const childName = getProtocolChildName$2(protocol, "property");
|
|
16993
|
+
if (!childName) return [];
|
|
16994
|
+
return ensureArray(source[childName]).map((raw, index) => {
|
|
16995
|
+
const property = getXmlNode$2(raw);
|
|
16996
|
+
const specs = PROJECT_XML_PROTOCOL.propertyOverride.attrs;
|
|
16997
|
+
const target = property ? readXmlAttr(property, specs.target) : void 0;
|
|
16998
|
+
const rawPropertyId = property ? readXmlAttr(property, specs.propertyId) : void 0;
|
|
16999
|
+
const propertyId = typeof rawPropertyId === "number" ? rawPropertyId : typeof rawPropertyId === "string" && /^\d+$/.test(rawPropertyId) ? Number(rawPropertyId) : NaN;
|
|
17000
|
+
const value = property ? readXmlAttr(property, specs.value) : void 0;
|
|
17001
|
+
if (!target || !Number.isSafeInteger(propertyId) || propertyId < 0 || value === void 0) throw new Error(`Invalid property override at ${childName}[${index}].`);
|
|
17002
|
+
return {
|
|
17003
|
+
target,
|
|
17004
|
+
propertyId,
|
|
17005
|
+
value: String(value)
|
|
17006
|
+
};
|
|
17007
|
+
});
|
|
17008
|
+
}
|
|
16947
17009
|
function getProtocolGearChildNames(protocol) {
|
|
16948
17010
|
return Object.keys(protocol.children ?? {}).filter((name) => name in GEAR_TAG_MAP);
|
|
16949
17011
|
}
|
|
@@ -16978,6 +17040,7 @@ function parseListItemXmlNode(item) {
|
|
|
16978
17040
|
const specs = PROJECT_XML_PROTOCOL.listItem.attrs;
|
|
16979
17041
|
const isFolder = readXmlAttr(item, specs.isFolder);
|
|
16980
17042
|
const controllers = readXmlAttr(item, specs.controllers);
|
|
17043
|
+
const propertyOverrides = parsePropertyOverrides(item, PROJECT_XML_PROTOCOL.listItem);
|
|
16981
17044
|
return {
|
|
16982
17045
|
title: readXmlAttr(item, specs.title) ?? null,
|
|
16983
17046
|
icon: readXmlAttr(item, specs.icon) ?? null,
|
|
@@ -16987,7 +17050,8 @@ function parseListItemXmlNode(item) {
|
|
|
16987
17050
|
selectedIcon: readXmlAttr(item, specs.selectedIcon) ?? null,
|
|
16988
17051
|
level: parseInt2(readXmlAttr(item, specs.level)),
|
|
16989
17052
|
isFolder: isFolder !== void 0 ? parseBool(isFolder) : null,
|
|
16990
|
-
...controllers !== void 0 ? { controllers } : {}
|
|
17053
|
+
...controllers !== void 0 ? { controllers } : {},
|
|
17054
|
+
...propertyOverrides.length > 0 ? { propertyOverrides } : {}
|
|
16991
17055
|
};
|
|
16992
17056
|
}
|
|
16993
17057
|
function parseComboBoxItemXmlNode(item) {
|
|
@@ -18054,6 +18118,8 @@ function createDisplayObject$1(ctx, doc, tagName, attrs, localControllers) {
|
|
|
18054
18118
|
if (scrollItemToViewOnClick !== void 0) g.setScrollItemToViewOnClick?.(parseBool(scrollItemToViewOnClick));
|
|
18055
18119
|
const foldInvisibleItems = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.foldInvisibleItems);
|
|
18056
18120
|
if (foldInvisibleItems !== void 0) g.setFoldInvisibleItems?.(parseBool(foldInvisibleItems));
|
|
18121
|
+
const autoClearItems = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.autoClearItems);
|
|
18122
|
+
if (autoClearItems !== void 0) g.setAutoClearItems?.(parseBool(autoClearItems));
|
|
18057
18123
|
const listItemChildName = getProtocolChildName$2(PROJECT_XML_PROTOCOL.list, "item");
|
|
18058
18124
|
const items = listItemChildName ? ensureArray(attrs[listItemChildName]) : [];
|
|
18059
18125
|
if (items.length > 0) {
|
|
@@ -18092,6 +18158,7 @@ function createDisplayObject$1(ctx, doc, tagName, attrs, localControllers) {
|
|
|
18092
18158
|
obj.addRelation(rel);
|
|
18093
18159
|
}
|
|
18094
18160
|
}
|
|
18161
|
+
if (obj.propertyType === "GComponent") obj.setPropertyOverrides(parsePropertyOverrides(attrs, PROJECT_XML_PROTOCOL.componentInstance));
|
|
18095
18162
|
for (const extTypeName of getProtocolExtensionChildNames(PROJECT_XML_PROTOCOL.componentInstance)) {
|
|
18096
18163
|
const extElement = attrs[extTypeName];
|
|
18097
18164
|
if (extElement) {
|
|
@@ -18128,6 +18195,8 @@ function createDisplayObject$1(ctx, doc, tagName, attrs, localControllers) {
|
|
|
18128
18195
|
if (selectionController !== void 0) componentObj.setInstanceSelectionController?.(selectionController);
|
|
18129
18196
|
const visibleItemCount = extSpecs.visibleItemCount ? readXmlAttr(extAttrs, extSpecs.visibleItemCount) : void 0;
|
|
18130
18197
|
if (visibleItemCount !== void 0) componentObj.setInstanceVisibleItemCount?.(parseInt2(visibleItemCount));
|
|
18198
|
+
const autoClearItems = extSpecs.autoClearItems ? readXmlAttr(extAttrs, extSpecs.autoClearItems) : void 0;
|
|
18199
|
+
if (autoClearItems !== void 0) componentObj.setInstanceAutoClearItems?.(parseBool(autoClearItems));
|
|
18131
18200
|
const value = extSpecs.value ? readXmlAttr(extAttrs, extSpecs.value) : void 0;
|
|
18132
18201
|
if (value !== void 0) componentObj.setInstanceValue?.(parseInt2(value));
|
|
18133
18202
|
const max = extSpecs.max ? readXmlAttr(extAttrs, extSpecs.max) : void 0;
|
|
@@ -18237,38 +18306,57 @@ function appendOrderedValue(target, key, value) {
|
|
|
18237
18306
|
}
|
|
18238
18307
|
target[key] = [current, value];
|
|
18239
18308
|
}
|
|
18240
|
-
function
|
|
18309
|
+
function getOrderedElementEntries(entries) {
|
|
18310
|
+
return entries.filter((entry) => Object.keys(entry).some((key) => key !== ":@" && key !== "#text"));
|
|
18311
|
+
}
|
|
18312
|
+
function normalizeOrderedChildren(entries, rawEntries = []) {
|
|
18241
18313
|
const out = {};
|
|
18242
|
-
|
|
18314
|
+
const elements = getOrderedElementEntries(entries);
|
|
18315
|
+
const rawElements = getOrderedElementEntries(rawEntries);
|
|
18316
|
+
for (const [index, entry] of elements.entries()) {
|
|
18243
18317
|
const attrs = entry[":@"] ?? {};
|
|
18318
|
+
const rawEntry = rawElements[index] ?? {};
|
|
18319
|
+
const rawAttrs = rawEntry[":@"] ?? {};
|
|
18244
18320
|
for (const [tagName, value] of Object.entries(entry)) {
|
|
18245
18321
|
if (tagName === ":@" || tagName === "#text") continue;
|
|
18246
|
-
const normalizedChildren = normalizeOrderedChildren(Array.isArray(value) ? value : []);
|
|
18247
|
-
|
|
18322
|
+
const normalizedChildren = normalizeOrderedChildren(Array.isArray(value) ? value : [], Array.isArray(rawEntry[tagName]) ? rawEntry[tagName] : []);
|
|
18323
|
+
const normalizedAttrs = tagName === "property" && typeof rawAttrs.value === "string" ? {
|
|
18248
18324
|
...attrs,
|
|
18325
|
+
value: rawAttrs.value
|
|
18326
|
+
} : attrs;
|
|
18327
|
+
appendOrderedValue(out, tagName, Object.keys(normalizedChildren).length > 0 ? {
|
|
18328
|
+
...normalizedAttrs,
|
|
18249
18329
|
...normalizedChildren
|
|
18250
|
-
} : { ...
|
|
18330
|
+
} : { ...normalizedAttrs });
|
|
18251
18331
|
}
|
|
18252
18332
|
}
|
|
18253
18333
|
return out;
|
|
18254
18334
|
}
|
|
18255
18335
|
function getOrderedDisplayListItems(xmlContent) {
|
|
18256
|
-
const
|
|
18336
|
+
const ordered = parseXMLPreserveOrder(xmlContent);
|
|
18337
|
+
const rawOrdered = parseXMLPreserveOrderRaw(xmlContent);
|
|
18338
|
+
const componentEntry = ordered.find((entry) => "component" in entry);
|
|
18339
|
+
const rawComponentEntry = rawOrdered.find((entry) => "component" in entry);
|
|
18257
18340
|
if (!componentEntry) return [];
|
|
18258
18341
|
const displayListEntry = (Array.isArray(componentEntry.component) ? componentEntry.component : []).find((entry) => "displayList" in entry);
|
|
18342
|
+
const rawDisplayListEntry = (Array.isArray(rawComponentEntry?.component) ? rawComponentEntry.component : []).find((entry) => "displayList" in entry);
|
|
18259
18343
|
if (!displayListEntry) return [];
|
|
18260
|
-
|
|
18344
|
+
const displayListChildren = Array.isArray(displayListEntry.displayList) ? getOrderedElementEntries(displayListEntry.displayList) : [];
|
|
18345
|
+
const rawDisplayListChildren = Array.isArray(rawDisplayListEntry?.displayList) ? getOrderedElementEntries(rawDisplayListEntry.displayList) : [];
|
|
18346
|
+
return displayListChildren.flatMap((entry, index) => {
|
|
18261
18347
|
const rawTagName = Object.keys(entry).find((key) => key !== ":@" && key !== "#text");
|
|
18262
18348
|
if (!rawTagName) return [];
|
|
18263
18349
|
const attrs = entry[":@"] ?? {};
|
|
18264
18350
|
const nestedEntries = Array.isArray(entry[rawTagName]) ? entry[rawTagName] : [];
|
|
18351
|
+
const rawEntry = rawDisplayListChildren[index] ?? {};
|
|
18352
|
+
const rawNestedEntries = Array.isArray(rawEntry[rawTagName]) ? rawEntry[rawTagName] : [];
|
|
18265
18353
|
const rawAttrs = readRawDisplayListAttrs(xmlContent, rawTagName, attrs.id);
|
|
18266
18354
|
return [{
|
|
18267
18355
|
tagName: rawTagName.toLowerCase(),
|
|
18268
18356
|
attrs: {
|
|
18269
18357
|
...rawAttrs,
|
|
18270
18358
|
...attrs,
|
|
18271
|
-
...normalizeOrderedChildren(nestedEntries)
|
|
18359
|
+
...normalizeOrderedChildren(nestedEntries, rawNestedEntries)
|
|
18272
18360
|
}
|
|
18273
18361
|
}];
|
|
18274
18362
|
});
|
|
@@ -18470,6 +18558,7 @@ function readComponentXml(ctx, comp, xmlContent) {
|
|
|
18470
18558
|
case "ComboBox":
|
|
18471
18559
|
if (readXmlAttr(extAttrs, EXTENSION_PROTOCOL_MAP$1.ComboBox.attrs.dropdown) !== void 0) comp.setDropdown?.(String(readXmlAttr(extAttrs, EXTENSION_PROTOCOL_MAP$1.ComboBox.attrs.dropdown)));
|
|
18472
18560
|
if (readXmlAttr(extAttrs, EXTENSION_PROTOCOL_MAP$1.ComboBox.attrs.selectionController) !== void 0) comp.setSelectionController?.(String(readXmlAttr(extAttrs, EXTENSION_PROTOCOL_MAP$1.ComboBox.attrs.selectionController)));
|
|
18561
|
+
if (readXmlAttr(extAttrs, EXTENSION_PROTOCOL_MAP$1.ComboBox.attrs.autoClearItems) !== void 0) comp.setAutoClearItems?.(parseBool(readXmlAttr(extAttrs, EXTENSION_PROTOCOL_MAP$1.ComboBox.attrs.autoClearItems)));
|
|
18473
18562
|
break;
|
|
18474
18563
|
case "Label":
|
|
18475
18564
|
if (readXmlAttr(extAttrs, EXTENSION_PROTOCOL_MAP$1.Label.attrs.prompt) !== void 0) comp.setPromptText?.(String(readXmlAttr(extAttrs, EXTENSION_PROTOCOL_MAP$1.Label.attrs.prompt)));
|
|
@@ -19552,6 +19641,16 @@ function serializeListItemXmlNode(item, options) {
|
|
|
19552
19641
|
if (item.level !== void 0 && item.level !== null && ((options?.forceLevel ?? false) || item.level !== 0 || item.isFolder === true)) writeXmlAttr(attrs, specs.level, String(item.level));
|
|
19553
19642
|
if (item.isFolder !== void 0 && item.isFolder !== null) writeXmlAttr(attrs, specs.isFolder, item.isFolder ? "true" : "false");
|
|
19554
19643
|
if (item.controllers !== void 0 && item.controllers !== null) writeXmlAttr(attrs, specs.controllers, item.controllers);
|
|
19644
|
+
const propertyChildName = getProtocolChildName(PROJECT_XML_PROTOCOL.listItem, "property");
|
|
19645
|
+
if (propertyChildName && item.propertyOverrides?.length) attrs[propertyChildName] = item.propertyOverrides.map(serializePropertyOverrideXmlNode);
|
|
19646
|
+
return attrs;
|
|
19647
|
+
}
|
|
19648
|
+
function serializePropertyOverrideXmlNode(property) {
|
|
19649
|
+
const attrs = {};
|
|
19650
|
+
const specs = PROJECT_XML_PROTOCOL.propertyOverride.attrs;
|
|
19651
|
+
writeXmlAttr(attrs, specs.target, property.target);
|
|
19652
|
+
writeXmlAttr(attrs, specs.propertyId, String(property.propertyId));
|
|
19653
|
+
writeXmlAttr(attrs, specs.value, property.value);
|
|
19555
19654
|
return attrs;
|
|
19556
19655
|
}
|
|
19557
19656
|
function serializeComboBoxItemXmlNode(item) {
|
|
@@ -20034,6 +20133,7 @@ function serializeChild(obj) {
|
|
|
20034
20133
|
if (clipSoftness && ((clipSoftness.x ?? 0) !== 0 || (clipSoftness.y ?? 0) !== 0)) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.clipSoftness, `${clipSoftness.x ?? 0},${clipSoftness.y ?? 0}`);
|
|
20035
20134
|
if (typedObj.getScrollItemToViewOnClick?.() === false) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.scrollItemToViewOnClick, "false");
|
|
20036
20135
|
if (typedObj.getFoldInvisibleItems?.() === true) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.foldInvisibleItems, "true");
|
|
20136
|
+
if (typedObj.getAutoClearItems?.() === true) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.autoClearItems, "true");
|
|
20037
20137
|
const listItems = typedObj.getListItems?.() ?? [];
|
|
20038
20138
|
const listItemChildName = getProtocolChildName(PROJECT_XML_PROTOCOL.list, "item");
|
|
20039
20139
|
if (listItems.length > 0 && listItemChildName) attrs[listItemChildName] = listItems.map((item) => serializeListItemXmlNode(item, { forceLevel: isTree }));
|
|
@@ -20101,6 +20201,9 @@ function serializeChild(obj) {
|
|
|
20101
20201
|
}
|
|
20102
20202
|
}
|
|
20103
20203
|
if (type === "GComponent") {
|
|
20204
|
+
const propertyOverrides = typedObj.getPropertyOverrides?.() ?? [];
|
|
20205
|
+
const propertyChildName = getProtocolChildName(PROJECT_XML_PROTOCOL.componentInstance, "property");
|
|
20206
|
+
if (propertyChildName && propertyOverrides.length > 0) attrs[propertyChildName] = propertyOverrides.map(serializePropertyOverrideXmlNode);
|
|
20104
20207
|
const instanceExtType = typedObj.getInstanceExtType?.() ?? "";
|
|
20105
20208
|
if (instanceExtType) {
|
|
20106
20209
|
const extSpecs = EXTENSION_PROTOCOL_MAP[instanceExtType].attrs;
|
|
@@ -20119,6 +20222,7 @@ function serializeChild(obj) {
|
|
|
20119
20222
|
if (typedObj.getInstancePromptText?.() && extSpecs.prompt) writeXmlAttr(extAttrs, extSpecs.prompt, typedObj.getInstancePromptText?.());
|
|
20120
20223
|
if (typedObj.getInstanceSelectionController?.() && extSpecs.selectionController) writeXmlAttr(extAttrs, extSpecs.selectionController, typedObj.getInstanceSelectionController?.());
|
|
20121
20224
|
if ((typedObj.getInstanceVisibleItemCount?.() ?? 0) > 0 && extSpecs.visibleItemCount) writeXmlAttr(extAttrs, extSpecs.visibleItemCount, String(typedObj.getInstanceVisibleItemCount?.() ?? 0));
|
|
20225
|
+
if (typedObj.getInstanceAutoClearItems?.() && extSpecs.autoClearItems) writeXmlAttr(extAttrs, extSpecs.autoClearItems, "true");
|
|
20122
20226
|
const instanceValue = typedObj.getInstanceValue?.() ?? 0;
|
|
20123
20227
|
const instanceMax = typedObj.getInstanceMax?.() ?? 0;
|
|
20124
20228
|
const instanceMin = typedObj.getInstanceMin?.() ?? 0;
|
|
@@ -20388,6 +20492,7 @@ async function writeComponent(fs, comp, pkgDir, sourceRelativePath) {
|
|
|
20388
20492
|
case "ComboBox":
|
|
20389
20493
|
if (typedComp.getDropdown?.()) writeXmlAttr(extAttrs, extSpecs.dropdown, typedComp.getDropdown?.());
|
|
20390
20494
|
if (typedComp.getSelectionController?.()) writeXmlAttr(extAttrs, extSpecs.selectionController, typedComp.getSelectionController?.());
|
|
20495
|
+
if (typedComp.getAutoClearItems?.()) writeXmlAttr(extAttrs, extSpecs.autoClearItems, "true");
|
|
20391
20496
|
break;
|
|
20392
20497
|
case "Label":
|
|
20393
20498
|
if (typedComp.getPromptText?.()) writeXmlAttr(extAttrs, extSpecs.prompt, typedComp.getPromptText?.());
|
|
@@ -25577,8 +25682,11 @@ async function collectImage(resource, pkg, inputs, encoder, options, doTrim, log
|
|
|
25577
25682
|
}).png().toBuffer();
|
|
25578
25683
|
sourceHasAlpha = true;
|
|
25579
25684
|
}
|
|
25580
|
-
} catch {
|
|
25581
|
-
if (options.strictOutput)
|
|
25685
|
+
} catch (error) {
|
|
25686
|
+
if (options.strictOutput) {
|
|
25687
|
+
const detail = error instanceof Error && error.message.startsWith("publishBrowser:") ? ` ${error.message}` : "";
|
|
25688
|
+
throw new Error(`atlas: Could not read image "${filePath}".${detail}`);
|
|
25689
|
+
}
|
|
25582
25690
|
if (origW === 0 || origH === 0) {
|
|
25583
25691
|
logger.warn(`atlas: Could not read image "${filePath}", skipping.`);
|
|
25584
25692
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfairygui/cli",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.37",
|
|
4
4
|
"description": "FairyGUI Headless Authoring SDK — command-line interface.",
|
|
5
5
|
"author": "OpenFairyGUI Contributors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"restore"
|
|
34
34
|
],
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@openfairygui/
|
|
37
|
-
"@openfairygui/
|
|
36
|
+
"@openfairygui/functions": "0.2.0-alpha.37",
|
|
37
|
+
"@openfairygui/core": "0.2.0-alpha.37"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"commander": "^14.0.2",
|
|
41
41
|
"jiti": "^2.7.0",
|
|
42
|
-
"@openfairygui/backend": "0.2.0-alpha.
|
|
42
|
+
"@openfairygui/backend": "0.2.0-alpha.37"
|
|
43
43
|
},
|
|
44
44
|
"optionalDependencies": {
|
|
45
45
|
"sharp": ">=0.33.0"
|