@plaidev/karte-action-sdk 1.1.139 → 1.1.140-27968620.92b2388a

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,4 +1,4 @@
1
- declare function createAppScript(script?: string): string;
1
+ declare function createAppScript(script?: string, icons?: string[]): string;
2
2
  declare function createIndexTsx({ script, polyfill, }?: {
3
3
  script?: string;
4
4
  polyfill?: boolean;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- function createAppScript(script = '') {
3
+ function createAppScript(script = '', icons = []) {
4
4
  // TODO: `script` should be validated!
5
5
  return `<script lang="ts">
6
6
  // SDK generated imports: DON'T TOUCH THIS
@@ -32,10 +32,14 @@ import {
32
32
  FormSelect,
33
33
  FormCheckBoxes,
34
34
  FormRatingButtonsNumber,
35
+ FormRatingButtonsFace,
35
36
  Countdown,
36
37
  Box,
38
+ IconElement,
37
39
  } from '@plaidev/karte-action-sdk';
38
40
 
41
+ ${icons.length > 0 ? `import { ${icons.join(',')} } from '@plaidev/karte-action-sdk/icons';` : ''}
42
+
39
43
  export let send: (event_name: string, values?: any) => void;
40
44
  let data_: Data;
41
45
  export { data_ as data };
@@ -85,17 +89,12 @@ export default action;`;
85
89
  }
86
90
  function createCustomScript(script = '') {
87
91
  // TODO: `script` should be validated!
88
- return `
89
- //import {
90
- // onShow,
91
- // onClose,
92
- // onChangeState,
93
- // onDestroy
94
- //} from "@plaidev/karte-action-sdk";
95
-
92
+ return `\
93
+ import { showAction } from "@plaidev/karte-action-sdk";
96
94
  ${script}
97
95
  export default ({ send, data }) => {
98
96
  // ここにスクリプトを書いてください
97
+ showAction();
99
98
  };`;
100
99
  }
101
100
 
@@ -1,4 +1,4 @@
1
- declare function createAppScript(script?: string): string;
1
+ declare function createAppScript(script?: string, icons?: string[]): string;
2
2
  declare function createIndexTsx({ script, polyfill, }?: {
3
3
  script?: string;
4
4
  polyfill?: boolean;
package/dist/templates.js CHANGED
@@ -1,4 +1,4 @@
1
- function createAppScript(script = '') {
1
+ function createAppScript(script = '', icons = []) {
2
2
  // TODO: `script` should be validated!
3
3
  return `<script lang="ts">
4
4
  // SDK generated imports: DON'T TOUCH THIS
@@ -30,10 +30,14 @@ import {
30
30
  FormSelect,
31
31
  FormCheckBoxes,
32
32
  FormRatingButtonsNumber,
33
+ FormRatingButtonsFace,
33
34
  Countdown,
34
35
  Box,
36
+ IconElement,
35
37
  } from '@plaidev/karte-action-sdk';
36
38
 
39
+ ${icons.length > 0 ? `import { ${icons.join(',')} } from '@plaidev/karte-action-sdk/icons';` : ''}
40
+
37
41
  export let send: (event_name: string, values?: any) => void;
38
42
  let data_: Data;
39
43
  export { data_ as data };
@@ -83,17 +87,12 @@ export default action;`;
83
87
  }
84
88
  function createCustomScript(script = '') {
85
89
  // TODO: `script` should be validated!
86
- return `
87
- //import {
88
- // onShow,
89
- // onClose,
90
- // onChangeState,
91
- // onDestroy
92
- //} from "@plaidev/karte-action-sdk";
93
-
90
+ return `\
91
+ import { showAction } from "@plaidev/karte-action-sdk";
94
92
  ${script}
95
93
  export default ({ send, data }) => {
96
94
  // ここにスクリプトを書いてください
95
+ showAction();
97
96
  };`;
98
97
  }
99
98
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaidev/karte-action-sdk",
3
- "version": "1.1.139",
3
+ "version": "1.1.140-27968620.92b2388a",
4
4
  "author": "Plaid Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "module": "./dist/index.es.js",
@@ -23,6 +23,10 @@
23
23
  "require": "./dist/templates.cjs.js",
24
24
  "types": "./dist/templates.d.ts"
25
25
  },
26
+ "./icons": {
27
+ "import": "./dist/icons.js",
28
+ "types": "./dist/icons.d.ts"
29
+ },
26
30
  "./package.json": "./package.json",
27
31
  "./dist/*": "./dist/*"
28
32
  },
@@ -34,6 +38,9 @@
34
38
  "templates": [
35
39
  "./dist/templates.d.ts"
36
40
  ],
41
+ "icons": [
42
+ "./dist/icons.d.ts"
43
+ ],
37
44
  "*": [
38
45
  "./dist/index.es.d.ts"
39
46
  ]
@@ -121,5 +128,8 @@
121
128
  },
122
129
  "publishConfig": {
123
130
  "access": "public"
131
+ },
132
+ "dependencies": {
133
+ "@rollup/plugin-image": "^3.0.2"
124
134
  }
125
135
  }