@inizioevoke/veeva-astroclm-core 1.2.1 → 1.2.3

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.
@@ -4,4 +4,16 @@ export type VeevaEnv = 'client' | 'evoke';
4
4
  export type VeevaPlatform = 'salesforce' | 'vault';
5
5
  export type LogLevel = 'disabled' | 'error' | 'debug';
6
6
  export type LogTime = 'none' | 'date' | 'time' | 'datetime' | 'performance';
7
- export type LogOutput = 'console' | 'screen';
7
+ export type LogOutput = 'console' | 'screen';
8
+
9
+ declare module 'astro:env/client' {
10
+ export const BUILD_TARGET: BuildTarget;
11
+ export const WEB_ENV: WebEnv;
12
+ export const WEB_SCALING: boolean;
13
+ export const VEEVA_TRAINING: boolean;
14
+ export const VEEVA_ENV: VeevaEnv;
15
+ export const VEEVA_PLATFORM: VeevaPlatform;
16
+ export const LOG_LEVEL: LogLevel;
17
+ export const LOG_TIME: LogTime;
18
+ export const LOG_OUTPUT: LogOutput;
19
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inizioevoke/veeva-astroclm-core",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "",
@@ -1,19 +1,21 @@
1
1
  ---
2
+ /// <reference path="../../../types/env.d.ts" />
3
+ import { BUILD_TARGET } from 'astro:env/client';
2
4
  import esbuild from 'esbuild';
3
- import { BuildTarget } from '../../../types/env';
5
+ // import { BuildTarget } from '../../../types/env';
4
6
 
5
7
  import script from './platform.ts?raw';
6
8
 
7
- export interface Props {
8
- buildTarget: BuildTarget;
9
- }
9
+ // export interface Props {
10
+ // buildTarget: BuildTarget;
11
+ // }
10
12
 
11
13
  const {
12
14
  buildTarget
13
15
  } = Astro.props;
14
16
 
15
17
  let js: string | undefined;
16
- if (buildTarget === 'veeva') {
18
+ if (BUILD_TARGET === 'veeva') {
17
19
  const { code } = await esbuild.transform(script, {
18
20
  loader: 'ts',
19
21
  target: 'es2020',
@@ -1,4 +1,4 @@
1
1
  export {
2
2
  default,
3
- type Props as PlatformScriptProps
3
+ // type Props as PlatformScriptProps
4
4
  } from "./PlatformScript.astro";
@@ -1,32 +1,28 @@
1
1
  ---
2
+ /// <reference path="../../../types/env.d.ts" />
3
+ import { BUILD_TARGET, WEB_SCALING } from 'astro:env/client';
2
4
  import esbuild from 'esbuild';
3
- import { BuildTarget } from '../../../types/env';
4
5
  import script from './resize.ts?raw';
5
6
 
6
7
  export interface Props {
7
- buildTarget: BuildTarget,
8
- webScaling: boolean,
9
- ivaDimensions: {
10
- width: number,
11
- height: number
12
- }
8
+ width: number,
9
+ height: number
13
10
  }
14
11
 
15
12
  const {
16
- buildTarget,
17
- webScaling,
18
- ivaDimensions
13
+ width,
14
+ height
19
15
  } = Astro.props;
20
16
 
21
17
  let js: string | undefined;
22
- if (buildTarget === 'veeva' || webScaling) {
18
+ if (BUILD_TARGET === 'veeva' || WEB_SCALING) {
23
19
  const { code } = await esbuild.transform(script, {
24
20
  loader: 'ts',
25
21
  target: 'es2020',
26
22
  minify: true,
27
23
  define: {
28
- IVA_WIDTH: ivaDimensions.width.toString(),
29
- IVA_HEIGHT: ivaDimensions.height.toString()
24
+ IVA_WIDTH: width.toString(),
25
+ IVA_HEIGHT: height.toString()
30
26
  }
31
27
  });
32
28
  js = code;
@@ -4,4 +4,16 @@ export type VeevaEnv = 'client' | 'evoke';
4
4
  export type VeevaPlatform = 'salesforce' | 'vault';
5
5
  export type LogLevel = 'disabled' | 'error' | 'debug';
6
6
  export type LogTime = 'none' | 'date' | 'time' | 'datetime' | 'performance';
7
- export type LogOutput = 'console' | 'screen';
7
+ export type LogOutput = 'console' | 'screen';
8
+
9
+ declare module 'astro:env/client' {
10
+ export const BUILD_TARGET: BuildTarget;
11
+ export const WEB_ENV: WebEnv;
12
+ export const WEB_SCALING: boolean;
13
+ export const VEEVA_TRAINING: boolean;
14
+ export const VEEVA_ENV: VeevaEnv;
15
+ export const VEEVA_PLATFORM: VeevaPlatform;
16
+ export const LOG_LEVEL: LogLevel;
17
+ export const LOG_TIME: LogTime;
18
+ export const LOG_OUTPUT: LogOutput;
19
+ }