@pitcher/js-api 1.29.0 → 1.30.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.
Files changed (73) hide show
  1. package/js-api.esm.js +408 -39
  2. package/js-api.esm.js.map +1 -1
  3. package/js-api.umd.min.js +32 -11
  4. package/js-api.umd.min.js.map +1 -1
  5. package/lib/ai-tasks/__tests__/weekly-focus.spec.d.ts +1 -0
  6. package/lib/ai-tasks/weekly-focus.d.ts +241 -0
  7. package/lib/apps/browser/appTypes.d.ts +28 -0
  8. package/lib/apps/browser/stores/api.d.ts +6 -1
  9. package/lib/apps/browser/stores/app.d.ts +5 -0
  10. package/lib/apps/browser/stores/app.selectionPruneScope.test.d.ts +1 -0
  11. package/lib/apps/browser/stores/upload.d.ts +26 -1
  12. package/lib/apps/browser/stores/upload.types.d.ts +9 -0
  13. package/lib/apps/browser/util/lifecycle.d.ts +57 -0
  14. package/lib/apps/browser/util/lifecycle.test.d.ts +1 -0
  15. package/lib/apps/canvas-builder/components/ui/DynamicContent/useDynamicContent.d.ts +2 -0
  16. package/lib/apps/canvas-builder/components/ui/Multimedia/Multimedia.ldAsset.spec.d.ts +1 -0
  17. package/lib/apps/canvas-builder/composables/useCanvas.d.ts +203 -1
  18. package/lib/apps/canvas-builder/composables/useCanvas.saveEcho.spec.d.ts +1 -0
  19. package/lib/apps/canvas-builder/composables/useCanvasBlocks.d.ts +36 -0
  20. package/lib/apps/canvas-builder/composables/useCanvasExit.d.ts +1 -0
  21. package/lib/apps/canvas-builder/composables/useCanvasHistory.d.ts +36 -0
  22. package/lib/apps/canvas-builder/composables/useCanvasTheme.d.ts +2 -0
  23. package/lib/apps/canvas-builder/composables/useContentSelector.d.ts +8 -1
  24. package/lib/apps/canvas-builder/composables/useInstalledEmbeddables.d.ts +1 -1
  25. package/lib/apps/canvas-builder/composables/useNavigatorDrawer.d.ts +2 -0
  26. package/lib/apps/canvas-builder/composables/usePopupApps.d.ts +2 -0
  27. package/lib/apps/canvas-builder/types/canvas.d.ts +53 -3
  28. package/lib/apps/canvas-builder/util/completionWizard.util.d.ts +107 -0
  29. package/lib/apps/canvas-builder/util/completionWizard.util.test.d.ts +1 -0
  30. package/lib/apps/canvas-builder/util/fullscreenMode.util.d.ts +7 -0
  31. package/lib/apps/canvas-builder/util/fullscreenMode.util.test.d.ts +1 -0
  32. package/lib/apps/canvas-builder/util/lazySections.util.d.ts +35 -0
  33. package/lib/apps/canvas-builder/util/lazySections.util.test.d.ts +1 -0
  34. package/lib/apps/collection-player/composables/collection-navigation.util.d.ts +27 -0
  35. package/lib/apps/collection-player/composables/collection-navigation.util.spec.d.ts +1 -0
  36. package/lib/apps/collection-player/stores/app.store.d.ts +3 -0
  37. package/lib/apps/content-selector/components/Assets.uploaderRefresh.spec.d.ts +1 -0
  38. package/lib/apps/content-selector/stores/app.d.ts +1 -1
  39. package/lib/components/CFileViewer/pdf/CFileViewer.pdf.annotations.use.d.ts +5 -1
  40. package/lib/components/CFileViewer/pdf/CFileViewer.pdf.formFields.use.d.ts +8 -0
  41. package/lib/components/CFileViewer/pdf/CFileViewer.pdf.link.use.d.ts +1 -1
  42. package/lib/components/CFileViewer/pdf/CFileViewer.pdf.overlayItems.use.d.ts +1 -1
  43. package/lib/components/CFileViewer/pdf/CFileViewer.pdf.use.d.ts +4 -9
  44. package/lib/components/CFileViewer/pdf/CFileViewer.pdf.util.d.ts +1 -1
  45. package/lib/components/CFileViewer/pdf/CFileViewerFullscreen.pdf.use.d.ts +1 -1
  46. package/lib/components/CFileViewer/pdf/__tests__/CFileViewer.pdf.annotations.text.test.d.ts +1 -0
  47. package/lib/components/savedCanvases/CSavedCanvasesManagement.use.d.ts +1 -0
  48. package/lib/composables/useCourseOnlyApps.d.ts +1 -1
  49. package/lib/composables/usePdfInterpolation.d.ts +2 -2
  50. package/lib/composables/useWindowEvents.d.ts +1 -1
  51. package/lib/constants/cdp.const.d.ts +1 -0
  52. package/lib/constants/translationLanguages.const.d.ts +72 -0
  53. package/lib/main.lib.d.ts +2 -0
  54. package/lib/sdk/api/HighLevelApi.d.ts +17 -6
  55. package/lib/sdk/api/modules/ai.d.ts +43 -1
  56. package/lib/sdk/api/modules/ai.spec.d.ts +1 -0
  57. package/lib/sdk/api/modules/canvas.d.ts +8 -0
  58. package/lib/sdk/api/modules/ui/types.ui.d.ts +7 -0
  59. package/lib/sdk/main.d.ts +8 -0
  60. package/lib/sdk/payload.types.d.ts +104 -0
  61. package/lib/types/ai-tasks.const.d.ts +39 -1
  62. package/lib/types/call.d.ts +14 -0
  63. package/lib/types/launchDarkly.types.d.ts +1 -3
  64. package/lib/types/organizationSettings.types.d.ts +10 -0
  65. package/lib/util/user.d.ts +18 -0
  66. package/lib/util/user.test.d.ts +1 -0
  67. package/package.json +1 -1
  68. package/types/openapi/models/DeletedEnvironment.d.ts +0 -1
  69. package/types/openapi/models/Environment.d.ts +0 -1
  70. package/types/openapi/models/EnvironmentRequest.d.ts +0 -1
  71. package/types/openapi/models/File.d.ts +2 -0
  72. package/types/openapi/models/FileRetrieve.d.ts +2 -0
  73. package/types/openapi/models/PatchedEnvironmentRequest.d.ts +0 -1
@@ -114,6 +114,8 @@ export default function useCanvasHistory(): {
114
114
  from?: "custom" | "pexels" | "unsplash" | "ai" | undefined;
115
115
  poster_url?: string | undefined;
116
116
  poster_background_size?: import('../../../types/background').BackgroundSize | undefined;
117
+ poster_file_id?: string | undefined;
118
+ poster_asset_type?: "pitcher_asset" | "ld_asset" | undefined;
117
119
  } | {
118
120
  asset_type: "pitcher_asset";
119
121
  file: {
@@ -125,6 +127,21 @@ export default function useCanvasHistory(): {
125
127
  horizontal_alignment?: import('../types/canvas').MultimediaHorizontalAlignmentOptions | undefined;
126
128
  poster_url?: string | undefined;
127
129
  poster_background_size?: import('../../../types/background').BackgroundSize | undefined;
130
+ poster_file_id?: string | undefined;
131
+ poster_asset_type?: "pitcher_asset" | "ld_asset" | undefined;
132
+ } | {
133
+ asset_type: "ld_asset";
134
+ file: {
135
+ id: import('../../../main.lib').File["id"];
136
+ name: import('../../../main.lib').File["name"];
137
+ content_url?: import('../../../main.lib').File["content_url"] | undefined;
138
+ };
139
+ type: "image" | "video";
140
+ horizontal_alignment?: import('../types/canvas').MultimediaHorizontalAlignmentOptions | undefined;
141
+ poster_url?: string | undefined;
142
+ poster_background_size?: import('../../../types/background').BackgroundSize | undefined;
143
+ poster_file_id?: string | undefined;
144
+ poster_asset_type?: "pitcher_asset" | "ld_asset" | undefined;
128
145
  } | {
129
146
  type: "app";
130
147
  app_name: string;
@@ -285,6 +302,7 @@ export default function useCanvasHistory(): {
285
302
  readonly original_url?: string | null | undefined;
286
303
  readonly thumbnail_url?: string | null | undefined;
287
304
  download_type?: import('../../../main.lib').DownloadTypeEnum | undefined;
305
+ readonly downloaded_at?: string | null | undefined;
288
306
  readonly zip_size?: number | null | undefined;
289
307
  readonly zip_url?: string | null | undefined;
290
308
  access_type?: import('../../../main.lib').AccessTypeEnum | undefined;
@@ -588,6 +606,8 @@ export default function useCanvasHistory(): {
588
606
  from?: "custom" | "pexels" | "unsplash" | "ai" | undefined;
589
607
  poster_url?: string | undefined;
590
608
  poster_background_size?: import('../../../types/background').BackgroundSize | undefined;
609
+ poster_file_id?: string | undefined;
610
+ poster_asset_type?: "pitcher_asset" | "ld_asset" | undefined;
591
611
  } | {
592
612
  asset_type: "pitcher_asset";
593
613
  file: {
@@ -599,6 +619,21 @@ export default function useCanvasHistory(): {
599
619
  horizontal_alignment?: import('../types/canvas').MultimediaHorizontalAlignmentOptions | undefined;
600
620
  poster_url?: string | undefined;
601
621
  poster_background_size?: import('../../../types/background').BackgroundSize | undefined;
622
+ poster_file_id?: string | undefined;
623
+ poster_asset_type?: "pitcher_asset" | "ld_asset" | undefined;
624
+ } | {
625
+ asset_type: "ld_asset";
626
+ file: {
627
+ id: import('../../../main.lib').File["id"];
628
+ name: import('../../../main.lib').File["name"];
629
+ content_url?: import('../../../main.lib').File["content_url"] | undefined;
630
+ };
631
+ type: "image" | "video";
632
+ horizontal_alignment?: import('../types/canvas').MultimediaHorizontalAlignmentOptions | undefined;
633
+ poster_url?: string | undefined;
634
+ poster_background_size?: import('../../../types/background').BackgroundSize | undefined;
635
+ poster_file_id?: string | undefined;
636
+ poster_asset_type?: "pitcher_asset" | "ld_asset" | undefined;
602
637
  } | {
603
638
  type: "app";
604
639
  app_name: string;
@@ -759,6 +794,7 @@ export default function useCanvasHistory(): {
759
794
  readonly original_url?: string | null | undefined;
760
795
  readonly thumbnail_url?: string | null | undefined;
761
796
  download_type?: import('../../../main.lib').DownloadTypeEnum | undefined;
797
+ readonly downloaded_at?: string | null | undefined;
762
798
  readonly zip_size?: number | null | undefined;
763
799
  readonly zip_url?: string | null | undefined;
764
800
  access_type?: import('../../../main.lib').AccessTypeEnum | undefined;
@@ -325,6 +325,7 @@ export default function useCanvasTheme(): {
325
325
  readonly original_url: string | null;
326
326
  readonly thumbnail_url: string | null;
327
327
  download_type?: import('../../../../types/openapi').DownloadTypeEnum | undefined;
328
+ readonly downloaded_at?: string | null | undefined;
328
329
  readonly zip_size: number | null;
329
330
  readonly zip_url: string | null;
330
331
  access_type?: import('../../../../types/openapi').AccessTypeEnum | undefined;
@@ -383,6 +384,7 @@ export default function useCanvasTheme(): {
383
384
  readonly original_url: string | null;
384
385
  readonly thumbnail_url: string | null;
385
386
  download_type?: import('../../../../types/openapi').DownloadTypeEnum | undefined;
387
+ readonly downloaded_at?: string | null | undefined;
386
388
  readonly zip_size: number | null;
387
389
  readonly zip_url: string | null;
388
390
  access_type?: import('../../../../types/openapi').AccessTypeEnum | undefined;
@@ -34,8 +34,15 @@ declare function prepareLinkFolderNodeData({ selectedItems, node, }: {
34
34
  selectedItems: SelectedFolder[];
35
35
  node?: ComponentNode<LinkProps>;
36
36
  }): LinkProps;
37
- declare function prepareMultimediaNodeData({ selectedItems, }: {
37
+ declare function prepareMultimediaNodeData({ selectedItems, assetType, }: {
38
38
  selectedItems: (SelectedExternalLink | SelectedAsset)[];
39
+ /**
40
+ * Which asset backend the picked file lives in — from `CanvasBuilderProps.assetType`. Defaults to
41
+ * `'pitcher_asset'` so every existing host is byte-identical; only the L&D course host passes
42
+ * `'ld_asset'` (T1.7b / PIT-7742), which is what makes Multimedia re-resolve the file's short-lived
43
+ * presigned URL at render instead of trusting the stored one.
44
+ */
45
+ assetType?: 'pitcher_asset' | 'ld_asset';
39
46
  }): {
40
47
  data: MultimediaProps;
41
48
  theme_meta?: Partial<ComponentNode['theme_meta']>;
@@ -5,7 +5,7 @@ export declare function useInstalledEmbeddables(): {
5
5
  installedEmbeddablesById: import('vue').Ref<Record<string, AppFile> | null, Record<string, AppFile> | null>;
6
6
  refetchedFor: Record<string, boolean>;
7
7
  shouldUseDeviceUrl: ComputedRef<boolean | undefined>;
8
- shortcuts: ComputedRef<Record<"edit" | "presentation" | "fullscreen", (EmbeddedAppShortcut & {
8
+ shortcuts: ComputedRef<Record<"fullscreen" | "edit" | "presentation", (EmbeddedAppShortcut & {
9
9
  appName: string;
10
10
  displayName: string;
11
11
  })[]>>;
@@ -1,6 +1,8 @@
1
1
  declare function toggleNavigatorDrawer(): void;
2
+ declare function defaultOpenNavigatorDrawer(): void;
2
3
  export default function (): {
3
4
  toggleNavigatorDrawer: typeof toggleNavigatorDrawer;
5
+ defaultOpenNavigatorDrawer: typeof defaultOpenNavigatorDrawer;
4
6
  isNavigatorDrawerOpen: import('vue').Ref<boolean, boolean>;
5
7
  };
6
8
  export {};
@@ -17,6 +17,7 @@ export declare function usePopupApps(): {
17
17
  readonly original_url: string | null;
18
18
  readonly thumbnail_url: string | null;
19
19
  download_type?: import('../../../main.lib').DownloadTypeEnum | undefined;
20
+ readonly downloaded_at?: string | null | undefined;
20
21
  readonly zip_size: number | null;
21
22
  readonly zip_url: string | null;
22
23
  access_type?: import('../../../main.lib').AccessTypeEnum | undefined;
@@ -480,6 +481,7 @@ export declare function usePopupApps(): {
480
481
  readonly original_url: string | null;
481
482
  readonly thumbnail_url: string | null;
482
483
  download_type?: import('../../../main.lib').DownloadTypeEnum | undefined;
484
+ readonly downloaded_at?: string | null | undefined;
483
485
  readonly zip_size: number | null;
484
486
  readonly zip_url: string | null;
485
487
  access_type?: import('../../../main.lib').AccessTypeEnum | undefined;
@@ -172,12 +172,33 @@ export interface CanvasFile {
172
172
  declare const MULTIMEDIA_IMG_TYPE: {
173
173
  readonly external: "external";
174
174
  readonly pitcher_asset: "pitcher_asset";
175
+ readonly ld_asset: "ld_asset";
175
176
  };
176
177
  export declare enum MultimediaHorizontalAlignmentOptions {
177
178
  LEFT = "left",
178
179
  CENTER = "center",
179
180
  RIGHT = "right"
180
181
  }
182
+ /**
183
+ * Where a Multimedia `poster_url` came from — shared by every asset variant, because a poster's origin is
184
+ * independent of the media's (an `external` video can carry an L&D-hosted poster).
185
+ *
186
+ * `poster_url` alone is unrefreshable: a short-lived source (an L&D presigned URL, 900s) rots and the
187
+ * canvas has no record of what it was, so nothing can re-resolve it — unlike `file.content_url`, which
188
+ * `Multimedia.vue` refreshes at render off `file.id`. Recording the id plus its backend is what keeps a
189
+ * poster recoverable.
190
+ *
191
+ * Both are absent for an external-link/Pexels poster (long-lived URL, no Pitcher id to resolve).
192
+ *
193
+ * `poster_asset_type` lives on the NODE rather than being read from host state at render, because the
194
+ * render path must work in COURSE (rep playback) — the mode where a poster is *guaranteed* to be past its
195
+ * TTL — and COURSE cannot supply `CanvasBuilderProps.assetType` at all (it's `?: never` there).
196
+ * (T1.7b / PIT-7742, R4-F1.)
197
+ */
198
+ type MultimediaPosterProvenance = {
199
+ poster_file_id?: string;
200
+ poster_asset_type?: 'pitcher_asset' | 'ld_asset';
201
+ };
181
202
  export type ExternalMultimediaAssetType = {
182
203
  asset_type: typeof MULTIMEDIA_IMG_TYPE.external;
183
204
  external_url: string;
@@ -186,7 +207,7 @@ export type ExternalMultimediaAssetType = {
186
207
  from?: 'custom' | 'pexels' | 'unsplash' | 'ai';
187
208
  poster_url?: string;
188
209
  poster_background_size?: BackgroundSize;
189
- };
210
+ } & MultimediaPosterProvenance;
190
211
  export type PitcherMultimediaAssetType = {
191
212
  asset_type: typeof MULTIMEDIA_IMG_TYPE.pitcher_asset;
192
213
  file: {
@@ -198,8 +219,20 @@ export type PitcherMultimediaAssetType = {
198
219
  horizontal_alignment?: MultimediaHorizontalAlignmentOptions;
199
220
  poster_url?: string;
200
221
  poster_background_size?: BackgroundSize;
201
- };
202
- export type MultimediaProps = ExternalMultimediaAssetType | PitcherMultimediaAssetType;
222
+ } & MultimediaPosterProvenance;
223
+ export interface LdMultimediaAssetType extends MultimediaPosterProvenance {
224
+ asset_type: typeof MULTIMEDIA_IMG_TYPE.ld_asset;
225
+ file: {
226
+ id: File['id'];
227
+ name: File['name'];
228
+ content_url?: File['content_url'];
229
+ };
230
+ type: 'image' | 'video';
231
+ horizontal_alignment?: MultimediaHorizontalAlignmentOptions;
232
+ poster_url?: string;
233
+ poster_background_size?: BackgroundSize;
234
+ }
235
+ export type MultimediaProps = ExternalMultimediaAssetType | PitcherMultimediaAssetType | LdMultimediaAssetType;
203
236
  export type ContentGridCommonFileProps = {
204
237
  id: FileRetrieve['id'];
205
238
  snapshot_id?: FileRetrieve['id'];
@@ -599,6 +632,7 @@ export type SharingBuilderProps = NoCRMBuilderProps & {
599
632
  };
600
633
  activeCanvas: CanvasRetrieve;
601
634
  onExit: () => void;
635
+ onEndCall?: () => void | Promise<void>;
602
636
  onSave?: never;
603
637
  onEnter?: () => void;
604
638
  onPageEnter?: (data: ComponentNode[], pageIndex: number) => void;
@@ -626,6 +660,7 @@ export type SharingBuilderProps = NoCRMBuilderProps & {
626
660
  listRecommendedFiles?: never;
627
661
  listCanvases?: never;
628
662
  fetchFolder?: never;
663
+ assetType?: never;
629
664
  fetchFile: (fileId: FileRetrieve['id']) => Promise<FileRetrieve>;
630
665
  fetchInstanceMetadataTemplate?: never;
631
666
  fetchCanvas?: (canvasId: CanvasRetrieve['id'], params?: Record<string, any>) => Promise<CanvasRetrieve>;
@@ -677,6 +712,7 @@ type AdminImpactCommonBuilderProps = {
677
712
  };
678
713
  activeCanvas: CanvasRetrieve;
679
714
  onExit: () => void;
715
+ onEndCall?: () => void | Promise<void>;
680
716
  onEnter?: () => void;
681
717
  onComponentEnter?: (data: ComponentNode | CanvasRetrieve, params: ComponentTrackingParams) => void;
682
718
  onComponentExit?: (data: ComponentNode | CanvasRetrieve, params: ComponentTrackingParams) => void;
@@ -735,6 +771,18 @@ type AdminImpactCommonBuilderProps = {
735
771
  isAnyTypeOfAdmin: boolean;
736
772
  canvasMetadata: CanvasMetadataRetrieve | null;
737
773
  hideEdit?: boolean;
774
+ /**
775
+ * Which asset backend the Assets tab's files come from, stamped onto a Multimedia node on selection
776
+ * (`prepareMultimediaNodeData`). Defaults to `'pitcher_asset'`, so every existing sales/DSR/admin
777
+ * mount is unchanged — only the L&D course host (course-canvas-host) opts into `'ld_asset'`.
778
+ *
779
+ * Lives on the Admin/Impact/Home common props because those are the only modes that can open the
780
+ * content selector; SHARING/COURSE type-block it with `?: never`.
781
+ *
782
+ * It does NOT affect rendering — Multimedia keys its render-time URL re-resolution off the node's
783
+ * own `asset_type`, so an `ld_asset` node renders correctly wherever it is mounted. (T1.7b/PIT-7742)
784
+ */
785
+ assetType?: 'pitcher_asset' | 'ld_asset';
738
786
  };
739
787
  type AdminBuilderProps = AdminImpactCommonBuilderProps & (CRMBuilderProps | NoCRMBuilderProps) & {
740
788
  isRedirectEvent?: never;
@@ -784,6 +832,7 @@ export type CourseBuilderProps = NoCRMBuilderProps & {
784
832
  };
785
833
  activeCanvas: CanvasRetrieve;
786
834
  onExit: () => void;
835
+ onEndCall?: () => void | Promise<void>;
787
836
  onSave?: (canvasId: CanvasRetrieve['id'], canvas: PatchedCanvasUpdateRequest & {
788
837
  fields?: string;
789
838
  include_expired_files?: boolean;
@@ -814,6 +863,7 @@ export type CourseBuilderProps = NoCRMBuilderProps & {
814
863
  listRecommendedFiles?: never;
815
864
  listCanvases?: never;
816
865
  fetchFolder?: never;
866
+ assetType?: never;
817
867
  fetchFile: (fileId: FileRetrieve['id']) => Promise<FileRetrieve>;
818
868
  fetchInstanceMetadataTemplate?: never;
819
869
  fetchCanvas?: (canvasId: CanvasRetrieve['id'], params?: Record<string, any>) => Promise<CanvasRetrieve>;
@@ -0,0 +1,107 @@
1
+ import { CanvasActions } from '../../../types/canvasActions';
2
+ import { AppFile } from '../../../types/app';
3
+ /** Installable-app name of the React pitchdeck wizard (PIT-7510). */
4
+ export declare const REACT_COMPLETION_WIZARD_APP_NAME = "pitchdeck-wizard-ng";
5
+ export interface ResolveCompletionWizardVariantParams {
6
+ /** `canvas.enable_react_completion_wizard` org/instance setting — opt-in, default off. */
7
+ isReactWizardSettingEnabled: boolean;
8
+ /** The React wizard app resolved to a loadable URL (installed or local dev override). */
9
+ isReactWizardAvailable: boolean;
10
+ /** The deck's admin config uses features the React wizard cannot honor yet (see below). */
11
+ hasUnsupportedConfig?: boolean;
12
+ }
13
+ /**
14
+ * PIT-7510: which completion-wizard implementation to render where the wizard opens today.
15
+ * The setting is the only switch (no LaunchDarkly flag); an enabled setting without an
16
+ * installed app — or a deck whose admin config the React wizard cannot honor — falls back
17
+ * to the Vue wizard so no flow is ever lost.
18
+ */
19
+ export declare function resolveCompletionWizardVariant(p: ResolveCompletionWizardVariantParams): 'vue' | 'react';
20
+ /**
21
+ * Admin group_selector config features the React wizard does not implement yet:
22
+ * repetition rules (slide repeats + salesforce-populator data binding) and visibility
23
+ * rules. Decks using them keep the vanilla wizard regardless of the setting.
24
+ */
25
+ export declare function hasUnsupportedGroupSelectorConfig(context: Record<string, unknown> | null | undefined): boolean;
26
+ /**
27
+ * Resolve the React wizard app's iframe URL: local dev override first (same mechanism as
28
+ * every installable app), else the installed app's `content_url`.
29
+ */
30
+ export declare function resolveReactCompletionWizardSrc(apps: AppFile[]): string | null;
31
+ /**
32
+ * PIT-7030: what cancelling the completion wizard means depends on how it was entered.
33
+ *
34
+ * Create flow (never-completed deck): cancel abandons the deck — the host emits
35
+ * `cancelCanvasCompletionWizard`, which slotty treats as "leave the canvas" (and deletes the
36
+ * deck when it came from the create-canvas modal).
37
+ *
38
+ * Edit flow (`completion_wizard.edited` — set by `retriggerWizard()`, i.e. the "Edit Wizard"
39
+ * button or the Edit-action auto-open): the wizard was opened over a deck that was already
40
+ * completed, and entering it persisted `completed: false`. Cancel must restore
41
+ * `completed: true` and reload into the canvas editor — exactly what the Vue wizard's
42
+ * `confirmCancel()` → `completeWizard()` does. Emitting the cancel event here instead exits
43
+ * the canvas entirely and leaves the deck stuck "In-progress" (the QA regression on the
44
+ * React wizard).
45
+ */
46
+ interface WizardCancelCanvasContext {
47
+ pitcher?: {
48
+ /** `edited` is written only by `retriggerWizard()` — the same signal the Vue wizard's `isEditWizard` reads. */
49
+ completion_wizard?: {
50
+ edited?: boolean;
51
+ completed?: boolean;
52
+ };
53
+ };
54
+ }
55
+ export declare function shouldCompleteWizardOnCancel(canvasContext: WizardCancelCanvasContext | null | undefined): boolean;
56
+ export declare function wasCompletionWizardAutoOpened(canvasId: string): boolean;
57
+ export declare function markCompletionWizardAutoOpened(canvasId: string | undefined): void;
58
+ /**
59
+ * Read AND clear the auto-opened marker (PIT-7510 QA Q12). The marker exists to survive the
60
+ * `window.location.reload()` that follows completing/cancelling the wizard — one page load.
61
+ * Left in place it suppressed every LATER Edit action for the rest of the browser session,
62
+ * so the wizard never auto-opened again. Consuming it on read keeps the reload covered
63
+ * (the fresh mount still sees it once) while the next explicit Edit navigation starts
64
+ * clean. Callers cache the consumed value per mount so re-running watcher ticks within the
65
+ * same mount stay suppressed.
66
+ */
67
+ export declare function consumeCompletionWizardAutoOpened(canvasId: string): boolean;
68
+ export interface ShouldAutoOpenCompletionWizardParams {
69
+ /** `canvas.enable_edit_opens_completion_wizard` org/instance setting — opt-in, default off. */
70
+ isSettingEnabled: boolean;
71
+ /** Impact only — the wizard is a rep-facing flow and `retriggerWizard()` bails elsewhere anyway. */
72
+ isImpact: boolean;
73
+ /** Canvases only, never templates / sections / blocks. */
74
+ isCanvas: boolean;
75
+ /** Canvas preview is read-only playback; never auto-open there. */
76
+ isCanvasPreviewMode: boolean;
77
+ /** The mode the builder was opened in (`metadata.startInMode`). */
78
+ startInMode?: CanvasActions;
79
+ /** Editing is unavailable: RBAC, `disable_canvas_edit_for_reps`, or a frozen canvas. */
80
+ hideEdit: boolean;
81
+ /** `canRetriggerWizard()` — the canvas has wizard steps AND the wizard is already completed. */
82
+ canRetriggerWizard: boolean;
83
+ /** Active canvas id — required so the caller can persist the per-canvas dedup marker. */
84
+ canvasId?: string;
85
+ /**
86
+ * Whether this canvas was already auto-opened in the CURRENT page load (PIT-7510 Q12). The
87
+ * caller reads this via `consumeCompletionWizardAutoOpened` — a read-and-clear `sessionStorage`
88
+ * marker (keyed by canvas id) rather than mount-local state, because the wizard completion path
89
+ * (`completeWizard()`) runs `window.location.reload()`, which remounts the whole builder. A
90
+ * mount-local flag would reset on that reload and the `{ immediate: true }` watcher would
91
+ * auto-reopen the wizard, producing the open→cancel→reload→reopen flash loop (PIT-7030). The
92
+ * marker is consumed per mount, so a LATER Edit open of the same deck auto-opens again.
93
+ */
94
+ alreadyAutoOpened: boolean;
95
+ }
96
+ /**
97
+ * PIT-7030: decide whether opening a canvas via the Edit action should reopen the completion
98
+ * wizard instead of landing in the canvas editor.
99
+ *
100
+ * Pure so the guard chain is unit-testable — the caller performs the (async, persisting)
101
+ * `retriggerWizard()` side effect.
102
+ *
103
+ * A never-completed deck already shows the wizard through `isCompletionWizardShowing`, so this
104
+ * only covers the completed case, which is what `canRetriggerWizard` encodes.
105
+ */
106
+ export declare function shouldAutoOpenCompletionWizard(p: ShouldAutoOpenCompletionWizardParams): boolean;
107
+ export {};
@@ -0,0 +1,7 @@
1
+ import { FullscreenMode } from '../../../types/organizationSettings.types';
2
+ /**
3
+ * The presentation fullscreen mode to use: the rep's explicit in-presentation
4
+ * choice wins; otherwise the org/instance default; otherwise 'fullscreen'
5
+ * (preserving PIT-7029's auto-enter-native behaviour).
6
+ */
7
+ export declare function resolvePresentationFullscreenMode(repChosen: FullscreenMode | null, defaultSetting: FullscreenMode | undefined): FullscreenMode;
@@ -0,0 +1,35 @@
1
+ import { CanvasSection } from '../../../../types/openapi';
2
+ /**
3
+ * Helpers for opt-in lazy section loading (`?lazy_sections=true`, PIT-7073).
4
+ *
5
+ * A lazy shell response carries ordered `section_ids` plus lightweight section
6
+ * STUBS — `{ id, name, thumbnail_url, metadata, is_draft, content: { data: [] } }`
7
+ * — so list views (ToC, section rail) render immediately while the real bodies
8
+ * stream in via the batch endpoint.
9
+ */
10
+ /**
11
+ * A stub carries an empty placeholder `content`; a hydrated body has components.
12
+ * This is how we tell "not fetched yet" from "fetched".
13
+ */
14
+ export declare const isHydratedSection: (section?: CanvasSection | null) => boolean;
15
+ /**
16
+ * Merge an incoming shell's sections over what we already hold, keeping any body
17
+ * we've already hydrated.
18
+ *
19
+ * A shell gets RE-APPLIED constantly: every embedded-app canvas update (each
20
+ * Shopping Cart change in the PRH apps) round-trips the canvas through the host,
21
+ * which hands back the lazy shell. Applying it verbatim would wipe the hydrated
22
+ * bodies, so the deck blanks and visibly BLINKS while it re-fetches them.
23
+ *
24
+ * Section bodies are separate canvases, so a deck-level update never invalidates
25
+ * them — carrying them forward is safe. An incoming section that IS hydrated
26
+ * always wins, so a genuine section refresh still lands.
27
+ */
28
+ export declare const preserveHydratedSections: (previous: CanvasSection[] | undefined, incoming: CanvasSection[]) => CanvasSection[];
29
+ /**
30
+ * The subset of `section_ids` that still needs fetching.
31
+ *
32
+ * Without this a re-applied shell would re-download every body on each
33
+ * interaction — on a 1k-section deck that's a full request storm per cart click.
34
+ */
35
+ export declare const pendingSectionIds: (sectionIds: string[], sections: CanvasSection[] | undefined) => string[];
@@ -0,0 +1,27 @@
1
+ interface SlideLike {
2
+ id: string;
3
+ }
4
+ interface GroupLike<S extends SlideLike> {
5
+ id: string;
6
+ slides: S[];
7
+ }
8
+ export interface FlatSlidePosition {
9
+ /** 1-based position of the active slide across the whole collection, or 0 when not found. */
10
+ number: number;
11
+ /** Total number of slides across every group in the collection. */
12
+ total: number;
13
+ }
14
+ /**
15
+ * Position of the active slide within the flattened collection (all groups' slides
16
+ * in order) — powers the content-viewer-style "N / M" page counter.
17
+ */
18
+ export declare const getFlatSlidePosition: <S extends SlideLike>(groups: GroupLike<S>[], activeGroupId: string | undefined, activeSlideId: string | undefined) => FlatSlidePosition;
19
+ /**
20
+ * Resolve a 1-based flat page number back to its group and slide, crossing group
21
+ * boundaries — the inverse of {@link getFlatSlidePosition}.
22
+ */
23
+ export declare const getSlideAtFlatPage: <G extends GroupLike<SlideLike>>(groups: G[], page: number) => {
24
+ group: G;
25
+ slide: G["slides"][number];
26
+ } | null;
27
+ export {};
@@ -10,6 +10,7 @@ import { ActionCallback, default as useKeyboardBindings } from '../composables/k
10
10
  import { default as useSlideDirection } from '../composables/slide-direction.use';
11
11
  import { useCacheNavigation } from '../composables/navigation-cache.use';
12
12
  import { useAnnotationLayer } from '../composables/annotation-layer.use';
13
+ import { FlatSlidePosition } from '../composables/collection-navigation.util';
13
14
  export type RenderPageAsImage = (payload: {
14
15
  fileId: File['id'];
15
16
  documentId?: File['id'];
@@ -61,7 +62,9 @@ type StoreData = {
61
62
  hasManyGroups: ComputedRef<boolean>;
62
63
  activeSlide: Ref<CollectionSlide | null>;
63
64
  activeGroup: Ref<CollectionGroup | null>;
65
+ slidePosition: ComputedRef<FlatSlidePosition>;
64
66
  setActiveSlide: (group?: CollectionGroup, slide?: CollectionSlide) => void;
67
+ setActiveFlatPage: (page: number) => void;
65
68
  onSlideChange: (customEvent: CustomEvent<[swiper: Swiper]>) => void;
66
69
  activatePreviousGroup: () => void;
67
70
  activateNextGroup: () => void;
@@ -2,7 +2,7 @@ import { Ref, ComputedRef, UnwrapNestedRefs } from 'vue';
2
2
  import { FolderRetrieve, FolderFile, FileRetrieve, File, FolderFolder, FileContentTypeEnum } from '../../../../types/openapi';
3
3
  import { ApiStore } from './api';
4
4
  export type AppName = 'admin' | 'impact';
5
- export type SelectorType = 'content' | 'assets' | 'external_links' | 'ai_images' | 'pexels_images' | 'theme' | `multimedia-selector-${string}`;
5
+ export type SelectorType = 'content' | 'assets' | 'external_links' | 'pexels_images' | 'theme' | `multimedia-selector-${string}`;
6
6
  export type SortOption = 'nameAsc' | 'nameDesc' | 'modifiedAsc' | 'modifiedDesc';
7
7
  export type SelectedPage = {
8
8
  id: string;
@@ -1,7 +1,11 @@
1
1
  import { Ref, ComputedRef } from 'vue';
2
- import { Instance, AnnotationsUnion } from 'pspdfkit';
2
+ import { Instance, AnnotationsUnion } from '@nutrient-sdk/viewer';
3
3
  import { CLIENT_TYPE } from '../../../constants/cdp.const';
4
4
  import { File } from '../../../../types/openapi';
5
+ export declare function stripSdkWrapper(text: string): string;
6
+ export declare function stripCorruption(text: string): string;
7
+ export declare function normalizeText(text: string): string;
8
+ export declare function needsCorruptionRepair(text: string): boolean;
5
9
  interface UseAnnotationsReturnType {
6
10
  annotations: Ref<AnnotationsUnion[]>;
7
11
  areAnnotationsModified: Ref<boolean>;
@@ -0,0 +1,8 @@
1
+ import { Ref, ComputedRef } from 'vue';
2
+ import { Instance } from '@nutrient-sdk/viewer';
3
+ interface UseFormFieldsReturnType {
4
+ areFormFieldValuesModified: ComputedRef<boolean>;
5
+ resetFormFieldChanges: () => void;
6
+ }
7
+ export declare function useFormFields(instance: Ref<Instance | undefined>): UseFormFieldsReturnType;
8
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { Ref, ComputedRef } from 'vue';
2
- import { Instance, AnnotationsUnion, List } from 'pspdfkit';
2
+ import { Instance, AnnotationsUnion, List } from '@nutrient-sdk/viewer';
3
3
  import { SaveLinkAnnotationPayload } from './CFileViewer.pdf.link.types';
4
4
  interface UseLinkAnnotationPayload {
5
5
  instance: Ref<Instance | undefined>;
@@ -1,5 +1,5 @@
1
1
  import { Ref } from 'vue';
2
- import { Instance } from 'pspdfkit';
2
+ import { Instance } from '@nutrient-sdk/viewer';
3
3
  import { FileRetrieve } from '../../../../types/openapi';
4
4
  interface UseOverlayItemsReturnType {
5
5
  setOverlayItemsForEmbeddedVideos: (currentPageIndex: number) => Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { Ref, ComputedRef } from 'vue';
2
2
  import { I18n } from 'vue-i18n';
3
- import { Instance, AnnotationsUnion } from 'pspdfkit';
3
+ import { Instance, AnnotationsUnion } from '@nutrient-sdk/viewer';
4
4
  import { AnnotationType } from '../CFileViewer.types';
5
5
  import { PitcherFile } from '../../../types/file.types';
6
6
  import { MiniPage, File, FileRetrieve } from '../../../../types/openapi';
@@ -27,6 +27,7 @@ interface FileViewerPdfReturnType {
27
27
  updateFileViewerSettings: (settings: Partial<typeof fileViewerSettings.value>) => void;
28
28
  cleanupPspdfKit: () => void;
29
29
  resetAnnotationChanges: () => void;
30
+ resetFormFieldChanges: () => void;
30
31
  isSearchOpen: Ref<boolean>;
31
32
  isThumbnailsOpen: Ref<boolean>;
32
33
  isTextAnnotationOpen: Ref<boolean>;
@@ -34,6 +35,7 @@ interface FileViewerPdfReturnType {
34
35
  currentPageIndex: Ref<number>;
35
36
  isAnnotationOpen: Ref<boolean>;
36
37
  areAnnotationsModified: Ref<boolean>;
38
+ areFormFieldValuesModified: ComputedRef<boolean>;
37
39
  selectedAnnotationType: Ref<Exclude<AnnotationType, 'text'>>;
38
40
  isSwitchingInteractionMode: Ref<boolean>;
39
41
  fileViewerSettings: typeof fileViewerSettings;
@@ -45,7 +47,7 @@ interface FileViewerPdfReturnType {
45
47
  onSaveLinkAnnotation: (data: SaveLinkAnnotationPayload) => void;
46
48
  hasHotspotsOnCurrentPage: Ref<boolean>;
47
49
  }
48
- declare const _default: ({ pdfViewerEl, bottomBarRef, i18n, appLocale, actions, assetsPrefix, clientType, context, pitcherSettings, launchDarkly, emit, fileId, fetchFileById, fetchDocumentInfo, }: {
50
+ declare const _default: ({ pdfViewerEl, bottomBarRef, i18n, appLocale, actions, assetsPrefix, clientType, context, pitcherSettings, launchDarkly, emit, fileId, fetchFileById, }: {
49
51
  pdfViewerEl: Ref<HTMLElement | null>;
50
52
  bottomBarRef: Ref<InstanceType<typeof CFileViewerBottomPdf> | null>;
51
53
  i18n: I18n;
@@ -59,12 +61,5 @@ declare const _default: ({ pdfViewerEl, bottomBarRef, i18n, appLocale, actions,
59
61
  fileId: ComputedRef<File["id"] | undefined>;
60
62
  emit: (name: string, ...args: any[]) => void;
61
63
  fetchFileById?: (id: FileRetrieve["id"]) => Promise<FileRetrieve>;
62
- fetchDocumentInfo?: (id: File["id"]) => Promise<{
63
- pageCount: number;
64
- pages?: Array<{
65
- width: number;
66
- height: number;
67
- }>;
68
- }>;
69
64
  }) => FileViewerPdfReturnType;
70
65
  export default _default;
@@ -1,4 +1,4 @@
1
- import { default as PSPDFKitType } from 'pspdfkit';
1
+ import { default as PSPDFKitType } from '@nutrient-sdk/viewer';
2
2
  /**
3
3
  * Tear down a PSPDFKit instance for a container without ever throwing.
4
4
  *
@@ -1,6 +1,6 @@
1
1
  import { Ref } from 'vue';
2
2
  import { MaybeRef } from '@vueuse/core';
3
- import { Instance } from 'pspdfkit';
3
+ import { Instance } from '@nutrient-sdk/viewer';
4
4
  import { default as CFileViewerBottomPdf } from './CFileViewerBottom.pdf.vue';
5
5
  declare const _default: ({ pdfViewerEl, bottomBarRef, instance, isThumbnailsOpen, isSearchOpen, }: {
6
6
  pdfViewerEl: MaybeRef<HTMLElement | null>;
@@ -4,6 +4,7 @@ export type FreezeStatus = 'active' | 'expired' | null;
4
4
  export declare function getFreezeStatus(canvas: Pick<CanvasRetrieve, 'metadata'>): FreezeStatus;
5
5
  export declare const SYSTEM_EXCLUDED_TAGS: readonly ["home", "share", "sharebox"];
6
6
  export declare function hasHidingTag(tags?: string[], dynamicTags?: string[]): boolean;
7
+ export declare function isTemplateHiddenFromReps(canvas: Pick<CanvasRetrieve, 'tags' | 'template'>, rendererExcludedTags?: string[]): boolean;
7
8
  export declare function useCSavedCanvasesManagement(): {
8
9
  statusOptions: {
9
10
  label: string;
@@ -7,5 +7,5 @@ import { AppFile } from '../types/app';
7
7
  */
8
8
  export declare function useCourseOnlyApps(): {
9
9
  allowCourseOnlyApps: boolean;
10
- isAppAllowed: (app: AppFile) => boolean;
10
+ isAppAllowedInHost: (app: AppFile) => boolean;
11
11
  };
@@ -1,7 +1,7 @@
1
- import { default as PSPDFKitType, ServerConfiguration } from 'pspdfkit';
1
+ import { default as PSPDFKitType, Configuration } from '@nutrient-sdk/viewer';
2
2
  declare function annotationsInterpolation({ PSPDFKit, config, data, }: {
3
3
  PSPDFKit: typeof PSPDFKitType;
4
- config: ServerConfiguration;
4
+ config: Configuration;
5
5
  data: Record<string, string>;
6
6
  }): Promise<void>;
7
7
  export default function usePdfInterpolation(strategy?: 'annotations' | 'text'): typeof annotationsInterpolation;