@plaidev/karte-action-sdk 1.1.181-28042089.f7e0349f → 1.1.181-28042947.ba6a2943

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.
@@ -1,6 +1,6 @@
1
1
  import { writable, get } from 'svelte/store';
2
2
  import { onMount as onMount$1, onDestroy as onDestroy$1, beforeUpdate as beforeUpdate$1, afterUpdate as afterUpdate$1, tick as tick$1, setContext, getContext, createEventDispatcher } from 'svelte';
3
- import { SvelteComponent, init, safe_not_equal, element, claim_element, children, detach, insert_hydration, noop, component_subscribe, attr, create_slot, create_component, space, claim_component, claim_space, mount_component, update_slot_base, get_all_dirty_from_scope, get_slot_changes, transition_in, transition_out, destroy_component, append_styles, empty, group_outros, check_outros, listen, null_to_empty, is_function, add_render_callback, create_in_transition, binding_callbacks, set_style, svg_element, claim_svg_element, append_hydration, destroy_each, text, claim_text, set_data, src_url_equal, HtmlTagHydration, claim_html_tag, construct_svelte_component, subscribe } from 'svelte/internal';
3
+ import { SvelteComponent, init, safe_not_equal, element, claim_element, children, detach, insert_hydration, noop, component_subscribe, attr, create_slot, create_component, space, claim_component, claim_space, mount_component, update_slot_base, get_all_dirty_from_scope, get_slot_changes, transition_in, transition_out, destroy_component, append_styles, empty, group_outros, check_outros, listen, assign, set_attributes, toggle_class, get_spread_update, null_to_empty, prevent_default, is_function, add_render_callback, create_in_transition, binding_callbacks, set_style, svg_element, claim_svg_element, append_hydration, destroy_each, text, claim_text, set_data, src_url_equal, HtmlTagHydration, claim_html_tag, construct_svelte_component, subscribe } from 'svelte/internal';
4
4
  import 'svelte/easing';
5
5
 
6
6
  /** @internal */
@@ -2889,20 +2889,66 @@ class BackgroundOverlay extends SvelteComponent {
2889
2889
  }
2890
2890
  }
2891
2891
 
2892
+ /**
2893
+ * data属性とカスタムのイベントハンドラによるstopPropagation。
2894
+ * デフォルトのstopPropagationだと伝播先のpreventDefaultも無効化されてしまうため、それの対策。
2895
+ */
2896
+ function createDataAttrKey(eventName) {
2897
+ return `data-stop-propagation-${eventName}-${actionId}`;
2898
+ }
2899
+ function dataAttrStopPropagation(eventName) {
2900
+ const dataAttr = createDataAttrKey(eventName);
2901
+ return {
2902
+ [dataAttr]: true,
2903
+ };
2904
+ }
2905
+ function checkStopPropagation(eventName, handler) {
2906
+ const dataAttr = createDataAttrKey(eventName);
2907
+ return function (event) {
2908
+ let el = event.target;
2909
+ do {
2910
+ const _el = el;
2911
+ if (_el === this) {
2912
+ // handlerの中で伝播先のDOMが同期的に消されると
2913
+ // preventDefaultが呼ばれずにデフォルトの挙動だけ残ってしまう
2914
+ setTimeout(() => {
2915
+ handler(event);
2916
+ }, 0);
2917
+ break;
2918
+ }
2919
+ if (_el.hasAttribute(dataAttr))
2920
+ break;
2921
+ el = el.parentElement || el.parentNode;
2922
+ } while (el !== null && el.nodeType === 1);
2923
+ };
2924
+ }
2925
+
2892
2926
  /* src/components/Button.svelte generated by Svelte v3.53.1 */
2893
2927
 
2894
2928
  function add_css$r(target) {
2895
2929
  append_styles(target, "svelte-1tg0tf", ".button.svelte-1tg0tf{display:block;text-decoration:none;color:inherit;border:none;background:none;margin:0;padding:0}.button.svelte-1tg0tf:link,.button.svelte-1tg0tf:visited,.button.svelte-1tg0tf:active,.button.svelte-1tg0tf:hover{color:inherit}");
2896
2930
  }
2897
2931
 
2898
- // (49:0) {:else}
2932
+ // (50:0) {:else}
2899
2933
  function create_else_block$3(ctx) {
2900
2934
  let button;
2901
2935
  let current;
2902
2936
  let mounted;
2903
2937
  let dispose;
2904
- const default_slot_template = /*#slots*/ ctx[10].default;
2905
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[9], null);
2938
+ const default_slot_template = /*#slots*/ ctx[9].default;
2939
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[8], null);
2940
+
2941
+ let button_levels = [
2942
+ { class: BUTTON_CLASS },
2943
+ { style: /*style*/ ctx[1] },
2944
+ dataAttrStopPropagation('click')
2945
+ ];
2946
+
2947
+ let button_data = {};
2948
+
2949
+ for (let i = 0; i < button_levels.length; i += 1) {
2950
+ button_data = assign(button_data, button_levels[i]);
2951
+ }
2906
2952
 
2907
2953
  return {
2908
2954
  c() {
@@ -2918,8 +2964,8 @@ function create_else_block$3(ctx) {
2918
2964
  this.h();
2919
2965
  },
2920
2966
  h() {
2921
- attr(button, "class", "" + (null_to_empty(BUTTON_CLASS) + " svelte-1tg0tf"));
2922
- attr(button, "style", /*style*/ ctx[1]);
2967
+ set_attributes(button, button_data);
2968
+ toggle_class(button, "svelte-1tg0tf", true);
2923
2969
  },
2924
2970
  m(target, anchor) {
2925
2971
  insert_hydration(target, button, anchor);
@@ -2928,32 +2974,37 @@ function create_else_block$3(ctx) {
2928
2974
  default_slot.m(button, null);
2929
2975
  }
2930
2976
 
2977
+ if (button.autofocus) button.focus();
2931
2978
  current = true;
2932
2979
 
2933
2980
  if (!mounted) {
2934
- dispose = listen(button, "click", /*handleClickButton*/ ctx[3]);
2981
+ dispose = listen(button, "click", checkStopPropagation('click', /*handleClick*/ ctx[3]));
2935
2982
  mounted = true;
2936
2983
  }
2937
2984
  },
2938
2985
  p(ctx, dirty) {
2939
2986
  if (default_slot) {
2940
- if (default_slot.p && (!current || dirty & /*$$scope*/ 512)) {
2987
+ if (default_slot.p && (!current || dirty & /*$$scope*/ 256)) {
2941
2988
  update_slot_base(
2942
2989
  default_slot,
2943
2990
  default_slot_template,
2944
2991
  ctx,
2945
- /*$$scope*/ ctx[9],
2992
+ /*$$scope*/ ctx[8],
2946
2993
  !current
2947
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[9])
2948
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[9], dirty, null),
2994
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[8])
2995
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[8], dirty, null),
2949
2996
  null
2950
2997
  );
2951
2998
  }
2952
2999
  }
2953
3000
 
2954
- if (!current || dirty & /*style*/ 2) {
2955
- attr(button, "style", /*style*/ ctx[1]);
2956
- }
3001
+ set_attributes(button, button_data = get_spread_update(button_levels, [
3002
+ { class: BUTTON_CLASS },
3003
+ (!current || dirty & /*style*/ 2) && { style: /*style*/ ctx[1] },
3004
+ dataAttrStopPropagation('click')
3005
+ ]));
3006
+
3007
+ toggle_class(button, "svelte-1tg0tf", true);
2957
3008
  },
2958
3009
  i(local) {
2959
3010
  if (current) return;
@@ -2973,12 +3024,12 @@ function create_else_block$3(ctx) {
2973
3024
  };
2974
3025
  }
2975
3026
 
2976
- // (45:39)
3027
+ // (46:39)
2977
3028
  function create_if_block_2(ctx) {
2978
3029
  let div;
2979
3030
  let current;
2980
- const default_slot_template = /*#slots*/ ctx[10].default;
2981
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[9], null);
3031
+ const default_slot_template = /*#slots*/ ctx[9].default;
3032
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[8], null);
2982
3033
 
2983
3034
  return {
2984
3035
  c() {
@@ -3008,15 +3059,15 @@ function create_if_block_2(ctx) {
3008
3059
  },
3009
3060
  p(ctx, dirty) {
3010
3061
  if (default_slot) {
3011
- if (default_slot.p && (!current || dirty & /*$$scope*/ 512)) {
3062
+ if (default_slot.p && (!current || dirty & /*$$scope*/ 256)) {
3012
3063
  update_slot_base(
3013
3064
  default_slot,
3014
3065
  default_slot_template,
3015
3066
  ctx,
3016
- /*$$scope*/ ctx[9],
3067
+ /*$$scope*/ ctx[8],
3017
3068
  !current
3018
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[9])
3019
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[9], dirty, null),
3069
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[8])
3070
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[8], dirty, null),
3020
3071
  null
3021
3072
  );
3022
3073
  }
@@ -3042,7 +3093,7 @@ function create_if_block_2(ctx) {
3042
3093
  };
3043
3094
  }
3044
3095
 
3045
- // (41:41)
3096
+ // (35:41)
3046
3097
  function create_if_block_1$2(ctx) {
3047
3098
  let a;
3048
3099
  let a_href_value;
@@ -3050,8 +3101,26 @@ function create_if_block_1$2(ctx) {
3050
3101
  let current;
3051
3102
  let mounted;
3052
3103
  let dispose;
3053
- const default_slot_template = /*#slots*/ ctx[10].default;
3054
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[9], null);
3104
+ const default_slot_template = /*#slots*/ ctx[9].default;
3105
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[8], null);
3106
+
3107
+ let a_levels = [
3108
+ { class: BUTTON_CLASS },
3109
+ { style: /*style*/ ctx[1] },
3110
+ {
3111
+ href: a_href_value = /*onClick*/ ctx[0].args[0]
3112
+ },
3113
+ {
3114
+ target: a_target_value = /*onClick*/ ctx[0].args[1] === true ? '_blank' : null
3115
+ },
3116
+ dataAttrStopPropagation('click')
3117
+ ];
3118
+
3119
+ let a_data = {};
3120
+
3121
+ for (let i = 0; i < a_levels.length; i += 1) {
3122
+ a_data = assign(a_data, a_levels[i]);
3123
+ }
3055
3124
 
3056
3125
  return {
3057
3126
  c() {
@@ -3073,10 +3142,8 @@ function create_if_block_1$2(ctx) {
3073
3142
  this.h();
3074
3143
  },
3075
3144
  h() {
3076
- attr(a, "class", "" + (null_to_empty(BUTTON_CLASS) + " svelte-1tg0tf"));
3077
- attr(a, "style", /*style*/ ctx[1]);
3078
- attr(a, "href", a_href_value = /*onClick*/ ctx[0].args[0]);
3079
- attr(a, "target", a_target_value = /*onClick*/ ctx[0].args[1] === true ? '_blank' : null);
3145
+ set_attributes(a, a_data);
3146
+ toggle_class(a, "svelte-1tg0tf", true);
3080
3147
  },
3081
3148
  m(target, anchor) {
3082
3149
  insert_hydration(target, a, anchor);
@@ -3088,37 +3155,35 @@ function create_if_block_1$2(ctx) {
3088
3155
  current = true;
3089
3156
 
3090
3157
  if (!mounted) {
3091
- dispose = listen(a, "click", /*handleClickAnchor*/ ctx[4]);
3158
+ dispose = listen(a, "click", prevent_default(checkStopPropagation('click', /*handleClick*/ ctx[3])));
3092
3159
  mounted = true;
3093
3160
  }
3094
3161
  },
3095
3162
  p(ctx, dirty) {
3096
3163
  if (default_slot) {
3097
- if (default_slot.p && (!current || dirty & /*$$scope*/ 512)) {
3164
+ if (default_slot.p && (!current || dirty & /*$$scope*/ 256)) {
3098
3165
  update_slot_base(
3099
3166
  default_slot,
3100
3167
  default_slot_template,
3101
3168
  ctx,
3102
- /*$$scope*/ ctx[9],
3169
+ /*$$scope*/ ctx[8],
3103
3170
  !current
3104
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[9])
3105
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[9], dirty, null),
3171
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[8])
3172
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[8], dirty, null),
3106
3173
  null
3107
3174
  );
3108
3175
  }
3109
3176
  }
3110
3177
 
3111
- if (!current || dirty & /*style*/ 2) {
3112
- attr(a, "style", /*style*/ ctx[1]);
3113
- }
3178
+ set_attributes(a, a_data = get_spread_update(a_levels, [
3179
+ { class: BUTTON_CLASS },
3180
+ (!current || dirty & /*style*/ 2) && { style: /*style*/ ctx[1] },
3181
+ (!current || dirty & /*onClick*/ 1 && a_href_value !== (a_href_value = /*onClick*/ ctx[0].args[0])) && { href: a_href_value },
3182
+ (!current || dirty & /*onClick*/ 1 && a_target_value !== (a_target_value = /*onClick*/ ctx[0].args[1] === true ? '_blank' : null)) && { target: a_target_value },
3183
+ dataAttrStopPropagation('click')
3184
+ ]));
3114
3185
 
3115
- if (!current || dirty & /*onClick*/ 1 && a_href_value !== (a_href_value = /*onClick*/ ctx[0].args[0])) {
3116
- attr(a, "href", a_href_value);
3117
- }
3118
-
3119
- if (!current || dirty & /*onClick*/ 1 && a_target_value !== (a_target_value = /*onClick*/ ctx[0].args[1] === true ? '_blank' : null)) {
3120
- attr(a, "target", a_target_value);
3121
- }
3186
+ toggle_class(a, "svelte-1tg0tf", true);
3122
3187
  },
3123
3188
  i(local) {
3124
3189
  if (current) return;
@@ -3138,12 +3203,12 @@ function create_if_block_1$2(ctx) {
3138
3203
  };
3139
3204
  }
3140
3205
 
3141
- // (37:0) {#if disabled}
3206
+ // (31:0) {#if disabled}
3142
3207
  function create_if_block$6(ctx) {
3143
3208
  let div;
3144
3209
  let current;
3145
- const default_slot_template = /*#slots*/ ctx[10].default;
3146
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[9], null);
3210
+ const default_slot_template = /*#slots*/ ctx[9].default;
3211
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[8], null);
3147
3212
 
3148
3213
  return {
3149
3214
  c() {
@@ -3173,15 +3238,15 @@ function create_if_block$6(ctx) {
3173
3238
  },
3174
3239
  p(ctx, dirty) {
3175
3240
  if (default_slot) {
3176
- if (default_slot.p && (!current || dirty & /*$$scope*/ 512)) {
3241
+ if (default_slot.p && (!current || dirty & /*$$scope*/ 256)) {
3177
3242
  update_slot_base(
3178
3243
  default_slot,
3179
3244
  default_slot_template,
3180
3245
  ctx,
3181
- /*$$scope*/ ctx[9],
3246
+ /*$$scope*/ ctx[8],
3182
3247
  !current
3183
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[9])
3184
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[9], dirty, null),
3248
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[8])
3249
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[8], dirty, null),
3185
3250
  null
3186
3251
  );
3187
3252
  }
@@ -3293,17 +3358,7 @@ function instance$u($$self, $$props, $$invalidate) {
3293
3358
  let { eventValue = undefined } = $$props;
3294
3359
  let { style = '' } = $$props;
3295
3360
 
3296
- function handleClickButton() {
3297
- if (eventName) {
3298
- send_event(eventName, eventValue);
3299
- }
3300
-
3301
- execOnClickOperation(onClick);
3302
- }
3303
-
3304
- function handleClickAnchor(e) {
3305
- e.preventDefault();
3306
-
3361
+ function handleClick() {
3307
3362
  if (eventName) {
3308
3363
  send_event(eventName, eventValue);
3309
3364
  }
@@ -3313,18 +3368,18 @@ function instance$u($$self, $$props, $$invalidate) {
3313
3368
 
3314
3369
  const { path: statePath } = getStateItemContext() ?? { path: '/' };
3315
3370
  const valuesAreValid = getValuesAreValidReader(statePath);
3316
- component_subscribe($$self, valuesAreValid, value => $$invalidate(8, $valuesAreValid = value));
3371
+ component_subscribe($$self, valuesAreValid, value => $$invalidate(7, $valuesAreValid = value));
3317
3372
 
3318
3373
  $$self.$$set = $$props => {
3319
3374
  if ('onClick' in $$props) $$invalidate(0, onClick = $$props.onClick);
3320
- if ('eventName' in $$props) $$invalidate(6, eventName = $$props.eventName);
3321
- if ('eventValue' in $$props) $$invalidate(7, eventValue = $$props.eventValue);
3375
+ if ('eventName' in $$props) $$invalidate(5, eventName = $$props.eventName);
3376
+ if ('eventValue' in $$props) $$invalidate(6, eventValue = $$props.eventValue);
3322
3377
  if ('style' in $$props) $$invalidate(1, style = $$props.style);
3323
- if ('$$scope' in $$props) $$invalidate(9, $$scope = $$props.$$scope);
3378
+ if ('$$scope' in $$props) $$invalidate(8, $$scope = $$props.$$scope);
3324
3379
  };
3325
3380
 
3326
3381
  $$self.$$.update = () => {
3327
- if ($$self.$$.dirty & /*onClick, $valuesAreValid*/ 257) {
3382
+ if ($$self.$$.dirty & /*onClick, $valuesAreValid*/ 129) {
3328
3383
  $$invalidate(2, disabled = (() => {
3329
3384
  let isEnabled = true;
3330
3385
 
@@ -3343,8 +3398,7 @@ function instance$u($$self, $$props, $$invalidate) {
3343
3398
  onClick,
3344
3399
  style,
3345
3400
  disabled,
3346
- handleClickButton,
3347
- handleClickAnchor,
3401
+ handleClick,
3348
3402
  valuesAreValid,
3349
3403
  eventName,
3350
3404
  eventValue,
@@ -3366,8 +3420,8 @@ class Button extends SvelteComponent {
3366
3420
  safe_not_equal,
3367
3421
  {
3368
3422
  onClick: 0,
3369
- eventName: 6,
3370
- eventValue: 7,
3423
+ eventName: 5,
3424
+ eventValue: 6,
3371
3425
  style: 1
3372
3426
  },
3373
3427
  add_css$r
@@ -7687,7 +7741,7 @@ function get_each_context(ctx, list, i) {
7687
7741
  return child_ctx;
7688
7742
  }
7689
7743
 
7690
- // (369:2) {#if isVisiblePrevButton}
7744
+ // (371:2) {#if isVisiblePrevButton}
7691
7745
  function create_if_block_1(ctx) {
7692
7746
  let div1;
7693
7747
  let div0;
@@ -7755,7 +7809,7 @@ function create_if_block_1(ctx) {
7755
7809
  };
7756
7810
  }
7757
7811
 
7758
- // (378:2) {#if isVisibleNextButton}
7812
+ // (380:2) {#if isVisibleNextButton}
7759
7813
  function create_if_block$1(ctx) {
7760
7814
  let div1;
7761
7815
  let div0;
@@ -7823,7 +7877,7 @@ function create_if_block$1(ctx) {
7823
7877
  };
7824
7878
  }
7825
7879
 
7826
- // (391:4) {#each items as _, i}
7880
+ // (393:4) {#each items as _, i}
7827
7881
  function create_each_block(ctx) {
7828
7882
  let div1;
7829
7883
  let div0;
@@ -7908,6 +7962,13 @@ function create_fragment$b(ctx) {
7908
7962
  each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
7909
7963
  }
7910
7964
 
7965
+ let div3_levels = [{ class: "root" }, dataAttrStopPropagation('click')];
7966
+ let div3_data = {};
7967
+
7968
+ for (let i = 0; i < div3_levels.length; i += 1) {
7969
+ div3_data = assign(div3_data, div3_levels[i]);
7970
+ }
7971
+
7911
7972
  return {
7912
7973
  c() {
7913
7974
  div3 = element("div");
@@ -7960,7 +8021,8 @@ function create_fragment$b(ctx) {
7960
8021
  attr(div1, "style", /*_style*/ ctx[0]);
7961
8022
  attr(div2, "class", "navigation svelte-1wlcw5a");
7962
8023
  attr(div2, "style", /*navigationStyle*/ ctx[4]);
7963
- attr(div3, "class", "root svelte-1wlcw5a");
8024
+ set_attributes(div3, div3_data);
8025
+ toggle_class(div3, "svelte-1wlcw5a", true);
7964
8026
  },
7965
8027
  m(target, anchor) {
7966
8028
  insert_hydration(target, div3, anchor);
@@ -8066,6 +8128,9 @@ function create_fragment$b(ctx) {
8066
8128
  if (!current || dirty[0] & /*navigationStyle*/ 16) {
8067
8129
  attr(div2, "style", /*navigationStyle*/ ctx[4]);
8068
8130
  }
8131
+
8132
+ set_attributes(div3, div3_data = get_spread_update(div3_levels, [{ class: "root" }, dataAttrStopPropagation('click')]));
8133
+ toggle_class(div3, "svelte-1wlcw5a", true);
8069
8134
  },
8070
8135
  i(local) {
8071
8136
  if (current) return;
@@ -8319,7 +8384,9 @@ function instance$b($$self, $$props, $$invalidate) {
8319
8384
  }
8320
8385
 
8321
8386
  function handleTouchMove(event) {
8387
+ // ウィンドウのスクロールを防ぐ
8322
8388
  event.preventDefault();
8389
+
8323
8390
  const clientX = event.touches[0].clientX;
8324
8391
  const timeStamp = event.timeStamp;
8325
8392
  handleMoving(clientX, timeStamp);
package/dist/index.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { writable, get } from 'svelte/store';
2
2
  import { onMount as onMount$1, onDestroy as onDestroy$1, beforeUpdate as beforeUpdate$1, afterUpdate as afterUpdate$1, tick as tick$1, setContext, getContext, createEventDispatcher } from 'svelte';
3
- import { SvelteComponent, init, safe_not_equal, element, insert, noop, detach, component_subscribe, attr, create_slot, create_component, space, mount_component, update_slot_base, get_all_dirty_from_scope, get_slot_changes, transition_in, transition_out, destroy_component, append_styles, empty, group_outros, check_outros, listen, null_to_empty, is_function, add_render_callback, create_in_transition, binding_callbacks, set_style, svg_element, append, destroy_each, text, set_data, src_url_equal, HtmlTag, construct_svelte_component, subscribe } from 'svelte/internal';
3
+ import { SvelteComponent, init, safe_not_equal, element, insert, noop, detach, component_subscribe, attr, create_slot, create_component, space, mount_component, update_slot_base, get_all_dirty_from_scope, get_slot_changes, transition_in, transition_out, destroy_component, append_styles, empty, group_outros, check_outros, listen, assign, set_attributes, toggle_class, get_spread_update, null_to_empty, prevent_default, is_function, add_render_callback, create_in_transition, binding_callbacks, set_style, svg_element, append, destroy_each, text, set_data, src_url_equal, HtmlTag, construct_svelte_component, subscribe } from 'svelte/internal';
4
4
  import { linear, elasticOut, cubicOut } from 'svelte/easing';
5
5
 
6
6
  /** @internal */
@@ -2953,27 +2953,73 @@ class BackgroundOverlay extends SvelteComponent {
2953
2953
  }
2954
2954
  }
2955
2955
 
2956
+ /**
2957
+ * data属性とカスタムのイベントハンドラによるstopPropagation。
2958
+ * デフォルトのstopPropagationだと伝播先のpreventDefaultも無効化されてしまうため、それの対策。
2959
+ */
2960
+ function createDataAttrKey(eventName) {
2961
+ return `data-stop-propagation-${eventName}-${actionId}`;
2962
+ }
2963
+ function dataAttrStopPropagation(eventName) {
2964
+ const dataAttr = createDataAttrKey(eventName);
2965
+ return {
2966
+ [dataAttr]: true,
2967
+ };
2968
+ }
2969
+ function checkStopPropagation(eventName, handler) {
2970
+ const dataAttr = createDataAttrKey(eventName);
2971
+ return function (event) {
2972
+ let el = event.target;
2973
+ do {
2974
+ const _el = el;
2975
+ if (_el === this) {
2976
+ // handlerの中で伝播先のDOMが同期的に消されると
2977
+ // preventDefaultが呼ばれずにデフォルトの挙動だけ残ってしまう
2978
+ setTimeout(() => {
2979
+ handler(event);
2980
+ }, 0);
2981
+ break;
2982
+ }
2983
+ if (_el.hasAttribute(dataAttr))
2984
+ break;
2985
+ el = el.parentElement || el.parentNode;
2986
+ } while (el !== null && el.nodeType === 1);
2987
+ };
2988
+ }
2989
+
2956
2990
  /* src/components/Button.svelte generated by Svelte v3.53.1 */
2957
2991
 
2958
2992
  function add_css$r(target) {
2959
2993
  append_styles(target, "svelte-1tg0tf", ".button.svelte-1tg0tf{display:block;text-decoration:none;color:inherit;border:none;background:none;margin:0;padding:0}.button.svelte-1tg0tf:link,.button.svelte-1tg0tf:visited,.button.svelte-1tg0tf:active,.button.svelte-1tg0tf:hover{color:inherit}");
2960
2994
  }
2961
2995
 
2962
- // (49:0) {:else}
2996
+ // (50:0) {:else}
2963
2997
  function create_else_block$3(ctx) {
2964
2998
  let button;
2965
2999
  let current;
2966
3000
  let mounted;
2967
3001
  let dispose;
2968
- const default_slot_template = /*#slots*/ ctx[10].default;
2969
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[9], null);
3002
+ const default_slot_template = /*#slots*/ ctx[9].default;
3003
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[8], null);
3004
+
3005
+ let button_levels = [
3006
+ { class: BUTTON_CLASS },
3007
+ { style: /*style*/ ctx[1] },
3008
+ dataAttrStopPropagation('click')
3009
+ ];
3010
+
3011
+ let button_data = {};
3012
+
3013
+ for (let i = 0; i < button_levels.length; i += 1) {
3014
+ button_data = assign(button_data, button_levels[i]);
3015
+ }
2970
3016
 
2971
3017
  return {
2972
3018
  c() {
2973
3019
  button = element("button");
2974
3020
  if (default_slot) default_slot.c();
2975
- attr(button, "class", "" + (null_to_empty(BUTTON_CLASS) + " svelte-1tg0tf"));
2976
- attr(button, "style", /*style*/ ctx[1]);
3021
+ set_attributes(button, button_data);
3022
+ toggle_class(button, "svelte-1tg0tf", true);
2977
3023
  },
2978
3024
  m(target, anchor) {
2979
3025
  insert(target, button, anchor);
@@ -2982,32 +3028,37 @@ function create_else_block$3(ctx) {
2982
3028
  default_slot.m(button, null);
2983
3029
  }
2984
3030
 
3031
+ if (button.autofocus) button.focus();
2985
3032
  current = true;
2986
3033
 
2987
3034
  if (!mounted) {
2988
- dispose = listen(button, "click", /*handleClickButton*/ ctx[3]);
3035
+ dispose = listen(button, "click", checkStopPropagation('click', /*handleClick*/ ctx[3]));
2989
3036
  mounted = true;
2990
3037
  }
2991
3038
  },
2992
3039
  p(ctx, dirty) {
2993
3040
  if (default_slot) {
2994
- if (default_slot.p && (!current || dirty & /*$$scope*/ 512)) {
3041
+ if (default_slot.p && (!current || dirty & /*$$scope*/ 256)) {
2995
3042
  update_slot_base(
2996
3043
  default_slot,
2997
3044
  default_slot_template,
2998
3045
  ctx,
2999
- /*$$scope*/ ctx[9],
3046
+ /*$$scope*/ ctx[8],
3000
3047
  !current
3001
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[9])
3002
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[9], dirty, null),
3048
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[8])
3049
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[8], dirty, null),
3003
3050
  null
3004
3051
  );
3005
3052
  }
3006
3053
  }
3007
3054
 
3008
- if (!current || dirty & /*style*/ 2) {
3009
- attr(button, "style", /*style*/ ctx[1]);
3010
- }
3055
+ set_attributes(button, button_data = get_spread_update(button_levels, [
3056
+ { class: BUTTON_CLASS },
3057
+ (!current || dirty & /*style*/ 2) && { style: /*style*/ ctx[1] },
3058
+ dataAttrStopPropagation('click')
3059
+ ]));
3060
+
3061
+ toggle_class(button, "svelte-1tg0tf", true);
3011
3062
  },
3012
3063
  i(local) {
3013
3064
  if (current) return;
@@ -3027,12 +3078,12 @@ function create_else_block$3(ctx) {
3027
3078
  };
3028
3079
  }
3029
3080
 
3030
- // (45:39)
3081
+ // (46:39)
3031
3082
  function create_if_block_2(ctx) {
3032
3083
  let div;
3033
3084
  let current;
3034
- const default_slot_template = /*#slots*/ ctx[10].default;
3035
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[9], null);
3085
+ const default_slot_template = /*#slots*/ ctx[9].default;
3086
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[8], null);
3036
3087
 
3037
3088
  return {
3038
3089
  c() {
@@ -3052,15 +3103,15 @@ function create_if_block_2(ctx) {
3052
3103
  },
3053
3104
  p(ctx, dirty) {
3054
3105
  if (default_slot) {
3055
- if (default_slot.p && (!current || dirty & /*$$scope*/ 512)) {
3106
+ if (default_slot.p && (!current || dirty & /*$$scope*/ 256)) {
3056
3107
  update_slot_base(
3057
3108
  default_slot,
3058
3109
  default_slot_template,
3059
3110
  ctx,
3060
- /*$$scope*/ ctx[9],
3111
+ /*$$scope*/ ctx[8],
3061
3112
  !current
3062
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[9])
3063
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[9], dirty, null),
3113
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[8])
3114
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[8], dirty, null),
3064
3115
  null
3065
3116
  );
3066
3117
  }
@@ -3086,7 +3137,7 @@ function create_if_block_2(ctx) {
3086
3137
  };
3087
3138
  }
3088
3139
 
3089
- // (41:41)
3140
+ // (35:41)
3090
3141
  function create_if_block_1$2(ctx) {
3091
3142
  let a;
3092
3143
  let a_href_value;
@@ -3094,17 +3145,33 @@ function create_if_block_1$2(ctx) {
3094
3145
  let current;
3095
3146
  let mounted;
3096
3147
  let dispose;
3097
- const default_slot_template = /*#slots*/ ctx[10].default;
3098
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[9], null);
3148
+ const default_slot_template = /*#slots*/ ctx[9].default;
3149
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[8], null);
3150
+
3151
+ let a_levels = [
3152
+ { class: BUTTON_CLASS },
3153
+ { style: /*style*/ ctx[1] },
3154
+ {
3155
+ href: a_href_value = /*onClick*/ ctx[0].args[0]
3156
+ },
3157
+ {
3158
+ target: a_target_value = /*onClick*/ ctx[0].args[1] === true ? '_blank' : null
3159
+ },
3160
+ dataAttrStopPropagation('click')
3161
+ ];
3162
+
3163
+ let a_data = {};
3164
+
3165
+ for (let i = 0; i < a_levels.length; i += 1) {
3166
+ a_data = assign(a_data, a_levels[i]);
3167
+ }
3099
3168
 
3100
3169
  return {
3101
3170
  c() {
3102
3171
  a = element("a");
3103
3172
  if (default_slot) default_slot.c();
3104
- attr(a, "class", "" + (null_to_empty(BUTTON_CLASS) + " svelte-1tg0tf"));
3105
- attr(a, "style", /*style*/ ctx[1]);
3106
- attr(a, "href", a_href_value = /*onClick*/ ctx[0].args[0]);
3107
- attr(a, "target", a_target_value = /*onClick*/ ctx[0].args[1] === true ? '_blank' : null);
3173
+ set_attributes(a, a_data);
3174
+ toggle_class(a, "svelte-1tg0tf", true);
3108
3175
  },
3109
3176
  m(target, anchor) {
3110
3177
  insert(target, a, anchor);
@@ -3116,37 +3183,35 @@ function create_if_block_1$2(ctx) {
3116
3183
  current = true;
3117
3184
 
3118
3185
  if (!mounted) {
3119
- dispose = listen(a, "click", /*handleClickAnchor*/ ctx[4]);
3186
+ dispose = listen(a, "click", prevent_default(checkStopPropagation('click', /*handleClick*/ ctx[3])));
3120
3187
  mounted = true;
3121
3188
  }
3122
3189
  },
3123
3190
  p(ctx, dirty) {
3124
3191
  if (default_slot) {
3125
- if (default_slot.p && (!current || dirty & /*$$scope*/ 512)) {
3192
+ if (default_slot.p && (!current || dirty & /*$$scope*/ 256)) {
3126
3193
  update_slot_base(
3127
3194
  default_slot,
3128
3195
  default_slot_template,
3129
3196
  ctx,
3130
- /*$$scope*/ ctx[9],
3197
+ /*$$scope*/ ctx[8],
3131
3198
  !current
3132
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[9])
3133
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[9], dirty, null),
3199
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[8])
3200
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[8], dirty, null),
3134
3201
  null
3135
3202
  );
3136
3203
  }
3137
3204
  }
3138
3205
 
3139
- if (!current || dirty & /*style*/ 2) {
3140
- attr(a, "style", /*style*/ ctx[1]);
3141
- }
3206
+ set_attributes(a, a_data = get_spread_update(a_levels, [
3207
+ { class: BUTTON_CLASS },
3208
+ (!current || dirty & /*style*/ 2) && { style: /*style*/ ctx[1] },
3209
+ (!current || dirty & /*onClick*/ 1 && a_href_value !== (a_href_value = /*onClick*/ ctx[0].args[0])) && { href: a_href_value },
3210
+ (!current || dirty & /*onClick*/ 1 && a_target_value !== (a_target_value = /*onClick*/ ctx[0].args[1] === true ? '_blank' : null)) && { target: a_target_value },
3211
+ dataAttrStopPropagation('click')
3212
+ ]));
3142
3213
 
3143
- if (!current || dirty & /*onClick*/ 1 && a_href_value !== (a_href_value = /*onClick*/ ctx[0].args[0])) {
3144
- attr(a, "href", a_href_value);
3145
- }
3146
-
3147
- if (!current || dirty & /*onClick*/ 1 && a_target_value !== (a_target_value = /*onClick*/ ctx[0].args[1] === true ? '_blank' : null)) {
3148
- attr(a, "target", a_target_value);
3149
- }
3214
+ toggle_class(a, "svelte-1tg0tf", true);
3150
3215
  },
3151
3216
  i(local) {
3152
3217
  if (current) return;
@@ -3166,12 +3231,12 @@ function create_if_block_1$2(ctx) {
3166
3231
  };
3167
3232
  }
3168
3233
 
3169
- // (37:0) {#if disabled}
3234
+ // (31:0) {#if disabled}
3170
3235
  function create_if_block$6(ctx) {
3171
3236
  let div;
3172
3237
  let current;
3173
- const default_slot_template = /*#slots*/ ctx[10].default;
3174
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[9], null);
3238
+ const default_slot_template = /*#slots*/ ctx[9].default;
3239
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[8], null);
3175
3240
 
3176
3241
  return {
3177
3242
  c() {
@@ -3191,15 +3256,15 @@ function create_if_block$6(ctx) {
3191
3256
  },
3192
3257
  p(ctx, dirty) {
3193
3258
  if (default_slot) {
3194
- if (default_slot.p && (!current || dirty & /*$$scope*/ 512)) {
3259
+ if (default_slot.p && (!current || dirty & /*$$scope*/ 256)) {
3195
3260
  update_slot_base(
3196
3261
  default_slot,
3197
3262
  default_slot_template,
3198
3263
  ctx,
3199
- /*$$scope*/ ctx[9],
3264
+ /*$$scope*/ ctx[8],
3200
3265
  !current
3201
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[9])
3202
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[9], dirty, null),
3266
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[8])
3267
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[8], dirty, null),
3203
3268
  null
3204
3269
  );
3205
3270
  }
@@ -3307,17 +3372,7 @@ function instance$u($$self, $$props, $$invalidate) {
3307
3372
  let { eventValue = undefined } = $$props;
3308
3373
  let { style = '' } = $$props;
3309
3374
 
3310
- function handleClickButton() {
3311
- if (eventName) {
3312
- send_event(eventName, eventValue);
3313
- }
3314
-
3315
- execOnClickOperation(onClick);
3316
- }
3317
-
3318
- function handleClickAnchor(e) {
3319
- e.preventDefault();
3320
-
3375
+ function handleClick() {
3321
3376
  if (eventName) {
3322
3377
  send_event(eventName, eventValue);
3323
3378
  }
@@ -3327,18 +3382,18 @@ function instance$u($$self, $$props, $$invalidate) {
3327
3382
 
3328
3383
  const { path: statePath } = getStateItemContext() ?? { path: '/' };
3329
3384
  const valuesAreValid = getValuesAreValidReader(statePath);
3330
- component_subscribe($$self, valuesAreValid, value => $$invalidate(8, $valuesAreValid = value));
3385
+ component_subscribe($$self, valuesAreValid, value => $$invalidate(7, $valuesAreValid = value));
3331
3386
 
3332
3387
  $$self.$$set = $$props => {
3333
3388
  if ('onClick' in $$props) $$invalidate(0, onClick = $$props.onClick);
3334
- if ('eventName' in $$props) $$invalidate(6, eventName = $$props.eventName);
3335
- if ('eventValue' in $$props) $$invalidate(7, eventValue = $$props.eventValue);
3389
+ if ('eventName' in $$props) $$invalidate(5, eventName = $$props.eventName);
3390
+ if ('eventValue' in $$props) $$invalidate(6, eventValue = $$props.eventValue);
3336
3391
  if ('style' in $$props) $$invalidate(1, style = $$props.style);
3337
- if ('$$scope' in $$props) $$invalidate(9, $$scope = $$props.$$scope);
3392
+ if ('$$scope' in $$props) $$invalidate(8, $$scope = $$props.$$scope);
3338
3393
  };
3339
3394
 
3340
3395
  $$self.$$.update = () => {
3341
- if ($$self.$$.dirty & /*onClick, $valuesAreValid*/ 257) {
3396
+ if ($$self.$$.dirty & /*onClick, $valuesAreValid*/ 129) {
3342
3397
  $$invalidate(2, disabled = (() => {
3343
3398
  let isEnabled = true;
3344
3399
 
@@ -3357,8 +3412,7 @@ function instance$u($$self, $$props, $$invalidate) {
3357
3412
  onClick,
3358
3413
  style,
3359
3414
  disabled,
3360
- handleClickButton,
3361
- handleClickAnchor,
3415
+ handleClick,
3362
3416
  valuesAreValid,
3363
3417
  eventName,
3364
3418
  eventValue,
@@ -3380,8 +3434,8 @@ class Button extends SvelteComponent {
3380
3434
  safe_not_equal,
3381
3435
  {
3382
3436
  onClick: 0,
3383
- eventName: 6,
3384
- eventValue: 7,
3437
+ eventName: 5,
3438
+ eventValue: 6,
3385
3439
  style: 1
3386
3440
  },
3387
3441
  add_css$r
@@ -7261,7 +7315,7 @@ function get_each_context(ctx, list, i) {
7261
7315
  return child_ctx;
7262
7316
  }
7263
7317
 
7264
- // (369:2) {#if isVisiblePrevButton}
7318
+ // (371:2) {#if isVisiblePrevButton}
7265
7319
  function create_if_block_1(ctx) {
7266
7320
  let div1;
7267
7321
  let div0;
@@ -7312,7 +7366,7 @@ function create_if_block_1(ctx) {
7312
7366
  };
7313
7367
  }
7314
7368
 
7315
- // (378:2) {#if isVisibleNextButton}
7369
+ // (380:2) {#if isVisibleNextButton}
7316
7370
  function create_if_block$1(ctx) {
7317
7371
  let div1;
7318
7372
  let div0;
@@ -7363,7 +7417,7 @@ function create_if_block$1(ctx) {
7363
7417
  };
7364
7418
  }
7365
7419
 
7366
- // (391:4) {#each items as _, i}
7420
+ // (393:4) {#each items as _, i}
7367
7421
  function create_each_block(ctx) {
7368
7422
  let div1;
7369
7423
  let div0;
@@ -7436,6 +7490,13 @@ function create_fragment$b(ctx) {
7436
7490
  each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
7437
7491
  }
7438
7492
 
7493
+ let div3_levels = [{ class: "root" }, dataAttrStopPropagation('click')];
7494
+ let div3_data = {};
7495
+
7496
+ for (let i = 0; i < div3_levels.length; i += 1) {
7497
+ div3_data = assign(div3_data, div3_levels[i]);
7498
+ }
7499
+
7439
7500
  return {
7440
7501
  c() {
7441
7502
  div3 = element("div");
@@ -7459,7 +7520,8 @@ function create_fragment$b(ctx) {
7459
7520
  attr(div1, "style", /*_style*/ ctx[0]);
7460
7521
  attr(div2, "class", "navigation svelte-1wlcw5a");
7461
7522
  attr(div2, "style", /*navigationStyle*/ ctx[4]);
7462
- attr(div3, "class", "root svelte-1wlcw5a");
7523
+ set_attributes(div3, div3_data);
7524
+ toggle_class(div3, "svelte-1wlcw5a", true);
7463
7525
  },
7464
7526
  m(target, anchor) {
7465
7527
  insert(target, div3, anchor);
@@ -7565,6 +7627,9 @@ function create_fragment$b(ctx) {
7565
7627
  if (!current || dirty[0] & /*navigationStyle*/ 16) {
7566
7628
  attr(div2, "style", /*navigationStyle*/ ctx[4]);
7567
7629
  }
7630
+
7631
+ set_attributes(div3, div3_data = get_spread_update(div3_levels, [{ class: "root" }, dataAttrStopPropagation('click')]));
7632
+ toggle_class(div3, "svelte-1wlcw5a", true);
7568
7633
  },
7569
7634
  i(local) {
7570
7635
  if (current) return;
@@ -7818,7 +7883,9 @@ function instance$b($$self, $$props, $$invalidate) {
7818
7883
  }
7819
7884
 
7820
7885
  function handleTouchMove(event) {
7886
+ // ウィンドウのスクロールを防ぐ
7821
7887
  event.preventDefault();
7888
+
7822
7889
  const clientX = event.touches[0].clientX;
7823
7890
  const timeStamp = event.timeStamp;
7824
7891
  handleMoving(clientX, timeStamp);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaidev/karte-action-sdk",
3
- "version": "1.1.181-28042089.f7e0349f",
3
+ "version": "1.1.181-28042947.ba6a2943",
4
4
  "author": "Plaid Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "module": "./dist/index.es.js",