@inizioevoke/veeva-astroclm 1.0.0
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/settings.local.json +10 -0
- package/.claude/skills/evoke-analytics-auditor/SKILL.md +509 -0
- package/.claude/skills/evoke-astro-core/SKILL.md +395 -0
- package/.claude/skills/evoke-page-manager/SKILL.md +75 -0
- package/.claude/skills/evoke-veeva-config-manager/SKILL.md +17 -0
- package/.claude/skills/evoke-veeva-config-manager/create.md +189 -0
- package/.claude/skills/evoke-veeva-config-manager/manage.md +48 -0
- package/.editorconfig +12 -0
- package/.env.development +3 -0
- package/.env.veeva-client +1 -0
- package/.env.veeva-client-training +2 -0
- package/.env.veeva-evoke +4 -0
- package/README.md +43 -0
- package/_contents.yml.example +6 -0
- package/astro.config.ts +36 -0
- package/package.json +40 -0
- package/public/astroclm.png +0 -0
- package/public/favicon.png +0 -0
- package/public/shared/salesforce.js +2586 -0
- package/public/shared/vault.js +2417 -0
- package/src/components/content/readme.md +1 -0
- package/src/components/isi/ISIContent.tsx +137 -0
- package/src/components/isi/_isi.scss +22 -0
- package/src/components/nav/MainNav/MainNav.astro +20 -0
- package/src/components/nav/MainNav/MainNav.tsx +36 -0
- package/src/components/nav/NavList.tsx +66 -0
- package/src/components/ui/Button.astro +19 -0
- package/src/components/ui/Image.astro +36 -0
- package/src/components/ui/IvaConsole/IvaConsole.astro +12 -0
- package/src/components/ui/IvaConsole/IvaConsole.scss +62 -0
- package/src/components/ui/IvaConsole/IvaConsole.ts +144 -0
- package/src/components/ui/Link.astro +39 -0
- package/src/components/ui/Link.tsx +36 -0
- package/src/components/ui/NavLink.astro +46 -0
- package/src/components/ui/NavLink.tsx +41 -0
- package/src/components/ui/VeevaControls/VeevaControls.astro +48 -0
- package/src/components/ui/VeevaControls/VeevaControls.scss +145 -0
- package/src/components/ui/VeevaLink.astro +36 -0
- package/src/data/pages.tsx +50 -0
- package/src/env.d.ts +14 -0
- package/src/lib/client/context.ts +45 -0
- package/src/lib/client/main.ts +54 -0
- package/src/lib/client/readme.md +1 -0
- package/src/lib/client/swipe-nav.ts +35 -0
- package/src/lib/client/utils.ts +58 -0
- package/src/lib/server/readme.md +1 -0
- package/src/lib/server/screen.ts +10 -0
- package/src/middleware.ts.bak +12 -0
- package/src/scss/_mixins.scss +1 -0
- package/src/scss/_variables.scss +6 -0
- package/src/scss/ipads.scss +89 -0
- package/src/shared/img/veeva/veeva-action.png +0 -0
- package/src/shared/img/veeva/veeva-desktop-action.png +0 -0
- package/src/shared/img/veeva/veeva-desktop-navigation.png +0 -0
- package/src/shared/img/veeva/veeva-desktop-next.png +0 -0
- package/src/shared/img/veeva/veeva-desktop-previous.png +0 -0
- package/src/shared/img/veeva/veeva-highlighter.png +0 -0
- package/src/shared/img/veeva/veeva-history-back.png +0 -0
- package/src/shared/img/veeva/veeva-history-forward.png +0 -0
- package/src/shared/img/veeva/veeva-navigation.png +0 -0
- package/src/shared/img/veeva/veeva-reactions.png +0 -0
- package/tasks/page-manager.ts +4 -0
- package/tasks/util.ts +7 -0
- package/tasks/veeva-config.ts +4 -0
- package/tasks/veeva-deploy.ts +21 -0
- package/tsconfig.json +23 -0
- package/veeva-metadata.js +461 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: evoke-astro-core
|
|
3
|
+
description: >
|
|
4
|
+
Reference and implementation guide for @inizioevoke/astro-core — a library of reusable Astro components,
|
|
5
|
+
build integrations, and client-side gesture scripts. Use this skill whenever the user asks how to use,
|
|
6
|
+
add, configure, or troubleshoot anything from this library. Triggers on: component names (Carousel,
|
|
7
|
+
CssBackgroundImage, CssVariables, FlipCard, RightISI, Modal, ModalTrigger, PdfViewer, ScrollContainer,
|
|
8
|
+
Tabs, TabItem, Zoom), integration names (pruneBuild, relativeLinks), script names (createSwipeListener,
|
|
9
|
+
createPinchListener), the package name @inizioevoke/astro-core, or any request to add/use one of these
|
|
10
|
+
items in an Astro or TypeScript file. Do NOT wait for the user to explicitly name the package — if they're
|
|
11
|
+
working on an Astro project and ask about a carousel, image slider, flip card, ISI panel, modal, PDF
|
|
12
|
+
viewer, scroll container, tabs, or swipe/pinch gesture, consult this skill.
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# @inizioevoke/astro-core
|
|
16
|
+
|
|
17
|
+
A library of reusable Astro components, build integrations, and client-side scripts for Evoke projects.
|
|
18
|
+
|
|
19
|
+
**Install:** `npm install @inizioevoke/astro-core`
|
|
20
|
+
|
|
21
|
+
## Behavior guide
|
|
22
|
+
|
|
23
|
+
- For a general "how do I use X" question — answer from the quick-reference below (import path, key props, basic example).
|
|
24
|
+
- If the user asks about specific props, all available slots, CSS variables, or the full JS API — read the relevant doc file (paths listed in each section) and answer from it.
|
|
25
|
+
- When adding to a file — use the correct import path, include required props, and add relevant slots.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Export paths
|
|
30
|
+
|
|
31
|
+
| What | Import from |
|
|
32
|
+
|---|---|
|
|
33
|
+
| All Astro components | `@inizioevoke/astro-core` |
|
|
34
|
+
| Build integrations | `@inizioevoke/astro-core/integrations` |
|
|
35
|
+
| FlipCard JS lib | `@inizioevoke/astro-core/lib/FlipCard` |
|
|
36
|
+
| ISI JS lib | `@inizioevoke/astro-core/lib/ISI` |
|
|
37
|
+
| Modal JS lib | `@inizioevoke/astro-core/lib/Modal` |
|
|
38
|
+
| PdfViewer JS lib | `@inizioevoke/astro-core/lib/PdfViewer` |
|
|
39
|
+
| ScrollContainer JS lib | `@inizioevoke/astro-core/lib/ScrollContainer` |
|
|
40
|
+
| Gesture scripts | `@inizioevoke/astro-core/lib/gestures` |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Components
|
|
45
|
+
|
|
46
|
+
### Carousel
|
|
47
|
+
|
|
48
|
+
A scrollable slide carousel rendered as the `<evo-carousel>` custom element. Features prev/next navigation buttons, pagination dots, touch/swipe support, and smooth animated scrolling. Slides must be wrapped in a `<ul><li>` structure inside the default slot.
|
|
49
|
+
|
|
50
|
+
```astro
|
|
51
|
+
---
|
|
52
|
+
import { Carousel } from '@inizioevoke/astro-core';
|
|
53
|
+
---
|
|
54
|
+
<Carousel slidesPerPage={1} gap={8}>
|
|
55
|
+
<ul>
|
|
56
|
+
<li>Slide 1</li>
|
|
57
|
+
<li>Slide 2</li>
|
|
58
|
+
<li>Slide 3</li>
|
|
59
|
+
</ul>
|
|
60
|
+
</Carousel>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Slots: default (`<ul><li>` slides required), `previous`, `next` (custom nav button content)
|
|
64
|
+
Props: `navigation?` (default true), `pagination?` (default true, or `{ disabled: true }` for non-clickable dots, or `false` to hide), `slidesPerPage?` (default 1), `gap?` (px, default 8), plus any `div` HTML attributes
|
|
65
|
+
|
|
66
|
+
**Client-side JS** (in a `<script>` block):
|
|
67
|
+
```ts
|
|
68
|
+
const carousel = document.querySelector('evo-carousel');
|
|
69
|
+
carousel.addEventListener('pagechange', (e) => console.log(e.detail.page));
|
|
70
|
+
await carousel.showPage(2); // or nextPage() / previousPage()
|
|
71
|
+
carousel.currentPage = 0; // get or set
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Custom events: `beforepagechange`, `pagechange` (both with `detail: { page: number }`)
|
|
75
|
+
|
|
76
|
+
> For full CSS variable list and JS API details → read `docs/components/Carousel.md`
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
### CssBackgroundImage
|
|
81
|
+
|
|
82
|
+
Renders a `<style>` tag that sets `background-image` on a CSS selector. Optimizes images via Astro's `getImage` (webp, quality 80 by default). Supports responsive breakpoints via media queries. No client JS.
|
|
83
|
+
|
|
84
|
+
```astro
|
|
85
|
+
---
|
|
86
|
+
import { CssBackgroundImage } from '@inizioevoke/astro-core';
|
|
87
|
+
import heroImg from '../assets/hero.jpg';
|
|
88
|
+
---
|
|
89
|
+
<CssBackgroundImage image={heroImg} selector=".hero" size="cover" position="center" />
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Key props: `image` (ImageMetadata, required), `selector` (default `body`), `size`, `position`, `repeat`, `optimize`, `format`, `quality`, `width`, `height`, `breakpoints[]`
|
|
93
|
+
|
|
94
|
+
> For full prop details and breakpoint examples → read `docs/components/CssBackgroundImage.md`
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### CssVariables
|
|
99
|
+
|
|
100
|
+
Injects CSS custom properties (`--name: value`) into a selector. Supports `image` (optimized), `url`, or plain string/number values. Supports responsive breakpoints.
|
|
101
|
+
|
|
102
|
+
```astro
|
|
103
|
+
---
|
|
104
|
+
import { CssVariables } from '@inizioevoke/astro-core';
|
|
105
|
+
import bg from '../assets/bg.jpg';
|
|
106
|
+
---
|
|
107
|
+
<CssVariables
|
|
108
|
+
selector=":root"
|
|
109
|
+
variables={[
|
|
110
|
+
{ name: '--brand-color', value: '#ff0000' },
|
|
111
|
+
{ name: '--hero-bg', type: 'image', value: bg },
|
|
112
|
+
]}
|
|
113
|
+
/>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Key props: `selector` (default `:root`), `variables[]` (each with `name`, `value`, optional `type`, optional `breakpoints`)
|
|
117
|
+
|
|
118
|
+
> For full variable type options and breakpoint examples → read `docs/components/CssVariables.md`
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
### FlipCard
|
|
123
|
+
|
|
124
|
+
A 3D CSS flip card rendered as the `<evo-flip-card>` custom element. Uses `front` and `back` slots.
|
|
125
|
+
|
|
126
|
+
```astro
|
|
127
|
+
---
|
|
128
|
+
import { FlipCard } from '@inizioevoke/astro-core';
|
|
129
|
+
---
|
|
130
|
+
<FlipCard width={300} height={200}>
|
|
131
|
+
<div slot="front">Front content</div>
|
|
132
|
+
<div slot="back">Back content</div>
|
|
133
|
+
<button slot="trigger">Flip</button>
|
|
134
|
+
</FlipCard>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Slots: `front`, `back`, `trigger`, `front-trigger`, `back-trigger`
|
|
138
|
+
Props: `width?`, `height?`, plus any `div` HTML attributes
|
|
139
|
+
|
|
140
|
+
**Client-side JS** (in a `<script>` block):
|
|
141
|
+
```ts
|
|
142
|
+
import type { EvoFlipCardElement } from '@inizioevoke/astro-core/lib/FlipCard';
|
|
143
|
+
const card = document.querySelector('evo-flip-card') as EvoFlipCardElement;
|
|
144
|
+
card.toggle(); // or flipFront() / flipBack()
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
> For full CSS variable list and JS API details → read `docs/components/FlipCard.md`
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
### RightISI
|
|
152
|
+
|
|
153
|
+
A sticky ISI (Important Safety Information) right-side drawer rendered as `<evo-isi>`. Embeds a `ScrollContainer` internally.
|
|
154
|
+
|
|
155
|
+
```astro
|
|
156
|
+
---
|
|
157
|
+
import { RightISI } from '@inizioevoke/astro-core';
|
|
158
|
+
---
|
|
159
|
+
<RightISI transitionDuration={400} headerButton>
|
|
160
|
+
<div slot="header">ISI Title</div>
|
|
161
|
+
<p>Important safety information content goes here.</p>
|
|
162
|
+
</RightISI>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Slots: `header`, `header-button`, `footer`, default (body content)
|
|
166
|
+
Props: `transitionDuration?` (ms, default 500), `headerButton?` (boolean), `scrollContainer?` (ScrollContainerProps)
|
|
167
|
+
|
|
168
|
+
**Client-side JS**:
|
|
169
|
+
```ts
|
|
170
|
+
import type { EvoIsiElement } from '@inizioevoke/astro-core/lib/ISI';
|
|
171
|
+
const isi = document.querySelector('evo-isi') as EvoIsiElement;
|
|
172
|
+
await isi.expand(); // toggle() / collapse() also available — all return Promise<void>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
> For full slot and prop details → read `docs/components/ISI/RightISI.md` (if available) or check the source
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
### Modal
|
|
180
|
+
|
|
181
|
+
A modal system with `<evo-modal>`, `ModalTrigger`, and `ModalOverlay` components. Supports `fade` and `none` animations.
|
|
182
|
+
|
|
183
|
+
```astro
|
|
184
|
+
---
|
|
185
|
+
import { Modal, ModalTrigger } from '@inizioevoke/astro-core';
|
|
186
|
+
---
|
|
187
|
+
<ModalTrigger modal="my-modal" animation="fade">Open</ModalTrigger>
|
|
188
|
+
|
|
189
|
+
<Modal id="my-modal" closeButton="default">
|
|
190
|
+
<h2>Modal Title</h2>
|
|
191
|
+
<p>Modal content here.</p>
|
|
192
|
+
</Modal>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Modal props:** `id` (required), `closeButton` (`'default'|'minimal'|'none'|false`), `closeButtonAtts`
|
|
196
|
+
**ModalTrigger props:** `modal` (id, required), `animation?`
|
|
197
|
+
Slots: default (inside wrapper), `close` (close button label), `outer` (full-bleed outside wrapper)
|
|
198
|
+
|
|
199
|
+
**Client-side JS**:
|
|
200
|
+
```ts
|
|
201
|
+
import { showModal, hideModal, hideModals } from '@inizioevoke/astro-core/lib/Modal';
|
|
202
|
+
showModal('#my-modal');
|
|
203
|
+
hideModal('#my-modal', 'fade');
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Custom events: `evomodal-visible`, `evomodal-hidden` (both bubble + composed)
|
|
207
|
+
|
|
208
|
+
> For full CSS variable list, all JS functions, and data attributes → read `docs/components/Modal.md`
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
### PdfViewer
|
|
213
|
+
|
|
214
|
+
A full-featured PDF viewer rendered as `<evo-pdf-viewer>`. Uses a bundled copy of pdf.js. Features lazy page rendering, pinch-to-zoom, toolbar, and vertical/horizontal layout.
|
|
215
|
+
|
|
216
|
+
```astro
|
|
217
|
+
---
|
|
218
|
+
import { PdfViewer } from '@inizioevoke/astro-core';
|
|
219
|
+
---
|
|
220
|
+
<PdfViewer id="viewer" pdf="/documents/file.pdf" height="600px" theme="light" />
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Props: `id` (required), `pdf` (URL, required), `height?`, `theme?` (`'light'|'dark'|'black'`), `zoom?`, `page?`, `layout?` (`'vertical'|'horizontal'`), `fit?`, `quality?`, `toolbar?`
|
|
224
|
+
|
|
225
|
+
**Client-side JS**:
|
|
226
|
+
```ts
|
|
227
|
+
import type { EvoPdfViewerElement } from '@inizioevoke/astro-core/lib/PdfViewer';
|
|
228
|
+
const viewer = document.querySelector('evo-pdf-viewer') as EvoPdfViewerElement;
|
|
229
|
+
viewer.scrollToPage(3);
|
|
230
|
+
viewer.zoom(1); // 1 = zoom in, -1 = zoom out, 0 = reset
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Custom event: `evopdfviewer-click` (fires when a custom `http://pdfviewer.evo` protocol link is clicked)
|
|
234
|
+
|
|
235
|
+
> For full prop details, fit modes, and toolbar options → read `docs/components/PdfViewer.md` (if available) or source
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
### ScrollContainer
|
|
240
|
+
|
|
241
|
+
Wraps content in `<evo-scroll-container>` with a custom draggable scrollbar. Supports `vertical`, `horizontal`, or `both` axes.
|
|
242
|
+
|
|
243
|
+
```astro
|
|
244
|
+
---
|
|
245
|
+
import { ScrollContainer } from '@inizioevoke/astro-core';
|
|
246
|
+
---
|
|
247
|
+
<ScrollContainer height="400px" scrolling="vertical">
|
|
248
|
+
<p>Long scrollable content here...</p>
|
|
249
|
+
</ScrollContainer>
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
Props: `width?`, `height?`, `scrolling?` (default `'vertical'`), plus any `div` attributes
|
|
253
|
+
|
|
254
|
+
**Client-side JS**:
|
|
255
|
+
```ts
|
|
256
|
+
import { scroll, refresh, getScroll } from '@inizioevoke/astro-core/lib/ScrollContainer';
|
|
257
|
+
scroll('evo-scroll-container', { top: 0 });
|
|
258
|
+
refresh(); // recalculate all scroll containers
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
> For full CSS variable list, element API, and all utility functions → read `docs/components/ScrollContainer.md`
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
### Tabs + TabItem
|
|
266
|
+
|
|
267
|
+
Build-time tabbed panels. `Tabs` processes its slot at build time, extracting metadata from `TabItem` children to generate the tab list and panels.
|
|
268
|
+
|
|
269
|
+
```astro
|
|
270
|
+
---
|
|
271
|
+
import { Tabs, TabItem } from '@inizioevoke/astro-core';
|
|
272
|
+
---
|
|
273
|
+
<Tabs>
|
|
274
|
+
<TabItem active>
|
|
275
|
+
<span slot="title">Tab One</span>
|
|
276
|
+
<p>Content for tab one.</p>
|
|
277
|
+
</TabItem>
|
|
278
|
+
<TabItem>
|
|
279
|
+
<span slot="title">Tab Two</span>
|
|
280
|
+
<p>Content for tab two.</p>
|
|
281
|
+
</TabItem>
|
|
282
|
+
</Tabs>
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
**Tabs props:** `listType?` (`'ul'|'none'`)
|
|
286
|
+
**TabItem props:** `active?`, `tabAttrs?`, `panelAttrs?`
|
|
287
|
+
**TabItem slots:** `title`, default (panel content)
|
|
288
|
+
|
|
289
|
+
> For full styling details → read `docs/components/Tabs.md`
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
### Zoom
|
|
294
|
+
|
|
295
|
+
A convenience wrapper combining a content card with a `ModalTrigger` button and a `Modal`. Auto-generates the modal ID.
|
|
296
|
+
|
|
297
|
+
```astro
|
|
298
|
+
---
|
|
299
|
+
import { Zoom } from '@inizioevoke/astro-core';
|
|
300
|
+
---
|
|
301
|
+
<Zoom animation="fade" modalIncludeTitle modalIncludeFooter>
|
|
302
|
+
<div slot="content">Card preview content</div>
|
|
303
|
+
<span slot="trigger">View full</span>
|
|
304
|
+
<div slot="modal-content">Full modal content here</div>
|
|
305
|
+
</Zoom>
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
Slots: `content`, `trigger`, `header`, `footer`, `modal-header`, `modal-content`, `modal-footer`
|
|
309
|
+
Props: `animation?`, `modalIncludeTitle?` (default true), `modalIncludeFooter?` (default true), `modalSlot?`
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Integrations
|
|
314
|
+
|
|
315
|
+
### pruneBuild
|
|
316
|
+
|
|
317
|
+
Deletes unreferenced asset files after build by scanning HTML/CSS/JS output for filename references.
|
|
318
|
+
|
|
319
|
+
```ts
|
|
320
|
+
// astro.config.mjs
|
|
321
|
+
import { pruneBuild } from '@inizioevoke/astro-core/integrations';
|
|
322
|
+
|
|
323
|
+
export default defineConfig({
|
|
324
|
+
integrations: [
|
|
325
|
+
pruneBuild({ keep: ['favicon.ico', /fonts\//] })
|
|
326
|
+
]
|
|
327
|
+
});
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
Options: `enabled?` (boolean), `keep?` (array of strings or RegExp)
|
|
331
|
+
|
|
332
|
+
> For behavior details and edge cases → read `docs/integrations/prune-build.md`
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
### relativeLinks
|
|
337
|
+
|
|
338
|
+
Rewrites absolute asset paths in `.html` and `.css` build output to relative paths (relative to each file's location). Useful for static deployments without a fixed root.
|
|
339
|
+
|
|
340
|
+
```ts
|
|
341
|
+
// astro.config.mjs
|
|
342
|
+
import { relativeLinks } from '@inizioevoke/astro-core/integrations';
|
|
343
|
+
|
|
344
|
+
export default defineConfig({
|
|
345
|
+
integrations: [relativeLinks()]
|
|
346
|
+
});
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
Options: `enabled?` (default true)
|
|
350
|
+
|
|
351
|
+
> For details on which attributes/properties are rewritten → read `docs/integrations/relative-links.md`
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## Client-side gesture scripts
|
|
356
|
+
|
|
357
|
+
Use inside Astro `<script>` blocks or in `.ts` client files.
|
|
358
|
+
|
|
359
|
+
### createSwipeListener
|
|
360
|
+
|
|
361
|
+
```ts
|
|
362
|
+
import { createSwipeListener } from '@inizioevoke/astro-core/lib/gestures';
|
|
363
|
+
|
|
364
|
+
const swipe = createSwipeListener(({ direction, distance, duration }) => {
|
|
365
|
+
if (direction === 'left') nextSlide();
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
// threshold can be '1/4', '1/3', '1/2' (fraction of screen) or a pixel number
|
|
369
|
+
const swipe = createSwipeListener(handler, { threshold: '1/3' });
|
|
370
|
+
|
|
371
|
+
swipe.disable();
|
|
372
|
+
swipe.enable();
|
|
373
|
+
swipe.dispose(); // remove listeners entirely
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
> For all threshold options and handler argument details → read `docs/lib/swipe.md`
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
380
|
+
### createPinchListener
|
|
381
|
+
|
|
382
|
+
```ts
|
|
383
|
+
import { createPinchListener } from '@inizioevoke/astro-core/lib/gestures';
|
|
384
|
+
|
|
385
|
+
const pinch = createPinchListener((scale, gesture) => {
|
|
386
|
+
// gesture is 'pinch' or 'spread'
|
|
387
|
+
element.style.transform = `scale(${scale})`;
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
pinch.disable();
|
|
391
|
+
pinch.enable();
|
|
392
|
+
pinch.dispose();
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
> For cumulative scale behavior details → read `docs/lib/pinch.md`
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: evoke-page-manager
|
|
3
|
+
description: >
|
|
4
|
+
Scaffolds a new page in this Veeva Astro CLM project. Use this skill whenever the user asks to
|
|
5
|
+
create a new page, add a page, scaffold a slide, generate a new route, or set up a new CLM slide —
|
|
6
|
+
even if they don't say "page manager" explicitly. If the user is working in this project and wants
|
|
7
|
+
a new page, this skill should always trigger.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Page Manager
|
|
11
|
+
|
|
12
|
+
## Step 1 — Ask for the page path
|
|
13
|
+
|
|
14
|
+
Ask: "What should the page path be? (relative to `src/contents/`, e.g. `home` or `module-1/slide-2`)"
|
|
15
|
+
|
|
16
|
+
## Step 2 — Ask for the layout
|
|
17
|
+
|
|
18
|
+
Read `src/layouts/` to discover available layouts (each subdirectory containing a `.astro` file is a layout). Present them as a numbered list, for example:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
Which layout would you like to use?
|
|
22
|
+
1. GlobalLayout
|
|
23
|
+
2. LeftNavLayout
|
|
24
|
+
3. TopNavLayout
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The user can respond with just a number. Resolve it to the layout name (e.g. `TopNavLayout`) before proceeding.
|
|
28
|
+
|
|
29
|
+
## Step 3 — Check for veeva-config.ts
|
|
30
|
+
|
|
31
|
+
Check if `veeva-config.ts` exists in the project root. If it does, ask the user: "Would you like to add a slide entry for this page in `veeva-config.ts`?"
|
|
32
|
+
|
|
33
|
+
## Step 4 — Create files
|
|
34
|
+
|
|
35
|
+
Given the page path (e.g. `this/one`):
|
|
36
|
+
- `contentName` = last segment of the path (e.g. `one`)
|
|
37
|
+
- `pageName` = full path with `/` replaced by `-` (e.g. `this-one`)
|
|
38
|
+
|
|
39
|
+
Check that neither `src/pages/<pageName>.astro` nor `src/contents/<path>/` already exist — if either does, stop and tell the user.
|
|
40
|
+
|
|
41
|
+
**Write `src/pages/<pageName>.astro`:**
|
|
42
|
+
```astro
|
|
43
|
+
---
|
|
44
|
+
import Page from '@/contents/<path>/<contentName>.astro';
|
|
45
|
+
---
|
|
46
|
+
<Page />
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Create `src/contents/<path>/` and write `<contentName>.astro`:**
|
|
50
|
+
```astro
|
|
51
|
+
---
|
|
52
|
+
import <layoutName> from '@/layouts/<layoutName>/<layoutName>.astro';
|
|
53
|
+
|
|
54
|
+
import './<contentName>.scss';
|
|
55
|
+
---
|
|
56
|
+
<<layoutName>>
|
|
57
|
+
<!-- Insert page content here -->
|
|
58
|
+
|
|
59
|
+
<script>
|
|
60
|
+
import './<contentName>';
|
|
61
|
+
</script>
|
|
62
|
+
</<layoutName>>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Write `src/contents/<path>/<contentName>.scss`:** empty file
|
|
66
|
+
|
|
67
|
+
**Write `src/contents/<path>/<contentName>.ts`:** empty file
|
|
68
|
+
|
|
69
|
+
## Step 5 — Add slide to veeva-config.ts
|
|
70
|
+
|
|
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
|
+
|
|
73
|
+
## Step 6 — Report
|
|
74
|
+
|
|
75
|
+
Tell the user which files were created.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: evoke-veeva-config-manager
|
|
3
|
+
description: >
|
|
4
|
+
Manages Veeva CLM configuration for this project. Use this skill whenever the user asks to
|
|
5
|
+
create, generate, or set up a Veeva config, initialize a veeva-config.ts, scaffold a new
|
|
6
|
+
presentation, or run the veeva-config-manager. Also trigger when the user says things like
|
|
7
|
+
"set up the config", "create the config file", "initialize the presentation config",
|
|
8
|
+
"sync the config", "check the config", or "update the slides in the config".
|
|
9
|
+
allowed-tools: AskUserQuestion
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Veeva Config Manager
|
|
13
|
+
|
|
14
|
+
## Available skills
|
|
15
|
+
|
|
16
|
+
- **Create config** — Generate a `veeva-config.ts` file for the project → read `create.md`
|
|
17
|
+
- **Manage config** — Sync `veeva-config.ts` slides with `src/pages/` → read `manage.md`
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# veeva-create-config
|
|
2
|
+
|
|
3
|
+
Interactively collect presentation metadata from the user and write a
|
|
4
|
+
`veeva-config.ts` file to the project root, replicating the flow in
|
|
5
|
+
`src/apps/veeva-config-manager/create.ts`.
|
|
6
|
+
|
|
7
|
+
## Before you start
|
|
8
|
+
|
|
9
|
+
Check whether `veeva-config.ts` already exists in the project root. If it does, ask the user how to proceed:
|
|
10
|
+
- **Overwrite** — discard the existing file and continue with this skill
|
|
11
|
+
- **Update instead** — stop this skill and run the manage skill (`manage.md`) to sync slides with `src/pages/`
|
|
12
|
+
- **Abort** — stop without making changes
|
|
13
|
+
|
|
14
|
+
Do not proceed with collecting input until the user confirms overwrite.
|
|
15
|
+
|
|
16
|
+
## Clean input rule
|
|
17
|
+
|
|
18
|
+
Before using any free-text value (product name, presentation name, presentation ID) in the output: `.trim()` and replace runs of two or more spaces with a single space. Do not otherwise transform user input. This rule is referenced from the input-collection and ID-generation steps below.
|
|
19
|
+
|
|
20
|
+
## What you need from the user
|
|
21
|
+
|
|
22
|
+
Tell the user that some information is required to generate the config file. Gather **all** of the following before writing any files.
|
|
23
|
+
|
|
24
|
+
Ask the free-text questions one at a time (steps 1–2). The predefined-option questions in step 3 are batched into a single `AskUserQuestion` call — that's intentional, since `AskUserQuestion` natively supports multiple questions per call. The Disable questions (step 4) are a separate `AskUserQuestion` call with three multi-select groups.
|
|
25
|
+
|
|
26
|
+
Apply the [Clean input rule](#clean-input-rule) to every free-text value as you receive it.
|
|
27
|
+
|
|
28
|
+
1. Ask for the `Product name` and `Presentation name` (one at a time).
|
|
29
|
+
2. Ask for the `Presentation ID`. Suggest a value derived from the cleaned `Presentation name`: lowercased, with any non-alphanumeric character replaced by `_`. Ask the user to confirm or enter a new value.
|
|
30
|
+
3. Call `AskUserQuestion` with one call containing the following three questions in order (all single-select):
|
|
31
|
+
- **Dimensions**
|
|
32
|
+
- Question: Select the IVA dimensions
|
|
33
|
+
- Options: `1024 × 768`, `1366 × 1024` *(default)*, `1376 × 1032`
|
|
34
|
+
- **Resolution**
|
|
35
|
+
- Question: Select the iOS resolution
|
|
36
|
+
- Options: `Default For Device` *(default)*, `Scale To Fit`, `Scale To 1024x768`
|
|
37
|
+
- **Platform**
|
|
38
|
+
- Question: Select the target Veeva platform
|
|
39
|
+
- Options: `Salesforce` *(default)*, `Vault`
|
|
40
|
+
|
|
41
|
+
4. Call `AskUserQuestion` with a separate call containing three questions, all `multiSelect: true`, to collect which Veeva features to disable. Each question covers a distinct group of features; `None` means the user wants nothing disabled from that group.
|
|
42
|
+
- **Disable 1/3**
|
|
43
|
+
- Question: Select any features to disable (group 1 of 3)
|
|
44
|
+
- Options: `Navigation Bar`, `Reactions`, `None`
|
|
45
|
+
- **Disable 2/3**
|
|
46
|
+
- Question: Select any features to disable (group 2 of 3)
|
|
47
|
+
- Options: `History Buttons`, `Swipe`, `None`
|
|
48
|
+
- **Disable 3/3**
|
|
49
|
+
- Question: Select any features to disable (group 3 of 3)
|
|
50
|
+
- Options: `Pinch to Exit`, `Rotation Lock`, `Zoom`, `None`
|
|
51
|
+
|
|
52
|
+
When building the `##DISABLE_ACTIONS##` array, collect all selected values across the three groups and exclude any `None` selections — they are a "nothing from this group" signal, not a feature name.
|
|
53
|
+
|
|
54
|
+
For the **Dimensions** answer, split the selected option on `×` and trim each side to get the numeric width and height (e.g. `1366 × 1024` → width `1366`, height `1024`).
|
|
55
|
+
|
|
56
|
+
### Preferred collection strategy
|
|
57
|
+
|
|
58
|
+
1. **Try `AskUserQuestion` first** for all fields with predefined options.
|
|
59
|
+
|
|
60
|
+
2. **Fall back to conversational** for any field if `AskUserQuestion` is
|
|
61
|
+
unavailable or the call fails. List the options in a numbered list so the user can reply with a number rather than the full option text.
|
|
62
|
+
|
|
63
|
+
### Exceptions
|
|
64
|
+
|
|
65
|
+
If `Other` is selected for `Dimensions`, `Resolution`, `Platform`, or any of the three Disable groups, reject the response and re-prompt the user asking them to choose only from the defined values.
|
|
66
|
+
|
|
67
|
+
## Generating IDs
|
|
68
|
+
|
|
69
|
+
You will need two kinds of random IDs. Implement them inline with JavaScript/TypeScript logic or generate them yourself:
|
|
70
|
+
|
|
71
|
+
- **External ID prefix**: First 3 chars of `product` (uppercased) + `_` + an 8-char alphanumeric random string (uppercase A–Z, 0–9). If the cleaned product name is shorter than 3 chars, right-pad with `_` to reach 3 chars before uppercasing.
|
|
72
|
+
Example: product `Velorixin` → `VEL_3K9BW12X`
|
|
73
|
+
Example: product `Ox` → `OX__3K9BW12X`
|
|
74
|
+
- **Per-slide ID**: An independent 8-char alphanumeric random string for each slide, unique within the set.
|
|
75
|
+
|
|
76
|
+
To generate an 8-char random-ish ID in a bash snippet you can run:
|
|
77
|
+
```bash
|
|
78
|
+
node -e "const a='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';let r='';for(let i=0;i<8;i++)r+=a[Math.floor(Math.random()*36)];console.log(r)"
|
|
79
|
+
```
|
|
80
|
+
Or generate them yourself — just make them look like `3K9BW12X` (8 uppercase alphanumeric chars).
|
|
81
|
+
|
|
82
|
+
## Discovering slides
|
|
83
|
+
|
|
84
|
+
Use the Glob tool with the pattern `src/pages/*.astro` to list all slide pages. (Glob is platform-agnostic — prefer it over `ls`, which is unreliable on Windows.)
|
|
85
|
+
|
|
86
|
+
For each file `some-page-name.astro`:
|
|
87
|
+
- `path` = filename without `.astro` extension (e.g. `some-page-name`)
|
|
88
|
+
- `title` = title-case the path by splitting on `-`, capitalising each part, joining with space (e.g. `Some Page Name`)
|
|
89
|
+
- `externalId` = `formatExtId('<SLIDE_ID>')` — keep as a function call literal in the output. Ensure that `<SLIDE_ID>` is unique
|
|
90
|
+
|
|
91
|
+
## Output format
|
|
92
|
+
|
|
93
|
+
Write `veeva-config.ts` to the **project root** using exactly this template. Replace every `##...##` token with the collected/generated value, but **leave all `${...}` template-literal expressions exactly as written** — those are TypeScript that runs at runtime, not placeholders for you to substitute. Do not modify the imports, the function signature, or the `binderFields` block.
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
import type { IVeevaClmBinderFields, IVeevaConfig, VeevaEnv } from "@inizioevoke/veeva-astroclm-core/types";
|
|
97
|
+
import { formatExtId as __formatExtId } from '@inizioevoke/veeva-astroclm-core/lib';
|
|
98
|
+
|
|
99
|
+
interface IVeevaConfigArgs {
|
|
100
|
+
veevaEnv?: VeevaEnv;
|
|
101
|
+
isTraining?: boolean;
|
|
102
|
+
}
|
|
103
|
+
export default function ({ veevaEnv = 'client', isTraining = false }: IVeevaConfigArgs = {}): IVeevaConfig {
|
|
104
|
+
const isEvokeBuild = veevaEnv === 'evoke';
|
|
105
|
+
const EXT_ID = `##EXTERNAL_ID##${isTraining ? '_TRN' : ''}`;
|
|
106
|
+
const PRESENTATION_NAME = '##PRESENTATION_NAME##';
|
|
107
|
+
|
|
108
|
+
const formatExtId = (id: string) => {
|
|
109
|
+
return __formatExtId(EXT_ID, id);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const binderFields: IVeevaClmBinderFields = {
|
|
113
|
+
// language: isEvokeBuild ? undefined : 'English',
|
|
114
|
+
// crmOrg: isEvokeBuild ? undefined : { crmId: ['CRM_ORD_ID'] },
|
|
115
|
+
// crmProduct: isEvokeBuild ? undefined : { id: 'VEEVA_ID_FROM_URL' },
|
|
116
|
+
// crmDetailGroup: isEvokeBuild ? undefined : { id: 'VEEVA_ID_FROM_URL' },
|
|
117
|
+
// detailGroup: undefined
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const queryStringParams = {
|
|
121
|
+
screenshots: true
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
dimensions: { width: ##DIMENSIONS_WIDTH##, height: ##DIMENSIONS_HEIGHT## },
|
|
126
|
+
thumbnails: {
|
|
127
|
+
queryStringParams
|
|
128
|
+
},
|
|
129
|
+
presentation: {
|
|
130
|
+
externalId: EXT_ID,
|
|
131
|
+
presentationId: `##PRESENTATION_ID##${isTraining ? '_trn' : ''}`,
|
|
132
|
+
product: '##PRODUCT##',
|
|
133
|
+
name: `${PRESENTATION_NAME}${isTraining ? ' [Training]' : ''}`,
|
|
134
|
+
country: 'United States',
|
|
135
|
+
isTraining,
|
|
136
|
+
crmTarget: '##CRM_TARGET##',
|
|
137
|
+
...binderFields,
|
|
138
|
+
|
|
139
|
+
shared: {
|
|
140
|
+
externalId: formatExtId('SHARED'),
|
|
141
|
+
...binderFields
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
slideSettings: {
|
|
145
|
+
mediaType: 'HTML',
|
|
146
|
+
disableActions: ##DISABLE_ACTIONS##,
|
|
147
|
+
iosResolution: '##IOS_RESOLUTION##',
|
|
148
|
+
...binderFields
|
|
149
|
+
},
|
|
150
|
+
slides: ##SLIDES##
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Token substitution reference
|
|
158
|
+
|
|
159
|
+
| Token | Value |
|
|
160
|
+
|---|---|
|
|
161
|
+
| `##EXTERNAL_ID##` | e.g. `OZE_3K9BW12X` |
|
|
162
|
+
| `##PRESENTATION_NAME##` | cleaned presentation name (trim, collapse double spaces) |
|
|
163
|
+
| `##PRESENTATION_ID##` | cleaned presentation ID |
|
|
164
|
+
| `##PRODUCT##` | cleaned product name |
|
|
165
|
+
| `##DIMENSIONS_WIDTH##` | numeric width, no quotes (e.g. `1366`) |
|
|
166
|
+
| `##DIMENSIONS_HEIGHT##` | numeric height, no quotes (e.g. `1024`) |
|
|
167
|
+
| `##IOS_RESOLUTION##` | string value as-is (e.g. `Default For Device`) |
|
|
168
|
+
| `##DISABLE_ACTIONS##` | TS array literal e.g. `['Swipe', 'Zoom']` or `[]` |
|
|
169
|
+
| `##CRM_TARGET##` | `Salesforce` or `Vault` |
|
|
170
|
+
| `##SLIDES##` | Array of slide objects (see below) |
|
|
171
|
+
|
|
172
|
+
### Slides array format
|
|
173
|
+
|
|
174
|
+
```ts
|
|
175
|
+
[{
|
|
176
|
+
path: 'some-page-name',
|
|
177
|
+
title: 'Some Page Name',
|
|
178
|
+
externalId: formatExtId('3K9BW12X')
|
|
179
|
+
}, {
|
|
180
|
+
path: 'another-page',
|
|
181
|
+
title: 'Another Page',
|
|
182
|
+
externalId: formatExtId('7XZ2M4QR')
|
|
183
|
+
}]
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## After writing the file
|
|
187
|
+
|
|
188
|
+
Tell the user where the file was written (`veeva-config.ts` in the project
|
|
189
|
+
root) and list the slides that were detected.
|