@plaidev/karte-action-sdk 1.1.268-29138921.8752a776 → 1.1.268-29148584.667572de

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.
@@ -74,6 +74,7 @@ export type BackgroundColorProps = {
74
74
  };
75
75
  export type BackgroundImageProps = {
76
76
  backgroundImageUrl?: string
77
+ backgroundSize?: Properties["backgroundSize"]
77
78
  backgroundPositionX?: Properties["backgroundPositionX"]
78
79
  backgroundPositionY?: Properties["backgroundPositionY"]
79
80
  backgroundBlendMode?: Properties["backgroundBlendMode"]
@@ -74,6 +74,7 @@ export type BackgroundColorProps = {
74
74
  };
75
75
  export type BackgroundImageProps = {
76
76
  backgroundImageUrl?: string
77
+ backgroundSize?: Properties["backgroundSize"]
77
78
  backgroundPositionX?: Properties["backgroundPositionX"]
78
79
  backgroundPositionY?: Properties["backgroundPositionY"]
79
80
  backgroundBlendMode?: Properties["backgroundBlendMode"]
@@ -382,6 +382,14 @@ const OnClickOperationOptions = [
382
382
  default: "/"
383
383
  }]
384
384
  },
385
+ {
386
+ operation: "callNativeFunction",
387
+ args: [{
388
+ name: "url",
389
+ type: "NativeFunction",
390
+ default: ""
391
+ }]
392
+ },
385
393
  {
386
394
  operation: "closeApp",
387
395
  args: [{
@@ -2487,8 +2495,13 @@ async function loadGlobalStyle(href) {
2487
2495
  return new Promise((resolve, reject) => {
2488
2496
  const action = document.querySelector(`.${KARTE_ACTION_ROOT}[data-${KARTE_ACTION_RID}='${actionId}']`);
2489
2497
  if (!action) return;
2498
+ const DATA_ATTR_KEY = "data-krt-action-font";
2499
+ const oldFontLink = document.querySelector(`link[${DATA_ATTR_KEY}]`);
2500
+ if (oldFontLink) if (oldFontLink.getAttribute("href") === href) return;
2501
+ else oldFontLink.parentElement?.removeChild(oldFontLink);
2490
2502
  const link = document.createElement("link");
2491
2503
  link.rel = "stylesheet";
2504
+ link.setAttribute(DATA_ATTR_KEY, "");
2492
2505
  link.href = href;
2493
2506
  link.type = "text/css";
2494
2507
  action.appendChild(link);
@@ -4421,6 +4434,7 @@ const bootChat = (hide_launcher, placement_pc, placement_mobile, horizontal_spac
4421
4434
  /** @internal */
4422
4435
  const execOnClickOperation = (onClickOperation) => {
4423
4436
  if (onClickOperation.operation === "linkTo") linkTo(...onClickOperation.args)();
4437
+ else if (onClickOperation.operation === "callNativeFunction") linkTo(...onClickOperation.args)();
4424
4438
  else if (onClickOperation.operation === "moveTo") moveTo(...onClickOperation.args)();
4425
4439
  else if (onClickOperation.operation === "closeApp") closeApp(onClickOperation.args[0] || "button")();
4426
4440
  else if (onClickOperation.operation === "runScript") runScript(onClickOperation.args[0])();
@@ -12957,7 +12971,7 @@ const toCssBackground = (p, brandKit) => {
12957
12971
  return {
12958
12972
  backgroundColor: p?.backgroundBlendColor ?? p?.backgroundColor ?? variant?.getProps(brandKit)?.backgroundColor,
12959
12973
  ...url ? {
12960
- backgroundSize: url ? "cover" : void 0,
12974
+ backgroundSize: url ? p.backgroundSize ?? "cover" : void 0,
12961
12975
  backgroundImage: url ? `url(${url})` : void 0,
12962
12976
  backgroundPositionX: p?.backgroundPositionX ?? "center",
12963
12977
  backgroundPositionY: p?.backgroundPositionY ?? "center",
@@ -12986,10 +13000,13 @@ const toCssOverflow = (p) => {
12986
13000
  //#region src/hooks/useClickable.ts
12987
13001
  const getHref = (onClick) => {
12988
13002
  if (!onClick) return void 0;
12989
- if (onClick.operation !== "linkTo") return void 0;
12990
- const href = String(onClick.args[0]) || "";
12991
- const decode = onClick.args[2] ?? false;
12992
- return decode ? decodeURI(href) : href;
13003
+ if (onClick.operation === "callNativeFunction") return String(onClick.args[0]);
13004
+ if (onClick.operation === "linkTo") {
13005
+ const href = String(onClick.args[0]) || "";
13006
+ const decode = onClick.args[2] ?? false;
13007
+ return decode ? decodeURI(href) : href;
13008
+ }
13009
+ return void 0;
12993
13010
  };
12994
13011
  const getTarget = (onClick) => {
12995
13012
  if (!onClick) return void 0;
@@ -13000,7 +13017,8 @@ const useClickable = ({ eventValue = {}, eventName = "", onClick, element: eleme
13000
13017
  const fixedElement = (() => {
13001
13018
  if (!onClick) return element$1;
13002
13019
  switch (onClick.operation) {
13003
- case "linkTo": return "a";
13020
+ case "linkTo":
13021
+ case "callNativeFunction": return "a";
13004
13022
  case "none": return element$1;
13005
13023
  default: return "button";
13006
13024
  }
@@ -19861,9 +19879,9 @@ function instance$13($$self, $$props, $$invalidate) {
19861
19879
  let { layerId = "" } = $$props;
19862
19880
  const { brandKit } = useBrandKit();
19863
19881
  const isExistBackgroundOverlayValue = placement && placement.backgroundOverlay !== void 0;
19864
- let backgroundOverlay = DefaultModalPlacement.backgroundOverlay;
19865
- let backgroundOverlayPC = DefaultModalPlacement.backgroundOverlay;
19866
- let backgroundOverlaySP = DefaultModalPlacement.backgroundOverlay;
19882
+ let backgroundOverlay = placement.position === "center";
19883
+ let backgroundOverlayPC = placement.position === "center";
19884
+ let backgroundOverlaySP = placement.position === "center";
19867
19885
  let backgroundClickFunction = DefaultModalPlacement.backgroundClick;
19868
19886
  let backgroundClickFunctionPC = DefaultModalPlacement.backgroundClick;
19869
19887
  let backgroundClickFunctionSP = DefaultModalPlacement.backgroundClick;
@@ -21104,6 +21122,7 @@ function instance$7($$self, $$props, $$invalidate) {
21104
21122
  let player = null;
21105
21123
  function onPlayerReady() {
21106
21124
  if (props.mute || props.autoplay) player.setVolume(0);
21125
+ if (props.autoplay) player.playVideo();
21107
21126
  }
21108
21127
  const getPlayerVars = () => {
21109
21128
  const boolToNumber = (bool, defaultValue = 0) => typeof bool === "boolean" ? bool ? 1 : 0 : defaultValue;
@@ -21113,6 +21132,7 @@ function instance$7($$self, $$props, $$invalidate) {
21113
21132
  showinfo: 0,
21114
21133
  iv_load_policy: 1,
21115
21134
  modestbranding: 1,
21135
+ mute: props.autoplay || props.mute ? 1 : 0,
21116
21136
  rel: boolToNumber(props.showRelatedMovies),
21117
21137
  autoplay: boolToNumber(props.autoplay),
21118
21138
  controls: boolToNumber(props.controls),
@@ -66,6 +66,7 @@ type OperationArgumentTypes = {
66
66
  Color: string
67
67
  Handler: string
68
68
  Trigger: string
69
+ NativeFunction: string
69
70
  };
70
71
  /** @internal */
71
72
  export type OperationArgumentType = keyof OperationArgumentTypes;
@@ -111,6 +112,13 @@ export declare const OnClickOperationOptions: readonly [{
111
112
  readonly type: "TransitState"
112
113
  readonly default: "/"
113
114
  }]
115
+ }, {
116
+ readonly operation: "callNativeFunction"
117
+ readonly args: readonly [{
118
+ readonly name: "url"
119
+ readonly type: "NativeFunction"
120
+ readonly default: ""
121
+ }]
114
122
  }, {
115
123
  readonly operation: "closeApp"
116
124
  readonly args: readonly [{
package/dist/index.es.js CHANGED
@@ -382,6 +382,14 @@ const OnClickOperationOptions = [
382
382
  default: "/"
383
383
  }]
384
384
  },
385
+ {
386
+ operation: "callNativeFunction",
387
+ args: [{
388
+ name: "url",
389
+ type: "NativeFunction",
390
+ default: ""
391
+ }]
392
+ },
385
393
  {
386
394
  operation: "closeApp",
387
395
  args: [{
@@ -2457,8 +2465,13 @@ async function loadGlobalStyle(href) {
2457
2465
  return new Promise((resolve, reject) => {
2458
2466
  const action = document.querySelector(`.${KARTE_ACTION_ROOT}[data-${KARTE_ACTION_RID}='${actionId}']`);
2459
2467
  if (!action) return;
2468
+ const DATA_ATTR_KEY = "data-krt-action-font";
2469
+ const oldFontLink = document.querySelector(`link[${DATA_ATTR_KEY}]`);
2470
+ if (oldFontLink) if (oldFontLink.getAttribute("href") === href) return;
2471
+ else oldFontLink.parentElement?.removeChild(oldFontLink);
2460
2472
  const link = document.createElement("link");
2461
2473
  link.rel = "stylesheet";
2474
+ link.setAttribute(DATA_ATTR_KEY, "");
2462
2475
  link.href = href;
2463
2476
  link.type = "text/css";
2464
2477
  action.appendChild(link);
@@ -4171,6 +4184,7 @@ const bootChat = (hide_launcher, placement_pc, placement_mobile, horizontal_spac
4171
4184
  /** @internal */
4172
4185
  const execOnClickOperation = (onClickOperation) => {
4173
4186
  if (onClickOperation.operation === "linkTo") linkTo(...onClickOperation.args)();
4187
+ else if (onClickOperation.operation === "callNativeFunction") linkTo(...onClickOperation.args)();
4174
4188
  else if (onClickOperation.operation === "moveTo") moveTo(...onClickOperation.args)();
4175
4189
  else if (onClickOperation.operation === "closeApp") closeApp(onClickOperation.args[0] || "button")();
4176
4190
  else if (onClickOperation.operation === "runScript") runScript(onClickOperation.args[0])();
@@ -11813,7 +11827,7 @@ const toCssBackground = (p, brandKit) => {
11813
11827
  return {
11814
11828
  backgroundColor: p?.backgroundBlendColor ?? p?.backgroundColor ?? variant?.getProps(brandKit)?.backgroundColor,
11815
11829
  ...url ? {
11816
- backgroundSize: url ? "cover" : void 0,
11830
+ backgroundSize: url ? p.backgroundSize ?? "cover" : void 0,
11817
11831
  backgroundImage: url ? `url(${url})` : void 0,
11818
11832
  backgroundPositionX: p?.backgroundPositionX ?? "center",
11819
11833
  backgroundPositionY: p?.backgroundPositionY ?? "center",
@@ -11842,10 +11856,13 @@ const toCssOverflow = (p) => {
11842
11856
  //#region src/hooks/useClickable.ts
11843
11857
  const getHref = (onClick) => {
11844
11858
  if (!onClick) return void 0;
11845
- if (onClick.operation !== "linkTo") return void 0;
11846
- const href = String(onClick.args[0]) || "";
11847
- const decode = onClick.args[2] ?? false;
11848
- return decode ? decodeURI(href) : href;
11859
+ if (onClick.operation === "callNativeFunction") return String(onClick.args[0]);
11860
+ if (onClick.operation === "linkTo") {
11861
+ const href = String(onClick.args[0]) || "";
11862
+ const decode = onClick.args[2] ?? false;
11863
+ return decode ? decodeURI(href) : href;
11864
+ }
11865
+ return void 0;
11849
11866
  };
11850
11867
  const getTarget = (onClick) => {
11851
11868
  if (!onClick) return void 0;
@@ -11856,7 +11873,8 @@ const useClickable = ({ eventValue = {}, eventName = "", onClick, element: eleme
11856
11873
  const fixedElement = (() => {
11857
11874
  if (!onClick) return element$1;
11858
11875
  switch (onClick.operation) {
11859
- case "linkTo": return "a";
11876
+ case "linkTo":
11877
+ case "callNativeFunction": return "a";
11860
11878
  case "none": return element$1;
11861
11879
  default: return "button";
11862
11880
  }
@@ -17768,9 +17786,9 @@ function instance$13($$self, $$props, $$invalidate) {
17768
17786
  let { layerId = "" } = $$props;
17769
17787
  const { brandKit } = useBrandKit();
17770
17788
  const isExistBackgroundOverlayValue = placement && placement.backgroundOverlay !== void 0;
17771
- let backgroundOverlay = DefaultModalPlacement.backgroundOverlay;
17772
- let backgroundOverlayPC = DefaultModalPlacement.backgroundOverlay;
17773
- let backgroundOverlaySP = DefaultModalPlacement.backgroundOverlay;
17789
+ let backgroundOverlay = placement.position === "center";
17790
+ let backgroundOverlayPC = placement.position === "center";
17791
+ let backgroundOverlaySP = placement.position === "center";
17774
17792
  let backgroundClickFunction = DefaultModalPlacement.backgroundClick;
17775
17793
  let backgroundClickFunctionPC = DefaultModalPlacement.backgroundClick;
17776
17794
  let backgroundClickFunctionSP = DefaultModalPlacement.backgroundClick;
@@ -18905,6 +18923,7 @@ function instance$7($$self, $$props, $$invalidate) {
18905
18923
  let player = null;
18906
18924
  function onPlayerReady() {
18907
18925
  if (props.mute || props.autoplay) player.setVolume(0);
18926
+ if (props.autoplay) player.playVideo();
18908
18927
  }
18909
18928
  const getPlayerVars = () => {
18910
18929
  const boolToNumber = (bool, defaultValue = 0) => typeof bool === "boolean" ? bool ? 1 : 0 : defaultValue;
@@ -18914,6 +18933,7 @@ function instance$7($$self, $$props, $$invalidate) {
18914
18933
  showinfo: 0,
18915
18934
  iv_load_policy: 1,
18916
18935
  modestbranding: 1,
18936
+ mute: props.autoplay || props.mute ? 1 : 0,
18917
18937
  rel: boolToNumber(props.showRelatedMovies),
18918
18938
  autoplay: boolToNumber(props.autoplay),
18919
18939
  controls: boolToNumber(props.controls),
package/dist/prop.d.ts CHANGED
@@ -66,6 +66,7 @@ type OperationArgumentTypes = {
66
66
  Color: string
67
67
  Handler: string
68
68
  Trigger: string
69
+ NativeFunction: string
69
70
  };
70
71
  /** @internal */
71
72
  export type OperationArgumentType = keyof OperationArgumentTypes;
@@ -111,6 +112,13 @@ export declare const OnClickOperationOptions: readonly [{
111
112
  readonly type: "TransitState"
112
113
  readonly default: "/"
113
114
  }]
115
+ }, {
116
+ readonly operation: "callNativeFunction"
117
+ readonly args: readonly [{
118
+ readonly name: "url"
119
+ readonly type: "NativeFunction"
120
+ readonly default: ""
121
+ }]
114
122
  }, {
115
123
  readonly operation: "closeApp"
116
124
  readonly args: readonly [{
@@ -74,6 +74,7 @@ export type BackgroundColorProps = {
74
74
  };
75
75
  export type BackgroundImageProps = {
76
76
  backgroundImageUrl?: string
77
+ backgroundSize?: Properties["backgroundSize"]
77
78
  backgroundPositionX?: Properties["backgroundPositionX"]
78
79
  backgroundPositionY?: Properties["backgroundPositionY"]
79
80
  backgroundBlendMode?: Properties["backgroundBlendMode"]
@@ -74,6 +74,7 @@ export type BackgroundColorProps = {
74
74
  };
75
75
  export type BackgroundImageProps = {
76
76
  backgroundImageUrl?: string
77
+ backgroundSize?: Properties["backgroundSize"]
77
78
  backgroundPositionX?: Properties["backgroundPositionX"]
78
79
  backgroundPositionY?: Properties["backgroundPositionY"]
79
80
  backgroundBlendMode?: Properties["backgroundBlendMode"]
@@ -440,6 +440,14 @@ const OnClickOperationOptions = [
440
440
  default: "/"
441
441
  }]
442
442
  },
443
+ {
444
+ operation: "callNativeFunction",
445
+ args: [{
446
+ name: "url",
447
+ type: "NativeFunction",
448
+ default: ""
449
+ }]
450
+ },
443
451
  {
444
452
  operation: "closeApp",
445
453
  args: [{
@@ -2286,8 +2294,13 @@ async function loadGlobalStyle(href) {
2286
2294
  return new Promise((resolve, reject) => {
2287
2295
  const action = document.querySelector(`.${KARTE_ACTION_ROOT}[data-${KARTE_ACTION_RID}='${actionId}']`);
2288
2296
  if (!action) return;
2297
+ const DATA_ATTR_KEY = "data-krt-action-font";
2298
+ const oldFontLink = document.querySelector(`link[${DATA_ATTR_KEY}]`);
2299
+ if (oldFontLink) if (oldFontLink.getAttribute("href") === href) return;
2300
+ else oldFontLink.parentElement?.removeChild(oldFontLink);
2289
2301
  const link = document.createElement("link");
2290
2302
  link.rel = "stylesheet";
2303
+ link.setAttribute(DATA_ATTR_KEY, "");
2291
2304
  link.href = href;
2292
2305
  link.type = "text/css";
2293
2306
  action.appendChild(link);
@@ -3283,7 +3296,7 @@ const toCssBackground = (p, brandKit) => {
3283
3296
  return {
3284
3297
  backgroundColor: p?.backgroundBlendColor ?? p?.backgroundColor ?? variant?.getProps(brandKit)?.backgroundColor,
3285
3298
  ...url ? {
3286
- backgroundSize: url ? "cover" : void 0,
3299
+ backgroundSize: url ? p.backgroundSize ?? "cover" : void 0,
3287
3300
  backgroundImage: url ? `url(${url})` : void 0,
3288
3301
  backgroundPositionX: p?.backgroundPositionX ?? "center",
3289
3302
  backgroundPositionY: p?.backgroundPositionY ?? "center",
@@ -3387,6 +3400,7 @@ const bootChat = (hide_launcher, placement_pc, placement_mobile, horizontal_spac
3387
3400
  /** @internal */
3388
3401
  const execOnClickOperation = (onClickOperation) => {
3389
3402
  if (onClickOperation.operation === "linkTo") linkTo(...onClickOperation.args)();
3403
+ else if (onClickOperation.operation === "callNativeFunction") linkTo(...onClickOperation.args)();
3390
3404
  else if (onClickOperation.operation === "moveTo") moveTo(...onClickOperation.args)();
3391
3405
  else if (onClickOperation.operation === "closeApp") closeApp(onClickOperation.args[0] || "button")();
3392
3406
  else if (onClickOperation.operation === "runScript") runScript(onClickOperation.args[0])();
@@ -3475,10 +3489,13 @@ function customAnimation(node, { transforms, animationStyle, delay = 0, duration
3475
3489
  //#region src/hooks/useClickable.ts
3476
3490
  const getHref = (onClick) => {
3477
3491
  if (!onClick) return void 0;
3478
- if (onClick.operation !== "linkTo") return void 0;
3479
- const href = String(onClick.args[0]) || "";
3480
- const decode = onClick.args[2] ?? false;
3481
- return decode ? decodeURI(href) : href;
3492
+ if (onClick.operation === "callNativeFunction") return String(onClick.args[0]);
3493
+ if (onClick.operation === "linkTo") {
3494
+ const href = String(onClick.args[0]) || "";
3495
+ const decode = onClick.args[2] ?? false;
3496
+ return decode ? decodeURI(href) : href;
3497
+ }
3498
+ return void 0;
3482
3499
  };
3483
3500
  const getTarget = (onClick) => {
3484
3501
  if (!onClick) return void 0;
@@ -3489,7 +3506,8 @@ const useClickable = ({ eventValue = {}, eventName = "", onClick, element = "div
3489
3506
  const fixedElement = (() => {
3490
3507
  if (!onClick) return element;
3491
3508
  switch (onClick.operation) {
3492
- case "linkTo": return "a";
3509
+ case "linkTo":
3510
+ case "callNativeFunction": return "a";
3493
3511
  case "none": return element;
3494
3512
  default: return "button";
3495
3513
  }
@@ -5912,9 +5930,9 @@ function Modal($$anchor, $$props) {
5912
5930
  let layerId = $$9.prop($$props, "layerId", 8, "");
5913
5931
  const { brandKit } = useBrandKit();
5914
5932
  const isExistBackgroundOverlayValue = placement() && placement().backgroundOverlay !== void 0;
5915
- let backgroundOverlay = $$9.mutable_state(DefaultModalPlacement.backgroundOverlay);
5916
- let backgroundOverlayPC = $$9.mutable_state(DefaultModalPlacement.backgroundOverlay);
5917
- let backgroundOverlaySP = $$9.mutable_state(DefaultModalPlacement.backgroundOverlay);
5933
+ let backgroundOverlay = $$9.mutable_state(placement().position === "center");
5934
+ let backgroundOverlayPC = $$9.mutable_state(placement().position === "center");
5935
+ let backgroundOverlaySP = $$9.mutable_state(placement().position === "center");
5918
5936
  let backgroundClickFunction = $$9.mutable_state(DefaultModalPlacement.backgroundClick);
5919
5937
  let backgroundClickFunctionPC = $$9.mutable_state(DefaultModalPlacement.backgroundClick);
5920
5938
  let backgroundClickFunctionSP = $$9.mutable_state(DefaultModalPlacement.backgroundClick);
@@ -6467,6 +6485,7 @@ function Youtube($$anchor, $$props) {
6467
6485
  let player = null;
6468
6486
  function onPlayerReady() {
6469
6487
  if (props().mute || props().autoplay) player.setVolume(0);
6488
+ if (props().autoplay) player.playVideo();
6470
6489
  }
6471
6490
  function onStart() {}
6472
6491
  function onPause() {}
@@ -6492,6 +6511,7 @@ function Youtube($$anchor, $$props) {
6492
6511
  showinfo: 0,
6493
6512
  iv_load_policy: 1,
6494
6513
  modestbranding: 1,
6514
+ mute: props().autoplay || props().mute ? 1 : 0,
6495
6515
  rel: boolToNumber(props().showRelatedMovies),
6496
6516
  autoplay: boolToNumber(props().autoplay),
6497
6517
  controls: boolToNumber(props().controls),
@@ -66,6 +66,7 @@ type OperationArgumentTypes = {
66
66
  Color: string
67
67
  Handler: string
68
68
  Trigger: string
69
+ NativeFunction: string
69
70
  };
70
71
  /** @internal */
71
72
  export type OperationArgumentType = keyof OperationArgumentTypes;
@@ -111,6 +112,13 @@ export declare const OnClickOperationOptions: readonly [{
111
112
  readonly type: "TransitState"
112
113
  readonly default: "/"
113
114
  }]
115
+ }, {
116
+ readonly operation: "callNativeFunction"
117
+ readonly args: readonly [{
118
+ readonly name: "url"
119
+ readonly type: "NativeFunction"
120
+ readonly default: ""
121
+ }]
114
122
  }, {
115
123
  readonly operation: "closeApp"
116
124
  readonly args: readonly [{
@@ -440,6 +440,14 @@ const OnClickOperationOptions = [
440
440
  default: "/"
441
441
  }]
442
442
  },
443
+ {
444
+ operation: "callNativeFunction",
445
+ args: [{
446
+ name: "url",
447
+ type: "NativeFunction",
448
+ default: ""
449
+ }]
450
+ },
443
451
  {
444
452
  operation: "closeApp",
445
453
  args: [{
@@ -2255,8 +2263,13 @@ async function loadGlobalStyle(href) {
2255
2263
  return new Promise((resolve, reject) => {
2256
2264
  const action = document.querySelector(`.${KARTE_ACTION_ROOT}[data-${KARTE_ACTION_RID}='${actionId}']`);
2257
2265
  if (!action) return;
2266
+ const DATA_ATTR_KEY = "data-krt-action-font";
2267
+ const oldFontLink = document.querySelector(`link[${DATA_ATTR_KEY}]`);
2268
+ if (oldFontLink) if (oldFontLink.getAttribute("href") === href) return;
2269
+ else oldFontLink.parentElement?.removeChild(oldFontLink);
2258
2270
  const link = document.createElement("link");
2259
2271
  link.rel = "stylesheet";
2272
+ link.setAttribute(DATA_ATTR_KEY, "");
2260
2273
  link.href = href;
2261
2274
  link.type = "text/css";
2262
2275
  action.appendChild(link);
@@ -3252,7 +3265,7 @@ const toCssBackground = (p, brandKit) => {
3252
3265
  return {
3253
3266
  backgroundColor: p?.backgroundBlendColor ?? p?.backgroundColor ?? variant?.getProps(brandKit)?.backgroundColor,
3254
3267
  ...url ? {
3255
- backgroundSize: url ? "cover" : void 0,
3268
+ backgroundSize: url ? p.backgroundSize ?? "cover" : void 0,
3256
3269
  backgroundImage: url ? `url(${url})` : void 0,
3257
3270
  backgroundPositionX: p?.backgroundPositionX ?? "center",
3258
3271
  backgroundPositionY: p?.backgroundPositionY ?? "center",
@@ -3356,6 +3369,7 @@ const bootChat = (hide_launcher, placement_pc, placement_mobile, horizontal_spac
3356
3369
  /** @internal */
3357
3370
  const execOnClickOperation = (onClickOperation) => {
3358
3371
  if (onClickOperation.operation === "linkTo") linkTo(...onClickOperation.args)();
3372
+ else if (onClickOperation.operation === "callNativeFunction") linkTo(...onClickOperation.args)();
3359
3373
  else if (onClickOperation.operation === "moveTo") moveTo(...onClickOperation.args)();
3360
3374
  else if (onClickOperation.operation === "closeApp") closeApp(onClickOperation.args[0] || "button")();
3361
3375
  else if (onClickOperation.operation === "runScript") runScript(onClickOperation.args[0])();
@@ -3444,10 +3458,13 @@ function customAnimation(node, { transforms, animationStyle, delay = 0, duration
3444
3458
  //#region src/hooks/useClickable.ts
3445
3459
  const getHref = (onClick) => {
3446
3460
  if (!onClick) return void 0;
3447
- if (onClick.operation !== "linkTo") return void 0;
3448
- const href = String(onClick.args[0]) || "";
3449
- const decode = onClick.args[2] ?? false;
3450
- return decode ? decodeURI(href) : href;
3461
+ if (onClick.operation === "callNativeFunction") return String(onClick.args[0]);
3462
+ if (onClick.operation === "linkTo") {
3463
+ const href = String(onClick.args[0]) || "";
3464
+ const decode = onClick.args[2] ?? false;
3465
+ return decode ? decodeURI(href) : href;
3466
+ }
3467
+ return void 0;
3451
3468
  };
3452
3469
  const getTarget = (onClick) => {
3453
3470
  if (!onClick) return void 0;
@@ -3458,7 +3475,8 @@ const useClickable = ({ eventValue = {}, eventName = "", onClick, element = "div
3458
3475
  const fixedElement = (() => {
3459
3476
  if (!onClick) return element;
3460
3477
  switch (onClick.operation) {
3461
- case "linkTo": return "a";
3478
+ case "linkTo":
3479
+ case "callNativeFunction": return "a";
3462
3480
  case "none": return element;
3463
3481
  default: return "button";
3464
3482
  }
@@ -5881,9 +5899,9 @@ function Modal($$anchor, $$props) {
5881
5899
  let layerId = $$9.prop($$props, "layerId", 8, "");
5882
5900
  const { brandKit } = useBrandKit();
5883
5901
  const isExistBackgroundOverlayValue = placement() && placement().backgroundOverlay !== void 0;
5884
- let backgroundOverlay = $$9.mutable_state(DefaultModalPlacement.backgroundOverlay);
5885
- let backgroundOverlayPC = $$9.mutable_state(DefaultModalPlacement.backgroundOverlay);
5886
- let backgroundOverlaySP = $$9.mutable_state(DefaultModalPlacement.backgroundOverlay);
5902
+ let backgroundOverlay = $$9.mutable_state(placement().position === "center");
5903
+ let backgroundOverlayPC = $$9.mutable_state(placement().position === "center");
5904
+ let backgroundOverlaySP = $$9.mutable_state(placement().position === "center");
5887
5905
  let backgroundClickFunction = $$9.mutable_state(DefaultModalPlacement.backgroundClick);
5888
5906
  let backgroundClickFunctionPC = $$9.mutable_state(DefaultModalPlacement.backgroundClick);
5889
5907
  let backgroundClickFunctionSP = $$9.mutable_state(DefaultModalPlacement.backgroundClick);
@@ -6436,6 +6454,7 @@ function Youtube($$anchor, $$props) {
6436
6454
  let player = null;
6437
6455
  function onPlayerReady() {
6438
6456
  if (props().mute || props().autoplay) player.setVolume(0);
6457
+ if (props().autoplay) player.playVideo();
6439
6458
  }
6440
6459
  function onStart() {}
6441
6460
  function onPause() {}
@@ -6461,6 +6480,7 @@ function Youtube($$anchor, $$props) {
6461
6480
  showinfo: 0,
6462
6481
  iv_load_policy: 1,
6463
6482
  modestbranding: 1,
6483
+ mute: props().autoplay || props().mute ? 1 : 0,
6464
6484
  rel: boolToNumber(props().showRelatedMovies),
6465
6485
  autoplay: boolToNumber(props().autoplay),
6466
6486
  controls: boolToNumber(props().controls),
@@ -441,6 +441,14 @@ const OnClickOperationOptions = [
441
441
  default: "/"
442
442
  }]
443
443
  },
444
+ {
445
+ operation: "callNativeFunction",
446
+ args: [{
447
+ name: "url",
448
+ type: "NativeFunction",
449
+ default: ""
450
+ }]
451
+ },
444
452
  {
445
453
  operation: "closeApp",
446
454
  args: [{
@@ -2256,8 +2264,13 @@ async function loadGlobalStyle(href) {
2256
2264
  return new Promise((resolve, reject) => {
2257
2265
  const action = document.querySelector(`.${KARTE_ACTION_ROOT}[data-${KARTE_ACTION_RID}='${actionId}']`);
2258
2266
  if (!action) return;
2267
+ const DATA_ATTR_KEY = "data-krt-action-font";
2268
+ const oldFontLink = document.querySelector(`link[${DATA_ATTR_KEY}]`);
2269
+ if (oldFontLink) if (oldFontLink.getAttribute("href") === href) return;
2270
+ else oldFontLink.parentElement?.removeChild(oldFontLink);
2259
2271
  const link = document.createElement("link");
2260
2272
  link.rel = "stylesheet";
2273
+ link.setAttribute(DATA_ATTR_KEY, "");
2261
2274
  link.href = href;
2262
2275
  link.type = "text/css";
2263
2276
  action.appendChild(link);
@@ -3253,7 +3266,7 @@ const toCssBackground = (p, brandKit) => {
3253
3266
  return {
3254
3267
  backgroundColor: p?.backgroundBlendColor ?? p?.backgroundColor ?? variant?.getProps(brandKit)?.backgroundColor,
3255
3268
  ...url ? {
3256
- backgroundSize: url ? "cover" : void 0,
3269
+ backgroundSize: url ? p.backgroundSize ?? "cover" : void 0,
3257
3270
  backgroundImage: url ? `url(${url})` : void 0,
3258
3271
  backgroundPositionX: p?.backgroundPositionX ?? "center",
3259
3272
  backgroundPositionY: p?.backgroundPositionY ?? "center",
@@ -3357,6 +3370,7 @@ const bootChat = (hide_launcher, placement_pc, placement_mobile, horizontal_spac
3357
3370
  /** @internal */
3358
3371
  const execOnClickOperation = (onClickOperation) => {
3359
3372
  if (onClickOperation.operation === "linkTo") linkTo(...onClickOperation.args)();
3373
+ else if (onClickOperation.operation === "callNativeFunction") linkTo(...onClickOperation.args)();
3360
3374
  else if (onClickOperation.operation === "moveTo") moveTo(...onClickOperation.args)();
3361
3375
  else if (onClickOperation.operation === "closeApp") closeApp(onClickOperation.args[0] || "button")();
3362
3376
  else if (onClickOperation.operation === "runScript") runScript(onClickOperation.args[0])();
@@ -3445,10 +3459,13 @@ function customAnimation(node, { transforms, animationStyle, delay = 0, duration
3445
3459
  //#region src/hooks/useClickable.ts
3446
3460
  const getHref = (onClick) => {
3447
3461
  if (!onClick) return void 0;
3448
- if (onClick.operation !== "linkTo") return void 0;
3449
- const href = String(onClick.args[0]) || "";
3450
- const decode = onClick.args[2] ?? false;
3451
- return decode ? decodeURI(href) : href;
3462
+ if (onClick.operation === "callNativeFunction") return String(onClick.args[0]);
3463
+ if (onClick.operation === "linkTo") {
3464
+ const href = String(onClick.args[0]) || "";
3465
+ const decode = onClick.args[2] ?? false;
3466
+ return decode ? decodeURI(href) : href;
3467
+ }
3468
+ return void 0;
3452
3469
  };
3453
3470
  const getTarget = (onClick) => {
3454
3471
  if (!onClick) return void 0;
@@ -3459,7 +3476,8 @@ const useClickable = ({ eventValue = {}, eventName = "", onClick, element = "div
3459
3476
  const fixedElement = (() => {
3460
3477
  if (!onClick) return element;
3461
3478
  switch (onClick.operation) {
3462
- case "linkTo": return "a";
3479
+ case "linkTo":
3480
+ case "callNativeFunction": return "a";
3463
3481
  case "none": return element;
3464
3482
  default: return "button";
3465
3483
  }
@@ -5882,9 +5900,9 @@ function Modal($$anchor, $$props) {
5882
5900
  let layerId = $$10.prop($$props, "layerId", 8, "");
5883
5901
  const { brandKit } = useBrandKit();
5884
5902
  const isExistBackgroundOverlayValue = placement() && placement().backgroundOverlay !== void 0;
5885
- let backgroundOverlay = $$10.mutable_state(DefaultModalPlacement.backgroundOverlay);
5886
- let backgroundOverlayPC = $$10.mutable_state(DefaultModalPlacement.backgroundOverlay);
5887
- let backgroundOverlaySP = $$10.mutable_state(DefaultModalPlacement.backgroundOverlay);
5903
+ let backgroundOverlay = $$10.mutable_state(placement().position === "center");
5904
+ let backgroundOverlayPC = $$10.mutable_state(placement().position === "center");
5905
+ let backgroundOverlaySP = $$10.mutable_state(placement().position === "center");
5888
5906
  let backgroundClickFunction = $$10.mutable_state(DefaultModalPlacement.backgroundClick);
5889
5907
  let backgroundClickFunctionPC = $$10.mutable_state(DefaultModalPlacement.backgroundClick);
5890
5908
  let backgroundClickFunctionSP = $$10.mutable_state(DefaultModalPlacement.backgroundClick);
@@ -6437,6 +6455,7 @@ function Youtube($$anchor, $$props) {
6437
6455
  let player = null;
6438
6456
  function onPlayerReady() {
6439
6457
  if (props().mute || props().autoplay) player.setVolume(0);
6458
+ if (props().autoplay) player.playVideo();
6440
6459
  }
6441
6460
  function onStart() {}
6442
6461
  function onPause() {}
@@ -6462,6 +6481,7 @@ function Youtube($$anchor, $$props) {
6462
6481
  showinfo: 0,
6463
6482
  iv_load_policy: 1,
6464
6483
  modestbranding: 1,
6484
+ mute: props().autoplay || props().mute ? 1 : 0,
6465
6485
  rel: boolToNumber(props().showRelatedMovies),
6466
6486
  autoplay: boolToNumber(props().autoplay),
6467
6487
  controls: boolToNumber(props().controls),
@@ -66,6 +66,7 @@ type OperationArgumentTypes = {
66
66
  Color: string
67
67
  Handler: string
68
68
  Trigger: string
69
+ NativeFunction: string
69
70
  };
70
71
  /** @internal */
71
72
  export type OperationArgumentType = keyof OperationArgumentTypes;
@@ -111,6 +112,13 @@ export declare const OnClickOperationOptions: readonly [{
111
112
  readonly type: "TransitState"
112
113
  readonly default: "/"
113
114
  }]
115
+ }, {
116
+ readonly operation: "callNativeFunction"
117
+ readonly args: readonly [{
118
+ readonly name: "url"
119
+ readonly type: "NativeFunction"
120
+ readonly default: ""
121
+ }]
114
122
  }, {
115
123
  readonly operation: "closeApp"
116
124
  readonly args: readonly [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaidev/karte-action-sdk",
3
- "version": "1.1.268-29138921.8752a776",
3
+ "version": "1.1.268-29148584.667572de",
4
4
  "author": "Plaid Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "module": "./dist/index.es.js",