@inizioevoke/veeva-astroclm 1.1.0 → 1.1.2
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/.claude/skills/evoke-page-manager/SKILL.md +17 -5
- package/README.md +68 -2
- package/package.json +2 -2
- package/src/data/pages.tsx +2 -2
|
@@ -32,9 +32,9 @@ Check if `veeva-config.ts` exists in the project root. If it does, ask the user:
|
|
|
32
32
|
|
|
33
33
|
## Step 4 — Create files
|
|
34
34
|
|
|
35
|
-
Given the page path (e.g. `
|
|
36
|
-
- `contentName` = last segment of the path (e.g. `
|
|
37
|
-
- `pageName` = full path with `/` replaced by `-` (e.g. `this-one`)
|
|
35
|
+
Given the page path (e.g. `This/One`):
|
|
36
|
+
- `contentName` = last segment of the path, preserving its original case (e.g. `One`)
|
|
37
|
+
- `pageName` = full path lowercased with `/` replaced by `-` (e.g. `this-one`)
|
|
38
38
|
|
|
39
39
|
Check that neither `src/pages/<pageName>.astro` nor `src/contents/<path>/` already exist — if either does, stop and tell the user.
|
|
40
40
|
|
|
@@ -70,6 +70,18 @@ import './<contentName>.scss';
|
|
|
70
70
|
|
|
71
71
|
If the user said yes in Step 3, add a new slide entry to `presentation.slides` following the pattern in `../veeva-config-manager/manage.md` (Step 3 — Resolve missing slides).
|
|
72
72
|
|
|
73
|
-
## Step 6 —
|
|
73
|
+
## Step 6 — Update Pages array in src/data/pages.tsx
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
For each page created, build its URL as `/<pageName>/` (must start and end with `/`). Collect these into a `string[]`.
|
|
76
|
+
|
|
77
|
+
Ask the user: "Would you like me to automatically append these URLs to the `Pages` array in `src/data/pages.tsx`?"
|
|
78
|
+
|
|
79
|
+
- **If yes:** Edit `src/data/pages.tsx` and append an entry to the `Pages` array for each URL, following the existing `Page` interface shape (`{ title: JSX.Element, href: string }`). The title is the `pageName` split on `-` with each segment capitalized and joined by spaces, e.g. for `pageName` `module-1-slide-2`:
|
|
80
|
+
```tsx
|
|
81
|
+
{ title: <>Module 1 Slide 2</>, href: '/module-1-slide-2/' }
|
|
82
|
+
```
|
|
83
|
+
- **If no:** Log the URLs to the console so the user can copy them manually.
|
|
84
|
+
|
|
85
|
+
## Step 7 — Report
|
|
86
|
+
|
|
87
|
+
Tell the user which files were created and whether `src/data/pages.tsx` was updated (or print the URL list if it wasn't).
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ npx --yes @inizioevoke/veeva-astroclm@latest
|
|
|
9
9
|
|
|
10
10
|
Install in target directory
|
|
11
11
|
```
|
|
12
|
-
npx --yes @inizioevoke/veeva-astroclm@latest
|
|
12
|
+
npx --yes @inizioevoke/veeva-astroclm@latest [target]
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Templates
|
|
@@ -23,7 +23,7 @@ When run, the scaffolder prompts you to pick a template:
|
|
|
23
23
|
|
|
24
24
|
Skip the prompt with the `--template` flag:
|
|
25
25
|
```
|
|
26
|
-
npx --yes @inizioevoke/veeva-astroclm@latest
|
|
26
|
+
npx --yes @inizioevoke/veeva-astroclm@latest [target] --template <name>
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
Valid values: `standard`, `left-nav`, `top-nav`, `empty`.
|
|
@@ -130,6 +130,72 @@ Bulk scaffold multiple pages at once by creating `_contents.yml` in the project
|
|
|
130
130
|
|
|
131
131
|
---
|
|
132
132
|
|
|
133
|
+
## Building content
|
|
134
|
+
|
|
135
|
+
Slide content lives in [src/contents/](src/contents/). A slide is an Astro component that wraps a layout and renders markup, scripts, and styles. Pair each slide with these building blocks.
|
|
136
|
+
|
|
137
|
+
### Images — [Image.astro](src/components/ui/Image.astro)
|
|
138
|
+
|
|
139
|
+
A thin wrapper around Astro's `getImage()` that fills in width/height from the source and defaults `loading="eager"` (Veeva slides should not lazy-load). Use for every image imported from `src/shared/img/` or a sibling asset directory.
|
|
140
|
+
|
|
141
|
+
```astro
|
|
142
|
+
---
|
|
143
|
+
import Image from '@components/ui/Image.astro';
|
|
144
|
+
import hero from './hero.png';
|
|
145
|
+
---
|
|
146
|
+
<Image src={hero} width={800} alt="Hero" />
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Props: `src` (required `ImageMetadata`), `width`, `height` (one is enough — the other is derived from aspect ratio), `format`, `quality` (default `80`), `alt`, plus any `<img>` attributes.
|
|
150
|
+
|
|
151
|
+
### Internal links — [Link.astro](src/components/ui/Link.astro)
|
|
152
|
+
|
|
153
|
+
Routes to another slide. In Veeva builds it emits `data-gotoslide` (the Veeva slide zip name) and an `href="#"`; in web builds it emits the real path. External URLs (`http(s)://…`) and `shared/…` paths are passed through unchanged. `aria-current="true"` is set automatically when the link points to the current page.
|
|
154
|
+
|
|
155
|
+
```astro
|
|
156
|
+
---
|
|
157
|
+
import Link from '@components/ui/Link.astro';
|
|
158
|
+
---
|
|
159
|
+
<Link href="about/moa" data-evotrk={{ type: 'button', name: 'learn_more' }}>Learn more</Link>
|
|
160
|
+
<Link href="https://example.com">External</Link>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Props: `href` (a `PageHref` from [src/data/pages.tsx](src/data/pages.tsx), or any string), optional `data-evotrk` (object form — serialized via [@inizioevoke/veeva-astroclm-core](https://www.npmjs.com/package/@inizioevoke/veeva-astroclm-core)), plus any `<a>` attributes.
|
|
164
|
+
|
|
165
|
+
### Nav links — [NavLink.astro](src/components/ui/NavLink.astro)
|
|
166
|
+
|
|
167
|
+
A `Link` variant for navigation menus. Adds `data-current="true"` when the link belongs to the currently active section — useful for highlighting a parent nav item on child routes. Match the current section via `hasCurrent`:
|
|
168
|
+
|
|
169
|
+
```astro
|
|
170
|
+
---
|
|
171
|
+
import NavLink from '@components/ui/NavLink.astro';
|
|
172
|
+
---
|
|
173
|
+
<NavLink href="about/moa" hasCurrent="/about/">About</NavLink>
|
|
174
|
+
<NavLink href="data" hasCurrent={/^\/data\//}>Data</NavLink>
|
|
175
|
+
<NavLink href="resources" hasCurrent={(path, href) => path.startsWith('/resources/')}>Resources</NavLink>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Props: everything `Link` accepts, plus `hasCurrent` (`string` prefix | `RegExp` | `(pathname, href) => boolean`).
|
|
179
|
+
|
|
180
|
+
### Cross-presentation links — [VeevaLink.astro](src/components/ui/VeevaLink.astro)
|
|
181
|
+
|
|
182
|
+
For jumping to a slide in another Veeva presentation. Emits a `data-gotoslide` with the slide name and (optionally) the target presentation ID — this is the only way to leave the current presentation inside Veeva. The `href` is always `#`; this component has no web-build fallback.
|
|
183
|
+
|
|
184
|
+
```astro
|
|
185
|
+
---
|
|
186
|
+
import VeevaLink from '@components/ui/VeevaLink.astro';
|
|
187
|
+
---
|
|
188
|
+
<VeevaLink slide="safety_main" presentation="my_other_presentation">Safety info</VeevaLink>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Props: `slide` (required), `presentation` (optional — defaults to the current one), optional `data-evotrk`, plus any `<a>` attributes.
|
|
192
|
+
|
|
193
|
+
### Page registry — [src/data/pages.tsx](src/data/pages.tsx)
|
|
194
|
+
|
|
195
|
+
`Pages` is a `const` array that defines each slide's `title` (JSX) and `href`. Its type powers the `PageHref` autocomplete used by `Link` / `NavLink`, and the helpers (`getPageElement`, `getPageComponent`, `PageComponents`) let nav components render titles consistently across slides. Add new entries here whenever you add a page that nav or breadcrumbs need to know about.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
133
199
|
## Veeva config
|
|
134
200
|
|
|
135
201
|
[veeva-config.ts](veeva-config.ts) describes the presentation to Veeva: dimensions, iOS resolution, platform (`Salesforce` or `Vault`), disabled actions (`Swipe`, `Zoom`, etc.), binder fields, and the slide list. [tasks/veeva-deploy.ts](tasks/veeva-deploy.ts) and the build pipeline both consume it.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inizioevoke/veeva-astroclm",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"bin": "./bin/create.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "astro dev",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@astrojs/preact": "^6.0.6",
|
|
29
29
|
"@inizioevoke/astro-core": "^3.3.1",
|
|
30
|
-
"@inizioevoke/veeva-astroclm-core": "^1.4.
|
|
30
|
+
"@inizioevoke/veeva-astroclm-core": "^1.4.3",
|
|
31
31
|
"@inizioevoke/veeva-clmjs": "^1.0.1",
|
|
32
32
|
"@inizioevoke/veeva-iva": "^1.3.2",
|
|
33
33
|
"astro": "^7.3.8",
|
package/src/data/pages.tsx
CHANGED
|
@@ -32,8 +32,8 @@ export function toPageComponent(page: PageElement): PageComponent {
|
|
|
32
32
|
|
|
33
33
|
export const PageElements: PageElement[] = Pages.map((p) => {
|
|
34
34
|
return {
|
|
35
|
-
...p,
|
|
36
|
-
href: p.href as PageHref
|
|
35
|
+
...(p as Page),
|
|
36
|
+
href: (p as Page).href as PageHref
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
|