@plaidev/karte-action-sdk 1.1.125 → 1.1.126-27949188.96bb611a

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.
package/README.md CHANGED
@@ -1,11 +1,13 @@
1
- # action-sdk
1
+ # `@plaidev/karte-action-sdk`
2
2
 
3
- ## Installation
3
+ KARTE action for SDK
4
+
5
+ ## 💿 Installation
4
6
 
5
7
  ```sh
6
8
  npm install --save @plaidev/karte-action-sdk
7
9
  ```
8
10
 
9
- ## License
11
+ ## ©️ License
10
12
 
11
13
  [Apache License 2.0](./LICENSE)
@@ -4349,7 +4349,7 @@ function instance$h($$self, $$props, $$invalidate) {
4349
4349
 
4350
4350
  let { _textStyle = 'font-size:12px;' } = $$props;
4351
4351
  let { textDirection = 'horizontal' } = $$props;
4352
- let { _style = '' } = $$props;
4352
+ let { _style = 'cursor: pointer;' } = $$props;
4353
4353
 
4354
4354
  function div0_binding($$value) {
4355
4355
  binding_callbacks[$$value ? 'unshift' : 'push'](() => {
package/dist/index.es.js CHANGED
@@ -4240,7 +4240,7 @@ function instance$h($$self, $$props, $$invalidate) {
4240
4240
 
4241
4241
  let { _textStyle = 'font-size:12px;' } = $$props;
4242
4242
  let { textDirection = 'horizontal' } = $$props;
4243
- let { _style = '' } = $$props;
4243
+ let { _style = 'cursor: pointer;' } = $$props;
4244
4244
 
4245
4245
  function div0_binding($$value) {
4246
4246
  binding_callbacks[$$value ? 'unshift' : 'push'](() => {
@@ -0,0 +1,4 @@
1
+ declare function createAppScript(script?: string): string;
2
+ declare function createIndexTsx(script?: string): string;
3
+ declare function createCustomScript(script?: string): string;
4
+ export { createAppScript, createIndexTsx, createCustomScript };
@@ -0,0 +1,106 @@
1
+ 'use strict';
2
+
3
+ function createAppScript(script = '') {
4
+ return `<script lang="ts">
5
+ // SDK generated imports: DON'T TOUCH THIS
6
+ // @ts-ignore
7
+ import type { ActionProps, CustomVariables } from "@plaidev/karte-action-sdk";
8
+ import type { Data, Props, Variables } from './gen';
9
+ import { onMount } from 'svelte';
10
+ import { writable } from 'svelte/store';
11
+ import {
12
+ state,
13
+ customVariables,
14
+ State,
15
+ StateItem,
16
+ Modal,
17
+ Grid,
18
+ GridItem,
19
+ List,
20
+ ListItem,
21
+ Slide,
22
+ SlideItem,
23
+ TextElement,
24
+ ImageElement,
25
+ TextButtonElement,
26
+ EmbedElement,
27
+ MovieYouTubeElement,
28
+ MovieVimeoElement,
29
+ FormTextarea,
30
+ FormRadioButtons,
31
+ FormSelect,
32
+ FormCheckBoxes,
33
+ FormRatingButtons,
34
+ } from '@plaidev/karte-action-sdk';
35
+
36
+ export let send: (event_name: string, values?: any) => void;
37
+ let data_: Data;
38
+ export { data_ as data };
39
+ let data = writable<Data & CustomVariables>({ ...data_ });
40
+ export let onShow: (props: ActionProps<Props, Variables>) => void = _props => {};
41
+ export let onChangeState: (props: ActionProps<Props, Variables>, stateId: string) => void = (_props, _state) => {};
42
+ ${script}
43
+
44
+ onMount(() => {
45
+ onShow({ send, data: $data });
46
+ });
47
+
48
+ $: {
49
+ if ($state) {
50
+ onChangeState({ send, data: $data }, $state);
51
+ }
52
+ }
53
+
54
+ $: {
55
+ data.update(current => {
56
+ return { ...current, ...$customVariables };
57
+ });
58
+ }
59
+ </script>`;
60
+ }
61
+ function createIndexTsx(script = '') {
62
+ return `import type { KarteAction, Send, Props, Variables } from "./gen";
63
+
64
+ import "https://polyfill.io/v3/polyfill.min.js?features=IntersectionObserver";
65
+ import { create } from "@plaidev/karte-action-sdk";
66
+
67
+ import { props } from "./gen";
68
+ import App from "./App.svelte";
69
+ import onCreate from "./customScript";
70
+ ${script}
71
+ const action = (options: { send: Send; props: Props; variables: Variables }): KarteAction => {
72
+ return create(App, {
73
+ props,
74
+ send: options.send,
75
+ variables: options.variables,
76
+ onCreate,
77
+ });
78
+ };
79
+
80
+ export default action;`;
81
+ }
82
+ function createCustomScript(script = '') {
83
+ return `/**
84
+ * アクションをカスタマイズするスクリプト
85
+ */
86
+ // ここでSDKをインポートしてください
87
+ //import jQuery from "jquery";
88
+ //import {
89
+ // onShow,
90
+ // onClose,
91
+ // onChangeState,
92
+ // onDestroy,
93
+ // setCustomVariables,
94
+ // setCustomHandlers,
95
+ //} from "@plaidev/karte-action-sdk";
96
+ ${script}
97
+ const onCreate = ({ send, data }) => {
98
+ // ここでアクションが作成される時のスクリプトを書いてください
99
+ };
100
+
101
+ export default onCreate;`;
102
+ }
103
+
104
+ exports.createAppScript = createAppScript;
105
+ exports.createCustomScript = createCustomScript;
106
+ exports.createIndexTsx = createIndexTsx;
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@plaidev/karte-action-sdk",
3
- "version": "1.1.125",
3
+ "version": "1.1.126-27949188.96bb611a",
4
4
  "author": "Plaid Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "module": "./dist/index.es.js",
7
7
  "types": "dist/index.es.d.ts",
8
+ "sideEffects": false,
8
9
  "exports": {
9
10
  ".": {
10
11
  "import": {
@@ -19,6 +20,7 @@
19
20
  },
20
21
  "./templates": {
21
22
  "import": "./dist/templates.js",
23
+ "require": "./dist/templates.cjs.js",
22
24
  "types": "./dist/templates.d.ts"
23
25
  },
24
26
  "./package.json": "./package.json",
@@ -121,6 +123,5 @@
121
123
  },
122
124
  "publishConfig": {
123
125
  "access": "public"
124
- },
125
- "sideEffects": false
126
+ }
126
127
  }