@inizioevoke/veeva-astroclm 1.1.6 → 1.1.8

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/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 24
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/bin/create.js CHANGED
@@ -62,7 +62,7 @@ if (existsSync(targetDir) && readdirSync(targetDir).length > 0) {
62
62
  }
63
63
  mkdirSync(targetDir, { recursive: true })
64
64
 
65
- const skipTopLevel = new Set(['bin', 'node_modules', '.git', 'package-lock.json'])
65
+ const skipTopLevel = new Set(['bin', 'node_modules', '.git', '.gitignore', 'package-lock.json'])
66
66
  const includedLayouts = new Set(TEMPLATES[template].layouts)
67
67
 
68
68
  cpSync(templateRoot, targetDir, {
@@ -83,6 +83,17 @@ for (const dir of ['src/contents', 'src/layouts', 'src/pages']) {
83
83
  mkdirSync(join(targetDir, dir), { recursive: true })
84
84
  }
85
85
 
86
+ // npm never publishes .gitignore, and the template's own ignores (src/pages,
87
+ // src/contents) don't apply to scaffolded projects, so write a dedicated one.
88
+ const gitignore = `.astro/
89
+ deploy/
90
+ dist/
91
+ node_modules/
92
+ .DS_Store
93
+ Thumbs.db
94
+ `
95
+ writeFileSync(join(targetDir, '.gitignore'), gitignore)
96
+
86
97
  const pkgPath = join(targetDir, 'package.json')
87
98
  const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'))
88
99
  pkg.name = basename(targetDir)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@inizioevoke/veeva-astroclm",
3
3
  "type": "module",
4
- "version": "1.1.6",
4
+ "version": "1.1.8",
5
5
  "bin": "./bin/create.js",
6
6
  "scripts": {
7
7
  "start": "astro dev",
@@ -25,18 +25,18 @@
25
25
  "page-manager": "npx tsx ./tasks/page-manager.ts"
26
26
  },
27
27
  "dependencies": {
28
- "@astrojs/preact": "^6.1.1",
28
+ "@astrojs/preact": "^6.1.2",
29
29
  "@inizioevoke/astro-core": "^3.3.3",
30
- "@inizioevoke/veeva-astroclm-core": "^1.4.8",
30
+ "@inizioevoke/veeva-astroclm-core": "^1.4.9",
31
31
  "@inizioevoke/veeva-clmjs": "^1.0.1",
32
32
  "@inizioevoke/veeva-iva": "^1.4.1",
33
- "astro": "^7.4.2",
34
- "preact": "^11.1.0",
35
- "sass": "^1.106.1"
33
+ "astro": "^7.4.7",
34
+ "preact": "^11.2.0",
35
+ "sass": "^1.108.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@astrojs/check": "^0.9.12",
39
- "@types/node": "^26.6.5",
39
+ "@types/node": "^26.6.6",
40
40
  "tsx": "^4.23.15"
41
41
  },
42
42
  "allowScripts": {
@@ -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
+ })()}
@@ -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>
@@ -1,12 +0,0 @@
1
- import { defineMiddleware } from "astro:middleware";
2
-
3
- export const onRequest = defineMiddleware((context, next) => {
4
- const url = new URL(context.request.url);
5
-
6
- // Map ./dir to /dir
7
- if (url.pathname.startsWith('./dir')) {
8
- return context.rewrite(url.pathname.replace('./dir', '/dir'));
9
- }
10
-
11
- return next();
12
- });