@plaidev/karte-action-sdk 1.1.158-28012700.23c1725b → 1.1.159-28012858.21df2a3f

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.
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @internal
8
8
  */
9
- declare function createAppScript(script?: string, icons?: string[]): string;
9
+ declare function createAppScript(script?: string, icons?: string[], customComponents?: string[]): string;
10
10
  /**
11
11
  * アクションのエントリーコード(index.tsx)の初期値の生成
12
12
  *
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * @internal
10
10
  */
11
- function createAppScript(script = '', icons = []) {
11
+ function createAppScript(script = '', icons = [], customComponents = []) {
12
12
  // TODO: `script` should be validated!
13
13
  return `<script lang="ts">
14
14
  // DON'T TOUCH THIS: SDK generates the following code
@@ -52,6 +52,13 @@ ${icons.length > 0
52
52
  ? `import {\n ${icons.join(',\n ')},\n} from '@plaidev/karte-action-sdk/icons';`
53
53
  : ''}
54
54
 
55
+ ${customComponents
56
+ .map(path => {
57
+ const componentName = path.split('/').pop().replace('.svelte', '');
58
+ return `import ${componentName} from '${path}';`;
59
+ })
60
+ .join('\n')}
61
+
55
62
  export let send: (event_name: string, values?: any) => void;
56
63
  let data_: Data;
57
64
  export { data_ as data };
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @internal
8
8
  */
9
- declare function createAppScript(script?: string, icons?: string[]): string;
9
+ declare function createAppScript(script?: string, icons?: string[], customComponents?: string[]): string;
10
10
  /**
11
11
  * アクションのエントリーコード(index.tsx)の初期値の生成
12
12
  *
package/dist/templates.js CHANGED
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @internal
8
8
  */
9
- function createAppScript(script = '', icons = []) {
9
+ function createAppScript(script = '', icons = [], customComponents = []) {
10
10
  // TODO: `script` should be validated!
11
11
  return `<script lang="ts">
12
12
  // DON'T TOUCH THIS: SDK generates the following code
@@ -50,6 +50,13 @@ ${icons.length > 0
50
50
  ? `import {\n ${icons.join(',\n ')},\n} from '@plaidev/karte-action-sdk/icons';`
51
51
  : ''}
52
52
 
53
+ ${customComponents
54
+ .map(path => {
55
+ const componentName = path.split('/').pop().replace('.svelte', '');
56
+ return `import ${componentName} from '${path}';`;
57
+ })
58
+ .join('\n')}
59
+
53
60
  export let send: (event_name: string, values?: any) => void;
54
61
  let data_: Data;
55
62
  export { data_ as data };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaidev/karte-action-sdk",
3
- "version": "1.1.158-28012700.23c1725b",
3
+ "version": "1.1.159-28012858.21df2a3f",
4
4
  "author": "Plaid Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "module": "./dist/index.es.js",