@vvfx/sdk 0.2.2-beta.3 → 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 CHANGED
@@ -143,6 +143,22 @@ export type CardTypeConfig = {
143
143
  * @description 卡片类型对应的运行时 HTML 渲染配置;函数不会进入序列化数据,恢复时由 cardType 动态解析。
144
144
  */
145
145
  html?: CardTypeHTMLResolver;
146
+ /**
147
+ * @description 是否根据 HTML 挂载内容的自然高度自动更新卡片高度
148
+ */
149
+ autoHeight?: boolean;
150
+ /**
151
+ * @description HTML 内容是否跟随卡片 scale 缩放,关闭后 HTML 按最终显示尺寸重新布局
152
+ */
153
+ autoScale?: boolean;
154
+ /**
155
+ * @description 是否启用编辑态交互。未配置时默认 true;只有显式 false 时,卡片默认直接交互且不进入编辑态。
156
+ */
157
+ editable?: boolean;
158
+ /**
159
+ * @description HTML 内容中可在非编辑态直接响应事件的额外 CSS 选择器;会与 SDK 默认交互选择器合并。
160
+ */
161
+ htmlInteractionSelectors?: string[];
146
162
  };
147
163
  /**
148
164
  * @description 卡片元素参数配置
@@ -1,5 +1,6 @@
1
1
  import type { Box2 } from '../math';
2
2
  import { type SnapdomOptions } from '@zumer/snapdom';
3
+ import type { CardTypeConfig } from '../config';
3
4
  import type { EventEmitter } from '../shared';
4
5
  import type { SDKEvents } from '../sdk';
5
6
  import { type SDKItem } from '../sdk-item';
@@ -25,16 +26,35 @@ type HTMLOverlayManagerOptions = {
25
26
  }) => void;
26
27
  viewportFit: (box: Box2) => void;
27
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;
28
42
  resolveCardHTML: (item: SDKItem) => CardHTML | undefined;
43
+ resolveCardTypeConfig: (item: SDKItem) => CardTypeConfig | undefined;
29
44
  };
30
45
  export declare class HTMLOverlayManager {
31
46
  private options;
32
47
  private eventCleanups;
48
+ private htmlRootConfigCleanups;
49
+ private pendingContentInteractionEvent?;
50
+ private contentInteractionFrame?;
33
51
  private state;
34
52
  constructor(options: HTMLOverlayManagerOptions);
35
53
  attach(): void;
54
+ get layerElement(): HTMLElement | undefined;
36
55
  dispose(): void;
37
56
  scheduleRender(): void;
57
+ invalidateCardHTML(id: string): void;
38
58
  rasterizeCard(id: string, options: CardRasterizeOptions): Promise<string | undefined>;
39
59
  private initEvents;
40
60
  private initDOMEvents;
@@ -42,26 +62,46 @@ export declare class HTMLOverlayManager {
42
62
  private handleContainerMouseDown;
43
63
  private handleContainerMouseMove;
44
64
  private handleContainerMouseLeave;
65
+ private handleContainerContextMenu;
66
+ private isHTMLContextMenuEvent;
45
67
  private handleViewportTransform;
46
68
  private render;
47
69
  private syncOverlayOrder;
70
+ private getOrCreateSelectionLayer;
48
71
  private renderFrameOverlays;
49
72
  private getOrCreateFrameOverlay;
50
73
  private getOrCreateOverlay;
74
+ private getOrCreateSelectionOverlay;
75
+ private syncOverlaySelection;
76
+ private getSelectionBoxShadow;
77
+ private getPreSelectionBoxShadow;
51
78
  private getHTMLCardIdByEvent;
52
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;
53
89
  private getLayerPoint;
54
90
  private getOrCreateContentOverlay;
55
91
  private createContentScaleOverlay;
56
92
  private syncContentScale;
57
93
  private requestAutoHeightFromIframes;
58
94
  private syncContentInteraction;
95
+ private syncContentInteractionZones;
59
96
  private syncShellInteraction;
60
97
  private enterEditing;
61
98
  private exitEditing;
99
+ private isEditableCard;
62
100
  private getEditingFitZoom;
63
101
  private isEventInsideOverlay;
64
102
  private renderOverlayHTML;
103
+ private observeContentInteractionZones;
104
+ private applyHTMLRootConfig;
65
105
  private renderOverlayContent;
66
106
  private chainCleanups;
67
107
  private cleanupOverlayContent;
@@ -78,5 +118,7 @@ export declare class HTMLOverlayManager {
78
118
  private applyAutoHeight;
79
119
  private getAutoHeightItemHeight;
80
120
  private isAutoHeightMessage;
121
+ private isAutoHeightEnabled;
122
+ private isAutoScaleEnabled;
81
123
  }
82
124
  export {};
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';