@inizioevoke/veeva-astroclm 1.1.7 → 1.1.9

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/.env.development CHANGED
@@ -1,3 +1,4 @@
1
1
  # WEB_ENV="production"
2
2
  # WEB_SCALING="true" # When this is true the resize script will be included if the <ResizeScript /> component is in the layout
3
+ VEEVA_CONTROLS="true"
3
4
  LOG_LEVEL="debug"
package/astro.config.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { defineConfig } from 'astro/config';
1
+ import { defineConfig, envField } from 'astro/config';
2
2
  import preact from '@astrojs/preact';
3
3
  import { schema } from '@inizioevoke/veeva-astroclm-core/env';
4
4
  import { pruneBuild } from '@inizioevoke/astro-core/integrations';
@@ -26,7 +26,8 @@ export default defineConfig({
26
26
  BUILD_TARGET,
27
27
  LOG_LEVEL, LOG_OUTPUT, LOG_TIME,
28
28
  VEEVA_ENV, VEEVA_PLATFORM, VEEVA_TRAINING,
29
- WEB_ENV, WEB_SCALING
29
+ WEB_ENV, WEB_SCALING,
30
+ VEEVA_CONTROLS: envField.boolean({ context: 'client', access: 'public', optional: true, default: false })
30
31
  }
31
32
  },
32
33
  integrations: [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@inizioevoke/veeva-astroclm",
3
3
  "type": "module",
4
- "version": "1.1.7",
4
+ "version": "1.1.9",
5
5
  "bin": "./bin/create.js",
6
6
  "scripts": {
7
7
  "start": "astro dev",
@@ -1,4 +1,5 @@
1
1
  ---
2
+ import { BUILD_TARGET, VEEVA_CONTROLS } from 'astro:env/client';
2
3
  import Image from '@components/ui/Image.astro';
3
4
  import imgAction from '@shared/img/veeva/veeva-action.png';
4
5
  import imgHighlighter from '@shared/img/veeva/veeva-highlighter.png';
@@ -28,21 +29,27 @@ const history = shouldInclude(Astro.props.history);
28
29
  const reactions = shouldInclude(Astro.props.reactions);
29
30
  const navigation = shouldInclude(Astro.props.navigation);
30
31
  ---
31
- <div id="veeva-action" class="veeva-control"><Image src={imgAction} /></div>
32
- { highlighter &&
33
- <div id="veeva-highlighter" class="veeva-control"><Image src={imgHighlighter} /></div>
34
- }
35
- { history &&
36
- <div id="veeva-history-back" class:list={['veeva-control', highlighter ? 'veeva-has-highlighter' : '']}><Image src={imgHistoryBack} /></div>
37
- <div id="veeva-history-forward" class:list={['veeva-control', highlighter ? 'veeva-has-highlighter' : '']}><Image src={imgHistoryForward} /></div>
38
- }
39
- { reactions &&
40
- <div id="veeva-reactions" class="veeva-control"><Image src={imgReactions} /></div>
41
- }
42
- { navigation &&
43
- <div id="veeva-navigation" class="veeva-control"><Image src={imgNavigation} /></div>
44
- }
45
- <div id="veeva-desktop-action" class="veeva-desktop-control"><Image src={imgDesktopAction} /></div>
46
- <div id="veeva-desktop-previous" class="veeva-desktop-control"><Image src={imgDesktopPrevious} /></div>
47
- <div id="veeva-desktop-next" class="veeva-desktop-control"><Image src={imgDesktopNext} /></div>
48
- <div id="veeva-desktop-navigation" class="veeva-desktop-control"><Image src={imgDesktopNavigation} /></div>
32
+ {(() => {
33
+ if (BUILD_TARGET === 'web' && VEEVA_CONTROLS) {
34
+ return (<>
35
+ <div id="veeva-action" class="veeva-control"><Image src={imgAction} /></div>
36
+ { highlighter &&
37
+ <div id="veeva-highlighter" class="veeva-control"><Image src={imgHighlighter} /></div>
38
+ }
39
+ { history &&
40
+ <div id="veeva-history-back" class:list={['veeva-control', highlighter ? 'veeva-has-highlighter' : '']}><Image src={imgHistoryBack} /></div>
41
+ <div id="veeva-history-forward" class:list={['veeva-control', highlighter ? 'veeva-has-highlighter' : '']}><Image src={imgHistoryForward} /></div>
42
+ }
43
+ { reactions &&
44
+ <div id="veeva-reactions" class="veeva-control"><Image src={imgReactions} /></div>
45
+ }
46
+ { navigation &&
47
+ <div id="veeva-navigation" class="veeva-control"><Image src={imgNavigation} /></div>
48
+ }
49
+ <div id="veeva-desktop-action" class="veeva-desktop-control"><Image src={imgDesktopAction} /></div>
50
+ <div id="veeva-desktop-previous" class="veeva-desktop-control"><Image src={imgDesktopPrevious} /></div>
51
+ <div id="veeva-desktop-next" class="veeva-desktop-control"><Image src={imgDesktopNext} /></div>
52
+ <div id="veeva-desktop-navigation" class="veeva-desktop-control"><Image src={imgDesktopNavigation} /></div>
53
+ </>);
54
+ }
55
+ })()}
@@ -1,14 +1,17 @@
1
1
  ---
2
+ import { BUILD_TARGET } from 'astro:env/client';
2
3
  import type { HTMLAttributes } from "astro/types";
3
4
  import { dataEvotrkToString } from "@inizioevoke/veeva-astroclm-core/lib";
4
5
 
5
6
  interface Props extends HTMLAttributes<'a'> {
7
+ href?: string;
6
8
  slide: string;
7
9
  presentation?: string;
8
10
  'data-evotrk'?: DataEvotrk;
9
11
  }
10
12
 
11
13
  const {
14
+ href,
12
15
  slide,
13
16
  presentation,
14
17
  'data-evotrk': dataEvotrk,
@@ -23,8 +26,12 @@ type VeevaLinkAttrs = HTMLAttributes<'a'> & {
23
26
  const attrs: VeevaLinkAttrs = {
24
27
  ...rest
25
28
  };
26
- attrs.href = '#';
27
29
 
30
+ if (BUILD_TARGET === 'web' && href) {
31
+ attrs.href = href;
32
+ } else {
33
+ attrs.href = '#';
34
+ }
28
35
 
29
36
  attrs['data-gotoslide'] = `${slide}${presentation ? `,${presentation}` : ''}`;
30
37
 
@@ -49,10 +49,10 @@ const pathname = Astro.url.pathname;
49
49
  <ResizeScript width={SCREEN_WIDTH} height={SCREEN_HEIGHT} />
50
50
  <slot />
51
51
  <ModalOverlay />
52
+ <VeevaControls reactions={false} />
52
53
  </div>
53
54
  </div>
54
55
 
55
- { BUILD_TARGET === 'web' && WEB_ENV !== "production" && <VeevaControls reactions={false} /> }
56
56
  <IvaConsole />
57
57
 
58
58
  <script>