@plaidev/karte-action-sdk 1.1.191-28155162.a21279ac → 1.1.191-28160907.3f2b01c0

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.
@@ -787,6 +787,11 @@ declare const OnClickOperationOptions: readonly [
787
787
  readonly name: "open_new_tab";
788
788
  readonly type: "BooleanKeyword";
789
789
  readonly default: true;
790
+ },
791
+ {
792
+ readonly name: "decode";
793
+ readonly type: "BooleanKeyword";
794
+ readonly default: false;
790
795
  }
791
796
  ];
792
797
  },
@@ -349,6 +349,11 @@ const OnClickOperationOptions = [
349
349
  type: 'BooleanKeyword',
350
350
  default: true,
351
351
  },
352
+ {
353
+ name: 'decode',
354
+ type: 'BooleanKeyword',
355
+ default: false,
356
+ },
352
357
  ],
353
358
  },
354
359
  {
@@ -2824,23 +2829,24 @@ const moveTo = (to) => () => {
2824
2829
  _moveTo(to);
2825
2830
  };
2826
2831
  /** @internal */
2827
- const linkTo = (to, targetBlank = true) => () => {
2832
+ const linkTo = (to, targetBlank = true, decode = false) => () => {
2833
+ const decodedTo = decode ? decodeURI(to) : to;
2828
2834
  const { target } = getActionRunnerContext() ?? {};
2829
2835
  async function sleep(ms) {
2830
2836
  return new Promise(resolve => setTimeout(resolve, ms));
2831
2837
  }
2832
2838
  async function _send() {
2833
- send_event('message_click', { url: to, state: getState$1() });
2839
+ send_event('message_click', { url: decodedTo, state: getState$1() });
2834
2840
  // # edge.js の retransmitter が送るのを待つ
2835
2841
  await sleep(450);
2836
2842
  }
2837
2843
  const isRequiredWindowOpen = target === 'native' ? false : targetBlank;
2838
2844
  if (isRequiredWindowOpen) {
2839
- window.open(to);
2845
+ window.open(decodedTo);
2840
2846
  }
2841
2847
  Promise.race([_send(), sleep(650)]).then(() => {
2842
2848
  if (!isRequiredWindowOpen) {
2843
- location.href = to;
2849
+ location.href = decodedTo;
2844
2850
  }
2845
2851
  });
2846
2852
  };
@@ -3246,7 +3252,9 @@ function create_if_block_1$2(ctx) {
3246
3252
  { class: BUTTON_CLASS },
3247
3253
  { style: /*style*/ ctx[1] },
3248
3254
  {
3249
- href: a_href_value = /*onClick*/ ctx[0].args[0]
3255
+ href: a_href_value = /*onClick*/ ctx[0].args[2]
3256
+ ? decodeURI(/*onClick*/ ctx[0].args[0])
3257
+ : /*onClick*/ ctx[0].args[0]
3250
3258
  },
3251
3259
  {
3252
3260
  target: a_target_value = /*onClick*/ ctx[0].args[1] === true ? '_blank' : null
@@ -3316,7 +3324,9 @@ function create_if_block_1$2(ctx) {
3316
3324
  set_attributes(a, a_data = get_spread_update(a_levels, [
3317
3325
  { class: BUTTON_CLASS },
3318
3326
  (!current || dirty & /*style*/ 2) && { style: /*style*/ ctx[1] },
3319
- (!current || dirty & /*onClick*/ 1 && a_href_value !== (a_href_value = /*onClick*/ ctx[0].args[0])) && { href: a_href_value },
3327
+ (!current || dirty & /*onClick*/ 1 && a_href_value !== (a_href_value = /*onClick*/ ctx[0].args[2]
3328
+ ? decodeURI(/*onClick*/ ctx[0].args[0])
3329
+ : /*onClick*/ ctx[0].args[0])) && { href: a_href_value },
3320
3330
  (!current || dirty & /*onClick*/ 1 && a_target_value !== (a_target_value = /*onClick*/ ctx[0].args[1] === true ? '_blank' : null)) && { target: a_target_value },
3321
3331
  dataAttrStopPropagation('click')
3322
3332
  ]));
@@ -787,6 +787,11 @@ declare const OnClickOperationOptions: readonly [
787
787
  readonly name: "open_new_tab";
788
788
  readonly type: "BooleanKeyword";
789
789
  readonly default: true;
790
+ },
791
+ {
792
+ readonly name: "decode";
793
+ readonly type: "BooleanKeyword";
794
+ readonly default: false;
790
795
  }
791
796
  ];
792
797
  },
package/dist/index.es.js CHANGED
@@ -353,6 +353,11 @@ const OnClickOperationOptions = [
353
353
  type: 'BooleanKeyword',
354
354
  default: true,
355
355
  },
356
+ {
357
+ name: 'decode',
358
+ type: 'BooleanKeyword',
359
+ default: false,
360
+ },
356
361
  ],
357
362
  },
358
363
  {
@@ -2843,23 +2848,24 @@ const moveTo = (to) => () => {
2843
2848
  _moveTo(to);
2844
2849
  };
2845
2850
  /** @internal */
2846
- const linkTo = (to, targetBlank = true) => () => {
2851
+ const linkTo = (to, targetBlank = true, decode = false) => () => {
2852
+ const decodedTo = decode ? decodeURI(to) : to;
2847
2853
  const { target } = getActionRunnerContext() ?? {};
2848
2854
  async function sleep(ms) {
2849
2855
  return new Promise(resolve => setTimeout(resolve, ms));
2850
2856
  }
2851
2857
  async function _send() {
2852
- send_event('message_click', { url: to, state: getState$1() });
2858
+ send_event('message_click', { url: decodedTo, state: getState$1() });
2853
2859
  // # edge.js の retransmitter が送るのを待つ
2854
2860
  await sleep(450);
2855
2861
  }
2856
2862
  const isRequiredWindowOpen = target === 'native' ? false : targetBlank;
2857
2863
  if (isRequiredWindowOpen) {
2858
- window.open(to);
2864
+ window.open(decodedTo);
2859
2865
  }
2860
2866
  Promise.race([_send(), sleep(650)]).then(() => {
2861
2867
  if (!isRequiredWindowOpen) {
2862
- location.href = to;
2868
+ location.href = decodedTo;
2863
2869
  }
2864
2870
  });
2865
2871
  };
@@ -3285,7 +3291,9 @@ function create_if_block_1$2(ctx) {
3285
3291
  { class: BUTTON_CLASS },
3286
3292
  { style: /*style*/ ctx[1] },
3287
3293
  {
3288
- href: a_href_value = /*onClick*/ ctx[0].args[0]
3294
+ href: a_href_value = /*onClick*/ ctx[0].args[2]
3295
+ ? decodeURI(/*onClick*/ ctx[0].args[0])
3296
+ : /*onClick*/ ctx[0].args[0]
3289
3297
  },
3290
3298
  {
3291
3299
  target: a_target_value = /*onClick*/ ctx[0].args[1] === true ? '_blank' : null
@@ -3339,7 +3347,9 @@ function create_if_block_1$2(ctx) {
3339
3347
  set_attributes(a, a_data = get_spread_update(a_levels, [
3340
3348
  { class: BUTTON_CLASS },
3341
3349
  (!current || dirty & /*style*/ 2) && { style: /*style*/ ctx[1] },
3342
- (!current || dirty & /*onClick*/ 1 && a_href_value !== (a_href_value = /*onClick*/ ctx[0].args[0])) && { href: a_href_value },
3350
+ (!current || dirty & /*onClick*/ 1 && a_href_value !== (a_href_value = /*onClick*/ ctx[0].args[2]
3351
+ ? decodeURI(/*onClick*/ ctx[0].args[0])
3352
+ : /*onClick*/ ctx[0].args[0])) && { href: a_href_value },
3343
3353
  (!current || dirty & /*onClick*/ 1 && a_target_value !== (a_target_value = /*onClick*/ ctx[0].args[1] === true ? '_blank' : null)) && { target: a_target_value },
3344
3354
  dataAttrStopPropagation('click')
3345
3355
  ]));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaidev/karte-action-sdk",
3
- "version": "1.1.191-28155162.a21279ac",
3
+ "version": "1.1.191-28160907.3f2b01c0",
4
4
  "author": "Plaid Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "module": "./dist/index.es.js",