@plaidev/karte-action-sdk 1.1.156-28011566.cc9ca327 → 1.1.157-28011607.f788fa7c

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.
@@ -11,7 +11,7 @@
11
11
  function createAppScript(script = '', icons = []) {
12
12
  // TODO: `script` should be validated!
13
13
  return `<script lang="ts">
14
- // DON'T TOUCH THIS: SDK generates the following imports
14
+ // DON'T TOUCH THIS: SDK generates the following code
15
15
  import type { ActionProps, ActionVariables } from '@plaidev/karte-action-sdk';
16
16
  import type { Data, Props, Variables } from './gen';
17
17
  import { onMount } from 'svelte';
@@ -19,6 +19,7 @@ import { writable } from 'svelte/store';
19
19
  import {
20
20
  state,
21
21
  variables as actionVariables,
22
+ getCssVariables,
22
23
  State,
23
24
  StateItem,
24
25
  Modal,
@@ -43,13 +44,12 @@ import {
43
44
  Countdown,
44
45
  Box,
45
46
  IconElement,
47
+ CustomElement,
46
48
  } from '@plaidev/karte-action-sdk';
47
49
 
48
- ${icons.length > 0 ? `import { ${icons.join(',')} } from '@plaidev/karte-action-sdk/icons';` : ''}
49
-
50
- // DON'T TOUCH THIS: SDK uses the following marks
51
- // __IMPORT_ELEMENTS_START__
52
- // __IMPORT_ELEMENTS_END__
50
+ ${icons.length > 0
51
+ ? `import {\n ${icons.join(',\n ')},\n} from '@plaidev/karte-action-sdk/icons';`
52
+ : ''}
53
53
 
54
54
  export let send: (event_name: string, values?: any) => void;
55
55
  let data_: Data;
@@ -58,7 +58,6 @@ let data = writable<Data & ActionVariables>({ ...data_ });
58
58
  export let onShow: (props: ActionProps<Props, Variables>) => void = _props => {};
59
59
  export let onChangeState: (props: ActionProps<Props, Variables>, stateId: string) => void = (_props, _state) => {};
60
60
  ${script}
61
-
62
61
  onMount(() => {
63
62
  onShow({ send, data: $data });
64
63
  });
@@ -74,6 +73,8 @@ $: {
74
73
  return { ...current, ...$actionVariables };
75
74
  });
76
75
  }
76
+
77
+ $: cssVariables = getCssVariables({ ...$data, ...$actionVariables });
77
78
  </script>`;
78
79
  }
79
80
  /**
package/dist/templates.js CHANGED
@@ -9,7 +9,7 @@
9
9
  function createAppScript(script = '', icons = []) {
10
10
  // TODO: `script` should be validated!
11
11
  return `<script lang="ts">
12
- // DON'T TOUCH THIS: SDK generates the following imports
12
+ // DON'T TOUCH THIS: SDK generates the following code
13
13
  import type { ActionProps, ActionVariables } from '@plaidev/karte-action-sdk';
14
14
  import type { Data, Props, Variables } from './gen';
15
15
  import { onMount } from 'svelte';
@@ -17,6 +17,7 @@ import { writable } from 'svelte/store';
17
17
  import {
18
18
  state,
19
19
  variables as actionVariables,
20
+ getCssVariables,
20
21
  State,
21
22
  StateItem,
22
23
  Modal,
@@ -41,13 +42,12 @@ import {
41
42
  Countdown,
42
43
  Box,
43
44
  IconElement,
45
+ CustomElement,
44
46
  } from '@plaidev/karte-action-sdk';
45
47
 
46
- ${icons.length > 0 ? `import { ${icons.join(',')} } from '@plaidev/karte-action-sdk/icons';` : ''}
47
-
48
- // DON'T TOUCH THIS: SDK uses the following marks
49
- // __IMPORT_ELEMENTS_START__
50
- // __IMPORT_ELEMENTS_END__
48
+ ${icons.length > 0
49
+ ? `import {\n ${icons.join(',\n ')},\n} from '@plaidev/karte-action-sdk/icons';`
50
+ : ''}
51
51
 
52
52
  export let send: (event_name: string, values?: any) => void;
53
53
  let data_: Data;
@@ -56,7 +56,6 @@ let data = writable<Data & ActionVariables>({ ...data_ });
56
56
  export let onShow: (props: ActionProps<Props, Variables>) => void = _props => {};
57
57
  export let onChangeState: (props: ActionProps<Props, Variables>, stateId: string) => void = (_props, _state) => {};
58
58
  ${script}
59
-
60
59
  onMount(() => {
61
60
  onShow({ send, data: $data });
62
61
  });
@@ -72,6 +71,8 @@ $: {
72
71
  return { ...current, ...$actionVariables };
73
72
  });
74
73
  }
74
+
75
+ $: cssVariables = getCssVariables({ ...$data, ...$actionVariables });
75
76
  </script>`;
76
77
  }
77
78
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaidev/karte-action-sdk",
3
- "version": "1.1.156-28011566.cc9ca327",
3
+ "version": "1.1.157-28011607.f788fa7c",
4
4
  "author": "Plaid Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "module": "./dist/index.es.js",