@plaidev/karte-action-sdk 1.0.45 → 1.1.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,378 @@
1
+ import { Writable } from "svelte/store";
2
+ declare const PropTypes: readonly [
3
+ "BooleanKeyword",
4
+ "NumberKeyword",
5
+ "StringKeyword",
6
+ "Function",
7
+ "Enum",
8
+ "Code",
9
+ "Direction",
10
+ "Url",
11
+ "Image",
12
+ "AnimationStyle",
13
+ "LongText",
14
+ "Length",
15
+ "Color",
16
+ "Alignment",
17
+ "State",
18
+ "Style",
19
+ "ModalPlacement",
20
+ "OnClick"
21
+ ];
22
+ type PropType = typeof PropTypes[number];
23
+ type Code = string;
24
+ declare const MediaQueries: {
25
+ [key: string]: string;
26
+ };
27
+ type MediaQuery = string;
28
+ declare const Directions: readonly [
29
+ "row",
30
+ "column"
31
+ ];
32
+ type Direction = typeof Directions[number];
33
+ declare const AnimationStyles: readonly [
34
+ "none",
35
+ "fade",
36
+ "bounce",
37
+ "slide-down",
38
+ "slide-up",
39
+ "slide-left",
40
+ "slide-right"
41
+ ];
42
+ type AnimationStyle = typeof AnimationStyles[number];
43
+ declare const AnimationStyleTranslations: {
44
+ none: {
45
+ ja: string;
46
+ en: string;
47
+ };
48
+ fade: {
49
+ ja: string;
50
+ en: string;
51
+ };
52
+ bounce: {
53
+ ja: string;
54
+ en: string;
55
+ };
56
+ "slide-down": {
57
+ ja: string;
58
+ en: string;
59
+ };
60
+ "slide-up": {
61
+ ja: string;
62
+ en: string;
63
+ };
64
+ "slide-left": {
65
+ ja: string;
66
+ en: string;
67
+ };
68
+ "slide-right": {
69
+ ja: string;
70
+ en: string;
71
+ };
72
+ };
73
+ declare const ModalPositions: readonly [
74
+ "top-left",
75
+ "top-center",
76
+ "top-right",
77
+ "center-left",
78
+ "center",
79
+ "center-right",
80
+ "bottom-left",
81
+ "bottom-center",
82
+ "bottom-right",
83
+ "none"
84
+ ];
85
+ type ModalPosition = typeof ModalPositions[number];
86
+ declare const ModalPositionTranslations: {
87
+ "top-left": {
88
+ ja: string;
89
+ en: string;
90
+ };
91
+ "top-center": {
92
+ ja: string;
93
+ en: string;
94
+ };
95
+ "top-right": {
96
+ ja: string;
97
+ en: string;
98
+ };
99
+ "center-left": {
100
+ ja: string;
101
+ en: string;
102
+ };
103
+ center: {
104
+ ja: string;
105
+ en: string;
106
+ };
107
+ "center-right": {
108
+ ja: string;
109
+ en: string;
110
+ };
111
+ "bottom-left": {
112
+ ja: string;
113
+ en: string;
114
+ };
115
+ "bottom-center": {
116
+ ja: string;
117
+ en: string;
118
+ };
119
+ "bottom-right": {
120
+ ja: string;
121
+ en: string;
122
+ };
123
+ };
124
+ declare const ModalMarginTranslations: {
125
+ left: {
126
+ ja: string;
127
+ en: string;
128
+ };
129
+ right: {
130
+ ja: string;
131
+ en: string;
132
+ };
133
+ top: {
134
+ ja: string;
135
+ en: string;
136
+ };
137
+ bottom: {
138
+ ja: string;
139
+ en: string;
140
+ };
141
+ };
142
+ type ModalMargin = {
143
+ left?: string;
144
+ right?: string;
145
+ top?: string;
146
+ bottom?: string;
147
+ };
148
+ type ModalPlacement<M = ModalMargin> = {
149
+ position?: ModalPosition;
150
+ margin?: M;
151
+ backgroundOverlay?: boolean;
152
+ };
153
+ declare const DefaultModalPlacement: Required<ModalPlacement<Required<ModalMargin>>>;
154
+ type I18nLabel<Locale extends string = "ja" | "en"> = {
155
+ [K in Locale]?: string;
156
+ };
157
+ type BaseOperationOptions = ReadonlyArray<{
158
+ name: I18nLabel;
159
+ operation: string;
160
+ args: ReadonlyArray<{
161
+ name: I18nLabel;
162
+ type: keyof OperationArgumentTypes;
163
+ default: any;
164
+ }>;
165
+ }>;
166
+ type OperationArgumentTypes = {
167
+ StringKeyword: string;
168
+ BooleanKeyword: boolean;
169
+ NumberKeyword: number;
170
+ State: string;
171
+ Url: string;
172
+ };
173
+ type ConvertOperationOptions<O extends BaseOperationOptions> = ConvertOperationOption<O[number]>;
174
+ type ConvertOperationOption<Option extends BaseOperationOptions[number]> = Option extends any ? {
175
+ operation: Option["operation"];
176
+ args: ConvertOperationOptionArguments<Option["args"]>;
177
+ } : never;
178
+ type ConvertOperationOptionArguments<Arguments extends BaseOperationOptions[number]["args"]> = {
179
+ -readonly [Index in keyof Arguments]: Arguments[Index] extends BaseOperationOptions[number]["args"][number] ? OperationArgumentTypes[Arguments[Index]["type"]] : never;
180
+ };
181
+ type Operation = ConvertOperationOptions<ReadonlyArray<any>>;
182
+ declare const OnClickOperationOptions: readonly [
183
+ {
184
+ readonly name: {
185
+ readonly ja: "\u64CD\u4F5C\u306A\u3057";
186
+ readonly en: "No Operation";
187
+ };
188
+ readonly operation: "none";
189
+ readonly args: readonly [
190
+ ];
191
+ },
192
+ {
193
+ readonly name: {
194
+ readonly ja: "\u30EA\u30F3\u30AF\u9077\u79FB";
195
+ readonly en: "Link To";
196
+ };
197
+ readonly operation: "linkTo";
198
+ readonly args: readonly [
199
+ {
200
+ readonly name: {
201
+ readonly ja: "URL\u3092\u5165\u529B";
202
+ readonly en: "Enter URL";
203
+ };
204
+ readonly type: "Url";
205
+ readonly default: "";
206
+ },
207
+ {
208
+ readonly name: {
209
+ readonly ja: "\u65B0\u3057\u3044\u30BF\u30D6\u3067\u958B\u304F";
210
+ readonly en: "Open in new tab";
211
+ };
212
+ readonly type: "BooleanKeyword";
213
+ readonly default: true;
214
+ }
215
+ ];
216
+ },
217
+ {
218
+ readonly name: {
219
+ readonly ja: "\u30B9\u30C6\u30FC\u30C8\u9077\u79FB";
220
+ readonly en: "Move To";
221
+ };
222
+ readonly operation: "moveTo";
223
+ readonly args: readonly [
224
+ {
225
+ readonly name: {
226
+ readonly ja: "\u30B9\u30C6\u30FC\u30C8\u3092\u9078\u629E";
227
+ readonly en: "State";
228
+ };
229
+ readonly type: "State";
230
+ readonly default: "/";
231
+ }
232
+ ];
233
+ },
234
+ {
235
+ readonly name: {
236
+ readonly ja: "\u9589\u3058\u308B";
237
+ readonly en: "Close";
238
+ };
239
+ readonly operation: "closeApp";
240
+ readonly args: readonly [
241
+ ];
242
+ }
243
+ ];
244
+ type OnClickOperation = ConvertOperationOptions<typeof OnClickOperationOptions>;
245
+ type LongText = string;
246
+ type Url = string;
247
+ type Image = string;
248
+ declare const LengthUnits: readonly [
249
+ "px",
250
+ "em",
251
+ "rem",
252
+ "vw",
253
+ "fr",
254
+ "%"
255
+ ];
256
+ type LengthUnit = typeof LengthUnits[number];
257
+ type Length = `${number}${LengthUnit}` | "auto";
258
+ type Color = `#${string}`;
259
+ declare const Justifies: readonly [
260
+ "flex-start",
261
+ "center",
262
+ "flex-end"
263
+ ];
264
+ type Justify = typeof Justifies[number];
265
+ declare const Alignments: readonly [
266
+ "flex-start",
267
+ "center",
268
+ "flex-end"
269
+ ];
270
+ type Alignment = typeof Alignments[number];
271
+ declare const ObjectFits: readonly [
272
+ "fill",
273
+ "contain",
274
+ "cover"
275
+ ];
276
+ type ObjectFit = typeof ObjectFits[number];
277
+ declare const Repeats: readonly [
278
+ "repeat",
279
+ "space",
280
+ "round",
281
+ "no-repeat"
282
+ ];
283
+ type Repeat = typeof Repeats[number];
284
+ declare const BackgroundSizes: readonly [
285
+ "cover",
286
+ "contain",
287
+ "auto"
288
+ ];
289
+ type BackgroundSize = typeof BackgroundSizes[number];
290
+ type Style = string;
291
+ type StateName = string;
292
+ type OPTIONS = {
293
+ send?: (event_name: string, values?: any) => void;
294
+ isPreview?: boolean;
295
+ initialState?: string;
296
+ };
297
+ declare const state: Writable<string>;
298
+ declare const closed: Writable<boolean>;
299
+ declare const maximumZindex: Writable<number>;
300
+ declare const initialize: (options?: OPTIONS) => () => void;
301
+ declare const finalize: () => void;
302
+ declare const send_event: (event_name: string, values?: any) => void;
303
+ declare const isPreview: () => boolean;
304
+ declare const setMiximumZindex: (zindex?: number) => void;
305
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
306
+ declare const none: () => () => void;
307
+ declare const moveTo: (to: string) => () => void;
308
+ declare const linkTo: (to: string, targetBlank?: boolean) => () => void;
309
+ declare const closeApp: () => () => void;
310
+ declare const execOnClickOperation: (onClickOperation: OnClickOperation) => void;
311
+ declare const handleFocus: (node: HTMLElement | null) => (e: any) => void;
312
+ declare const setPreviousFocus: () => void;
313
+ declare const handleKeydown: (handlers: {
314
+ [eventName: string]: (e: any) => void;
315
+ }) => (e: any) => void;
316
+ declare const getPositionStyle: (position: ModalPosition) => string;
317
+ declare const getMarginStyle: (margin: ModalMargin) => string;
318
+ declare function onScroll(fn: Function, rate: number): () => void;
319
+ declare function onTime(fn: Function, time: number): () => void;
320
+ declare function hasSuffix<Suffix extends "px" | "em" | "rem" | "%" | "fr" | "vw" | "vh" | "">(value: string, suffix: Suffix): value is `${number}${Suffix}`;
321
+ declare function toBr(text: string): string;
322
+ declare function randStr(digit?: number): string;
323
+ declare function hideOnScroll<Props extends {
324
+ hide_on_scroll: boolean;
325
+ hide_on_scroll_rate: number;
326
+ show_on_scroll_reenter: boolean;
327
+ }>(props: Props, fn?: () => void): () => void;
328
+ declare function hideOnTime<Props extends {
329
+ hide_on_time: boolean;
330
+ hide_on_time_count: number;
331
+ }>(props: Props, fn?: () => void): () => void;
332
+ declare function showOnScroll<Props extends {
333
+ show_on_scroll: boolean;
334
+ show_on_scroll_rate: number;
335
+ show_on_scroll_reenter: boolean;
336
+ }>(props: Props, fn?: Function): () => void;
337
+ declare function showOnTime<Props extends {
338
+ show_on_time: boolean;
339
+ show_on_time_count: number;
340
+ }>(props: Props, fn?: Function): () => void;
341
+ declare function ensureModalRoot(useShadow?: boolean): ShadowRoot | HTMLElement;
342
+ declare const h: (type: string, props: any, ...children: Array<any>) => HTMLElement;
343
+ declare function createFog({ color, opacity, zIndex, onclick }: {
344
+ color?: string;
345
+ opacity?: string;
346
+ zIndex?: number;
347
+ onclick: () => void;
348
+ }): {
349
+ fog: HTMLDivElement;
350
+ close: () => void;
351
+ };
352
+ type EmbedLogic = "replace" | "append" | "prepend" | "after" | "before";
353
+ declare function embed(target: HTMLElement, replace: HTMLElement, embed_method: EmbedLogic): void;
354
+ declare const collection: (config: {
355
+ api_key: string;
356
+ table: string;
357
+ endpoint?: string;
358
+ }) => {
359
+ get(key: string | string[], cb: (err: Error | null, items?: any) => void): void;
360
+ getByQuery(query_name: string, params: {
361
+ [p: string]: string | number | boolean | (string | number | boolean)[];
362
+ }, options: {
363
+ ignore_fields?: string[];
364
+ } | null | undefined, cb: (err: Error | null, items?: any) => void): void;
365
+ set(key: string, value: string, cb: (err: Error | null) => void): void;
366
+ };
367
+ export { state, closed, maximumZindex, initialize, finalize, send_event, isPreview, setMiximumZindex, none, moveTo, linkTo, closeApp, execOnClickOperation, handleFocus, setPreviousFocus, handleKeydown, getPositionStyle, getMarginStyle, onScroll, onTime, hasSuffix, toBr, randStr, PropTypes, PropType, Code, MediaQueries, MediaQuery, Directions, Direction, AnimationStyles, AnimationStyle, AnimationStyleTranslations, ModalPositions, ModalPosition, ModalPositionTranslations, ModalMarginTranslations, ModalMargin, ModalPlacement, DefaultModalPlacement, Operation, OnClickOperationOptions, OnClickOperation, LongText, Url, Image, LengthUnits, LengthUnit, Length, Color, Justifies, Justify, Alignments, Alignment, ObjectFits, ObjectFit, Repeats, Repeat, BackgroundSizes, BackgroundSize, Style, StateName, hideOnScroll, hideOnTime, showOnScroll, showOnTime, ensureModalRoot, h, createFog, EmbedLogic, embed, collection };
368
+ export { default as State } from './components/State.svelte';
369
+ export { default as StateItem } from './components/StateItem.svelte';
370
+ export { default as Modal } from './components/Modal.svelte';
371
+ export { default as GridModalState } from './components/GridModalState.svelte';
372
+ export { default as Grid } from './components/Grid.svelte';
373
+ export { default as GridItem } from './components/GridItem.svelte';
374
+ export { default as Flex } from './components/Flex.svelte';
375
+ export { default as FlexItem } from './components/FlexItem.svelte';
376
+ export { default as TextBlock } from './components/TextBlock.svelte';
377
+ export { default as TextButtonBlock } from './components/TextButtonBlock.svelte';
378
+ export { default as ImageBlock } from './components/ImageBlock.svelte';