@openfairygui/cli 0.2.0-alpha.28 → 0.2.0-alpha.29

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 +241 -17
  2. package/package.json +4 -4
package/dist/cli.mjs CHANGED
@@ -3072,9 +3072,23 @@ var GObject = class extends ExtensibleProperty {
3072
3072
  sourceHeight: 0,
3073
3073
  initWidth: 0,
3074
3074
  initHeight: 0,
3075
+ locked: false,
3076
+ aspect: false,
3077
+ minWidth: 0,
3078
+ maxWidth: 0,
3079
+ minHeight: 0,
3080
+ maxHeight: 0,
3075
3081
  pivotX: 0,
3076
3082
  pivotY: 0,
3077
3083
  anchor: false,
3084
+ scaleX: 1,
3085
+ scaleY: 1,
3086
+ skewX: 0,
3087
+ skewY: 0,
3088
+ tooltips: "",
3089
+ blendMode: "normal",
3090
+ filter: "",
3091
+ filterData: "",
3078
3092
  customData: "",
3079
3093
  relations: [],
3080
3094
  gears: new RefList()
@@ -3116,6 +3130,42 @@ var GObject = class extends ExtensibleProperty {
3116
3130
  setInitHeight(v) {
3117
3131
  return this.setObjectProp("initHeight", v);
3118
3132
  }
3133
+ getLocked() {
3134
+ return this.getObjectProp("locked");
3135
+ }
3136
+ setLocked(v) {
3137
+ return this.setObjectProp("locked", v);
3138
+ }
3139
+ getAspect() {
3140
+ return this.getObjectProp("aspect");
3141
+ }
3142
+ setAspect(v) {
3143
+ return this.setObjectProp("aspect", v);
3144
+ }
3145
+ getMinWidth() {
3146
+ return this.getObjectProp("minWidth");
3147
+ }
3148
+ setMinWidth(v) {
3149
+ return this.setObjectProp("minWidth", v);
3150
+ }
3151
+ getMaxWidth() {
3152
+ return this.getObjectProp("maxWidth");
3153
+ }
3154
+ setMaxWidth(v) {
3155
+ return this.setObjectProp("maxWidth", v);
3156
+ }
3157
+ getMinHeight() {
3158
+ return this.getObjectProp("minHeight");
3159
+ }
3160
+ setMinHeight(v) {
3161
+ return this.setObjectProp("minHeight", v);
3162
+ }
3163
+ getMaxHeight() {
3164
+ return this.getObjectProp("maxHeight");
3165
+ }
3166
+ setMaxHeight(v) {
3167
+ return this.setObjectProp("maxHeight", v);
3168
+ }
3119
3169
  getPivotX() {
3120
3170
  return this.getObjectProp("pivotX");
3121
3171
  }
@@ -3133,6 +3183,50 @@ var GObject = class extends ExtensibleProperty {
3133
3183
  setPivotAsAnchor(v) {
3134
3184
  return this.setObjectProp("anchor", v);
3135
3185
  }
3186
+ getScaleX() {
3187
+ return this.getObjectProp("scaleX");
3188
+ }
3189
+ getScaleY() {
3190
+ return this.getObjectProp("scaleY");
3191
+ }
3192
+ setScale(x, y) {
3193
+ this.setObjectProp("scaleX", x);
3194
+ return this.setObjectProp("scaleY", y);
3195
+ }
3196
+ getSkewX() {
3197
+ return this.getObjectProp("skewX");
3198
+ }
3199
+ getSkewY() {
3200
+ return this.getObjectProp("skewY");
3201
+ }
3202
+ setSkew(x, y) {
3203
+ this.setObjectProp("skewX", x);
3204
+ return this.setObjectProp("skewY", y);
3205
+ }
3206
+ getTooltips() {
3207
+ return this.getObjectProp("tooltips");
3208
+ }
3209
+ setTooltips(v) {
3210
+ return this.setObjectProp("tooltips", v);
3211
+ }
3212
+ getBlendMode() {
3213
+ return this.getObjectProp("blendMode");
3214
+ }
3215
+ setBlendMode(v) {
3216
+ return this.setObjectProp("blendMode", v);
3217
+ }
3218
+ getFilter() {
3219
+ return this.getObjectProp("filter");
3220
+ }
3221
+ setFilter(v) {
3222
+ return this.setObjectProp("filter", v);
3223
+ }
3224
+ getFilterData() {
3225
+ return this.getObjectProp("filterData");
3226
+ }
3227
+ setFilterData(v) {
3228
+ return this.setObjectProp("filterData", v);
3229
+ }
3136
3230
  getCustomData() {
3137
3231
  return this.getObjectProp("customData");
3138
3232
  }
@@ -9840,6 +9934,7 @@ const FILTER_ATTRS = {
9840
9934
  filter: { canonical: "filter" },
9841
9935
  filterData: { canonical: "filterData" }
9842
9936
  };
9937
+ const COMMON_DISPLAY_OBJECT_ATTRS = mergeAttrs(XY_SIZE_ATTRS, LOCKED_ATTRS, RESTRICT_SIZE_ATTRS, ASPECT_ATTRS, PIVOT_ATTRS, ANCHOR_ATTRS, SCALE_ATTRS, SKEW_ATTRS, COMMON_DISPLAY_STATE_ATTRS, INSTANCE_MISC_PANEL_ATTRS, { blendMode: { canonical: "blend" } }, FILTER_ATTRS);
9843
9938
  const ROOT_COMPONENT_PANEL_ATTRS = {
9844
9939
  size: { canonical: "size" },
9845
9940
  pivot: { canonical: "pivot" },
@@ -10229,17 +10324,17 @@ const WITH_ROOT_EXTENSION_CHILDREN = {
10229
10324
  };
10230
10325
  const CONTROLLER_NODE = defineNode(mergeAttrs(CONTROLLER_ATTRS), mergeChildren(WITH_CONTROLLER_ACTION_CHILDREN));
10231
10326
  const TRANSITION_NODE = defineNode(mergeAttrs(TRANSITION_ATTRS), mergeChildren(WITH_TRANSITION_ITEM_CHILDREN));
10232
- 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));
10233
- 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));
10234
- 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));
10235
- 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));
10236
- const LOADER_NODE = defineNode(mergeAttrs(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));
10237
- 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));
10238
- 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));
10239
- 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));
10240
- 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));
10241
- 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));
10242
- 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));
10327
+ 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));
10328
+ 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));
10329
+ 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));
10330
+ 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));
10331
+ 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));
10332
+ const LOADER3D_NODE = defineNode(mergeAttrs(COMMON_DISPLAY_OBJECT_ATTRS, LOADER3D_PANEL_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN));
10333
+ 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));
10334
+ const TEXT_INPUT_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));
10335
+ const RICH_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, RICH_TEXT_PANEL_ATTRS), mergeChildren(WITH_RELATION_CHILDREN, WITH_GEAR_CHILDREN));
10336
+ const GROUP_NODE = defineNode(mergeAttrs(COMMON_DISPLAY_OBJECT_ATTRS, 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));
10337
+ const LIST_NODE = defineNode(mergeAttrs(COMMON_DISPLAY_OBJECT_ATTRS, 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));
10243
10338
  const DISPLAY_LIST_CONTAINER$2 = defineContainer({
10244
10339
  image: IMAGE_NODE,
10245
10340
  graph: GRAPH_NODE,
@@ -10509,6 +10604,43 @@ function parseComboBoxItemXmlNode(item) {
10509
10604
  }
10510
10605
  function readCommonDisplayState(source, object, protocol) {
10511
10606
  const specs = protocol.attrs;
10607
+ const xy = specs.xy ? readXmlAttr(source, specs.xy) : void 0;
10608
+ if (xy) {
10609
+ const [x, y] = parseXYString(xy);
10610
+ object.setXY?.(x, y);
10611
+ }
10612
+ const size = specs.size ? readXmlAttr(source, specs.size) : void 0;
10613
+ if (size) {
10614
+ const [width, height] = parseSizeString(size);
10615
+ object.setSize?.(width, height);
10616
+ }
10617
+ const locked = specs.locked ? readXmlAttr(source, specs.locked) : void 0;
10618
+ if (locked !== void 0) object.setLocked(parseBool(locked));
10619
+ const restrictSize = specs.restrictSize ? readXmlAttr(source, specs.restrictSize) : void 0;
10620
+ if (restrictSize) {
10621
+ const [minWidth = 0, maxWidth = 0, minHeight = 0, maxHeight = 0] = restrictSize.split(",").map((value) => parseFloat2(value));
10622
+ object.setMinWidth(minWidth).setMaxWidth(maxWidth).setMinHeight(minHeight).setMaxHeight(maxHeight);
10623
+ }
10624
+ const aspect = specs.aspect ? readXmlAttr(source, specs.aspect) : void 0;
10625
+ if (aspect !== void 0) object.setAspect(parseBool(aspect));
10626
+ const pivot = specs.pivot ? readXmlAttr(source, specs.pivot) : void 0;
10627
+ if (pivot) {
10628
+ const [pivotX, pivotY] = parseXYString(pivot);
10629
+ const anchor = specs.anchor ? readXmlAttr(source, specs.anchor) : void 0;
10630
+ object.setPivot(pivotX, pivotY, parseBool(anchor));
10631
+ }
10632
+ const scale = specs.scale ? readXmlAttr(source, specs.scale) : void 0;
10633
+ if (scale) {
10634
+ const [scaleX, scaleY] = parseXYString(scale);
10635
+ object.setScale(scaleX, scaleY);
10636
+ }
10637
+ const skew = specs.skew ? readXmlAttr(source, specs.skew) : void 0;
10638
+ if (skew) {
10639
+ const [skewX, skewY] = parseXYString(skew);
10640
+ object.setSkew(skewX, skewY);
10641
+ }
10642
+ const group = specs.group ? readXmlAttr(source, specs.group) : void 0;
10643
+ if (group !== void 0) object.setGroup?.(group);
10512
10644
  const alpha = specs.alpha ? readXmlAttr(source, specs.alpha) : void 0;
10513
10645
  if (alpha !== void 0) object.setAlpha?.(parseFloat2(alpha, 1));
10514
10646
  const rotation = specs.rotation ? readXmlAttr(source, specs.rotation) : void 0;
@@ -10519,6 +10651,16 @@ function readCommonDisplayState(source, object, protocol) {
10519
10651
  if (touchable !== void 0) object.setTouchable?.(parseBool(touchable));
10520
10652
  const grayed = specs.grayed ? readXmlAttr(source, specs.grayed) : void 0;
10521
10653
  if (grayed !== void 0) object.setGrayed?.(parseBool(grayed));
10654
+ const tooltips = specs.tooltips ? readXmlAttr(source, specs.tooltips) : void 0;
10655
+ if (tooltips !== void 0) object.setTooltips(tooltips);
10656
+ const customData = specs.customData ? readXmlAttr(source, specs.customData) : void 0;
10657
+ if (customData !== void 0) object.setCustomData(customData);
10658
+ const blendMode = specs.blendMode ? readXmlAttr(source, specs.blendMode) : void 0;
10659
+ if (blendMode !== void 0) object.setBlendMode(blendMode);
10660
+ const filter = specs.filter ? readXmlAttr(source, specs.filter) : void 0;
10661
+ if (filter !== void 0) object.setFilter(filter);
10662
+ const filterData = specs.filterData ? readXmlAttr(source, specs.filterData) : void 0;
10663
+ if (filterData !== void 0) object.setFilterData(filterData);
10522
10664
  }
10523
10665
  /** Options for explicitly loading source bytes while reading a project. */
10524
10666
  function createDisplayObject$1(ctx, doc, tagName, attrs, localControllers) {
@@ -12890,11 +13032,43 @@ function normalizeGearXmlValue(gearType, value, ownerType, ownerName, gear) {
12890
13032
  }
12891
13033
  function writeCommonDisplayState(target, object, protocol) {
12892
13034
  const specs = protocol.attrs;
13035
+ if (specs.xy) writeXmlAttr(target, specs.xy, `${object.getX?.() ?? 0},${object.getY?.() ?? 0}`);
13036
+ const width = object.getWidth?.() ?? 0;
13037
+ const height = object.getHeight?.() ?? 0;
13038
+ if (specs.size && (width !== 0 || height !== 0)) writeXmlAttr(target, specs.size, `${width},${height}`);
13039
+ if (specs.locked && object.getLocked?.()) writeXmlAttr(target, specs.locked, "true");
13040
+ const restrictSize = [
13041
+ object.getMinWidth?.() ?? 0,
13042
+ object.getMaxWidth?.() ?? 0,
13043
+ object.getMinHeight?.() ?? 0,
13044
+ object.getMaxHeight?.() ?? 0
13045
+ ];
13046
+ if (specs.restrictSize && restrictSize.some((value) => value !== 0)) writeXmlAttr(target, specs.restrictSize, restrictSize.join(","));
13047
+ if (specs.aspect && object.getAspect?.()) writeXmlAttr(target, specs.aspect, "true");
13048
+ const pivotX = object.getPivotX?.() ?? 0;
13049
+ const pivotY = object.getPivotY?.() ?? 0;
13050
+ if (specs.pivot && (pivotX !== 0 || pivotY !== 0)) {
13051
+ writeXmlAttr(target, specs.pivot, `${pivotX},${pivotY}`);
13052
+ if (specs.anchor && object.getPivotAsAnchor?.()) writeXmlAttr(target, specs.anchor, "true");
13053
+ }
13054
+ const scaleX = object.getScaleX?.() ?? 1;
13055
+ const scaleY = object.getScaleY?.() ?? 1;
13056
+ if (specs.scale && (scaleX !== 1 || scaleY !== 1)) writeXmlAttr(target, specs.scale, `${scaleX},${scaleY}`);
13057
+ const skewX = object.getSkewX?.() ?? 0;
13058
+ const skewY = object.getSkewY?.() ?? 0;
13059
+ if (specs.skew && (skewX !== 0 || skewY !== 0)) writeXmlAttr(target, specs.skew, `${skewX},${skewY}`);
13060
+ if (specs.group && object.getGroup?.()) writeXmlAttr(target, specs.group, object.getGroup?.());
12893
13061
  if (specs.alpha && (object.getAlpha?.() ?? 1) !== 1) writeXmlAttr(target, specs.alpha, formatDisplayAlpha(object.getAlpha?.() ?? 1));
12894
13062
  if (specs.rotation && (object.getRotation?.() ?? 0) !== 0) writeXmlAttr(target, specs.rotation, String(object.getRotation?.() ?? 0));
12895
13063
  if (specs.visible && object.getVisible?.() === false) writeXmlAttr(target, specs.visible, "false");
12896
13064
  if (specs.touchable && object.getTouchable?.() === false) writeXmlAttr(target, specs.touchable, "false");
12897
13065
  if (specs.grayed && object.getGrayed?.()) writeXmlAttr(target, specs.grayed, "true");
13066
+ if (specs.tooltips && object.getTooltips?.()) writeXmlAttr(target, specs.tooltips, object.getTooltips?.());
13067
+ if (specs.customData && object.getCustomData?.()) writeXmlAttr(target, specs.customData, object.getCustomData?.());
13068
+ const blendMode = object.getBlendMode?.() ?? "normal";
13069
+ if (specs.blendMode && blendMode !== "normal") writeXmlAttr(target, specs.blendMode, blendMode);
13070
+ if (specs.filter && object.getFilter?.()) writeXmlAttr(target, specs.filter, object.getFilter?.());
13071
+ if (specs.filterData && object.getFilterData?.()) writeXmlAttr(target, specs.filterData, object.getFilterData?.());
12898
13072
  }
12899
13073
  function hasNonZeroInsets(value) {
12900
13074
  return !!value && !!(value.top || value.bottom || value.left || value.right);
@@ -18620,7 +18794,13 @@ function decodeChildBlock0(doc, childBuf) {
18620
18794
  else childBuf.skip(8);
18621
18795
  if (childBuf.readBool() && remainingBytes(childBuf) >= 8) if ("setSize" in child && typeof child.setSize === "function") child.setSize(childBuf.getInt32(), childBuf.getInt32());
18622
18796
  else childBuf.skip(8);
18623
- if (childBuf.readBool() && remainingBytes(childBuf) >= 16) childBuf.skip(16);
18797
+ if (childBuf.readBool() && remainingBytes(childBuf) >= 16) {
18798
+ const minWidth = childBuf.getInt32();
18799
+ const maxWidth = childBuf.getInt32();
18800
+ const minHeight = childBuf.getInt32();
18801
+ const maxHeight = childBuf.getInt32();
18802
+ child.setMinWidth(minWidth).setMaxWidth(maxWidth).setMinHeight(minHeight).setMaxHeight(maxHeight);
18803
+ }
18624
18804
  if (childBuf.readBool() && remainingBytes(childBuf) >= 8) if ("setScale" in child && typeof child.setScale === "function") child.setScale(childBuf.getFloat32(), childBuf.getFloat32());
18625
18805
  else childBuf.skip(8);
18626
18806
  if (childBuf.readBool() && remainingBytes(childBuf) >= 8) if ("setSkew" in child && typeof child.setSkew === "function") child.setSkew(childBuf.getFloat32(), childBuf.getFloat32());
@@ -18643,8 +18823,23 @@ function decodeChildBlock0(doc, childBuf) {
18643
18823
  if ("setTouchable" in child && typeof child.setTouchable === "function") child.setTouchable(touchable);
18644
18824
  if ("setGrayed" in child && typeof child.setGrayed === "function") child.setGrayed(grayed);
18645
18825
  if (remainingBytes(childBuf) < 2) return child;
18646
- childBuf.getUint8();
18647
- childBuf.getUint8();
18826
+ child.setBlendMode([
18827
+ "normal",
18828
+ "none",
18829
+ "add",
18830
+ "multiply",
18831
+ "screen",
18832
+ "erase"
18833
+ ][childBuf.getUint8()] ?? "normal");
18834
+ if (childBuf.getUint8() === 1 && remainingBytes(childBuf) >= 16) {
18835
+ const filterData = [
18836
+ childBuf.getFloat32(),
18837
+ childBuf.getFloat32(),
18838
+ childBuf.getFloat32(),
18839
+ childBuf.getFloat32()
18840
+ ].join(",");
18841
+ child.setFilter("color").setFilterData(filterData);
18842
+ }
18648
18843
  if (remainingBytes(childBuf) >= 2) if ("setCustomData" in child && typeof child.setCustomData === "function") child.setCustomData(childBuf.readS() ?? "");
18649
18844
  else childBuf.readS();
18650
18845
  return child;
@@ -20496,6 +20691,22 @@ function _writeColorForGear(buf, colorStr, defaultColor = 4278190080) {
20496
20691
  }
20497
20692
  //#endregion
20498
20693
  //#region ../core/src/io/component-encoder-child.ts
20694
+ const BLEND_MODE_CODE = {
20695
+ normal: 0,
20696
+ none: 1,
20697
+ add: 2,
20698
+ multiply: 3,
20699
+ screen: 4,
20700
+ erase: 5
20701
+ };
20702
+ function colorFilterValues(child) {
20703
+ const filter = child.getFilter?.() ?? "";
20704
+ if (filter === "") return null;
20705
+ if (filter !== "color") throw new Error(`Display node "${child.getId?.() ?? child.getName?.() ?? ""}" has unsupported filter "${filter}".`);
20706
+ const values = (child.getFilterData?.() ?? "").split(",").map((part) => Number(part.trim()));
20707
+ if (values.length !== 4 || values.some((value) => !Number.isFinite(value))) throw new Error(`Display node "${child.getId?.() ?? child.getName?.() ?? ""}" has invalid color filterData.`);
20708
+ return values;
20709
+ }
20499
20710
  const OBJECT_TYPE_MAP = {
20500
20711
  GImage: 0,
20501
20712
  GMovieClip: 1,
@@ -20556,7 +20767,15 @@ function _writeDisplayList(buf, comp, _doc, pkg, version) {
20556
20767
  buf.writeInt32(w);
20557
20768
  buf.writeInt32(h);
20558
20769
  }
20559
- buf.writeBool(false);
20770
+ const restrictSize = [
20771
+ child.getMinWidth?.() ?? 0,
20772
+ child.getMaxWidth?.() ?? 0,
20773
+ child.getMinHeight?.() ?? 0,
20774
+ child.getMaxHeight?.() ?? 0
20775
+ ];
20776
+ const hasRestrictSize = restrictSize.some((value) => value !== 0);
20777
+ buf.writeBool(hasRestrictSize);
20778
+ if (hasRestrictSize) for (const value of restrictSize) buf.writeInt32(value);
20560
20779
  const sx = child.getScaleX?.() ?? 1;
20561
20780
  const sy = child.getScaleY?.() ?? 1;
20562
20781
  const hasScale = sx !== 1 || sy !== 1;
@@ -20587,8 +20806,13 @@ function _writeDisplayList(buf, comp, _doc, pkg, version) {
20587
20806
  buf.writeBool(child.getVisible?.() ?? true);
20588
20807
  buf.writeBool(child.getTouchable?.() ?? true);
20589
20808
  buf.writeBool(child.getGrayed?.() ?? false);
20590
- buf.writeUint8(child.getBlendMode?.() ?? 0);
20591
- buf.writeUint8(0);
20809
+ const blendMode = child.getBlendMode?.() ?? "normal";
20810
+ const blendModeCode = BLEND_MODE_CODE[blendMode];
20811
+ if (blendModeCode === void 0) throw new Error(`Display node "${child.getId?.() ?? child.getName?.() ?? ""}" has unsupported blend mode "${blendMode}".`);
20812
+ buf.writeUint8(blendModeCode);
20813
+ const filterValues = colorFilterValues(child);
20814
+ buf.writeUint8(filterValues ? 1 : 0);
20815
+ if (filterValues) for (const value of filterValues) buf.writeFloat32(value);
20592
20816
  buf.writeSEx(child.getCustomData?.() ?? null, true);
20593
20817
  const cb1 = buf.pos - childIndexPos;
20594
20818
  buf.writeSEx(child.getTooltips?.() ?? null, true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfairygui/cli",
3
- "version": "0.2.0-alpha.28",
3
+ "version": "0.2.0-alpha.29",
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.28",
37
- "@openfairygui/core": "0.2.0-alpha.28"
36
+ "@openfairygui/core": "0.2.0-alpha.29",
37
+ "@openfairygui/functions": "0.2.0-alpha.29"
38
38
  },
39
39
  "dependencies": {
40
40
  "commander": "^14.0.2",
41
41
  "jiti": "^2.7.0",
42
- "@openfairygui/backend": "0.2.0-alpha.28"
42
+ "@openfairygui/backend": "0.2.0-alpha.29"
43
43
  },
44
44
  "optionalDependencies": {
45
45
  "sharp": ">=0.33.0"