@adstage/web-sdk 2.4.2 → 2.4.4
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.cjs.js +9 -7
- package/dist/index.d.ts +15 -3
- package/dist/index.esm.js +8 -7
- package/dist/index.standalone.js +8 -7
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/react/AdStageProvider.tsx +7 -6
- package/src/react/index.ts +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3371,21 +3371,22 @@ function AdStageProvider({ children, config }) {
|
|
|
3371
3371
|
* AdStage Context Hook
|
|
3372
3372
|
* AdStageProvider 내에서 SDK 상태에 접근할 수 있습니다.
|
|
3373
3373
|
*/
|
|
3374
|
-
function
|
|
3374
|
+
function useAdStageContext() {
|
|
3375
3375
|
const context = react.useContext(AdStageContext);
|
|
3376
3376
|
if (!context) {
|
|
3377
|
-
throw new Error('
|
|
3377
|
+
throw new Error('useAdStageContext must be used within an AdStageProvider');
|
|
3378
3378
|
}
|
|
3379
3379
|
return context;
|
|
3380
3380
|
}
|
|
3381
3381
|
/**
|
|
3382
|
-
* AdStage
|
|
3382
|
+
* AdStage Instance Hook
|
|
3383
3383
|
* 초기화된 AdStage 인스턴스에 직접 접근할 수 있습니다.
|
|
3384
3384
|
*/
|
|
3385
|
-
function
|
|
3386
|
-
const { isInitialized } =
|
|
3385
|
+
function useAdStageInstance() {
|
|
3386
|
+
const { isInitialized } = useAdStageContext();
|
|
3387
3387
|
if (!isInitialized) {
|
|
3388
|
-
|
|
3388
|
+
console.warn('AdStage SDK is not initialized. Please call initialize() first or provide config to AdStageProvider.');
|
|
3389
|
+
return null;
|
|
3389
3390
|
}
|
|
3390
3391
|
return AdStage;
|
|
3391
3392
|
}
|
|
@@ -3403,4 +3404,5 @@ exports.AdStage = AdStage;
|
|
|
3403
3404
|
exports.AdStageProvider = AdStageProvider;
|
|
3404
3405
|
exports.SDK_VERSION = SDK_VERSION;
|
|
3405
3406
|
exports.SUPPORTED_MODULES = SUPPORTED_MODULES;
|
|
3406
|
-
exports.
|
|
3407
|
+
exports.useAdStageContext = useAdStageContext;
|
|
3408
|
+
exports.useAdStageInstance = useAdStageInstance;
|
package/dist/index.d.ts
CHANGED
|
@@ -486,6 +486,13 @@ declare class AdStage {
|
|
|
486
486
|
static reset(): void;
|
|
487
487
|
}
|
|
488
488
|
|
|
489
|
+
interface AdStageContextType {
|
|
490
|
+
isInitialized: boolean;
|
|
491
|
+
config: AdStageConfig | null;
|
|
492
|
+
initialize: (config: AdStageConfig) => void;
|
|
493
|
+
reset: () => void;
|
|
494
|
+
error: string | null;
|
|
495
|
+
}
|
|
489
496
|
interface AdStageProviderProps {
|
|
490
497
|
children: ReactNode;
|
|
491
498
|
/**
|
|
@@ -496,10 +503,15 @@ interface AdStageProviderProps {
|
|
|
496
503
|
}
|
|
497
504
|
declare function AdStageProvider({ children, config }: AdStageProviderProps): react_jsx_runtime.JSX.Element;
|
|
498
505
|
/**
|
|
499
|
-
* AdStage
|
|
506
|
+
* AdStage Context Hook
|
|
507
|
+
* AdStageProvider 내에서 SDK 상태에 접근할 수 있습니다.
|
|
508
|
+
*/
|
|
509
|
+
declare function useAdStageContext(): AdStageContextType;
|
|
510
|
+
/**
|
|
511
|
+
* AdStage Instance Hook
|
|
500
512
|
* 초기화된 AdStage 인스턴스에 직접 접근할 수 있습니다.
|
|
501
513
|
*/
|
|
502
|
-
declare function
|
|
514
|
+
declare function useAdStageInstance(): typeof AdStage | null;
|
|
503
515
|
|
|
504
516
|
/**
|
|
505
517
|
* AdStage Web SDK
|
|
@@ -509,4 +521,4 @@ declare function useAdStageSDK(): typeof AdStage;
|
|
|
509
521
|
declare const SDK_VERSION = "2.0.0";
|
|
510
522
|
declare const SUPPORTED_MODULES: readonly ["ads", "events", "config"];
|
|
511
523
|
|
|
512
|
-
export { AdEventType, AdOptions, AdSlot, AdStage, AdStageConfig, AdStageProvider, AdType, Advertisement, ApiResponse, BaseModule, EventProperties, ModuleName, OrganizationInfo, PageData, SDK_VERSION, SUPPORTED_MODULES,
|
|
524
|
+
export { AdEventType, AdOptions, AdSlot, AdStage, AdStageConfig, AdStageProvider, AdType, Advertisement, ApiResponse, BaseModule, EventProperties, ModuleName, OrganizationInfo, PageData, SDK_VERSION, SUPPORTED_MODULES, useAdStageContext, useAdStageInstance };
|
package/dist/index.esm.js
CHANGED
|
@@ -3369,21 +3369,22 @@ function AdStageProvider({ children, config }) {
|
|
|
3369
3369
|
* AdStage Context Hook
|
|
3370
3370
|
* AdStageProvider 내에서 SDK 상태에 접근할 수 있습니다.
|
|
3371
3371
|
*/
|
|
3372
|
-
function
|
|
3372
|
+
function useAdStageContext() {
|
|
3373
3373
|
const context = useContext(AdStageContext);
|
|
3374
3374
|
if (!context) {
|
|
3375
|
-
throw new Error('
|
|
3375
|
+
throw new Error('useAdStageContext must be used within an AdStageProvider');
|
|
3376
3376
|
}
|
|
3377
3377
|
return context;
|
|
3378
3378
|
}
|
|
3379
3379
|
/**
|
|
3380
|
-
* AdStage
|
|
3380
|
+
* AdStage Instance Hook
|
|
3381
3381
|
* 초기화된 AdStage 인스턴스에 직접 접근할 수 있습니다.
|
|
3382
3382
|
*/
|
|
3383
|
-
function
|
|
3384
|
-
const { isInitialized } =
|
|
3383
|
+
function useAdStageInstance() {
|
|
3384
|
+
const { isInitialized } = useAdStageContext();
|
|
3385
3385
|
if (!isInitialized) {
|
|
3386
|
-
|
|
3386
|
+
console.warn('AdStage SDK is not initialized. Please call initialize() first or provide config to AdStageProvider.');
|
|
3387
|
+
return null;
|
|
3387
3388
|
}
|
|
3388
3389
|
return AdStage;
|
|
3389
3390
|
}
|
|
@@ -3397,4 +3398,4 @@ function useAdStageSDK() {
|
|
|
3397
3398
|
const SDK_VERSION = '2.0.0';
|
|
3398
3399
|
const SUPPORTED_MODULES = ['ads', 'events', 'config'];
|
|
3399
3400
|
|
|
3400
|
-
export { AdStage, AdStageProvider, SDK_VERSION, SUPPORTED_MODULES,
|
|
3401
|
+
export { AdStage, AdStageProvider, SDK_VERSION, SUPPORTED_MODULES, useAdStageContext, useAdStageInstance };
|
package/dist/index.standalone.js
CHANGED
|
@@ -3441,21 +3441,22 @@ function AdStageProvider({ children, config }) {
|
|
|
3441
3441
|
* AdStage Context Hook
|
|
3442
3442
|
* AdStageProvider 내에서 SDK 상태에 접근할 수 있습니다.
|
|
3443
3443
|
*/
|
|
3444
|
-
function
|
|
3444
|
+
function useAdStageContext() {
|
|
3445
3445
|
const context = reactExports.useContext(AdStageContext);
|
|
3446
3446
|
if (!context) {
|
|
3447
|
-
throw new Error('
|
|
3447
|
+
throw new Error('useAdStageContext must be used within an AdStageProvider');
|
|
3448
3448
|
}
|
|
3449
3449
|
return context;
|
|
3450
3450
|
}
|
|
3451
3451
|
/**
|
|
3452
|
-
* AdStage
|
|
3452
|
+
* AdStage Instance Hook
|
|
3453
3453
|
* 초기화된 AdStage 인스턴스에 직접 접근할 수 있습니다.
|
|
3454
3454
|
*/
|
|
3455
|
-
function
|
|
3456
|
-
const { isInitialized } =
|
|
3455
|
+
function useAdStageInstance() {
|
|
3456
|
+
const { isInitialized } = useAdStageContext();
|
|
3457
3457
|
if (!isInitialized) {
|
|
3458
|
-
|
|
3458
|
+
console.warn('AdStage SDK is not initialized. Please call initialize() first or provide config to AdStageProvider.');
|
|
3459
|
+
return null;
|
|
3459
3460
|
}
|
|
3460
3461
|
return AdStage;
|
|
3461
3462
|
}
|
|
@@ -3469,4 +3470,4 @@ function useAdStageSDK() {
|
|
|
3469
3470
|
const SDK_VERSION = '2.0.0';
|
|
3470
3471
|
const SUPPORTED_MODULES = ['ads', 'events', 'config'];
|
|
3471
3472
|
|
|
3472
|
-
export { AdStage, AdStageProvider, SDK_VERSION, SUPPORTED_MODULES,
|
|
3473
|
+
export { AdStage, AdStageProvider, SDK_VERSION, SUPPORTED_MODULES, useAdStageContext, useAdStageInstance };
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
export { default as AdStage } from './core/AdStage';
|
|
8
8
|
|
|
9
9
|
// React 통합
|
|
10
|
-
export { AdStageProvider,
|
|
10
|
+
export { AdStageProvider, useAdStageContext, useAdStageInstance } from './react';
|
|
11
11
|
|
|
12
12
|
// 설정 및 타입
|
|
13
13
|
export type { AdStageConfig, ModuleName, BaseModule, ApiResponse, OrganizationInfo } from './types/config';
|
|
@@ -94,23 +94,24 @@ export function AdStageProvider({ children, config }: AdStageProviderProps) {
|
|
|
94
94
|
* AdStage Context Hook
|
|
95
95
|
* AdStageProvider 내에서 SDK 상태에 접근할 수 있습니다.
|
|
96
96
|
*/
|
|
97
|
-
export function
|
|
97
|
+
export function useAdStageContext(): AdStageContextType {
|
|
98
98
|
const context = useContext(AdStageContext);
|
|
99
99
|
if (!context) {
|
|
100
|
-
throw new Error('
|
|
100
|
+
throw new Error('useAdStageContext must be used within an AdStageProvider');
|
|
101
101
|
}
|
|
102
102
|
return context;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
|
-
* AdStage
|
|
106
|
+
* AdStage Instance Hook
|
|
107
107
|
* 초기화된 AdStage 인스턴스에 직접 접근할 수 있습니다.
|
|
108
108
|
*/
|
|
109
|
-
export function
|
|
110
|
-
const { isInitialized } =
|
|
109
|
+
export function useAdStageInstance() {
|
|
110
|
+
const { isInitialized } = useAdStageContext();
|
|
111
111
|
|
|
112
112
|
if (!isInitialized) {
|
|
113
|
-
|
|
113
|
+
console.warn('AdStage SDK is not initialized. Please call initialize() first or provide config to AdStageProvider.');
|
|
114
|
+
return null;
|
|
114
115
|
}
|
|
115
116
|
|
|
116
117
|
return AdStage;
|
package/src/react/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* React 애플리케이션을 위한 컴포넌트와 훅들
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export { AdStageProvider,
|
|
6
|
+
export { AdStageProvider, useAdStageContext, useAdStageInstance } from './AdStageProvider';
|
|
7
7
|
|
|
8
8
|
// 타입들도 재export
|
|
9
9
|
export type { AdStageConfig, ModuleName, BaseModule } from '../types/config';
|