@shotstack/shotstack-studio 2.0.0-beta.10 → 2.0.0-beta.12
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 +16 -74
- package/dist/internal.es.js +49545 -0
- package/dist/internal.umd.js +298 -0
- package/dist/schema/index.cjs +1 -1
- package/dist/schema/index.d.ts +16 -74
- package/dist/schema/index.mjs +246 -245
- package/dist/shotstack-studio.es.js +33342 -27570
- package/dist/shotstack-studio.umd.js +194 -172
- package/package.json +13 -3
package/dist/index.d.ts
CHANGED
|
@@ -281,6 +281,8 @@ export declare class CanvasToolbar {
|
|
|
281
281
|
constructor(edit?: Edit, options?: {
|
|
282
282
|
mergeFields?: boolean;
|
|
283
283
|
});
|
|
284
|
+
/** Get the edit as ShotstackEdit if it has merge field capabilities */
|
|
285
|
+
private getShotstackEdit;
|
|
284
286
|
setPosition(screenX: number, screenY: number): void;
|
|
285
287
|
mount(parent: HTMLElement): void;
|
|
286
288
|
private setupEventListeners;
|
|
@@ -528,8 +530,6 @@ export declare class Edit extends Entity {
|
|
|
528
530
|
private isLoadingEdit;
|
|
529
531
|
private syncCorrectionCount;
|
|
530
532
|
private toolbarButtons;
|
|
531
|
-
/** Merge field service for managing dynamic content placeholders */
|
|
532
|
-
mergeFields: MergeFieldService;
|
|
533
533
|
private canvas;
|
|
534
534
|
private lumaMaskController;
|
|
535
535
|
private clipErrors;
|
|
@@ -700,12 +700,12 @@ export declare class Edit extends Entity {
|
|
|
700
700
|
*/
|
|
701
701
|
updateClipTiming(trackIdx: number, clipIdx: number, params: TimingUpdateParams): void;
|
|
702
702
|
executeEditCommand(command: EditCommand): void | Promise<void>;
|
|
703
|
-
|
|
703
|
+
protected executeCommand(command: EditCommand): void | Promise<void>;
|
|
704
704
|
/**
|
|
705
705
|
* Emits a unified `edit:changed` event after any state mutation.
|
|
706
706
|
* Consumers can subscribe to this single event instead of tracking 31+ granular events.
|
|
707
707
|
*/
|
|
708
|
-
|
|
708
|
+
protected emitEditChanged(source: string): void;
|
|
709
709
|
/**
|
|
710
710
|
* Detects merge field placeholders in the raw edit before substitution.
|
|
711
711
|
* Returns a map of clip keys ("trackIdx-clipIdx") to their merge field bindings.
|
|
@@ -727,7 +727,7 @@ export declare class Edit extends Entity {
|
|
|
727
727
|
* Only called when structure is unchanged (same track/clip counts).
|
|
728
728
|
*/
|
|
729
729
|
private applyGranularChanges;
|
|
730
|
-
|
|
730
|
+
protected createCommandContext(): CommandContext;
|
|
731
731
|
private queueDisposeClip;
|
|
732
732
|
protected disposeClips(): void;
|
|
733
733
|
/**
|
|
@@ -817,69 +817,9 @@ export declare class Edit extends Entity {
|
|
|
817
817
|
*/
|
|
818
818
|
getToolbarButtons(): ToolbarButtonConfig_2[];
|
|
819
819
|
/** Get the exportable clip (with merge field placeholders restored) */
|
|
820
|
-
|
|
820
|
+
protected getTemplateClip(trackIndex: number, clipIndex: number): ResolvedClip | null;
|
|
821
821
|
/** Get the text content from the template clip (with merge field placeholders) */
|
|
822
822
|
getTemplateClipText(trackIdx: number, clipIdx: number): string | null;
|
|
823
|
-
/**
|
|
824
|
-
* Apply a merge field to a clip property.
|
|
825
|
-
* Creates a command for undo/redo support.
|
|
826
|
-
*
|
|
827
|
-
* @param trackIndex - Track index
|
|
828
|
-
* @param clipIndex - Clip index within the track
|
|
829
|
-
* @param propertyPath - Dot-notation path to property (e.g., "asset.src", "asset.color")
|
|
830
|
-
* @param fieldName - Name of the merge field (e.g., "MEDIA_URL")
|
|
831
|
-
* @param value - The resolved value to apply
|
|
832
|
-
* @param originalValue - Optional: the original value before merge field (for undo)
|
|
833
|
-
*/
|
|
834
|
-
applyMergeField(trackIndex: number, clipIndex: number, propertyPath: string, fieldName: string, value: string, originalValue?: string): void;
|
|
835
|
-
/**
|
|
836
|
-
* Remove a merge field from a clip property, restoring the original value.
|
|
837
|
-
*
|
|
838
|
-
* @param trackIndex - Track index
|
|
839
|
-
* @param clipIndex - Clip index within the track
|
|
840
|
-
* @param propertyPath - Dot-notation path to property (e.g., "asset.src")
|
|
841
|
-
* @param restoreValue - The value to restore (original pre-merge-field value)
|
|
842
|
-
*/
|
|
843
|
-
removeMergeField(trackIndex: number, clipIndex: number, propertyPath: string, restoreValue: string): void;
|
|
844
|
-
/**
|
|
845
|
-
* Get the merge field name for a clip property, if any.
|
|
846
|
-
*
|
|
847
|
-
* @returns The field name if a merge field is applied, null otherwise
|
|
848
|
-
*/
|
|
849
|
-
getMergeFieldForProperty(trackIndex: number, clipIndex: number, propertyPath: string): string | null;
|
|
850
|
-
/**
|
|
851
|
-
* Update the value of a merge field. Updates all clips using this field in-place.
|
|
852
|
-
* This does NOT use the command pattern (no undo) - it's for live preview updates.
|
|
853
|
-
*/
|
|
854
|
-
updateMergeFieldValueLive(fieldName: string, newValue: string): void;
|
|
855
|
-
/** Helper: Update merge field binding resolvedValues for a player */
|
|
856
|
-
private updateMergeFieldBindings;
|
|
857
|
-
/** Helper: Update merge field occurrences in an object */
|
|
858
|
-
private updateMergeFieldInObject;
|
|
859
|
-
/**
|
|
860
|
-
* Redraw all clips that use a specific merge field.
|
|
861
|
-
* Call this after updateMergeFieldValueLive() to refresh the canvas.
|
|
862
|
-
* Handles both text redraws and asset reloads for URL changes.
|
|
863
|
-
*/
|
|
864
|
-
redrawMergeFieldClips(fieldName: string): void;
|
|
865
|
-
/** Helper: Check if and how a clip uses a specific merge field */
|
|
866
|
-
private getMergeFieldUsage;
|
|
867
|
-
/**
|
|
868
|
-
* Check if a merge field is used for asset.src in any clip.
|
|
869
|
-
* Used by UI to determine if URL validation should be applied.
|
|
870
|
-
*/
|
|
871
|
-
isSrcMergeField(fieldName: string): boolean;
|
|
872
|
-
/**
|
|
873
|
-
* Remove a merge field globally from all clips and the registry.
|
|
874
|
-
* Restores all affected clip properties to the merge field's default value.
|
|
875
|
-
*
|
|
876
|
-
* @param fieldName - The merge field name to remove
|
|
877
|
-
*/
|
|
878
|
-
deleteMergeFieldGlobally(fieldName: string): void;
|
|
879
|
-
/**
|
|
880
|
-
* Helper: Find and restore merge field occurrences in a clip
|
|
881
|
-
*/
|
|
882
|
-
private restoreMergeFieldInClip;
|
|
883
823
|
/** Map of content player → luma player for attachment tracking */
|
|
884
824
|
private lumaAttachments;
|
|
885
825
|
/** Map of asset src → original asset type (for reliable luma detachment) */
|
|
@@ -1208,6 +1148,8 @@ export declare class MediaToolbar extends BaseToolbar {
|
|
|
1208
1148
|
private showMergeFields;
|
|
1209
1149
|
private assetType;
|
|
1210
1150
|
constructor(edit: Edit, options?: MediaToolbarOptions);
|
|
1151
|
+
/** Get the edit as ShotstackEdit if it has merge field capabilities */
|
|
1152
|
+
private getShotstackEdit;
|
|
1211
1153
|
private currentFit;
|
|
1212
1154
|
private currentVolume;
|
|
1213
1155
|
private transitionPanel;
|
|
@@ -1548,7 +1490,8 @@ declare enum PlayerType {
|
|
|
1548
1490
|
Luma = "luma",
|
|
1549
1491
|
Html = "html",
|
|
1550
1492
|
Shape = "shape",
|
|
1551
|
-
Caption = "caption"
|
|
1493
|
+
Caption = "caption",
|
|
1494
|
+
Svg = "svg"
|
|
1552
1495
|
}
|
|
1553
1496
|
|
|
1554
1497
|
declare type ResolutionChangeCallback = (width: number, height: number) => void;
|
|
@@ -1589,6 +1532,7 @@ export declare class RichTextToolbar extends BaseToolbar {
|
|
|
1589
1532
|
private fontPicker;
|
|
1590
1533
|
private sizeInput;
|
|
1591
1534
|
private sizePopup;
|
|
1535
|
+
private weightDropdown;
|
|
1592
1536
|
private weightPopup;
|
|
1593
1537
|
private weightPreview;
|
|
1594
1538
|
private spacingPopup;
|
|
@@ -1644,6 +1588,7 @@ export declare class RichTextToolbar extends BaseToolbar {
|
|
|
1644
1588
|
private stylePanel;
|
|
1645
1589
|
private boundHandleClick;
|
|
1646
1590
|
constructor(edit: Edit, options?: RichTextToolbarOptions);
|
|
1591
|
+
private getShotstackEdit;
|
|
1647
1592
|
mount(parent: HTMLElement): void;
|
|
1648
1593
|
private handleClick;
|
|
1649
1594
|
private getCurrentAsset;
|
|
@@ -1677,7 +1622,7 @@ export declare class RichTextToolbar extends BaseToolbar {
|
|
|
1677
1622
|
private getFilteredFieldCount;
|
|
1678
1623
|
private buildFontPicker;
|
|
1679
1624
|
private getDisplayName;
|
|
1680
|
-
private
|
|
1625
|
+
private selectFont;
|
|
1681
1626
|
private updateVerticalAlign;
|
|
1682
1627
|
private cycleAlignment;
|
|
1683
1628
|
private updateAlignment;
|
|
@@ -1713,17 +1658,12 @@ declare type Seconds = number & {
|
|
|
1713
1658
|
|
|
1714
1659
|
declare const SecondsSymbol: unique symbol;
|
|
1715
1660
|
|
|
1716
|
-
/**
|
|
1717
|
-
* SelectionHandles renders selection UI (outline + resize handles) on selected players
|
|
1718
|
-
* and handles all drag/resize/rotate interactions.
|
|
1719
|
-
*
|
|
1720
|
-
* This class decouples interaction logic from Player, allowing Canvas to work as a pure renderer.
|
|
1721
|
-
*/
|
|
1722
1661
|
export declare class SelectionHandles implements CanvasOverlayRegistration {
|
|
1723
1662
|
private edit;
|
|
1724
1663
|
private container;
|
|
1725
1664
|
private outline;
|
|
1726
1665
|
private handles;
|
|
1666
|
+
private edgeHandles;
|
|
1727
1667
|
private app;
|
|
1728
1668
|
private positionBuilder;
|
|
1729
1669
|
private selectedPlayer;
|
|
@@ -1756,6 +1696,7 @@ export declare class SelectionHandles implements CanvasOverlayRegistration {
|
|
|
1756
1696
|
private syncToPlayer;
|
|
1757
1697
|
private drawOutline;
|
|
1758
1698
|
private drawHandles;
|
|
1699
|
+
private drawEdgeHandles;
|
|
1759
1700
|
private getUIScale;
|
|
1760
1701
|
private onPointerDown;
|
|
1761
1702
|
private onPointerMove;
|
|
@@ -1847,6 +1788,7 @@ export declare class TextToolbar extends BaseToolbar {
|
|
|
1847
1788
|
private effectPopup;
|
|
1848
1789
|
private effectPanel;
|
|
1849
1790
|
private boundHandleClick;
|
|
1791
|
+
private getShotstackEdit;
|
|
1850
1792
|
mount(parent: HTMLElement): void;
|
|
1851
1793
|
private bindElements;
|
|
1852
1794
|
private setupEventListeners;
|