@jolibox/ads 1.2.4 → 1.2.5-beta.3

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.
Files changed (2) hide show
  1. package/dist/index.js +63 -63
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -265,8 +265,8 @@ var x = lt, yn = class {
265
265
  yield t.element, t = t.next;
266
266
  }
267
267
  }, wn = 0, _e = class {
268
- constructor(t) {
269
- this.value = t, this.id = wn++;
268
+ constructor(e) {
269
+ this.value = e, this.id = wn++;
270
270
  }
271
271
  }, ke = class {
272
272
  constructor(e) {
@@ -323,43 +323,43 @@ var x = lt, yn = class {
323
323
  constructor() {
324
324
  this.listeners = /* @__PURE__ */ new Map(), this.listerHandlerMap = /* @__PURE__ */ new WeakMap(), this.cachedEventQueue = /* @__PURE__ */ new Map();
325
325
  }
326
- on(e, i) {
327
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0;
328
- var r;
329
- let o = (r = this.listeners.get(e)) != null ? r : new ke(), s = (l) => i(...l.args), a = o.event(s);
330
- this.listerHandlerMap.set(i, {
331
- handler: s,
332
- dispose: a
333
- }), this.listeners.set(e, o);
334
- let d = this.cachedEventQueue.get(e);
335
- if (d && n)
336
- for (let l of d)
337
- i(...l.args);
338
- }
339
- flushCachedEvent(e) {
340
- e ? this.cachedEventQueue.delete(e) : this.cachedEventQueue.clear();
341
- }
342
- off(e, i) {
343
- let n = this.listerHandlerMap.get(i);
344
- n && (n.dispose(), this.listerHandlerMap.delete(i));
345
- }
346
- emit(e) {
347
- let i = this.listeners.get(e), n = this.cachedEventQueue.get(e);
348
- for (var r = arguments.length, o = new Array(r > 1 ? r - 1 : 0), s = 1; s < r; s++)
349
- o[s - 1] = arguments[s];
350
- n || (n = new yn(), this.cachedEventQueue.set(e, n)), n.push({
351
- args: o
352
- }), i && i.fire({
353
- event: e,
354
- args: o
326
+ on(t, e) {
327
+ let i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0;
328
+ var n;
329
+ let r = (n = this.listeners.get(t)) != null ? n : new ke(), o = (d) => e(...d.args), s = r.event(o);
330
+ this.listerHandlerMap.set(e, {
331
+ handler: o,
332
+ dispose: s
333
+ }), this.listeners.set(t, r);
334
+ let a = this.cachedEventQueue.get(t);
335
+ if (a && i)
336
+ for (let d of a)
337
+ e(...d.args);
338
+ }
339
+ flushCachedEvent(t) {
340
+ t ? this.cachedEventQueue.delete(t) : this.cachedEventQueue.clear();
341
+ }
342
+ off(t, e) {
343
+ let i = this.listerHandlerMap.get(e);
344
+ i && (i.dispose(), this.listerHandlerMap.delete(e));
345
+ }
346
+ emit(t) {
347
+ let e = this.listeners.get(t), i = this.cachedEventQueue.get(t);
348
+ for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++)
349
+ r[o - 1] = arguments[o];
350
+ i || (i = new yn(), this.cachedEventQueue.set(t, i)), i.push({
351
+ args: r
352
+ }), e && e.fire({
353
+ event: t,
354
+ args: r
355
355
  });
356
356
  }
357
- once(e, i) {
358
- var n = this;
359
- let r = function() {
360
- i(...arguments), n.off(e, r);
357
+ once(t, e) {
358
+ var i = this;
359
+ let n = function() {
360
+ e(...arguments), i.off(t, n);
361
361
  };
362
- this.on(e, r, !1);
362
+ this.on(t, n, !1);
363
363
  }
364
364
  }, ct = {};
365
365
  Zi(ct, {
@@ -430,35 +430,35 @@ var ht = class {
430
430
  constructor() {
431
431
  this._commands = /* @__PURE__ */ new Map(), this._onDidRegisterCommand = new ke(), this.onDidRegisterCommand = this._onDidRegisterCommand.event, console.log("[Jolibox SDK] command registry");
432
432
  }
433
- registerCommand(e) {
434
- if (!e)
433
+ registerCommand(t) {
434
+ if (!t)
435
435
  throw new Error("invalid command");
436
- if (e.metadata && Array.isArray(e.metadata.args)) {
437
- let n = [];
438
- for (let o of e.metadata.args)
439
- n.push(o.constraint);
440
- let r = e.handler;
441
- e.handler = function() {
442
- for (var o = arguments.length, s = new Array(o), a = 0; a < o; a++)
443
- s[a] = arguments[a];
444
- return Sn(s, n), r(...s);
436
+ if (t.metadata && Array.isArray(t.metadata.args)) {
437
+ let i = [];
438
+ for (let r of t.metadata.args)
439
+ i.push(r.constraint);
440
+ let n = t.handler;
441
+ t.handler = function() {
442
+ for (var r = arguments.length, o = new Array(r), s = 0; s < r; s++)
443
+ o[s] = arguments[s];
444
+ return Sn(o, i), n(...o);
445
445
  };
446
446
  }
447
447
  let {
448
- id: i
449
- } = e;
450
- this._commands.get(i) && console.info(`[Jolibox SDK] duplicated command is registered ${i}`), this._commands.set(i, e), this._onDidRegisterCommand.fire(i);
448
+ id: e
449
+ } = t;
450
+ this._commands.get(e) && console.info(`[Jolibox SDK] duplicated command is registered ${e}`), this._commands.set(e, t), this._onDidRegisterCommand.fire(e);
451
451
  }
452
- getCommand(e) {
453
- return this._commands.get(e);
452
+ getCommand(t) {
453
+ return this._commands.get(t);
454
454
  }
455
455
  getCommands() {
456
- let e = /* @__PURE__ */ new Map();
457
- for (let i of this._commands.keys()) {
458
- let n = this.getCommand(i);
459
- n && e.set(i, n);
456
+ let t = /* @__PURE__ */ new Map();
457
+ for (let e of this._commands.keys()) {
458
+ let i = this.getCommand(e);
459
+ i && t.set(e, i);
460
460
  }
461
- return e;
461
+ return t;
462
462
  }
463
463
  };
464
464
  ht = ri([oi], ht);
@@ -3404,7 +3404,7 @@ function co(t, e) {
3404
3404
  }
3405
3405
  return (e === "string" ? String : Number)(t);
3406
3406
  }
3407
- class zo {
3407
+ class Ko {
3408
3408
  constructor(e) {
3409
3409
  if (z(this, "context", void 0), z(this, "contextInfo", void 0), z(this, "providers", {}), z(this, "channelPolicy", void 0), z(this, "adsActionDetection", void 0), z(this, "requestContext", void 0), z(this, "adsRequest", void 0), z(this, "initialized", !1), z(this, "adsIsShowing", !1), z(this, "lastAdBreak", void 0), z(this, "initializedTimeStamp", Date.now()), e)
3410
3410
  this.context = e, this.channelPolicy = new Ln(this.context), this.adsActionDetection = new Tn(this.context), this.contextInfo = this.context.getContextInfo(), this.adsRequest = new $i(e), this.requestContext = new Et(e);
@@ -4199,7 +4199,7 @@ function Mo(t, e) {
4199
4199
  }
4200
4200
  return (e === "string" ? String : Number)(t);
4201
4201
  }
4202
- class Ho {
4202
+ class zo {
4203
4203
  constructor(e) {
4204
4204
  if (le(this, "context", void 0), le(this, "contextInfo", void 0), le(this, "providers", {}), le(this, "requestContext", void 0), le(this, "adsRequest", void 0), le(this, "initialized", !1), e)
4205
4205
  this.context = e, this.requestContext = new Et(e), this.adsRequest = new $i(e, {
@@ -4320,7 +4320,7 @@ function Bo(t, e) {
4320
4320
  }
4321
4321
  return (e === "string" ? String : Number)(t);
4322
4322
  }
4323
- class Wo extends Error {
4323
+ class Ho extends Error {
4324
4324
  constructor(e) {
4325
4325
  super(e), ue(this, "name", void 0), ue(this, "message", void 0), ue(this, "errMsg", void 0), ue(this, "code", void 0), ue(this, "data", void 0), ue(this, "extra", void 0), this.name = "ResponseError", this.message = e, this.errMsg = e;
4326
4326
  }
@@ -4330,11 +4330,11 @@ export {
4330
4330
  Mn as GoogleAdSenseProvider,
4331
4331
  ko as GoogleIMAProvider,
4332
4332
  eo as InterstitialAdManager,
4333
- zo as JoliboxAdsForGame,
4334
- Ho as JoliboxAdsForVideo,
4333
+ Ko as JoliboxAdsForGame,
4334
+ zo as JoliboxAdsForVideo,
4335
4335
  Kr as OKSpinForGameProvider,
4336
4336
  xo as OKSpinForVideoProvider,
4337
- Wo as ResponseError,
4337
+ Ho as ResponseError,
4338
4338
  Mi as RewardAdManager,
4339
4339
  Ni as initGPTServices
4340
4340
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jolibox/ads",
3
3
  "description": "This project is for integrating Jolibox ads providers",
4
- "version": "1.2.4",
4
+ "version": "1.2.5-beta.3",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "type": "module",
@@ -12,9 +12,9 @@
12
12
  ],
13
13
  "types": "./dist/index.d.ts",
14
14
  "dependencies": {
15
- "@jolibox/common": "1.2.4",
15
+ "@jolibox/common": "1.2.5-beta.3",
16
16
  "@emotion/css": "11.13.5",
17
- "@jolibox/types": "1.2.4",
17
+ "@jolibox/types": "1.2.5-beta.3",
18
18
  "preact": "10.26.4",
19
19
  "@preact/signals": "2.0.4"
20
20
  },
@@ -25,7 +25,7 @@
25
25
  "@babel/runtime": "7.22.10",
26
26
  "@babel/runtime-corejs3": "7.22.10",
27
27
  "@babel/plugin-transform-react-jsx": "7.25.9",
28
- "@jolibox/eslint-config": "1.0.0",
28
+ "@jolibox/eslint-config": "1.0.1-beta.11",
29
29
  "@preact/preset-vite": "2.8.1",
30
30
  "@rollup/plugin-replace": "6.0.2",
31
31
  "@types/google-publisher-tag": "1.20250428.0",