box-content-preview 3.109.0 → 3.113.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/README.md +7 -7
- package/dist/lib/index.css +4 -4
- package/dist/lib/index.d.ts +28 -0
- package/dist/lib/index.js +716 -224
- package/package.json +2 -2
package/dist/lib/index.d.ts
CHANGED
|
@@ -29,6 +29,27 @@ export type PreviewEventName =
|
|
|
29
29
|
|
|
30
30
|
export type PreviewEventListener = (data?: any) => void;
|
|
31
31
|
|
|
32
|
+
export interface ComparisonBannerFile {
|
|
33
|
+
created_by?: { name?: string };
|
|
34
|
+
modified_at?: string;
|
|
35
|
+
modified_by?: { name?: string };
|
|
36
|
+
version_number?: string | number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Both panes get the same object; compared pane uses previousFileVersion. */
|
|
40
|
+
export interface ComparisonBannerVersions {
|
|
41
|
+
currentFileVersion?: ComparisonBannerFile;
|
|
42
|
+
previousFileVersion?: ComparisonBannerFile;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Partial update; only provided flags change. isComparedPreview implies isComparing. */
|
|
46
|
+
export interface ComparisonMode {
|
|
47
|
+
/** In a comparison (not “current pane”). Current = isComparing && !isComparedPreview. */
|
|
48
|
+
isComparing?: boolean;
|
|
49
|
+
/** Compared (previous version) pane. */
|
|
50
|
+
isComparedPreview?: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
32
53
|
export interface PreviewOptions {
|
|
33
54
|
apiHost?: string;
|
|
34
55
|
appHost?: string;
|
|
@@ -36,6 +57,7 @@ export interface PreviewOptions {
|
|
|
36
57
|
boxAnnotations?: any;
|
|
37
58
|
cache?: { inMemoryOnly?: boolean };
|
|
38
59
|
collection?: Array<string | BoxFile>;
|
|
60
|
+
comparisonBanner?: ComparisonBannerVersions;
|
|
39
61
|
container?: string | HTMLElement;
|
|
40
62
|
enableAnnotationsImageDiscoverability?: boolean;
|
|
41
63
|
enableThumbnailsSidebar?: boolean;
|
|
@@ -43,6 +65,10 @@ export interface PreviewOptions {
|
|
|
43
65
|
fixDependencies?: boolean;
|
|
44
66
|
header?: 'light' | 'dark' | 'none';
|
|
45
67
|
headerElement?: HTMLElement;
|
|
68
|
+
/** Compared (previous version) pane; implies isComparing. */
|
|
69
|
+
isComparedPreview?: boolean;
|
|
70
|
+
/** In a comparison (not “current pane”). */
|
|
71
|
+
isComparing?: boolean;
|
|
46
72
|
location?: { staticBaseURI?: string; version?: string; locale?: string };
|
|
47
73
|
logoUrl?: string;
|
|
48
74
|
pauseRequireJS?: boolean;
|
|
@@ -87,6 +113,8 @@ export class Preview {
|
|
|
87
113
|
|
|
88
114
|
hide(): void;
|
|
89
115
|
|
|
116
|
+
setComparisonMode(mode?: ComparisonMode): void;
|
|
117
|
+
|
|
90
118
|
reload(skipServerUpdate?: boolean): void;
|
|
91
119
|
|
|
92
120
|
resize(): void;
|