@dereekb/dbx-web 12.5.9 → 12.6.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/esm2022/lib/extension/download/blob/download.blob.button.component.mjs +86 -0
- package/esm2022/lib/extension/download/blob/index.mjs +2 -0
- package/esm2022/lib/extension/download/index.mjs +2 -1
- package/esm2022/lib/extension/download/text/download.text.component.mjs +20 -18
- package/esm2022/lib/extension/index.mjs +3 -1
- package/esm2022/lib/extension/model/model.tracker.mjs +1 -1
- package/esm2022/lib/extension/model/model.tracker.view.storage.mjs +3 -3
- package/esm2022/lib/extension/preview/index.mjs +4 -0
- package/esm2022/lib/extension/preview/webfilepreview.mjs +2 -0
- package/esm2022/lib/extension/preview/webfilepreview.service.mjs +60 -0
- package/esm2022/lib/extension/preview/webfilepreview.service.preset.mjs +31 -0
- package/esm2022/lib/extension/widget/widget.service.mjs +1 -1
- package/esm2022/lib/extension/zip/index.mjs +5 -0
- package/esm2022/lib/extension/zip/zip.blob.mjs +16 -0
- package/esm2022/lib/extension/zip/zip.blob.preview.component.mjs +156 -0
- package/esm2022/lib/extension/zip/zip.blob.preview.list.component.mjs +121 -0
- package/esm2022/lib/extension/zip/zip.preview.component.mjs +71 -0
- package/esm2022/lib/extension/zip/zip.preview.dialog.component.mjs +44 -0
- package/esm2022/lib/interaction/iframe/embed.component.mjs +104 -0
- package/esm2022/lib/interaction/iframe/embed.dialog.component.mjs +43 -0
- package/esm2022/lib/interaction/iframe/iframe.component.mjs +7 -4
- package/esm2022/lib/interaction/iframe/iframe.dialog.component.mjs +37 -0
- package/esm2022/lib/interaction/iframe/index.mjs +4 -1
- package/fesm2022/dereekb-dbx-web.mjs +4596 -3899
- package/fesm2022/dereekb-dbx-web.mjs.map +1 -1
- package/lib/extension/_extension.scss +19 -0
- package/lib/extension/download/blob/download.blob.button.component.d.ts +55 -0
- package/lib/extension/download/blob/index.d.ts +1 -0
- package/lib/extension/download/index.d.ts +1 -0
- package/lib/extension/download/text/download.text.component.d.ts +7 -7
- package/lib/extension/index.d.ts +2 -0
- package/lib/extension/model/model.tracker.d.ts +3 -3
- package/lib/extension/preview/index.d.ts +3 -0
- package/lib/extension/preview/webfilepreview.d.ts +13 -0
- package/lib/extension/preview/webfilepreview.service.d.ts +31 -0
- package/lib/extension/preview/webfilepreview.service.preset.d.ts +13 -0
- package/lib/extension/widget/widget.service.d.ts +1 -1
- package/lib/extension/zip/_zip.scss +35 -0
- package/lib/extension/zip/index.d.ts +4 -0
- package/lib/extension/zip/zip.blob.d.ts +9 -0
- package/lib/extension/zip/zip.blob.preview.component.d.ts +54 -0
- package/lib/extension/zip/zip.blob.preview.list.component.d.ts +25 -0
- package/lib/extension/zip/zip.preview.component.d.ts +31 -0
- package/lib/extension/zip/zip.preview.dialog.component.d.ts +17 -0
- package/lib/interaction/iframe/_iframe.scss +13 -0
- package/lib/interaction/iframe/embed.component.d.ts +31 -0
- package/lib/interaction/iframe/embed.dialog.component.d.ts +17 -0
- package/lib/interaction/iframe/iframe.component.d.ts +0 -1
- package/lib/interaction/iframe/iframe.dialog.component.d.ts +13 -0
- package/lib/interaction/iframe/index.d.ts +3 -0
- package/lib/layout/style/_style.scss +2 -1
- package/lib/style/_config.scss +7 -1
- package/package.json +3 -2
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
@use '../style/theming';
|
|
3
3
|
@use './calendar/calendar';
|
|
4
4
|
@use './table/table';
|
|
5
|
+
@use './zip/zip';
|
|
5
6
|
|
|
6
7
|
@mixin all-extension-core($theme-config) {
|
|
7
8
|
$calendar-enabled: 1;
|
|
8
9
|
$table-enabled: 1;
|
|
10
|
+
$zip-enabled: 1;
|
|
9
11
|
|
|
10
12
|
@if ($theme-config != null) {
|
|
11
13
|
$calendar-enabled: config.get-dbx-extension-calendar-enabled($theme-config);
|
|
12
14
|
$table-enabled: config.get-dbx-extension-table-enabled($theme-config);
|
|
15
|
+
$zip-enabled: config.get-dbx-extension-zip-enabled($theme-config);
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
@if ($calendar-enabled == 1) {
|
|
@@ -19,11 +22,16 @@
|
|
|
19
22
|
@if ($table-enabled == 1) {
|
|
20
23
|
@include table.core();
|
|
21
24
|
}
|
|
25
|
+
|
|
26
|
+
@if ($zip-enabled == 1) {
|
|
27
|
+
@include zip.core();
|
|
28
|
+
}
|
|
22
29
|
}
|
|
23
30
|
|
|
24
31
|
@mixin all-extension-typography($theme-config-or-typography-config) {
|
|
25
32
|
$calendar-enabled: 1;
|
|
26
33
|
$table-enabled: 1;
|
|
34
|
+
$zip-enabled: 1;
|
|
27
35
|
|
|
28
36
|
@if ($theme-config-or-typography-config != null) {
|
|
29
37
|
@if (theming.private-is-theme-object($theme-config-or-typography-config)) {
|
|
@@ -31,6 +39,7 @@
|
|
|
31
39
|
|
|
32
40
|
$calendar-enabled: config.get-dbx-extension-calendar-enabled($theme-config);
|
|
33
41
|
$table-enabled: config.get-dbx-extension-table-enabled($theme-config);
|
|
42
|
+
$zip-enabled: config.get-dbx-extension-zip-enabled($theme-config);
|
|
34
43
|
}
|
|
35
44
|
|
|
36
45
|
@if ($calendar-enabled == 1) {
|
|
@@ -40,16 +49,22 @@
|
|
|
40
49
|
@if ($table-enabled == 1) {
|
|
41
50
|
@include table.typography($theme-config-or-typography-config);
|
|
42
51
|
}
|
|
52
|
+
|
|
53
|
+
@if ($zip-enabled == 1) {
|
|
54
|
+
@include zip.typography($theme-config-or-typography-config);
|
|
55
|
+
}
|
|
43
56
|
}
|
|
44
57
|
}
|
|
45
58
|
|
|
46
59
|
@mixin all-extension-theme($theme-config) {
|
|
47
60
|
$calendar-enabled: 1;
|
|
48
61
|
$table-enabled: 1;
|
|
62
|
+
$zip-enabled: 1;
|
|
49
63
|
|
|
50
64
|
@if ($theme-config != null) {
|
|
51
65
|
$calendar-enabled: config.get-dbx-extension-calendar-enabled($theme-config);
|
|
52
66
|
$table-enabled: config.get-dbx-extension-table-enabled($theme-config);
|
|
67
|
+
$zip-enabled: config.get-dbx-extension-zip-enabled($theme-config);
|
|
53
68
|
}
|
|
54
69
|
|
|
55
70
|
@if ($calendar-enabled == 1) {
|
|
@@ -59,4 +74,8 @@
|
|
|
59
74
|
@if ($table-enabled == 1) {
|
|
60
75
|
@include table.theme($theme-config);
|
|
61
76
|
}
|
|
77
|
+
|
|
78
|
+
@if ($zip-enabled == 1) {
|
|
79
|
+
@include zip.theme($theme-config);
|
|
80
|
+
}
|
|
62
81
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ElementRef, OnDestroy } from '@angular/core';
|
|
2
|
+
import { SafeResourceUrl } from '@angular/platform-browser';
|
|
3
|
+
import { AbstractSubscriptionDirective, DbxButtonDisplay } from '@dereekb/dbx-core';
|
|
4
|
+
import { type DbxButtonStyle } from '../../../button/button.component';
|
|
5
|
+
import { Getter, Maybe, PromiseOrValue } from '@dereekb/util';
|
|
6
|
+
import { Observable } from 'rxjs';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export interface DbxDownloadBlobButtonConfig {
|
|
9
|
+
/**
|
|
10
|
+
* Button display customization.
|
|
11
|
+
*/
|
|
12
|
+
readonly buttonDisplay?: Maybe<DbxButtonDisplay>;
|
|
13
|
+
/**
|
|
14
|
+
* Custom button style to use.
|
|
15
|
+
*/
|
|
16
|
+
readonly buttonStyle?: Maybe<DbxButtonStyle>;
|
|
17
|
+
/**
|
|
18
|
+
* Name of the file to save when downloaded.
|
|
19
|
+
*/
|
|
20
|
+
readonly fileName?: Maybe<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Blob to download.
|
|
23
|
+
*/
|
|
24
|
+
readonly blob?: Maybe<Blob>;
|
|
25
|
+
/**
|
|
26
|
+
* Getter for the blob to download.
|
|
27
|
+
*/
|
|
28
|
+
readonly loadBlob?: Maybe<Getter<PromiseOrValue<Maybe<Blob>>>>;
|
|
29
|
+
/**
|
|
30
|
+
* Whether or not to preload the blob from the blobGetter instead of waiting for the button to be moused over.
|
|
31
|
+
*
|
|
32
|
+
* Ignored if blobGetter is not provided.
|
|
33
|
+
*/
|
|
34
|
+
readonly preloadBlob?: Maybe<boolean>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Button used for downloading an arbitrary blob based on the input configuration.
|
|
38
|
+
*/
|
|
39
|
+
export declare class DbxDownloadBlobButtonComponent extends AbstractSubscriptionDirective implements OnDestroy {
|
|
40
|
+
private readonly _sanitizer;
|
|
41
|
+
private readonly _browserObjectUrl;
|
|
42
|
+
readonly config: import("@angular/core").InputSignal<Maybe<DbxDownloadBlobButtonConfig>>;
|
|
43
|
+
readonly downloadButton: import("@angular/core").Signal<Maybe<ElementRef<any>>>;
|
|
44
|
+
readonly config$: Observable<Maybe<DbxDownloadBlobButtonConfig>>;
|
|
45
|
+
readonly blob$: Observable<Maybe<Blob>>;
|
|
46
|
+
readonly blobSignal: import("@angular/core").Signal<Maybe<Blob>>;
|
|
47
|
+
readonly fileUrlSignal: import("@angular/core").Signal<SafeResourceUrl | undefined>;
|
|
48
|
+
readonly fileNameSignal: import("@angular/core").Signal<string>;
|
|
49
|
+
readonly downloadReadySignal: import("@angular/core").Signal<boolean>;
|
|
50
|
+
readonly buttonDisplaySignal: import("@angular/core").Signal<DbxButtonDisplay>;
|
|
51
|
+
readonly buttonStyleSignal: import("@angular/core").Signal<DbxButtonStyle>;
|
|
52
|
+
ngOnDestroy(): void;
|
|
53
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxDownloadBlobButtonComponent, never>;
|
|
54
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxDownloadBlobButtonComponent, "dbx-download-blob-button", never, { "config": { "alias": "config"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './download.blob.button.component';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ElementRef } from '@angular/core';
|
|
1
|
+
import { ElementRef, OnDestroy } from '@angular/core';
|
|
2
2
|
import { WorkUsingObservable, LoadingState, MaybeObservableOrValue } from '@dereekb/rxjs';
|
|
3
3
|
import { type Maybe } from '@dereekb/util';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { DownloadTextContent } from './download.text';
|
|
6
|
-
import { SafeResourceUrl } from '@angular/platform-browser';
|
|
7
6
|
import { AbstractSubscriptionDirective } from '@dereekb/dbx-core';
|
|
7
|
+
import { DbxDownloadBlobButtonConfig } from '../blob/download.blob.button.component';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* View for previewing and downloading arbitrary text content.
|
|
11
11
|
*/
|
|
12
|
-
export declare class DbxDownloadTextViewComponent extends AbstractSubscriptionDirective {
|
|
12
|
+
export declare class DbxDownloadTextViewComponent extends AbstractSubscriptionDirective implements OnDestroy {
|
|
13
13
|
private readonly _clipboard;
|
|
14
14
|
private readonly _matSnackbar;
|
|
15
|
-
private readonly
|
|
15
|
+
private readonly _browserObjectUrl;
|
|
16
16
|
readonly downloadButton: import("@angular/core").Signal<Maybe<ElementRef<any>>>;
|
|
17
17
|
readonly loadingText: import("@angular/core").InputSignal<Maybe<string>>;
|
|
18
18
|
readonly linear: import("@angular/core").InputSignal<Maybe<boolean>>;
|
|
@@ -27,11 +27,11 @@ export declare class DbxDownloadTextViewComponent extends AbstractSubscriptionDi
|
|
|
27
27
|
readonly content$: Observable<Maybe<DownloadTextContent>>;
|
|
28
28
|
readonly contentSignal: import("@angular/core").Signal<Maybe<DownloadTextContent>>;
|
|
29
29
|
readonly contentDataSignal: import("@angular/core").Signal<string | undefined>;
|
|
30
|
-
readonly fileUrlSignal: import("@angular/core").Signal<SafeResourceUrl | undefined>;
|
|
31
30
|
readonly fileNameSignal: import("@angular/core").Signal<string>;
|
|
32
|
-
readonly
|
|
31
|
+
readonly downloadConfigSignal: import("@angular/core").Signal<DbxDownloadBlobButtonConfig | undefined>;
|
|
33
32
|
readonly context: import("@dereekb/rxjs").MutableLoadingStateContext<unknown, LoadingState<DownloadTextContent>, import("@dereekb/rxjs").LoadingContextEvent & LoadingState<DownloadTextContent>>;
|
|
34
33
|
readonly handleCopyToClipboard: WorkUsingObservable;
|
|
34
|
+
ngOnDestroy(): void;
|
|
35
35
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxDownloadTextViewComponent, never>;
|
|
36
36
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxDownloadTextViewComponent, "dbx-download-text-view", never, { "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "linear": { "alias": "linear"; "required": false; "isSignal": true; }; "showTitle": { "alias": "showTitle"; "required": false; "isSignal": true; }; "showPreview": { "alias": "showPreview"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "contentState": { "alias": "contentState"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
37
37
|
}
|
package/lib/extension/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Maybe, type ModelKey, type ModelKeyTypeNamePair, type UnixDateTimeSecondsNumber } from '@dereekb/util';
|
|
2
2
|
/**
|
|
3
3
|
* String context in which a model was viewed.
|
|
4
4
|
*/
|
|
@@ -7,7 +7,7 @@ export interface DbxModelViewTrackerEvent {
|
|
|
7
7
|
/**
|
|
8
8
|
* Event time
|
|
9
9
|
*/
|
|
10
|
-
readonly d?:
|
|
10
|
+
readonly d?: UnixDateTimeSecondsNumber;
|
|
11
11
|
/**
|
|
12
12
|
* Context
|
|
13
13
|
*/
|
|
@@ -22,7 +22,7 @@ export interface DbxModelViewTrackerEventSet {
|
|
|
22
22
|
/**
|
|
23
23
|
* The latest date/time number.
|
|
24
24
|
*/
|
|
25
|
-
readonly l:
|
|
25
|
+
readonly l: UnixDateTimeSecondsNumber;
|
|
26
26
|
/**
|
|
27
27
|
* List of events.
|
|
28
28
|
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type MatDialog, type MatDialogRef } from '@angular/material/dialog';
|
|
2
|
+
import { type WebsiteUrlWithPrefix, type Maybe, type ContentTypeMimeType, type ArrayOrValue, type MimeTypeWithoutParameters } from '@dereekb/util';
|
|
3
|
+
/**
|
|
4
|
+
* Used for previewing a src url and embedMimeType.
|
|
5
|
+
*/
|
|
6
|
+
export type DbxWebFilePreviewServicePreviewFunction = (matDialog: MatDialog, srcUrl: WebsiteUrlWithPrefix, embedMimeType?: Maybe<ContentTypeMimeType | string>) => MatDialogRef<any, any>;
|
|
7
|
+
export interface DbxWebFilePreviewServiceEntry {
|
|
8
|
+
/**
|
|
9
|
+
* The MimeType(s) to associate the preview function with.
|
|
10
|
+
*/
|
|
11
|
+
readonly mimeType: ArrayOrValue<MimeTypeWithoutParameters | string>;
|
|
12
|
+
readonly previewFunction: DbxWebFilePreviewServicePreviewFunction;
|
|
13
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
|
3
|
+
import { WebsiteUrlWithPrefix, Maybe, ContentTypeMimeType, MimeTypeWithoutParameters, ArrayOrValue } from '@dereekb/util';
|
|
4
|
+
import { DbxWebFilePreviewServiceEntry, DbxWebFilePreviewServicePreviewFunction } from './webfilepreview';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Default entries to inject.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DBX_WEB_FILE_PREVIEW_SERVICE_ENTRIES_TOKEN: InjectionToken<DbxWebFilePreviewServiceEntry[]>;
|
|
10
|
+
export declare function provideDbxWebFilePreviewServiceEntries(entries: DbxWebFilePreviewServiceEntry[]): {
|
|
11
|
+
provide: InjectionToken<DbxWebFilePreviewServiceEntry[]>;
|
|
12
|
+
useValue: DbxWebFilePreviewServiceEntry[];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Service used for previewing files with given mime types.
|
|
16
|
+
*/
|
|
17
|
+
export declare class DbxWebFilePreviewService {
|
|
18
|
+
readonly matDialog: MatDialog;
|
|
19
|
+
private readonly _entries;
|
|
20
|
+
constructor(entries: DbxWebFilePreviewServiceEntry[]);
|
|
21
|
+
private _defaultPreviewFunction;
|
|
22
|
+
registerPreviewEntries(entries: ArrayOrValue<DbxWebFilePreviewServiceEntry>): void;
|
|
23
|
+
/**
|
|
24
|
+
* Registers a preview function for the given mime type(s).
|
|
25
|
+
*/
|
|
26
|
+
registerPreviewFunctions(mimeType: ArrayOrValue<MimeTypeWithoutParameters | string>, previewFunction: DbxWebFilePreviewServicePreviewFunction): void;
|
|
27
|
+
setDefaultPreviewFunction(previewFunction: DbxWebFilePreviewServicePreviewFunction): void;
|
|
28
|
+
openPreviewDialog(srcUrl: WebsiteUrlWithPrefix, embedMimeType?: Maybe<ContentTypeMimeType | string>): MatDialogRef<any, any>;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxWebFilePreviewService, [{ optional: true; }]>;
|
|
30
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DbxWebFilePreviewService>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type DbxWebFilePreviewServiceEntry, type DbxWebFilePreviewServicePreviewFunction } from './webfilepreview';
|
|
2
|
+
/**
|
|
3
|
+
* Default preset for previewing a file using a DbxEmbedDialogComponent.
|
|
4
|
+
*/
|
|
5
|
+
export declare const DBX_WEB_FILE_PREVIEW_SERVICE_DEFAULT_PRESET: DbxWebFilePreviewServicePreviewFunction;
|
|
6
|
+
/**
|
|
7
|
+
* Preset for previewing a zip file using a DbxZipPreviewDialogComponent.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DBX_WEB_FILE_PREVIEW_SERVICE_ZIP_PRESET: DbxWebFilePreviewServicePreviewFunction;
|
|
10
|
+
/**
|
|
11
|
+
* DbxWebFilePreviewServiceEntry for previewing a zip file using a DbxZipPreviewDialogComponent.
|
|
12
|
+
*/
|
|
13
|
+
export declare const DBX_WEB_FILE_PREVIEW_SERVICE_ZIP_PRESET_ENTRY: DbxWebFilePreviewServiceEntry;
|
|
@@ -16,7 +16,7 @@ export interface DbxWidgetEntry {
|
|
|
16
16
|
* Service used to register widgets.
|
|
17
17
|
*/
|
|
18
18
|
export declare class DbxWidgetService {
|
|
19
|
-
private _entries;
|
|
19
|
+
private readonly _entries;
|
|
20
20
|
/**
|
|
21
21
|
* Used to register an entry. If an entry with the same type is already registered, this will override it by default.
|
|
22
22
|
*
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../style/theming';
|
|
3
|
+
|
|
4
|
+
// MARK: Variables
|
|
5
|
+
$dbx-zip-blob-preview-toolbar-height: 36px;
|
|
6
|
+
$dbx-zip-blob-preview-path-height: 28px;
|
|
7
|
+
|
|
8
|
+
// MARK: Mixin
|
|
9
|
+
@mixin core() {
|
|
10
|
+
.dbx-zip-blob-preview-content {
|
|
11
|
+
height: calc(100% - #{$dbx-zip-blob-preview-toolbar-height} - #{$dbx-zip-blob-preview-path-height});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@mixin color($theme-config) {
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@mixin typography($theme-config-or-typography-config) {
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@mixin theme($theme-config) {
|
|
22
|
+
@include theming.private-check-duplicate-theme-styles($theme-config, 'dbx-zip') {
|
|
23
|
+
$color: theming.m2-get-color-config($theme-config);
|
|
24
|
+
$density: theming.m2-get-density-config($theme-config);
|
|
25
|
+
$typography: theming.m2-get-typography-config($theme-config);
|
|
26
|
+
|
|
27
|
+
@if $color !=null {
|
|
28
|
+
@include color($theme-config);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@if $typography !=null {
|
|
32
|
+
@include typography($theme-config);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type MimeTypeWithoutParameters, type SlashPathDirectoryTreeNode, type SlashPathDirectoryTreeNodeValue, type SlashPathDirectoryTreeRoot, type Maybe, type Getter } from '@dereekb/util';
|
|
2
|
+
import { type Entry } from '@zip.js/zip.js';
|
|
3
|
+
export type DbxZipBlobPreviewEntryNodeValue<T extends Entry = Entry> = SlashPathDirectoryTreeNodeValue<T> & {
|
|
4
|
+
readonly mimeType: Maybe<MimeTypeWithoutParameters>;
|
|
5
|
+
readonly getBlob?: Getter<Promise<Blob>>;
|
|
6
|
+
};
|
|
7
|
+
export type DbxZipBlobPreviewEntryTreeNode<T extends Entry = Entry> = SlashPathDirectoryTreeNode<T, DbxZipBlobPreviewEntryNodeValue<T>>;
|
|
8
|
+
export type DbxZipBlobPreviewEntryTreeRoot = SlashPathDirectoryTreeRoot<Entry, DbxZipBlobPreviewEntryNodeValue<Entry>>;
|
|
9
|
+
export declare function dbxZipBlobPreviewEntryTreeFromEntries(entries: Maybe<Entry[]>): DbxZipBlobPreviewEntryTreeRoot;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Signal, OnDestroy } from '@angular/core';
|
|
2
|
+
import { Maybe } from '@dereekb/util';
|
|
3
|
+
import { ZipReader, Entry, FileEntry } from '@zip.js/zip.js';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
import { LoadingState } from '@dereekb/rxjs';
|
|
6
|
+
import { DbxZipBlobPreviewEntryTreeNode } from './zip.blob';
|
|
7
|
+
import { DbxListTitleGroupData, DbxListTitleGroupTitleDelegate } from '../../layout';
|
|
8
|
+
import { AnchorForValueFunction } from '../../router';
|
|
9
|
+
import { DbxDownloadBlobButtonConfig } from '../download/blob/download.blob.button.component';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
export type DbxZipBlobPreviewMode = 'view_directory' | 'view_entry';
|
|
12
|
+
export type DbxZipBlobPreviewGroupValue = 'directory' | 'file';
|
|
13
|
+
export type DbxZipBlobPreviewGroupData = DbxListTitleGroupData<DbxZipBlobPreviewGroupValue> & {
|
|
14
|
+
sort: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Used to display a zip preview based on the input blob.
|
|
18
|
+
*/
|
|
19
|
+
export declare class DbxZipBlobPreviewComponent implements OnDestroy {
|
|
20
|
+
readonly blob: import("@angular/core").InputSignal<Maybe<Blob>>;
|
|
21
|
+
/**
|
|
22
|
+
* The download file name for the zip file.
|
|
23
|
+
*
|
|
24
|
+
* If not defined, then the file cannot be downloaded directly.
|
|
25
|
+
*/
|
|
26
|
+
readonly downloadFileName: import("@angular/core").InputSignal<Maybe<string>>;
|
|
27
|
+
readonly hasBlob: Signal<boolean>;
|
|
28
|
+
readonly zipReader: Signal<ZipReader<unknown> | undefined>;
|
|
29
|
+
readonly downloadZipFileBlobButtonConfigSignal: Signal<DbxDownloadBlobButtonConfig | undefined>;
|
|
30
|
+
readonly zipReader$: Observable<ZipReader<unknown> | undefined>;
|
|
31
|
+
readonly allEntriesLoadingState$: Observable<LoadingState<Entry[]>>;
|
|
32
|
+
readonly allEntries$: Observable<Maybe<Entry[]>>;
|
|
33
|
+
readonly allEntriesRoot$: Observable<import("./zip.blob").DbxZipBlobPreviewEntryTreeRoot>;
|
|
34
|
+
readonly allEntriesRootSignal: Signal<import("./zip.blob").DbxZipBlobPreviewEntryTreeRoot | undefined>;
|
|
35
|
+
readonly selectedNodeSignal: import("@angular/core").WritableSignal<Maybe<DbxZipBlobPreviewEntryTreeNode>>;
|
|
36
|
+
readonly listTitleGroupDelegate: DbxListTitleGroupTitleDelegate<DbxZipBlobPreviewEntryTreeNode, DbxZipBlobPreviewGroupValue, DbxZipBlobPreviewGroupData>;
|
|
37
|
+
readonly mode: Signal<string>;
|
|
38
|
+
readonly listEntries: Signal<DbxZipBlobPreviewEntryTreeNode[]>;
|
|
39
|
+
readonly listEntries$: Observable<DbxZipBlobPreviewEntryTreeNode[]>;
|
|
40
|
+
readonly listEntriesState$: Observable<LoadingState<DbxZipBlobPreviewEntryTreeNode[]>>;
|
|
41
|
+
readonly selectedNodeIconSignal: Signal<string>;
|
|
42
|
+
readonly selectedNodePathSignal: Signal<string>;
|
|
43
|
+
readonly selectedFileNodeSignal: Signal<Maybe<DbxZipBlobPreviewEntryTreeNode<FileEntry>>>;
|
|
44
|
+
readonly selectedFileEntry$: Observable<Maybe<DbxZipBlobPreviewEntryTreeNode<FileEntry>>>;
|
|
45
|
+
readonly selectedFileEntryBlob$: Observable<Maybe<Blob>>;
|
|
46
|
+
readonly selectedFileEntryBlobSignal: Signal<Maybe<Blob>>;
|
|
47
|
+
readonly context: import("@dereekb/rxjs").MutableLoadingStateContext<unknown, LoadingState<Entry[]>, import("@dereekb/rxjs").LoadingContextEvent & LoadingState<Entry[]>>;
|
|
48
|
+
ngOnDestroy(): void;
|
|
49
|
+
readonly makeEntryAnchor: AnchorForValueFunction<DbxZipBlobPreviewEntryTreeNode>;
|
|
50
|
+
readonly homeClicked: () => void;
|
|
51
|
+
readonly backClicked: () => void;
|
|
52
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxZipBlobPreviewComponent, never>;
|
|
53
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxZipBlobPreviewComponent, "dbx-zip-blob-preview", never, { "blob": { "alias": "blob"; "required": false; "isSignal": true; }; "downloadFileName": { "alias": "downloadFileName"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
54
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DbxValueAsListItem, AbstractDbxSelectionListWrapperDirective, AbstractDbxSelectionListViewDirective, DbxSelectionValueListViewConfig, AbstractDbxValueListViewItemComponent } from '../../layout';
|
|
2
|
+
import { DbxZipBlobPreviewEntryTreeNode } from './zip.blob';
|
|
3
|
+
import { DbxDownloadBlobButtonConfig } from '../download/blob/download.blob.button.component';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export type DbxZipPreviewEntryWithSelection = DbxValueAsListItem<DbxZipBlobPreviewEntryTreeNode>;
|
|
6
|
+
export declare function iconForDbxZipPreviewEntryWithSelection(entry: DbxZipBlobPreviewEntryTreeNode): "folder" | "note" | "question_mark";
|
|
7
|
+
export declare class DbxZipPreviewEntryListComponent extends AbstractDbxSelectionListWrapperDirective<DbxZipPreviewEntryWithSelection> {
|
|
8
|
+
constructor();
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxZipPreviewEntryListComponent, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxZipPreviewEntryListComponent, "dbx-zip-preview-file-entry-list", never, {}, {}, never, ["[top]", "[bottom]", "[empty]", "[emptyLoading]", "[end]"], true, never>;
|
|
11
|
+
}
|
|
12
|
+
export declare class DbxZipPreviewEntryListViewComponent extends AbstractDbxSelectionListViewDirective<DbxZipPreviewEntryWithSelection> {
|
|
13
|
+
readonly config: DbxSelectionValueListViewConfig<DbxZipPreviewEntryWithSelection>;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxZipPreviewEntryListViewComponent, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxZipPreviewEntryListViewComponent, "dbx-zip-preview-file-entry-list-view", never, {}, {}, never, never, true, never>;
|
|
16
|
+
}
|
|
17
|
+
export declare class DbxZipPreviewEntryListViewItemComponent extends AbstractDbxValueListViewItemComponent<DbxZipPreviewEntryWithSelection> {
|
|
18
|
+
get name(): string;
|
|
19
|
+
get lastModDate(): Date;
|
|
20
|
+
get isDirectory(): boolean;
|
|
21
|
+
get canDownload(): boolean;
|
|
22
|
+
get downloadBlobButtonConfig(): DbxDownloadBlobButtonConfig;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxZipPreviewEntryListViewItemComponent, never>;
|
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxZipPreviewEntryListViewItemComponent, "dbx-zip-preview-file-entry-list-view-item", never, {}, {}, never, never, true, never>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { Maybe } from '@dereekb/util';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { LoadingState } from '@dereekb/rxjs';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Used to display a corresponding widget based on the input data.
|
|
8
|
+
*/
|
|
9
|
+
export declare class DbxZipPreviewComponent implements OnDestroy {
|
|
10
|
+
/**
|
|
11
|
+
* The URL to download the zip file from, if applicable.
|
|
12
|
+
*/
|
|
13
|
+
readonly srcUrl: import("@angular/core").InputSignal<Maybe<string>>;
|
|
14
|
+
/**
|
|
15
|
+
* The blob to use for the zip file, if applicable.
|
|
16
|
+
*/
|
|
17
|
+
readonly blob: import("@angular/core").InputSignal<Maybe<Blob>>;
|
|
18
|
+
/**
|
|
19
|
+
* The file name to use for the zip file.
|
|
20
|
+
*/
|
|
21
|
+
readonly downloadFileName: import("@angular/core").InputSignal<Maybe<string>>;
|
|
22
|
+
readonly srcUrl$: Observable<Maybe<string>>;
|
|
23
|
+
readonly blob$: Observable<Maybe<Blob>>;
|
|
24
|
+
readonly zipFileBlobLoadingState$: Observable<LoadingState<Blob>>;
|
|
25
|
+
readonly zipFileBlob$: Observable<Maybe<Blob>>;
|
|
26
|
+
readonly zipFileBlobSignal: import("@angular/core").Signal<Maybe<Blob>>;
|
|
27
|
+
readonly context: import("@dereekb/rxjs").MutableLoadingStateContext<unknown, LoadingState<Blob>, import("@dereekb/rxjs").LoadingContextEvent & LoadingState<Blob>>;
|
|
28
|
+
ngOnDestroy(): void;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxZipPreviewComponent, never>;
|
|
30
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxZipPreviewComponent, "dbx-zip-preview", never, { "srcUrl": { "alias": "srcUrl"; "required": false; "isSignal": true; }; "blob": { "alias": "blob"; "required": false; "isSignal": true; }; "downloadFileName": { "alias": "downloadFileName"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MatDialog, MatDialogRef, MatDialogConfig } from '@angular/material/dialog';
|
|
2
|
+
import { WebsiteUrlWithPrefix, Maybe } from '@dereekb/util';
|
|
3
|
+
import { AbstractDialogDirective } from '../../interaction/dialog';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export interface DbxZipPreviewDialogConfig extends Omit<MatDialogConfig, 'data'> {
|
|
6
|
+
readonly srcUrl?: Maybe<WebsiteUrlWithPrefix>;
|
|
7
|
+
readonly blob?: Maybe<Blob>;
|
|
8
|
+
readonly downloadFileName?: Maybe<string>;
|
|
9
|
+
}
|
|
10
|
+
export declare class DbxZipPreviewDialogComponent extends AbstractDialogDirective<void, DbxZipPreviewDialogConfig> {
|
|
11
|
+
get srcUrl(): Maybe<string>;
|
|
12
|
+
get blob(): Maybe<Blob>;
|
|
13
|
+
get downloadFileName(): Maybe<string>;
|
|
14
|
+
static openDialog(matDialog: MatDialog, config: DbxZipPreviewDialogConfig): MatDialogRef<DbxZipPreviewDialogComponent, void>;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxZipPreviewDialogComponent, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxZipPreviewDialogComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
17
|
+
}
|
|
@@ -14,6 +14,19 @@ $dbx-iframe-height-var: --dbx-iframe-height;
|
|
|
14
14
|
height: 100%;
|
|
15
15
|
width: 100%;
|
|
16
16
|
}
|
|
17
|
+
|
|
18
|
+
dbx-embed embed {
|
|
19
|
+
// because of the way embed works, the embed element itself must have weight/height set, but this can cause issues with images.
|
|
20
|
+
height: 100%;
|
|
21
|
+
width: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
dbx-embed embed.embed-image {
|
|
25
|
+
// This class aims to retain the original aspect ratio of the image while ensuring it does not overflow the container.
|
|
26
|
+
width: unset;
|
|
27
|
+
max-width: 100%;
|
|
28
|
+
max-height: 100%;
|
|
29
|
+
}
|
|
17
30
|
}
|
|
18
31
|
|
|
19
32
|
@mixin color($theme-config) {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ElementRef, OnDestroy } from '@angular/core';
|
|
2
|
+
import { Maybe } from '@dereekb/util';
|
|
3
|
+
import { AbstractSubscriptionDirective } from '@dereekb/dbx-core';
|
|
4
|
+
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class DbxEmbedComponent extends AbstractSubscriptionDirective implements OnDestroy {
|
|
7
|
+
private readonly _browserObjectUrlRef;
|
|
8
|
+
readonly sanitizer: DomSanitizer;
|
|
9
|
+
readonly root: import("@angular/core").Signal<ElementRef<HTMLSpanElement> | undefined>;
|
|
10
|
+
readonly sanitizeUrl: import("@angular/core").InputSignal<Maybe<boolean>>;
|
|
11
|
+
readonly srcUrl: import("@angular/core").InputSignal<Maybe<string | SafeResourceUrl>>;
|
|
12
|
+
readonly type: import("@angular/core").InputSignal<Maybe<string>>;
|
|
13
|
+
/**
|
|
14
|
+
* The input src blob or media source to use.
|
|
15
|
+
*
|
|
16
|
+
* If set, the srcUrl will be updated with the browser object URL.
|
|
17
|
+
*/
|
|
18
|
+
readonly srcBlob: import("@angular/core").InputSignal<Maybe<Blob>>;
|
|
19
|
+
readonly srcUrlFromBlob: import("@angular/core").WritableSignal<Maybe<string>>;
|
|
20
|
+
readonly typeFromBlob: import("@angular/core").WritableSignal<Maybe<string>>;
|
|
21
|
+
readonly srcBlobEffect: import("@angular/core").EffectRef;
|
|
22
|
+
readonly srcUrlSignal: import("@angular/core").Signal<Maybe<string | SafeResourceUrl>>;
|
|
23
|
+
readonly typeSignal: import("@angular/core").Signal<Maybe<string>>;
|
|
24
|
+
readonly root$: import("rxjs").Observable<ElementRef<HTMLSpanElement> | undefined>;
|
|
25
|
+
readonly srcUrl$: import("rxjs").Observable<Maybe<string | SafeResourceUrl>>;
|
|
26
|
+
readonly type$: import("rxjs").Observable<Maybe<string>>;
|
|
27
|
+
constructor();
|
|
28
|
+
ngOnDestroy(): void;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxEmbedComponent, never>;
|
|
30
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxEmbedComponent, "dbx-embed", never, { "sanitizeUrl": { "alias": "sanitizeUrl"; "required": false; "isSignal": true; }; "srcUrl": { "alias": "srcUrl"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "srcBlob": { "alias": "srcBlob"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MatDialog, MatDialogRef, MatDialogConfig } from '@angular/material/dialog';
|
|
2
|
+
import { ContentTypeMimeType, Maybe, WebsiteUrlWithPrefix } from '@dereekb/util';
|
|
3
|
+
import { AbstractDialogDirective } from '../dialog/abstract.dialog.directive';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export interface DbxEmbedDialogConfig extends Omit<MatDialogConfig, 'data'> {
|
|
6
|
+
readonly srcUrl: WebsiteUrlWithPrefix;
|
|
7
|
+
readonly embedMimeType?: Maybe<ContentTypeMimeType | string>;
|
|
8
|
+
readonly sanitizeUrl?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class DbxEmbedDialogComponent extends AbstractDialogDirective<void, DbxEmbedDialogConfig> {
|
|
11
|
+
get type(): Maybe<string>;
|
|
12
|
+
get srcUrl(): string;
|
|
13
|
+
get sanitizeUrl(): boolean | undefined;
|
|
14
|
+
static openDialog(matDialog: MatDialog, config: DbxEmbedDialogConfig): MatDialogRef<DbxEmbedDialogComponent, void>;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxEmbedDialogComponent, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxEmbedDialogComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
17
|
+
}
|
|
@@ -4,7 +4,6 @@ import { Maybe } from '@dereekb/util';
|
|
|
4
4
|
import { AbstractSubscriptionDirective } from '@dereekb/dbx-core';
|
|
5
5
|
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
-
export declare const DBX_IFRAME_COMPONENT_TEMPLATE = "<iframe #iframe src=\"about:blank\" frameborder=\"0\" [scrolling]=\"scrolling()\" allow=\"autoplay\"></iframe>";
|
|
8
7
|
export declare class DbxIframeComponent extends AbstractSubscriptionDirective implements OnDestroy {
|
|
9
8
|
readonly sanitizer: DomSanitizer;
|
|
10
9
|
readonly iframeLocationChanged: import("@angular/core").OutputEmitterRef<ElementRef<HTMLIFrameElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MatDialog, MatDialogRef, MatDialogConfig } from '@angular/material/dialog';
|
|
2
|
+
import { WebsiteUrlWithPrefix } from '@dereekb/util';
|
|
3
|
+
import { AbstractDialogDirective } from '../dialog/abstract.dialog.directive';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export interface DbxIframeDialogConfig extends Omit<MatDialogConfig, 'data'> {
|
|
6
|
+
readonly contentUrl: WebsiteUrlWithPrefix;
|
|
7
|
+
}
|
|
8
|
+
export declare class DbxIframeDialogComponent extends AbstractDialogDirective<void, DbxIframeDialogConfig> {
|
|
9
|
+
get contentUrl(): string;
|
|
10
|
+
static openDialog(matDialog: MatDialog, config: DbxIframeDialogConfig): MatDialogRef<DbxIframeDialogComponent, void>;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxIframeDialogComponent, never>;
|
|
12
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxIframeDialogComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
13
|
+
}
|
package/lib/style/_config.scss
CHANGED
|
@@ -192,7 +192,9 @@ $default-notice-color: #f28600;
|
|
|
192
192
|
// calendar enabled by default
|
|
193
193
|
'calendar': 1,
|
|
194
194
|
// table enabled by default
|
|
195
|
-
'table': 1
|
|
195
|
+
'table': 1,
|
|
196
|
+
// zip enabled by default
|
|
197
|
+
'zip': 1
|
|
196
198
|
);
|
|
197
199
|
|
|
198
200
|
@if ($input-dbx-theme-extension-config != null) {
|
|
@@ -217,3 +219,7 @@ $default-notice-color: #f28600;
|
|
|
217
219
|
@function get-dbx-extension-table-enabled($theme-config) {
|
|
218
220
|
@return get-dbx-extension-config-var($theme-config, 'table');
|
|
219
221
|
}
|
|
222
|
+
|
|
223
|
+
@function get-dbx-extension-zip-enabled($theme-config) {
|
|
224
|
+
@return get-dbx-extension-config-var($theme-config, 'zip');
|
|
225
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/dbx-web",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.6.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^18.0.0",
|
|
6
6
|
"@angular/core": "^18.0.0",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"@angular/platform-browser": "^18.0.0",
|
|
22
22
|
"@uirouter/angular": "15.0.0",
|
|
23
23
|
"change-case-all": "^2.1.0",
|
|
24
|
-
"class-validator": "^0.14.0"
|
|
24
|
+
"class-validator": "^0.14.0",
|
|
25
|
+
"@zip.js/zip.js": "^2.8.0"
|
|
25
26
|
},
|
|
26
27
|
"dependencies": {
|
|
27
28
|
"tslib": "^2.3.0"
|