@plaidev/karte-action-sdk 1.1.224-28447724.4d64da83 → 1.1.225

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.
@@ -0,0 +1,2661 @@
1
+ import { afterUpdate as afterUpdate_2 } from 'svelte';
2
+ import { beforeUpdate as beforeUpdate_2 } from 'svelte';
3
+ import { default as Box } from './components/Box.svelte';
4
+ import { default as CodeElement } from './components/CodeElement.svelte';
5
+ import { default as Countdown } from './components/Countdown.svelte';
6
+ import { default as EmbedElement } from './components/EmbedElement.svelte';
7
+ import { default as Flex } from './components/Flex.svelte';
8
+ import { default as FlexItem } from './components/FlexItem.svelte';
9
+ import { default as FormCheckBoxes } from './components/FormCheckBoxes.svelte';
10
+ import { default as FormIdentifyChoices } from './components/FormIdentifyChoices.svelte';
11
+ import { default as FormIdentifyInput } from './components/FormIdentifyInput.svelte';
12
+ import { default as FormRadioButtons } from './components/FormRadioButtons.svelte';
13
+ import { default as FormRatingButtonsFace } from './components/FormRatingButtonsFace.svelte';
14
+ import { default as FormRatingButtonsNumber } from './components/FormRatingButtonsNumber.svelte';
15
+ import { default as FormSelect } from './components/FormSelect.svelte';
16
+ import { default as FormTextarea } from './components/FormTextarea.svelte';
17
+ import { default as Grid } from './components/Grid.svelte';
18
+ import { default as GridItem } from './components/GridItem.svelte';
19
+ import { default as GridModalState } from './components/GridModalState.svelte';
20
+ import { default as IconElement } from './components/IconElement.svelte';
21
+ import { default as ImageBlock } from './components/ImageBlock.svelte';
22
+ import { default as ImageElement } from './components/ImageElement.svelte';
23
+ import { default as List } from './components/List.svelte';
24
+ import { default as ListItem } from './components/ListItem.svelte';
25
+ import { default as Modal } from './components/Modal.svelte';
26
+ import { default as MovieVimeoElement } from './components/MovieVimeoElement.svelte';
27
+ import { default as MovieYouTubeElement } from './components/MovieYouTubeElement.svelte';
28
+ import { onDestroy as onDestroy_2 } from 'svelte';
29
+ import { onMount as onMount_2 } from 'svelte';
30
+ import { default as Slide } from './components/Slide.svelte';
31
+ import { default as SlideItem } from './components/SlideItem.svelte';
32
+ import { default as State } from './components/State.svelte';
33
+ import { default as StateItem } from './components/StateItem.svelte';
34
+ import { SvelteComponentDev } from 'svelte/internal';
35
+ import { default as TextBlock } from './components/TextBlock.svelte';
36
+ import { default as TextButtonBlock } from './components/TextButtonBlock.svelte';
37
+ import { default as TextButtonElement } from './components/TextButtonElement.svelte';
38
+ import { default as TextElement } from './components/TextElement.svelte';
39
+ import { tick as tick_2 } from 'svelte';
40
+ import { Writable } from 'svelte/store';
41
+
42
+ /** @internal */
43
+ export declare const ACTION_HOOK_LABEL = "__ACTION_HOOK__";
44
+
45
+ /**
46
+ * アクションのライフサイクル changeState で呼び出されるフック関数
47
+ *
48
+ * @param props - アクションのプロパティ
49
+ * @param newState - アクションの新しいステート
50
+ *
51
+ * @public
52
+ */
53
+ export declare type ActionChangeStateHook<Props, Variables> = (props: Parameters<ActionHook<Props, Variables & ActionVariables>>[0], newState: string) => void | Promise<void>;
54
+
55
+ /**
56
+ * アクションのライフサイクル close で呼び出されるフックする関数
57
+ *
58
+ * @param props - アクションのプロパティ
59
+ * @param trigger - Close トリガー
60
+ *
61
+ * @public
62
+ */
63
+ export declare type ActionCloseHook<Props extends ModalProps$1, Variables> = (props: Parameters<ActionHook<Props, Variables & ActionVariables>>[0], trigger: CloseTrigger) => void | Promise<void>;
64
+
65
+ /**
66
+ * アクションの汎用的なタイプを定義する
67
+ *
68
+ * モーダル(ポップアップ)やアクションテーブルなど機能別のタイプは含めない。
69
+ */
70
+ /**
71
+ * アクションのイベントハンドラ
72
+ *
73
+ * @public
74
+ */
75
+ export declare type ActionEventHandler = (...args: any[]) => any | Promise<any>;
76
+
77
+ /**
78
+ * アクションのライフサイクルで呼び出されるフック
79
+ *
80
+ * @param props - アクションのプロパティ
81
+ *
82
+ * @public
83
+ */
84
+ export declare type ActionHook<Props, Variables> = (props: ActionProps<Props, Variables & ActionVariables>) => void | Promise<void>;
85
+
86
+ /** @internal */
87
+ export declare type ActionHookLog = {
88
+ name: string;
89
+ values?: any;
90
+ };
91
+
92
+ /**
93
+ * {@link create} 向けのオプション
94
+ *
95
+ * @public
96
+ */
97
+ export declare interface ActionOptions<Props, Variables, VariablesQuery> {
98
+ /**
99
+ * アクション内でイベントを発火する関数
100
+ *
101
+ * @defaultValue `() => {}`
102
+ */
103
+ send?: SendFunction;
104
+ /**
105
+ * アクション内でタグのQueueにリクエストを発行する関数
106
+ *
107
+ * @defaultValue `() => {}`
108
+ */
109
+ publish?: PublishFunction;
110
+ /**
111
+ * アクションで使用されるプロパティ
112
+ *
113
+ * @defaultValue `{}`
114
+ */
115
+ props?: Props;
116
+ /**
117
+ * アクションで使用される解析時に取得される変数
118
+ *
119
+ * @defaultValue `{}`
120
+ */
121
+ variables?: Variables;
122
+ /**
123
+ * アクションで使用されるアクション実行時に取得される変数
124
+ *
125
+ * @defaultValue `[]`
126
+ */
127
+ localVariablesQuery?: VariablesQuery;
128
+ /**
129
+ * アクションが作成されているときにフックされる {@link onCreate}
130
+ *
131
+ * @defaultValue `() => {}`
132
+ */
133
+ onCreate?: ActionHook<Props, Variables & ActionVariables>;
134
+ /**
135
+ * KARTEテンプレートの情報
136
+ *
137
+ * @defaultValue `{}`
138
+ */
139
+ karteTemplate?: {
140
+ [key: string]: any;
141
+ };
142
+ /**
143
+ * アクション実行時のコンテキスト
144
+ */
145
+ context: ActionRunnerContext;
146
+ }
147
+
148
+ /**
149
+ * アクションのプロパティ
150
+ *
151
+ * @public
152
+ */
153
+ export declare interface ActionProps<Props, Variables> {
154
+ /**
155
+ * アクションでイベントがトリガーされたときに受信するための関数
156
+ */
157
+ send: SendFunction;
158
+ /**
159
+ * アクション内でタグのQueueにリクエストを発行する関数
160
+ */
161
+ publish: PublishFunction;
162
+ /**
163
+ * アクションで使用されるデータ
164
+ */
165
+ data: Props & Variables & ActionVariables;
166
+ /**
167
+ * アクションが表示されたときにフックされる {@link onShow}
168
+ */
169
+ onShow?: ActionHook<Props, Variables & ActionVariables>;
170
+ /**
171
+ * アクションのステートが変更されたときにフックされる {@link onChangeState}
172
+ */
173
+ onChangeState?: ActionChangeStateHook<Props, Variables & ActionVariables>;
174
+ }
175
+
176
+ /**
177
+ * アクション実行時のコンテキスト
178
+ */
179
+ declare type ActionRunnerContext = {
180
+ api_key: string;
181
+ target?: "web" | "native";
182
+ };
183
+
184
+ /**
185
+ * アクション設定
186
+ *
187
+ * @public
188
+ */
189
+ declare type ActionSetting = {
190
+ send?: SendFunction;
191
+ publish?: PublishFunction;
192
+ initialState?: string;
193
+ };
194
+
195
+ declare type ActionTableQueryParam = string | number | boolean | Date;
196
+
197
+ declare type ActionTableQueryParams = {
198
+ [key: string]: ActionTableQueryParam | ActionTableQueryParam[];
199
+ };
200
+
201
+ /** @internal */
202
+ export declare type ActionTableQueryRequestConfig = VariableQuery & {
203
+ resolver: "action-table-query";
204
+ query: {
205
+ table_name: string;
206
+ query_name: string;
207
+ params?: {
208
+ [key: string]: string;
209
+ };
210
+ default_value?: Array<ActionTableResult>;
211
+ };
212
+ preview_value?: Array<ActionTableResult>;
213
+ };
214
+
215
+ /** @internal */
216
+ export declare type ActionTableRequestConfig = ActionTableRowRequestConfig | ActionTableRowsRequestConfig | ActionTableQueryRequestConfig;
217
+
218
+ declare type ActionTableResult = number | string | boolean | Date | null | undefined;
219
+
220
+ /** @internal */
221
+ export declare type ActionTableRowRequestConfig = VariableQuery & {
222
+ resolver: "action-table-row";
223
+ query: {
224
+ table_name: string;
225
+ key: string;
226
+ default_value?: ActionTableResult;
227
+ };
228
+ preview_value?: ActionTableResult;
229
+ };
230
+
231
+ /** @internal */
232
+ export declare type ActionTableRowsRequestConfig = VariableQuery & {
233
+ resolver: "action-table-rows";
234
+ query: {
235
+ table_name: string;
236
+ keys: Array<string>;
237
+ default_value?: Array<ActionTableResult>;
238
+ };
239
+ preview_value?: Array<ActionTableResult>;
240
+ };
241
+
242
+ /**
243
+ * アクションの変数
244
+ *
245
+ * @public
246
+ */
247
+ export declare type ActionVariables = {
248
+ [key: string]: any;
249
+ };
250
+
251
+ /**
252
+ * 選択式のアンケート回答を追加する
253
+ *
254
+ * @param questionId - 質問ID
255
+ * @param choices - 回答内容
256
+ *
257
+ * @public
258
+ */
259
+ export declare function addChoiceAnswer(questionId: string, choices: string[], validation?: {
260
+ isValid: boolean;
261
+ statePath: string;
262
+ }): void;
263
+
264
+ /**
265
+ * 自由記述式のアンケート回答を追加する
266
+ *
267
+ * @param questionId - 質問ID
268
+ * @param freeAnswer - 回答内容
269
+ *
270
+ * @public
271
+ */
272
+ export declare function addFreeAnswer(questionId: string, freeAnswer: string, validation?: {
273
+ isValid: boolean;
274
+ statePath: string;
275
+ }): void;
276
+
277
+ /**
278
+ * エレメントを更新した後に実行される関数の登録
279
+ *
280
+ * @param fn - マウントしたときに実行される関数
281
+ */
282
+ export declare const afterUpdate: typeof afterUpdate_2;
283
+
284
+ /** @internal */
285
+ export declare type Alignment = (typeof Alignments)[number];
286
+
287
+ /** @internal */
288
+ export declare const Alignments: readonly [
289
+ "flex-start",
290
+ "center",
291
+ "flex-end"
292
+ ];
293
+
294
+ /** @internal */
295
+ export declare type AnimationStyle = (typeof AnimationStyles)[number];
296
+
297
+ /** @internal */
298
+ export declare const AnimationStyles: readonly [
299
+ "none",
300
+ "fade",
301
+ "bounce",
302
+ "slide-down",
303
+ "slide-up",
304
+ "slide-left",
305
+ "slide-right"
306
+ ];
307
+
308
+ declare type AnswerValue = {
309
+ choices: string[];
310
+ } | {
311
+ free_answer: string;
312
+ };
313
+
314
+ /**
315
+ * 非推奨
316
+ *
317
+ * @deprecated 非推奨
318
+ *
319
+ * @internal
320
+ */
321
+ declare interface App {
322
+ /**
323
+ * The method to destroy an app instance.
324
+ */
325
+ close: () => void;
326
+ /**
327
+ * The method to show an app instance.
328
+ */
329
+ show: () => void;
330
+ }
331
+
332
+ /**
333
+ * アクションに CSS を適用する
334
+ *
335
+ * @param css - 適用する CSS
336
+ *
337
+ * @returns 適用された style 要素を返す Promise
338
+ *
339
+ * @public
340
+ */
341
+ export declare function applyCss(css: string): Promise<HTMLStyleElement>;
342
+
343
+ /**
344
+ * グローバル CSS をページに適用する
345
+ *
346
+ * @param css - CSS
347
+ *
348
+ * @public
349
+ */
350
+ export declare function applyGlobalCss(css: string): Promise<any>;
351
+
352
+ /**
353
+ * 非推奨
354
+ *
355
+ * @deprecated 非推奨
356
+ *
357
+ * @internal
358
+ */
359
+ declare type AppOptions<Props, Variables, VariablesQuery> = ActionOptions<Props, Variables, VariablesQuery>;
360
+
361
+ /** @internal */
362
+ export declare type BackgroundSize = (typeof BackgroundSizes)[number];
363
+
364
+ /** @internal */
365
+ export declare const BackgroundSizes: readonly [
366
+ "auto",
367
+ "cover",
368
+ "contain"
369
+ ];
370
+
371
+ declare interface BaseListBackground {
372
+ type: ListBackgroundType;
373
+ }
374
+
375
+ declare interface BaseListSeparator {
376
+ type: ListSeparatorType;
377
+ }
378
+
379
+ declare type BaseOperationOptions = ReadonlyArray<{
380
+ operation: string;
381
+ args: ReadonlyArray<{
382
+ name: string;
383
+ type: OperationArgumentType;
384
+ default: any;
385
+ }>;
386
+ }>;
387
+
388
+ declare type BaseSlideButton = {
389
+ type: SlideButtonType;
390
+ };
391
+
392
+ /**
393
+ * エレメントを更新する前に実行される関数の登録
394
+ *
395
+ * @param fn - マウントしたときに実行される関数
396
+ */
397
+ export declare const beforeUpdate: typeof beforeUpdate_2;
398
+
399
+ /** @internal */
400
+ export declare type Border = string;
401
+
402
+ /** @internal */
403
+ export declare type BorderStyle = string;
404
+
405
+ /** @internal */
406
+ export declare type BorderWidth = `${number}px`;
407
+
408
+ export { Box }
409
+
410
+ /** @internal */
411
+ export declare type BoxShadow = string;
412
+
413
+ /** @internal */
414
+ export declare type ClipPath = (typeof ClipPaths)[number];
415
+
416
+ /** @internal */
417
+ export declare const ClipPaths: readonly [
418
+ "none",
419
+ "circle(closest-side)"
420
+ ];
421
+
422
+ /**
423
+ * 非推奨
424
+ *
425
+ * @deprecated 非推奨
426
+ *
427
+ * @internal
428
+ */
429
+ declare const close_2: typeof closeAction;
430
+ export { close_2 as close }
431
+
432
+ /**
433
+ * アクションを閉じる
434
+ *
435
+ * @param trigger - 閉じた時のトリガー。デフォルト `'none'`
436
+ *
437
+ * @public
438
+ */
439
+ export declare function closeAction(trigger?: CloseTrigger): void;
440
+
441
+ /**
442
+ * 閉じるアクショントリガー
443
+ *
444
+ * @public
445
+ */
446
+ export declare type CloseTrigger = "button" | "overlay" | "auto" | "none";
447
+
448
+ /** @internal */
449
+ export declare type Code = string;
450
+
451
+ export { CodeElement }
452
+
453
+ /**
454
+ * アクションテーブルを管理するメソッドを取得する
455
+ *
456
+ * @param config - アクションテーブル設定情報
457
+ *
458
+ * @returns メソッドを返します
459
+ *
460
+ * @public
461
+ */
462
+ export declare function collection(config: CollectionConfig): {
463
+ get(key: string | Array<string>, cb: (err: Error | null, items?: ActionTableResult | Array<ActionTableResult>) => void): void;
464
+ getByQuery(query_name: string, params: ActionTableQueryParams, options: {
465
+ ignore_fields?: string[];
466
+ } | null | undefined, cb: (err: Error | null, items?: Array<ActionTableResult>) => void): void;
467
+ set(key: string, value: string, cb: (err: Error | null) => void): void;
468
+ };
469
+
470
+ /**
471
+ * アクションテーブルの設定情報
472
+ *
473
+ * @param api_key - API Key
474
+ * @param table - テーブル名
475
+ * @param endpoint - エンドポイント / 指定がない場合はデフォルトのエンドポイントを使用します。検証用途以外での通常利用では指定なしで大丈夫です。
476
+ */
477
+ export declare type CollectionConfig = {
478
+ api_key: string;
479
+ table: string;
480
+ endpoint?: string;
481
+ };
482
+
483
+ /** @internal */
484
+ export declare type Color = `#${string}` | `rgba(${string})`;
485
+
486
+ declare type ConvertOperationOption<Option extends BaseOperationOptions[number]> = Option extends any ? {
487
+ operation: Option["operation"];
488
+ args: ConvertOperationOptionArguments<Option["args"]>;
489
+ } : never;
490
+
491
+ declare type ConvertOperationOptionArguments<Arguments extends BaseOperationOptions[number]["args"]> = {
492
+ -readonly [Index in keyof Arguments]: Arguments[Index] extends BaseOperationOptions[number]["args"][number] ? OperationArgumentTypes[Arguments[Index]["type"]] : never;
493
+ };
494
+
495
+ declare type ConvertOperationOptions<O extends BaseOperationOptions> = ConvertOperationOption<O[number]>;
496
+
497
+ export { Countdown }
498
+
499
+ /**
500
+ * アクションを作成する
501
+ *
502
+ * @param App - Svelte コンポーネントのエントリポイント
503
+ * @param options - {@link ActionOptions | オプション}
504
+ *
505
+ * @returns アクションを破棄する関数
506
+ *
507
+ * @public
508
+ */
509
+ export declare function create<Props extends ModalProps, Variables, VariablesQuery extends Array<VariableQuery>>(App: typeof SvelteComponentDev, options?: ActionOptions<Props, Variables & ActionVariables, VariablesQuery>): () => void;
510
+
511
+ /**
512
+ * 非推奨
513
+ *
514
+ * @deprecated 非推奨
515
+ *
516
+ * @internal
517
+ */
518
+ export declare function createApp<Props, Variables, VariablesQuery>(App: typeof SvelteComponentDev, options?: AppOptions<Props, Variables, VariablesQuery>): App;
519
+
520
+ /**
521
+ * 非推奨
522
+ *
523
+ * @deprecated 非推奨
524
+ *
525
+ * @internal
526
+ */
527
+ export declare function createFog({ color, opacity, zIndex, onclick }: {
528
+ color?: string;
529
+ opacity?: string;
530
+ zIndex?: number;
531
+ onclick: () => void;
532
+ }): {
533
+ fog: HTMLDivElement;
534
+ close: () => void;
535
+ };
536
+
537
+ /** @internal */
538
+ export declare type Cursor = (typeof Cursors)[number];
539
+
540
+ /** @internal */
541
+ export declare const Cursors: readonly [
542
+ "default",
543
+ "pointer"
544
+ ];
545
+
546
+ /** @internal */
547
+ export declare type DateTime = string;
548
+
549
+ /** @internal */
550
+ export declare const DefaultEdgePosition: EdgePosition;
551
+
552
+ /** @internal */
553
+ export declare const DefaultElasticity: Elasticity;
554
+
555
+ /** @internal */
556
+ export declare const DefaultFormButtonColor: {
557
+ readonly main: "#2aab9f";
558
+ readonly sub: "#fff";
559
+ };
560
+
561
+ /** @internal */
562
+ export declare const DefaultFormIdentifyBooleanField: FormIdentifyBooleanField;
563
+
564
+ /** @internal */
565
+ export declare const DefaultFormIdentifyTextField: FormIdentifyTextField;
566
+
567
+ /** @internal */
568
+ export declare const DefaultListBackground: Required<ListBackgroundNone>;
569
+
570
+ /** @internal */
571
+ export declare const DefaultListBackgroundNone: Required<ListBackgroundNone>;
572
+
573
+ /** @internal */
574
+ export declare const DefaultListBackgroundStripe: Required<ListBackgroundStripe>;
575
+
576
+ /** @internal */
577
+ export declare const DefaultListSeparator: Required<ListSeparatorBorder>;
578
+
579
+ /** @internal */
580
+ export declare const DefaultListSeparatorBorder: Required<ListSeparatorBorder>;
581
+
582
+ /** @internal */
583
+ export declare const DefaultListSeparatorGap: Required<ListSeparatorGap>;
584
+
585
+ /** @internal */
586
+ export declare const DefaultListSeparatorNone: Required<ListSeparatorNone>;
587
+
588
+ /** @internal */
589
+ export declare const DefaultModalBreakPoint: ModalBreakPoint;
590
+
591
+ /** @internal */
592
+ export declare const DefaultModalPlacement: Required<ModalPlacement<Required<ModalMargin>>>;
593
+
594
+ /** @internal */
595
+ export declare const DefaultSlideButton: {
596
+ readonly type: "icon";
597
+ readonly icon: "chevron-left";
598
+ readonly color: "#999";
599
+ readonly fill: "#999";
600
+ readonly size: "20px";
601
+ };
602
+
603
+ /** @internal */
604
+ export declare const DefaultSlideNavigationButton: {
605
+ readonly type: "circle";
606
+ readonly size: "8px";
607
+ readonly color: "#ddd";
608
+ readonly colorActive: "#666";
609
+ };
610
+
611
+ /**
612
+ * 非推奨
613
+ *
614
+ * @deprecated 非推奨
615
+ *
616
+ * @internal
617
+ */
618
+ export declare function destroy(): void;
619
+
620
+ /**
621
+ * アクションの破棄する
622
+ *
623
+ * @public
624
+ */
625
+ export declare function destroyAction(): void;
626
+
627
+ /** @internal */
628
+ export declare type Direction = (typeof Directions)[number];
629
+
630
+ /** @internal */
631
+ export declare const Directions: readonly [
632
+ "row",
633
+ "column"
634
+ ];
635
+
636
+ /** @internal */
637
+ export declare interface EdgePosition {
638
+ edgeDistance: Length;
639
+ edgeDirectionOffset: Length;
640
+ }
641
+
642
+ /** @internal */
643
+ export declare const Elasticities: readonly [
644
+ "none",
645
+ "vertical",
646
+ "horizontal"
647
+ ];
648
+
649
+ /** @internal */
650
+ export declare type Elasticity = (typeof Elasticities)[number];
651
+
652
+ /** @internal */
653
+ export declare const ElasticityStyle: {
654
+ none: string;
655
+ vertical: string;
656
+ horizontal: string;
657
+ };
658
+
659
+ export { EmbedElement }
660
+
661
+ /** @internal */
662
+ declare function ensureActionRoot(useShadow?: boolean): ShadowRoot | HTMLElement;
663
+
664
+ /**
665
+ * 非推奨
666
+ *
667
+ * @deprecated 非推奨
668
+ *
669
+ * @internal
670
+ */
671
+ export declare const ensureModalRoot: typeof ensureActionRoot;
672
+
673
+ /** @internal */
674
+ declare type Event_2 = {
675
+ name: string;
676
+ values?: any;
677
+ date?: Date;
678
+ };
679
+ export { Event_2 as Event }
680
+
681
+ /**
682
+ * Store to handle event handlers
683
+ *
684
+ * This is used internally.
685
+ *
686
+ * @internal
687
+ */
688
+ export declare const eventHandlers: Store<{
689
+ [key: string]: ActionEventHandler;
690
+ }>;
691
+
692
+ /** @internal */
693
+ export declare const finalize: () => void;
694
+
695
+ export { Flex }
696
+
697
+ /** @internal */
698
+ export declare type FlexDirection = (typeof FlexDirections)[number];
699
+
700
+ /** @internal */
701
+ export declare const FlexDirections: readonly [
702
+ "row",
703
+ "column"
704
+ ];
705
+
706
+ export { FlexItem }
707
+
708
+ export declare type Font = (typeof Fonts)[number];
709
+
710
+ /** @internal */
711
+ export declare const Fonts: readonly [
712
+ "sans-serif, serif, monospace, system-ui",
713
+ "Noto Sans JP",
714
+ "M PLUS Rounded 1c",
715
+ "M PLUS 1p",
716
+ "Kosugi Maru",
717
+ "Kosugi",
718
+ "BIZ UDPGothic",
719
+ "Noto Serif JP",
720
+ "BIZ UDPMincho",
721
+ "Roboto",
722
+ "Open Sans",
723
+ "Montserrat",
724
+ "Lato",
725
+ "Poppins",
726
+ "Raleway",
727
+ "Nunito",
728
+ "Playfair Display",
729
+ "Merriweather",
730
+ "Lora",
731
+ "Libre Baskerville",
732
+ "EB Garamond"
733
+ ];
734
+
735
+ /** @internal */
736
+ export declare type FontWeight = string;
737
+
738
+ /** @internal */
739
+ export declare interface FormButtonColor {
740
+ main: Color;
741
+ sub: Color;
742
+ }
743
+
744
+ export { FormCheckBoxes }
745
+
746
+ /**
747
+ * Store for form data
748
+ *
749
+ * @internal
750
+ */
751
+ export declare const formData: Writable<FormData_2>;
752
+
753
+ /** @internal */
754
+ declare interface FormData_2 {
755
+ [name: string]: {
756
+ value: any;
757
+ statePath: string;
758
+ isValid: boolean;
759
+ };
760
+ }
761
+
762
+ /** @internal */
763
+ export declare type FormIdentifyBooleanField = (typeof FormIdentifyBooleanFields)[number];
764
+
765
+ /** @internal */
766
+ export declare const FormIdentifyBooleanFields: readonly [
767
+ "subscription",
768
+ "phone_subscribe"
769
+ ];
770
+
771
+ export { FormIdentifyChoices }
772
+
773
+ export { FormIdentifyInput }
774
+
775
+ /** @internal */
776
+ export declare type FormIdentifyTextField = (typeof FormIdentifyTextFields)[number];
777
+
778
+ /** @internal */
779
+ export declare const FormIdentifyTextFieldPlaceholders: {
780
+ [K in FormIdentifyTextField]: string;
781
+ };
782
+
783
+ export declare const FormIdentifyTextFields: readonly [
784
+ "email",
785
+ "phone",
786
+ "first_name",
787
+ "last_name",
788
+ "address"
789
+ ];
790
+
791
+ /** @internal */
792
+ export declare const FormIdentifyTextFieldValidations: {
793
+ [K in FormIdentifyTextField]: RegExpProp;
794
+ };
795
+
796
+ /** @internal */
797
+ export declare type FormInputName = string;
798
+
799
+ export { FormRadioButtons }
800
+
801
+ export { FormRatingButtonsFace }
802
+
803
+ export { FormRatingButtonsNumber }
804
+
805
+ export { FormSelect }
806
+
807
+ export { FormTextarea }
808
+
809
+ /**
810
+ * アクションのルートの DOM 要素を取得する
811
+ *
812
+ * @returns アクションがルートの DOM 要素 を持つ場合は DOM 要素を返します。ない場合は `null` を返します
813
+ *
814
+ * @public
815
+ */
816
+ export declare function getActionRoot(): ShadowRoot | null;
817
+
818
+ /**
819
+ * 回答済の回答内容を取得する
820
+ *
821
+ * @param questionId - 質問ID
822
+ *
823
+ * @returns 回答データ
824
+ *
825
+ * @public
826
+ */
827
+ export declare function getAnsweredQuestion(questionId: string): AnswerValue | undefined;
828
+
829
+ /**
830
+ * 回答済の回答IDのリストを取得
831
+ *
832
+ * @returns 回答済の質問の質問IDの配列
833
+ *
834
+ * @public
835
+ */
836
+ export declare function getAnsweredQuestionIds(): string[];
837
+
838
+ export declare function getCssVariables(data: {
839
+ [key: string]: string | number;
840
+ }): string;
841
+
842
+ /**
843
+ * イベントハンドラーの一覧を取得する
844
+ *
845
+ * @returns 現在のイベントハンドラー
846
+ *
847
+ * @public
848
+ */
849
+ export declare function getEventHandlers(): {
850
+ [key: string]: ActionEventHandler;
851
+ };
852
+
853
+ /** @internal */
854
+ export declare function getEvents(): Event_2[];
855
+
856
+ /** @internal */
857
+ export declare function getLogs(): Log[];
858
+
859
+ /**
860
+ * 現在のステートを取得する
861
+ *
862
+ * @remarks
863
+ * アクションが表示されて設定されるため、{@link onShow} フック関数で利用できます。
864
+ *
865
+ * @returns 現在のステートID
866
+ *
867
+ * @public
868
+ */
869
+ export declare function getState(): string;
870
+
871
+ /**
872
+ * ステートID一覧を取得する
873
+ *
874
+ * @remarks
875
+ * アクションが表示されて設定されるため、{@link onShow} フック関数で利用できます。
876
+ *
877
+ * @returns すべてのステートID
878
+ *
879
+ * @public
880
+ */
881
+ export declare function getStates(): string[];
882
+
883
+ /**
884
+ * KARTE の設定を取得する
885
+ *
886
+ * @remarks
887
+ * アクションが表示されて設定されるため、{@link onShow} フック関数で利用できます。
888
+ * 取得できる設定は、APIキー、接客ID、アクションショートIDなどです。
889
+ *
890
+ * @returns 現在の KARTE システムの設定を返します
891
+ *
892
+ * @public
893
+ */
894
+ export declare function getSystem(): SystemConfig;
895
+
896
+ /**
897
+ * 変数の一覧を取得する
898
+ *
899
+ * @returns 現在の変数の一覧
900
+ */
901
+ export declare function getVariables(): ActionVariables;
902
+
903
+ export { Grid }
904
+
905
+ export { GridItem }
906
+
907
+ export { GridModalState }
908
+
909
+ /**
910
+ * スクロールに応じてアクションを非表示にするトリガー関数
911
+ *
912
+ * @remarks
913
+ * スクロール率が `hide_on_scroll_rate` に達したときに `hide` 関数を呼び出します。
914
+ * `show_on_scroll_reenter` が `true` で、かつ `hide_on_scroll_rate` またはその値以下の場合、アクションに対して `show` 関数が呼び出されます。
915
+ *
916
+ * @param props - アクションのプロパティ。プロパティには `hide_on_scroll`、`hide_on_scroll_rate` そして `show_on_scroll_reenter` が必要です。
917
+ * @param hide - アクションを非表示にするロジックが実装された関数。指定ない場合は noop 関数が使用されます。
918
+ * @param show - アクションを再び表示するロジックが実装された関数。指定ない場合は noop 関数が使用されます。
919
+ *
920
+ * @returns
921
+ * スクロールが開始された場合は、クリーンアップする関数を返します。そうでない場合は `null` を返します。
922
+ *
923
+ * @internal
924
+ */
925
+ export declare function hideOnScroll<ModalProps extends Pick<Props, "hide_on_scroll" | "hide_on_scroll_rate" | "show_on_scroll_reenter">>(props: ModalProps, hide?: Function, show?: Function): (() => void) | null;
926
+
927
+ /**
928
+ * 時間に応じてアクションを非表示にするトリガー関数
929
+ *
930
+ * @remarks
931
+ * 時間のカウントが `hide_on_time_count` に達したときに `hide` 関数を呼び出します。
932
+ *
933
+ * @param props - アクションのプロパティ。プロパティには `hide_on_time` そして `hide_on_time_count` が必要です。
934
+ * @param hide - アクションを非表示にするロジックが実装された関数。指定ない場合は noop 関数が使用されます。
935
+ *
936
+ * @returns
937
+ * タイマーが開始された場合、タイマーをクリーンアップする関数を返します。それ以外は `null` を返します。
938
+ *
939
+ * @internal
940
+ */
941
+ export declare function hideOnTime<ModalProps extends Pick<Props, "hide_on_time" | "hide_on_time_count">>(props: ModalProps, hide?: Function): (() => void) | null;
942
+
943
+ /** @internal */
944
+ export declare type Icon = string;
945
+
946
+ export { IconElement }
947
+
948
+ /** @internal */
949
+ declare type Image_2 = string;
950
+ export { Image_2 as Image }
951
+
952
+ export { ImageBlock }
953
+
954
+ export { ImageElement }
955
+
956
+ /** @internal */
957
+ export declare const initialize: (setting?: ActionSetting) => () => void;
958
+
959
+ /**
960
+ * アクションの表示・非表示の状態を取得する
961
+ *
962
+ * @returns アクションが表示されているときは `true`、非表示のときは `false` を返します。
963
+ *
964
+ * @public
965
+ */
966
+ export declare function isOpened(): boolean;
967
+
968
+ /** @internal */
969
+ export declare const Justifies: readonly [
970
+ "flex-start",
971
+ "center",
972
+ "flex-end"
973
+ ];
974
+
975
+ /** @internal */
976
+ export declare type Justify = (typeof Justifies)[number];
977
+
978
+ /**
979
+ * 非推奨
980
+ *
981
+ * @deprecated 非推奨
982
+ *
983
+ * @internal
984
+ */
985
+ export declare const KARTE_MODAL_ROOT = "karte-modal-root";
986
+
987
+ export declare const LAYOUT_COMPONENT_NAMES: string[];
988
+
989
+ /** @internal */
990
+ export declare type Length = `${number}${LengthUnit}` | "auto";
991
+
992
+ /** @internal */
993
+ export declare type LengthUnit = (typeof LengthUnits)[number];
994
+
995
+ /** @internal */
996
+ export declare const LengthUnits: readonly [
997
+ "px",
998
+ "em",
999
+ "rem",
1000
+ "vw",
1001
+ "fr",
1002
+ "%"
1003
+ ];
1004
+
1005
+ export { List }
1006
+
1007
+ /**
1008
+ * @internal
1009
+ */
1010
+ export declare type ListBackground = ListBackgroundNone | ListBackgroundStripe;
1011
+
1012
+ /** @internal */
1013
+ export declare interface ListBackgroundNone extends BaseListBackground {
1014
+ type: "none";
1015
+ }
1016
+
1017
+ /** @internal */
1018
+ export declare interface ListBackgroundStripe extends BaseListBackground {
1019
+ type: "stripe";
1020
+ background1?: Color;
1021
+ background2?: Color;
1022
+ }
1023
+
1024
+ declare type ListBackgroundType = (typeof ListBackgroundTypes)[number];
1025
+
1026
+ /** @internal */
1027
+ export declare const ListBackgroundTypes: readonly [
1028
+ "none",
1029
+ "stripe"
1030
+ ];
1031
+
1032
+ /** @internal */
1033
+ export declare type ListContext = {
1034
+ separator: ListSeparator;
1035
+ background: ListBackground;
1036
+ direction: ListDirection;
1037
+ registerItem: (props: {
1038
+ onMount: (props: {
1039
+ index: number;
1040
+ length: number;
1041
+ }) => void;
1042
+ }) => string;
1043
+ unregisterItem: (id: string) => void;
1044
+ };
1045
+
1046
+ /** @internal */
1047
+ export declare type ListDirection = (typeof ListDirections)[number];
1048
+
1049
+ /** @internal */
1050
+ export declare const ListDirections: readonly [
1051
+ "vertical",
1052
+ "horizontal"
1053
+ ];
1054
+
1055
+ /**
1056
+ * メッセージを実行ログに表示する
1057
+ *
1058
+ * @internal
1059
+ */
1060
+ export declare function listenLogger(): () => void;
1061
+
1062
+ export { ListItem }
1063
+
1064
+ /** @internal */
1065
+ export declare type ListSeparator = ListSeparatorNone | ListSeparatorBorder | ListSeparatorGap;
1066
+
1067
+ /** @internal */
1068
+ export declare interface ListSeparatorBorder extends BaseListSeparator {
1069
+ type: "border";
1070
+ borderStyle: BorderStyle;
1071
+ borderWidth?: BorderWidth;
1072
+ borderColor?: Color;
1073
+ }
1074
+
1075
+ /** @internal */
1076
+ export declare interface ListSeparatorGap extends BaseListSeparator {
1077
+ type: "gap";
1078
+ gap: Length;
1079
+ }
1080
+
1081
+ /** @internal */
1082
+ export declare interface ListSeparatorNone extends BaseListSeparator {
1083
+ type: "none";
1084
+ }
1085
+
1086
+ declare type ListSeparatorType = (typeof ListSeparatorTypes)[number];
1087
+
1088
+ /** @internal */
1089
+ export declare const ListSeparatorTypes: readonly [
1090
+ "none",
1091
+ "border",
1092
+ "gap"
1093
+ ];
1094
+
1095
+ /** @internal */
1096
+ export declare const loadActionTable: (config: Array<VariableQuery>, data: {
1097
+ [key: string]: any;
1098
+ }, api_key: string, endpoint?: string) => Promise<{
1099
+ [key: string]: any;
1100
+ }>;
1101
+
1102
+ /** @internal */
1103
+ export declare const loadActionTableQuery: (config: ActionTableQueryRequestConfig, data: {
1104
+ [key: string]: any;
1105
+ }, api_key: string, endpoint?: string) => Promise<unknown>;
1106
+
1107
+ /** @internal */
1108
+ export declare const loadActionTableRow: (config: ActionTableRowRequestConfig, data: {
1109
+ [key: string]: any;
1110
+ }, api_key: string, endpoint?: string) => Promise<unknown>;
1111
+
1112
+ /** @internal */
1113
+ export declare const loadActionTableRows: (config: ActionTableRowsRequestConfig, data: {
1114
+ [key: string]: any;
1115
+ }, api_key: string, endpoint?: string) => Promise<unknown>;
1116
+
1117
+ /**
1118
+ * ES Modules に対応していない JavaScript をページに読み込む
1119
+ *
1120
+ * @param src - JavaScript ファイルのリンク URL
1121
+ *
1122
+ * @public
1123
+ */
1124
+ export declare function loadGlobalScript(src: string): Promise<any>;
1125
+
1126
+ /**
1127
+ * style ファイルをページに読み込む
1128
+ *
1129
+ * @param href - style ファイルのリンク URL
1130
+ *
1131
+ * @public
1132
+ */
1133
+ export declare function loadGlobalStyle(href: string): Promise<any>;
1134
+
1135
+ /**
1136
+ * アクションにグローバルなスタイルを読み込む
1137
+ *
1138
+ * @param href - style ファイルのリンク URL
1139
+ *
1140
+ * @public
1141
+ */
1142
+ export declare function loadStyle(href: string): Promise<void>;
1143
+
1144
+ /** @internal */
1145
+ export declare type Log = {
1146
+ level: LogLevel;
1147
+ messages: any;
1148
+ date?: Date;
1149
+ };
1150
+
1151
+ /**
1152
+ * ログを送信する関数群
1153
+ *
1154
+ * @internal
1155
+ */
1156
+ export declare const logger: {
1157
+ info: (...messages: any[]) => void;
1158
+ log: (...messages: any[]) => void;
1159
+ error: (...messages: any[]) => void;
1160
+ warn: (...messages: any[]) => void;
1161
+ system: (...messages: any[]) => void;
1162
+ event: (name: string, values?: any) => void;
1163
+ clear: () => void;
1164
+ clearEvents: () => void;
1165
+ };
1166
+
1167
+ /**
1168
+ * アクションのログの記録の管理
1169
+ */
1170
+ /** @internal */
1171
+ export declare type LogLevel = "info" | "error" | "warn" | "system";
1172
+
1173
+ /** @internal */
1174
+ export declare type LongText = string;
1175
+
1176
+ /** @internal */
1177
+ export declare const MediaQueries: {
1178
+ [key: string]: string;
1179
+ };
1180
+
1181
+ /** @internal */
1182
+ export declare type MediaQuery = string;
1183
+
1184
+ export { Modal }
1185
+
1186
+ /** @internal */
1187
+ export declare type ModalBreakPoint = {
1188
+ PC: ModalStyle;
1189
+ SP: ModalStyle;
1190
+ };
1191
+
1192
+ /** @internal */
1193
+ export declare type ModalMargin = {
1194
+ left?: string;
1195
+ right?: string;
1196
+ top?: string;
1197
+ bottom?: string;
1198
+ };
1199
+
1200
+ /** @internal */
1201
+ export declare type ModalPlacement<M = ModalMargin> = {
1202
+ position?: ModalPosition;
1203
+ margin?: M;
1204
+ backgroundOverlay?: boolean;
1205
+ backgroundClick?: OnClickOperation;
1206
+ };
1207
+
1208
+ /** @internal */
1209
+ export declare type ModalPosition = (typeof ModalPositions)[number];
1210
+
1211
+ /** @internal */
1212
+ export declare const ModalPositions: readonly [
1213
+ "top-left",
1214
+ "top-center",
1215
+ "top-right",
1216
+ "center-left",
1217
+ "center",
1218
+ "center-right",
1219
+ "bottom-left",
1220
+ "bottom-center",
1221
+ "bottom-right",
1222
+ "none"
1223
+ ];
1224
+
1225
+ declare type ModalProps$1 = Props;
1226
+
1227
+ declare type ModalProps = Props;
1228
+
1229
+ /** @internal */
1230
+ export declare type ModalStyle = {
1231
+ placement?: ModalPlacement;
1232
+ elasticity?: Elasticity;
1233
+ };
1234
+
1235
+ export { MovieVimeoElement }
1236
+
1237
+ export { MovieYouTubeElement }
1238
+
1239
+ /** @internal */
1240
+ export declare type ObjectFit = (typeof ObjectFits)[number];
1241
+
1242
+ /** @internal */
1243
+ export declare const ObjectFits: readonly [
1244
+ "cover",
1245
+ "fill",
1246
+ "contain"
1247
+ ];
1248
+
1249
+ /**
1250
+ * アクションのステートが変更された (changeState) 後にフックする関数
1251
+ *
1252
+ * @param fn - 呼び出されるフック関数
1253
+ *
1254
+ * @public
1255
+ */
1256
+ export declare function onChangeState<Props extends ModalProps$1, Variables>(fn: ActionChangeStateHook<Props, Variables & ActionVariables>): void;
1257
+
1258
+ /** @internal */
1259
+ export declare type OnClickOperation = ConvertOperationOptions<typeof OnClickOperationOptions>;
1260
+
1261
+ /** @internal */
1262
+ export declare const OnClickOperationOptions: readonly [
1263
+ {
1264
+ readonly operation: "none";
1265
+ readonly args: readonly [
1266
+ ];
1267
+ },
1268
+ {
1269
+ readonly operation: "linkTo";
1270
+ readonly args: readonly [
1271
+ {
1272
+ readonly name: "url";
1273
+ readonly type: "Url";
1274
+ readonly default: "https://example.com";
1275
+ },
1276
+ {
1277
+ readonly name: "open_new_tab";
1278
+ readonly type: "BooleanKeyword";
1279
+ readonly default: true;
1280
+ },
1281
+ {
1282
+ readonly name: "decode";
1283
+ readonly type: "BooleanKeyword";
1284
+ readonly default: false;
1285
+ }
1286
+ ];
1287
+ },
1288
+ {
1289
+ readonly operation: "moveTo";
1290
+ readonly args: readonly [
1291
+ {
1292
+ readonly name: "state";
1293
+ readonly type: "TransitState";
1294
+ readonly default: "/";
1295
+ }
1296
+ ];
1297
+ },
1298
+ {
1299
+ readonly operation: "closeApp";
1300
+ readonly args: readonly [
1301
+ {
1302
+ readonly name: "trigger";
1303
+ readonly type: "Trigger";
1304
+ readonly default: "button";
1305
+ }
1306
+ ];
1307
+ },
1308
+ {
1309
+ readonly operation: "runScript";
1310
+ readonly args: readonly [
1311
+ {
1312
+ readonly name: "handler";
1313
+ readonly type: "Handler";
1314
+ readonly default: "";
1315
+ }
1316
+ ];
1317
+ },
1318
+ {
1319
+ readonly operation: "submitForm";
1320
+ readonly args: readonly [
1321
+ {
1322
+ readonly name: "state";
1323
+ readonly type: "TransitState";
1324
+ readonly default: "/";
1325
+ }
1326
+ ];
1327
+ },
1328
+ {
1329
+ readonly operation: "bootChat";
1330
+ readonly args: readonly [
1331
+ {
1332
+ readonly name: "hide_launcher";
1333
+ readonly type: "BooleanKeyword";
1334
+ readonly default: false;
1335
+ },
1336
+ {
1337
+ readonly name: "placement_pc";
1338
+ readonly type: "StringKeyword";
1339
+ readonly default: "left";
1340
+ },
1341
+ {
1342
+ readonly name: "placement_mobile";
1343
+ readonly type: "StringKeyword";
1344
+ readonly default: "left";
1345
+ },
1346
+ {
1347
+ readonly name: "horizontal_spacing_pc";
1348
+ readonly type: "NumberKeyword";
1349
+ readonly default: 20;
1350
+ },
1351
+ {
1352
+ readonly name: "horizontal_spacing_mobile";
1353
+ readonly type: "NumberKeyword";
1354
+ readonly default: 20;
1355
+ },
1356
+ {
1357
+ readonly name: "vertical_spacing_pc";
1358
+ readonly type: "NumberKeyword";
1359
+ readonly default: 20;
1360
+ },
1361
+ {
1362
+ readonly name: "vertical_spacing_mobile";
1363
+ readonly type: "NumberKeyword";
1364
+ readonly default: 20;
1365
+ },
1366
+ {
1367
+ readonly name: "theme_color";
1368
+ readonly type: "Color";
1369
+ readonly default: "#2aab9f";
1370
+ },
1371
+ {
1372
+ readonly name: "header_title";
1373
+ readonly type: "StringKeyword";
1374
+ readonly default: "KARTE\u30B5\u30DD\u30FC\u30C8\u30C1\u30FC\u30E0";
1375
+ },
1376
+ {
1377
+ readonly name: "header_description";
1378
+ readonly type: "StringKeyword";
1379
+ readonly default: "\u3054\u8CEA\u554F\u304C\u3042\u308C\u3070\u304A\u5C0B\u306D\u304F\u3060\u3055\u3044\u3002\nKARTE\u30B5\u30DD\u30FC\u30C8\u62C5\u5F53\u8005\u306B\u3064\u306A\u304C\u308A\u307E\u3059\u3002\u30B5\u30DD\u30FC\u30C8\u53D7\u4ED8\u6642\u9593\u306F\u5E73\u65E510:30-17:30\u3067\u3059\u3002";
1380
+ },
1381
+ {
1382
+ readonly name: "launcher_image";
1383
+ readonly type: "StringKeyword";
1384
+ readonly default: "";
1385
+ }
1386
+ ];
1387
+ }
1388
+ ];
1389
+
1390
+ /**
1391
+ * アクションがクローズ (close) される前にフックする関数
1392
+ *
1393
+ * @param fn - 呼び出されるフック関数
1394
+ *
1395
+ * @public
1396
+ */
1397
+ export declare function onClose<Props extends ModalProps$1, Variables>(fn: ActionCloseHook<Props, Variables & ActionVariables>): void;
1398
+
1399
+ /**
1400
+ * アクションが作成 (create) される前にフックする関数
1401
+ *
1402
+ * @param fn - 呼び出されるフック関数
1403
+ *
1404
+ * @public
1405
+ */
1406
+ export declare function onCreate<Props extends ModalProps, Variables>(fn: ActionHook<Props, Variables & ActionVariables>): void;
1407
+
1408
+ /**
1409
+ * エレメントを破棄したときに実行される関数の登録
1410
+ *
1411
+ * @param fn - マウントしたときに実行される関数
1412
+ */
1413
+ export declare const onDestory: typeof onDestroy_2;
1414
+
1415
+ /**
1416
+ * アクションが破棄 (destroy) される前にフックする関数
1417
+ *
1418
+ * @param fn - 呼び出されるフック関数
1419
+ *
1420
+ * @public
1421
+ */
1422
+ export declare function onDestroy<Props extends ModalProps, Variables>(fn: ActionHook<Props, Variables & ActionVariables>): void;
1423
+
1424
+ /**
1425
+ * エレメントをマウントしたときに実行される関数の登録
1426
+ *
1427
+ * @param fn - マウントしたときに実行される関数
1428
+ */
1429
+ export declare const onMount: typeof onMount_2;
1430
+
1431
+ /**
1432
+ * スクロール率が達したときに呼び出すコールバックを登録します
1433
+ *
1434
+ * @param rate - スクロール率。この値は viewport でのスクロールのパーセンテージ
1435
+ * @param fn - スクロール率が達したときに呼び出されるコールバック関数
1436
+ *
1437
+ * @returns スクロール率によって呼び出されるコールバックを停止する関数を返します
1438
+ *
1439
+ * @public
1440
+ */
1441
+ export declare function onScroll(rate: number | number[], fn: OnScrollFunction): () => void;
1442
+
1443
+ /**
1444
+ * {@link onScroll} のスクロールコンテキスト情報
1445
+ *
1446
+ * @remarks
1447
+ * このコンテキスト情報は、{@link OnScrollFunction} が呼び出されたタイミングの情報が格納されています
1448
+ *
1449
+ * @see {@link onScroll}
1450
+ *
1451
+ * @public
1452
+ */
1453
+ export declare interface OnScrollContext {
1454
+ /**
1455
+ * {@link onScroll} によって指定されたスクロール率
1456
+ */
1457
+ rate: number;
1458
+ /**
1459
+ * ページのスクロール率
1460
+ */
1461
+ scrollRate: number;
1462
+ /**
1463
+ * 前のスクロール率
1464
+ */
1465
+ previousRate: number;
1466
+ /**
1467
+ * 現在のスクロール率と前のスクロール率との差分値
1468
+ */
1469
+ deltaRate: number;
1470
+ /**
1471
+ * スクロール方向
1472
+ */
1473
+ direction: ScrollDirection;
1474
+ }
1475
+
1476
+ /**
1477
+ * {@link onScroll} によって呼び出されるコールバック関数
1478
+ *
1479
+ * @see {@link onScroll}
1480
+ *
1481
+ * @public
1482
+ */
1483
+ export declare type OnScrollFunction = (ctx: OnScrollContext) => boolean;
1484
+
1485
+ /**
1486
+ * アクションが表示 (show) された後にフックする関数
1487
+ *
1488
+ * @param fn - 呼び出されるフック関数
1489
+ *
1490
+ * @public
1491
+ */
1492
+ export declare function onShow<Props extends ModalProps$1, Variables>(fn: ActionHook<Props, Variables & ActionVariables>): void;
1493
+
1494
+ /**
1495
+ * 指定した時間の経過後に呼び出すコールバックを登録します
1496
+ *
1497
+ * @param time - コールバックを呼び出すまでの時間。単位はミリセカンド(ms)
1498
+ * @param fn - 指定した時間が経過後に呼び出されるコールバック関数
1499
+ *
1500
+ * @returns コールバックを呼び出すためのタイマーを停止する関数を返します
1501
+ *
1502
+ * @public
1503
+ */
1504
+ export declare function onTime(time: number, fn: Function): () => void;
1505
+
1506
+ /** @internal */
1507
+ export declare type Operation = ConvertOperationOptions<ReadonlyArray<any>>;
1508
+
1509
+ /** @internal */
1510
+ export declare type OperationArgumentType = keyof OperationArgumentTypes;
1511
+
1512
+ declare type OperationArgumentTypes = {
1513
+ StringKeyword: string;
1514
+ BooleanKeyword: boolean;
1515
+ NumberKeyword: number;
1516
+ TransitState: string;
1517
+ Url: string;
1518
+ Color: string;
1519
+ Handler: string;
1520
+ Trigger: string;
1521
+ };
1522
+
1523
+ /** @internal */
1524
+ export declare type Overflow = (typeof Overflows)[number];
1525
+
1526
+ /** @internal */
1527
+ export declare const Overflows: readonly [
1528
+ "hidden",
1529
+ "auto",
1530
+ "visible"
1531
+ ];
1532
+
1533
+ /**
1534
+ * モーダル(ポップアップ)のプロパティ
1535
+ *
1536
+ * @internal
1537
+ */
1538
+ declare interface Props {
1539
+ /**
1540
+ * 全ての条件を満たしたら表示するかどうか
1541
+ */
1542
+ show_and_condition?: boolean;
1543
+ /**
1544
+ * スクロール率による表示を有効化するかどうか
1545
+ */
1546
+ show_on_scroll?: boolean;
1547
+ /**
1548
+ * 表示するスクロール率
1549
+ */
1550
+ show_on_scroll_rate?: number;
1551
+ /**
1552
+ * 条件を満たした時に再表示するかどうか
1553
+ */
1554
+ show_on_scroll_reenter?: boolean;
1555
+ /**
1556
+ * 時間による表示を有効化するかどうか
1557
+ */
1558
+ show_on_time?: boolean;
1559
+ /**
1560
+ * 表示する秒数
1561
+ */
1562
+ show_on_time_count?: number;
1563
+ /**
1564
+ * 全ての条件を満たしたら非表示するかどうか
1565
+ */
1566
+ hide_and_condition?: boolean;
1567
+ /**
1568
+ * スクロール率で非表示を有効化するかどうか
1569
+ */
1570
+ hide_on_scroll?: boolean;
1571
+ /**
1572
+ * 非表示にするスクロール率
1573
+ */
1574
+ hide_on_scroll_rate?: number;
1575
+ /**
1576
+ * 条件を満たした時に表示するかどうか
1577
+ */
1578
+ hide_on_scroll_releave?: boolean;
1579
+ /**
1580
+ * 時間による非表示を有効化するかどうか
1581
+ */
1582
+ hide_on_time?: boolean;
1583
+ /**
1584
+ * 非表示にする秒数
1585
+ */
1586
+ hide_on_time_count?: number;
1587
+ }
1588
+
1589
+ /** @internal */
1590
+ export declare type PropType = (typeof PropTypes)[number];
1591
+
1592
+ /** @internal */
1593
+ export declare const PropTypes: readonly [
1594
+ "BooleanKeyword",
1595
+ "NumberKeyword",
1596
+ "StringKeyword",
1597
+ "Function",
1598
+ "Enum",
1599
+ "Code",
1600
+ "Direction",
1601
+ "Url",
1602
+ "Image",
1603
+ "AnimationStyle",
1604
+ "LongText",
1605
+ "Length",
1606
+ "Color",
1607
+ "Alignment",
1608
+ "State",
1609
+ "TransitState",
1610
+ "Style",
1611
+ "ModalPlacement",
1612
+ "OnClick"
1613
+ ];
1614
+
1615
+ /**
1616
+ * アクションの publish 関数
1617
+ *
1618
+ * @public
1619
+ */
1620
+ export declare type PublishFunction = (topic: string, values?: any) => void;
1621
+
1622
+ /** @internal */
1623
+ export declare type RegExpProp = {
1624
+ pattern: string;
1625
+ flags: string;
1626
+ };
1627
+
1628
+ /**
1629
+ * 回答済の回答を削除
1630
+ *
1631
+ * @param questionId - 質問ID
1632
+ *
1633
+ * @public
1634
+ */
1635
+ export declare function removeAnswer(questionId: string): void;
1636
+
1637
+ /** @internal */
1638
+ export declare type Repeat = (typeof Repeats)[number];
1639
+
1640
+ /** @internal */
1641
+ export declare const Repeats: readonly [
1642
+ "repeat",
1643
+ "space",
1644
+ "round",
1645
+ "no-repeat"
1646
+ ];
1647
+
1648
+ /**
1649
+ * イベントハンドラーをリセットする
1650
+ *
1651
+ */
1652
+ export declare function resetEventHandlers(): void;
1653
+
1654
+ /**
1655
+ * 変数をリセットする
1656
+ */
1657
+ export declare function resetVariables(): void;
1658
+
1659
+ /**
1660
+ * スクロール方向
1661
+ *
1662
+ * @public
1663
+ *
1664
+ * @see {@link onScroll}
1665
+ */
1666
+ export declare type ScrollDirection = "up" | "down";
1667
+
1668
+ /**
1669
+ * `sendAnswers`のエイリアス
1670
+ *
1671
+ * @public
1672
+ */
1673
+ export declare function sendAnswer(): boolean;
1674
+
1675
+ /**
1676
+ * 回答済の回答をまとめてイベントとして送信する
1677
+ *
1678
+ * @returns イベント送信の成功/失敗
1679
+ *
1680
+ * @public
1681
+ */
1682
+ export declare function sendAnswers(): boolean;
1683
+
1684
+ /**
1685
+ * アクションの send 関数
1686
+ *
1687
+ * @public
1688
+ */
1689
+ export declare type SendFunction = (event_name: string, values?: any) => void;
1690
+
1691
+ /**
1692
+ * イベントハンドラーを登録する
1693
+ *
1694
+ * @remarks
1695
+ * 登録したイベントハンドラーは、ビジュアルエディタでアクション本体とのテキストボタンのクリック時の動作で利用できます。
1696
+ *
1697
+ * @param handlers - 登録するイベントハンドラー
1698
+ *
1699
+ * @public
1700
+ */
1701
+ export declare function setEventHandlers(handlers: {
1702
+ [key: string]: ActionEventHandler;
1703
+ }): {
1704
+ [key: string]: ActionEventHandler;
1705
+ };
1706
+
1707
+ /**
1708
+ * アクション設定を更新する
1709
+ *
1710
+ * @param setting - 更新するアクション設定
1711
+ *
1712
+ * @returns 新しいアクション設定
1713
+ *
1714
+ * @public
1715
+ */
1716
+ export declare function setSetting(setting: ActionSetting): ActionSetting;
1717
+
1718
+ /**
1719
+ * 現在のステートを設定する
1720
+ *
1721
+ * @param stateId - 表示するステートID
1722
+ * @param options - オプション。`options.disableInPreview`でプレビュー時のステート遷移を無効化できます。
1723
+ *
1724
+ * @public
1725
+ */
1726
+ export declare function setState(stateId: string, options?: {
1727
+ disableInPreview: boolean;
1728
+ }): void;
1729
+
1730
+ /**
1731
+ * 変数を設定する
1732
+ *
1733
+ * @remarks
1734
+ * 設定した変数は、ビジュアルエディタのテキストフォームなどで利用できます。
1735
+ *
1736
+ * @param vars - 変数
1737
+ */
1738
+ export declare function setVariables(vars: ActionVariables): ActionVariables;
1739
+
1740
+ /**
1741
+ * 非推奨
1742
+ *
1743
+ * @deprecated 非推奨
1744
+ *
1745
+ * @internal
1746
+ */
1747
+ export declare const show: typeof showAction;
1748
+
1749
+ /**
1750
+ * アクションを表示する
1751
+ *
1752
+ * @public
1753
+ */
1754
+ export declare function showAction(): void;
1755
+
1756
+ /**
1757
+ * 非推奨
1758
+ *
1759
+ * @deprecated 非推奨
1760
+ *
1761
+ * @internal
1762
+ */
1763
+ export declare const showModal: typeof create;
1764
+
1765
+ /**
1766
+ * スクロールに応じてアクションを表示するトリガー関数
1767
+ *
1768
+ * @remarks
1769
+ * スクロール率が `show_on_scroll_rate` に達したときに `show` 関数を呼び出します。
1770
+ * `hide_on_scroll_releave` が `true` で、かつ `show_on_scroll_rate` 以下の場合は、アクションに対して `hide` 関数が呼び出されます。
1771
+ *
1772
+ * @param props - アクションのプロパティ。プロパティには `show_on_scroll`、`show_on_scroll_rate` そして `hide_on_scroll_releave` が必要です。
1773
+ * @param show - アクションを表示するロジックが実装された関数。指定ない場合は noop 関数が使用されます。
1774
+ * @param hide - アクションを非表示にするロジックが実装された関数。指定ない場合は noop 関数が使用されます。
1775
+ *
1776
+ * @returns
1777
+ * スクロールが開始されている場合は、クリーンアップ関数を返します。そうでない場合は `null` を返します
1778
+ *
1779
+ * @internal
1780
+ */
1781
+ export declare function showOnScroll<ModalProps extends Pick<Props, "show_on_scroll" | "show_on_scroll_rate" | "hide_on_scroll_releave">>(props: ModalProps, show?: Function, hide?: Function): (() => void) | null;
1782
+
1783
+ /**
1784
+ * 時間に応じてアクションを表示するトリガー関数
1785
+ *
1786
+ * @param props - アクションのプロパティ。プロパティには `show_on_time` そして `show_on_time_count` が必要です。
1787
+ * @param show - アクションを表示するロジックが実装された関数。指定ない場合は noop 関数が使用されます。
1788
+ *
1789
+ * @remarks
1790
+ * 時間のカウントが `show_on_time_count` に達したときに `show` 関数を呼び出します。
1791
+ *
1792
+ * @returns
1793
+ * タイマーが開始された場合、タイマーをクリーンアップする関数を返します。それ以外は `null` を返します。
1794
+ *
1795
+ * @internal
1796
+ */
1797
+ export declare function showOnTime<ModalProps extends Pick<Props, "show_on_time" | "show_on_time_count">>(props: ModalProps, show?: Function): (() => void) | null;
1798
+
1799
+ /**
1800
+ * 表示アクショントリガー
1801
+ *
1802
+ * @internal */
1803
+ export declare type ShowTrigger = "custom" | "auto" | "none";
1804
+
1805
+ export { Slide }
1806
+
1807
+ /** @internal */
1808
+ export declare type SlideButton = SlideButtonIcon | SlideButtonText;
1809
+
1810
+ /** @internal */
1811
+ export declare interface SlideButtonIcon extends BaseSlideButton {
1812
+ type: "icon";
1813
+ icon: string;
1814
+ size: Length;
1815
+ color: Color;
1816
+ fill: Color;
1817
+ }
1818
+
1819
+ /** @internal */
1820
+ export declare type SlideButtonPosition = "top" | "middle" | "bottom";
1821
+
1822
+ /** @internal */
1823
+ export declare interface SlideButtonText extends BaseSlideButton {
1824
+ type: "text";
1825
+ text: string;
1826
+ }
1827
+
1828
+ declare type SlideButtonType = "icon" | "text";
1829
+
1830
+ export { SlideItem }
1831
+
1832
+ /** @internal */
1833
+ export declare interface SlideNavigationButton {
1834
+ type: "circle";
1835
+ size: Length;
1836
+ color: Color;
1837
+ colorActive: Color;
1838
+ }
1839
+
1840
+ export { State }
1841
+
1842
+ /**
1843
+ * Store to handle current state ID
1844
+ *
1845
+ * This is exported becase of compatible interface for App.svelte.
1846
+ * Don't use directly.
1847
+ *
1848
+ * @internal
1849
+ */
1850
+ export declare const state: Store<string>;
1851
+
1852
+ export { StateItem }
1853
+
1854
+ /** @internal */
1855
+ declare type Store<T> = Writable<T>;
1856
+
1857
+ /** @internal */
1858
+ export declare type Style = string;
1859
+
1860
+ /** @internal */
1861
+ export declare const SYSTEM_FONT = "sans-serif, serif, monospace, system-ui";
1862
+
1863
+ /**
1864
+ * KARTE のシステム設定情報
1865
+ *
1866
+ * @public
1867
+ */
1868
+ export declare type SystemConfig = {
1869
+ /**
1870
+ * API キー
1871
+ */
1872
+ apiKey?: string;
1873
+ /**
1874
+ * 接客ID
1875
+ */
1876
+ campaignId?: string;
1877
+ shortenId?: string;
1878
+ };
1879
+
1880
+ export { TextBlock }
1881
+
1882
+ export { TextButtonBlock }
1883
+
1884
+ export { TextButtonElement }
1885
+
1886
+ /** @internal */
1887
+ export declare type TextDirection = (typeof TextDirections)[number];
1888
+
1889
+ /** @internal */
1890
+ export declare const TextDirections: readonly [
1891
+ "horizontal",
1892
+ "vertical"
1893
+ ];
1894
+
1895
+ export { TextElement }
1896
+
1897
+ /**
1898
+ * エレメントのライフサイクルを進める
1899
+ *
1900
+ * @returns Promise<void>
1901
+ */
1902
+ export declare const tick: typeof tick_2;
1903
+
1904
+ /** @internal */
1905
+ export declare type TransitState = string;
1906
+
1907
+ /** @internal */
1908
+ export declare type Url = string;
1909
+
1910
+ /** @internal */
1911
+ declare type VariableQuery = {
1912
+ resolver: string;
1913
+ name: string;
1914
+ query: any;
1915
+ preview_value?: any;
1916
+ };
1917
+
1918
+ /**
1919
+ * Store to handle variables
1920
+ *
1921
+ * @internal
1922
+ */
1923
+ export declare const variables: Store<{
1924
+ [key: string]: any;
1925
+ }>;
1926
+
1927
+ export declare namespace widget {
1928
+ /**
1929
+ * アクションの汎用的なタイプを定義する
1930
+ *
1931
+ * モーダル(ポップアップ)やアクションテーブルなど機能別のタイプは含めない。
1932
+ */
1933
+ /**
1934
+ * アクションのイベントハンドラ
1935
+ *
1936
+ * @public
1937
+ */
1938
+ export type ActionEventHandler = (...args: any[]) => any | Promise<any>;
1939
+ /**
1940
+ * アクションの変数
1941
+ *
1942
+ * @public
1943
+ */
1944
+ export type ActionVariables = {
1945
+ [key: string]: any;
1946
+ };
1947
+ /**
1948
+ * アクションの send 関数
1949
+ *
1950
+ * @public
1951
+ */
1952
+ export type SendFunction = (event_name: string, values?: any) => void;
1953
+ /**
1954
+ * アクションの publish 関数
1955
+ *
1956
+ * @public
1957
+ */
1958
+ export type PublishFunction = (topic: string, values?: any) => void;
1959
+ /**
1960
+ * アクション設定
1961
+ *
1962
+ * @public
1963
+ */
1964
+ export type ActionSetting = {
1965
+ send?: SendFunction;
1966
+ publish?: PublishFunction;
1967
+ initialState?: string;
1968
+ };
1969
+ /**
1970
+ * アクションのライフサイクル changeState で呼び出されるフック関数
1971
+ *
1972
+ * @param props - アクションのプロパティ
1973
+ * @param newState - アクションの新しいステート
1974
+ *
1975
+ * @public
1976
+ */
1977
+ export type ActionChangeStateHook<Props, Variables> = (props: Parameters<ActionHook<Props, Variables & ActionVariables>>[0], newState: string) => void | Promise<void>;
1978
+ /**
1979
+ * アクションのプロパティ
1980
+ *
1981
+ * @public
1982
+ */
1983
+ export interface ActionProps<Props, Variables> {
1984
+ /**
1985
+ * アクションでイベントがトリガーされたときに受信するための関数
1986
+ */
1987
+ send: SendFunction;
1988
+ /**
1989
+ * アクション内でタグのQueueにリクエストを発行する関数
1990
+ */
1991
+ publish: PublishFunction;
1992
+ /**
1993
+ * アクションで使用されるデータ
1994
+ */
1995
+ data: Props & Variables & ActionVariables;
1996
+ /**
1997
+ * アクションが表示されたときにフックされる {@link onShow}
1998
+ */
1999
+ onShow?: ActionHook<Props, Variables & ActionVariables>;
2000
+ /**
2001
+ * アクションのステートが変更されたときにフックされる {@link onChangeState}
2002
+ */
2003
+ onChangeState?: ActionChangeStateHook<Props, Variables & ActionVariables>;
2004
+ }
2005
+ /**
2006
+ * アクションのライフサイクルで呼び出されるフック
2007
+ *
2008
+ * @param props - アクションのプロパティ
2009
+ *
2010
+ * @public
2011
+ */
2012
+ export type ActionHook<Props, Variables> = (props: ActionProps<Props, Variables & ActionVariables>) => void | Promise<void>;
2013
+ /**
2014
+ * {@link create} 向けのオプション
2015
+ *
2016
+ * @public
2017
+ */
2018
+ export interface ActionOptions<Props, Variables, VariablesQuery> {
2019
+ /**
2020
+ * アクション内でイベントを発火する関数
2021
+ *
2022
+ * @defaultValue `() => {}`
2023
+ */
2024
+ send?: SendFunction;
2025
+ /**
2026
+ * アクション内でタグのQueueにリクエストを発行する関数
2027
+ *
2028
+ * @defaultValue `() => {}`
2029
+ */
2030
+ publish?: PublishFunction;
2031
+ /**
2032
+ * アクションで使用されるプロパティ
2033
+ *
2034
+ * @defaultValue `{}`
2035
+ */
2036
+ props?: Props;
2037
+ /**
2038
+ * アクションで使用される解析時に取得される変数
2039
+ *
2040
+ * @defaultValue `{}`
2041
+ */
2042
+ variables?: Variables;
2043
+ /**
2044
+ * アクションで使用されるアクション実行時に取得される変数
2045
+ *
2046
+ * @defaultValue `[]`
2047
+ */
2048
+ localVariablesQuery?: VariablesQuery;
2049
+ /**
2050
+ * アクションが作成されているときにフックされる {@link onCreate}
2051
+ *
2052
+ * @defaultValue `() => {}`
2053
+ */
2054
+ onCreate?: ActionHook<Props, Variables & ActionVariables>;
2055
+ /**
2056
+ * KARTEテンプレートの情報
2057
+ *
2058
+ * @defaultValue `{}`
2059
+ */
2060
+ karteTemplate?: {
2061
+ [key: string]: any;
2062
+ };
2063
+ /**
2064
+ * アクション実行時のコンテキスト
2065
+ */
2066
+ context: ActionRunnerContext;
2067
+ }
2068
+ /**
2069
+ * KARTE のシステム設定情報
2070
+ *
2071
+ * @public
2072
+ */
2073
+ export type SystemConfig = {
2074
+ /**
2075
+ * API キー
2076
+ */
2077
+ apiKey?: string;
2078
+ /**
2079
+ * 接客ID
2080
+ */
2081
+ campaignId?: string;
2082
+ shortenId?: string;
2083
+ };
2084
+ /** @internal */
2085
+ export type ActionHookLog = {
2086
+ name: string;
2087
+ values?: any;
2088
+ };
2089
+ /**
2090
+ * アクション実行時のコンテキスト
2091
+ */
2092
+ export type ActionRunnerContext = {
2093
+ api_key: string;
2094
+ target?: "web" | "native";
2095
+ };
2096
+ export type ActionTableResult = number | string | boolean | Date | null | undefined;
2097
+ export type ActionTableQueryParam = string | number | boolean | Date;
2098
+ export type ActionTableQueryParams = {
2099
+ [key: string]: ActionTableQueryParam | ActionTableQueryParam[];
2100
+ };
2101
+ /**
2102
+ * アクションテーブルの設定情報
2103
+ *
2104
+ * @param api_key - API Key
2105
+ * @param table - テーブル名
2106
+ * @param endpoint - エンドポイント / 指定がない場合はデフォルトのエンドポイントを使用します。検証用途以外での通常利用では指定なしで大丈夫です。
2107
+ */
2108
+ export type CollectionConfig = {
2109
+ api_key: string;
2110
+ table: string;
2111
+ endpoint?: string;
2112
+ };
2113
+ /**
2114
+ * アクションテーブルを管理するメソッドを取得する
2115
+ *
2116
+ * @param config - アクションテーブル設定情報
2117
+ *
2118
+ * @returns メソッドを返します
2119
+ *
2120
+ * @public
2121
+ */
2122
+ export function collection(config: CollectionConfig): {
2123
+ get(key: string | Array<string>, cb: (err: Error | null, items?: ActionTableResult | Array<ActionTableResult>) => void): void;
2124
+ getByQuery(query_name: string, params: ActionTableQueryParams, options: {
2125
+ ignore_fields?: string[];
2126
+ } | null | undefined, cb: (err: Error | null, items?: Array<ActionTableResult>) => void): void;
2127
+ set(key: string, value: string, cb: (err: Error | null) => void): void;
2128
+ };
2129
+ /** @internal */
2130
+ export type VariableQuery = {
2131
+ resolver: string;
2132
+ name: string;
2133
+ query: any;
2134
+ preview_value?: any;
2135
+ };
2136
+ /** @internal */
2137
+ export type ActionTableRowRequestConfig = VariableQuery & {
2138
+ resolver: "action-table-row";
2139
+ query: {
2140
+ table_name: string;
2141
+ key: string;
2142
+ default_value?: ActionTableResult;
2143
+ };
2144
+ preview_value?: ActionTableResult;
2145
+ };
2146
+ /** @internal */
2147
+ export type ActionTableRowsRequestConfig = VariableQuery & {
2148
+ resolver: "action-table-rows";
2149
+ query: {
2150
+ table_name: string;
2151
+ keys: Array<string>;
2152
+ default_value?: Array<ActionTableResult>;
2153
+ };
2154
+ preview_value?: Array<ActionTableResult>;
2155
+ };
2156
+ /** @internal */
2157
+ export type ActionTableQueryRequestConfig = VariableQuery & {
2158
+ resolver: "action-table-query";
2159
+ query: {
2160
+ table_name: string;
2161
+ query_name: string;
2162
+ params?: {
2163
+ [key: string]: string;
2164
+ };
2165
+ default_value?: Array<ActionTableResult>;
2166
+ };
2167
+ preview_value?: Array<ActionTableResult>;
2168
+ };
2169
+ /** @internal */
2170
+ export type ActionTableRequestConfig = ActionTableRowRequestConfig | ActionTableRowsRequestConfig | ActionTableQueryRequestConfig;
2171
+ /** @internal */
2172
+ const loadActionTableRow: (config: ActionTableRowRequestConfig, data: {
2173
+ [key: string]: any;
2174
+ }, api_key: string, endpoint?: string) => Promise<unknown>;
2175
+ /** @internal */
2176
+ const loadActionTableRows: (config: ActionTableRowsRequestConfig, data: {
2177
+ [key: string]: any;
2178
+ }, api_key: string, endpoint?: string) => Promise<unknown>;
2179
+ /** @internal */
2180
+ const loadActionTableQuery: (config: ActionTableQueryRequestConfig, data: {
2181
+ [key: string]: any;
2182
+ }, api_key: string, endpoint?: string) => Promise<unknown>;
2183
+ /** @internal */
2184
+ const loadActionTable: (config: Array<VariableQuery>, data: {
2185
+ [key: string]: any;
2186
+ }, api_key: string, endpoint?: string) => Promise<{
2187
+ [key: string]: any;
2188
+ }>;
2189
+ /** @internal */
2190
+ export function setupActionTable(localVariablesQuery: Array<VariableQuery>, data: {
2191
+ [key: string]: any;
2192
+ }, apiKey: string): Promise<{
2193
+ success: boolean;
2194
+ }>;
2195
+ /** @internal */
2196
+ export function initActionTable(localVariablesQuery: Array<VariableQuery> | undefined): void;
2197
+ /**
2198
+ * モーダル(ポップアップ)のプロパティ
2199
+ *
2200
+ * @internal
2201
+ */
2202
+ export interface Props {
2203
+ /**
2204
+ * 全ての条件を満たしたら表示するかどうか
2205
+ */
2206
+ show_and_condition?: boolean;
2207
+ /**
2208
+ * スクロール率による表示を有効化するかどうか
2209
+ */
2210
+ show_on_scroll?: boolean;
2211
+ /**
2212
+ * 表示するスクロール率
2213
+ */
2214
+ show_on_scroll_rate?: number;
2215
+ /**
2216
+ * 条件を満たした時に再表示するかどうか
2217
+ */
2218
+ show_on_scroll_reenter?: boolean;
2219
+ /**
2220
+ * 時間による表示を有効化するかどうか
2221
+ */
2222
+ show_on_time?: boolean;
2223
+ /**
2224
+ * 表示する秒数
2225
+ */
2226
+ show_on_time_count?: number;
2227
+ /**
2228
+ * 全ての条件を満たしたら非表示するかどうか
2229
+ */
2230
+ hide_and_condition?: boolean;
2231
+ /**
2232
+ * スクロール率で非表示を有効化するかどうか
2233
+ */
2234
+ hide_on_scroll?: boolean;
2235
+ /**
2236
+ * 非表示にするスクロール率
2237
+ */
2238
+ hide_on_scroll_rate?: number;
2239
+ /**
2240
+ * 条件を満たした時に表示するかどうか
2241
+ */
2242
+ hide_on_scroll_releave?: boolean;
2243
+ /**
2244
+ * 時間による非表示を有効化するかどうか
2245
+ */
2246
+ hide_on_time?: boolean;
2247
+ /**
2248
+ * 非表示にする秒数
2249
+ */
2250
+ hide_on_time_count?: number;
2251
+ }
2252
+ /**
2253
+ * スクロールに応じてアクションを非表示にするトリガー関数
2254
+ *
2255
+ * @remarks
2256
+ * スクロール率が `hide_on_scroll_rate` に達したときに `hide` 関数を呼び出します。
2257
+ * `show_on_scroll_reenter` が `true` で、かつ `hide_on_scroll_rate` またはその値以下の場合、アクションに対して `show` 関数が呼び出されます。
2258
+ *
2259
+ * @param props - アクションのプロパティ。プロパティには `hide_on_scroll`、`hide_on_scroll_rate` そして `show_on_scroll_reenter` が必要です。
2260
+ * @param hide - アクションを非表示にするロジックが実装された関数。指定ない場合は noop 関数が使用されます。
2261
+ * @param show - アクションを再び表示するロジックが実装された関数。指定ない場合は noop 関数が使用されます。
2262
+ *
2263
+ * @returns
2264
+ * スクロールが開始された場合は、クリーンアップする関数を返します。そうでない場合は `null` を返します。
2265
+ *
2266
+ * @internal
2267
+ */
2268
+ export function hideOnScroll<ModalProps extends Pick<Props, "hide_on_scroll" | "hide_on_scroll_rate" | "show_on_scroll_reenter">>(props: ModalProps, hide?: Function, show?: Function): (() => void) | null;
2269
+ /**
2270
+ * 時間に応じてアクションを非表示にするトリガー関数
2271
+ *
2272
+ * @remarks
2273
+ * 時間のカウントが `hide_on_time_count` に達したときに `hide` 関数を呼び出します。
2274
+ *
2275
+ * @param props - アクションのプロパティ。プロパティには `hide_on_time` そして `hide_on_time_count` が必要です。
2276
+ * @param hide - アクションを非表示にするロジックが実装された関数。指定ない場合は noop 関数が使用されます。
2277
+ *
2278
+ * @returns
2279
+ * タイマーが開始された場合、タイマーをクリーンアップする関数を返します。それ以外は `null` を返します。
2280
+ *
2281
+ * @internal
2282
+ */
2283
+ export function hideOnTime<ModalProps extends Pick<Props, "hide_on_time" | "hide_on_time_count">>(props: ModalProps, hide?: Function): (() => void) | null;
2284
+ /**
2285
+ * スクロールに応じてアクションを表示するトリガー関数
2286
+ *
2287
+ * @remarks
2288
+ * スクロール率が `show_on_scroll_rate` に達したときに `show` 関数を呼び出します。
2289
+ * `hide_on_scroll_releave` が `true` で、かつ `show_on_scroll_rate` 以下の場合は、アクションに対して `hide` 関数が呼び出されます。
2290
+ *
2291
+ * @param props - アクションのプロパティ。プロパティには `show_on_scroll`、`show_on_scroll_rate` そして `hide_on_scroll_releave` が必要です。
2292
+ * @param show - アクションを表示するロジックが実装された関数。指定ない場合は noop 関数が使用されます。
2293
+ * @param hide - アクションを非表示にするロジックが実装された関数。指定ない場合は noop 関数が使用されます。
2294
+ *
2295
+ * @returns
2296
+ * スクロールが開始されている場合は、クリーンアップ関数を返します。そうでない場合は `null` を返します
2297
+ *
2298
+ * @internal
2299
+ */
2300
+ export function showOnScroll<ModalProps extends Pick<Props, "show_on_scroll" | "show_on_scroll_rate" | "hide_on_scroll_releave">>(props: ModalProps, show?: Function, hide?: Function): (() => void) | null;
2301
+ /**
2302
+ * 時間に応じてアクションを表示するトリガー関数
2303
+ *
2304
+ * @param props - アクションのプロパティ。プロパティには `show_on_time` そして `show_on_time_count` が必要です。
2305
+ * @param show - アクションを表示するロジックが実装された関数。指定ない場合は noop 関数が使用されます。
2306
+ *
2307
+ * @remarks
2308
+ * 時間のカウントが `show_on_time_count` に達したときに `show` 関数を呼び出します。
2309
+ *
2310
+ * @returns
2311
+ * タイマーが開始された場合、タイマーをクリーンアップする関数を返します。それ以外は `null` を返します。
2312
+ *
2313
+ * @internal
2314
+ */
2315
+ export function showOnTime<ModalProps extends Pick<Props, "show_on_time" | "show_on_time_count">>(props: ModalProps, show?: Function): (() => void) | null;
2316
+ /** @internal */
2317
+ export function and(fn: Function, ...conditionFns: Function[]): () => void;
2318
+ /** @internal */
2319
+ export function or(fn: Function, ...conditionFns: Function[]): () => void;
2320
+ export type ModalProps = Props;
2321
+ /**
2322
+ * 表示アクショントリガー
2323
+ *
2324
+ * @internal */
2325
+ export type ShowTrigger = "custom" | "auto" | "none";
2326
+ /**
2327
+ * 閉じるアクショントリガー
2328
+ *
2329
+ * @public
2330
+ */
2331
+ export type CloseTrigger = "button" | "overlay" | "auto" | "none";
2332
+ /** @internal */
2333
+ const handleState: (event: any) => void;
2334
+ /**
2335
+ * アクションが表示 (show) された後にフックする関数
2336
+ *
2337
+ * @param fn - 呼び出されるフック関数
2338
+ *
2339
+ * @public
2340
+ */
2341
+ export function onShow<Props extends ModalProps, Variables>(fn: ActionHook<Props, Variables & ActionVariables>): void;
2342
+ /**
2343
+ * アクションのライフサイクル close で呼び出されるフックする関数
2344
+ *
2345
+ * @param props - アクションのプロパティ
2346
+ * @param trigger - Close トリガー
2347
+ *
2348
+ * @public
2349
+ */
2350
+ export type ActionCloseHook<Props extends ModalProps, Variables> = (props: Parameters<ActionHook<Props, Variables & ActionVariables>>[0], trigger: CloseTrigger) => void | Promise<void>;
2351
+ /**
2352
+ * アクションがクローズ (close) される前にフックする関数
2353
+ *
2354
+ * @param fn - 呼び出されるフック関数
2355
+ *
2356
+ * @public
2357
+ */
2358
+ export function onClose<Props extends ModalProps, Variables>(fn: ActionCloseHook<Props, Variables & ActionVariables>): void;
2359
+ /**
2360
+ * アクションのステートが変更された (changeState) 後にフックする関数
2361
+ *
2362
+ * @param fn - 呼び出されるフック関数
2363
+ *
2364
+ * @public
2365
+ */
2366
+ export function onChangeState<Props extends ModalProps, Variables>(fn: ActionChangeStateHook<Props, Variables & ActionVariables>): void;
2367
+ /**
2368
+ * アクションを表示する
2369
+ *
2370
+ * @public
2371
+ */
2372
+ export function showAction(): void;
2373
+ /**
2374
+ * アクションを閉じる
2375
+ *
2376
+ * @param trigger - 閉じた時のトリガー。デフォルト `'none'`
2377
+ *
2378
+ * @public
2379
+ */
2380
+ export function closeAction(trigger?: CloseTrigger): void;
2381
+ /**
2382
+ * アクションに CSS を適用する
2383
+ *
2384
+ * @param css - 適用する CSS
2385
+ *
2386
+ * @returns 適用された style 要素を返す Promise
2387
+ *
2388
+ * @public
2389
+ */
2390
+ export function applyCss(css: string): Promise<HTMLStyleElement>;
2391
+ /**
2392
+ * アクションにグローバルなスタイルを読み込む
2393
+ *
2394
+ * @param href - style ファイルのリンク URL
2395
+ *
2396
+ * @public
2397
+ */
2398
+ export function loadStyle(href: string): Promise<void>;
2399
+ // @internal
2400
+ export function getCssVariables(data: {
2401
+ [key: string]: string | number;
2402
+ }): string;
2403
+ /**
2404
+ * アクションのルートの DOM 要素を取得する
2405
+ *
2406
+ * @returns アクションがルートの DOM 要素 を持つ場合は DOM 要素を返します。ない場合は `null` を返します
2407
+ *
2408
+ * @public
2409
+ */
2410
+ export function getActionRoot(): ShadowRoot | null;
2411
+ /** @internal */
2412
+ export function createModal<Props extends ModalProps, Variables, VariablesQuery extends Array<VariableQuery>>(App: typeof SvelteComponentDev, options?: ActionOptions<Props, Variables & ActionVariables, VariablesQuery>): () => void;
2413
+ /** @internal */
2414
+ export function ensureActionRoot(useShadow?: boolean): ShadowRoot | HTMLElement;
2415
+ // -------- The following codes are deprecated --------
2416
+ /**
2417
+ * 非推奨
2418
+ *
2419
+ * @deprecated 非推奨
2420
+ *
2421
+ * @internal
2422
+ */
2423
+ export function getActionShadowRoot(): ShadowRoot | null;
2424
+ /**
2425
+ * 非推奨
2426
+ *
2427
+ * @deprecated 非推奨
2428
+ *
2429
+ * @internal
2430
+ */
2431
+ const show: typeof showAction;
2432
+ /**
2433
+ * 非推奨
2434
+ *
2435
+ * @deprecated 非推奨
2436
+ *
2437
+ * @internal
2438
+ */
2439
+ const close: typeof closeAction;
2440
+ /**
2441
+ * 非推奨
2442
+ *
2443
+ * @deprecated 非推奨
2444
+ *
2445
+ * @internal
2446
+ */
2447
+ export interface App {
2448
+ /**
2449
+ * The method to destroy an app instance.
2450
+ */
2451
+ close: () => void;
2452
+ /**
2453
+ * The method to show an app instance.
2454
+ */
2455
+ show: () => void;
2456
+ }
2457
+ /**
2458
+ * 非推奨
2459
+ *
2460
+ * @deprecated 非推奨
2461
+ *
2462
+ * @internal
2463
+ */
2464
+ export type AppOptions<Props, Variables, VariablesQuery> = ActionOptions<Props, Variables, VariablesQuery>;
2465
+ /**
2466
+ * 非推奨
2467
+ *
2468
+ * @deprecated 非推奨
2469
+ *
2470
+ * @internal
2471
+ */
2472
+ export type ModalOptions<Props, Variables, VariablesQuery> = ActionOptions<Props, Variables, VariablesQuery>;
2473
+ /**
2474
+ * 非推奨
2475
+ *
2476
+ * @deprecated 非推奨
2477
+ *
2478
+ * @internal
2479
+ */
2480
+ const ensureModalRoot: typeof ensureActionRoot;
2481
+ /**
2482
+ * 非推奨
2483
+ *
2484
+ * @deprecated 非推奨
2485
+ *
2486
+ * @internal
2487
+ */
2488
+ export function createApp<Props, Variables, VariablesQuery>(App: typeof SvelteComponentDev, options?: AppOptions<Props, Variables, VariablesQuery>): App;
2489
+ /**
2490
+ * 非推奨
2491
+ *
2492
+ * @deprecated 非推奨
2493
+ *
2494
+ * @internal
2495
+ */
2496
+ export function createFog({ color, opacity, zIndex, onclick }: {
2497
+ color?: string;
2498
+ opacity?: string;
2499
+ zIndex?: number;
2500
+ onclick: () => void;
2501
+ }): {
2502
+ fog: HTMLDivElement;
2503
+ close: () => void;
2504
+ };
2505
+ // @ts-ignore
2506
+ export type ChangeValCallback = ({ newVal, oldVal, key }: {
2507
+ newVal: any;
2508
+ oldVal: any;
2509
+ key: any;
2510
+ }) => void;
2511
+ export type EventCallback = (event: any) => void;
2512
+ export type WidgetEventName = "hide" | "clickBackdrop" | "destroyed";
2513
+ /**
2514
+ * 変数を設定する
2515
+ *
2516
+ * @param name - 変数名
2517
+ * @param value - 変数値
2518
+ *
2519
+ * @public
2520
+ */
2521
+ export function setVal(name: string, value: any): void;
2522
+ /**
2523
+ * 変数を取得する
2524
+ *
2525
+ * @param name - 変数名
2526
+ *
2527
+ * @returns 変数値
2528
+ *
2529
+ * @public
2530
+ */
2531
+ export function getVal(name: string): any;
2532
+ /**
2533
+ * 変数が変更されたときに実行されるコールバック関数を設定する
2534
+ *
2535
+ * @param name - 変数名
2536
+ * @param callback - コールバック関数
2537
+ *
2538
+ * @public
2539
+ */
2540
+ export function onChangeVal(name: string, callback: ChangeValCallback): void;
2541
+ /**
2542
+ * WEBのイベントが発生したときに実行されるコールバック関数を設定する
2543
+ *
2544
+ * @param name - WEBのイベント名
2545
+ * @param callback - コールバック関数
2546
+ *
2547
+ * @public
2548
+ */
2549
+ export function method(name: string, callback: EventCallback): void;
2550
+ /**
2551
+ * Widgetのイベントが発生したときに実行されるコールバック関数を設定する
2552
+ *
2553
+ * @param name - Widgetのイベント名
2554
+ * @param callback - コールバック関数
2555
+ *
2556
+ * @public
2557
+ */
2558
+ export function on(name: WidgetEventName, callback: EventCallback): void;
2559
+ /**
2560
+ * 現在のステートを設定する
2561
+ *
2562
+ * @param stateId - ステートID
2563
+ *
2564
+ * @public
2565
+ */
2566
+ export function setState(stateId: string): void;
2567
+ /**
2568
+ * 現在のステートを取得する
2569
+ *
2570
+ * @returns ステートID
2571
+ *
2572
+ * @public
2573
+ */
2574
+ export function getState(): string;
2575
+ /**
2576
+ * ページ内の変数を設定する
2577
+ *
2578
+ * @param key - 変数のキー
2579
+ * @param value - 変数値
2580
+ *
2581
+ * @public
2582
+ */
2583
+ export function setMemoryStore(key: string, value: any): void;
2584
+ /**
2585
+ * ページ内の変数を取定する
2586
+ *
2587
+ * @param key - 変数のキー
2588
+ *
2589
+ * @returns 変数
2590
+ *
2591
+ * @public
2592
+ */
2593
+ export function getMemoryStore(key: string): any;
2594
+ /**
2595
+ * ページをまたぐ変数を設定する
2596
+ *
2597
+ * @param key - 変数のキー
2598
+ * @param value - 変数値
2599
+ *
2600
+ * @public
2601
+ */
2602
+ export function setLocalStore(key: string, value: any, options?: {
2603
+ expire: number | boolean;
2604
+ }): void;
2605
+ /**
2606
+ * ページをまたぐ変数を取得設定する
2607
+ *
2608
+ * @param key - 変数のキー
2609
+ *
2610
+ * @returns 変数
2611
+ *
2612
+ * @public
2613
+ */
2614
+ export function getLocalStore(key: string): any | undefined;
2615
+ const storage: {
2616
+ memory: {
2617
+ store: typeof setMemoryStore;
2618
+ restore: typeof getMemoryStore;
2619
+ };
2620
+ local: {
2621
+ store: typeof setLocalStore;
2622
+ restore: typeof getLocalStore;
2623
+ };
2624
+ };
2625
+ /**
2626
+ * アクションテーブルを操作するオブジェクト
2627
+ *
2628
+ * @param table - アクションテーブル名
2629
+ *
2630
+ * @public
2631
+ */
2632
+ export function collection$0(table: string): {
2633
+ get(key: string | string[], cb: (err: Error, items?: (string | number | boolean | Date) | (string | number | boolean | Date)[]) => void): void;
2634
+ getByQuery(query_name: string, params: {
2635
+ [key: string]: (string | number | boolean | Date) | (string | number | boolean | Date)[];
2636
+ }, options: {
2637
+ ignore_fields?: string[];
2638
+ }, cb: (err: Error, items?: (string | number | boolean | Date)[]) => void): void;
2639
+ set(key: string, value: string, cb: (err: Error) => void): void;
2640
+ };
2641
+ /**
2642
+ * アクションを表示する
2643
+ *
2644
+ * @remarks
2645
+ * この関数は {@link showAction} のエイリアスです
2646
+ *
2647
+ * @public
2648
+ */
2649
+ { showAction as show, closeAction as hide };
2650
+ }
2651
+
2652
+ /** @internal */
2653
+ export declare type WritingMode = (typeof WritingModes)[number];
2654
+
2655
+ /** @internal */
2656
+ export declare const WritingModes: readonly [
2657
+ "horizontal-tb",
2658
+ "vertical-lr"
2659
+ ];
2660
+
2661
+ export { }