@openfairygui/cli 0.6.1 → 0.6.3

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.
Files changed (2) hide show
  1. package/dist/cli.mjs +25 -6
  2. package/package.json +4 -4
package/dist/cli.mjs CHANGED
@@ -910,7 +910,7 @@ var ExtensibleProperty = class extends Property {
910
910
  };
911
911
  //#endregion
912
912
  //#region ../core/src/constants.ts
913
- const VERSION = `v0.6.1`;
913
+ const VERSION = `v0.6.3`;
914
914
  /** Binary package file magic number: "FGUI" as uint32. */
915
915
  const FGUI_MAGIC = 1179080009;
916
916
  /** Null string index in the binary string table. */
@@ -10604,6 +10604,11 @@ function validateDisplayNode(node, controllerMap, knownChildIds, knownGroupIds,
10604
10604
  if (node.pivotAsAnchor !== void 0) {
10605
10605
  if (typeof node.pivotAsAnchor !== "boolean") pushIssue(issues, `${path}.pivotAsAnchor`, "Display node pivotAsAnchor must be boolean.");
10606
10606
  }
10607
+ if (node.kind === "component" && node.fileName !== void 0 && typeof node.fileName !== "string") pushIssue(issues, `${path}.fileName`, "Component file name hint must be a string.");
10608
+ if ((node.kind === "component" || node.kind === "button" || node.kind === "label" || node.kind === "comboBox" || node.kind === "progressBar" || node.kind === "slider" || node.kind === "scrollBar") && node.pageController !== void 0) {
10609
+ if (typeof node.pageController !== "string") pushIssue(issues, `${path}.pageController`, "Component page controller must be a string.");
10610
+ else if (node.pageController && !controllerMap.has(node.pageController)) pushIssue(issues, `${path}.pageController`, `Unknown page controller "${node.pageController}".`);
10611
+ }
10607
10612
  if (node.kind === "component" && node.controllerOverrides !== void 0 && typeof node.controllerOverrides !== "string") pushIssue(issues, `${path}.controllerOverrides`, "Component controller overrides must be a string of controller name/page ID pairs.");
10608
10613
  if (node.kind === "component" && node.propertyOverrides !== void 0 && (!Array.isArray(node.propertyOverrides) || !node.propertyOverrides.every(isValidUamComponentPropertyOverride))) pushIssue(issues, `${path}.propertyOverrides`, "Component property overrides must contain a non-empty target, a non-negative integer propertyId, and a string value.");
10609
10614
  if (node.kind === "list" || node.kind === "tree") {
@@ -17446,7 +17451,8 @@ function liftComponentDerivedControlBase(child) {
17446
17451
  ...liftDisplayNodeBase(child),
17447
17452
  group: child.getGroup(),
17448
17453
  src: child.getSrc(),
17449
- packageId: child.getPackageId()
17454
+ packageId: child.getPackageId(),
17455
+ ...child.getPageController() ? { pageController: child.getPageController() } : {}
17450
17456
  };
17451
17457
  }
17452
17458
  function liftTitleControlBase(child) {
@@ -17835,6 +17841,8 @@ function liftDisplayNode(child) {
17835
17841
  resourceId: component.getSrc()
17836
17842
  },
17837
17843
  ...component.getControllerOverrides() ? { controllerOverrides: component.getControllerOverrides() } : {},
17844
+ ...component.getPageController() ? { pageController: component.getPageController() } : {},
17845
+ ...component.getFileName() ? { fileName: component.getFileName() } : {},
17838
17846
  ...propertyOverrides.length > 0 ? { propertyOverrides } : {},
17839
17847
  ...instanceProperties ? { instanceProperties } : {}
17840
17848
  };
@@ -21981,7 +21989,7 @@ function normalizeGearLookSegment(segment, fixedAlpha) {
21981
21989
  function normalizeGearColorSegment(segment, compactOutline) {
21982
21990
  if (!segment || segment === "-") return segment;
21983
21991
  const parts = segment.split(",");
21984
- if (parts.length === 1) return formatXmlColor(parts[0] ?? "");
21992
+ if (parts.length === 1 || parts.length === 2 && parts[1] === "") return formatXmlColor(parts[0] ?? "");
21985
21993
  const normalized = parts.map((part) => formatXmlColor(part));
21986
21994
  if (compactOutline && normalized.length >= 2 && isDefaultBlackColor(normalized[1])) return normalized[0] ?? "";
21987
21995
  return normalized.join(",");
@@ -21997,13 +22005,13 @@ function normalizeGearSizeSegment(segment, fixedScale, omitIdentityScale) {
21997
22005
  const parts = segment.split(",");
21998
22006
  if (parts.length < 2) return segment;
21999
22007
  const normalized = [formatProjectInt32(Number(parts[0] ?? 0), "gearSize width"), formatProjectInt32(Number(parts[1] ?? 0), "gearSize height")];
22000
- if (parts.length >= 4) {
22008
+ if (parts.length >= 4 || !omitIdentityScale) {
22001
22009
  if (omitIdentityScale && isIdentityGearSizeScale(segment)) return normalized.join(",");
22002
22010
  const scaleFormatter = fixedScale ? (value) => {
22003
22011
  const numeric = Number(value);
22004
22012
  return Number.isFinite(numeric) ? numeric.toFixed(2) : String(value ?? "");
22005
22013
  } : (value) => formatTrimmedFixed$1(Number(value ?? 0), 2);
22006
- normalized.push(scaleFormatter(parts[2]), scaleFormatter(parts[3]));
22014
+ normalized.push(scaleFormatter(parts[2] ?? "1"), scaleFormatter(parts[3] ?? "1"));
22007
22015
  }
22008
22016
  return normalized.join(",");
22009
22017
  }
@@ -22017,6 +22025,12 @@ function normalizeGearXYSegment(segment) {
22017
22025
  ...parts.slice(2)
22018
22026
  ].join(",");
22019
22027
  }
22028
+ function normalizeGearAnimationSegment(segment) {
22029
+ if (!segment || segment === "-") return segment;
22030
+ const parts = segment.split(",");
22031
+ while (parts.length > 2 && parts.at(-1) === "") parts.pop();
22032
+ return parts.join(",");
22033
+ }
22020
22034
  function shouldCompactTextGearColor(ownerType, ownerName) {
22021
22035
  return (ownerType === "GTextField" || ownerType === "GRichTextField" || ownerType === "GTextInput") && ownerName === "title";
22022
22036
  }
@@ -22038,6 +22052,7 @@ function normalizeGearXmlValue(gearType, value, ownerType, ownerName, gear) {
22038
22052
  const compactOutline = !(ownerType === "GTextField" || ownerType === "GRichTextField" || ownerType === "GTextInput") || shouldCompactTextGearColor(ownerType, ownerName);
22039
22053
  return raw.split("|").map((segment) => normalizeGearColorSegment(segment, compactOutline)).join("|");
22040
22054
  }
22055
+ case GearType.Animation: return raw.split("|").map(normalizeGearAnimationSegment).join("|");
22041
22056
  default: return raw;
22042
22057
  }
22043
22058
  }
@@ -22569,6 +22584,10 @@ function serializeChild(obj) {
22569
22584
  if (type === "GGroup") writeGroupXmlAttributes(attrs, obj);
22570
22585
  if (type === "GList" || type === "GTree") writeListXmlNode(attrs, obj);
22571
22586
  const extension = type === "GComponent" ? writeComponentInstanceXmlNode(attrs, obj) : void 0;
22587
+ if (EXTENSION_TYPE[type]) {
22588
+ const pageController = obj.getPageController();
22589
+ if (pageController) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.componentInstance.attrs.pageController, pageController);
22590
+ }
22572
22591
  const objectProtocol = DISPLAY_OBJECT_PROTOCOL_BY_TYPE[type] ?? PROJECT_XML_PROTOCOL.componentInstance;
22573
22592
  writeCommonDisplayState(attrs, obj, objectProtocol);
22574
22593
  writeDisplayObjectBehaviors(attrs, obj, objectProtocol);
@@ -33299,7 +33318,7 @@ function registerValidateCommand(program) {
33299
33318
  //#region src/utils/package-version.ts
33300
33319
  const require$1 = createRequire(import.meta.url);
33301
33320
  function getInjectedPackageVersion() {
33302
- const version = "0.6.1";
33321
+ const version = "0.6.3";
33303
33322
  return typeof version === "string" && true ? version : null;
33304
33323
  }
33305
33324
  function readPackageVersion() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfairygui/cli",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "FairyGUI Headless Authoring SDK — command-line interface.",
5
5
  "author": "OpenFairyGUI Contributors",
6
6
  "license": "MIT",
@@ -36,13 +36,13 @@
36
36
  "restore"
37
37
  ],
38
38
  "devDependencies": {
39
- "@openfairygui/core": "0.6.1",
40
- "@openfairygui/functions": "0.6.1"
39
+ "@openfairygui/functions": "0.6.3",
40
+ "@openfairygui/core": "0.6.3"
41
41
  },
42
42
  "dependencies": {
43
43
  "commander": "^14.0.2",
44
44
  "jiti": "^2.7.0",
45
- "@openfairygui/backend": "0.6.1"
45
+ "@openfairygui/backend": "0.6.3"
46
46
  },
47
47
  "optionalDependencies": {
48
48
  "sharp": ">=0.33.0"