@plaidev/karte-action-sdk 1.0.41 → 1.0.42

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.
@@ -2,25 +2,6 @@
2
2
  * UIから選択できる関数
3
3
  */
4
4
  import { Writable } from "svelte/store";
5
- type OPTIONS = {
6
- send?: (event_name: string, values?: any) => void;
7
- isPreview?: boolean;
8
- initialState?: string;
9
- };
10
- declare const state: Writable<string>;
11
- declare const closed: Writable<boolean>;
12
- declare const maximumZindex: Writable<number>;
13
- declare const initialize: (options?: OPTIONS) => () => void;
14
- declare const finalize: () => void;
15
- declare const send_event: (event_name: string, values?: any) => void;
16
- declare const isPreview: () => boolean;
17
- declare const setMiximumZindex: (zindex?: number) => void;
18
- // eslint-disable-next-line @typescript-eslint/no-empty-function
19
- declare const none: () => () => void;
20
- declare const moveTo: (to: string) => () => void;
21
- declare const linkTo: (to: string, targetBlank?: boolean) => () => void;
22
- declare const closeApp: () => () => void;
23
- declare const _default: "dummy";
24
5
  declare const PropTypes: readonly [
25
6
  "BooleanKeyword",
26
7
  "NumberKeyword",
@@ -37,7 +18,9 @@ declare const PropTypes: readonly [
37
18
  "Color",
38
19
  "Alignment",
39
20
  "State",
40
- "Style"
21
+ "Style",
22
+ "ModalPlacement",
23
+ "OnClick"
41
24
  ];
42
25
  type PropType = typeof PropTypes[number];
43
26
  type Code = string;
@@ -171,6 +154,96 @@ type ModalPlacement<M = ModalMargin> = {
171
154
  backgroundOverlay?: boolean;
172
155
  };
173
156
  declare const DefaultModalPlacement: Required<ModalPlacement<Required<ModalMargin>>>;
157
+ type I18nLabel<Locale extends string = "ja" | "en"> = {
158
+ [K in Locale]?: string;
159
+ };
160
+ type BaseOperationOptions = ReadonlyArray<{
161
+ name: I18nLabel;
162
+ operation: string;
163
+ args: ReadonlyArray<{
164
+ name: I18nLabel;
165
+ type: keyof OperationArgumentTypes;
166
+ default: any;
167
+ }>;
168
+ }>;
169
+ type OperationArgumentTypes = {
170
+ StringKeyword: string;
171
+ BooleanKeyword: boolean;
172
+ NumberKeyword: number;
173
+ State: string;
174
+ };
175
+ type ConvertOperationOptions<O extends BaseOperationOptions> = ConvertOperationOption<O[number]>;
176
+ type ConvertOperationOption<Option extends BaseOperationOptions[number]> = Option extends any ? {
177
+ operation: Option["operation"];
178
+ args: ConvertOperationOptionArguments<Option["args"]>;
179
+ } : never;
180
+ type ConvertOperationOptionArguments<Arguments extends BaseOperationOptions[number]["args"]> = {
181
+ -readonly [Index in keyof Arguments]: Arguments[Index] extends BaseOperationOptions[number]["args"][number] ? OperationArgumentTypes[Arguments[Index]["type"]] : never;
182
+ };
183
+ type Operation = ConvertOperationOptions<ReadonlyArray<any>>;
184
+ declare const OnClickOperationOptions: readonly [
185
+ {
186
+ readonly name: {
187
+ readonly ja: "\u64CD\u4F5C\u306A\u3057";
188
+ readonly en: "No Operation";
189
+ };
190
+ readonly operation: "none";
191
+ readonly args: readonly [
192
+ ];
193
+ },
194
+ {
195
+ readonly name: {
196
+ readonly ja: "\u30EA\u30F3\u30AF\u9077\u79FB";
197
+ readonly en: "Link To";
198
+ };
199
+ readonly operation: "linkTo";
200
+ readonly args: readonly [
201
+ {
202
+ readonly name: {
203
+ readonly ja: "URL\u3092\u5165\u529B";
204
+ readonly en: "Enter URL";
205
+ };
206
+ readonly type: "StringKeyword";
207
+ readonly default: "";
208
+ },
209
+ {
210
+ readonly name: {
211
+ readonly ja: "\u65B0\u3057\u3044\u30BF\u30D6\u3067\u958B\u304F";
212
+ readonly en: "Open in new tab";
213
+ };
214
+ readonly type: "BooleanKeyword";
215
+ readonly default: true;
216
+ }
217
+ ];
218
+ },
219
+ {
220
+ readonly name: {
221
+ readonly ja: "\u30B9\u30C6\u30FC\u30C8\u9077\u79FB";
222
+ readonly en: "Move To";
223
+ };
224
+ readonly operation: "moveTo";
225
+ readonly args: readonly [
226
+ {
227
+ readonly name: {
228
+ readonly ja: "\u30B9\u30C6\u30FC\u30C8\u3092\u9078\u629E";
229
+ readonly en: "State";
230
+ };
231
+ readonly type: "State";
232
+ readonly default: "/";
233
+ }
234
+ ];
235
+ },
236
+ {
237
+ readonly name: {
238
+ readonly ja: "\u9589\u3058\u308B";
239
+ readonly en: "Close";
240
+ };
241
+ readonly operation: "closeApp";
242
+ readonly args: readonly [
243
+ ];
244
+ }
245
+ ];
246
+ type OnClickOperation = ConvertOperationOptions<typeof OnClickOperationOptions>;
174
247
  type LongText = string;
175
248
  type Url = string;
176
249
  type Image = string;
@@ -218,6 +291,26 @@ declare const BackgroundSizes: readonly [
218
291
  type BackgroundSize = typeof BackgroundSizes[number];
219
292
  type Style = string;
220
293
  type StateName = string;
294
+ type OPTIONS = {
295
+ send?: (event_name: string, values?: any) => void;
296
+ isPreview?: boolean;
297
+ initialState?: string;
298
+ };
299
+ declare const state: Writable<string>;
300
+ declare const closed: Writable<boolean>;
301
+ declare const maximumZindex: Writable<number>;
302
+ declare const initialize: (options?: OPTIONS) => () => void;
303
+ declare const finalize: () => void;
304
+ declare const send_event: (event_name: string, values?: any) => void;
305
+ declare const isPreview: () => boolean;
306
+ declare const setMiximumZindex: (zindex?: number) => void;
307
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
308
+ declare const none: () => () => void;
309
+ declare const moveTo: (to: string) => () => void;
310
+ declare const linkTo: (to: string, targetBlank?: boolean) => () => void;
311
+ declare const closeApp: () => () => void;
312
+ declare const execOnClickOperation: (onClickOperation: OnClickOperation) => void;
313
+ declare const _default: "dummy";
221
314
  declare const handleFocus: (node: HTMLElement | null) => (e: any) => void;
222
315
  declare const setPreviousFocus: () => void;
223
316
  declare const handleKeydown: (handlers: {
@@ -275,7 +368,7 @@ declare const collection: (config: {
275
368
  } | null | undefined, cb: (err: Error | null, items?: any) => void): void;
276
369
  set(key: string, value: string, cb: (err: Error | null) => void): void;
277
370
  };
278
- export { state, closed, maximumZindex, initialize, finalize, send_event, isPreview, setMiximumZindex, none, moveTo, linkTo, closeApp, _default, handleFocus, setPreviousFocus, handleKeydown, getPositionStyle, getMarginStyle, onScroll, onTime, hasSuffix, toBr, randStr, PropTypes, PropType, Code, MediaQueries, MediaQuery, Directions, Direction, AnimationStyles, AnimationStyle, AnimationStyleTranslations, ModalPositions, ModalPosition, ModalPositionTranslations, ModalMarginTranslations, ModalMargin, ModalPlacement, DefaultModalPlacement, LongText, Url, Image, LengthUnits, LengthUnit, Length, Color, Justifies, Justify, Alignments, Alignment, ObjectFits, ObjectFit, Repeats, Repeat, BackgroundSizes, BackgroundSize, Style, StateName, hideOnScroll, hideOnTime, showOnScroll, showOnTime, ensureModalRoot, h, createFog, EmbedLogic, embed, collection };
371
+ export { state, closed, maximumZindex, initialize, finalize, send_event, isPreview, setMiximumZindex, none, moveTo, linkTo, closeApp, execOnClickOperation, _default, handleFocus, setPreviousFocus, handleKeydown, getPositionStyle, getMarginStyle, onScroll, onTime, hasSuffix, toBr, randStr, PropTypes, PropType, Code, MediaQueries, MediaQuery, Directions, Direction, AnimationStyles, AnimationStyle, AnimationStyleTranslations, ModalPositions, ModalPosition, ModalPositionTranslations, ModalMarginTranslations, ModalMargin, ModalPlacement, DefaultModalPlacement, Operation, OnClickOperationOptions, OnClickOperation, LongText, Url, Image, LengthUnits, LengthUnit, Length, Color, Justifies, Justify, Alignments, Alignment, ObjectFits, ObjectFit, Repeats, Repeat, BackgroundSizes, BackgroundSize, Style, StateName, hideOnScroll, hideOnTime, showOnScroll, showOnTime, ensureModalRoot, h, createFog, EmbedLogic, embed, collection };
279
372
  export { default as State } from './components/State.svelte';
280
373
  export { default as StateItem } from './components/StateItem.svelte';
281
374
  export { default as Modal } from './components/Modal.svelte';
package/dist/index.es.js CHANGED
@@ -162,6 +162,17 @@ const closeApp = () => () => {
162
162
  send_event('message_close', null);
163
163
  closed.set(true);
164
164
  };
165
+ const execOnClickOperation = (onClickOperation) => {
166
+ if (onClickOperation.operation === 'linkTo') {
167
+ linkTo(...onClickOperation.args)();
168
+ }
169
+ else if (onClickOperation.operation === 'moveTo') {
170
+ moveTo(...onClickOperation.args)();
171
+ }
172
+ else if (onClickOperation.operation === 'closeApp') {
173
+ closeApp()();
174
+ }
175
+ };
165
176
 
166
177
  const PropTypes = [
167
178
  'BooleanKeyword',
@@ -180,6 +191,8 @@ const PropTypes = [
180
191
  'Alignment',
181
192
  'State',
182
193
  'Style',
194
+ 'ModalPlacement',
195
+ 'OnClick',
183
196
  ];
184
197
  const MediaQueries = {
185
198
  PC: '(\\s*min-width\\s*:\\s*1025px\\s*)',
@@ -304,6 +317,27 @@ const DefaultModalPlacement = {
304
317
  },
305
318
  backgroundOverlay: false,
306
319
  };
320
+ const OnClickOperationOptions = [
321
+ { name: { ja: '操作なし', en: 'No Operation' }, operation: 'none', args: [] },
322
+ {
323
+ name: { ja: 'リンク遷移', en: 'Link To' },
324
+ operation: 'linkTo',
325
+ args: [
326
+ { name: { ja: 'URLを入力', en: 'Enter URL' }, type: 'StringKeyword', default: '' },
327
+ {
328
+ name: { ja: '新しいタブで開く', en: 'Open in new tab' },
329
+ type: 'BooleanKeyword',
330
+ default: true,
331
+ },
332
+ ],
333
+ },
334
+ {
335
+ name: { ja: 'ステート遷移', en: 'Move To' },
336
+ operation: 'moveTo',
337
+ args: [{ name: { ja: 'ステートを選択', en: 'State' }, type: 'State', default: '/' }],
338
+ },
339
+ { name: { ja: '閉じる', en: 'Close' }, operation: 'closeApp', args: [] },
340
+ ];
307
341
  const LengthUnits = ['px', 'em', 'rem', 'vw', 'fr', '%'];
308
342
  const Justifies = ['flex-start', 'center', 'flex-end'];
309
343
  const Alignments = ['flex-start', 'center', 'flex-end'];
@@ -873,7 +907,7 @@ function add_css$6(target) {
873
907
  append_styles(target, "svelte-1bxl6mz", ".modal.svelte-1bxl6mz{position:fixed;box-sizing:border-box;z-index:2147483647}.close.svelte-1bxl6mz{position:absolute;display:flex;justify-content:center;align-items:center;background-color:transparent;border:none;cursor:pointer;padding:0;transition:all 0.25s}.close.svelte-1bxl6mz:hover{transform:rotate(90deg)}");
874
908
  }
875
909
 
876
- // (130:4) {#if closable}
910
+ // (148:4) {#if closable}
877
911
  function create_if_block(ctx) {
878
912
  let button;
879
913
  let svg;
@@ -925,7 +959,7 @@ function create_if_block(ctx) {
925
959
  };
926
960
  }
927
961
 
928
- // (117:0) <Animation {animation}>
962
+ // (135:0) <Animation {animation}>
929
963
  function create_default_slot$1(ctx) {
930
964
  let div;
931
965
  let t;
@@ -934,8 +968,8 @@ function create_default_slot$1(ctx) {
934
968
  let mounted;
935
969
  let dispose;
936
970
  let if_block = /*closable*/ ctx[2] && create_if_block(ctx);
937
- const default_slot_template = /*#slots*/ ctx[20].default;
938
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[22], null);
971
+ const default_slot_template = /*#slots*/ ctx[22].default;
972
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[24], null);
939
973
 
940
974
  return {
941
975
  c() {
@@ -957,7 +991,7 @@ function create_default_slot$1(ctx) {
957
991
  default_slot.m(div, null);
958
992
  }
959
993
 
960
- /*div_binding*/ ctx[21](div);
994
+ /*div_binding*/ ctx[23](div);
961
995
  current = true;
962
996
 
963
997
  if (!mounted) {
@@ -980,15 +1014,15 @@ function create_default_slot$1(ctx) {
980
1014
  }
981
1015
 
982
1016
  if (default_slot) {
983
- if (default_slot.p && (!current || dirty & /*$$scope*/ 4194304)) {
1017
+ if (default_slot.p && (!current || dirty & /*$$scope*/ 16777216)) {
984
1018
  update_slot_base(
985
1019
  default_slot,
986
1020
  default_slot_template,
987
1021
  ctx,
988
- /*$$scope*/ ctx[22],
1022
+ /*$$scope*/ ctx[24],
989
1023
  !current
990
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[22])
991
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[22], dirty, null),
1024
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[24])
1025
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[24], dirty, null),
992
1026
  null
993
1027
  );
994
1028
  }
@@ -1011,7 +1045,7 @@ function create_default_slot$1(ctx) {
1011
1045
  if (detaching) detach(div);
1012
1046
  if (if_block) if_block.d();
1013
1047
  if (default_slot) default_slot.d(detaching);
1014
- /*div_binding*/ ctx[21](null);
1048
+ /*div_binding*/ ctx[23](null);
1015
1049
  mounted = false;
1016
1050
  dispose();
1017
1051
  }
@@ -1066,7 +1100,7 @@ function create_fragment$8(ctx) {
1066
1100
  const animation_1_changes = {};
1067
1101
  if (dirty & /*animation*/ 1) animation_1_changes.animation = /*animation*/ ctx[0];
1068
1102
 
1069
- if (dirty & /*$$scope, pos, marginStyle, _style, modal, $maximumZindex, _closeStyle, closeButtonColor, closable*/ 4195070) {
1103
+ if (dirty & /*$$scope, pos, marginStyle, _style, modal, $maximumZindex, _closeStyle, closeButtonColor, closable*/ 16777982) {
1070
1104
  animation_1_changes.$$scope = { dirty, ctx };
1071
1105
  }
1072
1106
 
@@ -1102,6 +1136,11 @@ function instance$8($$self, $$props, $$invalidate) {
1102
1136
  let $maximumZindex;
1103
1137
  component_subscribe($$self, maximumZindex, $$value => $$invalidate(9, $maximumZindex = $$value));
1104
1138
  let { $$slots: slots = {}, $$scope } = $$props;
1139
+ let { onClick = { operation: 'none', args: [] } } = $$props;
1140
+
1141
+ /**
1142
+ * {"hidden": true}
1143
+ */
1105
1144
  const dispatchClick = createEventDispatcher();
1106
1145
 
1107
1146
  const click = () => {
@@ -1109,7 +1148,11 @@ function instance$8($$self, $$props, $$invalidate) {
1109
1148
  send_event(clickEventName, clickEventValue);
1110
1149
  }
1111
1150
 
1112
- dispatchClick('click');
1151
+ if (onClick.operation !== 'none') {
1152
+ execOnClickOperation(onClick);
1153
+ } else {
1154
+ dispatchClick('click');
1155
+ }
1113
1156
  };
1114
1157
 
1115
1158
  let { clickEventName = '' } = $$props;
@@ -1118,12 +1161,10 @@ function instance$8($$self, $$props, $$invalidate) {
1118
1161
  let { animation = 'none' } = $$props;
1119
1162
  let { _style = '' } = $$props;
1120
1163
  let { closable = true } = $$props;
1164
+ let { onClose = { operation: 'none', args: [] } } = $$props;
1121
1165
 
1122
1166
  /**
1123
- * {
1124
- * "title": {"ja": "タイプ", "en": "Type"},
1125
- * "folder": {"ja": "閉じるボタン", "en": "Close Button"}
1126
- * }
1167
+ * {"hidden": true}
1127
1168
  */
1128
1169
  const dispatchClose = createEventDispatcher();
1129
1170
 
@@ -1132,7 +1173,11 @@ function instance$8($$self, $$props, $$invalidate) {
1132
1173
  send_event(closeEventName, closeEventValue);
1133
1174
  }
1134
1175
 
1135
- dispatchClose('close');
1176
+ if (onClose.operation !== 'none') {
1177
+ execOnClickOperation(onClose);
1178
+ } else {
1179
+ dispatchClose('close');
1180
+ }
1136
1181
  };
1137
1182
 
1138
1183
  let { closeButtonColor = '#000000' } = $$props;
@@ -1151,36 +1196,38 @@ function instance$8($$self, $$props, $$invalidate) {
1151
1196
  }
1152
1197
 
1153
1198
  $$self.$$set = $$props => {
1154
- if ('clickEventName' in $$props) $$invalidate(13, clickEventName = $$props.clickEventName);
1155
- if ('clickEventValue' in $$props) $$invalidate(14, clickEventValue = $$props.clickEventValue);
1156
- if ('placement' in $$props) $$invalidate(15, placement = $$props.placement);
1199
+ if ('onClick' in $$props) $$invalidate(13, onClick = $$props.onClick);
1200
+ if ('clickEventName' in $$props) $$invalidate(14, clickEventName = $$props.clickEventName);
1201
+ if ('clickEventValue' in $$props) $$invalidate(15, clickEventValue = $$props.clickEventValue);
1202
+ if ('placement' in $$props) $$invalidate(16, placement = $$props.placement);
1157
1203
  if ('animation' in $$props) $$invalidate(0, animation = $$props.animation);
1158
1204
  if ('_style' in $$props) $$invalidate(1, _style = $$props._style);
1159
1205
  if ('closable' in $$props) $$invalidate(2, closable = $$props.closable);
1206
+ if ('onClose' in $$props) $$invalidate(17, onClose = $$props.onClose);
1160
1207
  if ('closeButtonColor' in $$props) $$invalidate(3, closeButtonColor = $$props.closeButtonColor);
1161
- if ('closeEventName' in $$props) $$invalidate(16, closeEventName = $$props.closeEventName);
1162
- if ('closeEventValue' in $$props) $$invalidate(17, closeEventValue = $$props.closeEventValue);
1208
+ if ('closeEventName' in $$props) $$invalidate(18, closeEventName = $$props.closeEventName);
1209
+ if ('closeEventValue' in $$props) $$invalidate(19, closeEventValue = $$props.closeEventValue);
1163
1210
  if ('_closeStyle' in $$props) $$invalidate(4, _closeStyle = $$props._closeStyle);
1164
- if ('$$scope' in $$props) $$invalidate(22, $$scope = $$props.$$scope);
1211
+ if ('$$scope' in $$props) $$invalidate(24, $$scope = $$props.$$scope);
1165
1212
  };
1166
1213
 
1167
1214
  $$self.$$.update = () => {
1168
- if ($$self.$$.dirty & /*placement*/ 32768) {
1215
+ if ($$self.$$.dirty & /*placement*/ 65536) {
1169
1216
  $$invalidate(8, backgroundOverray = placement && placement.backgroundOverlay != null
1170
1217
  ? placement.backgroundOverlay
1171
1218
  : DefaultModalPlacement.backgroundOverlay);
1172
1219
  }
1173
1220
 
1174
- if ($$self.$$.dirty & /*placement*/ 32768) {
1175
- $$invalidate(19, overwritePosition = isPreview()
1221
+ if ($$self.$$.dirty & /*placement*/ 65536) {
1222
+ $$invalidate(21, overwritePosition = isPreview()
1176
1223
  ? 'center'
1177
1224
  : placement && placement.position != null
1178
1225
  ? placement.position
1179
1226
  : DefaultModalPlacement.position);
1180
1227
  }
1181
1228
 
1182
- if ($$self.$$.dirty & /*placement*/ 32768) {
1183
- $$invalidate(18, overwriteMargin = isPreview()
1229
+ if ($$self.$$.dirty & /*placement*/ 65536) {
1230
+ $$invalidate(20, overwriteMargin = isPreview()
1184
1231
  ? {
1185
1232
  left: '0px',
1186
1233
  right: '0px',
@@ -1192,11 +1239,11 @@ function instance$8($$self, $$props, $$invalidate) {
1192
1239
  : DefaultModalPlacement.margin);
1193
1240
  }
1194
1241
 
1195
- if ($$self.$$.dirty & /*overwritePosition*/ 524288) {
1242
+ if ($$self.$$.dirty & /*overwritePosition*/ 2097152) {
1196
1243
  $$invalidate(7, pos = getPositionStyle(overwritePosition));
1197
1244
  }
1198
1245
 
1199
- if ($$self.$$.dirty & /*overwriteMargin*/ 262144) {
1246
+ if ($$self.$$.dirty & /*overwriteMargin*/ 1048576) {
1200
1247
  $$invalidate(6, marginStyle = getMarginStyle(overwriteMargin));
1201
1248
  }
1202
1249
  };
@@ -1215,9 +1262,11 @@ function instance$8($$self, $$props, $$invalidate) {
1215
1262
  click,
1216
1263
  close,
1217
1264
  handle_keydown,
1265
+ onClick,
1218
1266
  clickEventName,
1219
1267
  clickEventValue,
1220
1268
  placement,
1269
+ onClose,
1221
1270
  closeEventName,
1222
1271
  closeEventValue,
1223
1272
  overwriteMargin,
@@ -1239,15 +1288,17 @@ class Modal extends SvelteComponent {
1239
1288
  create_fragment$8,
1240
1289
  safe_not_equal,
1241
1290
  {
1242
- clickEventName: 13,
1243
- clickEventValue: 14,
1244
- placement: 15,
1291
+ onClick: 13,
1292
+ clickEventName: 14,
1293
+ clickEventValue: 15,
1294
+ placement: 16,
1245
1295
  animation: 0,
1246
1296
  _style: 1,
1247
1297
  closable: 2,
1298
+ onClose: 17,
1248
1299
  closeButtonColor: 3,
1249
- closeEventName: 16,
1250
- closeEventValue: 17,
1300
+ closeEventName: 18,
1301
+ closeEventValue: 19,
1251
1302
  _closeStyle: 4
1252
1303
  },
1253
1304
  add_css$6
@@ -2178,12 +2229,10 @@ function create_fragment$1(ctx) {
2178
2229
 
2179
2230
  function instance$1($$self, $$props, $$invalidate) {
2180
2231
  let { text = 'ボタンラベル' } = $$props;
2232
+ let { onClick = { operation: 'none', args: [] } } = $$props;
2181
2233
 
2182
2234
  /**
2183
- * {
2184
- * "title": {"ja": "タイプ", "en": "Type"},
2185
- * "folder": {"ja": "クリック時の動作", "en": "Behavior to Click"}
2186
- * }
2235
+ * {"hidden": true}
2187
2236
  */
2188
2237
  const dispatch = createEventDispatcher();
2189
2238
 
@@ -2192,7 +2241,11 @@ function instance$1($$self, $$props, $$invalidate) {
2192
2241
  send_event(eventName);
2193
2242
  }
2194
2243
 
2195
- dispatch('click');
2244
+ if (onClick.operation !== 'none') {
2245
+ execOnClickOperation(onClick);
2246
+ } else {
2247
+ dispatch('click');
2248
+ }
2196
2249
  };
2197
2250
 
2198
2251
  let { eventName = '' } = $$props;
@@ -2201,12 +2254,13 @@ function instance$1($$self, $$props, $$invalidate) {
2201
2254
 
2202
2255
  $$self.$$set = $$props => {
2203
2256
  if ('text' in $$props) $$invalidate(0, text = $$props.text);
2204
- if ('eventName' in $$props) $$invalidate(4, eventName = $$props.eventName);
2257
+ if ('onClick' in $$props) $$invalidate(4, onClick = $$props.onClick);
2258
+ if ('eventName' in $$props) $$invalidate(5, eventName = $$props.eventName);
2205
2259
  if ('_buttonStyle' in $$props) $$invalidate(1, _buttonStyle = $$props._buttonStyle);
2206
2260
  if ('_style' in $$props) $$invalidate(2, _style = $$props._style);
2207
2261
  };
2208
2262
 
2209
- return [text, _buttonStyle, _style, click, eventName];
2263
+ return [text, _buttonStyle, _style, click, onClick, eventName];
2210
2264
  }
2211
2265
 
2212
2266
  class TextButtonBlock extends SvelteComponent {
@@ -2221,7 +2275,8 @@ class TextButtonBlock extends SvelteComponent {
2221
2275
  safe_not_equal,
2222
2276
  {
2223
2277
  text: 0,
2224
- eventName: 4,
2278
+ onClick: 4,
2279
+ eventName: 5,
2225
2280
  _buttonStyle: 1,
2226
2281
  _style: 2
2227
2282
  },
@@ -2302,12 +2357,10 @@ function instance($$self, $$props, $$invalidate) {
2302
2357
  let { src = 'https://admin.karte.io/action-editor2/public/images/no_image_en.svg' } = $$props;
2303
2358
  let { alt = 'No Image' } = $$props;
2304
2359
  let { transport = false } = $$props;
2360
+ let { onClick = { operation: 'none', args: [] } } = $$props;
2305
2361
 
2306
2362
  /**
2307
- * {
2308
- * "title": {"ja": "タイプ", "en": "Type"},
2309
- * "folder": {"ja": "クリック時の動作", "en": "Behavior to Click"}
2310
- * }
2363
+ * {"hidden": true}
2311
2364
  */
2312
2365
  const dispatch = createEventDispatcher();
2313
2366
 
@@ -2316,7 +2369,11 @@ function instance($$self, $$props, $$invalidate) {
2316
2369
  send_event(eventName);
2317
2370
  }
2318
2371
 
2319
- dispatch('click');
2372
+ if (onClick.operation !== 'none') {
2373
+ execOnClickOperation(onClick);
2374
+ } else {
2375
+ dispatch('click');
2376
+ }
2320
2377
  };
2321
2378
 
2322
2379
  let { eventName = '' } = $$props;
@@ -2327,12 +2384,13 @@ function instance($$self, $$props, $$invalidate) {
2327
2384
  if ('src' in $$props) $$invalidate(0, src = $$props.src);
2328
2385
  if ('alt' in $$props) $$invalidate(1, alt = $$props.alt);
2329
2386
  if ('transport' in $$props) $$invalidate(2, transport = $$props.transport);
2330
- if ('eventName' in $$props) $$invalidate(6, eventName = $$props.eventName);
2387
+ if ('onClick' in $$props) $$invalidate(6, onClick = $$props.onClick);
2388
+ if ('eventName' in $$props) $$invalidate(7, eventName = $$props.eventName);
2331
2389
  if ('_imageStyle' in $$props) $$invalidate(3, _imageStyle = $$props._imageStyle);
2332
2390
  if ('_style' in $$props) $$invalidate(4, _style = $$props._style);
2333
2391
  };
2334
2392
 
2335
- return [src, alt, transport, _imageStyle, _style, click, eventName];
2393
+ return [src, alt, transport, _imageStyle, _style, click, onClick, eventName];
2336
2394
  }
2337
2395
 
2338
2396
  class ImageBlock extends SvelteComponent {
@@ -2349,7 +2407,8 @@ class ImageBlock extends SvelteComponent {
2349
2407
  src: 0,
2350
2408
  alt: 1,
2351
2409
  transport: 2,
2352
- eventName: 6,
2410
+ onClick: 6,
2411
+ eventName: 7,
2353
2412
  _imageStyle: 3,
2354
2413
  _style: 4
2355
2414
  },
@@ -2358,4 +2417,4 @@ class ImageBlock extends SvelteComponent {
2358
2417
  }
2359
2418
  }
2360
2419
 
2361
- export { Alignments, AnimationStyleTranslations, AnimationStyles, BackgroundSizes, DefaultModalPlacement, Directions, Flex, FlexItem, Grid, GridItem, GridModalState, ImageBlock, Justifies, LengthUnits, MediaQueries, Modal, ModalMarginTranslations, ModalPositionTranslations, ModalPositions, ObjectFits, PropTypes, Repeats, State, StateItem, TextBlock, TextButtonBlock, closeApp, closed, collection, createFog, embed, ensureModalRoot, finalize, getMarginStyle, getPositionStyle, h, handleFocus, handleKeydown, hasSuffix, hideOnScroll, hideOnTime, initialize, isPreview, linkTo, maximumZindex, moveTo, none, onScroll, onTime, randStr, send_event, setMiximumZindex, setPreviousFocus, showOnScroll, showOnTime, state, toBr };
2420
+ export { Alignments, AnimationStyleTranslations, AnimationStyles, BackgroundSizes, DefaultModalPlacement, Directions, Flex, FlexItem, Grid, GridItem, GridModalState, ImageBlock, Justifies, LengthUnits, MediaQueries, Modal, ModalMarginTranslations, ModalPositionTranslations, ModalPositions, ObjectFits, OnClickOperationOptions, PropTypes, Repeats, State, StateItem, TextBlock, TextButtonBlock, closeApp, closed, collection, createFog, embed, ensureModalRoot, execOnClickOperation, finalize, getMarginStyle, getPositionStyle, h, handleFocus, handleKeydown, hasSuffix, hideOnScroll, hideOnTime, initialize, isPreview, linkTo, maximumZindex, moveTo, none, onScroll, onTime, randStr, send_event, setMiximumZindex, setPreviousFocus, showOnScroll, showOnTime, state, toBr };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaidev/karte-action-sdk",
3
- "version": "1.0.41",
3
+ "version": "1.0.42",
4
4
  "author": "Plaid Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "module": "./dist/index.es.js",