@shotstack/shotstack-studio 2.0.0-beta.29 → 2.0.0-beta.30
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/index.d.ts +35 -2
- package/dist/schema/index.d.ts +35 -2
- package/dist/shotstack-studio.es.js +3801 -3708
- package/dist/shotstack-studio.umd.js +89 -85
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -31,11 +31,16 @@ export { AssetSchema }
|
|
|
31
31
|
|
|
32
32
|
export declare class AssetToolbar {
|
|
33
33
|
private container;
|
|
34
|
+
private buttonsContainer;
|
|
34
35
|
private ui;
|
|
35
36
|
private unsubscribe;
|
|
37
|
+
private dragResult;
|
|
36
38
|
constructor(ui: UIController);
|
|
39
|
+
getDragState(): ToolbarDragState | null;
|
|
37
40
|
setPosition(screenX: number, screenY: number): void;
|
|
38
|
-
mount(parent: HTMLElement
|
|
41
|
+
mount(parent: HTMLElement, options?: {
|
|
42
|
+
onDragReset?: () => void;
|
|
43
|
+
}): void;
|
|
39
44
|
private render;
|
|
40
45
|
private setupEventListeners;
|
|
41
46
|
dispose(): void;
|
|
@@ -57,7 +62,12 @@ declare abstract class BaseToolbar {
|
|
|
57
62
|
protected selectedTrackIdx: number;
|
|
58
63
|
protected selectedClipIdx: number;
|
|
59
64
|
protected clickOutsideHandler: ((e: MouseEvent) => void) | null;
|
|
65
|
+
protected dragResult: ToolbarDragHandle | null;
|
|
60
66
|
constructor(edit: Edit);
|
|
67
|
+
/**
|
|
68
|
+
* Add a drag handle to the toolbar container and enable free-form dragging.
|
|
69
|
+
*/
|
|
70
|
+
protected enableDrag(): void;
|
|
61
71
|
/**
|
|
62
72
|
* Mount the toolbar to a parent element.
|
|
63
73
|
* Subclasses must implement to build their specific HTML structure.
|
|
@@ -248,6 +258,7 @@ export declare class CanvasToolbar {
|
|
|
248
258
|
private fpsChangeCallback;
|
|
249
259
|
private backgroundChangeCallback;
|
|
250
260
|
private clickOutsideHandler;
|
|
261
|
+
private dragResult;
|
|
251
262
|
private showMergeFields;
|
|
252
263
|
private maxPixels?;
|
|
253
264
|
constructor(edit?: Edit, options?: CanvasToolbarOptions);
|
|
@@ -255,8 +266,11 @@ export declare class CanvasToolbar {
|
|
|
255
266
|
private isOverLimit;
|
|
256
267
|
/** Get the edit as ShotstackEdit if it has merge field capabilities */
|
|
257
268
|
private getShotstackEdit;
|
|
269
|
+
getDragState(): ToolbarDragState | null;
|
|
258
270
|
setPosition(screenX: number, screenY: number): void;
|
|
259
|
-
mount(parent: HTMLElement
|
|
271
|
+
mount(parent: HTMLElement, options?: {
|
|
272
|
+
onDragReset?: () => void;
|
|
273
|
+
}): void;
|
|
260
274
|
private setupEventListeners;
|
|
261
275
|
private togglePopup;
|
|
262
276
|
private closeAllPopups;
|
|
@@ -1530,6 +1544,17 @@ export declare interface ToolbarButtonConfig {
|
|
|
1530
1544
|
dividerBefore?: boolean;
|
|
1531
1545
|
}
|
|
1532
1546
|
|
|
1547
|
+
declare interface ToolbarDragHandle {
|
|
1548
|
+
getState(): ToolbarDragState;
|
|
1549
|
+
dispose(): void;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
declare interface ToolbarDragState {
|
|
1553
|
+
readonly hasUserPosition: boolean;
|
|
1554
|
+
readonly userX: number;
|
|
1555
|
+
readonly userY: number;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1533
1558
|
export declare type Track = components["schemas"]["Track"];
|
|
1534
1559
|
|
|
1535
1560
|
export { TrackSchema }
|
|
@@ -1607,6 +1632,10 @@ export declare class UIController {
|
|
|
1607
1632
|
private buttonEvents;
|
|
1608
1633
|
private assetToolbar;
|
|
1609
1634
|
private canvasToolbar;
|
|
1635
|
+
private lastAutoAssetX;
|
|
1636
|
+
private lastAutoAssetY;
|
|
1637
|
+
private lastAutoCanvasX;
|
|
1638
|
+
private lastAutoCanvasY;
|
|
1610
1639
|
/**
|
|
1611
1640
|
* Create a UIController with all standard toolbars pre-registered.
|
|
1612
1641
|
* This is the recommended way to create a UIController for most use cases.
|
|
@@ -1689,6 +1718,10 @@ export declare class UIController {
|
|
|
1689
1718
|
* Update all canvas overlays. Called by Canvas each tick.
|
|
1690
1719
|
*/
|
|
1691
1720
|
updateOverlays(deltaTime: number, elapsed: number): void;
|
|
1721
|
+
/**
|
|
1722
|
+
* Position a sidebar toolbar at autoX/autoY, applying the user's drag offset if present.
|
|
1723
|
+
*/
|
|
1724
|
+
private applySidebarPosition;
|
|
1692
1725
|
/**
|
|
1693
1726
|
* Update toolbar positions to be adjacent to the canvas content.
|
|
1694
1727
|
* Uses position: fixed with screen coordinates for complete independence from parent CSS.
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -31,11 +31,16 @@ export { AssetSchema }
|
|
|
31
31
|
|
|
32
32
|
export declare class AssetToolbar {
|
|
33
33
|
private container;
|
|
34
|
+
private buttonsContainer;
|
|
34
35
|
private ui;
|
|
35
36
|
private unsubscribe;
|
|
37
|
+
private dragResult;
|
|
36
38
|
constructor(ui: UIController);
|
|
39
|
+
getDragState(): ToolbarDragState | null;
|
|
37
40
|
setPosition(screenX: number, screenY: number): void;
|
|
38
|
-
mount(parent: HTMLElement
|
|
41
|
+
mount(parent: HTMLElement, options?: {
|
|
42
|
+
onDragReset?: () => void;
|
|
43
|
+
}): void;
|
|
39
44
|
private render;
|
|
40
45
|
private setupEventListeners;
|
|
41
46
|
dispose(): void;
|
|
@@ -57,7 +62,12 @@ declare abstract class BaseToolbar {
|
|
|
57
62
|
protected selectedTrackIdx: number;
|
|
58
63
|
protected selectedClipIdx: number;
|
|
59
64
|
protected clickOutsideHandler: ((e: MouseEvent) => void) | null;
|
|
65
|
+
protected dragResult: ToolbarDragHandle | null;
|
|
60
66
|
constructor(edit: Edit);
|
|
67
|
+
/**
|
|
68
|
+
* Add a drag handle to the toolbar container and enable free-form dragging.
|
|
69
|
+
*/
|
|
70
|
+
protected enableDrag(): void;
|
|
61
71
|
/**
|
|
62
72
|
* Mount the toolbar to a parent element.
|
|
63
73
|
* Subclasses must implement to build their specific HTML structure.
|
|
@@ -248,6 +258,7 @@ export declare class CanvasToolbar {
|
|
|
248
258
|
private fpsChangeCallback;
|
|
249
259
|
private backgroundChangeCallback;
|
|
250
260
|
private clickOutsideHandler;
|
|
261
|
+
private dragResult;
|
|
251
262
|
private showMergeFields;
|
|
252
263
|
private maxPixels?;
|
|
253
264
|
constructor(edit?: Edit, options?: CanvasToolbarOptions);
|
|
@@ -255,8 +266,11 @@ export declare class CanvasToolbar {
|
|
|
255
266
|
private isOverLimit;
|
|
256
267
|
/** Get the edit as ShotstackEdit if it has merge field capabilities */
|
|
257
268
|
private getShotstackEdit;
|
|
269
|
+
getDragState(): ToolbarDragState | null;
|
|
258
270
|
setPosition(screenX: number, screenY: number): void;
|
|
259
|
-
mount(parent: HTMLElement
|
|
271
|
+
mount(parent: HTMLElement, options?: {
|
|
272
|
+
onDragReset?: () => void;
|
|
273
|
+
}): void;
|
|
260
274
|
private setupEventListeners;
|
|
261
275
|
private togglePopup;
|
|
262
276
|
private closeAllPopups;
|
|
@@ -1530,6 +1544,17 @@ export declare interface ToolbarButtonConfig {
|
|
|
1530
1544
|
dividerBefore?: boolean;
|
|
1531
1545
|
}
|
|
1532
1546
|
|
|
1547
|
+
declare interface ToolbarDragHandle {
|
|
1548
|
+
getState(): ToolbarDragState;
|
|
1549
|
+
dispose(): void;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
declare interface ToolbarDragState {
|
|
1553
|
+
readonly hasUserPosition: boolean;
|
|
1554
|
+
readonly userX: number;
|
|
1555
|
+
readonly userY: number;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1533
1558
|
export declare type Track = components["schemas"]["Track"];
|
|
1534
1559
|
|
|
1535
1560
|
export { TrackSchema }
|
|
@@ -1607,6 +1632,10 @@ export declare class UIController {
|
|
|
1607
1632
|
private buttonEvents;
|
|
1608
1633
|
private assetToolbar;
|
|
1609
1634
|
private canvasToolbar;
|
|
1635
|
+
private lastAutoAssetX;
|
|
1636
|
+
private lastAutoAssetY;
|
|
1637
|
+
private lastAutoCanvasX;
|
|
1638
|
+
private lastAutoCanvasY;
|
|
1610
1639
|
/**
|
|
1611
1640
|
* Create a UIController with all standard toolbars pre-registered.
|
|
1612
1641
|
* This is the recommended way to create a UIController for most use cases.
|
|
@@ -1689,6 +1718,10 @@ export declare class UIController {
|
|
|
1689
1718
|
* Update all canvas overlays. Called by Canvas each tick.
|
|
1690
1719
|
*/
|
|
1691
1720
|
updateOverlays(deltaTime: number, elapsed: number): void;
|
|
1721
|
+
/**
|
|
1722
|
+
* Position a sidebar toolbar at autoX/autoY, applying the user's drag offset if present.
|
|
1723
|
+
*/
|
|
1724
|
+
private applySidebarPosition;
|
|
1692
1725
|
/**
|
|
1693
1726
|
* Update toolbar positions to be adjacent to the canvas content.
|
|
1694
1727
|
* Uses position: fixed with screen coordinates for complete independence from parent CSS.
|