@coxwave/tap-kit 1.0.4 → 1.0.6
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.cts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/react.d.cts +24 -1
- package/dist/react.d.ts +24 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _coxwave_tap_kit_types from '@coxwave/tap-kit-types';
|
|
2
|
-
import { TAPKIT_CONFIG_SYMBOL as TAPKIT_CONFIG_SYMBOL$1, TapKitInstance, TapKitConfig, TapKitInitParams, TapKitConfigOptions } from '@coxwave/tap-kit-types';
|
|
2
|
+
import { TAPKIT_CONFIG_SYMBOL as TAPKIT_CONFIG_SYMBOL$1, TapKitInstance, TapKitConfig, TapKitInitParams, TapKitConfigOptions, TapButtonAttributes } from '@coxwave/tap-kit-types';
|
|
3
3
|
export { AlarmMessageInstanceType, AlarmType, ContainerConfig, ContainerMode, Course, ITapButtonElement, PositionType, SeekTimelineParamsType, TapButtonAttributes, TapKitConfig, TapKitConfigOptions, TapKitConstructor, TapKitInitParams, TapKitInstance } from '@coxwave/tap-kit-types';
|
|
4
4
|
|
|
5
5
|
/** @internal Symbol for internal configuration method */
|
|
@@ -61,4 +61,17 @@ declare class TapKit implements TapKitInstance {
|
|
|
61
61
|
get [Symbol.toStringTag](): string;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* TapKit - Official TapKit Web SDK
|
|
66
|
+
* @see https://edutap-ai-docs.vercel.app
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
declare global {
|
|
70
|
+
namespace JSX {
|
|
71
|
+
interface IntrinsicElements {
|
|
72
|
+
"tap-button": TapButtonAttributes;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
64
77
|
export { TAPKIT_CONFIG_SYMBOL, TapKit, TapKit as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _coxwave_tap_kit_types from '@coxwave/tap-kit-types';
|
|
2
|
-
import { TAPKIT_CONFIG_SYMBOL as TAPKIT_CONFIG_SYMBOL$1, TapKitInstance, TapKitConfig, TapKitInitParams, TapKitConfigOptions } from '@coxwave/tap-kit-types';
|
|
2
|
+
import { TAPKIT_CONFIG_SYMBOL as TAPKIT_CONFIG_SYMBOL$1, TapKitInstance, TapKitConfig, TapKitInitParams, TapKitConfigOptions, TapButtonAttributes } from '@coxwave/tap-kit-types';
|
|
3
3
|
export { AlarmMessageInstanceType, AlarmType, ContainerConfig, ContainerMode, Course, ITapButtonElement, PositionType, SeekTimelineParamsType, TapButtonAttributes, TapKitConfig, TapKitConfigOptions, TapKitConstructor, TapKitInitParams, TapKitInstance } from '@coxwave/tap-kit-types';
|
|
4
4
|
|
|
5
5
|
/** @internal Symbol for internal configuration method */
|
|
@@ -61,4 +61,17 @@ declare class TapKit implements TapKitInstance {
|
|
|
61
61
|
get [Symbol.toStringTag](): string;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* TapKit - Official TapKit Web SDK
|
|
66
|
+
* @see https://edutap-ai-docs.vercel.app
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
declare global {
|
|
70
|
+
namespace JSX {
|
|
71
|
+
interface IntrinsicElements {
|
|
72
|
+
"tap-button": TapButtonAttributes;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
64
77
|
export { TAPKIT_CONFIG_SYMBOL, TapKit, TapKit as default };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var O=Object.defineProperty;var
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var O=Object.defineProperty;var h=i=>{throw TypeError(i)};var g=(i,t,n)=>t in i?O(i,t,{enumerable:true,configurable:true,writable:true,value:n}):i[t]=n;var A=(i,t,n)=>g(i,typeof t!="symbol"?t+"":t,n),D=(i,t,n)=>t.has(i)||h("Cannot "+n);var r=(i,t,n)=>(D(i,t,"read from private field"),n?n.call(i):t.get(i)),c=(i,t,n)=>t.has(i)?h("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,n),T=(i,t,n,e)=>(D(i,t,"write to private field"),t.set(i,n),n);var m="https://files.edutap.ai/tap-sdk/loader.js";function y(){return window?.__TAP_KIT_LOADER_URL__?window.__TAP_KIT_LOADER_URL__:m}function C(){return typeof window<"u"&&!!window.__TAP_KIT_CORE_URL__}function P(){return window.__TAP_KIT_CORE_URL__||""}function E(i,t,n){let e=Date.now(),o=()=>{if(window.TapKit&&window.TapKitLoaded===true){window.__TAP_KIT_LOADER_LOADED__=true,window.__TAP_KIT_LOADER_LOADING__=void 0,i();return}if(Date.now()-e>n){window.__TAP_KIT_LOADER_LOADING__=void 0,t(new Error(`TapKit loader timeout: SDK not available after ${n}ms`));return}typeof requestIdleCallback<"u"?requestIdleCallback(o,{timeout:500}):setTimeout(o,500);};return o}function I(i=4e3){if(window.__TAP_KIT_LOADER_LOADED__&&window.TapKit)return Promise.resolve();if(window.__TAP_KIT_LOADER_LOADING__)return window.__TAP_KIT_LOADER_LOADING__;let t=new Promise((n,e)=>{if(typeof document>"u"){e(new Error("TapKit requires browser environment (document is undefined)"));return}if(C()){if(window.TapKit&&window.TapKitLoaded===true){window.__TAP_KIT_LOADER_LOADED__=true,window.__TAP_KIT_LOADER_LOADING__=void 0,n();return}let w=P(),u=document.createElement("script");u.src=w,u.async=true,u.onload=()=>{window.TapKit?(window.TapKitLoaded=true,window.__TAP_KIT_LOADER_LOADED__=true,window.__TAP_KIT_LOADER_LOADING__=void 0,n()):(window.__TAP_KIT_LOADER_LOADING__=void 0,e(new Error("TapKit not available after loading local core")));},u.onerror=()=>{window.__TAP_KIT_LOADER_LOADING__=void 0,e(new Error(`Failed to load local TapKit core: ${w}`));},document.head.appendChild(u);return}let o=y(),d=document.createElement("script");d.src=o,d.async=true,d.onload=()=>{E(n,e,i)();},d.onerror=()=>{window.__TAP_KIT_LOADER_LOADING__=void 0,e(new Error(`Failed to load TapKit CDN loader: ${o}`));};let K=document.querySelector(`script[src="${o}"]`);K?(K.addEventListener("load",()=>{E(n,e,i)();}),K.addEventListener("error",()=>e(new Error(`Failed to load TapKit CDN loader: ${o}`)))):document.head.appendChild(d);});return window.__TAP_KIT_LOADER_LOADING__=t,t}var f=Symbol.for("tapkit.config"),_,s,a,p,l,L=class{constructor(t){A(this,"instance",null);c(this,_);c(this,s);c(this,a,null);A(this,"pendingConfig");c(this,p);c(this,l);T(this,s,t),T(this,_,this.load());}async load(){try{if(await I(),!window.TapKit)throw new Error("TapKit not available after loading CDN loader");this.instance=new window.TapKit(r(this,s)),this.pendingConfig&&(this.instance[f]?.(this.pendingConfig),this.pendingConfig=void 0);}catch(t){throw T(this,a,t instanceof Error?t:new Error(String(t))),r(this,a)}}get loaded(){return r(this,_).then(()=>{if(r(this,a))throw r(this,a);if(!this.instance)throw new Error(`TapKit instance not initialized after loading. This may indicate a CDN loading failure for apiKey: ${r(this,s).apiKey}`)})}get ready(){return r(this,_).then(()=>{if(r(this,a))throw r(this,a);if(!this.instance)throw new Error(`TapKit instance not initialized after loading. This may indicate a CDN loading failure for apiKey: ${r(this,s).apiKey}`);return this.instance.ready})}get events(){return r(this,p)||T(this,p,new Proxy({},{get:(t,n)=>(...e)=>this.ready.then(()=>{let o=(this.instance?.events)[n];return typeof o=="function"?o(...e):o})})),r(this,p)}get isOpen(){return this.instance?.isOpen??false}get isInitialized(){return this.instance?.isInitialized??false}get video(){return r(this,l)||T(this,l,new Proxy({},{get:(t,n)=>(...e)=>this.ready.then(()=>{let o=(this.instance?.video)[n];return typeof o=="function"?o(...e):o})})),r(this,l)}async init(t){if(await r(this,_),!this.instance)throw new Error("TapKit instance not available after loading");return await this.instance.init(t)}destroy(){this.instance&&(this.instance.destroy(),this.instance=null);}[f](t){if(!this.instance){this.pendingConfig=t;return}this.instance[f]?.(t);}get[Symbol.toStringTag](){return "TapKit"}};_=new WeakMap,s=new WeakMap,a=new WeakMap,p=new WeakMap,l=new WeakMap;
|
|
2
2
|
exports.TAPKIT_CONFIG_SYMBOL=f;exports.TapKit=L;exports.default=L;//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var O=Object.defineProperty;var
|
|
1
|
+
var O=Object.defineProperty;var h=i=>{throw TypeError(i)};var g=(i,t,n)=>t in i?O(i,t,{enumerable:true,configurable:true,writable:true,value:n}):i[t]=n;var A=(i,t,n)=>g(i,typeof t!="symbol"?t+"":t,n),D=(i,t,n)=>t.has(i)||h("Cannot "+n);var r=(i,t,n)=>(D(i,t,"read from private field"),n?n.call(i):t.get(i)),c=(i,t,n)=>t.has(i)?h("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,n),T=(i,t,n,e)=>(D(i,t,"write to private field"),t.set(i,n),n);var m="https://files.edutap.ai/tap-sdk/loader.js";function y(){return window?.__TAP_KIT_LOADER_URL__?window.__TAP_KIT_LOADER_URL__:m}function C(){return typeof window<"u"&&!!window.__TAP_KIT_CORE_URL__}function P(){return window.__TAP_KIT_CORE_URL__||""}function E(i,t,n){let e=Date.now(),o=()=>{if(window.TapKit&&window.TapKitLoaded===true){window.__TAP_KIT_LOADER_LOADED__=true,window.__TAP_KIT_LOADER_LOADING__=void 0,i();return}if(Date.now()-e>n){window.__TAP_KIT_LOADER_LOADING__=void 0,t(new Error(`TapKit loader timeout: SDK not available after ${n}ms`));return}typeof requestIdleCallback<"u"?requestIdleCallback(o,{timeout:500}):setTimeout(o,500);};return o}function I(i=4e3){if(window.__TAP_KIT_LOADER_LOADED__&&window.TapKit)return Promise.resolve();if(window.__TAP_KIT_LOADER_LOADING__)return window.__TAP_KIT_LOADER_LOADING__;let t=new Promise((n,e)=>{if(typeof document>"u"){e(new Error("TapKit requires browser environment (document is undefined)"));return}if(C()){if(window.TapKit&&window.TapKitLoaded===true){window.__TAP_KIT_LOADER_LOADED__=true,window.__TAP_KIT_LOADER_LOADING__=void 0,n();return}let w=P(),u=document.createElement("script");u.src=w,u.async=true,u.onload=()=>{window.TapKit?(window.TapKitLoaded=true,window.__TAP_KIT_LOADER_LOADED__=true,window.__TAP_KIT_LOADER_LOADING__=void 0,n()):(window.__TAP_KIT_LOADER_LOADING__=void 0,e(new Error("TapKit not available after loading local core")));},u.onerror=()=>{window.__TAP_KIT_LOADER_LOADING__=void 0,e(new Error(`Failed to load local TapKit core: ${w}`));},document.head.appendChild(u);return}let o=y(),d=document.createElement("script");d.src=o,d.async=true,d.onload=()=>{E(n,e,i)();},d.onerror=()=>{window.__TAP_KIT_LOADER_LOADING__=void 0,e(new Error(`Failed to load TapKit CDN loader: ${o}`));};let K=document.querySelector(`script[src="${o}"]`);K?(K.addEventListener("load",()=>{E(n,e,i)();}),K.addEventListener("error",()=>e(new Error(`Failed to load TapKit CDN loader: ${o}`)))):document.head.appendChild(d);});return window.__TAP_KIT_LOADER_LOADING__=t,t}var f=Symbol.for("tapkit.config"),_,s,a,p,l,L=class{constructor(t){A(this,"instance",null);c(this,_);c(this,s);c(this,a,null);A(this,"pendingConfig");c(this,p);c(this,l);T(this,s,t),T(this,_,this.load());}async load(){try{if(await I(),!window.TapKit)throw new Error("TapKit not available after loading CDN loader");this.instance=new window.TapKit(r(this,s)),this.pendingConfig&&(this.instance[f]?.(this.pendingConfig),this.pendingConfig=void 0);}catch(t){throw T(this,a,t instanceof Error?t:new Error(String(t))),r(this,a)}}get loaded(){return r(this,_).then(()=>{if(r(this,a))throw r(this,a);if(!this.instance)throw new Error(`TapKit instance not initialized after loading. This may indicate a CDN loading failure for apiKey: ${r(this,s).apiKey}`)})}get ready(){return r(this,_).then(()=>{if(r(this,a))throw r(this,a);if(!this.instance)throw new Error(`TapKit instance not initialized after loading. This may indicate a CDN loading failure for apiKey: ${r(this,s).apiKey}`);return this.instance.ready})}get events(){return r(this,p)||T(this,p,new Proxy({},{get:(t,n)=>(...e)=>this.ready.then(()=>{let o=(this.instance?.events)[n];return typeof o=="function"?o(...e):o})})),r(this,p)}get isOpen(){return this.instance?.isOpen??false}get isInitialized(){return this.instance?.isInitialized??false}get video(){return r(this,l)||T(this,l,new Proxy({},{get:(t,n)=>(...e)=>this.ready.then(()=>{let o=(this.instance?.video)[n];return typeof o=="function"?o(...e):o})})),r(this,l)}async init(t){if(await r(this,_),!this.instance)throw new Error("TapKit instance not available after loading");return await this.instance.init(t)}destroy(){this.instance&&(this.instance.destroy(),this.instance=null);}[f](t){if(!this.instance){this.pendingConfig=t;return}this.instance[f]?.(t);}get[Symbol.toStringTag](){return "TapKit"}};_=new WeakMap,s=new WeakMap,a=new WeakMap,p=new WeakMap,l=new WeakMap;
|
|
2
2
|
export{f as TAPKIT_CONFIG_SYMBOL,L as TapKit,L as default};//# sourceMappingURL=index.mjs.map
|
|
3
3
|
//# sourceMappingURL=index.mjs.map
|
package/dist/react.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TapKitInstance, TapKitInitParams, TapKitConfig } from '@coxwave/tap-kit-types';
|
|
1
|
+
import { TapKitInstance, TapKitInitParams, TapKitConfig, TapButtonAttributes } from '@coxwave/tap-kit-types';
|
|
2
2
|
|
|
3
3
|
interface UseTapKitReturn {
|
|
4
4
|
/** TapKit instance */
|
|
@@ -61,4 +61,27 @@ interface UseTapKitReturn {
|
|
|
61
61
|
*/
|
|
62
62
|
declare function useTapKit(config: TapKitConfig): UseTapKitReturn;
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* TapKit React Integration
|
|
66
|
+
*
|
|
67
|
+
* React 앱에서 TapKit을 쉽게 사용할 수 있는 Hook을 제공합니다.
|
|
68
|
+
*
|
|
69
|
+
* useTapKit은 useSyncExternalStore를 활용하여 전역 store를 관리합니다.
|
|
70
|
+
* 같은 apiKey로 여러 컴포넌트에서 호출하면 자동으로 같은 인스턴스를 공유합니다.
|
|
71
|
+
*
|
|
72
|
+
* **Note for Next.js App Router users:**
|
|
73
|
+
* If you're using this in a Next.js App Router project with Server Components,
|
|
74
|
+
* make sure to add 'use client' at the top of your component file that imports this hook.
|
|
75
|
+
*
|
|
76
|
+
* @see https://edutap-ai-docs.vercel.app/docs/guides/react
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
declare global {
|
|
80
|
+
namespace JSX {
|
|
81
|
+
interface IntrinsicElements {
|
|
82
|
+
"tap-button": TapButtonAttributes;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
64
87
|
export { type UseTapKitReturn, useTapKit };
|
package/dist/react.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TapKitInstance, TapKitInitParams, TapKitConfig } from '@coxwave/tap-kit-types';
|
|
1
|
+
import { TapKitInstance, TapKitInitParams, TapKitConfig, TapButtonAttributes } from '@coxwave/tap-kit-types';
|
|
2
2
|
|
|
3
3
|
interface UseTapKitReturn {
|
|
4
4
|
/** TapKit instance */
|
|
@@ -61,4 +61,27 @@ interface UseTapKitReturn {
|
|
|
61
61
|
*/
|
|
62
62
|
declare function useTapKit(config: TapKitConfig): UseTapKitReturn;
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* TapKit React Integration
|
|
66
|
+
*
|
|
67
|
+
* React 앱에서 TapKit을 쉽게 사용할 수 있는 Hook을 제공합니다.
|
|
68
|
+
*
|
|
69
|
+
* useTapKit은 useSyncExternalStore를 활용하여 전역 store를 관리합니다.
|
|
70
|
+
* 같은 apiKey로 여러 컴포넌트에서 호출하면 자동으로 같은 인스턴스를 공유합니다.
|
|
71
|
+
*
|
|
72
|
+
* **Note for Next.js App Router users:**
|
|
73
|
+
* If you're using this in a Next.js App Router project with Server Components,
|
|
74
|
+
* make sure to add 'use client' at the top of your component file that imports this hook.
|
|
75
|
+
*
|
|
76
|
+
* @see https://edutap-ai-docs.vercel.app/docs/guides/react
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
declare global {
|
|
80
|
+
namespace JSX {
|
|
81
|
+
interface IntrinsicElements {
|
|
82
|
+
"tap-button": TapButtonAttributes;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
64
87
|
export { type UseTapKitReturn, useTapKit };
|