@inizioevoke/veeva-astroclm-core 1.1.6 → 1.2.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/build.ts CHANGED
@@ -28,6 +28,7 @@ switch (argv.cmd) {
28
28
  const dirsToCopy = [
29
29
  'apps/page-manager/templates',
30
30
  'apps/veeva-config-manager/templates',
31
+ 'components',
31
32
  'types'
32
33
  ];
33
34
  for (const dir of dirsToCopy) {
@@ -0,0 +1,25 @@
1
+ ---
2
+ import esbuild from 'esbuild';
3
+ import { BuildTarget } from '../../../types/env';
4
+
5
+ import script from './platform.ts?raw';
6
+
7
+ export interface Props {
8
+ buildTarget: BuildTarget;
9
+ }
10
+
11
+ const {
12
+ buildTarget
13
+ } = Astro.props;
14
+
15
+ let js: string | undefined;
16
+ if (buildTarget === 'veeva') {
17
+ const { code } = await esbuild.transform(script, {
18
+ loader: 'ts',
19
+ target: 'es2020',
20
+ minify: true
21
+ });
22
+ js = code;
23
+ }
24
+ ---
25
+ {js && <script is:inline set:html={js} />}
@@ -0,0 +1,4 @@
1
+ export {
2
+ default,
3
+ type Props as PlatformScriptProps
4
+ } from "./PlatformScript.astro";
@@ -0,0 +1,16 @@
1
+ (() => {
2
+ const veevaPlatform: 'windows' | 'mac' | 'ipad' | 'unknown' = (() => {
3
+ const ua = navigator.userAgent;
4
+ const platform = navigator.platform;
5
+ if (/windows/i.test(ua)) {
6
+ return 'windows';
7
+ } else if (/ipad/i.test(ua) || (platform === 'MacIntel' && navigator.maxTouchPoints > 1) || (/macintosh/i.test(ua) && 'ontouchstart' in window)) {
8
+ return 'ipad';
9
+ } else if (/macintosh/i.test(ua) || platform === 'MacIntel') {
10
+ return 'mac';
11
+ } else {
12
+ return 'unknown';
13
+ }
14
+ })();
15
+ document.documentElement.classList.add(`platform-${veevaPlatform}`);
16
+ })();
@@ -0,0 +1,35 @@
1
+ ---
2
+ import esbuild from 'esbuild';
3
+ import { BuildTarget } from '../../../types/env';
4
+ import script from './resize.ts?raw';
5
+
6
+ export interface Props {
7
+ buildTarget: BuildTarget,
8
+ webScaling: boolean,
9
+ ivaDimensions: {
10
+ width: number,
11
+ height: number
12
+ }
13
+ }
14
+
15
+ const {
16
+ buildTarget,
17
+ webScaling,
18
+ ivaDimensions
19
+ } = Astro.props;
20
+
21
+ let js: string | undefined;
22
+ if (buildTarget === 'veeva' || webScaling) {
23
+ const { code } = await esbuild.transform(script, {
24
+ loader: 'ts',
25
+ target: 'es2020',
26
+ minify: true,
27
+ define: {
28
+ IVA_WIDTH: ivaDimensions.width.toString(),
29
+ IVA_HEIGHT: ivaDimensions.height.toString()
30
+ }
31
+ });
32
+ js = code;
33
+ }
34
+ ---
35
+ {js && <script is:inline set:html={js} />}
@@ -0,0 +1,4 @@
1
+ export {
2
+ default,
3
+ type Props as ResizeScriptProps
4
+ } from "./ResizeScript.astro";
@@ -0,0 +1,50 @@
1
+ (() => {
2
+ // Backup for CSS scaling for Veeva builds when the current screen size is not configured
3
+
4
+ // ----------------------------------------------------------------------------------------------------
5
+ // These values will be replaced during the build
6
+ // @ts-ignore
7
+ const width: number = IVA_WIDTH;
8
+ // @ts-ignore
9
+ const height: number = IVA_HEIGHT;
10
+ // ----------------------------------------------------------------------------------------------------
11
+
12
+ const scalingWrapper = document.querySelector('.scaling-wrapper') as HTMLElement;
13
+
14
+ function debounce<T extends (...args: unknown[]) => void>(fn: T, delay: number = 100) {
15
+ let timer: ReturnType<typeof setTimeout>;
16
+ return (...args: Parameters<T>) => {
17
+ clearTimeout(timer);
18
+ timer = setTimeout(() => fn(...args), delay);
19
+ };
20
+ }
21
+
22
+ let lastScale = 0;
23
+ const resize = () => {
24
+ const vw = Math.round(visualViewport?.width ?? window.innerWidth);
25
+ const vh = Math.round(visualViewport?.height ?? window.innerHeight);
26
+ let transform: string | undefined;
27
+ const shouldScaleDown = vw < width - 1 || vh < height - 1;
28
+ if (shouldScaleDown) {
29
+ const scale = Math.min(vw / width, vh / height);
30
+ if (scale !== 1 && lastScale !== scale) {
31
+ lastScale = scale;
32
+ const offsetX = (vw - width * scale) / 2 / scale;
33
+ const offsetY = (vh - height * scale) / 2 / scale;
34
+ transform = `scale(${scale}) translate(${offsetX}px, ${offsetY}px)`;
35
+ }
36
+ } else {
37
+ transform = 'none';
38
+ }
39
+
40
+ if (transform) {
41
+ document.body.classList[transform === 'none' ? 'remove' : 'add']('scaled');
42
+ scalingWrapper.style.transform = transform;
43
+ }
44
+ }
45
+
46
+ resize();
47
+ window.addEventListener('DOMContentLoaded', () => {
48
+ window.addEventListener('resize', debounce(resize), { passive: true });
49
+ }, { passive: true });
50
+ })();
@@ -41,6 +41,7 @@ export default async function ({ root, config, env, csvOnly = false, serverPort
41
41
  server: { host: server.host ?? 'localhost', port: server.port },
42
42
  config,
43
43
  deployDir,
44
+ root
44
45
  });
45
46
  await server.stop();
46
47
  await createZips({ deployDir });
@@ -1,6 +1,7 @@
1
1
  import type { IVeevaConfig } from "../types";
2
2
  interface Params {
3
3
  config: IVeevaConfig;
4
+ root: string;
4
5
  deployDir: string;
5
6
  server: {
6
7
  protocol?: 'http' | 'https';
@@ -8,5 +9,5 @@ interface Params {
8
9
  port: number;
9
10
  };
10
11
  }
11
- export default function ({ config, deployDir, server }: Params): Promise<void>;
12
+ export default function ({ config, root, deployDir, server }: Params): Promise<void>;
12
13
  export {};
@@ -3,7 +3,7 @@ import { join } from "node:path";
3
3
  import puppeteer from "puppeteer";
4
4
  import sharp from 'sharp';
5
5
  import logger from '../lib/logger.js';
6
- export default async function ({ config, deployDir, server }) {
6
+ export default async function ({ config, root, deployDir, server }) {
7
7
  logger.info('Generating thumbnails');
8
8
  initThumbSettings(config);
9
9
  await generateSharedThumb(config, deployDir);
@@ -17,8 +17,13 @@ export default async function ({ config, deployDir, server }) {
17
17
  isMobile: true
18
18
  });
19
19
  for (const slide of config.presentation.slides) {
20
+ if (slide.thumbnails?.thumbFile?.filepath) {
21
+ const filepath = join(root, slide.thumbnails.thumbFile.filepath);
22
+ }
23
+ if (slide.thumbnails?.posterFile?.filepath) {
24
+ }
20
25
  for (const settings of slide.thumbnails.settings) {
21
- logger.info(`Generating /${slide.path}/`);
26
+ logger.info(`Generating /${settings.path ?? slide.path}/`);
22
27
  const url = `${server.protocol ?? 'http'}://${server.host}:${server.port}/${settings.path ?? slide.path}/${settings.queryStringParams ? `?${objToQS(settings.queryStringParams)}` : ''}`;
23
28
  try {
24
29
  await page.goto(url, {
@@ -44,7 +49,7 @@ export default async function ({ config, deployDir, server }) {
44
49
  quality: 80,
45
50
  effort: 10
46
51
  })).toBuffer();
47
- const fileName = typeof settings.filename == 'function' ? settings.filename(config, slide, settings) : settings.filename ?? 'thumb.png';
52
+ const fileName = typeof settings.outFile == 'function' ? settings.outFile(config, slide, settings) : settings.outFile ?? 'thumb.png';
48
53
  await writeFile(join(deployDir, slide.path, fileName), thumb);
49
54
  }
50
55
  }
@@ -52,7 +57,7 @@ export default async function ({ config, deployDir, server }) {
52
57
  await browser.close();
53
58
  }
54
59
  async function generateSharedThumb(config, deployDir) {
55
- let settings = config.thumbnails?.settings?.find(s => s.filename === 'thumb.png');
60
+ let settings = config.thumbnails?.settings?.find(s => s.outFile === 'thumb.png');
56
61
  const width = settings?.width ?? 600;
57
62
  const height = settings?.height ?? width / 4 * 3;
58
63
  const svgImage = `
@@ -101,8 +106,8 @@ function initThumbSettings(config) {
101
106
  if (!config.thumbnails.default.height) {
102
107
  config.thumbnails.default.height = config.thumbnails.default.width / 4 * 3;
103
108
  }
104
- if (!config.thumbnails.default.filename) {
105
- config.thumbnails.default.filename = 'thumb.png';
109
+ if (!config.thumbnails.default.outFile) {
110
+ config.thumbnails.default.outFile = 'thumb.png';
106
111
  }
107
112
  if (!config.thumbnails.settings) {
108
113
  config.thumbnails.settings = [];
@@ -126,7 +131,7 @@ function initThumbSettings(config) {
126
131
  switch (slide.thumbnails.strategy) {
127
132
  case 'append':
128
133
  slide.thumbnails.settings = config.thumbnails.settings.concat(slide.thumbnails.settings.map((sets) => {
129
- return { ...config.thumbnails.default, ...slide.thumbnails?.default ?? {}, ...sets };
134
+ return { ...config.thumbnails.default, ...sets }; // {...config.thumbnails!.default, ...slide.thumbnails?.default ?? {}, ...sets}
130
135
  }));
131
136
  break;
132
137
  case 'replace':
@@ -136,7 +141,7 @@ function initThumbSettings(config) {
136
141
  for (let i = 0; i < slide.thumbnails.settings.length; i++) {
137
142
  slide.thumbnails.settings[i] = {
138
143
  ...(config.thumbnails.settings[i] ?? config.thumbnails.default),
139
- ...(slide.thumbnails.default ?? {}),
144
+ // ...(slide.thumbnails.default ?? {}),
140
145
  ...slide.thumbnails.settings[i]
141
146
  };
142
147
  }
@@ -8,22 +8,31 @@ export interface IDimensions {
8
8
  }
9
9
 
10
10
  export interface IScreenshotSettings extends IDimensions {
11
- filename?: string | ThumbnailNameHandler;
12
11
  path?: string;
13
12
  queryStringParams?: Record<string, boolean | number | string>;
14
13
  delay?: number;
14
+ outFile?: string | ThumbnailNameHandler;
15
15
  outDir?: string | string[] | ThumbnailNameHandler;
16
16
  }
17
17
  export interface IThumbnailSettings {
18
- strategy?: 'append' | 'merge' | 'replace',
19
18
  default?: IScreenshotSettings;
20
19
  settings?: IScreenshotSettings[];
21
20
  }
21
+ export interface ISlideThumbnailSettings {
22
+ strategy?: 'append' | 'merge' | 'replace';
23
+ thumbFile?: IDimensions & {
24
+ filepath: string;
25
+ };
26
+ posterFile?: IDimensions & {
27
+ filepath: string;
28
+ };
29
+ settings?: IScreenshotSettings[];
30
+ }
22
31
 
23
32
  export interface IVeevaConfigSlide extends IVeevaClmSlide {
24
33
  path: string;
25
34
  enableActions?: Actions[];
26
- thumbnails?: IThumbnailSettings;
35
+ thumbnails?: ISlideThumbnailSettings;
27
36
  }
28
37
 
29
38
  export interface IVeevaConfigPresentation extends IVeevaClmPresentation {
@@ -38,7 +47,7 @@ export interface IVeevaConfigPresentation extends IVeevaClmPresentation {
38
47
  export interface IVeevaConfig {
39
48
  dimensions: { width: number, height: number };
40
49
  slideSettings?: IVeevaClmSlideSettings; // legacy support
41
- thumbnails?: Omit<IThumbnailSettings, 'strategy'>;
50
+ thumbnails?: IThumbnailSettings;
42
51
 
43
52
  presentation: IVeevaConfigPresentation & {
44
53
  name: string;
@@ -3,8 +3,8 @@ export type iOSResolution = "Default For Device" | "Scale To 1024x768" | "Scale
3
3
  export type Actions = "Swipe" | "Pinch to Exit" | "Zoom" | "Rotation Lock" | "History Buttons" | "Navigation Bar" | "Reactions";
4
4
  export type CrmTarget = 'Salesforce' | 'Vault';
5
5
 
6
- export interface VeevaIdField {
7
- id: string;
6
+ export interface VeevaIdField<T = string> {
7
+ id: T;
8
8
  }
9
9
  export interface VeevaCrmIdField<T = string> {
10
10
  crmId: T;
@@ -16,9 +16,9 @@ export interface VeevaExternalIdField {
16
16
  export interface IVeevaClmBinderFields {
17
17
  language?: 'English' & (string & {});
18
18
  crmTarget?: CrmTarget;
19
- crmOrg?: VeevaCrmIdField<string[]>;
19
+ crmOrg?: VeevaCrmIdField<string | string[]>;
20
20
  crmProduct?: VeevaIdField;
21
- crmContentGroup?: VeevaIdField | VeevaIdField[];
21
+ crmContentGroup?: VeevaIdField<string | string[]>;
22
22
  crmDetailGroup?: VeevaIdField;
23
23
  detailGroup?: string;
24
24
  expirationDate?: `${string}/${string}/${string}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inizioevoke/veeva-astroclm-core",
3
- "version": "1.1.6",
3
+ "version": "1.2.0",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "",
@@ -12,6 +12,8 @@
12
12
  },
13
13
  "exports": {
14
14
  "./apps": "./dist/apps/index.js",
15
+ "./PlatformScript": "./dist/components/PlatformScript/index.ts",
16
+ "./ResizeScript": "./dist/components/ResizeScript/index.ts",
15
17
  "./env": "./dist/env/index.js",
16
18
  "./integrations": "./dist/integrations/index.js",
17
19
  "./lib": {
@@ -0,0 +1,25 @@
1
+ ---
2
+ import esbuild from 'esbuild';
3
+ import { BuildTarget } from '../../../types/env';
4
+
5
+ import script from './platform.ts?raw';
6
+
7
+ export interface Props {
8
+ buildTarget: BuildTarget;
9
+ }
10
+
11
+ const {
12
+ buildTarget
13
+ } = Astro.props;
14
+
15
+ let js: string | undefined;
16
+ if (buildTarget === 'veeva') {
17
+ const { code } = await esbuild.transform(script, {
18
+ loader: 'ts',
19
+ target: 'es2020',
20
+ minify: true
21
+ });
22
+ js = code;
23
+ }
24
+ ---
25
+ {js && <script is:inline set:html={js} />}
@@ -0,0 +1,4 @@
1
+ export {
2
+ default,
3
+ type Props as PlatformScriptProps
4
+ } from "./PlatformScript.astro";
@@ -0,0 +1,16 @@
1
+ (() => {
2
+ const veevaPlatform: 'windows' | 'mac' | 'ipad' | 'unknown' = (() => {
3
+ const ua = navigator.userAgent;
4
+ const platform = navigator.platform;
5
+ if (/windows/i.test(ua)) {
6
+ return 'windows';
7
+ } else if (/ipad/i.test(ua) || (platform === 'MacIntel' && navigator.maxTouchPoints > 1) || (/macintosh/i.test(ua) && 'ontouchstart' in window)) {
8
+ return 'ipad';
9
+ } else if (/macintosh/i.test(ua) || platform === 'MacIntel') {
10
+ return 'mac';
11
+ } else {
12
+ return 'unknown';
13
+ }
14
+ })();
15
+ document.documentElement.classList.add(`platform-${veevaPlatform}`);
16
+ })();
@@ -0,0 +1,35 @@
1
+ ---
2
+ import esbuild from 'esbuild';
3
+ import { BuildTarget } from '../../../types/env';
4
+ import script from './resize.ts?raw';
5
+
6
+ export interface Props {
7
+ buildTarget: BuildTarget,
8
+ webScaling: boolean,
9
+ ivaDimensions: {
10
+ width: number,
11
+ height: number
12
+ }
13
+ }
14
+
15
+ const {
16
+ buildTarget,
17
+ webScaling,
18
+ ivaDimensions
19
+ } = Astro.props;
20
+
21
+ let js: string | undefined;
22
+ if (buildTarget === 'veeva' || webScaling) {
23
+ const { code } = await esbuild.transform(script, {
24
+ loader: 'ts',
25
+ target: 'es2020',
26
+ minify: true,
27
+ define: {
28
+ IVA_WIDTH: ivaDimensions.width.toString(),
29
+ IVA_HEIGHT: ivaDimensions.height.toString()
30
+ }
31
+ });
32
+ js = code;
33
+ }
34
+ ---
35
+ {js && <script is:inline set:html={js} />}
@@ -0,0 +1,4 @@
1
+ export {
2
+ default,
3
+ type Props as ResizeScriptProps
4
+ } from "./ResizeScript.astro";
@@ -0,0 +1,50 @@
1
+ (() => {
2
+ // Backup for CSS scaling for Veeva builds when the current screen size is not configured
3
+
4
+ // ----------------------------------------------------------------------------------------------------
5
+ // These values will be replaced during the build
6
+ // @ts-ignore
7
+ const width: number = IVA_WIDTH;
8
+ // @ts-ignore
9
+ const height: number = IVA_HEIGHT;
10
+ // ----------------------------------------------------------------------------------------------------
11
+
12
+ const scalingWrapper = document.querySelector('.scaling-wrapper') as HTMLElement;
13
+
14
+ function debounce<T extends (...args: unknown[]) => void>(fn: T, delay: number = 100) {
15
+ let timer: ReturnType<typeof setTimeout>;
16
+ return (...args: Parameters<T>) => {
17
+ clearTimeout(timer);
18
+ timer = setTimeout(() => fn(...args), delay);
19
+ };
20
+ }
21
+
22
+ let lastScale = 0;
23
+ const resize = () => {
24
+ const vw = Math.round(visualViewport?.width ?? window.innerWidth);
25
+ const vh = Math.round(visualViewport?.height ?? window.innerHeight);
26
+ let transform: string | undefined;
27
+ const shouldScaleDown = vw < width - 1 || vh < height - 1;
28
+ if (shouldScaleDown) {
29
+ const scale = Math.min(vw / width, vh / height);
30
+ if (scale !== 1 && lastScale !== scale) {
31
+ lastScale = scale;
32
+ const offsetX = (vw - width * scale) / 2 / scale;
33
+ const offsetY = (vh - height * scale) / 2 / scale;
34
+ transform = `scale(${scale}) translate(${offsetX}px, ${offsetY}px)`;
35
+ }
36
+ } else {
37
+ transform = 'none';
38
+ }
39
+
40
+ if (transform) {
41
+ document.body.classList[transform === 'none' ? 'remove' : 'add']('scaled');
42
+ scalingWrapper.style.transform = transform;
43
+ }
44
+ }
45
+
46
+ resize();
47
+ window.addEventListener('DOMContentLoaded', () => {
48
+ window.addEventListener('resize', debounce(resize), { passive: true });
49
+ }, { passive: true });
50
+ })();
@@ -58,6 +58,7 @@ export default async function({ root, config, env, csvOnly = false, serverPort =
58
58
  server: { host: server.host ?? 'localhost', port: server.port },
59
59
  config,
60
60
  deployDir,
61
+ root
61
62
  });
62
63
 
63
64
  await server.stop();
@@ -8,6 +8,7 @@ import type { IVeevaConfig } from "../types";
8
8
 
9
9
  interface Params {
10
10
  config: IVeevaConfig;
11
+ root: string;
11
12
  deployDir: string;
12
13
  server: {
13
14
  protocol?: 'http' | 'https';
@@ -16,7 +17,7 @@ interface Params {
16
17
  };
17
18
  }
18
19
 
19
- export default async function({ config, deployDir, server }: Params) {
20
+ export default async function({ config, root, deployDir, server }: Params) {
20
21
  logger.info('Generating thumbnails');
21
22
  initThumbSettings(config);
22
23
  await generateSharedThumb(config, deployDir);
@@ -32,8 +33,14 @@ export default async function({ config, deployDir, server }: Params) {
32
33
  });
33
34
 
34
35
  for (const slide of config.presentation.slides) {
36
+ if (slide.thumbnails?.thumbFile?.filepath) {
37
+ const filepath = join(root, slide.thumbnails.thumbFile.filepath);
38
+ }
39
+ if (slide.thumbnails?.posterFile?.filepath) {
40
+
41
+ }
35
42
  for (const settings of slide.thumbnails!.settings!) {
36
- logger.info(`Generating /${slide.path}/`);
43
+ logger.info(`Generating /${settings.path ?? slide.path}/`);
37
44
  const url = `${server.protocol ?? 'http'}://${server.host}:${server.port}/${settings.path ?? slide.path}/${settings.queryStringParams ? `?${objToQS(settings.queryStringParams)}` : ''}`
38
45
 
39
46
  try {
@@ -62,7 +69,7 @@ export default async function({ config, deployDir, server }: Params) {
62
69
  })
63
70
  ).toBuffer();
64
71
 
65
- const fileName = typeof settings.filename == 'function' ? settings.filename(config, slide, settings) : settings.filename ?? 'thumb.png';
72
+ const fileName = typeof settings.outFile == 'function' ? settings.outFile(config, slide, settings) : settings.outFile ?? 'thumb.png';
66
73
  await writeFile(join(deployDir, slide.path, fileName), thumb);
67
74
  }
68
75
  }
@@ -72,7 +79,7 @@ export default async function({ config, deployDir, server }: Params) {
72
79
  }
73
80
 
74
81
  async function generateSharedThumb(config: IVeevaConfig, deployDir: string) {
75
- let settings = config.thumbnails?.settings?.find(s => s.filename === 'thumb.png');
82
+ let settings = config.thumbnails?.settings?.find(s => s.outFile === 'thumb.png');
76
83
  const width = settings?.width ?? 600;
77
84
  const height = settings?.height ?? width / 4 * 3;
78
85
  const svgImage = `
@@ -125,8 +132,8 @@ function initThumbSettings(config: IVeevaConfig) {
125
132
  if (!config.thumbnails.default.height) {
126
133
  config.thumbnails.default.height = config.thumbnails.default.width / 4 * 3;
127
134
  }
128
- if (!config.thumbnails.default.filename) {
129
- config.thumbnails.default.filename = 'thumb.png';
135
+ if (!config.thumbnails.default.outFile) {
136
+ config.thumbnails.default.outFile = 'thumb.png';
130
137
  }
131
138
  if (!config.thumbnails.settings) {
132
139
  config.thumbnails.settings = [];
@@ -150,7 +157,7 @@ function initThumbSettings(config: IVeevaConfig) {
150
157
  case 'append':
151
158
  slide.thumbnails.settings = config.thumbnails.settings.concat(
152
159
  slide.thumbnails.settings.map((sets) => {
153
- return {...config.thumbnails!.default, ...slide.thumbnails?.default ?? {}, ...sets}
160
+ return {...config.thumbnails!.default, ...sets}; // {...config.thumbnails!.default, ...slide.thumbnails?.default ?? {}, ...sets}
154
161
  })
155
162
  );
156
163
  break;
@@ -161,7 +168,7 @@ function initThumbSettings(config: IVeevaConfig) {
161
168
  for (let i=0; i<slide.thumbnails.settings.length; i++) {
162
169
  slide.thumbnails.settings[i] = {
163
170
  ...(config.thumbnails.settings[i] ?? config.thumbnails.default),
164
- ...(slide.thumbnails.default ?? {}),
171
+ // ...(slide.thumbnails.default ?? {}),
165
172
  ...slide.thumbnails.settings[i]
166
173
  };
167
174
  }
@@ -8,22 +8,31 @@ export interface IDimensions {
8
8
  }
9
9
 
10
10
  export interface IScreenshotSettings extends IDimensions {
11
- filename?: string | ThumbnailNameHandler;
12
11
  path?: string;
13
12
  queryStringParams?: Record<string, boolean | number | string>;
14
13
  delay?: number;
14
+ outFile?: string | ThumbnailNameHandler;
15
15
  outDir?: string | string[] | ThumbnailNameHandler;
16
16
  }
17
17
  export interface IThumbnailSettings {
18
- strategy?: 'append' | 'merge' | 'replace',
19
18
  default?: IScreenshotSettings;
20
19
  settings?: IScreenshotSettings[];
21
20
  }
21
+ export interface ISlideThumbnailSettings {
22
+ strategy?: 'append' | 'merge' | 'replace';
23
+ thumbFile?: IDimensions & {
24
+ filepath: string;
25
+ };
26
+ posterFile?: IDimensions & {
27
+ filepath: string;
28
+ };
29
+ settings?: IScreenshotSettings[];
30
+ }
22
31
 
23
32
  export interface IVeevaConfigSlide extends IVeevaClmSlide {
24
33
  path: string;
25
34
  enableActions?: Actions[];
26
- thumbnails?: IThumbnailSettings;
35
+ thumbnails?: ISlideThumbnailSettings;
27
36
  }
28
37
 
29
38
  export interface IVeevaConfigPresentation extends IVeevaClmPresentation {
@@ -38,7 +47,7 @@ export interface IVeevaConfigPresentation extends IVeevaClmPresentation {
38
47
  export interface IVeevaConfig {
39
48
  dimensions: { width: number, height: number };
40
49
  slideSettings?: IVeevaClmSlideSettings; // legacy support
41
- thumbnails?: Omit<IThumbnailSettings, 'strategy'>;
50
+ thumbnails?: IThumbnailSettings;
42
51
 
43
52
  presentation: IVeevaConfigPresentation & {
44
53
  name: string;
@@ -3,8 +3,8 @@ export type iOSResolution = "Default For Device" | "Scale To 1024x768" | "Scale
3
3
  export type Actions = "Swipe" | "Pinch to Exit" | "Zoom" | "Rotation Lock" | "History Buttons" | "Navigation Bar" | "Reactions";
4
4
  export type CrmTarget = 'Salesforce' | 'Vault';
5
5
 
6
- export interface VeevaIdField {
7
- id: string;
6
+ export interface VeevaIdField<T = string> {
7
+ id: T;
8
8
  }
9
9
  export interface VeevaCrmIdField<T = string> {
10
10
  crmId: T;
@@ -16,9 +16,9 @@ export interface VeevaExternalIdField {
16
16
  export interface IVeevaClmBinderFields {
17
17
  language?: 'English' & (string & {});
18
18
  crmTarget?: CrmTarget;
19
- crmOrg?: VeevaCrmIdField<string[]>;
19
+ crmOrg?: VeevaCrmIdField<string | string[]>;
20
20
  crmProduct?: VeevaIdField;
21
- crmContentGroup?: VeevaIdField | VeevaIdField[];
21
+ crmContentGroup?: VeevaIdField<string | string[]>;
22
22
  crmDetailGroup?: VeevaIdField;
23
23
  detailGroup?: string;
24
24
  expirationDate?: `${string}/${string}/${string}`;
package/tsconfig.json CHANGED
@@ -22,6 +22,7 @@
22
22
  ],
23
23
  "exclude": [
24
24
  "./dist",
25
- "./node_modules"
25
+ "./node_modules",
26
+ "./src/components"
26
27
  ]
27
28
  }