@openfairygui/cli 0.2.0-alpha.18 → 0.2.0-alpha.19

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 +258 -59
  2. package/package.json +4 -4
package/dist/cli.mjs CHANGED
@@ -3009,6 +3009,9 @@ var GObject = class extends ExtensibleProperty {
3009
3009
  sourceHeight: 0,
3010
3010
  initWidth: 0,
3011
3011
  initHeight: 0,
3012
+ pivotX: 0,
3013
+ pivotY: 0,
3014
+ anchor: false,
3012
3015
  customData: "",
3013
3016
  relations: [],
3014
3017
  gears: new RefList()
@@ -3050,6 +3053,23 @@ var GObject = class extends ExtensibleProperty {
3050
3053
  setInitHeight(v) {
3051
3054
  return this.setObjectProp("initHeight", v);
3052
3055
  }
3056
+ getPivotX() {
3057
+ return this.getObjectProp("pivotX");
3058
+ }
3059
+ getPivotY() {
3060
+ return this.getObjectProp("pivotY");
3061
+ }
3062
+ getPivotAsAnchor() {
3063
+ return this.getObjectProp("anchor");
3064
+ }
3065
+ setPivot(x, y, anchor = false) {
3066
+ this.setObjectProp("pivotX", x);
3067
+ this.setObjectProp("pivotY", y);
3068
+ return this.setObjectProp("anchor", anchor);
3069
+ }
3070
+ setPivotAsAnchor(v) {
3071
+ return this.setObjectProp("anchor", v);
3072
+ }
3053
3073
  getCustomData() {
3054
3074
  return this.getObjectProp("customData");
3055
3075
  }
@@ -3330,6 +3350,9 @@ var GTextField = class extends GObject {
3330
3350
  y: 0,
3331
3351
  width: 0,
3332
3352
  height: 0,
3353
+ pivotX: 0,
3354
+ pivotY: 0,
3355
+ anchor: false,
3333
3356
  minWidth: 0,
3334
3357
  maxWidth: 0,
3335
3358
  minHeight: 0,
@@ -3433,6 +3456,23 @@ var GTextField = class extends GObject {
3433
3456
  setY(v) {
3434
3457
  return this.setTextFieldProp("y", v);
3435
3458
  }
3459
+ getPivotX() {
3460
+ return this.getTextFieldProp("pivotX");
3461
+ }
3462
+ getPivotY() {
3463
+ return this.getTextFieldProp("pivotY");
3464
+ }
3465
+ getPivotAsAnchor() {
3466
+ return this.getTextFieldProp("anchor");
3467
+ }
3468
+ setPivot(x, y, anchor = false) {
3469
+ this.setTextFieldProp("pivotX", x);
3470
+ this.setTextFieldProp("pivotY", y);
3471
+ return this.setTextFieldProp("anchor", anchor);
3472
+ }
3473
+ setPivotAsAnchor(v) {
3474
+ return this.setTextFieldProp("anchor", v);
3475
+ }
3436
3476
  getGroup() {
3437
3477
  return this.getTextFieldProp("group");
3438
3478
  }
@@ -4075,6 +4115,7 @@ var GLoader = class extends GObject {
4075
4115
  height: 0,
4076
4116
  pivotX: 0,
4077
4117
  pivotY: 0,
4118
+ anchor: false,
4078
4119
  scaleX: 1,
4079
4120
  scaleY: 1,
4080
4121
  alpha: 1,
@@ -4151,9 +4192,16 @@ var GLoader = class extends GObject {
4151
4192
  getPivotY() {
4152
4193
  return this.get("pivotY");
4153
4194
  }
4154
- setPivot(x, y) {
4195
+ getPivotAsAnchor() {
4196
+ return this.get("anchor");
4197
+ }
4198
+ setPivot(x, y, anchor = false) {
4155
4199
  this.set("pivotX", x);
4156
- return this.set("pivotY", y);
4200
+ this.set("pivotY", y);
4201
+ return this.set("anchor", anchor);
4202
+ }
4203
+ setPivotAsAnchor(v) {
4204
+ return this.set("anchor", v);
4157
4205
  }
4158
4206
  getScaleX() {
4159
4207
  return this.get("scaleX");
@@ -4516,9 +4564,13 @@ var GMovieClip = class extends GObject {
4516
4564
  getPivotY() {
4517
4565
  return this.get("pivotY");
4518
4566
  }
4519
- setPivot(x, y) {
4567
+ getPivotAsAnchor() {
4568
+ return this.get("anchor");
4569
+ }
4570
+ setPivot(x, y, anchor = false) {
4520
4571
  this.set("pivotX", x);
4521
- return this.set("pivotY", y);
4572
+ this.set("pivotY", y);
4573
+ return this.set("anchor", anchor);
4522
4574
  }
4523
4575
  getGroup() {
4524
4576
  return this.get("group");
@@ -5021,6 +5073,9 @@ var GListBase = class extends GObject {
5021
5073
  y: 0,
5022
5074
  width: 0,
5023
5075
  height: 0,
5076
+ pivotX: 0,
5077
+ pivotY: 0,
5078
+ anchor: false,
5024
5079
  group: "",
5025
5080
  alpha: 1,
5026
5081
  rotation: 0,
@@ -5106,6 +5161,23 @@ var GListBase = class extends GObject {
5106
5161
  setY(v) {
5107
5162
  return this.setListProp("y", v);
5108
5163
  }
5164
+ getPivotX() {
5165
+ return this.getListProp("pivotX");
5166
+ }
5167
+ getPivotY() {
5168
+ return this.getListProp("pivotY");
5169
+ }
5170
+ getPivotAsAnchor() {
5171
+ return this.getListProp("anchor");
5172
+ }
5173
+ setPivot(x, y, anchor = false) {
5174
+ this.setListProp("pivotX", x);
5175
+ this.setListProp("pivotY", y);
5176
+ return this.setListProp("anchor", anchor);
5177
+ }
5178
+ setPivotAsAnchor(v) {
5179
+ return this.setListProp("anchor", v);
5180
+ }
5109
5181
  getAlpha() {
5110
5182
  return this.getListProp("alpha");
5111
5183
  }
@@ -9546,14 +9618,12 @@ const ASPECT_ATTRS = { aspect: { canonical: "aspect" } };
9546
9618
  const PIVOT_ATTRS = { pivot: { canonical: "pivot" } };
9547
9619
  const ANCHOR_ATTRS = { anchor: { canonical: "anchor" } };
9548
9620
  const SCALE_ATTRS = { scale: { canonical: "scale" } };
9621
+ const SKEW_ATTRS = { skew: { canonical: "skew" } };
9549
9622
  const GROUP_REF_ATTRS = { group: { canonical: "group" } };
9550
- const ROTATION_ALPHA_ATTRS = {
9623
+ const COMMON_DISPLAY_STATE_ATTRS = mergeAttrs({
9551
9624
  rotation: { canonical: "rotation" },
9552
9625
  alpha: { canonical: "alpha" }
9553
- };
9554
- const VISIBLE_ATTRS = { visible: { canonical: "visible" } };
9555
- const TOUCHABLE_ATTRS = { touchable: { canonical: "touchable" } };
9556
- const GRAYED_ATTRS = { grayed: { canonical: "grayed" } };
9626
+ }, { visible: { canonical: "visible" } }, { touchable: { canonical: "touchable" } }, { grayed: { canonical: "grayed" } });
9557
9627
  const INSTANCE_MISC_PANEL_ATTRS = {
9558
9628
  tooltips: { canonical: "tooltips" },
9559
9629
  customData: { canonical: "customData" }
@@ -9613,7 +9683,6 @@ const IMAGE_PANEL_ATTRS = {
9613
9683
  fillAmount: { canonical: "fillAmount" }
9614
9684
  };
9615
9685
  const GRAPH_PANEL_ATTRS = {
9616
- skew: { canonical: "skew" },
9617
9686
  type: { canonical: "type" },
9618
9687
  lineSize: { canonical: "lineSize" },
9619
9688
  lineColor: { canonical: "lineColor" },
@@ -9730,10 +9799,8 @@ const LIST_PANEL_ATTRS = {
9730
9799
  canonical: "colGap",
9731
9800
  aliases: ["columnGap"]
9732
9801
  },
9733
- lineCount: {
9734
- canonical: "lineItemCount",
9735
- aliases: ["lineCount"]
9736
- },
9802
+ lineItemCount: { canonical: "lineItemCount" },
9803
+ lineItemCount2: { canonical: "lineItemCount2" },
9737
9804
  autoResizeItem: {
9738
9805
  canonical: "autoItemSize",
9739
9806
  aliases: ["autoResizeItem"]
@@ -9860,6 +9927,7 @@ const TRANSITION_ITEM_ATTRS = {
9860
9927
  label: { canonical: "label" },
9861
9928
  label2: { canonical: "label2" },
9862
9929
  path: { canonical: "path" },
9930
+ customEase: { canonical: "customEase" },
9863
9931
  ease: { canonical: "ease" },
9864
9932
  type: { canonical: "type" },
9865
9933
  value: { canonical: "value" },
@@ -9891,7 +9959,7 @@ const PACKAGE_IMAGE_RESOURCE_NODE = defineNode(PACKAGE_IMAGE_RESOURCE_ATTRS);
9891
9959
  const PACKAGE_FONT_RESOURCE_NODE = defineNode(PACKAGE_FONT_RESOURCE_ATTRS);
9892
9960
  const PACKAGE_MOVIE_CLIP_RESOURCE_NODE = defineNode(PACKAGE_MOVIE_CLIP_RESOURCE_ATTRS);
9893
9961
  const PACKAGE_SKELETON_RESOURCE_NODE = defineNode(PACKAGE_SKELETON_RESOURCE_ATTRS);
9894
- const DISPLAY_OBJECT_NODE = defineNode(DISPLAY_OBJECT_IDENTITY_ATTRS);
9962
+ const DISPLAY_OBJECT_NODE = defineNode(mergeAttrs(DISPLAY_OBJECT_IDENTITY_ATTRS, PIVOT_ATTRS, ANCHOR_ATTRS));
9895
9963
  const BUTTON_EXTENSION_NODE = defineNode(BUTTON_EXTENSION_ATTRS);
9896
9964
  const LABEL_EXTENSION_NODE = defineNode(LABEL_EXTENSION_ATTRS);
9897
9965
  const PROGRESSBAR_EXTENSION_NODE = defineNode(PROGRESSBAR_EXTENSION_ATTRS);
@@ -9946,17 +10014,17 @@ const WITH_ROOT_EXTENSION_CHILDREN = {
9946
10014
  };
9947
10015
  const CONTROLLER_NODE = defineNode(mergeAttrs(CONTROLLER_ATTRS), mergeChildren(WITH_CONTROLLER_ACTION_CHILDREN));
9948
10016
  const TRANSITION_NODE = defineNode(mergeAttrs(TRANSITION_ATTRS), mergeChildren(WITH_TRANSITION_ITEM_CHILDREN));
9949
- const IMAGE_NODE = defineNode(mergeAttrs(IMAGE_PANEL_ATTRS, XY_SIZE_ATTRS, LOCKED_ATTRS, ASPECT_ATTRS, PIVOT_ATTRS, ANCHOR_ATTRS, SCALE_ATTRS, GROUP_REF_ATTRS, ROTATION_ALPHA_ATTRS, VISIBLE_ATTRS, GRAYED_ATTRS, RESOURCE_LINK_ATTRS, FILTER_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN));
9950
- const GRAPH_NODE = defineNode(mergeAttrs(XY_SIZE_ATTRS, LOCKED_ATTRS, RESTRICT_SIZE_ATTRS, PIVOT_ATTRS, ANCHOR_ATTRS, GROUP_REF_ATTRS, ROTATION_ALPHA_ATTRS, VISIBLE_ATTRS, TOUCHABLE_ATTRS, GRAPH_PANEL_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN));
9951
- const MOVIE_CLIP_NODE = defineNode(mergeAttrs(MOVIE_CLIP_PANEL_ATTRS, XY_SIZE_ATTRS, PIVOT_ATTRS, GROUP_REF_ATTRS, ROTATION_ALPHA_ATTRS, VISIBLE_ATTRS, GRAYED_ATTRS, RESOURCE_LINK_ATTRS, FILTER_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN));
9952
- const COMPONENT_INSTANCE_NODE = defineNode(mergeAttrs(COMPONENT_INSTANCE_PANEL_ATTRS, XY_SIZE_ATTRS, LOCKED_ATTRS, RESTRICT_SIZE_ATTRS, ASPECT_ATTRS, PIVOT_ATTRS, ANCHOR_ATTRS, SCALE_ATTRS, GROUP_REF_ATTRS, ROTATION_ALPHA_ATTRS, VISIBLE_ATTRS, TOUCHABLE_ATTRS, GRAYED_ATTRS, INSTANCE_MISC_PANEL_ATTRS, RESOURCE_LINK_ATTRS, FILTER_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN, WITH_INSTANCE_EXTENSION_CHILDREN));
9953
- const LOADER_NODE = defineNode(mergeAttrs(XY_SIZE_ATTRS, PIVOT_ATTRS, SCALE_ATTRS, GROUP_REF_ATTRS, VISIBLE_ATTRS, GRAYED_ATTRS, LOADER_PANEL_ATTRS, FILTER_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN));
9954
- const LOADER3D_NODE = defineNode(mergeAttrs(XY_SIZE_ATTRS, VISIBLE_ATTRS, LOADER3D_PANEL_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN));
9955
- const TEXT_NODE = defineNode(mergeAttrs(XY_SIZE_ATTRS, RESTRICT_SIZE_ATTRS, { customData: { canonical: "customData" } }, GROUP_REF_ATTRS, ROTATION_ALPHA_ATTRS, VISIBLE_ATTRS, TOUCHABLE_ATTRS, GRAYED_ATTRS, TEXT_PANEL_ATTRS, TEXT_INPUT_PANEL_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN));
9956
- const TEXT_INPUT_NODE = defineNode(mergeAttrs(XY_SIZE_ATTRS, RESTRICT_SIZE_ATTRS, GROUP_REF_ATTRS, ROTATION_ALPHA_ATTRS, VISIBLE_ATTRS, TOUCHABLE_ATTRS, GRAYED_ATTRS, TEXT_PANEL_ATTRS, TEXT_INPUT_PANEL_ATTRS));
9957
- const RICH_TEXT_NODE = defineNode(mergeAttrs(XY_SIZE_ATTRS, GROUP_REF_ATTRS, ROTATION_ALPHA_ATTRS, VISIBLE_ATTRS, TOUCHABLE_ATTRS, GRAYED_ATTRS, TEXT_PANEL_ATTRS, RICH_TEXT_PANEL_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN));
9958
- const GROUP_NODE = defineNode(mergeAttrs(XY_SIZE_ATTRS, LOCKED_ATTRS, GROUP_REF_ATTRS, VISIBLE_ATTRS, GROUP_PANEL_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GROUP_GEAR_CHILDREN));
9959
- const LIST_NODE = defineNode(mergeAttrs(XY_SIZE_ATTRS, GROUP_REF_ATTRS, VISIBLE_ATTRS, TOUCHABLE_ATTRS, LIST_PANEL_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN, WITH_LIST_ITEM_CHILDREN));
10017
+ const IMAGE_NODE = defineNode(mergeAttrs(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));
10018
+ const GRAPH_NODE = defineNode(mergeAttrs(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));
10019
+ const MOVIE_CLIP_NODE = defineNode(mergeAttrs(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));
10020
+ const COMPONENT_INSTANCE_NODE = defineNode(mergeAttrs(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));
10021
+ const LOADER_NODE = defineNode(mergeAttrs(XY_SIZE_ATTRS, PIVOT_ATTRS, ANCHOR_ATTRS, SCALE_ATTRS, GROUP_REF_ATTRS, COMMON_DISPLAY_STATE_ATTRS, LOADER_PANEL_ATTRS, FILTER_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN));
10022
+ const LOADER3D_NODE = defineNode(mergeAttrs(XY_SIZE_ATTRS, PIVOT_ATTRS, ANCHOR_ATTRS, COMMON_DISPLAY_STATE_ATTRS, LOADER3D_PANEL_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN));
10023
+ const TEXT_NODE = defineNode(mergeAttrs(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));
10024
+ const TEXT_INPUT_NODE = defineNode(mergeAttrs(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));
10025
+ const RICH_TEXT_NODE = defineNode(mergeAttrs(XY_SIZE_ATTRS, RESTRICT_SIZE_ATTRS, PIVOT_ATTRS, ANCHOR_ATTRS, { customData: { canonical: "customData" } }, GROUP_REF_ATTRS, COMMON_DISPLAY_STATE_ATTRS, TEXT_PANEL_ATTRS, RICH_TEXT_PANEL_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN));
10026
+ const GROUP_NODE = defineNode(mergeAttrs(XY_SIZE_ATTRS, LOCKED_ATTRS, PIVOT_ATTRS, ANCHOR_ATTRS, GROUP_REF_ATTRS, COMMON_DISPLAY_STATE_ATTRS, GROUP_PANEL_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GROUP_GEAR_CHILDREN));
10027
+ const LIST_NODE = defineNode(mergeAttrs(XY_SIZE_ATTRS, PIVOT_ATTRS, ANCHOR_ATTRS, GROUP_REF_ATTRS, COMMON_DISPLAY_STATE_ATTRS, LIST_PANEL_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN, WITH_LIST_ITEM_CHILDREN));
9960
10028
  const DISPLAY_LIST_CONTAINER$2 = defineContainer({
9961
10029
  image: IMAGE_NODE,
9962
10030
  graph: GRAPH_NODE,
@@ -10054,6 +10122,21 @@ var ReaderContext = class {
10054
10122
  }
10055
10123
  };
10056
10124
  //#endregion
10125
+ //#region ../core/src/io/tree-item-hierarchy.ts
10126
+ /**
10127
+ * Resolves a tree item's folder state using the editor's flat hierarchy rules.
10128
+ *
10129
+ * Explicit values take precedence. An unspecified item is a folder only when
10130
+ * the following item is nested more deeply; trailing items are leaves.
10131
+ */
10132
+ function resolveTreeItemIsFolder(items, index) {
10133
+ const item = items[index];
10134
+ if (!item) return false;
10135
+ if (item.isFolder !== void 0 && item.isFolder !== null) return item.isFolder;
10136
+ const next = items[index + 1];
10137
+ return next !== void 0 && (next.level ?? 0) > (item.level ?? 0);
10138
+ }
10139
+ //#endregion
10057
10140
  //#region ../core/src/io/project-reader.ts
10058
10141
  /** Map ease type string to numeric code matching editor's EaseType.parseEaseType. */
10059
10142
  function _parseEaseType(ease) {
@@ -10368,22 +10451,9 @@ function assertDisplayListTagAllowed(tagName, attrs, componentName) {
10368
10451
  function inferTreeItemFolderFlags(items) {
10369
10452
  return items.map((item, index) => {
10370
10453
  if (item.isFolder !== null) return item;
10371
- const next = items[index + 1];
10372
- if (next && next.level > item.level) return {
10373
- ...item,
10374
- isFolder: true
10375
- };
10376
- if (next && next.level <= item.level) return {
10377
- ...item,
10378
- isFolder: false
10379
- };
10380
- if (!item.icon && !item.url) return {
10381
- ...item,
10382
- isFolder: true
10383
- };
10384
10454
  return {
10385
10455
  ...item,
10386
- isFolder: false
10456
+ isFolder: resolveTreeItemIsFolder(items, index)
10387
10457
  };
10388
10458
  });
10389
10459
  }
@@ -10411,6 +10481,19 @@ function parseComboBoxItemXmlNode(item) {
10411
10481
  icon: readXmlAttr(item, specs.icon) ?? null
10412
10482
  };
10413
10483
  }
10484
+ function readCommonDisplayState(source, object, protocol) {
10485
+ const specs = protocol.attrs;
10486
+ const alpha = specs.alpha ? readXmlAttr(source, specs.alpha) : void 0;
10487
+ if (alpha !== void 0) object.setAlpha?.(parseFloat2(alpha, 1));
10488
+ const rotation = specs.rotation ? readXmlAttr(source, specs.rotation) : void 0;
10489
+ if (rotation !== void 0) object.setRotation?.(parseFloat2(rotation));
10490
+ const visible = specs.visible ? readXmlAttr(source, specs.visible) : void 0;
10491
+ if (visible !== void 0) object.setVisible?.(parseBool(visible));
10492
+ const touchable = specs.touchable ? readXmlAttr(source, specs.touchable) : void 0;
10493
+ if (touchable !== void 0) object.setTouchable?.(parseBool(touchable));
10494
+ const grayed = specs.grayed ? readXmlAttr(source, specs.grayed) : void 0;
10495
+ if (grayed !== void 0) object.setGrayed?.(parseBool(grayed));
10496
+ }
10414
10497
  function getProjectBasePath(fs, projectPath) {
10415
10498
  const basePath = fs.dirname(projectPath);
10416
10499
  return basePath === "." ? "" : basePath;
@@ -11043,6 +11126,7 @@ var ProjectReader = class {
11043
11126
  const label = readXmlAttr(parsedItem, PROJECT_XML_PROTOCOL.transitionItem.attrs.label);
11044
11127
  const label2 = readXmlAttr(parsedItem, PROJECT_XML_PROTOCOL.transitionItem.attrs.label2);
11045
11128
  const pathValue = readXmlAttr(parsedItem, PROJECT_XML_PROTOCOL.transitionItem.attrs.path);
11129
+ const customEaseValue = readXmlAttr(parsedItem, PROJECT_XML_PROTOCOL.transitionItem.attrs.customEase);
11046
11130
  ti.setTime(parseFloat2(time));
11047
11131
  ti.setTargetId(target || "");
11048
11132
  ti.setTween(parseBool(tween));
@@ -11052,6 +11136,7 @@ var ProjectReader = class {
11052
11136
  ti.setLabel(label || "");
11053
11137
  if (label2 !== void 0) ti.setEndLabel?.(label2);
11054
11138
  if (pathValue !== void 0) ti.setPath?.(pathValue);
11139
+ if (customEaseValue !== void 0) ti.setCustomEasePath?.(customEaseValue);
11055
11140
  const ease = readXmlAttr(parsedItem, PROJECT_XML_PROTOCOL.transitionItem.attrs.ease);
11056
11141
  if (ease) ti.setEaseType?.(_parseEaseType(ease));
11057
11142
  const typeStr = (readXmlAttr(parsedItem, PROJECT_XML_PROTOCOL.transitionItem.attrs.type) || "").toUpperCase();
@@ -11119,6 +11204,11 @@ var ProjectReader = class {
11119
11204
  const [scaleX, scaleY] = parseXYString(imageScale);
11120
11205
  g.setScale(scaleX, scaleY);
11121
11206
  }
11207
+ const imageSkew = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.image.attrs.skew);
11208
+ if (imageSkew) {
11209
+ const [skewX, skewY] = parseXYString(imageSkew);
11210
+ g.setSkew(skewX, skewY);
11211
+ }
11122
11212
  const imageRotation = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.image.attrs.rotation);
11123
11213
  if (imageRotation !== void 0) g.setRotation(parseFloat2(imageRotation));
11124
11214
  const imageAlpha = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.image.attrs.alpha);
@@ -11181,6 +11271,12 @@ var ProjectReader = class {
11181
11271
  const [w, h] = parseSizeString(textSize);
11182
11272
  g.setSize(w, h);
11183
11273
  }
11274
+ const textPivot = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.text.attrs.pivot);
11275
+ if (textPivot) {
11276
+ const [pivotX, pivotY] = parseXYString(textPivot);
11277
+ const textAnchor = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.text.attrs.anchor);
11278
+ g.setPivot(pivotX, pivotY, parseBool(textAnchor));
11279
+ }
11184
11280
  const textRestrictSize = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.text.attrs.restrictSize);
11185
11281
  if (textRestrictSize) {
11186
11282
  const parts = textRestrictSize.split(",").map(Number);
@@ -11301,6 +11397,12 @@ var ProjectReader = class {
11301
11397
  const [w, h] = parseSizeString(richTextSize);
11302
11398
  g.setSize(w, h);
11303
11399
  }
11400
+ const richTextPivot = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.richText.attrs.pivot);
11401
+ if (richTextPivot) {
11402
+ const [pivotX, pivotY] = parseXYString(richTextPivot);
11403
+ const richTextAnchor = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.richText.attrs.anchor);
11404
+ g.setPivot(pivotX, pivotY, parseBool(richTextAnchor));
11405
+ }
11304
11406
  const richTextRestrictSize = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.richText.attrs.restrictSize);
11305
11407
  if (richTextRestrictSize) {
11306
11408
  const parts = richTextRestrictSize.split(",").map(Number);
@@ -11399,6 +11501,12 @@ var ProjectReader = class {
11399
11501
  const [w, h] = parseSizeString(inputSize);
11400
11502
  g.setSize(w, h);
11401
11503
  }
11504
+ const inputPivot = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.textInput.attrs.pivot);
11505
+ if (inputPivot) {
11506
+ const [pivotX, pivotY] = parseXYString(inputPivot);
11507
+ const inputAnchor = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.textInput.attrs.anchor);
11508
+ g.setPivot(pivotX, pivotY, parseBool(inputAnchor));
11509
+ }
11402
11510
  const inputRestrictSize = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.text.attrs.restrictSize);
11403
11511
  if (inputRestrictSize) {
11404
11512
  const parts = inputRestrictSize.split(",").map(Number);
@@ -11576,6 +11684,12 @@ var ProjectReader = class {
11576
11684
  }
11577
11685
  const groupLocked = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.group.attrs.locked);
11578
11686
  if (groupLocked !== void 0) g.setLocked(parseBool(groupLocked));
11687
+ const groupPivot = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.group.attrs.pivot);
11688
+ if (groupPivot) {
11689
+ const [pivotX, pivotY] = parseXYString(groupPivot);
11690
+ const groupAnchor = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.group.attrs.anchor);
11691
+ g.setPivot(pivotX, pivotY, parseBool(groupAnchor));
11692
+ }
11579
11693
  const groupRef = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.group.attrs.group);
11580
11694
  if (groupRef) g.setGroup(groupRef);
11581
11695
  const groupVisible = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.group.attrs.visible);
@@ -11616,7 +11730,8 @@ var ProjectReader = class {
11616
11730
  const loaderPivot = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader.attrs.pivot);
11617
11731
  if (loaderPivot) {
11618
11732
  const [pivotX, pivotY] = parseXYString(loaderPivot);
11619
- g.setPivot(pivotX, pivotY);
11733
+ const loaderAnchor = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader.attrs.anchor);
11734
+ g.setPivot(pivotX, pivotY, parseBool(loaderAnchor));
11620
11735
  }
11621
11736
  const loaderScale = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader.attrs.scale);
11622
11737
  if (loaderScale) {
@@ -11700,6 +11815,12 @@ var ProjectReader = class {
11700
11815
  const [w, h] = parseSizeString(loader3dSize);
11701
11816
  g.setSize(w, h);
11702
11817
  }
11818
+ const loader3dPivot = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader3D.attrs.pivot);
11819
+ if (loader3dPivot) {
11820
+ const [pivotX, pivotY] = parseXYString(loader3dPivot);
11821
+ const loader3dAnchor = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader3D.attrs.anchor);
11822
+ g.setPivot(pivotX, pivotY, parseBool(loader3dAnchor));
11823
+ }
11703
11824
  const loader3dVisible = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader3D.attrs.visible);
11704
11825
  if (loader3dVisible !== void 0) g.setVisible(parseBool(loader3dVisible));
11705
11826
  const loader3dUrl = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader3D.attrs.url);
@@ -11764,7 +11885,8 @@ var ProjectReader = class {
11764
11885
  const movieClipPivot = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.movieClip.attrs.pivot);
11765
11886
  if (movieClipPivot) {
11766
11887
  const [pivotX, pivotY] = parseXYString(movieClipPivot);
11767
- g.setPivot(pivotX, pivotY);
11888
+ const movieClipAnchor = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.movieClip.attrs.anchor);
11889
+ g.setPivot(pivotX, pivotY, parseBool(movieClipAnchor));
11768
11890
  }
11769
11891
  const movieClipRotation = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.movieClip.attrs.rotation);
11770
11892
  if (movieClipRotation !== void 0) g.setRotation(parseFloat2(movieClipRotation));
@@ -11882,6 +12004,12 @@ var ProjectReader = class {
11882
12004
  const [w, h] = parseSizeString(listSize);
11883
12005
  g.setSize(w, h);
11884
12006
  }
12007
+ const listPivot = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.pivot);
12008
+ if (listPivot) {
12009
+ const [pivotX, pivotY] = parseXYString(listPivot);
12010
+ const listAnchor = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.anchor);
12011
+ g.setPivot(pivotX, pivotY, parseBool(listAnchor));
12012
+ }
11885
12013
  const listGroup = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.group);
11886
12014
  if (listGroup) g.setGroup(listGroup);
11887
12015
  const listVisible = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.visible);
@@ -11936,8 +12064,15 @@ var ProjectReader = class {
11936
12064
  if (lineGap !== void 0) g.setLineGap(parseInt2(lineGap));
11937
12065
  const columnGap = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.columnGap);
11938
12066
  if (columnGap !== void 0) g.setColumnGap(parseInt2(columnGap));
11939
- const lineCount = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.lineCount);
11940
- if (lineCount !== void 0) g.setLineCount?.(parseInt2(lineCount));
12067
+ const lineItemCount = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.lineItemCount);
12068
+ const lineItemCount2 = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.lineItemCount2);
12069
+ if (layout) {
12070
+ const resolvedLayout = g.getLayout?.() ?? 0;
12071
+ if (resolvedLayout === 2 || resolvedLayout === 4) {
12072
+ if (lineItemCount !== void 0) g.setColumnCount?.(parseInt2(lineItemCount));
12073
+ } else if (resolvedLayout === 3 && lineItemCount !== void 0) g.setLineCount?.(parseInt2(lineItemCount));
12074
+ if (resolvedLayout === 4 && lineItemCount2 !== void 0) g.setLineCount?.(parseInt2(lineItemCount2));
12075
+ }
11941
12076
  const autoResizeItem = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.autoResizeItem);
11942
12077
  if (autoResizeItem !== void 0) g.setAutoResizeItem?.(parseBool(autoResizeItem));
11943
12078
  const selectionMode = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.selectionMode);
@@ -11997,6 +12132,7 @@ var ProjectReader = class {
11997
12132
  const objectId = readXmlAttr(attrs, PROJECT_XML_PROTOCOL.displayObject.attrs.id);
11998
12133
  obj.setId(objectId || "");
11999
12134
  const objectProtocol = DISPLAY_OBJECT_PROTOCOL_MAP[tagName];
12135
+ readCommonDisplayState(attrs, obj, objectProtocol);
12000
12136
  for (const gearTag of getProtocolGearChildNames(objectProtocol)) {
12001
12137
  const gearDefs = ensureArray(attrs[gearTag]);
12002
12138
  for (const gearDef of gearDefs) {
@@ -12446,6 +12582,14 @@ function stringifyTransitionValue(actionType, values) {
12446
12582
  }
12447
12583
  return parts.map((part) => formatTransitionValuePart(actionType, part)).join(",");
12448
12584
  }
12585
+ function writeCommonDisplayState(target, object, protocol) {
12586
+ const specs = protocol.attrs;
12587
+ if (specs.alpha && (object.getAlpha?.() ?? 1) !== 1) writeXmlAttr(target, specs.alpha, formatDisplayAlpha(object.getAlpha?.() ?? 1));
12588
+ if (specs.rotation && (object.getRotation?.() ?? 0) !== 0) writeXmlAttr(target, specs.rotation, String(object.getRotation?.() ?? 0));
12589
+ if (specs.visible && object.getVisible?.() === false) writeXmlAttr(target, specs.visible, "false");
12590
+ if (specs.touchable && object.getTouchable?.() === false) writeXmlAttr(target, specs.touchable, "false");
12591
+ if (specs.grayed && object.getGrayed?.()) writeXmlAttr(target, specs.grayed, "true");
12592
+ }
12449
12593
  function hasNonZeroInsets(value) {
12450
12594
  return !!value && !!(value.top || value.bottom || value.left || value.right);
12451
12595
  }
@@ -12487,6 +12631,7 @@ function serializeListItemXmlNode(item, options) {
12487
12631
  if (item.selectedTitle !== void 0 && item.selectedTitle !== null) writeXmlAttr(attrs, specs.selectedTitle, item.selectedTitle);
12488
12632
  if (item.selectedIcon !== void 0 && item.selectedIcon !== null) writeXmlAttr(attrs, specs.selectedIcon, item.selectedIcon);
12489
12633
  if (item.level !== void 0 && item.level !== null && ((options?.forceLevel ?? false) || item.level !== 0 || item.isFolder === true)) writeXmlAttr(attrs, specs.level, String(item.level));
12634
+ if (item.isFolder !== void 0 && item.isFolder !== null) writeXmlAttr(attrs, specs.isFolder, item.isFolder ? "true" : "false");
12490
12635
  if (item.controllers !== void 0 && item.controllers !== null) writeXmlAttr(attrs, specs.controllers, item.controllers);
12491
12636
  return attrs;
12492
12637
  }
@@ -13081,6 +13226,8 @@ var ProjectWriter = class {
13081
13226
  }
13082
13227
  const [scaleX, scaleY] = [typedObj.getScaleX?.() ?? 1, typedObj.getScaleY?.() ?? 1];
13083
13228
  if (scaleX !== 1 || scaleY !== 1) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.image.attrs.scale, `${scaleX},${scaleY}`);
13229
+ const [skewX, skewY] = [typedObj.getSkewX?.() ?? 0, typedObj.getSkewY?.() ?? 0];
13230
+ if (skewX !== 0 || skewY !== 0) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.image.attrs.skew, `${skewX},${skewY}`);
13084
13231
  if ((typedObj.getRotation?.() ?? 0) !== 0) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.image.attrs.rotation, String(typedObj.getRotation?.() ?? 0));
13085
13232
  if ((typedObj.getAlpha?.() ?? 1) !== 1) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.image.attrs.alpha, formatDisplayAlpha(typedObj.getAlpha?.() ?? 1));
13086
13233
  if (typedObj.getVisible?.() === false) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.image.attrs.visible, "false");
@@ -13155,6 +13302,11 @@ var ProjectWriter = class {
13155
13302
  const [w, h] = [typedObj.getWidth?.() ?? 0, typedObj.getHeight?.() ?? 0];
13156
13303
  if (w !== 0 || h !== 0) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.group.attrs.size, `${w},${h}`);
13157
13304
  if (typedObj.getLocked?.()) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.group.attrs.locked, "true");
13305
+ const [pivotX, pivotY] = [typedObj.getPivotX?.() ?? 0, typedObj.getPivotY?.() ?? 0];
13306
+ if (pivotX !== 0 || pivotY !== 0) {
13307
+ writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.group.attrs.pivot, `${pivotX},${pivotY}`);
13308
+ if (typedObj.getPivotAsAnchor?.()) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.group.attrs.anchor, "true");
13309
+ }
13158
13310
  }
13159
13311
  if (type === "GLoader") {
13160
13312
  const [x, y] = [typedObj.getX?.() ?? 0, typedObj.getY?.() ?? 0];
@@ -13162,7 +13314,10 @@ var ProjectWriter = class {
13162
13314
  const [w, h] = [typedObj.getWidth?.() ?? 0, typedObj.getHeight?.() ?? 0];
13163
13315
  if (w !== 0 || h !== 0) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader.attrs.size, `${w},${h}`);
13164
13316
  const [pivotX, pivotY] = [typedObj.getPivotX?.() ?? 0, typedObj.getPivotY?.() ?? 0];
13165
- if (pivotX !== 0 || pivotY !== 0) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader.attrs.pivot, `${pivotX},${pivotY}`);
13317
+ if (pivotX !== 0 || pivotY !== 0) {
13318
+ writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader.attrs.pivot, `${pivotX},${pivotY}`);
13319
+ if (typedObj.getPivotAsAnchor?.()) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader.attrs.anchor, "true");
13320
+ }
13166
13321
  const [scaleX, scaleY] = [typedObj.getScaleX?.() ?? 1, typedObj.getScaleY?.() ?? 1];
13167
13322
  if (scaleX !== 1 || scaleY !== 1) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader.attrs.scale, `${scaleX},${scaleY}`);
13168
13323
  if (typedObj.getVisible?.() === false) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader.attrs.visible, "false");
@@ -13216,7 +13371,10 @@ var ProjectWriter = class {
13216
13371
  if (w !== 0 || h !== 0) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.movieClip.attrs.size, `${w},${h}`);
13217
13372
  if (typedObj.getGroup?.()) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.movieClip.attrs.group, typedObj.getGroup?.());
13218
13373
  const [pivotX, pivotY] = [typedObj.getPivotX?.() ?? 0, typedObj.getPivotY?.() ?? 0];
13219
- if (pivotX !== 0 || pivotY !== 0) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.movieClip.attrs.pivot, `${pivotX},${pivotY}`);
13374
+ if (pivotX !== 0 || pivotY !== 0) {
13375
+ writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.movieClip.attrs.pivot, `${pivotX},${pivotY}`);
13376
+ if (typedObj.getPivotAsAnchor?.()) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.movieClip.attrs.anchor, "true");
13377
+ }
13220
13378
  if ((typedObj.getRotation?.() ?? 0) !== 0) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.movieClip.attrs.rotation, String(typedObj.getRotation?.() ?? 0));
13221
13379
  if ((typedObj.getAlpha?.() ?? 1) !== 1) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.movieClip.attrs.alpha, formatDisplayAlpha(typedObj.getAlpha?.() ?? 1));
13222
13380
  if (typedObj.getVisible?.() === false) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.movieClip.attrs.visible, "false");
@@ -13232,6 +13390,11 @@ var ProjectWriter = class {
13232
13390
  writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.text.attrs.xy, `${x},${y}`);
13233
13391
  const [w, h] = [typedObj.getWidth?.() ?? 0, typedObj.getHeight?.() ?? 0];
13234
13392
  if (w !== 0 || h !== 0) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.text.attrs.size, `${w},${h}`);
13393
+ const [pivotX, pivotY] = [typedObj.getPivotX?.() ?? 0, typedObj.getPivotY?.() ?? 0];
13394
+ if (pivotX !== 0 || pivotY !== 0) {
13395
+ writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.text.attrs.pivot, `${pivotX},${pivotY}`);
13396
+ if (typedObj.getPivotAsAnchor?.()) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.text.attrs.anchor, "true");
13397
+ }
13235
13398
  const restrictSize = [
13236
13399
  typedObj.getMinWidth?.() ?? 0,
13237
13400
  typedObj.getMaxWidth?.() ?? 0,
@@ -13267,6 +13430,11 @@ var ProjectWriter = class {
13267
13430
  writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.xy, `${x},${y}`);
13268
13431
  const [w, h] = [typedObj.getWidth?.() ?? 0, typedObj.getHeight?.() ?? 0];
13269
13432
  if (w !== 0 || h !== 0) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.size, `${w},${h}`);
13433
+ const [pivotX, pivotY] = [typedObj.getPivotX?.() ?? 0, typedObj.getPivotY?.() ?? 0];
13434
+ if (pivotX !== 0 || pivotY !== 0) {
13435
+ writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.pivot, `${pivotX},${pivotY}`);
13436
+ if (typedObj.getPivotAsAnchor?.()) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.anchor, "true");
13437
+ }
13270
13438
  if (typedObj.getVisible?.() === false) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.visible, "false");
13271
13439
  }
13272
13440
  if (type === "GLoader3D") {
@@ -13274,6 +13442,11 @@ var ProjectWriter = class {
13274
13442
  writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader3D.attrs.xy, `${x},${y}`);
13275
13443
  const [w, h] = [typedObj.getWidth?.() ?? 0, typedObj.getHeight?.() ?? 0];
13276
13444
  if (w !== 0 || h !== 0) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader3D.attrs.size, `${w},${h}`);
13445
+ const [pivotX, pivotY] = [typedObj.getPivotX?.() ?? 0, typedObj.getPivotY?.() ?? 0];
13446
+ if (pivotX !== 0 || pivotY !== 0) {
13447
+ writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader3D.attrs.pivot, `${pivotX},${pivotY}`);
13448
+ if (typedObj.getPivotAsAnchor?.()) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader3D.attrs.anchor, "true");
13449
+ }
13277
13450
  if (typedObj.getVisible?.() === false) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader3D.attrs.visible, "false");
13278
13451
  const url = typedObj.getUrl?.();
13279
13452
  if (url) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.loader3D.attrs.url, url);
@@ -13363,7 +13536,10 @@ var ProjectWriter = class {
13363
13536
  2: "bottom"
13364
13537
  }[vAlign] ?? "top");
13365
13538
  const lineCount = typedObj.getLineCount?.() ?? 0;
13366
- if (lineCount !== 0) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.lineCount, String(lineCount));
13539
+ const columnCount = typedObj.getColumnCount?.() ?? 0;
13540
+ if ((layout === 2 || layout === 4) && columnCount !== 0) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.lineItemCount, String(columnCount));
13541
+ else if (layout === 3 && lineCount !== 0) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.lineItemCount, String(lineCount));
13542
+ if (layout === 4 && lineCount !== 0) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.lineItemCount2, String(lineCount));
13367
13543
  if (typedObj.getAutoResizeItem?.() === false) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.autoResizeItem, "false");
13368
13544
  const selectionMode = typedObj.getSelectionMode?.();
13369
13545
  if (selectionMode !== void 0 && selectionMode !== 0) writeXmlAttr(attrs, PROJECT_XML_PROTOCOL.list.attrs.selectionMode, {
@@ -13506,6 +13682,7 @@ var ProjectWriter = class {
13506
13682
  }
13507
13683
  }
13508
13684
  const objectProtocol = DISPLAY_OBJECT_PROTOCOL_BY_TYPE[type] ?? PROJECT_XML_PROTOCOL.componentInstance;
13685
+ writeCommonDisplayState(attrs, typedObj, objectProtocol);
13509
13686
  const gearChildNameSet = getProtocolGearChildNameSet(objectProtocol);
13510
13687
  for (const gear of obj.listGears()) {
13511
13688
  const gearTag = GEAR_TAG[gear.getGearType()];
@@ -13591,6 +13768,7 @@ var ProjectWriter = class {
13591
13768
  if (item.getLabel()) writeXmlAttr(ia, PROJECT_XML_PROTOCOL.transitionItem.attrs.label, item.getLabel());
13592
13769
  if (item.getEndLabel()) writeXmlAttr(ia, PROJECT_XML_PROTOCOL.transitionItem.attrs.label2, item.getEndLabel());
13593
13770
  if (item.getPath()) writeXmlAttr(ia, PROJECT_XML_PROTOCOL.transitionItem.attrs.path, item.getPath());
13771
+ if (item.getEaseType() === 31 && item.getCustomEasePath()) writeXmlAttr(ia, PROJECT_XML_PROTOCOL.transitionItem.attrs.customEase, item.getCustomEasePath());
13594
13772
  const sv = item.getStartValue();
13595
13773
  if (sv.length) if (!item.getTween()) writeXmlAttr(ia, PROJECT_XML_PROTOCOL.transitionItem.attrs.value, stringifyTransitionValue(item.getActionType(), sv));
13596
13774
  else writeXmlAttr(ia, PROJECT_XML_PROTOCOL.transitionItem.attrs.startValue, stringifyTransitionValue(item.getActionType(), sv));
@@ -17783,13 +17961,11 @@ function decodeListScrollPane(child, childBuf) {
17783
17961
  ]);
17784
17962
  listLike.setVtScrollBarRes(childBuf.readS() ?? "").setHzScrollBarRes(childBuf.readS() ?? "").setHeaderRes(childBuf.readS() ?? "").setFooterRes(childBuf.readS() ?? "");
17785
17963
  }
17786
- function skipListItemOverrides(buf, version) {
17787
- if (remainingBytes(buf) < 2) return;
17964
+ function decodeListItemOverrides(buf, version) {
17965
+ if (remainingBytes(buf) < 2) return null;
17788
17966
  const controllerOverrideCount = buf.getInt16();
17789
- for (let index = 0; index < controllerOverrideCount && remainingBytes(buf) >= 4; index += 1) {
17790
- buf.readS();
17791
- buf.readS();
17792
- }
17967
+ const controllerParts = [];
17968
+ for (let index = 0; index < controllerOverrideCount && remainingBytes(buf) >= 4; index += 1) controllerParts.push(buf.readS() ?? "", buf.readS() ?? "");
17793
17969
  if (version >= 2 && remainingBytes(buf) >= 2) {
17794
17970
  const propertyOverrideCount = buf.getInt16();
17795
17971
  for (let index = 0; index < propertyOverrideCount && remainingBytes(buf) >= 6; index += 1) {
@@ -17798,6 +17974,7 @@ function skipListItemOverrides(buf, version) {
17798
17974
  buf.readS();
17799
17975
  }
17800
17976
  }
17977
+ return controllerParts.length > 0 ? controllerParts.join(",") : null;
17801
17978
  }
17802
17979
  function decodeListItems(child, childBuf) {
17803
17980
  if (!childBuf.seek(0, 8) || remainingBytes(childBuf) < 4) return;
@@ -17816,7 +17993,7 @@ function decodeListItems(child, childBuf) {
17816
17993
  isFolder = childBuf.readBool();
17817
17994
  level = childBuf.getUint8();
17818
17995
  }
17819
- items.push({
17996
+ const item = {
17820
17997
  url,
17821
17998
  title: childBuf.readS(),
17822
17999
  selectedTitle: childBuf.readS(),
@@ -17825,8 +18002,12 @@ function decodeListItems(child, childBuf) {
17825
18002
  name: childBuf.readS(),
17826
18003
  level,
17827
18004
  isFolder
18005
+ };
18006
+ const controllers = decodeListItemOverrides(childBuf, childBuf.version);
18007
+ items.push(controllers === null ? item : {
18008
+ ...item,
18009
+ controllers
17828
18010
  });
17829
- skipListItemOverrides(childBuf, childBuf.version);
17830
18011
  childBuf.pos = nextPos;
17831
18012
  }
17832
18013
  listLike.setListItems(items);
@@ -19217,6 +19398,11 @@ function _numVal(v, fallback = 0) {
19217
19398
  }
19218
19399
  return fallback;
19219
19400
  }
19401
+ function _numberToken(value, fallback) {
19402
+ if (value === void 0 || value.trim() === "") return fallback;
19403
+ const parsed = Number(value);
19404
+ return Number.isFinite(parsed) ? parsed : fallback;
19405
+ }
19220
19406
  function _boolVal(v, fallback = false) {
19221
19407
  if (typeof v === "boolean") return v;
19222
19408
  if (typeof v === "number") return v !== 0;
@@ -20002,7 +20188,7 @@ function _writeGearStatus(buf, gearType, valueStr, _version) {
20002
20188
  buf.writeFloat32(parseFloat(parts[3]) || 1);
20003
20189
  break;
20004
20190
  case 3:
20005
- buf.writeFloat32(parseFloat(parts[0]) || 1);
20191
+ buf.writeFloat32(_numberToken(parts[0], 1));
20006
20192
  buf.writeFloat32(parseFloat(parts[1]) || 0);
20007
20193
  buf.writeBool(parts[2] === "true" || parts[2] === "1");
20008
20194
  buf.writeBool(parts.length < 4 || parts[3] === "true" || parts[3] === "1");
@@ -20472,13 +20658,12 @@ function _writeListItems(buf, child, pkg, version) {
20472
20658
  const isTree = child.propertyType === "GTree";
20473
20659
  const listItems = child.getListItems?.() ?? [];
20474
20660
  buf.writeInt16(listItems.length);
20475
- for (const item of listItems) {
20661
+ for (const [index, item] of listItems.entries()) {
20476
20662
  const itemStart = buf.pos;
20477
20663
  buf.writeInt16(0);
20478
20664
  buf.writeS(remapLocalUiUrl(pkg, item.url ?? null));
20479
20665
  if (isTree) {
20480
- const isFolder = item.isFolder ?? (!(item.icon ?? null) && !(item.url ?? null));
20481
- buf.writeBool(isFolder);
20666
+ buf.writeBool(resolveTreeItemIsFolder(listItems, index));
20482
20667
  buf.writeUint8(Math.max(0, item.level ?? 0));
20483
20668
  }
20484
20669
  buf.writeSEx(item.title ?? null, true);
@@ -20486,7 +20671,21 @@ function _writeListItems(buf, child, pkg, version) {
20486
20671
  buf.writeS(remapLocalUiUrl(pkg, item.icon ?? null));
20487
20672
  buf.writeS(remapLocalUiUrl(pkg, item.selectedIcon ?? null));
20488
20673
  buf.writeS(item.name ?? null);
20674
+ const controllerParts = item.controllers?.split(",") ?? [];
20675
+ const controllerCountPos = buf.pos;
20489
20676
  buf.writeInt16(0);
20677
+ let controllerCount = 0;
20678
+ for (let index = 0; index < controllerParts.length; index += 2) {
20679
+ const controllerName = controllerParts[index];
20680
+ if (!controllerName) continue;
20681
+ buf.writeS(controllerName);
20682
+ buf.writeS(controllerParts[index + 1] ?? "");
20683
+ controllerCount += 1;
20684
+ }
20685
+ const controllerEnd = buf.pos;
20686
+ buf.pos = controllerCountPos;
20687
+ buf.writeInt16(controllerCount);
20688
+ buf.pos = controllerEnd;
20490
20689
  if (version >= 2) buf.writeInt16(0);
20491
20690
  const itemEnd = buf.pos;
20492
20691
  const saved = buf.pos;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfairygui/cli",
3
- "version": "0.2.0-alpha.18",
3
+ "version": "0.2.0-alpha.19",
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/functions": "0.2.0-alpha.18",
37
- "@openfairygui/core": "0.2.0-alpha.18"
36
+ "@openfairygui/functions": "0.2.0-alpha.19",
37
+ "@openfairygui/core": "0.2.0-alpha.19"
38
38
  },
39
39
  "dependencies": {
40
40
  "commander": "^14.0.2",
41
41
  "jiti": "^2.7.0",
42
- "@openfairygui/backend": "0.2.0-alpha.18"
42
+ "@openfairygui/backend": "0.2.0-alpha.19"
43
43
  },
44
44
  "optionalDependencies": {
45
45
  "sharp": ">=0.33.0"