@plaidev/karte-action-sdk 1.1.176 → 1.1.177

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,529 +1,521 @@
1
+ import { SvelteComponentDev } from "svelte/internal";
1
2
  import { Writable } from "svelte/store";
2
- import { get as get_ } from "svelte/store";
3
3
  import { Writable as Writable_ } from "svelte/store";
4
- import { SvelteComponentDev } from "svelte/internal";
5
4
  import { onMount as onMountSvelte } from "svelte";
6
5
  import { onDestroy as onDestorySvelte } from "svelte";
7
6
  import { beforeUpdate as beforeUpdateSvelte } from "svelte";
8
7
  import { afterUpdate as afterUpdateSvelte } from "svelte";
9
8
  import { tick as tickSvelte } from "svelte";
10
9
  /** @internal */
11
- declare const PropTypes: readonly [
12
- "BooleanKeyword",
13
- "NumberKeyword",
14
- "StringKeyword",
15
- "Function",
16
- "Enum",
17
- "Code",
18
- "Direction",
19
- "Url",
20
- "Image",
21
- "AnimationStyle",
22
- "LongText",
23
- "Length",
24
- "Color",
25
- "Alignment",
26
- "State",
27
- "TransitState",
28
- "Style",
29
- "ModalPlacement",
30
- "OnClick"
31
- ];
10
+ declare const ACTION_HOOK_LABEL = "__ACTION_HOOK__";
11
+ // -------- The following codes are deprecated --------
12
+ /**
13
+ * 非推奨
14
+ *
15
+ * @deprecated 非推奨
16
+ *
17
+ * @internal
18
+ */
19
+ declare const KARTE_MODAL_ROOT = "karte-modal-root";
20
+ /**
21
+ * アクションの汎用的なタイプを定義する
22
+ *
23
+ * モーダル(ポップアップ)やアクションテーブルなど機能別のタイプは含めない。
24
+ */
25
+ /**
26
+ * アクションのイベントハンドラ
27
+ *
28
+ * @public
29
+ */
30
+ type ActionEventHandler = (...args: any[]) => any | Promise<any>;
31
+ /**
32
+ * アクションの変数
33
+ *
34
+ * @public
35
+ */
36
+ type ActionVariables = {
37
+ [key: string]: any;
38
+ };
39
+ /**
40
+ * アクション設定
41
+ *
42
+ * @public
43
+ */
44
+ type ActionSetting = {
45
+ send?: (event_name: string, values?: any) => void;
46
+ initialState?: string;
47
+ };
48
+ /**
49
+ * アクションの send 関数
50
+ *
51
+ * @public
52
+ */
53
+ type SendFunction = (event_name: string, values?: any) => void;
54
+ /**
55
+ * アクションの publish 関数
56
+ *
57
+ * @public
58
+ */
59
+ type PublishFunction = (topic: string, values?: any) => void;
60
+ /**
61
+ * アクションのライフサイクル changeState で呼び出されるフック関数
62
+ *
63
+ * @param props - アクションのプロパティ
64
+ * @param newState - アクションの新しいステート
65
+ *
66
+ * @public
67
+ */
68
+ type ActionChangeStateHook<Props, Variables> = (props: Parameters<ActionHook<Props, Variables & ActionVariables>>[0], newState: string) => void | Promise<void>;
69
+ /**
70
+ * アクションのプロパティ
71
+ *
72
+ * @public
73
+ */
74
+ interface ActionProps<Props, Variables> {
75
+ /**
76
+ * アクションでイベントがトリガーされたときに受信するための関数
77
+ */
78
+ send: SendFunction;
79
+ /**
80
+ * アクション内でタグのQueueにリクエストを発行する関数
81
+ */
82
+ publish: PublishFunction;
83
+ /**
84
+ * アクションで使用されるデータ
85
+ */
86
+ data: Props & Variables & ActionVariables;
87
+ /**
88
+ * アクションが表示されたときにフックされる {@link onShow}
89
+ */
90
+ onShow?: ActionHook<Props, Variables & ActionVariables>;
91
+ /**
92
+ * アクションのステートが変更されたときにフックされる {@link onChangeState}
93
+ */
94
+ onChangeState?: ActionChangeStateHook<Props, Variables & ActionVariables>;
95
+ }
96
+ /**
97
+ * アクションのライフサイクルで呼び出されるフック
98
+ *
99
+ * @param props - アクションのプロパティ
100
+ *
101
+ * @public
102
+ */
103
+ type ActionHook<Props, Variables> = (props: ActionProps<Props, Variables & ActionVariables>) => void | Promise<void>;
104
+ /**
105
+ * {@link create} 向けのオプション
106
+ *
107
+ * @public
108
+ */
109
+ interface ActionOptions<Props, Variables, VariablesQuery> {
110
+ /**
111
+ * アクション内でイベントを発火する関数
112
+ *
113
+ * @defaultValue `() => {}`
114
+ */
115
+ send?: SendFunction;
116
+ /**
117
+ * アクション内でタグのQueueにリクエストを発行する関数
118
+ *
119
+ * @defaultValue `() => {}`
120
+ */
121
+ publish?: PublishFunction;
122
+ /**
123
+ * アクションで使用されるプロパティ
124
+ *
125
+ * @defaultValue `{}`
126
+ */
127
+ props?: Props;
128
+ /**
129
+ * アクションで使用される解析時に取得される変数
130
+ *
131
+ * @defaultValue `{}`
132
+ */
133
+ variables?: Variables;
134
+ /**
135
+ * アクションで使用されるアクション実行時に取得される変数
136
+ *
137
+ * @defaultValue `[]`
138
+ */
139
+ localVariablesQuery?: VariablesQuery;
140
+ /**
141
+ * アクションが作成されているときにフックされる {@link onCreate}
142
+ *
143
+ * @defaultValue `() => {}`
144
+ */
145
+ onCreate?: ActionHook<Props, Variables & ActionVariables>;
146
+ }
147
+ /**
148
+ * KARTE のシステム設定情報
149
+ *
150
+ * @public
151
+ */
152
+ type SystemConfig = {
153
+ /**
154
+ * API キー
155
+ */
156
+ apiKey?: string;
157
+ /**
158
+ * 接客ID
159
+ */
160
+ campaignId?: string;
161
+ shortenId?: string;
162
+ };
163
+ type ActionTableResult = number | string | boolean | Date | null | undefined;
164
+ type ActionTableQueryParam = string | number | boolean | Date;
165
+ type ActionTableQueryParams = {
166
+ [key: string]: ActionTableQueryParam | ActionTableQueryParam[];
167
+ };
168
+ /**
169
+ * アクションテーブルの設定情報
170
+ *
171
+ * @public
172
+ */
173
+ type CollectionConfig = {
174
+ /**
175
+ * APIキー
176
+ */
177
+ api_key: string;
178
+ /**
179
+ * テーブル名
180
+ */
181
+ table: string;
182
+ /**
183
+ * エンドポイント
184
+ */
185
+ endpoint?: string;
186
+ };
187
+ /**
188
+ * アクションテーブルを管理するメソッドを取得する
189
+ *
190
+ * @param config - 設定情報
191
+ *
192
+ * @returns メソッドを返します
193
+ *
194
+ * @public
195
+ */
196
+ declare function collection(config: CollectionConfig): {
197
+ get(key: string | Array<string>, cb: (err: Error | null, items?: ActionTableResult | Array<ActionTableResult>) => void): void;
198
+ getByQuery(query_name: string, params: ActionTableQueryParams, options: {
199
+ ignore_fields?: string[];
200
+ } | null | undefined, cb: (err: Error | null, items?: Array<ActionTableResult>) => void): void;
201
+ set(key: string, value: string, cb: (err: Error | null) => void): void;
202
+ };
32
203
  /** @internal */
33
- type PropType = (typeof PropTypes)[number];
204
+ type VariableQuery = {
205
+ resolver: string;
206
+ name: string;
207
+ query: any;
208
+ preview_value?: any;
209
+ };
34
210
  /** @internal */
35
- type Code = string;
211
+ type ActionTableRowRequestConfig = VariableQuery & {
212
+ resolver: "action-table-row";
213
+ query: {
214
+ table_name: string;
215
+ key: string;
216
+ default_value?: ActionTableResult;
217
+ };
218
+ preview_value?: ActionTableResult;
219
+ };
36
220
  /** @internal */
37
- declare const MediaQueries: {
38
- [key: string]: string;
221
+ type ActionTableRowsRequestConfig = VariableQuery & {
222
+ resolver: "action-table-rows";
223
+ query: {
224
+ table_name: string;
225
+ key: Array<string>;
226
+ default_value?: Array<ActionTableResult>;
227
+ };
228
+ preview_value?: Array<ActionTableResult>;
39
229
  };
40
230
  /** @internal */
41
- type MediaQuery = string;
231
+ type ActionTableQueryRequestConfig = VariableQuery & {
232
+ resolver: "action-table-query";
233
+ query: {
234
+ table_name: string;
235
+ query_name: string;
236
+ params?: ActionTableQueryParams;
237
+ default_value?: Array<ActionTableResult>;
238
+ };
239
+ preview_value?: Array<ActionTableResult>;
240
+ };
42
241
  /** @internal */
43
- declare const Directions: readonly [
44
- "row",
45
- "column"
46
- ];
242
+ type ActionTableRequestConfig = ActionTableRowRequestConfig | ActionTableRowsRequestConfig | ActionTableQueryRequestConfig;
47
243
  /** @internal */
48
- type Direction = (typeof Directions)[number];
244
+ declare const loadActionTableRow: (config: ActionTableRowRequestConfig, api_key: string, endpoint?: string) => Promise<unknown>;
49
245
  /** @internal */
50
- declare const AnimationStyles: readonly [
51
- "none",
52
- "fade",
53
- "bounce",
54
- "slide-down",
55
- "slide-up",
56
- "slide-left",
57
- "slide-right"
58
- ];
59
- /** @internal */
60
- type AnimationStyle = (typeof AnimationStyles)[number];
61
- /** @internal */
62
- declare const ModalPositions: readonly [
63
- "top-left",
64
- "top-center",
65
- "top-right",
66
- "center-left",
67
- "center",
68
- "center-right",
69
- "bottom-left",
70
- "bottom-center",
71
- "bottom-right",
72
- "none"
73
- ];
74
- /** @internal */
75
- type ModalPosition = (typeof ModalPositions)[number];
76
- /** @internal */
77
- type ModalMargin = {
78
- left?: string;
79
- right?: string;
80
- top?: string;
81
- bottom?: string;
82
- };
83
- /** @internal */
84
- type ModalPlacement<M = ModalMargin> = {
85
- position?: ModalPosition;
86
- margin?: M;
87
- backgroundOverlay?: boolean;
88
- backgroundClick?: OnClickOperation;
89
- };
90
- /** @internal */
91
- declare const DefaultModalPlacement: Required<ModalPlacement<Required<ModalMargin>>>;
92
- /** @internal */
93
- declare const Elasticities: readonly [
94
- "none",
95
- "vertical",
96
- "horizontal"
97
- ];
98
- /** @internal */
99
- type Elasticity = (typeof Elasticities)[number];
100
- /** @internal */
101
- declare const ElasticityStyle: {
102
- none: string;
103
- vertical: string;
104
- horizontal: string;
105
- };
246
+ declare const loadActionTableRows: (config: ActionTableRowsRequestConfig, api_key: string, endpoint?: string) => Promise<unknown>;
106
247
  /** @internal */
107
- declare const TextDirections: readonly [
108
- "horizontal",
109
- "vertical"
110
- ];
248
+ declare const loadActionTableQuery: (config: ActionTableQueryRequestConfig, api_key: string, endpoint?: string) => Promise<unknown>;
249
+ declare const loadActionTable: (config: Array<VariableQuery>, api_key: string, endpoint?: string) => Promise<{
250
+ [key: string]: any;
251
+ }>;
252
+ /**
253
+ * モーダル(ポップアップ)のプロパティ
254
+ *
255
+ * @internal
256
+ */
257
+ interface Props {
258
+ /**
259
+ * 全ての条件を満たしたら表示するかどうか
260
+ */
261
+ show_and_condition?: boolean;
262
+ /**
263
+ * スクロール率による表示を有効化するかどうか
264
+ */
265
+ show_on_scroll?: boolean;
266
+ /**
267
+ * 表示するスクロール率
268
+ */
269
+ show_on_scroll_rate?: number;
270
+ /**
271
+ * 条件を満たした時に再表示するかどうか
272
+ */
273
+ show_on_scroll_reenter?: boolean;
274
+ /**
275
+ * 時間による表示を有効化するかどうか
276
+ */
277
+ show_on_time?: boolean;
278
+ /**
279
+ * 表示する秒数
280
+ */
281
+ show_on_time_count?: number;
282
+ /**
283
+ * 全ての条件を満たしたら非表示するかどうか
284
+ */
285
+ hide_and_condition?: boolean;
286
+ /**
287
+ * スクロール率で非表示を有効化するかどうか
288
+ */
289
+ hide_on_scroll?: boolean;
290
+ /**
291
+ * 非表示にするスクロール率
292
+ */
293
+ hide_on_scroll_rate?: number;
294
+ /**
295
+ * 条件を満たした時に表示するかどうか
296
+ */
297
+ hide_on_scroll_releave?: boolean;
298
+ /**
299
+ * 時間による非表示を有効化するかどうか
300
+ */
301
+ hide_on_time?: boolean;
302
+ /**
303
+ * 非表示にする秒数
304
+ */
305
+ hide_on_time_count?: number;
306
+ }
307
+ /**
308
+ * スクロールに応じてアクションを非表示にするトリガー関数
309
+ *
310
+ * @remarks
311
+ * スクロール率が `hide_on_scroll_rate` に達したときに `hide` 関数を呼び出します。
312
+ * `show_on_scroll_reenter` が `true` で、かつ `hide_on_scroll_rate` またはその値以下の場合、アクションに対して `show` 関数が呼び出されます。
313
+ *
314
+ * @param props - アクションのプロパティ。プロパティには `hide_on_scroll`、`hide_on_scroll_rate` そして `show_on_scroll_reenter` が必要です。
315
+ * @param hide - アクションを非表示にするロジックが実装された関数。指定ない場合は noop 関数が使用されます。
316
+ * @param show - アクションを再び表示するロジックが実装された関数。指定ない場合は noop 関数が使用されます。
317
+ *
318
+ * @returns
319
+ * スクロールが開始された場合は、クリーンアップする関数を返します。そうでない場合は `null` を返します。
320
+ *
321
+ * @internal
322
+ */
323
+ 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;
324
+ /**
325
+ * 時間に応じてアクションを非表示にするトリガー関数
326
+ *
327
+ * @remarks
328
+ * 時間のカウントが `hide_on_time_count` に達したときに `hide` 関数を呼び出します。
329
+ *
330
+ * @param props - アクションのプロパティ。プロパティには `hide_on_time` そして `hide_on_time_count` が必要です。
331
+ * @param hide - アクションを非表示にするロジックが実装された関数。指定ない場合は noop 関数が使用されます。
332
+ *
333
+ * @returns
334
+ * タイマーが開始された場合、タイマーをクリーンアップする関数を返します。それ以外は `null` を返します。
335
+ *
336
+ * @internal
337
+ */
338
+ declare function hideOnTime<ModalProps extends Pick<Props, "hide_on_time" | "hide_on_time_count">>(props: ModalProps, hide?: Function): (() => void) | null;
339
+ /**
340
+ * スクロールに応じてアクションを表示するトリガー関数
341
+ *
342
+ * @remarks
343
+ * スクロール率が `show_on_scroll_rate` に達したときに `show` 関数を呼び出します。
344
+ * `hide_on_scroll_releave` が `true` で、かつ `show_on_scroll_rate` 以下の場合は、アクションに対して `hide` 関数が呼び出されます。
345
+ *
346
+ * @param props - アクションのプロパティ。プロパティには `show_on_scroll`、`show_on_scroll_rate` そして `hide_on_scroll_releave` が必要です。
347
+ * @param show - アクションを表示するロジックが実装された関数。指定ない場合は noop 関数が使用されます。
348
+ * @param hide - アクションを非表示にするロジックが実装された関数。指定ない場合は noop 関数が使用されます。
349
+ *
350
+ * @returns
351
+ * スクロールが開始されている場合は、クリーンアップ関数を返します。そうでない場合は `null` を返します
352
+ *
353
+ * @internal
354
+ */
355
+ 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;
356
+ /**
357
+ * 時間に応じてアクションを表示するトリガー関数
358
+ *
359
+ * @param props - アクションのプロパティ。プロパティには `show_on_time` そして `show_on_time_count` が必要です。
360
+ * @param show - アクションを表示するロジックが実装された関数。指定ない場合は noop 関数が使用されます。
361
+ *
362
+ * @remarks
363
+ * 時間のカウントが `show_on_time_count` に達したときに `show` 関数を呼び出します。
364
+ *
365
+ * @returns
366
+ * タイマーが開始された場合、タイマーをクリーンアップする関数を返します。それ以外は `null` を返します。
367
+ *
368
+ * @internal
369
+ */
370
+ declare function showOnTime<ModalProps extends Pick<Props, "show_on_time" | "show_on_time_count">>(props: ModalProps, show?: Function): (() => void) | null;
371
+ type ModalProps = Props;
111
372
  /** @internal */
112
- type TextDirection = (typeof TextDirections)[number];
113
- type OperationArgumentTypes = {
114
- StringKeyword: string;
115
- BooleanKeyword: boolean;
116
- NumberKeyword: number;
117
- TransitState: string;
118
- Url: string;
119
- Handler: string;
120
- Trigger: string;
373
+ type ActionHookLog = {
374
+ name: string;
375
+ values?: any;
121
376
  };
122
377
  /** @internal */
123
- type OperationArgumentType = keyof OperationArgumentTypes;
124
- type BaseOperationOptions = ReadonlyArray<{
125
- operation: string;
126
- args: ReadonlyArray<{
127
- type: OperationArgumentType;
128
- default: any;
129
- }>;
130
- }>;
131
- type ConvertOperationOptions<O extends BaseOperationOptions> = ConvertOperationOption<O[number]>;
132
- type ConvertOperationOption<Option extends BaseOperationOptions[number]> = Option extends any ? {
133
- operation: Option["operation"];
134
- args: ConvertOperationOptionArguments<Option["args"]>;
135
- } : never;
136
- type ConvertOperationOptionArguments<Arguments extends BaseOperationOptions[number]["args"]> = {
137
- -readonly [Index in keyof Arguments]: Arguments[Index] extends BaseOperationOptions[number]["args"][number] ? OperationArgumentTypes[Arguments[Index]["type"]] : never;
138
- };
378
+ declare const initialize: (setting?: ActionSetting) => () => void;
139
379
  /** @internal */
140
- type Operation = ConvertOperationOptions<ReadonlyArray<any>>;
380
+ declare const finalize: () => void;
381
+ /**
382
+ * アクションを作成する
383
+ *
384
+ * @param App - Svelte コンポーネントのエントリポイント
385
+ * @param options - {@link ActionOptions | オプション}
386
+ *
387
+ * @returns アクションを破棄する関数
388
+ *
389
+ * @public
390
+ */
391
+ declare function create<Props extends ModalProps, Variables, VariablesQuery extends Array<VariableQuery>>(App: typeof SvelteComponentDev, options?: ActionOptions<Props, Variables & ActionVariables, VariablesQuery>): () => void;
141
392
  /** @internal */
142
- declare const OnClickOperationOptions: readonly [
143
- {
144
- readonly operation: "none";
145
- readonly args: readonly [
146
- ];
147
- },
148
- {
149
- readonly operation: "linkTo";
150
- readonly args: readonly [
151
- {
152
- readonly type: "Url";
153
- readonly default: "";
154
- },
155
- {
156
- readonly type: "BooleanKeyword";
157
- readonly default: true;
158
- }
159
- ];
160
- },
161
- {
162
- readonly operation: "moveTo";
163
- readonly args: readonly [
164
- {
165
- readonly type: "TransitState";
166
- readonly default: "/";
167
- }
168
- ];
169
- },
170
- {
171
- readonly operation: "closeApp";
172
- readonly args: readonly [
173
- {
174
- readonly type: "Trigger";
175
- readonly default: "button";
176
- }
177
- ];
178
- },
179
- {
180
- readonly operation: "runScript";
181
- readonly args: readonly [
182
- {
183
- readonly type: "Handler";
184
- readonly default: "";
185
- }
186
- ];
187
- },
188
- {
189
- readonly operation: "submitForm";
190
- readonly args: readonly [
191
- {
192
- readonly type: "TransitState";
193
- readonly default: "/";
194
- }
195
- ];
196
- }
197
- ];
198
- /** @internal */
199
- type OnClickOperation = ConvertOperationOptions<typeof OnClickOperationOptions>;
200
- /** @internal */
201
- type LongText = string;
202
- /** @internal */
203
- type Url = string;
204
- /** @internal */
205
- type Image = string;
206
- /** @internal */
207
- declare const LengthUnits: readonly [
208
- "px",
209
- "em",
210
- "rem",
211
- "vw",
212
- "fr",
213
- "%"
214
- ];
215
- /** @internal */
216
- type LengthUnit = (typeof LengthUnits)[number];
217
- /** @internal */
218
- type Length = `${number}${LengthUnit}` | "auto";
219
- /** @internal */
220
- type Color = `#${string}` | `rgba(${string})`;
221
- /** @internal */
222
- type FontWeight = string;
223
- /** @internal */
224
- declare const Fonts: readonly [
225
- "Noto Sans JP",
226
- "M PLUS Rounded 1c",
227
- "M PLUS 1p",
228
- "Kosugi Maru",
229
- "Kosugi",
230
- "BIZ UDPGothic",
231
- "Noto Serif JP",
232
- "BIZ UDPMincho",
233
- "Roboto",
234
- "Open Sans",
235
- "Montserrat",
236
- "Lato",
237
- "Poppins",
238
- "Raleway",
239
- "Nunito",
240
- "Playfair Display",
241
- "Merriweather",
242
- "Lora",
243
- "Libre Baskerville",
244
- "EB Garamond"
245
- ];
246
- /** @internal */
247
- declare const Justifies: readonly [
248
- "flex-start",
249
- "center",
250
- "flex-end"
251
- ];
252
- /** @internal */
253
- type Justify = (typeof Justifies)[number];
254
- /** @internal */
255
- declare const Alignments: readonly [
256
- "flex-start",
257
- "center",
258
- "flex-end"
259
- ];
260
- /** @internal */
261
- type Alignment = (typeof Alignments)[number];
262
- /** @internal */
263
- declare const FlexDirections: readonly [
264
- "row",
265
- "column"
266
- ];
267
- /** @internal */
268
- type FlexDirection = (typeof FlexDirections)[number];
269
- /** @internal */
270
- declare const ObjectFits: readonly [
271
- "fill",
272
- "contain",
273
- "cover"
274
- ];
275
- /** @internal */
276
- type ObjectFit = (typeof ObjectFits)[number];
277
- /** @internal */
278
- declare const ClipPaths: readonly [
279
- "none",
280
- "circle(closest-side)"
281
- ];
282
- /** @internal */
283
- type ClipPath = (typeof ClipPaths)[number];
284
- /** @internal */
285
- declare const Repeats: readonly [
286
- "repeat",
287
- "space",
288
- "round",
289
- "no-repeat"
290
- ];
291
- /** @internal */
292
- type Repeat = (typeof Repeats)[number];
293
- /** @internal */
294
- declare const BackgroundSizes: readonly [
295
- "cover",
296
- "contain",
297
- "auto"
298
- ];
299
- /** @internal */
300
- type BackgroundSize = (typeof BackgroundSizes)[number];
301
- /** @internal */
302
- declare const Cursors: readonly [
303
- "default",
304
- "pointer"
305
- ];
306
- /** @internal */
307
- type Cursor = (typeof Cursors)[number];
308
- /** @internal */
309
- declare const Overflows: readonly [
310
- "visible",
311
- "auto",
312
- "hidden"
313
- ];
314
- /** @internal */
315
- type Overflow = (typeof Overflows)[number];
316
- /** @internal */
317
- type Border = string;
318
- /** @internal */
319
- type BorderStyle = string;
320
- /** @internal */
321
- type BorderWidth = `${number}px`;
322
- /** @internal */
323
- type BoxShadow = string;
324
- /** @internal */
325
- type Style = string;
326
- /** @internal */
327
- type TransitState = string;
328
- /** @internal */
329
- declare const WritingModes: readonly [
330
- "horizontal-tb",
331
- "vertical-lr"
332
- ];
333
- /** @internal */
334
- type WritingMode = (typeof WritingModes)[number];
335
- /** @internal */
336
- type DateTime = string;
337
- /** @internal */
338
- type Icon = string;
339
- /** @internal */
340
- declare const ListSeparatorTypes: readonly [
341
- "none",
342
- "border",
343
- "gap"
344
- ];
345
- /** @internal */
346
- interface EdgePosition {
347
- edgeDistance: Length;
348
- edgeDirectionOffset: Length;
349
- }
350
- /** @internal */
351
- declare const DefaultEdgePosition: EdgePosition;
352
- type ListSeparatorType = (typeof ListSeparatorTypes)[number];
353
- interface BaseListSeparator {
354
- type: ListSeparatorType;
355
- }
356
- /** @internal */
357
- interface ListSeparatorNone extends BaseListSeparator {
358
- type: "none";
359
- }
360
- /** @internal */
361
- interface ListSeparatorBorder extends BaseListSeparator {
362
- type: "border";
363
- borderStyle: BorderStyle;
364
- borderWidth?: BorderWidth;
365
- borderColor?: Color;
366
- }
367
- /** @internal */
368
- interface ListSeparatorGap extends BaseListSeparator {
369
- type: "gap";
370
- gap: Length;
371
- }
372
- /** @internal */
373
- type ListSeparator = ListSeparatorNone | ListSeparatorBorder | ListSeparatorGap;
374
- /** @internal */
375
- declare const DefaultListSeparatorNone: Required<ListSeparatorNone>;
376
- /** @internal */
377
- declare const DefaultListSeparatorBorder: Required<ListSeparatorBorder>;
378
- /** @internal */
379
- declare const DefaultListSeparatorGap: Required<ListSeparatorGap>;
380
- /** @internal */
381
- declare const DefaultListSeparator: Required<ListSeparatorBorder>;
382
- /** @internal */
383
- declare const ListBackgroundTypes: readonly [
384
- "none",
385
- "stripe"
386
- ];
387
- type ListBackgroundType = (typeof ListBackgroundTypes)[number];
388
- interface BaseListBackground {
389
- type: ListBackgroundType;
390
- }
391
- /** @internal */
392
- interface ListBackgroundNone extends BaseListBackground {
393
- type: "none";
394
- }
395
- /** @internal */
396
- interface ListBackgroundStripe extends BaseListBackground {
397
- type: "stripe";
398
- background1?: Color;
399
- background2?: Color;
400
- }
393
+ declare function ensureActionRoot(useShadow?: boolean): ShadowRoot | HTMLElement;
401
394
  /**
402
- * @internal
395
+ * アクションの破棄する
396
+ *
397
+ * @public
403
398
  */
404
- type ListBackground = ListBackgroundNone | ListBackgroundStripe;
405
- /** @internal */
406
- declare const DefaultListBackgroundNone: Required<ListBackgroundNone>;
407
- /** @internal */
408
- declare const DefaultListBackgroundStripe: Required<ListBackgroundStripe>;
409
- /** @internal */
410
- declare const DefaultListBackground: Required<ListBackgroundNone>;
411
- /** @internal */
412
- declare const ListDirections: readonly [
413
- "vertical",
414
- "horizontal"
415
- ];
416
- /** @internal */
417
- type ListDirection = (typeof ListDirections)[number];
418
- /** @internal */
419
- type ListContext = {
420
- separator: ListSeparator;
421
- background: ListBackground;
422
- direction: ListDirection;
423
- registerItem: (props: {
424
- onMount: (props: {
425
- index: number;
426
- length: number;
427
- }) => void;
428
- }) => string;
429
- unregisterItem: (id: string) => void;
430
- };
431
- type SlideButtonType = "icon" | "text";
432
- type BaseSlideButton = {
433
- type: SlideButtonType;
434
- };
435
- /** @internal */
436
- interface SlideButtonIcon extends BaseSlideButton {
437
- type: "icon";
438
- icon: string;
439
- size: Length;
440
- color: Color;
441
- fill: Color;
442
- }
443
- /** @internal */
444
- interface SlideButtonText extends BaseSlideButton {
445
- type: "text";
446
- text: string;
447
- }
448
- /** @internal */
449
- type SlideButton = SlideButtonIcon | SlideButtonText;
450
- /** @internal */
451
- declare const DefaultSlideButton: {
452
- readonly type: "icon";
453
- readonly icon: "chevron-left";
454
- readonly color: "#999";
455
- readonly fill: "#999";
456
- readonly size: "20px";
457
- };
458
- /** @internal */
459
- type SlideButtonPosition = "top" | "middle" | "bottom";
460
- /** @internal */
461
- interface SlideNavigationButton {
462
- type: "circle";
463
- size: Length;
464
- color: Color;
465
- colorActive: Color;
466
- }
467
- /** @internal */
468
- declare const DefaultSlideNavigationButton: {
469
- readonly type: "circle";
470
- readonly size: "8px";
471
- readonly color: "#ddd";
472
- readonly colorActive: "#666";
473
- };
474
- /** @internal */
475
- type FormInputName = string;
476
- /** @internal */
477
- interface FormButtonColor {
478
- main: Color;
479
- sub: Color;
480
- }
481
- /** @internal */
482
- declare const DefaultFormButtonColor: {
483
- readonly main: "#2aab9f";
484
- readonly sub: "#fff";
485
- };
486
- /** @internal */
487
- type Store<T> = Writable_<T>; // Wrap svelte tools
399
+ declare function destroyAction(): void;
488
400
  /**
489
- * KARTE のシステム設定情報
401
+ * アクションが作成 (create) される前にフックする関数
402
+ *
403
+ * @param fn - 呼び出されるフック関数
490
404
  *
491
405
  * @public
492
406
  */
493
- type SystemConfig = {
407
+ declare function onCreate<Props extends ModalProps, Variables>(fn: ActionHook<Props, Variables & ActionVariables>): void;
408
+ /**
409
+ * アクションが破棄 (destroy) される前にフックする関数
410
+ *
411
+ * @param fn - 呼び出されるフック関数
412
+ *
413
+ * @public
414
+ */
415
+ declare function onDestroy<Props extends ModalProps, Variables>(fn: ActionHook<Props, Variables & ActionVariables>): void;
416
+ // -------- The following codes are deprecated --------
417
+ /**
418
+ * 非推奨
419
+ *
420
+ * @deprecated 非推奨
421
+ *
422
+ * @internal
423
+ */
424
+ type AppOptions<Props, Variables, VariablesQuery> = ActionOptions<Props, Variables, VariablesQuery>;
425
+ /**
426
+ * 非推奨
427
+ *
428
+ * @deprecated 非推奨
429
+ *
430
+ * @internal
431
+ */
432
+ interface App {
494
433
  /**
495
- * API キー
434
+ * The method to destroy an app instance.
496
435
  */
497
- apiKey?: string;
436
+ close: () => void;
498
437
  /**
499
- * 接客ID
438
+ * The method to show an app instance.
500
439
  */
501
- campaignId?: string;
502
- shortenId?: string;
440
+ show: () => void;
441
+ }
442
+ /**
443
+ * 非推奨
444
+ *
445
+ * @deprecated 非推奨
446
+ *
447
+ * @internal
448
+ */
449
+ declare const showModal: typeof create;
450
+ /**
451
+ * 非推奨
452
+ *
453
+ * @deprecated 非推奨
454
+ *
455
+ * @internal
456
+ */
457
+ declare const ensureModalRoot: typeof ensureActionRoot;
458
+ /**
459
+ * 非推奨
460
+ *
461
+ * @deprecated 非推奨
462
+ *
463
+ * @internal
464
+ */
465
+ declare function createApp<Props, Variables, VariablesQuery>(App: typeof SvelteComponentDev, options?: AppOptions<Props, Variables, VariablesQuery>): App;
466
+ /**
467
+ * 非推奨
468
+ *
469
+ * @deprecated 非推奨
470
+ *
471
+ * @internal
472
+ */
473
+ declare function destroy(): void;
474
+ /**
475
+ * 非推奨
476
+ *
477
+ * @deprecated 非推奨
478
+ *
479
+ * @internal
480
+ */
481
+ declare function createFog({ color, opacity, zIndex, onclick }: {
482
+ color?: string;
483
+ opacity?: string;
484
+ zIndex?: number;
485
+ onclick: () => void;
486
+ }): {
487
+ fog: HTMLDivElement;
488
+ close: () => void;
503
489
  };
504
490
  /**
505
- * アクションのイベントハンドラ
491
+ * スクリプト接客が利用するコードの管理
492
+ */
493
+ /**
494
+ * ES Modules に対応していない JavaScript をページに読み込む
495
+ *
496
+ * @param src - JavaScript ファイルのリンク URL
506
497
  *
507
498
  * @public
508
499
  */
509
- type ActionEventHandler = (...args: any[]) => any | Promise<any>;
500
+ declare function loadGlobalScript(src: string): Promise<any>;
510
501
  /**
511
- * アクション設定
502
+ * グローバル CSS をページに適用する
503
+ *
504
+ * @param css - CSS
512
505
  *
513
506
  * @public
514
507
  */
515
- type ActionSetting = {
516
- send?: (event_name: string, values?: any) => void;
517
- initialState?: string;
518
- };
508
+ declare function applyGlobalCss(css: string): Promise<any>;
519
509
  /**
520
- * 変数
510
+ * style ファイルをページに読み込む
511
+ *
512
+ * @param href - style ファイルのリンク URL
521
513
  *
522
514
  * @public
523
515
  */
524
- type ActionVariables = {
525
- [key: string]: any;
526
- };
516
+ declare function loadGlobalStyle(href: string): Promise<any>;
517
+ /** @internal */
518
+ type Store<T> = Writable_<T>; // Wrap svelte tools
527
519
  /**
528
520
  * アクション設定を更新する
529
521
  *
@@ -669,704 +661,698 @@ declare function setVariables(vars: ActionVariables): ActionVariables;
669
661
  */
670
662
  declare function resetVariables(): void;
671
663
  /** @internal */
672
- interface FormData {
673
- [name: string]: {
674
- statePath: string;
675
- value: any;
676
- isValid: boolean;
677
- };
678
- }
679
- /**
680
- * Store for form data
681
- *
682
- * @internal
683
- */
684
- declare const formData: Writable_<FormData>;
685
- type ActionTableResult = number | string | boolean | Date | null | undefined;
686
- type ActionTableQueryParam = string | number | boolean | Date;
687
- type ActionTableQueryParams = {
688
- [key: string]: ActionTableQueryParam | ActionTableQueryParam[];
664
+ interface FormData {
665
+ [name: string]: {
666
+ statePath: string;
667
+ value: any;
668
+ isValid: boolean;
669
+ };
670
+ }
671
+ /**
672
+ * Store for form data
673
+ *
674
+ * @internal
675
+ */
676
+ declare const formData: Writable_<FormData>;
677
+ /**
678
+ * 静的変数に関連するコードを管理する
679
+ */
680
+ /** @internal */
681
+ declare const PropTypes: readonly [
682
+ "BooleanKeyword",
683
+ "NumberKeyword",
684
+ "StringKeyword",
685
+ "Function",
686
+ "Enum",
687
+ "Code",
688
+ "Direction",
689
+ "Url",
690
+ "Image",
691
+ "AnimationStyle",
692
+ "LongText",
693
+ "Length",
694
+ "Color",
695
+ "Alignment",
696
+ "State",
697
+ "TransitState",
698
+ "Style",
699
+ "ModalPlacement",
700
+ "OnClick"
701
+ ];
702
+ /** @internal */
703
+ type PropType = (typeof PropTypes)[number];
704
+ /** @internal */
705
+ type Code = string;
706
+ /** @internal */
707
+ declare const MediaQueries: {
708
+ [key: string]: string;
709
+ };
710
+ /** @internal */
711
+ type MediaQuery = string;
712
+ /** @internal */
713
+ declare const Directions: readonly [
714
+ "row",
715
+ "column"
716
+ ];
717
+ /** @internal */
718
+ type Direction = (typeof Directions)[number];
719
+ /** @internal */
720
+ declare const AnimationStyles: readonly [
721
+ "none",
722
+ "fade",
723
+ "bounce",
724
+ "slide-down",
725
+ "slide-up",
726
+ "slide-left",
727
+ "slide-right"
728
+ ];
729
+ /** @internal */
730
+ type AnimationStyle = (typeof AnimationStyles)[number];
731
+ /** @internal */
732
+ declare const ModalPositions: readonly [
733
+ "top-left",
734
+ "top-center",
735
+ "top-right",
736
+ "center-left",
737
+ "center",
738
+ "center-right",
739
+ "bottom-left",
740
+ "bottom-center",
741
+ "bottom-right",
742
+ "none"
743
+ ];
744
+ /** @internal */
745
+ type ModalPosition = (typeof ModalPositions)[number];
746
+ /** @internal */
747
+ type ModalMargin = {
748
+ left?: string;
749
+ right?: string;
750
+ top?: string;
751
+ bottom?: string;
689
752
  };
690
- /**
691
- * アクションテーブルの設定情報
692
- *
693
- * @public
694
- */
695
- type CollectionConfig = {
696
- /**
697
- * APIキー
698
- */
699
- api_key: string;
700
- /**
701
- * テーブル名
702
- */
703
- table: string;
704
- /**
705
- * エンドポイント
706
- */
707
- endpoint?: string;
753
+ /** @internal */
754
+ type ModalPlacement<M = ModalMargin> = {
755
+ position?: ModalPosition;
756
+ margin?: M;
757
+ backgroundOverlay?: boolean;
758
+ backgroundClick?: OnClickOperation;
708
759
  };
709
- /**
710
- * アクションテーブルを管理するメソッドを取得する
711
- *
712
- * @param config - 設定情報
713
- *
714
- * @returns メソッドを返します
715
- *
716
- * @public
717
- */
718
- declare function collection(config: CollectionConfig): {
719
- get(key: string | Array<string>, cb: (err: Error | null, items?: ActionTableResult | Array<ActionTableResult>) => void): void;
720
- getByQuery(query_name: string, params: ActionTableQueryParams, options: {
721
- ignore_fields?: string[];
722
- } | null | undefined, cb: (err: Error | null, items?: Array<ActionTableResult>) => void): void;
723
- set(key: string, value: string, cb: (err: Error | null) => void): void;
760
+ /** @internal */
761
+ declare const DefaultModalPlacement: Required<ModalPlacement<Required<ModalMargin>>>;
762
+ /** @internal */
763
+ declare const Elasticities: readonly [
764
+ "none",
765
+ "vertical",
766
+ "horizontal"
767
+ ];
768
+ /** @internal */
769
+ type Elasticity = (typeof Elasticities)[number];
770
+ /** @internal */
771
+ declare const ElasticityStyle: {
772
+ none: string;
773
+ vertical: string;
774
+ horizontal: string;
775
+ };
776
+ /** @internal */
777
+ declare const TextDirections: readonly [
778
+ "horizontal",
779
+ "vertical"
780
+ ];
781
+ /** @internal */
782
+ type TextDirection = (typeof TextDirections)[number];
783
+ type OperationArgumentTypes = {
784
+ StringKeyword: string;
785
+ BooleanKeyword: boolean;
786
+ NumberKeyword: number;
787
+ TransitState: string;
788
+ Url: string;
789
+ Handler: string;
790
+ Trigger: string;
791
+ };
792
+ /** @internal */
793
+ type OperationArgumentType = keyof OperationArgumentTypes;
794
+ type BaseOperationOptions = ReadonlyArray<{
795
+ operation: string;
796
+ args: ReadonlyArray<{
797
+ type: OperationArgumentType;
798
+ default: any;
799
+ }>;
800
+ }>;
801
+ type ConvertOperationOptions<O extends BaseOperationOptions> = ConvertOperationOption<O[number]>;
802
+ type ConvertOperationOption<Option extends BaseOperationOptions[number]> = Option extends any ? {
803
+ operation: Option["operation"];
804
+ args: ConvertOperationOptionArguments<Option["args"]>;
805
+ } : never;
806
+ type ConvertOperationOptionArguments<Arguments extends BaseOperationOptions[number]["args"]> = {
807
+ -readonly [Index in keyof Arguments]: Arguments[Index] extends BaseOperationOptions[number]["args"][number] ? OperationArgumentTypes[Arguments[Index]["type"]] : never;
724
808
  };
725
809
  /** @internal */
726
- type VariableQuery = {
727
- resolver: string;
728
- name: string;
729
- query: any;
730
- preview_value?: any;
731
- };
810
+ type Operation = ConvertOperationOptions<ReadonlyArray<any>>;
811
+ /** @internal */
812
+ declare const OnClickOperationOptions: readonly [
813
+ {
814
+ readonly operation: "none";
815
+ readonly args: readonly [
816
+ ];
817
+ },
818
+ {
819
+ readonly operation: "linkTo";
820
+ readonly args: readonly [
821
+ {
822
+ readonly type: "Url";
823
+ readonly default: "";
824
+ },
825
+ {
826
+ readonly type: "BooleanKeyword";
827
+ readonly default: true;
828
+ }
829
+ ];
830
+ },
831
+ {
832
+ readonly operation: "moveTo";
833
+ readonly args: readonly [
834
+ {
835
+ readonly type: "TransitState";
836
+ readonly default: "/";
837
+ }
838
+ ];
839
+ },
840
+ {
841
+ readonly operation: "closeApp";
842
+ readonly args: readonly [
843
+ {
844
+ readonly type: "Trigger";
845
+ readonly default: "button";
846
+ }
847
+ ];
848
+ },
849
+ {
850
+ readonly operation: "runScript";
851
+ readonly args: readonly [
852
+ {
853
+ readonly type: "Handler";
854
+ readonly default: "";
855
+ }
856
+ ];
857
+ },
858
+ {
859
+ readonly operation: "submitForm";
860
+ readonly args: readonly [
861
+ {
862
+ readonly type: "TransitState";
863
+ readonly default: "/";
864
+ }
865
+ ];
866
+ }
867
+ ];
868
+ /** @internal */
869
+ type OnClickOperation = ConvertOperationOptions<typeof OnClickOperationOptions>;
870
+ /** @internal */
871
+ type LongText = string;
872
+ /** @internal */
873
+ type Url = string;
874
+ /** @internal */
875
+ type Image = string;
876
+ /** @internal */
877
+ declare const LengthUnits: readonly [
878
+ "px",
879
+ "em",
880
+ "rem",
881
+ "vw",
882
+ "fr",
883
+ "%"
884
+ ];
885
+ /** @internal */
886
+ type LengthUnit = (typeof LengthUnits)[number];
887
+ /** @internal */
888
+ type Length = `${number}${LengthUnit}` | "auto";
889
+ /** @internal */
890
+ type Color = `#${string}` | `rgba(${string})`;
891
+ /** @internal */
892
+ type FontWeight = string;
893
+ /** @internal */
894
+ declare const Fonts: readonly [
895
+ "Noto Sans JP",
896
+ "M PLUS Rounded 1c",
897
+ "M PLUS 1p",
898
+ "Kosugi Maru",
899
+ "Kosugi",
900
+ "BIZ UDPGothic",
901
+ "Noto Serif JP",
902
+ "BIZ UDPMincho",
903
+ "Roboto",
904
+ "Open Sans",
905
+ "Montserrat",
906
+ "Lato",
907
+ "Poppins",
908
+ "Raleway",
909
+ "Nunito",
910
+ "Playfair Display",
911
+ "Merriweather",
912
+ "Lora",
913
+ "Libre Baskerville",
914
+ "EB Garamond"
915
+ ];
916
+ /** @internal */
917
+ declare const Justifies: readonly [
918
+ "flex-start",
919
+ "center",
920
+ "flex-end"
921
+ ];
922
+ /** @internal */
923
+ type Justify = (typeof Justifies)[number];
924
+ /** @internal */
925
+ declare const Alignments: readonly [
926
+ "flex-start",
927
+ "center",
928
+ "flex-end"
929
+ ];
930
+ /** @internal */
931
+ type Alignment = (typeof Alignments)[number];
932
+ /** @internal */
933
+ declare const FlexDirections: readonly [
934
+ "row",
935
+ "column"
936
+ ];
937
+ /** @internal */
938
+ type FlexDirection = (typeof FlexDirections)[number];
939
+ /** @internal */
940
+ declare const ObjectFits: readonly [
941
+ "fill",
942
+ "contain",
943
+ "cover"
944
+ ];
945
+ /** @internal */
946
+ type ObjectFit = (typeof ObjectFits)[number];
947
+ /** @internal */
948
+ declare const ClipPaths: readonly [
949
+ "none",
950
+ "circle(closest-side)"
951
+ ];
732
952
  /** @internal */
733
- type ActionTableRowRequestConfig = VariableQuery & {
734
- resolver: "action-table-row";
735
- query: {
736
- table_name: string;
737
- key: string;
738
- default_value?: ActionTableResult;
739
- };
740
- preview_value?: ActionTableResult;
741
- };
953
+ type ClipPath = (typeof ClipPaths)[number];
742
954
  /** @internal */
743
- type ActionTableRowsRequestConfig = VariableQuery & {
744
- resolver: "action-table-rows";
745
- query: {
746
- table_name: string;
747
- key: Array<string>;
748
- default_value?: Array<ActionTableResult>;
749
- };
750
- preview_value?: Array<ActionTableResult>;
751
- };
955
+ declare const Repeats: readonly [
956
+ "repeat",
957
+ "space",
958
+ "round",
959
+ "no-repeat"
960
+ ];
752
961
  /** @internal */
753
- type ActionTableQueryRequestConfig = VariableQuery & {
754
- resolver: "action-table-query";
755
- query: {
756
- table_name: string;
757
- query_name: string;
758
- params?: ActionTableQueryParams;
759
- default_value?: Array<ActionTableResult>;
760
- };
761
- preview_value?: Array<ActionTableResult>;
762
- };
962
+ type Repeat = (typeof Repeats)[number];
763
963
  /** @internal */
764
- type ActionTableRequestConfig = ActionTableRowRequestConfig | ActionTableRowsRequestConfig | ActionTableQueryRequestConfig;
964
+ declare const BackgroundSizes: readonly [
965
+ "cover",
966
+ "contain",
967
+ "auto"
968
+ ];
765
969
  /** @internal */
766
- declare const loadActionTableRow: (config: ActionTableRowRequestConfig, api_key: string, endpoint?: string) => Promise<unknown>;
970
+ type BackgroundSize = (typeof BackgroundSizes)[number];
767
971
  /** @internal */
768
- declare const loadActionTableRows: (config: ActionTableRowsRequestConfig, api_key: string, endpoint?: string) => Promise<unknown>;
972
+ declare const Cursors: readonly [
973
+ "default",
974
+ "pointer"
975
+ ];
769
976
  /** @internal */
770
- declare const loadActionTableQuery: (config: ActionTableQueryRequestConfig, api_key: string, endpoint?: string) => Promise<unknown>;
771
- declare const loadActionTable: (config: Array<VariableQuery>, api_key: string, endpoint?: string) => Promise<{
772
- [key: string]: any;
773
- }>;
774
- /**
775
- * プロパティ
776
- *
777
- * @internal
778
- */
779
- interface Props {
780
- /**
781
- * 全ての条件を満たしたら表示するかどうか
782
- */
783
- show_and_condition?: boolean;
784
- /**
785
- * スクロール率による表示を有効化するかどうか
786
- */
787
- show_on_scroll?: boolean;
788
- /**
789
- * 表示するスクロール率
790
- */
791
- show_on_scroll_rate?: number;
792
- /**
793
- * 条件を満たした時に再表示するかどうか
794
- */
795
- show_on_scroll_reenter?: boolean;
796
- /**
797
- * 時間による表示を有効化するかどうか
798
- */
799
- show_on_time?: boolean;
800
- /**
801
- * 表示する秒数
802
- */
803
- show_on_time_count?: number;
804
- /**
805
- * 全ての条件を満たしたら非表示するかどうか
806
- */
807
- hide_and_condition?: boolean;
808
- /**
809
- * スクロール率で非表示を有効化するかどうか
810
- */
811
- hide_on_scroll?: boolean;
812
- /**
813
- * 非表示にするスクロール率
814
- */
815
- hide_on_scroll_rate?: number;
816
- /**
817
- * 条件を満たした時に表示するかどうか
818
- */
819
- hide_on_scroll_releave?: boolean;
820
- /**
821
- * 時間による非表示を有効化するかどうか
822
- */
823
- hide_on_time?: boolean;
824
- /**
825
- * 非表示にする秒数
826
- */
827
- hide_on_time_count?: number;
977
+ type Cursor = (typeof Cursors)[number];
978
+ /** @internal */
979
+ declare const Overflows: readonly [
980
+ "visible",
981
+ "auto",
982
+ "hidden"
983
+ ];
984
+ /** @internal */
985
+ type Overflow = (typeof Overflows)[number];
986
+ /** @internal */
987
+ type Border = string;
988
+ /** @internal */
989
+ type BorderStyle = string;
990
+ /** @internal */
991
+ type BorderWidth = `${number}px`;
992
+ /** @internal */
993
+ type BoxShadow = string;
994
+ /** @internal */
995
+ type Style = string;
996
+ /** @internal */
997
+ type TransitState = string;
998
+ /** @internal */
999
+ declare const WritingModes: readonly [
1000
+ "horizontal-tb",
1001
+ "vertical-lr"
1002
+ ];
1003
+ /** @internal */
1004
+ type WritingMode = (typeof WritingModes)[number];
1005
+ /** @internal */
1006
+ type DateTime = string;
1007
+ /** @internal */
1008
+ type Icon = string;
1009
+ /** @internal */
1010
+ declare const ListSeparatorTypes: readonly [
1011
+ "none",
1012
+ "border",
1013
+ "gap"
1014
+ ];
1015
+ /** @internal */
1016
+ interface EdgePosition {
1017
+ edgeDistance: Length;
1018
+ edgeDirectionOffset: Length;
828
1019
  }
829
- type _Props = Props;
830
- /**
831
- * 閉じるアクショントリガー
832
- *
833
- * @public
834
- */
835
- type CloseTrigger = "button" | "overlay" | "auto" | "none";
836
1020
  /** @internal */
837
- declare const initialize: (setting?: ActionSetting) => () => void;
1021
+ declare const DefaultEdgePosition: EdgePosition;
1022
+ type ListSeparatorType = (typeof ListSeparatorTypes)[number];
1023
+ interface BaseListSeparator {
1024
+ type: ListSeparatorType;
1025
+ }
838
1026
  /** @internal */
839
- declare const finalize: () => void;
840
- /**
841
- * An option for svelte custom animation
842
- */
843
- interface CustomAnimationOptions {
844
- /**
845
- * A Transform value in percent of target element
846
- */
847
- transform: [
848
- number,
849
- number
850
- ];
851
- /**
852
- * A style of animation(e.g. fade, slide-in)
853
- */
854
- animationStyle: AnimationStyle;
855
- /**
856
- * A waiting time in milliseconds before starting animation
857
- *
858
- * @defaultValue 0
859
- */
860
- delay?: number;
861
- /**
862
- * A total duration time in milliseconds of the animation
863
- *
864
- * @defaultValue 1000
865
- */
866
- duration?: number;
1027
+ interface ListSeparatorNone extends BaseListSeparator {
1028
+ type: "none";
867
1029
  }
868
- /**
869
- * ES Modules に対応していない JavaScript をページに読み込む
870
- *
871
- * @param src - JavaScript ファイルのリンク URL
872
- *
873
- * @public
874
- */
875
- declare function loadGlobalScript(src: string): Promise<any>;
876
- /**
877
- * グローバル CSS をページに適用する
878
- *
879
- * @param css - CSS
880
- *
881
- * @public
882
- */
883
- declare function applyGlobalCss(css: string): Promise<any>;
884
- /**
885
- * style ファイルをページに読み込む
886
- *
887
- * @param href - style ファイルのリンク URL
888
- *
889
- * @public
890
- */
891
- declare function loadGlobalStyle(href: string): Promise<any>;
892
- // @internal
893
- declare function getCssVariables<Props extends _Props, Variables>(data: Writable<Props & Variables & ActionVariables & VariableQuery>): string;
894
- /**
895
- * スクロール方向
896
- *
897
- * @public
898
- *
899
- * @see {@link onScroll}
900
- */
901
- type ScrollDirection = "up" | "down";
902
- /**
903
- * {@link onScroll} のスクロールコンテキスト情報
904
- *
905
- * @remarks
906
- * このコンテキスト情報は、{@link OnScrollFunction} が呼び出されたタイミングの情報が格納されています
907
- *
908
- * @see {@link onScroll}
909
- *
910
- * @public
911
- */
912
- interface OnScrollContext {
913
- /**
914
- * {@link onScroll} によって指定されたスクロール率
915
- */
916
- rate: number;
917
- /**
918
- * ページのスクロール率
919
- */
920
- scrollRate: number;
921
- /**
922
- * 前のスクロール率
923
- */
924
- previousRate: number;
925
- /**
926
- * 現在のスクロール率と前のスクロール率との差分値
927
- */
928
- deltaRate: number;
929
- /**
930
- * スクロール方向
931
- */
932
- direction: ScrollDirection;
1030
+ /** @internal */
1031
+ interface ListSeparatorBorder extends BaseListSeparator {
1032
+ type: "border";
1033
+ borderStyle: BorderStyle;
1034
+ borderWidth?: BorderWidth;
1035
+ borderColor?: Color;
1036
+ }
1037
+ /** @internal */
1038
+ interface ListSeparatorGap extends BaseListSeparator {
1039
+ type: "gap";
1040
+ gap: Length;
933
1041
  }
934
- /**
935
- * {@link onScroll} によって呼び出されるコールバック関数
936
- *
937
- * @see {@link onScroll}
938
- *
939
- * @public
940
- */
941
- type OnScrollFunction = (ctx: OnScrollContext) => boolean;
942
- /**
943
- * スクロール率が達したときに呼び出すコールバックを登録します
944
- *
945
- * @param rate - スクロール率。この値は viewport でのスクロールのパーセンテージ
946
- * @param fn - スクロール率が達したときに呼び出されるコールバック関数
947
- *
948
- * @returns スクロール率によって呼び出されるコールバックを停止する関数を返します
949
- *
950
- * @public
951
- */
952
- declare function onScroll(rate: number | number[], fn: OnScrollFunction): () => void;
953
- /**
954
- * 指定した時間の経過後に呼び出すコールバックを登録します
955
- *
956
- * @param time - コールバックを呼び出すまでの時間。単位はミリセカンド(ms)
957
- * @param fn - 指定した時間が経過後に呼び出されるコールバック関数
958
- *
959
- * @returns コールバックを呼び出すためのタイマーを停止する関数を返します
960
- *
961
- * @public
962
- */
963
- declare function onTime(time: number, fn: Function): () => void;
964
- /**
965
- * アクションのログの記録の管理
966
- */
967
1042
  /** @internal */
968
- type LogLevel = "info" | "error" | "warn" | "system";
1043
+ type ListSeparator = ListSeparatorNone | ListSeparatorBorder | ListSeparatorGap;
969
1044
  /** @internal */
970
- type Log = {
971
- level: LogLevel;
972
- messages: any;
973
- date?: Date;
974
- };
1045
+ declare const DefaultListSeparatorNone: Required<ListSeparatorNone>;
975
1046
  /** @internal */
976
- type Event = {
977
- name: string;
978
- values?: any;
979
- date?: Date;
980
- };
1047
+ declare const DefaultListSeparatorBorder: Required<ListSeparatorBorder>;
981
1048
  /** @internal */
982
- declare function getLogs(): Log[];
1049
+ declare const DefaultListSeparatorGap: Required<ListSeparatorGap>;
983
1050
  /** @internal */
984
- declare function getEvents(): Event[];
1051
+ declare const DefaultListSeparator: Required<ListSeparatorBorder>;
1052
+ /** @internal */
1053
+ declare const ListBackgroundTypes: readonly [
1054
+ "none",
1055
+ "stripe"
1056
+ ];
1057
+ type ListBackgroundType = (typeof ListBackgroundTypes)[number];
1058
+ interface BaseListBackground {
1059
+ type: ListBackgroundType;
1060
+ }
1061
+ /** @internal */
1062
+ interface ListBackgroundNone extends BaseListBackground {
1063
+ type: "none";
1064
+ }
1065
+ /** @internal */
1066
+ interface ListBackgroundStripe extends BaseListBackground {
1067
+ type: "stripe";
1068
+ background1?: Color;
1069
+ background2?: Color;
1070
+ }
985
1071
  /**
986
- * ログを送信する関数群
987
- *
988
1072
  * @internal
989
1073
  */
990
- declare const logger: {
991
- info: (...messages: any[]) => void;
992
- log: (...messages: any[]) => void;
993
- error: (...messages: any[]) => void;
994
- warn: (...messages: any[]) => void;
995
- system: (...messages: any[]) => void;
996
- event: (name: string, values?: any) => void;
997
- clear: () => void;
998
- clearEvents: () => void;
1074
+ type ListBackground = ListBackgroundNone | ListBackgroundStripe;
1075
+ /** @internal */
1076
+ declare const DefaultListBackgroundNone: Required<ListBackgroundNone>;
1077
+ /** @internal */
1078
+ declare const DefaultListBackgroundStripe: Required<ListBackgroundStripe>;
1079
+ /** @internal */
1080
+ declare const DefaultListBackground: Required<ListBackgroundNone>;
1081
+ /** @internal */
1082
+ declare const ListDirections: readonly [
1083
+ "vertical",
1084
+ "horizontal"
1085
+ ];
1086
+ /** @internal */
1087
+ type ListDirection = (typeof ListDirections)[number];
1088
+ /** @internal */
1089
+ type ListContext = {
1090
+ separator: ListSeparator;
1091
+ background: ListBackground;
1092
+ direction: ListDirection;
1093
+ registerItem: (props: {
1094
+ onMount: (props: {
1095
+ index: number;
1096
+ length: number;
1097
+ }) => void;
1098
+ }) => string;
1099
+ unregisterItem: (id: string) => void;
1100
+ };
1101
+ type SlideButtonType = "icon" | "text";
1102
+ type BaseSlideButton = {
1103
+ type: SlideButtonType;
999
1104
  };
1000
- /**
1001
- * メッセージを実行ログに表示する
1002
- *
1003
- * @internal
1004
- */
1005
- declare function listenLogger(): () => void;
1006
- type _Props$0 = Props;
1007
- /**
1008
- * スクロールに応じてアクションを非表示にするトリガー関数
1009
- *
1010
- * @remarks
1011
- * スクロール率が `hide_on_scroll_rate` に達したときに `hide` 関数を呼び出します。
1012
- * `show_on_scroll_reenter` が `true` で、かつ `hide_on_scroll_rate` またはその値以下の場合、アクションに対して `show` 関数が呼び出されます。
1013
- *
1014
- * @param props - アクションのプロパティ。プロパティには `hide_on_scroll`、`hide_on_scroll_rate` そして `show_on_scroll_reenter` が必要です。
1015
- * @param hide - アクションを非表示にするロジックが実装された関数。指定ない場合は noop 関数が使用されます。
1016
- * @param show - アクションを再び表示するロジックが実装された関数。指定ない場合は noop 関数が使用されます。
1017
- *
1018
- * @returns
1019
- * スクロールが開始された場合は、クリーンアップする関数を返します。そうでない場合は `null` を返します。
1020
- *
1021
- * @internal
1022
- */
1023
- declare function hideOnScroll<Props extends Pick<_Props$0, "hide_on_scroll" | "hide_on_scroll_rate" | "show_on_scroll_reenter">>(props: Props, hide?: Function, show?: Function): (() => void) | null;
1024
- /**
1025
- * 時間に応じてアクションを非表示にするトリガー関数
1026
- *
1027
- * @remarks
1028
- * 時間のカウントが `hide_on_time_count` に達したときに `hide` 関数を呼び出します。
1029
- *
1030
- * @param props - アクションのプロパティ。プロパティには `hide_on_time` そして `hide_on_time_count` が必要です。
1031
- * @param hide - アクションを非表示にするロジックが実装された関数。指定ない場合は noop 関数が使用されます。
1032
- *
1033
- * @returns
1034
- * タイマーが開始された場合、タイマーをクリーンアップする関数を返します。それ以外は `null` を返します。
1035
- *
1036
- * @internal
1037
- */
1038
- declare function hideOnTime<Props extends Pick<_Props$0, "hide_on_time" | "hide_on_time_count">>(props: Props, hide?: Function): (() => void) | null;
1039
- /**
1040
- * スクロールに応じてアクションを表示するトリガー関数
1041
- *
1042
- * @remarks
1043
- * スクロール率が `show_on_scroll_rate` に達したときに `show` 関数を呼び出します。
1044
- * `hide_on_scroll_releave` が `true` で、かつ `show_on_scroll_rate` 以下の場合は、アクションに対して `hide` 関数が呼び出されます。
1045
- *
1046
- * @param props - アクションのプロパティ。プロパティには `show_on_scroll`、`show_on_scroll_rate` そして `hide_on_scroll_releave` が必要です。
1047
- * @param show - アクションを表示するロジックが実装された関数。指定ない場合は noop 関数が使用されます。
1048
- * @param hide - アクションを非表示にするロジックが実装された関数。指定ない場合は noop 関数が使用されます。
1049
- *
1050
- * @returns
1051
- * スクロールが開始されている場合は、クリーンアップ関数を返します。そうでない場合は `null` を返します
1052
- *
1053
- * @internal
1054
- */
1055
- declare function showOnScroll<Props extends Pick<_Props$0, "show_on_scroll" | "show_on_scroll_rate" | "hide_on_scroll_releave">>(props: Props, show?: Function, hide?: Function): (() => void) | null;
1056
- /**
1057
- * 時間に応じてアクションを表示するトリガー関数
1058
- *
1059
- * @param props - アクションのプロパティ。プロパティには `show_on_time` そして `show_on_time_count` が必要です。
1060
- * @param show - アクションを表示するロジックが実装された関数。指定ない場合は noop 関数が使用されます。
1061
- *
1062
- * @remarks
1063
- * 時間のカウントが `show_on_time_count` に達したときに `show` 関数を呼び出します。
1064
- *
1065
- * @returns
1066
- * タイマーが開始された場合、タイマーをクリーンアップする関数を返します。それ以外は `null` を返します。
1067
- *
1068
- * @internal
1069
- */
1070
- declare function showOnTime<Props extends Pick<_Props$0, "show_on_time" | "show_on_time_count">>(props: Props, show?: Function): (() => void) | null;
1071
- type _Props$1 = Props;
1072
1105
  /** @internal */
1073
- declare const ACTION_HOOK_LABEL = "__ACTION_HOOK__";
1106
+ interface SlideButtonIcon extends BaseSlideButton {
1107
+ type: "icon";
1108
+ icon: string;
1109
+ size: Length;
1110
+ color: Color;
1111
+ fill: Color;
1112
+ }
1074
1113
  /** @internal */
1075
- type ActionHookLog = {
1076
- name: string;
1077
- values?: any;
1114
+ interface SlideButtonText extends BaseSlideButton {
1115
+ type: "text";
1116
+ text: string;
1117
+ }
1118
+ /** @internal */
1119
+ type SlideButton = SlideButtonIcon | SlideButtonText;
1120
+ /** @internal */
1121
+ declare const DefaultSlideButton: {
1122
+ readonly type: "icon";
1123
+ readonly icon: "chevron-left";
1124
+ readonly color: "#999";
1125
+ readonly fill: "#999";
1126
+ readonly size: "20px";
1127
+ };
1128
+ /** @internal */
1129
+ type SlideButtonPosition = "top" | "middle" | "bottom";
1130
+ /** @internal */
1131
+ interface SlideNavigationButton {
1132
+ type: "circle";
1133
+ size: Length;
1134
+ color: Color;
1135
+ colorActive: Color;
1136
+ }
1137
+ /** @internal */
1138
+ declare const DefaultSlideNavigationButton: {
1139
+ readonly type: "circle";
1140
+ readonly size: "8px";
1141
+ readonly color: "#ddd";
1142
+ readonly colorActive: "#666";
1143
+ };
1144
+ /** @internal */
1145
+ type FormInputName = string;
1146
+ /** @internal */
1147
+ interface FormButtonColor {
1148
+ main: Color;
1149
+ sub: Color;
1150
+ }
1151
+ /** @internal */
1152
+ declare const DefaultFormButtonColor: {
1153
+ readonly main: "#2aab9f";
1154
+ readonly sub: "#fff";
1078
1155
  };
1079
1156
  /**
1080
- * アクションのライフサイクルで呼び出されるフック
1081
- *
1082
- * @param props - アクションのプロパティ
1083
- *
1084
- * @public
1085
- */
1086
- type ActionHook<Props extends _Props$1, Variables> = (props: ActionProps<Props, Variables & ActionVariables>) => void | Promise<void>;
1087
- /**
1088
- * アクションが作成 (create) される前にフックする関数
1089
- *
1090
- * @param fn - 呼び出されるフック関数
1091
- *
1092
- * @public
1093
- */
1094
- declare function onCreate<Props extends _Props$1, Variables>(fn: ActionHook<Props, Variables & ActionVariables>): void;
1095
- /**
1096
- * アクションが表示 (show) された後にフックする関数
1097
- *
1098
- * @param fn - 呼び出されるフック関数
1099
- *
1100
- * @public
1101
- */
1102
- declare function onShow<Props extends _Props$1, Variables>(fn: ActionHook<Props, Variables & ActionVariables>): void;
1103
- /**
1104
- * アクションのライフサイクル close で呼び出されるフックする関数
1105
- *
1106
- * @param props - アクションのプロパティ
1107
- * @param trigger - Close トリガー
1108
- *
1109
- * @public
1110
- */
1111
- type ActionCloseHook<Props extends _Props$1, Variables> = (props: Parameters<ActionHook<Props, Variables & ActionVariables>>[0], trigger: CloseTrigger) => void | Promise<void>;
1112
- /**
1113
- * アクションがクローズ (close) される前にフックする関数
1114
- *
1115
- * @param fn - 呼び出されるフック関数
1116
- *
1117
- * @public
1118
- */
1119
- declare function onClose<Props extends _Props$1, Variables>(fn: ActionCloseHook<Props, Variables & ActionVariables>): void;
1120
- /**
1121
- * アクションが破棄 (destroy) される前にフックする関数
1122
- *
1123
- * @param fn - 呼び出されるフック関数
1124
- *
1125
- * @public
1126
- */
1127
- declare function onDestroy<Props extends _Props$1, Variables>(fn: ActionHook<Props, Variables & ActionVariables>): void;
1128
- /**
1129
- * アクションのライフサイクル changeState で呼び出されるフック関数
1130
- *
1131
- * @param props - アクションのプロパティ
1132
- * @param newState - アクションの新しいステート
1157
+ * スクロール方向
1133
1158
  *
1134
1159
  * @public
1135
- */
1136
- type ActionChangeStateHook<Props extends _Props$1, Variables> = (props: Parameters<ActionHook<Props, Variables & ActionVariables>>[0], newState: string) => void | Promise<void>;
1137
- /**
1138
- * アクションのステートが変更された (changeState) 後にフックする関数
1139
1160
  *
1140
- * @param fn - 呼び出されるフック関数
1141
- *
1142
- * @public
1161
+ * @see {@link onScroll}
1143
1162
  */
1144
- declare function onChangeState<Props extends _Props$1, Variables>(fn: ActionChangeStateHook<Props, Variables & ActionVariables>): void;
1163
+ type ScrollDirection = "up" | "down";
1145
1164
  /**
1146
- * アクションの send 関数
1165
+ * {@link onScroll} のスクロールコンテキスト情報
1147
1166
  *
1148
- * @public
1149
- */
1150
- type SendFunction = (event_name: string, values?: any) => void;
1151
- /**
1152
- * アクションの publish 関数
1167
+ * @remarks
1168
+ * このコンテキスト情報は、{@link OnScrollFunction} が呼び出されたタイミングの情報が格納されています
1153
1169
  *
1154
- * @public
1155
- */
1156
- type PublishFunction = (topic: string, values?: any) => void;
1157
- /**
1158
- * アクションのプロパティ
1170
+ * @see {@link onScroll}
1159
1171
  *
1160
1172
  * @public
1161
1173
  */
1162
- interface ActionProps<Props, Variables> {
1174
+ interface OnScrollContext {
1163
1175
  /**
1164
- * アクションでイベントがトリガーされたときに受信するための関数
1176
+ * {@link onScroll} によって指定されたスクロール率
1165
1177
  */
1166
- send: SendFunction;
1178
+ rate: number;
1167
1179
  /**
1168
- * アクション内でタグのQueueにリクエストを発行する関数
1180
+ * ページのスクロール率
1169
1181
  */
1170
- publish: PublishFunction;
1182
+ scrollRate: number;
1171
1183
  /**
1172
- * アクションで使用されるデータ
1184
+ * 前のスクロール率
1173
1185
  */
1174
- data: Props & Variables & ActionVariables;
1186
+ previousRate: number;
1175
1187
  /**
1176
- * アクションが表示されたときにフックされる {@link onShow}
1188
+ * 現在のスクロール率と前のスクロール率との差分値
1177
1189
  */
1178
- onShow?: ActionHook<Props, Variables & ActionVariables>;
1190
+ deltaRate: number;
1179
1191
  /**
1180
- * アクションのステートが変更されたときにフックされる {@link onChangeState}
1192
+ * スクロール方向
1181
1193
  */
1182
- onChangeState?: ActionChangeStateHook<Props, Variables & ActionVariables>;
1194
+ direction: ScrollDirection;
1183
1195
  }
1184
1196
  /**
1185
- * {@link create} 向けのオプション
1197
+ * {@link onScroll} によって呼び出されるコールバック関数
1198
+ *
1199
+ * @see {@link onScroll}
1186
1200
  *
1187
1201
  * @public
1188
1202
  */
1189
- interface ActionOptions<Props, Variables, VariablesQuery> {
1190
- /**
1191
- * アクション内でイベントを発火する関数
1192
- *
1193
- * @defaultValue `() => {}`
1194
- */
1195
- send?: SendFunction;
1196
- /**
1197
- * アクション内でタグのQueueにリクエストを発行する関数
1198
- *
1199
- * @defaultValue `() => {}`
1200
- */
1201
- publish?: PublishFunction;
1202
- /**
1203
- * アクションで使用されるプロパティ
1204
- *
1205
- * @defaultValue `{}`
1206
- */
1207
- props?: Props;
1208
- /**
1209
- * アクションで使用される解析時に取得される変数
1210
- *
1211
- * @defaultValue `{}`
1212
- */
1213
- variables?: Variables;
1214
- /**
1215
- * アクションで使用されるアクション実行時に取得される変数
1216
- *
1217
- * @defaultValue `[]`
1218
- */
1219
- localVariablesQuery?: VariablesQuery;
1220
- /**
1221
- * アクションが作成されているときにフックされる {@link onCreate}
1222
- *
1223
- * @defaultValue `() => {}`
1224
- */
1225
- onCreate?: ActionHook<Props, Variables & ActionVariables>;
1226
- }
1203
+ type OnScrollFunction = (ctx: OnScrollContext) => boolean;
1227
1204
  /**
1228
- * アクションを作成する
1205
+ * スクロール率が達したときに呼び出すコールバックを登録します
1229
1206
  *
1230
- * @param App - Svelte コンポーネントのエントリポイント
1231
- * @param options - {@link ActionOptions | オプション}
1207
+ * @param rate - スクロール率。この値は viewport でのスクロールのパーセンテージ
1208
+ * @param fn - スクロール率が達したときに呼び出されるコールバック関数
1232
1209
  *
1233
- * @returns アクションを破棄する関数
1210
+ * @returns スクロール率によって呼び出されるコールバックを停止する関数を返します
1234
1211
  *
1235
1212
  * @public
1236
1213
  */
1237
- declare function create<Props extends _Props$1, Variables, VariablesQuery extends Array<VariableQuery>>(App: typeof SvelteComponentDev, options?: ActionOptions<Props, Variables & ActionVariables, VariablesQuery>): () => void;
1214
+ declare function onScroll(rate: number | number[], fn: OnScrollFunction): () => void;
1238
1215
  /**
1239
- * アクションの破棄する
1216
+ * 指定した時間の経過後に呼び出すコールバックを登録します
1240
1217
  *
1241
- * @public
1242
- */
1243
- declare function destroyAction(): void;
1244
- /**
1245
- * アクションを表示する
1218
+ * @param time - コールバックを呼び出すまでの時間。単位はミリセカンド(ms)
1219
+ * @param fn - 指定した時間が経過後に呼び出されるコールバック関数
1220
+ *
1221
+ * @returns コールバックを呼び出すためのタイマーを停止する関数を返します
1246
1222
  *
1247
1223
  * @public
1248
1224
  */
1249
- declare function showAction(): void;
1225
+ declare function onTime(time: number, fn: Function): () => void;
1250
1226
  /**
1251
- * アクションを閉じる
1252
- *
1253
- * @param trigger - 閉じた時のトリガー。デフォルト `'none'`
1254
- *
1255
- * @public
1227
+ * アクションのログの記録の管理
1256
1228
  */
1257
- declare function closeAction(trigger?: CloseTrigger): void;
1258
1229
  /** @internal */
1259
- declare function ensureActionRoot(useShadow?: boolean): ShadowRoot | HTMLElement;
1230
+ type LogLevel = "info" | "error" | "warn" | "system";
1231
+ /** @internal */
1232
+ type Log = {
1233
+ level: LogLevel;
1234
+ messages: any;
1235
+ date?: Date;
1236
+ };
1237
+ /** @internal */
1238
+ type Event = {
1239
+ name: string;
1240
+ values?: any;
1241
+ date?: Date;
1242
+ };
1243
+ /** @internal */
1244
+ declare function getLogs(): Log[];
1245
+ /** @internal */
1246
+ declare function getEvents(): Event[];
1260
1247
  /**
1261
- * 非推奨
1262
- *
1263
- * @deprecated 非推奨
1248
+ * ログを送信する関数群
1264
1249
  *
1265
1250
  * @internal
1266
1251
  */
1267
- declare function createFog({ color, opacity, zIndex, onclick }: {
1268
- color?: string;
1269
- opacity?: string;
1270
- zIndex?: number;
1271
- onclick: () => void;
1272
- }): {
1273
- fog: HTMLDivElement;
1274
- close: () => void;
1252
+ declare const logger: {
1253
+ info: (...messages: any[]) => void;
1254
+ log: (...messages: any[]) => void;
1255
+ error: (...messages: any[]) => void;
1256
+ warn: (...messages: any[]) => void;
1257
+ system: (...messages: any[]) => void;
1258
+ event: (name: string, values?: any) => void;
1259
+ clear: () => void;
1260
+ clearEvents: () => void;
1275
1261
  };
1276
- /** @internal */
1277
- type EmbedLogic = "replace" | "append" | "prepend" | "after" | "before";
1278
1262
  /**
1279
- * アクションのルートの DOM 要素を取得する
1263
+ * メッセージを実行ログに表示する
1280
1264
  *
1281
- * @returns アクションがルートの DOM 要素 を持つ場合は DOM 要素を返します。ない場合は `null` を返します
1265
+ * @internal
1266
+ */
1267
+ declare function listenLogger(): () => void;
1268
+ type ModalProps$0 = Props;
1269
+ /**
1270
+ * 表示アクショントリガー
1271
+ *
1272
+ * @internal */
1273
+ type ShowTrigger = "custom" | "auto" | "none";
1274
+ /**
1275
+ * 閉じるアクショントリガー
1282
1276
  *
1283
1277
  * @public
1284
1278
  */
1285
- declare function getActionRoot(): ShadowRoot | null;
1279
+ type CloseTrigger = "button" | "overlay" | "auto" | "none";
1286
1280
  /**
1287
- * アクションに CSS を適用する
1288
- *
1289
- * @param css - 適用する CSS
1281
+ * アクションが表示 (show) された後にフックする関数
1290
1282
  *
1291
- * @returns 適用された style 要素を返す Promise
1283
+ * @param fn - 呼び出されるフック関数
1292
1284
  *
1293
1285
  * @public
1294
1286
  */
1295
- declare function applyCss(css: string): Promise<HTMLStyleElement>;
1287
+ declare function onShow<Props extends ModalProps$0, Variables>(fn: ActionHook<Props, Variables & ActionVariables>): void;
1296
1288
  /**
1297
- * アクションにグローバルなスタイルを読み込む
1289
+ * アクションのライフサイクル close で呼び出されるフックする関数
1298
1290
  *
1299
- * @param href - style ファイルのリンク URL
1291
+ * @param props - アクションのプロパティ
1292
+ * @param trigger - Close トリガー
1300
1293
  *
1301
1294
  * @public
1302
1295
  */
1303
- declare function loadStyle(href: string): Promise<void>;
1304
- // -------- The following codes are deprecated --------
1296
+ type ActionCloseHook<Props extends ModalProps$0, Variables> = (props: Parameters<ActionHook<Props, Variables & ActionVariables>>[0], trigger: CloseTrigger) => void | Promise<void>;
1305
1297
  /**
1306
- * 非推奨
1298
+ * アクションがクローズ (close) される前にフックする関数
1307
1299
  *
1308
- * @deprecated 非推奨
1300
+ * @param fn - 呼び出されるフック関数
1309
1301
  *
1310
- * @internal
1302
+ * @public
1311
1303
  */
1312
- declare const showModal: typeof create;
1304
+ declare function onClose<Props extends ModalProps$0, Variables>(fn: ActionCloseHook<Props, Variables & ActionVariables>): void;
1313
1305
  /**
1314
- * 非推奨
1306
+ * アクションのステートが変更された (changeState) 後にフックする関数
1315
1307
  *
1316
- * @deprecated 非推奨
1308
+ * @param fn - 呼び出されるフック関数
1317
1309
  *
1318
- * @internal
1310
+ * @public
1319
1311
  */
1320
- declare const KARTE_MODAL_ROOT = "karte-modal-root";
1312
+ declare function onChangeState<Props extends ModalProps$0, Variables>(fn: ActionChangeStateHook<Props, Variables & ActionVariables>): void;
1321
1313
  /**
1322
- * 非推奨
1323
- *
1324
- * @deprecated 非推奨
1314
+ * アクションを表示する
1325
1315
  *
1326
- * @internal
1316
+ * @public
1327
1317
  */
1328
- declare const ensureModalRoot: typeof ensureActionRoot;
1318
+ declare function showAction(): void;
1329
1319
  /**
1330
- * 非推奨
1320
+ * アクションを閉じる
1331
1321
  *
1332
- * @deprecated 非推奨
1322
+ * @param trigger - 閉じた時のトリガー。デフォルト `'none'`
1333
1323
  *
1334
- * @internal
1324
+ * @public
1335
1325
  */
1336
- declare const show: typeof showAction;
1326
+ declare function closeAction(trigger?: CloseTrigger): void;
1337
1327
  /**
1338
- * 非推奨
1328
+ * アクションに CSS を適用する
1339
1329
  *
1340
- * @deprecated 非推奨
1330
+ * @param css - 適用する CSS
1341
1331
  *
1342
- * @internal
1332
+ * @returns 適用された style 要素を返す Promise
1333
+ *
1334
+ * @public
1343
1335
  */
1344
- declare const close: typeof closeAction;
1336
+ declare function applyCss(css: string): Promise<HTMLStyleElement>;
1345
1337
  /**
1346
- * 非推奨
1338
+ * アクションにグローバルなスタイルを読み込む
1347
1339
  *
1348
- * @deprecated 非推奨
1340
+ * @param href - style ファイルのリンク URL
1349
1341
  *
1350
- * @internal
1342
+ * @public
1351
1343
  */
1352
- type AppOptions<Props, Variables, VariablesQuery> = ActionOptions<Props, Variables, VariablesQuery>;
1344
+ declare function loadStyle(href: string): Promise<void>;
1345
+ // @internal
1346
+ declare function getCssVariables<Props extends ModalProps$0, Variables>(data: Writable<Props & Variables & ActionVariables & VariableQuery>): string;
1353
1347
  /**
1354
- * 非推奨
1348
+ * アクションのルートの DOM 要素を取得する
1355
1349
  *
1356
- * @deprecated 非推奨
1350
+ * @returns アクションがルートの DOM 要素 を持つ場合は DOM 要素を返します。ない場合は `null` を返します
1357
1351
  *
1358
- * @internal
1352
+ * @public
1359
1353
  */
1360
- interface App {
1361
- /**
1362
- * The method to destroy an app instance.
1363
- */
1364
- close: () => void;
1365
- /**
1366
- * The method to show an app instance.
1367
- */
1368
- show: () => void;
1369
- }
1354
+ declare function getActionRoot(): ShadowRoot | null;
1355
+ // -------- The following codes are deprecated --------
1370
1356
  /**
1371
1357
  * 非推奨
1372
1358
  *
@@ -1374,7 +1360,7 @@ interface App {
1374
1360
  *
1375
1361
  * @internal
1376
1362
  */
1377
- declare function createApp<Props, Variables, VariablesQuery>(App: typeof SvelteComponentDev, options?: AppOptions<Props, Variables, VariablesQuery>): App;
1363
+ declare const show: typeof showAction;
1378
1364
  /**
1379
1365
  * 非推奨
1380
1366
  *
@@ -1382,865 +1368,151 @@ declare function createApp<Props, Variables, VariablesQuery>(App: typeof SvelteC
1382
1368
  *
1383
1369
  * @internal
1384
1370
  */
1385
- declare function destroy(): void;
1371
+ declare const close: typeof closeAction;
1386
1372
  declare namespace widget {
1387
- /** @internal */
1388
- const PropTypes: readonly [
1389
- "BooleanKeyword",
1390
- "NumberKeyword",
1391
- "StringKeyword",
1392
- "Function",
1393
- "Enum",
1394
- "Code",
1395
- "Direction",
1396
- "Url",
1397
- "Image",
1398
- "AnimationStyle",
1399
- "LongText",
1400
- "Length",
1401
- "Color",
1402
- "Alignment",
1403
- "State",
1404
- "TransitState",
1405
- "Style",
1406
- "ModalPlacement",
1407
- "OnClick"
1408
- ];
1409
- /** @internal */
1410
- type PropType = (typeof PropTypes)[number];
1411
- /** @internal */
1412
- type Code = string;
1413
- /** @internal */
1414
- const MediaQueries: {
1415
- [key: string]: string;
1416
- };
1417
- /** @internal */
1418
- type MediaQuery = string;
1419
- /** @internal */
1420
- const Directions: readonly [
1421
- "row",
1422
- "column"
1423
- ];
1424
- /** @internal */
1425
- type Direction = (typeof Directions)[number];
1426
- /** @internal */
1427
- const AnimationStyles: readonly [
1428
- "none",
1429
- "fade",
1430
- "bounce",
1431
- "slide-down",
1432
- "slide-up",
1433
- "slide-left",
1434
- "slide-right"
1435
- ];
1436
- /** @internal */
1437
- type AnimationStyle = (typeof AnimationStyles)[number];
1438
- /** @internal */
1439
- const ModalPositions: readonly [
1440
- "top-left",
1441
- "top-center",
1442
- "top-right",
1443
- "center-left",
1444
- "center",
1445
- "center-right",
1446
- "bottom-left",
1447
- "bottom-center",
1448
- "bottom-right",
1449
- "none"
1450
- ];
1451
- /** @internal */
1452
- type ModalPosition = (typeof ModalPositions)[number];
1453
- /** @internal */
1454
- type ModalMargin = {
1455
- left?: string;
1456
- right?: string;
1457
- top?: string;
1458
- bottom?: string;
1459
- };
1460
- /** @internal */
1461
- type ModalPlacement<M = ModalMargin> = {
1462
- position?: ModalPosition;
1463
- margin?: M;
1464
- backgroundOverlay?: boolean;
1465
- backgroundClick?: OnClickOperation;
1466
- };
1467
- /** @internal */
1468
- const DefaultModalPlacement: Required<ModalPlacement<Required<ModalMargin>>>;
1469
- /** @internal */
1470
- const Elasticities: readonly [
1471
- "none",
1472
- "vertical",
1473
- "horizontal"
1474
- ];
1475
- /** @internal */
1476
- type Elasticity = (typeof Elasticities)[number];
1477
- /** @internal */
1478
- const ElasticityStyle: {
1479
- none: string;
1480
- vertical: string;
1481
- horizontal: string;
1482
- };
1483
- /** @internal */
1484
- const TextDirections: readonly [
1485
- "horizontal",
1486
- "vertical"
1487
- ];
1488
- /** @internal */
1489
- type TextDirection = (typeof TextDirections)[number];
1490
- type OperationArgumentTypes = {
1491
- StringKeyword: string;
1492
- BooleanKeyword: boolean;
1493
- NumberKeyword: number;
1494
- TransitState: string;
1495
- Url: string;
1496
- Handler: string;
1497
- Trigger: string;
1498
- };
1499
- /** @internal */
1500
- type OperationArgumentType = keyof OperationArgumentTypes;
1501
- type BaseOperationOptions = ReadonlyArray<{
1502
- operation: string;
1503
- args: ReadonlyArray<{
1504
- type: OperationArgumentType;
1505
- default: any;
1506
- }>;
1507
- }>;
1508
- type ConvertOperationOptions<O extends BaseOperationOptions> = ConvertOperationOption<O[number]>;
1509
- type ConvertOperationOption<Option extends BaseOperationOptions[number]> = Option extends any ? {
1510
- operation: Option["operation"];
1511
- args: ConvertOperationOptionArguments<Option["args"]>;
1512
- } : never;
1513
- type ConvertOperationOptionArguments<Arguments extends BaseOperationOptions[number]["args"]> = {
1514
- -readonly [Index in keyof Arguments]: Arguments[Index] extends BaseOperationOptions[number]["args"][number] ? OperationArgumentTypes[Arguments[Index]["type"]] : never;
1515
- };
1516
- /** @internal */
1517
- type Operation = ConvertOperationOptions<ReadonlyArray<any>>;
1518
- /** @internal */
1519
- const OnClickOperationOptions: readonly [
1520
- {
1521
- readonly operation: "none";
1522
- readonly args: readonly [
1523
- ];
1524
- },
1525
- {
1526
- readonly operation: "linkTo";
1527
- readonly args: readonly [
1528
- {
1529
- readonly type: "Url";
1530
- readonly default: "";
1531
- },
1532
- {
1533
- readonly type: "BooleanKeyword";
1534
- readonly default: true;
1535
- }
1536
- ];
1537
- },
1538
- {
1539
- readonly operation: "moveTo";
1540
- readonly args: readonly [
1541
- {
1542
- readonly type: "TransitState";
1543
- readonly default: "/";
1544
- }
1545
- ];
1546
- },
1547
- {
1548
- readonly operation: "closeApp";
1549
- readonly args: readonly [
1550
- {
1551
- readonly type: "Trigger";
1552
- readonly default: "button";
1553
- }
1554
- ];
1555
- },
1556
- {
1557
- readonly operation: "runScript";
1558
- readonly args: readonly [
1559
- {
1560
- readonly type: "Handler";
1561
- readonly default: "";
1562
- }
1563
- ];
1564
- },
1565
- {
1566
- readonly operation: "submitForm";
1567
- readonly args: readonly [
1568
- {
1569
- readonly type: "TransitState";
1570
- readonly default: "/";
1571
- }
1572
- ];
1573
- }
1574
- ];
1575
- /** @internal */
1576
- type OnClickOperation = ConvertOperationOptions<typeof OnClickOperationOptions>;
1577
- /** @internal */
1578
- type LongText = string;
1579
- /** @internal */
1580
- type Url = string;
1581
- /** @internal */
1582
- type Image = string;
1583
- /** @internal */
1584
- const LengthUnits: readonly [
1585
- "px",
1586
- "em",
1587
- "rem",
1588
- "vw",
1589
- "fr",
1590
- "%"
1591
- ];
1592
- /** @internal */
1593
- type LengthUnit = (typeof LengthUnits)[number];
1594
- /** @internal */
1595
- type Length = `${number}${LengthUnit}` | "auto";
1596
- /** @internal */
1597
- type Color = `#${string}` | `rgba(${string})`;
1598
- /** @internal */
1599
- type FontWeight = string;
1600
- /** @internal */
1601
- const Fonts: readonly [
1602
- "Noto Sans JP",
1603
- "M PLUS Rounded 1c",
1604
- "M PLUS 1p",
1605
- "Kosugi Maru",
1606
- "Kosugi",
1607
- "BIZ UDPGothic",
1608
- "Noto Serif JP",
1609
- "BIZ UDPMincho",
1610
- "Roboto",
1611
- "Open Sans",
1612
- "Montserrat",
1613
- "Lato",
1614
- "Poppins",
1615
- "Raleway",
1616
- "Nunito",
1617
- "Playfair Display",
1618
- "Merriweather",
1619
- "Lora",
1620
- "Libre Baskerville",
1621
- "EB Garamond"
1622
- ];
1623
- /** @internal */
1624
- const Justifies: readonly [
1625
- "flex-start",
1626
- "center",
1627
- "flex-end"
1628
- ];
1629
- /** @internal */
1630
- type Justify = (typeof Justifies)[number];
1631
- /** @internal */
1632
- const Alignments: readonly [
1633
- "flex-start",
1634
- "center",
1635
- "flex-end"
1636
- ];
1637
- /** @internal */
1638
- type Alignment = (typeof Alignments)[number];
1639
- /** @internal */
1640
- const FlexDirections: readonly [
1641
- "row",
1642
- "column"
1643
- ];
1644
- /** @internal */
1645
- type FlexDirection = (typeof FlexDirections)[number];
1646
- /** @internal */
1647
- const ObjectFits: readonly [
1648
- "fill",
1649
- "contain",
1650
- "cover"
1651
- ];
1652
- /** @internal */
1653
- type ObjectFit = (typeof ObjectFits)[number];
1654
- /** @internal */
1655
- const ClipPaths: readonly [
1656
- "none",
1657
- "circle(closest-side)"
1658
- ];
1659
- /** @internal */
1660
- type ClipPath = (typeof ClipPaths)[number];
1661
- /** @internal */
1662
- const Repeats: readonly [
1663
- "repeat",
1664
- "space",
1665
- "round",
1666
- "no-repeat"
1667
- ];
1668
- /** @internal */
1669
- type Repeat = (typeof Repeats)[number];
1670
- /** @internal */
1671
- const BackgroundSizes: readonly [
1672
- "cover",
1673
- "contain",
1674
- "auto"
1675
- ];
1676
- /** @internal */
1677
- type BackgroundSize = (typeof BackgroundSizes)[number];
1678
- /** @internal */
1679
- const Cursors: readonly [
1680
- "default",
1681
- "pointer"
1682
- ];
1683
- /** @internal */
1684
- type Cursor = (typeof Cursors)[number];
1685
- /** @internal */
1686
- const Overflows: readonly [
1687
- "visible",
1688
- "auto",
1689
- "hidden"
1690
- ];
1691
- /** @internal */
1692
- type Overflow = (typeof Overflows)[number];
1693
- /** @internal */
1694
- type Border = string;
1695
- /** @internal */
1696
- type BorderStyle = string;
1697
- /** @internal */
1698
- type BorderWidth = `${number}px`;
1699
- /** @internal */
1700
- type BoxShadow = string;
1701
- /** @internal */
1702
- type Style = string;
1703
- /** @internal */
1704
- type TransitState = string;
1705
- /** @internal */
1706
- const WritingModes: readonly [
1707
- "horizontal-tb",
1708
- "vertical-lr"
1709
- ];
1710
- /** @internal */
1711
- type WritingMode = (typeof WritingModes)[number];
1712
- /** @internal */
1713
- type DateTime = string;
1714
- /** @internal */
1715
- type Icon = string;
1716
- /** @internal */
1717
- const ListSeparatorTypes: readonly [
1718
- "none",
1719
- "border",
1720
- "gap"
1721
- ];
1722
- /** @internal */
1723
- interface EdgePosition {
1724
- edgeDistance: Length;
1725
- edgeDirectionOffset: Length;
1726
- }
1727
- /** @internal */
1728
- const DefaultEdgePosition: EdgePosition;
1729
- type ListSeparatorType = (typeof ListSeparatorTypes)[number];
1730
- interface BaseListSeparator {
1731
- type: ListSeparatorType;
1732
- }
1733
- /** @internal */
1734
- interface ListSeparatorNone extends BaseListSeparator {
1735
- type: "none";
1736
- }
1737
- /** @internal */
1738
- interface ListSeparatorBorder extends BaseListSeparator {
1739
- type: "border";
1740
- borderStyle: BorderStyle;
1741
- borderWidth?: BorderWidth;
1742
- borderColor?: Color;
1743
- }
1744
- /** @internal */
1745
- interface ListSeparatorGap extends BaseListSeparator {
1746
- type: "gap";
1747
- gap: Length;
1748
- }
1749
- /** @internal */
1750
- type ListSeparator = ListSeparatorNone | ListSeparatorBorder | ListSeparatorGap;
1751
- /** @internal */
1752
- const DefaultListSeparatorNone: Required<ListSeparatorNone>;
1753
- /** @internal */
1754
- const DefaultListSeparatorBorder: Required<ListSeparatorBorder>;
1755
- /** @internal */
1756
- const DefaultListSeparatorGap: Required<ListSeparatorGap>;
1757
- /** @internal */
1758
- const DefaultListSeparator: Required<ListSeparatorBorder>;
1759
- /** @internal */
1760
- const ListBackgroundTypes: readonly [
1761
- "none",
1762
- "stripe"
1763
- ];
1764
- type ListBackgroundType = (typeof ListBackgroundTypes)[number];
1765
- interface BaseListBackground {
1766
- type: ListBackgroundType;
1767
- }
1768
- /** @internal */
1769
- interface ListBackgroundNone extends BaseListBackground {
1770
- type: "none";
1771
- }
1772
- /** @internal */
1773
- interface ListBackgroundStripe extends BaseListBackground {
1774
- type: "stripe";
1775
- background1?: Color;
1776
- background2?: Color;
1777
- }
1778
- /**
1779
- * @internal
1780
- */
1781
- type ListBackground = ListBackgroundNone | ListBackgroundStripe;
1782
- /** @internal */
1783
- const DefaultListBackgroundNone: Required<ListBackgroundNone>;
1784
- /** @internal */
1785
- const DefaultListBackgroundStripe: Required<ListBackgroundStripe>;
1786
- /** @internal */
1787
- const DefaultListBackground: Required<ListBackgroundNone>;
1788
- /** @internal */
1789
- const ListDirections: readonly [
1790
- "vertical",
1791
- "horizontal"
1792
- ];
1793
- /** @internal */
1794
- type ListDirection = (typeof ListDirections)[number];
1795
- /** @internal */
1796
- type ListContext = {
1797
- separator: ListSeparator;
1798
- background: ListBackground;
1799
- direction: ListDirection;
1800
- registerItem: (props: {
1801
- onMount: (props: {
1802
- index: number;
1803
- length: number;
1804
- }) => void;
1805
- }) => string;
1806
- unregisterItem: (id: string) => void;
1807
- };
1808
- type SlideButtonType = "icon" | "text";
1809
- type BaseSlideButton = {
1810
- type: SlideButtonType;
1811
- };
1812
- /** @internal */
1813
- interface SlideButtonIcon extends BaseSlideButton {
1814
- type: "icon";
1815
- icon: string;
1816
- size: Length;
1817
- color: Color;
1818
- fill: Color;
1819
- }
1820
- /** @internal */
1821
- interface SlideButtonText extends BaseSlideButton {
1822
- type: "text";
1823
- text: string;
1824
- }
1825
- /** @internal */
1826
- type SlideButton = SlideButtonIcon | SlideButtonText;
1827
- /** @internal */
1828
- const DefaultSlideButton: {
1829
- readonly type: "icon";
1830
- readonly icon: "chevron-left";
1831
- readonly color: "#999";
1832
- readonly fill: "#999";
1833
- readonly size: "20px";
1834
- };
1835
- /** @internal */
1836
- type SlideButtonPosition = "top" | "middle" | "bottom";
1837
- /** @internal */
1838
- interface SlideNavigationButton {
1839
- type: "circle";
1840
- size: Length;
1841
- color: Color;
1842
- colorActive: Color;
1843
- }
1844
- /** @internal */
1845
- const DefaultSlideNavigationButton: {
1846
- readonly type: "circle";
1847
- readonly size: "8px";
1848
- readonly color: "#ddd";
1849
- readonly colorActive: "#666";
1850
- };
1851
- /** @internal */
1852
- type FormInputName = string;
1853
- /** @internal */
1854
- interface FormButtonColor {
1855
- main: Color;
1856
- sub: Color;
1857
- }
1858
- /** @internal */
1859
- const DefaultFormButtonColor: {
1860
- readonly main: "#2aab9f";
1861
- readonly sub: "#fff";
1862
- };
1863
- /** @internal */
1864
- type Store<T> = Writable_<T>; // Wrap svelte tools
1865
- /**
1866
- * get store state value
1867
- *
1868
- * @deprecated 非推奨
1869
- *
1870
- * @internal
1871
- */
1872
- const getStoreState: typeof get_;
1873
- /**
1874
- * KARTE のシステム設定情報
1875
- *
1876
- * @public
1877
- */
1878
- type SystemConfig = {
1879
- /**
1880
- * API キー
1881
- */
1882
- apiKey?: string;
1883
- /**
1884
- * 接客ID
1885
- */
1886
- campaignId?: string;
1887
- shortenId?: string;
1888
- };
1889
- /**
1890
- * アクションのイベントハンドラ
1891
- *
1892
- * @public
1893
- */
1894
- type ActionEventHandler = (...args: any[]) => any | Promise<any>;
1895
- /**
1896
- * アクション設定
1897
- *
1898
- * @public
1899
- */
1900
- type ActionSetting = {
1901
- send?: (event_name: string, values?: any) => void;
1902
- initialState?: string;
1903
- };
1904
- /**
1905
- * 変数
1906
- *
1907
- * @public
1908
- */
1909
- type ActionVariables = {
1910
- [key: string]: any;
1911
- };
1912
- /**
1913
- * Store to handle action setting
1914
- *
1915
- * @internal
1916
- */
1917
- const actionSetting: Store<ActionSetting>;
1918
- /**
1919
- * {@link getSetting} function to get action setting.
1920
- *
1921
- * @returns Current action setting
1922
- *
1923
- * @internal
1924
- */
1925
- function getSetting(): ActionSetting;
1926
- /**
1927
- * アクション設定を更新する
1928
- *
1929
- * @param setting - 更新するアクション設定
1930
- *
1931
- * @returns 新しいアクション設定
1932
- *
1933
- * @public
1934
- */
1935
- function setSetting(setting: ActionSetting): ActionSetting;
1936
- /**
1937
- * {@link resetSetting} function to reset action setting
1938
- *
1939
- * @internal
1940
- */
1941
- function resetSetting(): void;
1942
- /**
1943
- * Store to read KARTE system config
1944
- *
1945
- * @internal
1946
- */
1947
- const system: Store<SystemConfig>;
1948
- /**
1949
- * KARTE の設定を取得する
1950
- *
1951
- * @remarks
1952
- * アクションが表示されて設定されるため、{@link onShow} フック関数で利用できます。
1953
- * 取得できる設定は、APIキー、接客ID、アクションショートIDなどです。
1954
- *
1955
- * @returns 現在の KARTE システムの設定を返します
1956
- *
1957
- * @public
1958
- */
1959
- function getSystem(): SystemConfig;
1960
- /**
1961
- * {@link setSystem} function to set KARTE system config.
1962
- *
1963
- * @internal
1964
- */
1965
- function setSystem(config: SystemConfig): void;
1966
- /**
1967
- * Store to handle current state ID
1968
- *
1969
- * This is exported becase of compatible interface for App.svelte.
1970
- * Don't use directly.
1971
- *
1972
- * @internal
1973
- */
1974
- const state: Store<string>;
1975
- /**
1976
- * 現在のステートを設定する
1977
- *
1978
- * @param stateId - 表示するステートID
1979
- * @param options - オプション。`options.disableInPreview`でプレビュー時のステート遷移を無効化できます。
1980
- *
1981
- * @public
1982
- */
1983
- function setState(stateId: string, options?: {
1984
- disableInPreview: boolean;
1985
- }): void;
1986
- /**
1987
- * 現在のステートを取得する
1988
- *
1989
- * @remarks
1990
- * アクションが表示されて設定されるため、{@link onShow} フック関数で利用できます。
1991
- *
1992
- * @returns 現在のステートID
1993
- *
1994
- * @public
1995
- */
1996
- function getState(): string;
1997
- /**
1998
- * Store to handle all state IDs
1999
- *
2000
- * @internal
2001
- */
2002
- const states: Store<string[]>;
2003
- /**
2004
- * {@link getStates} function to add new state ID to list of state IDs.
2005
- *
2006
- * @param stateId - New state ID
2007
- *
2008
- * @internal
2009
- */
2010
- function addState(stateId: string): void;
2011
- /**
2012
- * ステートID一覧を取得する
2013
- *
2014
- * @remarks
2015
- * アクションが表示されて設定されるため、{@link onShow} フック関数で利用できます。
2016
- *
2017
- * @returns すべてのステートID
2018
- *
2019
- * @public
2020
- */
2021
- function getStates(): string[];
2022
1373
  /**
2023
- * Store to handle visibility of action
1374
+ * アクションの汎用的なタイプを定義する
2024
1375
  *
2025
- * @internal
1376
+ * モーダル(ポップアップ)やアクションテーブルなど機能別のタイプは含めない。
2026
1377
  */
2027
- const opened: Store<boolean>;
2028
1378
  /**
2029
- * アクションの表示・非表示の状態を取得する
2030
- *
2031
- * @returns アクションが表示されているときは `true`、非表示のときは `false` を返します。
1379
+ * アクションのイベントハンドラ
2032
1380
  *
2033
1381
  * @public
2034
1382
  */
2035
- function isOpened(): boolean;
2036
- /**
2037
- * {@link setOpened} function to set if action is opened.
2038
- *
2039
- * @internal
2040
- */
2041
- function setOpened(on: boolean): void;
2042
- /**
2043
- * Store to handle visibility of action
2044
- *
2045
- * @deprecated 非推奨
2046
- *
2047
- * @internal
2048
- */
2049
- const closed: Store<boolean>; // deprecated
2050
- /**
2051
- * {@link isClosed} function to check if action is clsoed.
2052
- *
2053
- * @returns Flag if action is closed / true: Closed, false: Not closed
2054
- *
2055
- * @deprecated 非推奨
2056
- *
2057
- * @internal
2058
- */
2059
- function isClosed(): boolean;
2060
- /**
2061
- * {@link setClosed} function to set if action is closed.
2062
- *
2063
- * @deprecated 非推奨
2064
- *
2065
- * @internal
2066
- */
2067
- function setClosed(on: boolean): void;
2068
- /**
2069
- * Store to handle max z-index for grid items
2070
- *
2071
- * @internal
2072
- */
2073
- const maximumZindex: Store<number>;
2074
- /**
2075
- * Set maximum z-index.
2076
- *
2077
- * @internal
2078
- */
2079
- const setMaximumZindex: (zindex?: number) => void;
2080
- /**
2081
- * Store to handle internal event handlers
2082
- *
2083
- * @internal
2084
- */
2085
- const internalHandlers: Store<{
2086
- [key: string]: ActionEventHandler[];
2087
- }>;
2088
- /**
2089
- * {@link getInternalHandlers} function to get internal event handlers.
2090
- *
2091
- * @returns Current internal handlers
2092
- *
2093
- * @internal
2094
- */
2095
- function getInternalHandlers(): {
2096
- [key: string]: ActionEventHandler[];
2097
- };
2098
- /**
2099
- * {@link setInternalHandlers} function to set internal event handlers.
2100
- *
2101
- * @param handlers - New internal event handlers
2102
- *
2103
- * @internal
2104
- */
2105
- function setInternalHandlers(handlers: {
2106
- [key: string]: ActionEventHandler[];
2107
- }): {
2108
- [key: string]: ActionEventHandler[];
2109
- };
2110
- /**
2111
- * Store to handle internal event handlers for widget API
2112
- *
2113
- * @internal
2114
- */
2115
- const widgetHandlers: Store<{
2116
- [key: string]: ActionEventHandler[];
2117
- }>;
2118
- /**
2119
- * {@link getWidgetHandlers} function to get internal event handlers for widget API.
2120
- *
2121
- * @param handlers - New internal widget event handlers
2122
- *
2123
- * @returns Current internal widget handlers
2124
- *
2125
- * @internal
2126
- */
2127
- function getWidgetHandlers(): {
2128
- [key: string]: ActionEventHandler[];
2129
- };
2130
- /**
2131
- * {@link setWidgetHandlers} function to set internal event handlers.
2132
- *
2133
- * @internal
2134
- */
2135
- function setWidgetHandlers(handlers: {
2136
- [key: string]: ActionEventHandler[];
2137
- }): void;
2138
- /**
2139
- * Store to handle event handlers
2140
- *
2141
- * This is used internally.
2142
- *
2143
- * @internal
2144
- */
2145
- const eventHandlers: Store<{
2146
- [key: string]: ActionEventHandler;
2147
- }>;
1383
+ type ActionEventHandler = (...args: any[]) => any | Promise<any>;
2148
1384
  /**
2149
- * イベントハンドラーの一覧を取得する
2150
- *
2151
- * @returns 現在のイベントハンドラー
1385
+ * アクションの変数
2152
1386
  *
2153
1387
  * @public
2154
1388
  */
2155
- function getEventHandlers(): {
2156
- [key: string]: ActionEventHandler;
1389
+ type ActionVariables = {
1390
+ [key: string]: any;
2157
1391
  };
2158
1392
  /**
2159
- * イベントハンドラーを登録する
2160
- *
2161
- * @remarks
2162
- * 登録したイベントハンドラーは、ビジュアルエディタでアクション本体とのテキストボタンのクリック時の動作で利用できます。
2163
- *
2164
- * @param handlers - 登録するイベントハンドラー
1393
+ * アクション設定
2165
1394
  *
2166
1395
  * @public
2167
1396
  */
2168
- function setEventHandlers(handlers: {
2169
- [key: string]: ActionEventHandler;
2170
- }): {
2171
- [key: string]: ActionEventHandler;
1397
+ type ActionSetting = {
1398
+ send?: (event_name: string, values?: any) => void;
1399
+ initialState?: string;
2172
1400
  };
2173
1401
  /**
2174
- * イベントハンドラーをリセットする
2175
- *
2176
- */
2177
- function resetEventHandlers(): void;
2178
- /**
2179
- * Store to handle destruction of action
1402
+ * アクションの send 関数
2180
1403
  *
2181
- * @internal
1404
+ * @public
2182
1405
  */
2183
- const destroyed: Store<boolean>;
1406
+ type SendFunction = (event_name: string, values?: any) => void;
2184
1407
  /**
2185
- * {@link isDestroyed} function to check if action is destroyed.
2186
- *
2187
- * @returns Flag if action is destoryed / true: Destroyed, false: Not Destroyed
1408
+ * アクションの publish 関数
2188
1409
  *
2189
- * @internal
1410
+ * @public
2190
1411
  */
2191
- function isDestroyed(): boolean;
1412
+ type PublishFunction = (topic: string, values?: any) => void;
2192
1413
  /**
2193
- * {@link setDestroyed} function to set if action is destroyed.
1414
+ * アクションのライフサイクル changeState で呼び出されるフック関数
2194
1415
  *
2195
- * @internal
2196
- */
2197
- function setDestroyed(on: boolean): void;
2198
- /**
2199
- * Store to handle variables
1416
+ * @param props - アクションのプロパティ
1417
+ * @param newState - アクションの新しいステート
2200
1418
  *
2201
- * @internal
1419
+ * @public
2202
1420
  */
2203
- const variables: Store<{
2204
- [key: string]: any;
2205
- }>;
1421
+ type ActionChangeStateHook<Props, Variables> = (props: Parameters<ActionHook<Props, Variables & ActionVariables>>[0], newState: string) => void | Promise<void>;
2206
1422
  /**
2207
- * 変数の一覧を取得する
2208
- *
2209
- * @returns 現在の変数の一覧
1423
+ * アクションのプロパティ
2210
1424
  *
2211
- * @internal
1425
+ * @public
2212
1426
  */
2213
- function getVariables(): ActionVariables;
1427
+ interface ActionProps<Props, Variables> {
1428
+ /**
1429
+ * アクションでイベントがトリガーされたときに受信するための関数
1430
+ */
1431
+ send: SendFunction;
1432
+ /**
1433
+ * アクション内でタグのQueueにリクエストを発行する関数
1434
+ */
1435
+ publish: PublishFunction;
1436
+ /**
1437
+ * アクションで使用されるデータ
1438
+ */
1439
+ data: Props & Variables & ActionVariables;
1440
+ /**
1441
+ * アクションが表示されたときにフックされる {@link onShow}
1442
+ */
1443
+ onShow?: ActionHook<Props, Variables & ActionVariables>;
1444
+ /**
1445
+ * アクションのステートが変更されたときにフックされる {@link onChangeState}
1446
+ */
1447
+ onChangeState?: ActionChangeStateHook<Props, Variables & ActionVariables>;
1448
+ }
2214
1449
  /**
2215
- * 変数を設定する
2216
- *
2217
- * @remarks
2218
- * 設定した変数は、ビジュアルエディタのテキストフォームなどで利用できます。
1450
+ * アクションのライフサイクルで呼び出されるフック
2219
1451
  *
2220
- * @param vars - 変数
1452
+ * @param props - アクションのプロパティ
2221
1453
  *
2222
- * @internal
1454
+ * @public
2223
1455
  */
2224
- function setVariables(vars: ActionVariables): ActionVariables;
1456
+ type ActionHook<Props, Variables> = (props: ActionProps<Props, Variables & ActionVariables>) => void | Promise<void>;
2225
1457
  /**
2226
- * 変数をリセットする
1458
+ * {@link create} 向けのオプション
2227
1459
  *
1460
+ * @public
2228
1461
  */
2229
- function resetVariables(): void;
2230
- /** @internal */
2231
- interface FormData {
2232
- [name: string]: {
2233
- statePath: string;
2234
- value: any;
2235
- isValid: boolean;
2236
- };
1462
+ interface ActionOptions<Props, Variables, VariablesQuery> {
1463
+ /**
1464
+ * アクション内でイベントを発火する関数
1465
+ *
1466
+ * @defaultValue `() => {}`
1467
+ */
1468
+ send?: SendFunction;
1469
+ /**
1470
+ * アクション内でタグのQueueにリクエストを発行する関数
1471
+ *
1472
+ * @defaultValue `() => {}`
1473
+ */
1474
+ publish?: PublishFunction;
1475
+ /**
1476
+ * アクションで使用されるプロパティ
1477
+ *
1478
+ * @defaultValue `{}`
1479
+ */
1480
+ props?: Props;
1481
+ /**
1482
+ * アクションで使用される解析時に取得される変数
1483
+ *
1484
+ * @defaultValue `{}`
1485
+ */
1486
+ variables?: Variables;
1487
+ /**
1488
+ * アクションで使用されるアクション実行時に取得される変数
1489
+ *
1490
+ * @defaultValue `[]`
1491
+ */
1492
+ localVariablesQuery?: VariablesQuery;
1493
+ /**
1494
+ * アクションが作成されているときにフックされる {@link onCreate}
1495
+ *
1496
+ * @defaultValue `() => {}`
1497
+ */
1498
+ onCreate?: ActionHook<Props, Variables & ActionVariables>;
2237
1499
  }
2238
1500
  /**
2239
- * Store for form data
1501
+ * KARTE のシステム設定情報
2240
1502
  *
2241
- * @internal
1503
+ * @public
2242
1504
  */
2243
- const formData: Writable_<FormData>;
1505
+ type SystemConfig = {
1506
+ /**
1507
+ * API キー
1508
+ */
1509
+ apiKey?: string;
1510
+ /**
1511
+ * 接客ID
1512
+ */
1513
+ campaignId?: string;
1514
+ shortenId?: string;
1515
+ };
2244
1516
  type ActionTableResult = number | string | boolean | Date | null | undefined;
2245
1517
  type ActionTableQueryParam = string | number | boolean | Date;
2246
1518
  type ActionTableQueryParams = {
@@ -2331,7 +1603,7 @@ declare namespace widget {
2331
1603
  [key: string]: any;
2332
1604
  }>;
2333
1605
  /**
2334
- * プロパティ
1606
+ * モーダル(ポップアップ)のプロパティ
2335
1607
  *
2336
1608
  * @internal
2337
1609
  */
@@ -2357,185 +1629,114 @@ declare namespace widget {
2357
1629
  */
2358
1630
  show_on_time?: boolean;
2359
1631
  /**
2360
- * 表示する秒数
2361
- */
2362
- show_on_time_count?: number;
2363
- /**
2364
- * 全ての条件を満たしたら非表示するかどうか
2365
- */
2366
- hide_and_condition?: boolean;
2367
- /**
2368
- * スクロール率で非表示を有効化するかどうか
2369
- */
2370
- hide_on_scroll?: boolean;
2371
- /**
2372
- * 非表示にするスクロール率
2373
- */
2374
- hide_on_scroll_rate?: number;
2375
- /**
2376
- * 条件を満たした時に表示するかどうか
2377
- */
2378
- hide_on_scroll_releave?: boolean;
2379
- /**
2380
- * 時間による非表示を有効化するかどうか
2381
- */
2382
- hide_on_time?: boolean;
2383
- /**
2384
- * 非表示にする秒数
2385
- */
2386
- hide_on_time_count?: number;
2387
- }
2388
- type _Props = Props;
2389
- /**
2390
- * 表示アクショントリガー
2391
- *
2392
- * @internal
2393
- */
2394
- type ShowTrigger = "custom" | "auto" | "none";
2395
- /**
2396
- * 閉じるアクショントリガー
2397
- *
2398
- * @public
2399
- */
2400
- type CloseTrigger = "button" | "overlay" | "auto" | "none";
2401
- /** @internal */
2402
- const ALL_ACTION_ID = "KARTE_ALL_ACTION_ID";
2403
- /** @internal */
2404
- const ALL_ACTION_SHORTEN_ID = "KARTE_ALL_ACTION_SHORTEN_ID";
2405
- // prettier-ignore
2406
- /** @internal */
2407
- const actionId: string;
2408
- /** @internal */
2409
- const ACTION_SHOW_EVENT: string;
2410
- /** @internal */
2411
- const ACTION_CLOSE_EVENT: string;
2412
- /** @internal */
2413
- const ACTION_DESTROY_EVENT: string;
2414
- /** @internal */
2415
- const ACTION_CHANGE_STATE_EVENT: string;
2416
- /** @internal */
2417
- const handleState: (event: any) => void;
2418
- /** @internal */
2419
- const initialize: (setting?: ActionSetting) => () => void;
2420
- /** @internal */
2421
- const finalize: () => void;
2422
- /** @internal */
2423
- const send_event: (event_name: string, values?: any) => void;
2424
- /** @internal */
2425
- const none: () => () => void; // eslint-disable-next @typescript-eslint/no-empty-function
2426
- /** @internal */
2427
- const moveTo: (to: string) => () => void;
2428
- /** @internal */
2429
- const linkTo: (to: string, targetBlank?: boolean) => () => void;
2430
- /** @internal */
2431
- const closeApp: (trigger: CloseTrigger) => () => void;
2432
- /** @internal */
2433
- const runScript: (handlerName: string) => () => void;
2434
- /** @internal */
2435
- const submitForm: (to: string) => () => void;
2436
- /** @internal */
2437
- const execOnClickOperation: (onClickOperation: OnClickOperation) => void;
2438
- /** @internal */
2439
- const haveFunction: (onClickOperation: OnClickOperation) => boolean;
2440
- /**
2441
- * An option for svelte custom animation
2442
- */
2443
- interface CustomAnimationOptions {
1632
+ * 表示する秒数
1633
+ */
1634
+ show_on_time_count?: number;
2444
1635
  /**
2445
- * A Transform value in percent of target element
1636
+ * 全ての条件を満たしたら非表示するかどうか
2446
1637
  */
2447
- transform: [
2448
- number,
2449
- number
2450
- ];
1638
+ hide_and_condition?: boolean;
1639
+ /**
1640
+ * スクロール率で非表示を有効化するかどうか
1641
+ */
1642
+ hide_on_scroll?: boolean;
2451
1643
  /**
2452
- * A style of animation(e.g. fade, slide-in)
1644
+ * 非表示にするスクロール率
2453
1645
  */
2454
- animationStyle: AnimationStyle;
1646
+ hide_on_scroll_rate?: number;
2455
1647
  /**
2456
- * A waiting time in milliseconds before starting animation
2457
- *
2458
- * @defaultValue 0
1648
+ * 条件を満たした時に表示するかどうか
2459
1649
  */
2460
- delay?: number;
1650
+ hide_on_scroll_releave?: boolean;
2461
1651
  /**
2462
- * A total duration time in milliseconds of the animation
2463
- *
2464
- * @defaultValue 1000
1652
+ * 時間による非表示を有効化するかどうか
1653
+ */
1654
+ hide_on_time?: boolean;
1655
+ /**
1656
+ * 非表示にする秒数
2465
1657
  */
2466
- duration?: number;
1658
+ hide_on_time_count?: number;
2467
1659
  }
2468
1660
  /**
2469
- * The function to activate svelte animation.
1661
+ * スクロールに応じてアクションを非表示にするトリガー関数
1662
+ *
1663
+ * @remarks
1664
+ * スクロール率が `hide_on_scroll_rate` に達したときに `hide` 関数を呼び出します。
1665
+ * `show_on_scroll_reenter` が `true` で、かつ `hide_on_scroll_rate` またはその値以下の場合、アクションに対して `show` 関数が呼び出されます。
2470
1666
  *
2471
- * @param node - A target node of animation. This argument is passed by svelte, by default.
2472
- * @param customAnimationOptions - A custom animation option object
1667
+ * @param props - アクションのプロパティ。プロパティには `hide_on_scroll`、`hide_on_scroll_rate` そして `show_on_scroll_reenter` が必要です。
1668
+ * @param hide - アクションを非表示にするロジックが実装された関数。指定ない場合は noop 関数が使用されます。
1669
+ * @param show - アクションを再び表示するロジックが実装された関数。指定ない場合は noop 関数が使用されます。
2473
1670
  *
2474
- * @see {@link https://svelte.dev/docs#template-syntax-element-directives-transition-fn-custom-transition-functions| Custom transition functions} for detail documentation
1671
+ * @returns
1672
+ * スクロールが開始された場合は、クリーンアップする関数を返します。そうでない場合は `null` を返します。
2475
1673
  *
2476
1674
  * @internal
2477
1675
  */
2478
- function customAnimation(node: Element, { transform, animationStyle, delay, duration }: CustomAnimationOptions): {
2479
- delay?: undefined;
2480
- duration?: undefined;
2481
- easing?: undefined;
2482
- css?: undefined;
2483
- } | {
2484
- delay: number;
2485
- duration: number;
2486
- easing: (t: any) => any;
2487
- css: (progress: number) => string;
2488
- };
1676
+ 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;
2489
1677
  /**
2490
- * ES Modules に対応していない JavaScript をページに読み込む
1678
+ * 時間に応じてアクションを非表示にするトリガー関数
1679
+ *
1680
+ * @remarks
1681
+ * 時間のカウントが `hide_on_time_count` に達したときに `hide` 関数を呼び出します。
2491
1682
  *
2492
- * @param src - JavaScript ファイルのリンク URL
1683
+ * @param props - アクションのプロパティ。プロパティには `hide_on_time` そして `hide_on_time_count` が必要です。
1684
+ * @param hide - アクションを非表示にするロジックが実装された関数。指定ない場合は noop 関数が使用されます。
2493
1685
  *
2494
- * @public
1686
+ * @returns
1687
+ * タイマーが開始された場合、タイマーをクリーンアップする関数を返します。それ以外は `null` を返します。
1688
+ *
1689
+ * @internal
2495
1690
  */
2496
- function loadGlobalScript(src: string): Promise<any>;
1691
+ function hideOnTime<ModalProps extends Pick<Props, "hide_on_time" | "hide_on_time_count">>(props: ModalProps, hide?: Function): (() => void) | null;
2497
1692
  /**
2498
- * グローバル CSS をページに適用する
1693
+ * スクロールに応じてアクションを表示するトリガー関数
2499
1694
  *
2500
- * @param css - CSS
1695
+ * @remarks
1696
+ * スクロール率が `show_on_scroll_rate` に達したときに `show` 関数を呼び出します。
1697
+ * `hide_on_scroll_releave` が `true` で、かつ `show_on_scroll_rate` 以下の場合は、アクションに対して `hide` 関数が呼び出されます。
2501
1698
  *
2502
- * @public
1699
+ * @param props - アクションのプロパティ。プロパティには `show_on_scroll`、`show_on_scroll_rate` そして `hide_on_scroll_releave` が必要です。
1700
+ * @param show - アクションを表示するロジックが実装された関数。指定ない場合は noop 関数が使用されます。
1701
+ * @param hide - アクションを非表示にするロジックが実装された関数。指定ない場合は noop 関数が使用されます。
1702
+ *
1703
+ * @returns
1704
+ * スクロールが開始されている場合は、クリーンアップ関数を返します。そうでない場合は `null` を返します
1705
+ *
1706
+ * @internal
2503
1707
  */
2504
- function applyGlobalCss(css: string): Promise<any>;
1708
+ 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;
2505
1709
  /**
2506
- * style ファイルをページに読み込む
1710
+ * 時間に応じてアクションを表示するトリガー関数
2507
1711
  *
2508
- * @param href - style ファイルのリンク URL
1712
+ * @param props - アクションのプロパティ。プロパティには `show_on_time` そして `show_on_time_count` が必要です。
1713
+ * @param show - アクションを表示するロジックが実装された関数。指定ない場合は noop 関数が使用されます。
2509
1714
  *
2510
- * @public
1715
+ * @remarks
1716
+ * 時間のカウントが `show_on_time_count` に達したときに `show` 関数を呼び出します。
1717
+ *
1718
+ * @returns
1719
+ * タイマーが開始された場合、タイマーをクリーンアップする関数を返します。それ以外は `null` を返します。
1720
+ *
1721
+ * @internal
2511
1722
  */
2512
- function loadGlobalStyle(href: string): Promise<any>;
2513
- // @internal
2514
- function getCssVariables<Props extends _Props, Variables>(data: Writable<Props & Variables & ActionVariables & VariableQuery>): string;
2515
- type _Props$0 = Props;
1723
+ function showOnTime<ModalProps extends Pick<Props, "show_on_time" | "show_on_time_count">>(props: ModalProps, show?: Function): (() => void) | null;
2516
1724
  /** @internal */
2517
- const ACTION_HOOK_LABEL = "__ACTION_HOOK__";
1725
+ function and(fn: Function, ...conditionFns: Function[]): () => void;
2518
1726
  /** @internal */
2519
- type ActionHookLog = {
2520
- name: string;
2521
- values?: any;
2522
- };
1727
+ function or(fn: Function, ...conditionFns: Function[]): () => void;
1728
+ type ModalProps = Props;
2523
1729
  /**
2524
- * アクションのライフサイクルで呼び出されるフック
2525
- *
2526
- * @param props - アクションのプロパティ
1730
+ * 表示アクショントリガー
2527
1731
  *
2528
- * @public
2529
- */
2530
- type ActionHook<Props extends _Props$0, Variables> = (props: ActionProps<Props, Variables & ActionVariables>) => void | Promise<void>;
1732
+ * @internal */
1733
+ type ShowTrigger = "custom" | "auto" | "none";
2531
1734
  /**
2532
- * アクションが作成 (create) される前にフックする関数
2533
- *
2534
- * @param fn - 呼び出されるフック関数
1735
+ * 閉じるアクショントリガー
2535
1736
  *
2536
1737
  * @public
2537
1738
  */
2538
- function onCreate<Props extends _Props$0, Variables>(fn: ActionHook<Props, Variables & ActionVariables>): void;
1739
+ type CloseTrigger = "button" | "overlay" | "auto" | "none";
2539
1740
  /**
2540
1741
  * アクションが表示 (show) された後にフックする関数
2541
1742
  *
@@ -2543,7 +1744,7 @@ declare namespace widget {
2543
1744
  *
2544
1745
  * @public
2545
1746
  */
2546
- function onShow<Props extends _Props$0, Variables>(fn: ActionHook<Props, Variables & ActionVariables>): void;
1747
+ function onShow<Props extends ModalProps, Variables>(fn: ActionHook<Props, Variables & ActionVariables>): void;
2547
1748
  /**
2548
1749
  * アクションのライフサイクル close で呼び出されるフックする関数
2549
1750
  *
@@ -2552,7 +1753,7 @@ declare namespace widget {
2552
1753
  *
2553
1754
  * @public
2554
1755
  */
2555
- type ActionCloseHook<Props extends _Props$0, Variables> = (props: Parameters<ActionHook<Props, Variables & ActionVariables>>[0], trigger: CloseTrigger) => void | Promise<void>;
1756
+ type ActionCloseHook<Props extends ModalProps, Variables> = (props: Parameters<ActionHook<Props, Variables & ActionVariables>>[0], trigger: CloseTrigger) => void | Promise<void>;
2556
1757
  /**
2557
1758
  * アクションがクローズ (close) される前にフックする関数
2558
1759
  *
@@ -2560,24 +1761,7 @@ declare namespace widget {
2560
1761
  *
2561
1762
  * @public
2562
1763
  */
2563
- function onClose<Props extends _Props$0, Variables>(fn: ActionCloseHook<Props, Variables & ActionVariables>): void;
2564
- /**
2565
- * アクションが破棄 (destroy) される前にフックする関数
2566
- *
2567
- * @param fn - 呼び出されるフック関数
2568
- *
2569
- * @public
2570
- */
2571
- function onDestroy<Props extends _Props$0, Variables>(fn: ActionHook<Props, Variables & ActionVariables>): void;
2572
- /**
2573
- * アクションのライフサイクル changeState で呼び出されるフック関数
2574
- *
2575
- * @param props - アクションのプロパティ
2576
- * @param newState - アクションの新しいステート
2577
- *
2578
- * @public
2579
- */
2580
- type ActionChangeStateHook<Props extends _Props$0, Variables> = (props: Parameters<ActionHook<Props, Variables & ActionVariables>>[0], newState: string) => void | Promise<void>;
1764
+ function onClose<Props extends ModalProps, Variables>(fn: ActionCloseHook<Props, Variables & ActionVariables>): void;
2581
1765
  /**
2582
1766
  * アクションのステートが変更された (changeState) 後にフックする関数
2583
1767
  *
@@ -2585,112 +1769,7 @@ declare namespace widget {
2585
1769
  *
2586
1770
  * @public
2587
1771
  */
2588
- function onChangeState<Props extends _Props$0, Variables>(fn: ActionChangeStateHook<Props, Variables & ActionVariables>): void;
2589
- /**
2590
- * アクションの send 関数
2591
- *
2592
- * @public
2593
- */
2594
- type SendFunction = (event_name: string, values?: any) => void;
2595
- /**
2596
- * アクションの publish 関数
2597
- *
2598
- * @public
2599
- */
2600
- type PublishFunction = (topic: string, values?: any) => void;
2601
- /**
2602
- * アクションのプロパティ
2603
- *
2604
- * @public
2605
- */
2606
- interface ActionProps<Props, Variables> {
2607
- /**
2608
- * アクションでイベントがトリガーされたときに受信するための関数
2609
- */
2610
- send: SendFunction;
2611
- /**
2612
- * アクション内でタグのQueueにリクエストを発行する関数
2613
- */
2614
- publish: PublishFunction;
2615
- /**
2616
- * アクションで使用されるデータ
2617
- */
2618
- data: Props & Variables & ActionVariables;
2619
- /**
2620
- * アクションが表示されたときにフックされる {@link onShow}
2621
- */
2622
- onShow?: ActionHook<Props, Variables & ActionVariables>;
2623
- /**
2624
- * アクションのステートが変更されたときにフックされる {@link onChangeState}
2625
- */
2626
- onChangeState?: ActionChangeStateHook<Props, Variables & ActionVariables>;
2627
- }
2628
- /**
2629
- * {@link create} 向けのオプション
2630
- *
2631
- * @public
2632
- */
2633
- interface ActionOptions<Props, Variables, VariablesQuery> {
2634
- /**
2635
- * アクション内でイベントを発火する関数
2636
- *
2637
- * @defaultValue `() => {}`
2638
- */
2639
- send?: SendFunction;
2640
- /**
2641
- * アクション内でタグのQueueにリクエストを発行する関数
2642
- *
2643
- * @defaultValue `() => {}`
2644
- */
2645
- publish?: PublishFunction;
2646
- /**
2647
- * アクションで使用されるプロパティ
2648
- *
2649
- * @defaultValue `{}`
2650
- */
2651
- props?: Props;
2652
- /**
2653
- * アクションで使用される解析時に取得される変数
2654
- *
2655
- * @defaultValue `{}`
2656
- */
2657
- variables?: Variables;
2658
- /**
2659
- * アクションで使用されるアクション実行時に取得される変数
2660
- *
2661
- * @defaultValue `[]`
2662
- */
2663
- localVariablesQuery?: VariablesQuery;
2664
- /**
2665
- * アクションが作成されているときにフックされる {@link onCreate}
2666
- *
2667
- * @defaultValue `() => {}`
2668
- */
2669
- onCreate?: ActionHook<Props, Variables & ActionVariables>;
2670
- }
2671
- /**
2672
- * アクションを作成する
2673
- *
2674
- * @param App - Svelte コンポーネントのエントリポイント
2675
- * @param options - {@link ActionOptions | オプション}
2676
- *
2677
- * @returns アクションを破棄する関数
2678
- *
2679
- * @public
2680
- */
2681
- function create<Props extends _Props$0, Variables, VariablesQuery extends Array<VariableQuery>>(App: typeof SvelteComponentDev, options?: ActionOptions<Props, Variables & ActionVariables, VariablesQuery>): () => void;
2682
- /**
2683
- * Dispatch the event to destroy KARTE action
2684
- *
2685
- * @internal
2686
- */
2687
- function dispatchDestroyEvent(): void;
2688
- /**
2689
- * アクションの破棄する
2690
- *
2691
- * @public
2692
- */
2693
- function destroyAction(): void;
1772
+ function onChangeState<Props extends ModalProps, Variables>(fn: ActionChangeStateHook<Props, Variables & ActionVariables>): void;
2694
1773
  /**
2695
1774
  * アクションを表示する
2696
1775
  *
@@ -2705,44 +1784,6 @@ declare namespace widget {
2705
1784
  * @public
2706
1785
  */
2707
1786
  function closeAction(trigger?: CloseTrigger): void;
2708
- /** @internal */
2709
- const KARTE_ACTION_ROOT = "karte-action-root";
2710
- /** @internal */
2711
- const KARTE_ACTION_RID = "karte-action-rid";
2712
- /** @internal */
2713
- const KARTE_ACTION_SHORTEN_ID = "karte-action-id";
2714
- /** @internal */
2715
- function ensureActionRoot(useShadow?: boolean): ShadowRoot | HTMLElement;
2716
- /** @internal */
2717
- const h: (type: string, props: any, ...children: Array<any>) => HTMLElement;
2718
- /**
2719
- * 非推奨
2720
- *
2721
- * @deprecated 非推奨
2722
- *
2723
- * @internal
2724
- */
2725
- function createFog({ color, opacity, zIndex, onclick }: {
2726
- color?: string;
2727
- opacity?: string;
2728
- zIndex?: number;
2729
- onclick: () => void;
2730
- }): {
2731
- fog: HTMLDivElement;
2732
- close: () => void;
2733
- };
2734
- /** @internal */
2735
- type EmbedLogic = "replace" | "append" | "prepend" | "after" | "before";
2736
- /** @internal */
2737
- function embed(target: HTMLElement, replace: HTMLElement, embed_method: EmbedLogic): void;
2738
- /**
2739
- * アクションのルートの DOM 要素を取得する
2740
- *
2741
- * @returns アクションがルートの DOM 要素 を持つ場合は DOM 要素を返します。ない場合は `null` を返します
2742
- *
2743
- * @public
2744
- */
2745
- function getActionRoot(): ShadowRoot | null;
2746
1787
  /**
2747
1788
  * アクションに CSS を適用する
2748
1789
  *
@@ -2761,31 +1802,17 @@ declare namespace widget {
2761
1802
  * @public
2762
1803
  */
2763
1804
  function loadStyle(href: string): Promise<void>;
2764
- // -------- The following codes are deprecated --------
2765
- /**
2766
- * 非推奨
2767
- *
2768
- * @deprecated 非推奨
2769
- *
2770
- * @internal
2771
- */
2772
- const showModal: typeof create;
2773
- /**
2774
- * 非推奨
2775
- *
2776
- * @deprecated 非推奨
2777
- *
2778
- * @internal
2779
- */
2780
- type ModalOptions<Props, Variables, VariablesQuery> = ActionOptions<Props, Variables, VariablesQuery>;
1805
+ // @internal
1806
+ function getCssVariables<Props extends ModalProps, Variables>(data: Writable<Props & Variables & ActionVariables & VariableQuery>): string;
2781
1807
  /**
2782
- * 非推奨
1808
+ * アクションのルートの DOM 要素を取得する
2783
1809
  *
2784
- * @deprecated 非推奨
1810
+ * @returns アクションがルートの DOM 要素 を持つ場合は DOM 要素を返します。ない場合は `null` を返します
2785
1811
  *
2786
- * @internal
1812
+ * @public
2787
1813
  */
2788
- const KARTE_MODAL_ROOT = "karte-modal-root";
1814
+ function getActionRoot(): ShadowRoot | null;
1815
+ // -------- The following codes are deprecated --------
2789
1816
  /**
2790
1817
  * 非推奨
2791
1818
  *
@@ -2793,7 +1820,8 @@ declare namespace widget {
2793
1820
  *
2794
1821
  * @internal
2795
1822
  */
2796
- const ensureModalRoot: typeof ensureActionRoot;
1823
+ function getActionShadowRoot(): ShadowRoot | null;
1824
+ // -------- The following codes are deprecated --------
2797
1825
  /**
2798
1826
  * 非推奨
2799
1827
  *
@@ -2810,55 +1838,6 @@ declare namespace widget {
2810
1838
  * @internal
2811
1839
  */
2812
1840
  const close: typeof closeAction;
2813
- /**
2814
- * 非推奨
2815
- *
2816
- * @deprecated 非推奨
2817
- *
2818
- * @internal
2819
- */
2820
- type AppOptions<Props, Variables, VariablesQuery> = ActionOptions<Props, Variables, VariablesQuery>;
2821
- /**
2822
- * 非推奨
2823
- *
2824
- * @deprecated 非推奨
2825
- *
2826
- * @internal
2827
- */
2828
- interface App {
2829
- /**
2830
- * The method to destroy an app instance.
2831
- */
2832
- close: () => void;
2833
- /**
2834
- * The method to show an app instance.
2835
- */
2836
- show: () => void;
2837
- }
2838
- /**
2839
- * 非推奨
2840
- *
2841
- * @deprecated 非推奨
2842
- *
2843
- * @internal
2844
- */
2845
- function createApp<Props, Variables, VariablesQuery>(App: typeof SvelteComponentDev, options?: AppOptions<Props, Variables, VariablesQuery>): App;
2846
- /**
2847
- * 非推奨
2848
- *
2849
- * @deprecated 非推奨
2850
- *
2851
- * @internal
2852
- */
2853
- function getActionShadowRoot(): ShadowRoot | null;
2854
- /**
2855
- * 非推奨
2856
- *
2857
- * @deprecated 非推奨
2858
- *
2859
- * @internal
2860
- */
2861
- function destroy(): void;
2862
1841
  // @ts-ignore
2863
1842
  type ChangeValCallback = ({ newVal, oldVal, key }: {
2864
1843
  newVal: any;
@@ -2920,7 +1899,7 @@ declare namespace widget {
2920
1899
  *
2921
1900
  * @public
2922
1901
  */
2923
- function setState$0(stateId: string): void;
1902
+ function setState(stateId: string): void;
2924
1903
  /**
2925
1904
  * 現在のステートを取得する
2926
1905
  *
@@ -2928,7 +1907,7 @@ declare namespace widget {
2928
1907
  *
2929
1908
  * @public
2930
1909
  */
2931
- function getState$0(): string;
1910
+ function getState(): string;
2932
1911
  /**
2933
1912
  * ページ内の変数を設定する
2934
1913
  *
@@ -3037,8 +2016,8 @@ declare const afterUpdate: typeof afterUpdateSvelte;
3037
2016
  declare const tick: typeof tickSvelte;
3038
2017
  // @internal
3039
2018
  declare const LAYOUT_COMPONENT_NAMES: string[];
3040
- export { loadGlobalScript, loadGlobalStyle, applyGlobalCss, getCssVariables, initialize, finalize, getState, setState, getStates, isOpened, getVariables, setVariables, resetVariables, getEventHandlers, setEventHandlers, resetEventHandlers, getSystem, setSetting, eventHandlers, variables, formData, state, onScroll, onTime, getLogs, getEvents, logger, listenLogger, hideOnScroll, hideOnTime, showOnScroll, showOnTime, PropTypes, PropType, Code, MediaQueries, MediaQuery, Directions, Direction, AnimationStyles, AnimationStyle, ModalPositions, ModalPosition, ModalMargin, ModalPlacement, DefaultModalPlacement, Elasticities, Elasticity, ElasticityStyle, TextDirections, TextDirection, OperationArgumentType, Operation, OnClickOperationOptions, OnClickOperation, LongText, Url, Image, LengthUnits, LengthUnit, Length, Color, FontWeight, Fonts, Justifies, Justify, Alignments, Alignment, FlexDirections, FlexDirection, ObjectFits, ObjectFit, ClipPaths, ClipPath, Repeats, Repeat, BackgroundSizes, BackgroundSize, Cursors, Cursor, Overflows, Overflow, Border, BorderStyle, BorderWidth, BoxShadow, Style, TransitState, WritingModes, WritingMode, DateTime, Icon, ListSeparatorTypes, EdgePosition, DefaultEdgePosition, ListSeparatorNone, ListSeparatorBorder, ListSeparatorGap, ListSeparator, DefaultListSeparatorNone, DefaultListSeparatorBorder, DefaultListSeparatorGap, DefaultListSeparator, ListBackgroundTypes, ListBackgroundNone, ListBackgroundStripe, ListBackground, DefaultListBackgroundNone, DefaultListBackgroundStripe, DefaultListBackground, ListDirections, ListDirection, ListContext, SlideButtonIcon, SlideButtonText, SlideButton, DefaultSlideButton, SlideButtonPosition, SlideNavigationButton, DefaultSlideNavigationButton, FormInputName, FormButtonColor, DefaultFormButtonColor, create, showAction, closeAction, destroyAction, loadStyle, applyCss, getActionRoot, onCreate, onShow, onClose, onDestroy, onChangeState, ACTION_HOOK_LABEL, showModal, ensureModalRoot, show, close, destroy, createApp, createFog, KARTE_MODAL_ROOT, collection, loadActionTableRow, loadActionTableRows, loadActionTableQuery, loadActionTable, widget, onMount, onDestory, beforeUpdate, afterUpdate, tick, LAYOUT_COMPONENT_NAMES };
3041
- export type { CloseTrigger, ActionVariables, ActionEventHandler, SystemConfig, OnScrollContext, OnScrollFunction, ScrollDirection, LogLevel, Log, Event, ActionProps, ActionOptions, ActionHook, ActionCloseHook, ActionChangeStateHook, SendFunction, ActionHookLog, CollectionConfig, ActionTableRowRequestConfig, ActionTableRowsRequestConfig, ActionTableQueryRequestConfig, ActionTableRequestConfig };
2019
+ export { ACTION_HOOK_LABEL, KARTE_MODAL_ROOT, create, onCreate, destroyAction, onDestroy, initialize, finalize, showModal, ensureModalRoot, destroy, createApp, createFog, loadGlobalScript, loadGlobalStyle, applyGlobalCss, getState, setState, getStates, isOpened, getVariables, setVariables, resetVariables, getEventHandlers, setEventHandlers, resetEventHandlers, getSystem, setSetting, eventHandlers, variables, formData, state, onScroll, onTime, getLogs, getEvents, logger, listenLogger, hideOnScroll, hideOnTime, showOnScroll, showOnTime, PropTypes, PropType, Code, MediaQueries, MediaQuery, Directions, Direction, AnimationStyles, AnimationStyle, ModalPositions, ModalPosition, ModalMargin, ModalPlacement, DefaultModalPlacement, Elasticities, Elasticity, ElasticityStyle, TextDirections, TextDirection, OperationArgumentType, Operation, OnClickOperationOptions, OnClickOperation, LongText, Url, Image, LengthUnits, LengthUnit, Length, Color, FontWeight, Fonts, Justifies, Justify, Alignments, Alignment, FlexDirections, FlexDirection, ObjectFits, ObjectFit, ClipPaths, ClipPath, Repeats, Repeat, BackgroundSizes, BackgroundSize, Cursors, Cursor, Overflows, Overflow, Border, BorderStyle, BorderWidth, BoxShadow, Style, TransitState, WritingModes, WritingMode, DateTime, Icon, ListSeparatorTypes, EdgePosition, DefaultEdgePosition, ListSeparatorNone, ListSeparatorBorder, ListSeparatorGap, ListSeparator, DefaultListSeparatorNone, DefaultListSeparatorBorder, DefaultListSeparatorGap, DefaultListSeparator, ListBackgroundTypes, ListBackgroundNone, ListBackgroundStripe, ListBackground, DefaultListBackgroundNone, DefaultListBackgroundStripe, DefaultListBackground, ListDirections, ListDirection, ListContext, SlideButtonIcon, SlideButtonText, SlideButton, DefaultSlideButton, SlideButtonPosition, SlideNavigationButton, DefaultSlideNavigationButton, FormInputName, FormButtonColor, DefaultFormButtonColor, showAction, closeAction, loadStyle, applyCss, onShow, onClose, onChangeState, getActionRoot, getCssVariables, show, close, collection, loadActionTableRow, loadActionTableRows, loadActionTableQuery, loadActionTable, widget, onMount, onDestory, beforeUpdate, afterUpdate, tick, LAYOUT_COMPONENT_NAMES };
2020
+ export type { ActionHookLog, SystemConfig, ActionVariables, ActionEventHandler, ActionProps, ActionOptions, ActionHook, ActionChangeStateHook, SendFunction, PublishFunction, OnScrollContext, OnScrollFunction, ScrollDirection, LogLevel, Log, Event, ActionCloseHook, ShowTrigger, CloseTrigger, CollectionConfig, ActionTableRowRequestConfig, ActionTableRowsRequestConfig, ActionTableQueryRequestConfig, ActionTableRequestConfig };
3042
2021
  export { default as State } from './components/State.svelte';
3043
2022
  export { default as StateItem } from './components/StateItem.svelte';
3044
2023
  export { default as Modal } from './components/Modal.svelte';