@vvfx/sdk 0.2.2-beta.4 → 0.2.2-beta.5
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/config.d.ts +8 -0
- package/dist/html-overlay/manager.d.ts +37 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +491 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +491 -21
- package/dist/index.mjs.map +1 -1
- package/dist/layer-order.d.ts +7 -0
- package/dist/sdk.d.ts +1 -0
- package/dist/types.d.ts +15 -0
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
|
@@ -151,6 +151,14 @@ export type CardTypeConfig = {
|
|
|
151
151
|
* @description HTML 内容是否跟随卡片 scale 缩放,关闭后 HTML 按最终显示尺寸重新布局
|
|
152
152
|
*/
|
|
153
153
|
autoScale?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* @description 是否启用编辑态交互。未配置时默认 true;只有显式 false 时,卡片默认直接交互且不进入编辑态。
|
|
156
|
+
*/
|
|
157
|
+
editable?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* @description HTML 内容中可在非编辑态直接响应事件的额外 CSS 选择器;会与 SDK 默认交互选择器合并。
|
|
160
|
+
*/
|
|
161
|
+
htmlInteractionSelectors?: string[];
|
|
154
162
|
};
|
|
155
163
|
/**
|
|
156
164
|
* @description 卡片元素参数配置
|
|
@@ -26,15 +26,32 @@ type HTMLOverlayManagerOptions = {
|
|
|
26
26
|
}) => void;
|
|
27
27
|
viewportFit: (box: Box2) => void;
|
|
28
28
|
setCardItemHeight: (id: string, height: number) => void;
|
|
29
|
+
getSelectedItemIds: () => string[];
|
|
30
|
+
getPreSelectedItemId: () => string | undefined;
|
|
31
|
+
getSelectionEdgeStyle: () => {
|
|
32
|
+
color: number;
|
|
33
|
+
alpha: number;
|
|
34
|
+
width: number;
|
|
35
|
+
};
|
|
36
|
+
getPreSelectionEdgeStyle: () => {
|
|
37
|
+
color: number;
|
|
38
|
+
alpha: number;
|
|
39
|
+
width: number;
|
|
40
|
+
};
|
|
41
|
+
getCanvasEventTarget?: () => HTMLElement | undefined;
|
|
29
42
|
resolveCardHTML: (item: SDKItem) => CardHTML | undefined;
|
|
30
43
|
resolveCardTypeConfig: (item: SDKItem) => CardTypeConfig | undefined;
|
|
31
44
|
};
|
|
32
45
|
export declare class HTMLOverlayManager {
|
|
33
46
|
private options;
|
|
34
47
|
private eventCleanups;
|
|
48
|
+
private htmlRootConfigCleanups;
|
|
49
|
+
private pendingContentInteractionEvent?;
|
|
50
|
+
private contentInteractionFrame?;
|
|
35
51
|
private state;
|
|
36
52
|
constructor(options: HTMLOverlayManagerOptions);
|
|
37
53
|
attach(): void;
|
|
54
|
+
get layerElement(): HTMLElement | undefined;
|
|
38
55
|
dispose(): void;
|
|
39
56
|
scheduleRender(): void;
|
|
40
57
|
invalidateCardHTML(id: string): void;
|
|
@@ -45,26 +62,46 @@ export declare class HTMLOverlayManager {
|
|
|
45
62
|
private handleContainerMouseDown;
|
|
46
63
|
private handleContainerMouseMove;
|
|
47
64
|
private handleContainerMouseLeave;
|
|
65
|
+
private handleContainerContextMenu;
|
|
66
|
+
private isHTMLContextMenuEvent;
|
|
48
67
|
private handleViewportTransform;
|
|
49
68
|
private render;
|
|
50
69
|
private syncOverlayOrder;
|
|
70
|
+
private getOrCreateSelectionLayer;
|
|
51
71
|
private renderFrameOverlays;
|
|
52
72
|
private getOrCreateFrameOverlay;
|
|
53
73
|
private getOrCreateOverlay;
|
|
74
|
+
private getOrCreateSelectionOverlay;
|
|
75
|
+
private syncOverlaySelection;
|
|
76
|
+
private getSelectionBoxShadow;
|
|
77
|
+
private getPreSelectionBoxShadow;
|
|
54
78
|
private getHTMLCardIdByEvent;
|
|
55
79
|
private getHoverShellInteractiveIdByEvent;
|
|
80
|
+
private syncActiveContentInteraction;
|
|
81
|
+
private scheduleActiveContentInteractionSync;
|
|
82
|
+
private setActiveContentInteraction;
|
|
83
|
+
private getContentInteractiveZoneByEvent;
|
|
84
|
+
private getContentInteractionZones;
|
|
85
|
+
private getContentInteractiveSelector;
|
|
86
|
+
private isContentInteractionDisabled;
|
|
87
|
+
private invalidateContentInteractionZones;
|
|
88
|
+
private observeContentInteractionZoneResizes;
|
|
56
89
|
private getLayerPoint;
|
|
57
90
|
private getOrCreateContentOverlay;
|
|
58
91
|
private createContentScaleOverlay;
|
|
59
92
|
private syncContentScale;
|
|
60
93
|
private requestAutoHeightFromIframes;
|
|
61
94
|
private syncContentInteraction;
|
|
95
|
+
private syncContentInteractionZones;
|
|
62
96
|
private syncShellInteraction;
|
|
63
97
|
private enterEditing;
|
|
64
98
|
private exitEditing;
|
|
99
|
+
private isEditableCard;
|
|
65
100
|
private getEditingFitZoom;
|
|
66
101
|
private isEventInsideOverlay;
|
|
67
102
|
private renderOverlayHTML;
|
|
103
|
+
private observeContentInteractionZones;
|
|
104
|
+
private applyHTMLRootConfig;
|
|
68
105
|
private renderOverlayContent;
|
|
69
106
|
private chainCleanups;
|
|
70
107
|
private cleanupOverlayContent;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { SDKOptions, SDKInputParam, PageData, PageProperty, ViewProperty, ActiveData, ViewParam, BaseItemProperty, SpriteItemProperty, TextItemProperty, VideoItemProperty, GeneratorItemProperty, FrameItemProperty, FrameLayoutMode, SpriteCreateInfo, TextCreateInfo, GroupCreateInfo, VideoCreateInfo, GeneratorCreateInfo, EffectsCreateInfo, FrameCreateInfo, CardCreateInfo, CardItemProperty, CardItemTransformInfo, ItemCreateInfo, } from './types';
|
|
2
|
-
export type { CardTypeConfig, CardConfig } from './config';
|
|
1
|
+
export type { SDKOptions, SDKInputParam, PageData, PageProperty, ViewProperty, ActiveData, ViewParam, BaseItemProperty, SpriteItemProperty, TextItemProperty, VideoItemProperty, GeneratorItemProperty, FrameItemProperty, FrameLayoutMode, SpriteCreateInfo, TextCreateInfo, GroupCreateInfo, VideoCreateInfo, GeneratorCreateInfo, EffectsCreateInfo, FrameCreateInfo, CardCreateInfo, CardItemProperty, CardItemTransformInfo, CardHTML, CardHTMLContent, CardHTMLInlineContent, CardHTMLDOMRendererContent, CardHTMLDocumentContent, CardHTMLDocumentMessage, CardHTMLShellContent, CardHTMLShellRenderer, CardHTMLShellRendererContext, CardHTMLShellRendererResult, CardHTMLDOMRenderer, CardHTMLContentCleanup, CardHTMLRenderCleanup, CardHTMLRootConfig, CardHTMLRootStyle, ItemCreateInfo, } from './types';
|
|
2
|
+
export type { SDKConfig, SDKMode, CardTypeConfig, CardConfig, CardTypeHTMLResolver, } from './config';
|
|
3
3
|
export type { SDKItem } from './sdk-item';
|
|
4
4
|
export { BaseItem, SpriteItem, TextItem, VideoItem, GroupItem, GeneratorItem, EffectsItem, FrameItem, CardItem, isBaseItem, isSpriteItem, isTextItem, isVideoItem, isGroupItem, isGeneratorItem, isEffectsItem, isFrameItem, isCardItem, SDKItemType, } from './sdk-item';
|
|
5
5
|
export type { SDKItemOptions, SpriteItemOptions, TextItemOptions, VideoItemOptions, GroupItemOptions, GeneratorItemOptions, EffectsItemOptions, FrameItemOptions, CardItemOptions, } from './sdk-item';
|