@plaidev/karte-action-sdk 1.1.268-29132946.504b468b → 1.1.268-29147222.21424830
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/hydrate/index.es.js +29 -10
- package/dist/hydrate/prop.d.ts +8 -0
- package/dist/index.es.js +29 -10
- package/dist/prop.d.ts +8 -0
- package/dist/svelte5/hydrate/index.es.js +28 -8
- package/dist/svelte5/hydrate/prop.d.ts +8 -0
- package/dist/svelte5/index.es.js +28 -8
- package/dist/svelte5/index.front2.es.js +28 -8
- package/dist/svelte5/prop.d.ts +8 -0
- package/package.json +1 -6
package/dist/hydrate/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: [{
|
@@ -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])();
|
@@ -6518,7 +6532,6 @@ function create_if_block$13(ctx) {
|
|
6518
6532
|
let a;
|
6519
6533
|
let div0;
|
6520
6534
|
let rendertext;
|
6521
|
-
let a_href_value;
|
6522
6535
|
let a_class_value;
|
6523
6536
|
let t0;
|
6524
6537
|
let div1;
|
@@ -6569,7 +6582,7 @@ function create_if_block$13(ctx) {
|
|
6569
6582
|
},
|
6570
6583
|
h() {
|
6571
6584
|
attr(div0, "class", "text-element-inner svelte-9ixs0b");
|
6572
|
-
attr(a, "href",
|
6585
|
+
attr(a, "href", "");
|
6573
6586
|
attr(a, "class", a_class_value = null_to_empty(`text-element text-link-element text-direction-${ctx[1]}`) + " svelte-9ixs0b");
|
6574
6587
|
attr(
|
6575
6588
|
a,
|
@@ -12987,10 +13000,13 @@ const toCssOverflow = (p) => {
|
|
12987
13000
|
//#region src/hooks/useClickable.ts
|
12988
13001
|
const getHref = (onClick) => {
|
12989
13002
|
if (!onClick) return void 0;
|
12990
|
-
if (onClick.operation
|
12991
|
-
|
12992
|
-
|
12993
|
-
|
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;
|
12994
13010
|
};
|
12995
13011
|
const getTarget = (onClick) => {
|
12996
13012
|
if (!onClick) return void 0;
|
@@ -13001,7 +13017,8 @@ const useClickable = ({ eventValue = {}, eventName = "", onClick, element: eleme
|
|
13001
13017
|
const fixedElement = (() => {
|
13002
13018
|
if (!onClick) return element$1;
|
13003
13019
|
switch (onClick.operation) {
|
13004
|
-
case "linkTo":
|
13020
|
+
case "linkTo":
|
13021
|
+
case "callNativeFunction": return "a";
|
13005
13022
|
case "none": return element$1;
|
13006
13023
|
default: return "button";
|
13007
13024
|
}
|
@@ -19862,9 +19879,9 @@ function instance$13($$self, $$props, $$invalidate) {
|
|
19862
19879
|
let { layerId = "" } = $$props;
|
19863
19880
|
const { brandKit } = useBrandKit();
|
19864
19881
|
const isExistBackgroundOverlayValue = placement && placement.backgroundOverlay !== void 0;
|
19865
|
-
let backgroundOverlay =
|
19866
|
-
let backgroundOverlayPC =
|
19867
|
-
let backgroundOverlaySP =
|
19882
|
+
let backgroundOverlay = placement.position === "center";
|
19883
|
+
let backgroundOverlayPC = placement.position === "center";
|
19884
|
+
let backgroundOverlaySP = placement.position === "center";
|
19868
19885
|
let backgroundClickFunction = DefaultModalPlacement.backgroundClick;
|
19869
19886
|
let backgroundClickFunctionPC = DefaultModalPlacement.backgroundClick;
|
19870
19887
|
let backgroundClickFunctionSP = DefaultModalPlacement.backgroundClick;
|
@@ -21105,6 +21122,7 @@ function instance$7($$self, $$props, $$invalidate) {
|
|
21105
21122
|
let player = null;
|
21106
21123
|
function onPlayerReady() {
|
21107
21124
|
if (props.mute || props.autoplay) player.setVolume(0);
|
21125
|
+
if (props.autoplay) player.playVideo();
|
21108
21126
|
}
|
21109
21127
|
const getPlayerVars = () => {
|
21110
21128
|
const boolToNumber = (bool, defaultValue = 0) => typeof bool === "boolean" ? bool ? 1 : 0 : defaultValue;
|
@@ -21114,6 +21132,7 @@ function instance$7($$self, $$props, $$invalidate) {
|
|
21114
21132
|
showinfo: 0,
|
21115
21133
|
iv_load_policy: 1,
|
21116
21134
|
modestbranding: 1,
|
21135
|
+
mute: props.autoplay || props.mute ? 1 : 0,
|
21117
21136
|
rel: boolToNumber(props.showRelatedMovies),
|
21118
21137
|
autoplay: boolToNumber(props.autoplay),
|
21119
21138
|
controls: boolToNumber(props.controls),
|
package/dist/hydrate/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 [{
|
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])();
|
@@ -6058,7 +6072,6 @@ function create_if_block$13(ctx) {
|
|
6058
6072
|
let a;
|
6059
6073
|
let div0;
|
6060
6074
|
let rendertext;
|
6061
|
-
let a_href_value;
|
6062
6075
|
let a_class_value;
|
6063
6076
|
let t0;
|
6064
6077
|
let div1;
|
@@ -6080,7 +6093,7 @@ function create_if_block$13(ctx) {
|
|
6080
6093
|
div2 = element("div");
|
6081
6094
|
div2.textContent = "コピーできませんでした";
|
6082
6095
|
attr(div0, "class", "text-element-inner svelte-9ixs0b");
|
6083
|
-
attr(a, "href",
|
6096
|
+
attr(a, "href", "");
|
6084
6097
|
attr(a, "class", a_class_value = null_to_empty(`text-element text-link-element text-direction-${ctx[1]}`) + " svelte-9ixs0b");
|
6085
6098
|
attr(
|
6086
6099
|
a,
|
@@ -11843,10 +11856,13 @@ const toCssOverflow = (p) => {
|
|
11843
11856
|
//#region src/hooks/useClickable.ts
|
11844
11857
|
const getHref = (onClick) => {
|
11845
11858
|
if (!onClick) return void 0;
|
11846
|
-
if (onClick.operation
|
11847
|
-
|
11848
|
-
|
11849
|
-
|
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;
|
11850
11866
|
};
|
11851
11867
|
const getTarget = (onClick) => {
|
11852
11868
|
if (!onClick) return void 0;
|
@@ -11857,7 +11873,8 @@ const useClickable = ({ eventValue = {}, eventName = "", onClick, element: eleme
|
|
11857
11873
|
const fixedElement = (() => {
|
11858
11874
|
if (!onClick) return element$1;
|
11859
11875
|
switch (onClick.operation) {
|
11860
|
-
case "linkTo":
|
11876
|
+
case "linkTo":
|
11877
|
+
case "callNativeFunction": return "a";
|
11861
11878
|
case "none": return element$1;
|
11862
11879
|
default: return "button";
|
11863
11880
|
}
|
@@ -17769,9 +17786,9 @@ function instance$13($$self, $$props, $$invalidate) {
|
|
17769
17786
|
let { layerId = "" } = $$props;
|
17770
17787
|
const { brandKit } = useBrandKit();
|
17771
17788
|
const isExistBackgroundOverlayValue = placement && placement.backgroundOverlay !== void 0;
|
17772
|
-
let backgroundOverlay =
|
17773
|
-
let backgroundOverlayPC =
|
17774
|
-
let backgroundOverlaySP =
|
17789
|
+
let backgroundOverlay = placement.position === "center";
|
17790
|
+
let backgroundOverlayPC = placement.position === "center";
|
17791
|
+
let backgroundOverlaySP = placement.position === "center";
|
17775
17792
|
let backgroundClickFunction = DefaultModalPlacement.backgroundClick;
|
17776
17793
|
let backgroundClickFunctionPC = DefaultModalPlacement.backgroundClick;
|
17777
17794
|
let backgroundClickFunctionSP = DefaultModalPlacement.backgroundClick;
|
@@ -18906,6 +18923,7 @@ function instance$7($$self, $$props, $$invalidate) {
|
|
18906
18923
|
let player = null;
|
18907
18924
|
function onPlayerReady() {
|
18908
18925
|
if (props.mute || props.autoplay) player.setVolume(0);
|
18926
|
+
if (props.autoplay) player.playVideo();
|
18909
18927
|
}
|
18910
18928
|
const getPlayerVars = () => {
|
18911
18929
|
const boolToNumber = (bool, defaultValue = 0) => typeof bool === "boolean" ? bool ? 1 : 0 : defaultValue;
|
@@ -18915,6 +18933,7 @@ function instance$7($$self, $$props, $$invalidate) {
|
|
18915
18933
|
showinfo: 0,
|
18916
18934
|
iv_load_policy: 1,
|
18917
18935
|
modestbranding: 1,
|
18936
|
+
mute: props.autoplay || props.mute ? 1 : 0,
|
18918
18937
|
rel: boolToNumber(props.showRelatedMovies),
|
18919
18938
|
autoplay: boolToNumber(props.autoplay),
|
18920
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 [{
|
@@ -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);
|
@@ -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
|
3479
|
-
|
3480
|
-
|
3481
|
-
|
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":
|
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(
|
5916
|
-
let backgroundOverlayPC = $$9.mutable_state(
|
5917
|
-
let backgroundOverlaySP = $$9.mutable_state(
|
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 [{
|
package/dist/svelte5/index.es.js
CHANGED
@@ -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);
|
@@ -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
|
3448
|
-
|
3449
|
-
|
3450
|
-
|
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":
|
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(
|
5885
|
-
let backgroundOverlayPC = $$9.mutable_state(
|
5886
|
-
let backgroundOverlaySP = $$9.mutable_state(
|
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);
|
@@ -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
|
3449
|
-
|
3450
|
-
|
3451
|
-
|
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":
|
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(
|
5886
|
-
let backgroundOverlayPC = $$10.mutable_state(
|
5887
|
-
let backgroundOverlaySP = $$10.mutable_state(
|
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),
|
package/dist/svelte5/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 [{
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@plaidev/karte-action-sdk",
|
3
|
-
"version": "1.1.268-
|
3
|
+
"version": "1.1.268-29147222.21424830",
|
4
4
|
"author": "Plaid Inc.",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"module": "./dist/index.es.js",
|
@@ -113,10 +113,6 @@
|
|
113
113
|
"svelte-check": "2.10.3",
|
114
114
|
"svelte-preprocess": "5.1.4",
|
115
115
|
"terser": "^5.37.0",
|
116
|
-
"textlint": "^13.1.1",
|
117
|
-
"textlint-plugin-tsdoc": "^0.1.0",
|
118
|
-
"textlint-rule-preset-ja-spacing": "^2.3.0",
|
119
|
-
"textlint-rule-preset-ja-technical-writing": "^7.0.0",
|
120
116
|
"tslib": "^2.3.1",
|
121
117
|
"tsx": "^4.19.2",
|
122
118
|
"unplugin-isolated-decl": "0.13.7",
|
@@ -141,7 +137,6 @@
|
|
141
137
|
"build:watch": "pnpm run build:svelte5:watch",
|
142
138
|
"build:svelte3:watch": "pnpm install:svelte3 && tsx ./scripts/watch.ts --version 3",
|
143
139
|
"build:svelte5:watch": "pnpm install:svelte5 && tsx ./scripts/watch.ts --version 5",
|
144
|
-
"lint:text": "textlint --config .textlintrc.json ./docs",
|
145
140
|
"clean": "rm -rf dist __dist__ docs/**.md",
|
146
141
|
"docs:dev": "vitepress dev docs",
|
147
142
|
"docs:build": "vitepress build docs",
|