@vvfx/sdk 0.2.9 → 0.2.11

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/sdk.js CHANGED
@@ -16,6 +16,7 @@ import { Vector2, Vector3 } from './math';
16
16
  import { UndoRedo } from './service/UndoRedo';
17
17
  import { isCardItem, isEffectsItem, isFrameItem } from './sdk-item';
18
18
  import { HTMLOverlayManager } from './html-overlay';
19
+ import { resolveTopAnchoredCardPosition } from './html-overlay/auto-height-layout';
19
20
  import { orderSDKCanvasLayers } from './layer-order';
20
21
  const HTML_CARD_EDITING_VIEWPORT_PADDING = 48;
21
22
  export class SDK {
@@ -124,14 +125,18 @@ export class SDK {
124
125
  });
125
126
  return;
126
127
  }
127
- const [x, y] = item.property.position;
128
- const deltaY = (height - options.previousHeight) / 2;
128
+ const position = resolveTopAnchoredCardPosition({
129
+ nextHeight: height,
130
+ position: item.property.position,
131
+ previousHeight: options.previousHeight,
132
+ scaleY: item.property.scale?.[1] ?? 1,
133
+ });
129
134
  void this.setItemProperty({
130
135
  itemId: id,
131
136
  type: SDKItemType.CARD,
132
137
  property: {
133
138
  height,
134
- position: [x, y + deltaY],
139
+ position,
135
140
  },
136
141
  });
137
142
  },
package/package.json CHANGED
@@ -1,16 +1,13 @@
1
1
  {
2
2
  "name": "@vvfx/sdk",
3
3
  "description": "TODO",
4
- "version": "0.2.9",
4
+ "version": "0.2.11",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
8
8
  "files": [
9
9
  "dist"
10
10
  ],
11
- "sideEffects": [
12
- "./dist/shared/player.js"
13
- ],
14
11
  "exports": {
15
12
  ".": {
16
13
  "types": "./dist/index.d.ts",