@plaidev/karte-action-sdk 1.1.213 → 1.1.216

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.
@@ -1756,11 +1756,7 @@ function createModal(App, options = {
1756
1756
  context: { api_key: '' },
1757
1757
  }) {
1758
1758
  let app = null;
1759
- const data = {
1760
- ...options.props,
1761
- ...options.variables,
1762
- ...getVariables(),
1763
- };
1759
+ const data = getVariables();
1764
1760
  const actionProps = {
1765
1761
  send: options.send,
1766
1762
  publish: options.publish,
@@ -2043,21 +2039,14 @@ async function runScript$1(options = {
2043
2039
  }) {
2044
2040
  if (!options.onCreate)
2045
2041
  return;
2046
- let data = {
2047
- ...options.props,
2048
- ...options.variables,
2049
- ...getVariables(),
2050
- };
2042
+ let data = getVariables();
2051
2043
  initialize({ send: options.send, initialState: data.initial_state });
2052
2044
  initActionTable(options.localVariablesQuery);
2053
2045
  const { success } = await setupActionTable(options.localVariablesQuery, data, data.api_key);
2054
2046
  if (!success)
2055
2047
  return;
2056
2048
  // Action Tableの取得結果を反映する
2057
- data = {
2058
- ...data,
2059
- ...getVariables(),
2060
- };
2049
+ data = getVariables();
2061
2050
  const actionProps = {
2062
2051
  send: options.send,
2063
2052
  publish: options.publish,
@@ -2158,11 +2147,11 @@ function create(App, options = {
2158
2147
  karteTemplate: {},
2159
2148
  context: { api_key: '' },
2160
2149
  }) {
2161
- const data = {
2150
+ setVariables({
2162
2151
  ...options.props,
2163
2152
  ...options.variables,
2164
- ...getVariables(),
2165
- };
2153
+ });
2154
+ const data = getVariables();
2166
2155
  const actionProps = {
2167
2156
  send: options.send,
2168
2157
  publish: options.publish,
@@ -2924,6 +2913,7 @@ class StateItem extends SvelteComponent {
2924
2913
  }
2925
2914
  }
2926
2915
 
2916
+ const USER_ID_VARIABLE_NAME = '__karte_form_identify_user_id';
2927
2917
  function isEmpty(value) {
2928
2918
  if (Array.isArray(value)) {
2929
2919
  return value.length === 0;
@@ -3043,6 +3033,9 @@ function submit() {
3043
3033
  const identifyFormData$1 = get(identifyFormData);
3044
3034
  const values = formDataToEventValues(campaignId, formData$1);
3045
3035
  const identifyValues = formDataToIdentifyEventValues(identifyFormData$1);
3036
+ if (Object.keys(identifyValues).length > 0) {
3037
+ identifyValues['user_id'] = getVariables()?.[USER_ID_VARIABLE_NAME];
3038
+ }
3046
3039
  return { values, identifyValues };
3047
3040
  }
3048
3041
  return {};
@@ -7017,7 +7010,7 @@ function instance$j($$self, $$props, $$invalidate) {
7017
7010
  let $value;
7018
7011
  let { name = '' } = $$props;
7019
7012
  let { placeholder = '回答を入力してください' } = $$props;
7020
- let { required = true } = $$props;
7013
+ let { required = false } = $$props;
7021
7014
  let { _style = '' } = $$props;
7022
7015
  let { _focusStyle = 'border-width: 2px; border-color: #2aab9f; border-style: solid' } = $$props;
7023
7016
  let { font = SYSTEM_FONT } = $$props;
@@ -8142,7 +8135,7 @@ class FormCheckBoxes extends SvelteComponent {
8142
8135
  /* src/components/FormRatingButtonsNumber.svelte generated by Svelte v3.53.1 */
8143
8136
 
8144
8137
  function add_css$e(target) {
8145
- append_styles(target, "svelte-18pfy31", ".rating-buttons.svelte-18pfy31{display:flex;justify-content:space-between;align-items:center;width:100%;height:100%}.rating-button.svelte-18pfy31{cursor:pointer;display:flex;justify-content:center;align-items:center;transition:background-color 0.2s, box-shadow 0.2s;appearance:none;background:none;border:none;margin:0;padding:0}");
8138
+ append_styles(target, "svelte-9idbf1", ".rating-buttons.svelte-9idbf1{display:flex;justify-content:space-between;align-items:center;width:100%;height:100%}.rating-button.svelte-9idbf1{cursor:pointer;display:flex;justify-content:center;align-items:center;transition:background-color 0.2s, box-shadow 0.2s;appearance:none;background:none;border:none;margin:0;padding:0}");
8146
8139
  }
8147
8140
 
8148
8141
  function get_each_context$2(ctx, list, i) {
@@ -8151,7 +8144,7 @@ function get_each_context$2(ctx, list, i) {
8151
8144
  return child_ctx;
8152
8145
  }
8153
8146
 
8154
- // (60:2) {#each [...Array(count).keys()].map(i => i + 1) as i}
8147
+ // (64:2) {#each [...Array(count).keys()].map(i => i + 1) as i}
8155
8148
  function create_each_block$2(ctx) {
8156
8149
  let button;
8157
8150
  let t0_value = /*i*/ ctx[12] + "";
@@ -8177,7 +8170,7 @@ function create_each_block$2(ctx) {
8177
8170
  this.h();
8178
8171
  },
8179
8172
  h() {
8180
- attr(button, "class", "rating-button svelte-18pfy31");
8173
+ attr(button, "class", "rating-button svelte-9idbf1");
8181
8174
  attr(button, "style", button_style_value = /*getTextButtonStyle*/ ctx[4](/*i*/ ctx[12] === /*_value*/ ctx[1]));
8182
8175
  },
8183
8176
  m(target, anchor) {
@@ -8240,7 +8233,7 @@ function create_fragment$f(ctx) {
8240
8233
  this.h();
8241
8234
  },
8242
8235
  h() {
8243
- attr(div, "class", "rating-buttons svelte-18pfy31");
8236
+ attr(div, "class", "rating-buttons svelte-9idbf1");
8244
8237
  },
8245
8238
  m(target, anchor) {
8246
8239
  insert_hydration(target, div, anchor);
@@ -8315,7 +8308,7 @@ function instance$f($$self, $$props, $$invalidate) {
8315
8308
  return [
8316
8309
  ...buttonStyle.split(';'),
8317
8310
  `font-family:${font}`,
8318
- ...isActive ? buttonActiveStyle : []
8311
+ ...isActive ? buttonActiveStyle.split(';') : []
8319
8312
  ].join(';');
8320
8313
  }
8321
8314
 
@@ -8588,7 +8581,7 @@ class FormRatingButtonsFace extends SvelteComponent {
8588
8581
  /* src/components/FormIdentifyInput.svelte generated by Svelte v3.53.1 */
8589
8582
 
8590
8583
  function add_css$c(target) {
8591
- append_styles(target, "svelte-17a0wgl", ".input-wrapper.svelte-17a0wgl{display:flex;align-items:center;width:100%;height:100%}.input.svelte-17a0wgl{width:100%;height:100%;box-sizing:border-box;resize:none;appearance:none;background-color:#fff;border:solid 2px #ccc;border-radius:6px;padding:6px 10px 6px 10px;font-size:12px;line-height:1.5}.input.svelte-17a0wgl::placeholder{color:var(--placeholder-color)}.input.svelte-17a0wgl:focus{outline:none;border-width:var(--focus-border-width) !important;border-color:var(--focus-border-color) !important;border-style:var(--focus-border-style) !important}.input._error.svelte-17a0wgl{outline:none;border-width:var(--error-border-width) !important;border-color:var(--error-border-color) !important;border-style:var(--error-border-style) !important}");
8584
+ append_styles(target, "svelte-f14zo5", ".input-wrapper.svelte-f14zo5{display:flex;align-items:center;width:100%;height:100%}.input.svelte-f14zo5{width:100%;height:100%;box-sizing:border-box;resize:none;appearance:none;background-color:#fff;border:solid 2px #ccc;border-radius:6px;padding:6px 10px 6px 10px;font-size:12px;line-height:1.5}.input.svelte-f14zo5::placeholder{color:var(--placeholder-color)}.input.svelte-f14zo5:focus{outline:none;border-width:var(--focus-border-width) !important;border-color:var(--focus-border-color) !important;border-style:var(--focus-border-style) !important}.input._error.svelte-f14zo5{outline:none;border-width:var(--error-border-width) !important;border-color:var(--error-border-color) !important;border-style:var(--error-border-style) !important}");
8592
8585
  }
8593
8586
 
8594
8587
  function create_fragment$d(ctx) {
@@ -8619,14 +8612,14 @@ function create_fragment$d(ctx) {
8619
8612
  this.h();
8620
8613
  },
8621
8614
  h() {
8622
- attr(input, "class", input_class_value = "" + (null_to_empty(['input', /*$isValid*/ ctx[5] ? '' : '_error'].join(' ')) + " svelte-17a0wgl"));
8615
+ attr(input, "class", input_class_value = "" + (null_to_empty(['input', /*isValidForUI*/ ctx[3] ? '' : '_error'].join(' ')) + " svelte-f14zo5"));
8623
8616
  attr(input, "type", "text");
8624
- input.value = /*$value*/ ctx[4];
8617
+ input.value = /*$value*/ ctx[2];
8625
8618
  input.required = /*required*/ ctx[0];
8626
8619
  attr(input, "placeholder", /*placeholder*/ ctx[1]);
8627
- attr(input, "style", /*style*/ ctx[3]);
8628
- attr(div, "class", "input-wrapper svelte-17a0wgl");
8629
- attr(div, "style", /*styleVariables*/ ctx[2]);
8620
+ attr(input, "style", /*style*/ ctx[5]);
8621
+ attr(div, "class", "input-wrapper svelte-f14zo5");
8622
+ attr(div, "style", /*styleVariables*/ ctx[4]);
8630
8623
  },
8631
8624
  m(target, anchor) {
8632
8625
  insert_hydration(target, div, anchor);
@@ -8638,12 +8631,12 @@ function create_fragment$d(ctx) {
8638
8631
  }
8639
8632
  },
8640
8633
  p(ctx, [dirty]) {
8641
- if (dirty & /*$isValid*/ 32 && input_class_value !== (input_class_value = "" + (null_to_empty(['input', /*$isValid*/ ctx[5] ? '' : '_error'].join(' ')) + " svelte-17a0wgl"))) {
8634
+ if (dirty & /*isValidForUI*/ 8 && input_class_value !== (input_class_value = "" + (null_to_empty(['input', /*isValidForUI*/ ctx[3] ? '' : '_error'].join(' ')) + " svelte-f14zo5"))) {
8642
8635
  attr(input, "class", input_class_value);
8643
8636
  }
8644
8637
 
8645
- if (dirty & /*$value*/ 16 && input.value !== /*$value*/ ctx[4]) {
8646
- input.value = /*$value*/ ctx[4];
8638
+ if (dirty & /*$value*/ 4 && input.value !== /*$value*/ ctx[2]) {
8639
+ input.value = /*$value*/ ctx[2];
8647
8640
  }
8648
8641
 
8649
8642
  if (dirty & /*required*/ 1) {
@@ -8654,12 +8647,12 @@ function create_fragment$d(ctx) {
8654
8647
  attr(input, "placeholder", /*placeholder*/ ctx[1]);
8655
8648
  }
8656
8649
 
8657
- if (dirty & /*style*/ 8) {
8658
- attr(input, "style", /*style*/ ctx[3]);
8650
+ if (dirty & /*style*/ 32) {
8651
+ attr(input, "style", /*style*/ ctx[5]);
8659
8652
  }
8660
8653
 
8661
- if (dirty & /*styleVariables*/ 4) {
8662
- attr(div, "style", /*styleVariables*/ ctx[2]);
8654
+ if (dirty & /*styleVariables*/ 16) {
8655
+ attr(div, "style", /*styleVariables*/ ctx[4]);
8663
8656
  }
8664
8657
  },
8665
8658
  i: noop,
@@ -8675,8 +8668,9 @@ function create_fragment$d(ctx) {
8675
8668
  function instance$d($$self, $$props, $$invalidate) {
8676
8669
  let style;
8677
8670
  let styleVariables;
8678
- let $value;
8671
+ let isValidForUI;
8679
8672
  let $isValid;
8673
+ let $value;
8680
8674
  let { field = 'email' } = $$props;
8681
8675
 
8682
8676
  let { validation = {
@@ -8687,7 +8681,7 @@ function instance$d($$self, $$props, $$invalidate) {
8687
8681
  flags: ''
8688
8682
  } } = $$props;
8689
8683
 
8690
- let { required = true } = $$props;
8684
+ let { required = false } = $$props;
8691
8685
  let { placeholder = 'メールアドレスを入力' } = $$props;
8692
8686
  let { _style = '' } = $$props;
8693
8687
  let { _focusStyle = 'border-width: 2px; border-color: #2aab9f; border-style: solid' } = $$props;
@@ -8720,8 +8714,8 @@ function instance$d($$self, $$props, $$invalidate) {
8720
8714
  }
8721
8715
  });
8722
8716
 
8723
- component_subscribe($$self, value, value => $$invalidate(4, $value = value));
8724
- component_subscribe($$self, isValid, value => $$invalidate(5, $isValid = value));
8717
+ component_subscribe($$self, value, value => $$invalidate(2, $value = value));
8718
+ component_subscribe($$self, isValid, value => $$invalidate(17, $isValid = value));
8725
8719
 
8726
8720
  function stringInputHandler(event) {
8727
8721
  set_store_value(value, $value = event.target.value, $value);
@@ -8746,11 +8740,11 @@ function instance$d($$self, $$props, $$invalidate) {
8746
8740
  }
8747
8741
 
8748
8742
  if ($$self.$$.dirty & /*_style, _textStyle, font*/ 51200) {
8749
- $$invalidate(3, style = [..._style.split(';'), ..._textStyle.split(';'), `font-family:${font}`].join(';'));
8743
+ $$invalidate(5, style = [..._style.split(';'), ..._textStyle.split(';'), `font-family:${font}`].join(';'));
8750
8744
  }
8751
8745
 
8752
8746
  if ($$self.$$.dirty & /*_focusStyle, _errorStyle, _placeholderStyle*/ 77824) {
8753
- $$invalidate(2, styleVariables = (() => {
8747
+ $$invalidate(4, styleVariables = (() => {
8754
8748
  const variables = {};
8755
8749
  const focusStyleObj = parseStyle(_focusStyle);
8756
8750
  const errorStyleObj = parseStyle(_errorStyle);
@@ -8765,15 +8759,21 @@ function instance$d($$self, $$props, $$invalidate) {
8765
8759
  return stringifyStyleObj(variables);
8766
8760
  })());
8767
8761
  }
8762
+
8763
+ if ($$self.$$.dirty & /*$value, $isValid*/ 131076) {
8764
+ $$invalidate(3, isValidForUI = (() => {
8765
+ return $value === '' || $isValid;
8766
+ })());
8767
+ }
8768
8768
  };
8769
8769
 
8770
8770
  return [
8771
8771
  required,
8772
8772
  placeholder,
8773
+ $value,
8774
+ isValidForUI,
8773
8775
  styleVariables,
8774
8776
  style,
8775
- $value,
8776
- $isValid,
8777
8777
  value,
8778
8778
  isValid,
8779
8779
  stringInputHandler,
@@ -8784,7 +8784,8 @@ function instance$d($$self, $$props, $$invalidate) {
8784
8784
  _errorStyle,
8785
8785
  font,
8786
8786
  _textStyle,
8787
- _placeholderStyle
8787
+ _placeholderStyle,
8788
+ $isValid
8788
8789
  ];
8789
8790
  }
8790
8791
 
package/dist/index.es.js CHANGED
@@ -1792,11 +1792,7 @@ function createModal(App, options = {
1792
1792
  context: { api_key: '' },
1793
1793
  }) {
1794
1794
  let app = null;
1795
- const data = {
1796
- ...options.props,
1797
- ...options.variables,
1798
- ...getVariables(),
1799
- };
1795
+ const data = getVariables();
1800
1796
  const actionProps = {
1801
1797
  send: options.send,
1802
1798
  publish: options.publish,
@@ -2102,21 +2098,14 @@ async function runScript$1(options = {
2102
2098
  }) {
2103
2099
  if (!options.onCreate)
2104
2100
  return;
2105
- let data = {
2106
- ...options.props,
2107
- ...options.variables,
2108
- ...getVariables(),
2109
- };
2101
+ let data = getVariables();
2110
2102
  initialize({ send: options.send, initialState: data.initial_state });
2111
2103
  initActionTable(options.localVariablesQuery);
2112
2104
  const { success } = await setupActionTable(options.localVariablesQuery, data, data.api_key);
2113
2105
  if (!success)
2114
2106
  return;
2115
2107
  // Action Tableの取得結果を反映する
2116
- data = {
2117
- ...data,
2118
- ...getVariables(),
2119
- };
2108
+ data = getVariables();
2120
2109
  const actionProps = {
2121
2110
  send: options.send,
2122
2111
  publish: options.publish,
@@ -2217,11 +2206,11 @@ function create(App, options = {
2217
2206
  karteTemplate: {},
2218
2207
  context: { api_key: '' },
2219
2208
  }) {
2220
- const data = {
2209
+ setVariables({
2221
2210
  ...options.props,
2222
2211
  ...options.variables,
2223
- ...getVariables(),
2224
- };
2212
+ });
2213
+ const data = getVariables();
2225
2214
  const actionProps = {
2226
2215
  send: options.send,
2227
2216
  publish: options.publish,
@@ -2948,6 +2937,7 @@ class StateItem extends SvelteComponent {
2948
2937
  }
2949
2938
  }
2950
2939
 
2940
+ const USER_ID_VARIABLE_NAME = '__karte_form_identify_user_id';
2951
2941
  function isEmpty(value) {
2952
2942
  if (Array.isArray(value)) {
2953
2943
  return value.length === 0;
@@ -3067,6 +3057,9 @@ function submit() {
3067
3057
  const identifyFormData$1 = get(identifyFormData);
3068
3058
  const values = formDataToEventValues(campaignId, formData$1);
3069
3059
  const identifyValues = formDataToIdentifyEventValues(identifyFormData$1);
3060
+ if (Object.keys(identifyValues).length > 0) {
3061
+ identifyValues['user_id'] = getVariables()?.[USER_ID_VARIABLE_NAME];
3062
+ }
3070
3063
  return { values, identifyValues };
3071
3064
  }
3072
3065
  return {};
@@ -6771,7 +6764,7 @@ function instance$j($$self, $$props, $$invalidate) {
6771
6764
  let $value;
6772
6765
  let { name = '' } = $$props;
6773
6766
  let { placeholder = '回答を入力してください' } = $$props;
6774
- let { required = true } = $$props;
6767
+ let { required = false } = $$props;
6775
6768
  let { _style = '' } = $$props;
6776
6769
  let { _focusStyle = 'border-width: 2px; border-color: #2aab9f; border-style: solid' } = $$props;
6777
6770
  let { font = SYSTEM_FONT } = $$props;
@@ -7785,7 +7778,7 @@ class FormCheckBoxes extends SvelteComponent {
7785
7778
  /* src/components/FormRatingButtonsNumber.svelte generated by Svelte v3.53.1 */
7786
7779
 
7787
7780
  function add_css$e(target) {
7788
- append_styles(target, "svelte-18pfy31", ".rating-buttons.svelte-18pfy31{display:flex;justify-content:space-between;align-items:center;width:100%;height:100%}.rating-button.svelte-18pfy31{cursor:pointer;display:flex;justify-content:center;align-items:center;transition:background-color 0.2s, box-shadow 0.2s;appearance:none;background:none;border:none;margin:0;padding:0}");
7781
+ append_styles(target, "svelte-9idbf1", ".rating-buttons.svelte-9idbf1{display:flex;justify-content:space-between;align-items:center;width:100%;height:100%}.rating-button.svelte-9idbf1{cursor:pointer;display:flex;justify-content:center;align-items:center;transition:background-color 0.2s, box-shadow 0.2s;appearance:none;background:none;border:none;margin:0;padding:0}");
7789
7782
  }
7790
7783
 
7791
7784
  function get_each_context$2(ctx, list, i) {
@@ -7794,7 +7787,7 @@ function get_each_context$2(ctx, list, i) {
7794
7787
  return child_ctx;
7795
7788
  }
7796
7789
 
7797
- // (60:2) {#each [...Array(count).keys()].map(i => i + 1) as i}
7790
+ // (64:2) {#each [...Array(count).keys()].map(i => i + 1) as i}
7798
7791
  function create_each_block$2(ctx) {
7799
7792
  let button;
7800
7793
  let t0_value = /*i*/ ctx[12] + "";
@@ -7809,7 +7802,7 @@ function create_each_block$2(ctx) {
7809
7802
  button = element("button");
7810
7803
  t0 = text(t0_value);
7811
7804
  t1 = space();
7812
- attr(button, "class", "rating-button svelte-18pfy31");
7805
+ attr(button, "class", "rating-button svelte-9idbf1");
7813
7806
  attr(button, "style", button_style_value = /*getTextButtonStyle*/ ctx[4](/*i*/ ctx[12] === /*_value*/ ctx[1]));
7814
7807
  },
7815
7808
  m(target, anchor) {
@@ -7858,7 +7851,7 @@ function create_fragment$f(ctx) {
7858
7851
  each_blocks[i].c();
7859
7852
  }
7860
7853
 
7861
- attr(div, "class", "rating-buttons svelte-18pfy31");
7854
+ attr(div, "class", "rating-buttons svelte-9idbf1");
7862
7855
  },
7863
7856
  m(target, anchor) {
7864
7857
  insert(target, div, anchor);
@@ -7933,7 +7926,7 @@ function instance$f($$self, $$props, $$invalidate) {
7933
7926
  return [
7934
7927
  ...buttonStyle.split(';'),
7935
7928
  `font-family:${font}`,
7936
- ...isActive ? buttonActiveStyle : []
7929
+ ...isActive ? buttonActiveStyle.split(';') : []
7937
7930
  ].join(';');
7938
7931
  }
7939
7932
 
@@ -8181,7 +8174,7 @@ class FormRatingButtonsFace extends SvelteComponent {
8181
8174
  /* src/components/FormIdentifyInput.svelte generated by Svelte v3.53.1 */
8182
8175
 
8183
8176
  function add_css$c(target) {
8184
- append_styles(target, "svelte-17a0wgl", ".input-wrapper.svelte-17a0wgl{display:flex;align-items:center;width:100%;height:100%}.input.svelte-17a0wgl{width:100%;height:100%;box-sizing:border-box;resize:none;appearance:none;background-color:#fff;border:solid 2px #ccc;border-radius:6px;padding:6px 10px 6px 10px;font-size:12px;line-height:1.5}.input.svelte-17a0wgl::placeholder{color:var(--placeholder-color)}.input.svelte-17a0wgl:focus{outline:none;border-width:var(--focus-border-width) !important;border-color:var(--focus-border-color) !important;border-style:var(--focus-border-style) !important}.input._error.svelte-17a0wgl{outline:none;border-width:var(--error-border-width) !important;border-color:var(--error-border-color) !important;border-style:var(--error-border-style) !important}");
8177
+ append_styles(target, "svelte-f14zo5", ".input-wrapper.svelte-f14zo5{display:flex;align-items:center;width:100%;height:100%}.input.svelte-f14zo5{width:100%;height:100%;box-sizing:border-box;resize:none;appearance:none;background-color:#fff;border:solid 2px #ccc;border-radius:6px;padding:6px 10px 6px 10px;font-size:12px;line-height:1.5}.input.svelte-f14zo5::placeholder{color:var(--placeholder-color)}.input.svelte-f14zo5:focus{outline:none;border-width:var(--focus-border-width) !important;border-color:var(--focus-border-color) !important;border-style:var(--focus-border-style) !important}.input._error.svelte-f14zo5{outline:none;border-width:var(--error-border-width) !important;border-color:var(--error-border-color) !important;border-style:var(--error-border-style) !important}");
8185
8178
  }
8186
8179
 
8187
8180
  function create_fragment$d(ctx) {
@@ -8195,14 +8188,14 @@ function create_fragment$d(ctx) {
8195
8188
  c() {
8196
8189
  div = element("div");
8197
8190
  input = element("input");
8198
- attr(input, "class", input_class_value = "" + (null_to_empty(['input', /*$isValid*/ ctx[5] ? '' : '_error'].join(' ')) + " svelte-17a0wgl"));
8191
+ attr(input, "class", input_class_value = "" + (null_to_empty(['input', /*isValidForUI*/ ctx[3] ? '' : '_error'].join(' ')) + " svelte-f14zo5"));
8199
8192
  attr(input, "type", "text");
8200
- input.value = /*$value*/ ctx[4];
8193
+ input.value = /*$value*/ ctx[2];
8201
8194
  input.required = /*required*/ ctx[0];
8202
8195
  attr(input, "placeholder", /*placeholder*/ ctx[1]);
8203
- attr(input, "style", /*style*/ ctx[3]);
8204
- attr(div, "class", "input-wrapper svelte-17a0wgl");
8205
- attr(div, "style", /*styleVariables*/ ctx[2]);
8196
+ attr(input, "style", /*style*/ ctx[5]);
8197
+ attr(div, "class", "input-wrapper svelte-f14zo5");
8198
+ attr(div, "style", /*styleVariables*/ ctx[4]);
8206
8199
  },
8207
8200
  m(target, anchor) {
8208
8201
  insert(target, div, anchor);
@@ -8214,12 +8207,12 @@ function create_fragment$d(ctx) {
8214
8207
  }
8215
8208
  },
8216
8209
  p(ctx, [dirty]) {
8217
- if (dirty & /*$isValid*/ 32 && input_class_value !== (input_class_value = "" + (null_to_empty(['input', /*$isValid*/ ctx[5] ? '' : '_error'].join(' ')) + " svelte-17a0wgl"))) {
8210
+ if (dirty & /*isValidForUI*/ 8 && input_class_value !== (input_class_value = "" + (null_to_empty(['input', /*isValidForUI*/ ctx[3] ? '' : '_error'].join(' ')) + " svelte-f14zo5"))) {
8218
8211
  attr(input, "class", input_class_value);
8219
8212
  }
8220
8213
 
8221
- if (dirty & /*$value*/ 16 && input.value !== /*$value*/ ctx[4]) {
8222
- input.value = /*$value*/ ctx[4];
8214
+ if (dirty & /*$value*/ 4 && input.value !== /*$value*/ ctx[2]) {
8215
+ input.value = /*$value*/ ctx[2];
8223
8216
  }
8224
8217
 
8225
8218
  if (dirty & /*required*/ 1) {
@@ -8230,12 +8223,12 @@ function create_fragment$d(ctx) {
8230
8223
  attr(input, "placeholder", /*placeholder*/ ctx[1]);
8231
8224
  }
8232
8225
 
8233
- if (dirty & /*style*/ 8) {
8234
- attr(input, "style", /*style*/ ctx[3]);
8226
+ if (dirty & /*style*/ 32) {
8227
+ attr(input, "style", /*style*/ ctx[5]);
8235
8228
  }
8236
8229
 
8237
- if (dirty & /*styleVariables*/ 4) {
8238
- attr(div, "style", /*styleVariables*/ ctx[2]);
8230
+ if (dirty & /*styleVariables*/ 16) {
8231
+ attr(div, "style", /*styleVariables*/ ctx[4]);
8239
8232
  }
8240
8233
  },
8241
8234
  i: noop,
@@ -8251,8 +8244,9 @@ function create_fragment$d(ctx) {
8251
8244
  function instance$d($$self, $$props, $$invalidate) {
8252
8245
  let style;
8253
8246
  let styleVariables;
8254
- let $value;
8247
+ let isValidForUI;
8255
8248
  let $isValid;
8249
+ let $value;
8256
8250
  let { field = 'email' } = $$props;
8257
8251
 
8258
8252
  let { validation = {
@@ -8263,7 +8257,7 @@ function instance$d($$self, $$props, $$invalidate) {
8263
8257
  flags: ''
8264
8258
  } } = $$props;
8265
8259
 
8266
- let { required = true } = $$props;
8260
+ let { required = false } = $$props;
8267
8261
  let { placeholder = 'メールアドレスを入力' } = $$props;
8268
8262
  let { _style = '' } = $$props;
8269
8263
  let { _focusStyle = 'border-width: 2px; border-color: #2aab9f; border-style: solid' } = $$props;
@@ -8296,8 +8290,8 @@ function instance$d($$self, $$props, $$invalidate) {
8296
8290
  }
8297
8291
  });
8298
8292
 
8299
- component_subscribe($$self, value, value => $$invalidate(4, $value = value));
8300
- component_subscribe($$self, isValid, value => $$invalidate(5, $isValid = value));
8293
+ component_subscribe($$self, value, value => $$invalidate(2, $value = value));
8294
+ component_subscribe($$self, isValid, value => $$invalidate(17, $isValid = value));
8301
8295
 
8302
8296
  function stringInputHandler(event) {
8303
8297
  set_store_value(value, $value = event.target.value, $value);
@@ -8322,11 +8316,11 @@ function instance$d($$self, $$props, $$invalidate) {
8322
8316
  }
8323
8317
 
8324
8318
  if ($$self.$$.dirty & /*_style, _textStyle, font*/ 51200) {
8325
- $$invalidate(3, style = [..._style.split(';'), ..._textStyle.split(';'), `font-family:${font}`].join(';'));
8319
+ $$invalidate(5, style = [..._style.split(';'), ..._textStyle.split(';'), `font-family:${font}`].join(';'));
8326
8320
  }
8327
8321
 
8328
8322
  if ($$self.$$.dirty & /*_focusStyle, _errorStyle, _placeholderStyle*/ 77824) {
8329
- $$invalidate(2, styleVariables = (() => {
8323
+ $$invalidate(4, styleVariables = (() => {
8330
8324
  const variables = {};
8331
8325
  const focusStyleObj = parseStyle(_focusStyle);
8332
8326
  const errorStyleObj = parseStyle(_errorStyle);
@@ -8341,15 +8335,21 @@ function instance$d($$self, $$props, $$invalidate) {
8341
8335
  return stringifyStyleObj(variables);
8342
8336
  })());
8343
8337
  }
8338
+
8339
+ if ($$self.$$.dirty & /*$value, $isValid*/ 131076) {
8340
+ $$invalidate(3, isValidForUI = (() => {
8341
+ return $value === '' || $isValid;
8342
+ })());
8343
+ }
8344
8344
  };
8345
8345
 
8346
8346
  return [
8347
8347
  required,
8348
8348
  placeholder,
8349
+ $value,
8350
+ isValidForUI,
8349
8351
  styleVariables,
8350
8352
  style,
8351
- $value,
8352
- $isValid,
8353
8353
  value,
8354
8354
  isValid,
8355
8355
  stringInputHandler,
@@ -8360,7 +8360,8 @@ function instance$d($$self, $$props, $$invalidate) {
8360
8360
  _errorStyle,
8361
8361
  font,
8362
8362
  _textStyle,
8363
- _placeholderStyle
8363
+ _placeholderStyle,
8364
+ $isValid
8364
8365
  ];
8365
8366
  }
8366
8367
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaidev/karte-action-sdk",
3
- "version": "1.1.213",
3
+ "version": "1.1.216",
4
4
  "author": "Plaid Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "module": "./dist/index.es.js",