@openfairygui/cli 0.6.2 → 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 +22 -5
  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.2`;
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. */
@@ -10605,6 +10605,10 @@ function validateDisplayNode(node, controllerMap, knownChildIds, knownGroupIds,
10605
10605
  if (typeof node.pivotAsAnchor !== "boolean") pushIssue(issues, `${path}.pivotAsAnchor`, "Display node pivotAsAnchor must be boolean.");
10606
10606
  }
10607
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
+ }
10608
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.");
10609
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.");
10610
10614
  if (node.kind === "list" || node.kind === "tree") {
@@ -17447,7 +17451,8 @@ function liftComponentDerivedControlBase(child) {
17447
17451
  ...liftDisplayNodeBase(child),
17448
17452
  group: child.getGroup(),
17449
17453
  src: child.getSrc(),
17450
- packageId: child.getPackageId()
17454
+ packageId: child.getPackageId(),
17455
+ ...child.getPageController() ? { pageController: child.getPageController() } : {}
17451
17456
  };
17452
17457
  }
17453
17458
  function liftTitleControlBase(child) {
@@ -17836,6 +17841,7 @@ function liftDisplayNode(child) {
17836
17841
  resourceId: component.getSrc()
17837
17842
  },
17838
17843
  ...component.getControllerOverrides() ? { controllerOverrides: component.getControllerOverrides() } : {},
17844
+ ...component.getPageController() ? { pageController: component.getPageController() } : {},
17839
17845
  ...component.getFileName() ? { fileName: component.getFileName() } : {},
17840
17846
  ...propertyOverrides.length > 0 ? { propertyOverrides } : {},
17841
17847
  ...instanceProperties ? { instanceProperties } : {}
@@ -21999,13 +22005,13 @@ function normalizeGearSizeSegment(segment, fixedScale, omitIdentityScale) {
21999
22005
  const parts = segment.split(",");
22000
22006
  if (parts.length < 2) return segment;
22001
22007
  const normalized = [formatProjectInt32(Number(parts[0] ?? 0), "gearSize width"), formatProjectInt32(Number(parts[1] ?? 0), "gearSize height")];
22002
- if (parts.length >= 4) {
22008
+ if (parts.length >= 4 || !omitIdentityScale) {
22003
22009
  if (omitIdentityScale && isIdentityGearSizeScale(segment)) return normalized.join(",");
22004
22010
  const scaleFormatter = fixedScale ? (value) => {
22005
22011
  const numeric = Number(value);
22006
22012
  return Number.isFinite(numeric) ? numeric.toFixed(2) : String(value ?? "");
22007
22013
  } : (value) => formatTrimmedFixed$1(Number(value ?? 0), 2);
22008
- normalized.push(scaleFormatter(parts[2]), scaleFormatter(parts[3]));
22014
+ normalized.push(scaleFormatter(parts[2] ?? "1"), scaleFormatter(parts[3] ?? "1"));
22009
22015
  }
22010
22016
  return normalized.join(",");
22011
22017
  }
@@ -22019,6 +22025,12 @@ function normalizeGearXYSegment(segment) {
22019
22025
  ...parts.slice(2)
22020
22026
  ].join(",");
22021
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
+ }
22022
22034
  function shouldCompactTextGearColor(ownerType, ownerName) {
22023
22035
  return (ownerType === "GTextField" || ownerType === "GRichTextField" || ownerType === "GTextInput") && ownerName === "title";
22024
22036
  }
@@ -22040,6 +22052,7 @@ function normalizeGearXmlValue(gearType, value, ownerType, ownerName, gear) {
22040
22052
  const compactOutline = !(ownerType === "GTextField" || ownerType === "GRichTextField" || ownerType === "GTextInput") || shouldCompactTextGearColor(ownerType, ownerName);
22041
22053
  return raw.split("|").map((segment) => normalizeGearColorSegment(segment, compactOutline)).join("|");
22042
22054
  }
22055
+ case GearType.Animation: return raw.split("|").map(normalizeGearAnimationSegment).join("|");
22043
22056
  default: return raw;
22044
22057
  }
22045
22058
  }
@@ -22571,6 +22584,10 @@ function serializeChild(obj) {
22571
22584
  if (type === "GGroup") writeGroupXmlAttributes(attrs, obj);
22572
22585
  if (type === "GList" || type === "GTree") writeListXmlNode(attrs, obj);
22573
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
+ }
22574
22591
  const objectProtocol = DISPLAY_OBJECT_PROTOCOL_BY_TYPE[type] ?? PROJECT_XML_PROTOCOL.componentInstance;
22575
22592
  writeCommonDisplayState(attrs, obj, objectProtocol);
22576
22593
  writeDisplayObjectBehaviors(attrs, obj, objectProtocol);
@@ -33301,7 +33318,7 @@ function registerValidateCommand(program) {
33301
33318
  //#region src/utils/package-version.ts
33302
33319
  const require$1 = createRequire(import.meta.url);
33303
33320
  function getInjectedPackageVersion() {
33304
- const version = "0.6.2";
33321
+ const version = "0.6.3";
33305
33322
  return typeof version === "string" && true ? version : null;
33306
33323
  }
33307
33324
  function readPackageVersion() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfairygui/cli",
3
- "version": "0.6.2",
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.2",
40
- "@openfairygui/functions": "0.6.2"
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.2"
45
+ "@openfairygui/backend": "0.6.3"
46
46
  },
47
47
  "optionalDependencies": {
48
48
  "sharp": ">=0.33.0"