@coxwave/tap-kit-types 2.9.0 → 2.9.2
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 +17 -22
- package/dist/index.js +3 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -230,8 +230,8 @@ type FeatureFlags = Partial<Record<FeatureFlagKey, boolean>>;
|
|
|
230
230
|
*/
|
|
231
231
|
declare function isFeatureEnabled(flags: FeatureFlags | undefined, key: FeatureFlagKey, defaultValue?: boolean): boolean;
|
|
232
232
|
|
|
233
|
-
type TapMessageType = "tap:ready" | "tap:close" | "timeline:seek" | "alarm:click" | "alarm:fadeIn" | "popUp:open" | "popUp:close" | "material:view:open" | "material:view:close" | "material:view:error" | "html:view:open" | "html:view:close" | "container:mode:change" | "container:mode:change:ack" | "container:layout:state:changed" | "viewport:resize" | "config:update" | "config:request" | "GA_EVENT" | "tutor:info";
|
|
234
|
-
type TapMessage = TapReadyMessage | TapCloseMessage | TimelineSeekMessage | AlarmClickMessage | AlarmFadeInMessage | PopUpOpenMessage | PopUpCloseMessage | MaterialViewOpenMessage | MaterialViewCloseMessage | MaterialViewErrorMessage | HtmlViewOpenMessage | HtmlViewCloseMessage | ContainerModeChangeMessage | ContainerModeChangeAckMessage | ContainerLayoutStateChangedMessage | ViewportResizeMessage | ConfigUpdateMessage | ConfigRequestMessage | GAEventMessage | TutorInfoMessage;
|
|
233
|
+
type TapMessageType = "tap:ready" | "tap:close" | "timeline:seek" | "alarm:click" | "alarm:fadeIn" | "popUp:open" | "popUp:close" | "material:view:open" | "material:view:close" | "material:view:error" | "html:view:open" | "html:view:close" | "container:mode:change" | "container:mode:change:ack" | "container:layout:state:changed" | "viewport:resize" | "config:update" | "config:request" | "GA_EVENT" | "tutor:info" | "featureFlags:update";
|
|
234
|
+
type TapMessage = TapReadyMessage | TapCloseMessage | TimelineSeekMessage | AlarmClickMessage | AlarmFadeInMessage | PopUpOpenMessage | PopUpCloseMessage | MaterialViewOpenMessage | MaterialViewCloseMessage | MaterialViewErrorMessage | HtmlViewOpenMessage | HtmlViewCloseMessage | ContainerModeChangeMessage | ContainerModeChangeAckMessage | ContainerLayoutStateChangedMessage | ViewportResizeMessage | ConfigUpdateMessage | ConfigRequestMessage | GAEventMessage | TutorInfoMessage | FeatureFlagsUpdateMessage;
|
|
235
235
|
interface TapReadyMessage {
|
|
236
236
|
type: "tap:ready";
|
|
237
237
|
gaId: string;
|
|
@@ -458,6 +458,15 @@ interface TutorInfoMessage {
|
|
|
458
458
|
type: "tutor:info";
|
|
459
459
|
tutorName: string;
|
|
460
460
|
}
|
|
461
|
+
/**
|
|
462
|
+
* Feature Flags Update Message (iframe → parent)
|
|
463
|
+
* Sent from edutap after tutor_setting API response with feature flags
|
|
464
|
+
* Used to update feature flags store in tap-kit-core
|
|
465
|
+
*/
|
|
466
|
+
interface FeatureFlagsUpdateMessage {
|
|
467
|
+
type: "featureFlags:update";
|
|
468
|
+
flags: FeatureFlags;
|
|
469
|
+
}
|
|
461
470
|
|
|
462
471
|
/**
|
|
463
472
|
* Fallback type.
|
|
@@ -2955,12 +2964,7 @@ interface TapButtonAttributes {
|
|
|
2955
2964
|
* Button position on screen (only applies when floating is true)
|
|
2956
2965
|
* @default "bottom-right"
|
|
2957
2966
|
*/
|
|
2958
|
-
position?:
|
|
2959
|
-
| "bottom-right"
|
|
2960
|
-
| "bottom-left"
|
|
2961
|
-
| "top-right"
|
|
2962
|
-
| "top-left"
|
|
2963
|
-
| "custom";
|
|
2967
|
+
position?: "bottom-right" | "bottom-left" | "top-right" | "top-left" | "custom";
|
|
2964
2968
|
|
|
2965
2969
|
/**
|
|
2966
2970
|
* Button size preset
|
|
@@ -3283,12 +3287,8 @@ interface TapHtmlViewerAttributes {
|
|
|
3283
3287
|
*/
|
|
3284
3288
|
interface EventManager {
|
|
3285
3289
|
seekTimeline: (params: SeekTimelineParamsType) => void;
|
|
3286
|
-
onTimelineSeek: (
|
|
3287
|
-
|
|
3288
|
-
) => () => void;
|
|
3289
|
-
onAlarmFadeIn: (
|
|
3290
|
-
handler: (messageInfo: AlarmMessageInstanceType) => void,
|
|
3291
|
-
) => () => void;
|
|
3290
|
+
onTimelineSeek: (callback: (clipPlayHead: number, clipId: string) => void) => () => void;
|
|
3291
|
+
onAlarmFadeIn: (handler: (messageInfo: AlarmMessageInstanceType) => void) => () => void;
|
|
3292
3292
|
}
|
|
3293
3293
|
|
|
3294
3294
|
/**
|
|
@@ -3451,9 +3451,7 @@ interface TapKitElement extends HTMLElement {
|
|
|
3451
3451
|
* @param course - Partial course information (courseId and clipId required)
|
|
3452
3452
|
* @example kit.setCourse({ courseId: 'new', clipId: 'new-1' })
|
|
3453
3453
|
*/
|
|
3454
|
-
setCourse(
|
|
3455
|
-
course: Partial<Course> & { courseId: string; clipId: string },
|
|
3456
|
-
): void;
|
|
3454
|
+
setCourse(course: Partial<Course> & { courseId: string; clipId: string }): void;
|
|
3457
3455
|
|
|
3458
3456
|
// ===== Delegate Properties (Read-only) =====
|
|
3459
3457
|
|
|
@@ -3924,12 +3922,9 @@ declare global {
|
|
|
3924
3922
|
timeRemaining(): number;
|
|
3925
3923
|
}
|
|
3926
3924
|
|
|
3927
|
-
function requestIdleCallback(
|
|
3928
|
-
callback: (deadline: IdleDeadline) => void,
|
|
3929
|
-
options?: { timeout: number },
|
|
3930
|
-
): number;
|
|
3925
|
+
function requestIdleCallback(callback: (deadline: IdleDeadline) => void, options?: { timeout: number }): number;
|
|
3931
3926
|
|
|
3932
3927
|
function cancelIdleCallback(handle: number): void;
|
|
3933
3928
|
}
|
|
3934
3929
|
|
|
3935
|
-
export { ALARM_DURATION, type AlarmClickMessage, AlarmClickSchema, type AlarmElement, type AlarmElementProps, AlarmElementPropsSchema, AlarmElementSchema, type AlarmFadeInMessage, AlarmFadeInSchema, AlarmMessageInstanceSchema, type AlarmMessageInstanceType, type AlarmPayload, type AlarmType, type CSSStyle, CSSStyleSchema, type ConfigRequestMessage, ConfigRequestSchema, type ConfigUpdateKey, type ConfigUpdateMessage, type ConfigUpdateOptions, type ConfigUpdatePayload, ConfigUpdateSchema, type ContainerConfig, type ContainerLayoutStateChangedMessage, ContainerLayoutStateChangedSchema, type ContainerModeChangeAckMessage, ContainerModeChangeAckSchema, type ContainerModeChangeMessage, ContainerModeChangeSchema, type ContainerVisibility, type Course, type DisplayMode, type EventManager, type FeatureFlagKey, type FeatureFlags, type FloatingConfig, type GAEventMessage, GAEventSchema, type HtmlViewCloseMessage, HtmlViewCloseSchema, type HtmlViewConfig, type HtmlViewOpenMessage, HtmlViewOpenSchema, type ITapButtonElement, type ITapContainerElement, type ITapHtmlViewerElement, type ITapKitElement, type ITapMaterialViewerElement, TapKitInitializationError as InitializationError, type LayoutMode, type MaterialViewCloseMessage, MaterialViewCloseSchema, type MaterialViewConfig, type MaterialViewErrorMessage, MaterialViewErrorSchema, type MaterialViewOpenMessage, MaterialViewOpenSchema, MaterialViewerError, type PopUpCloseMessage, PopUpCloseSchema, type PopUpOpenMessage, PopUpOpenSchema, type PositionType, type SeekTimelineParamsType, type ShortcutKeyPropertiesType, type SidebarConfig, type SyncableConfigKey, TAP_BUTTON_CLICK_EVENT, TAP_ERROR_MARKER, type TapButtonAttributes, type TapButtonClickEventDetail, type TapCloseMessage, TapCloseSchema, type TapContainerAttributes, type TapErrorOptions, type TapHtmlViewerAttributes, type TapKitConfig, TapKitConfigurationError, type TapKitConstructor, type TapKitElement, type TapKitElementEventMap, TapKitError, TapKitIframeError, type TapKitInitParams, TapKitInitializationError, type TapKitInstance, TapKitLoaderError, TapKitMessageError, type TapMaterialViewerAttributes, type TapMessage, type TapMessageRecord, TapMessageSchema, type TapMessageType, type TapReadyMessage, TapReadySchema, type TimelineSeekMessage, TimelineSeekSchema, type TutorInfoMessage, TutorInfoSchema, type VideoController, type VideoPlayerAdapter, type VideoPlayerConfig, type ViewportResizeMessage, ViewportResizeSchema, isFeatureEnabled };
|
|
3930
|
+
export { ALARM_DURATION, type AlarmClickMessage, AlarmClickSchema, type AlarmElement, type AlarmElementProps, AlarmElementPropsSchema, AlarmElementSchema, type AlarmFadeInMessage, AlarmFadeInSchema, AlarmMessageInstanceSchema, type AlarmMessageInstanceType, type AlarmPayload, type AlarmType, type CSSStyle, CSSStyleSchema, type ConfigRequestMessage, ConfigRequestSchema, type ConfigUpdateKey, type ConfigUpdateMessage, type ConfigUpdateOptions, type ConfigUpdatePayload, ConfigUpdateSchema, type ContainerConfig, type ContainerLayoutStateChangedMessage, ContainerLayoutStateChangedSchema, type ContainerModeChangeAckMessage, ContainerModeChangeAckSchema, type ContainerModeChangeMessage, ContainerModeChangeSchema, type ContainerVisibility, type Course, type DisplayMode, type EventManager, type FeatureFlagKey, type FeatureFlags, type FeatureFlagsUpdateMessage, type FloatingConfig, type GAEventMessage, GAEventSchema, type HtmlViewCloseMessage, HtmlViewCloseSchema, type HtmlViewConfig, type HtmlViewOpenMessage, HtmlViewOpenSchema, type ITapButtonElement, type ITapContainerElement, type ITapHtmlViewerElement, type ITapKitElement, type ITapMaterialViewerElement, TapKitInitializationError as InitializationError, type LayoutMode, type MaterialViewCloseMessage, MaterialViewCloseSchema, type MaterialViewConfig, type MaterialViewErrorMessage, MaterialViewErrorSchema, type MaterialViewOpenMessage, MaterialViewOpenSchema, MaterialViewerError, type PopUpCloseMessage, PopUpCloseSchema, type PopUpOpenMessage, PopUpOpenSchema, type PositionType, type SeekTimelineParamsType, type ShortcutKeyPropertiesType, type SidebarConfig, type SyncableConfigKey, TAP_BUTTON_CLICK_EVENT, TAP_ERROR_MARKER, type TapButtonAttributes, type TapButtonClickEventDetail, type TapCloseMessage, TapCloseSchema, type TapContainerAttributes, type TapErrorOptions, type TapHtmlViewerAttributes, type TapKitConfig, TapKitConfigurationError, type TapKitConstructor, type TapKitElement, type TapKitElementEventMap, TapKitError, TapKitIframeError, type TapKitInitParams, TapKitInitializationError, type TapKitInstance, TapKitLoaderError, TapKitMessageError, type TapMaterialViewerAttributes, type TapMessage, type TapMessageRecord, TapMessageSchema, type TapMessageType, type TapReadyMessage, TapReadySchema, type TimelineSeekMessage, TimelineSeekSchema, type TutorInfoMessage, TutorInfoSchema, type VideoController, type VideoPlayerAdapter, type VideoPlayerConfig, type ViewportResizeMessage, ViewportResizeSchema, isFeatureEnabled };
|
package/dist/index.js
CHANGED
|
@@ -149,13 +149,9 @@ var MaterialViewerError = class _MaterialViewerError extends TapKitError {
|
|
|
149
149
|
return error;
|
|
150
150
|
}
|
|
151
151
|
if (error && typeof error === "object" && TAP_ERROR_MARKER in error && error[TAP_ERROR_MARKER] === "MaterialViewerError") {
|
|
152
|
-
const err = new _MaterialViewerError(
|
|
153
|
-
error.
|
|
154
|
-
|
|
155
|
-
{
|
|
156
|
-
code: error.code
|
|
157
|
-
}
|
|
158
|
-
);
|
|
152
|
+
const err = new _MaterialViewerError(error.message, error.materialId || "unknown", {
|
|
153
|
+
code: error.code
|
|
154
|
+
});
|
|
159
155
|
err.stack = error.stack;
|
|
160
156
|
return err;
|
|
161
157
|
}
|