@social-mail/social-mail-client 1.2.306 → 1.2.307
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/dist/admin/AdminAppIndex.pack.js +46 -3
- package/dist/admin/AdminAppIndex.pack.js.map +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js +2 -2
- package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web/AppIndex.pack.js +46 -3
- package/dist/web/AppIndex.pack.js.map +1 -1
- package/dist/web/AppIndex.pack.min.js +2 -2
- package/dist/web/AppIndex.pack.min.js.map +1 -1
- package/dist/web/page/files/preview/document/PreviewPDF.d.ts +1 -0
- package/dist/web/page/files/preview/document/PreviewPDF.d.ts.map +1 -1
- package/dist/web/page/files/preview/document/PreviewPDF.js +46 -3
- package/dist/web/page/files/preview/document/PreviewPDF.js.map +1 -1
- package/package.json +1 -1
- package/src/web/page/files/preview/document/PreviewPDF.tsx +54 -2
|
@@ -52679,10 +52679,10 @@ System.register(["tslib"], function (_export, _context) {
|
|
|
52679
52679
|
|
|
52680
52680
|
AmdLoader.instance.setup("@social-mail/social-mail-client/dist/common/Modules");
|
|
52681
52681
|
|
|
52682
|
-
System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "@web-atoms/core/dist/core/XNode", "../../../../../common/apiPath", "@web-atoms/core/dist/style/styled", "@web-atoms/core/dist/core/Bind", "../../../../../common/Modules", "@web-atoms/core/dist/App"], function (_export, _context) {
|
|
52682
|
+
System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "@web-atoms/core/dist/core/XNode", "../../../../../common/controls/buttons/IconButton", "../../../../../common/apiPath", "@web-atoms/core/dist/style/styled", "@web-atoms/core/dist/core/Bind", "../../../../../common/Modules", "@web-atoms/core/dist/App", "@web-atoms/web-controls/dist/basic/Form", "@web-atoms/web-controls/dist/basic/FormField", "@web-atoms/web-controls/dist/basic/PasswordBox"], function (_export, _context) {
|
|
52683
52683
|
"use strict";
|
|
52684
52684
|
|
|
52685
|
-
var __awaiter, ContentPage, XNode, apiPath, styled, Bind, Modules, App, PreviewDocument, installStyleSheet;
|
|
52685
|
+
var __awaiter, ContentPage, XNode, IconButton, apiPath, styled, Bind, Modules, App, Form, FormField, PasswordBox, PreviewDocument, installStyleSheet;
|
|
52686
52686
|
_export("default", void 0);
|
|
52687
52687
|
return {
|
|
52688
52688
|
setters: [function (_tslib) {
|
|
@@ -52691,6 +52691,8 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
|
|
|
52691
52691
|
ContentPage = _webAtomsWebControlsDistMobileAppMobileApp.ContentPage;
|
|
52692
52692
|
}, function (_webAtomsCoreDistCoreXNode) {
|
|
52693
52693
|
XNode = _webAtomsCoreDistCoreXNode.default;
|
|
52694
|
+
}, function (_commonControlsButtonsIconButton) {
|
|
52695
|
+
IconButton = _commonControlsButtonsIconButton.IconButton;
|
|
52694
52696
|
}, function (_commonApiPath) {
|
|
52695
52697
|
apiPath = _commonApiPath.apiPath;
|
|
52696
52698
|
}, function (_webAtomsCoreDistStyleStyled) {
|
|
@@ -52701,6 +52703,12 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
|
|
|
52701
52703
|
Modules = _commonModules.default;
|
|
52702
52704
|
}, function (_webAtomsCoreDistApp) {
|
|
52703
52705
|
App = _webAtomsCoreDistApp.App;
|
|
52706
|
+
}, function (_webAtomsWebControlsDistBasicForm) {
|
|
52707
|
+
Form = _webAtomsWebControlsDistBasicForm.default;
|
|
52708
|
+
}, function (_webAtomsWebControlsDistBasicFormField) {
|
|
52709
|
+
FormField = _webAtomsWebControlsDistBasicFormField.default;
|
|
52710
|
+
}, function (_webAtomsWebControlsDistBasicPasswordBox) {
|
|
52711
|
+
PasswordBox = _webAtomsWebControlsDistBasicPasswordBox.default;
|
|
52704
52712
|
}],
|
|
52705
52713
|
execute: function () {
|
|
52706
52714
|
styled.css`
|
|
@@ -52848,6 +52856,7 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
|
|
|
52848
52856
|
constructor() {
|
|
52849
52857
|
super(...arguments);
|
|
52850
52858
|
this.scale = 1;
|
|
52859
|
+
this.password = "";
|
|
52851
52860
|
}
|
|
52852
52861
|
init() {
|
|
52853
52862
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -52857,6 +52866,7 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
|
|
|
52857
52866
|
fileContentID,
|
|
52858
52867
|
name
|
|
52859
52868
|
} = this.parameters;
|
|
52869
|
+
this.title = name;
|
|
52860
52870
|
const pdf = apiPath(`/api/files/pdf/${appFileID}/${fileContentID}/${name}/${name}.pdf`);
|
|
52861
52871
|
const downloadUrl = apiPath(`/api/files/download/${appFileID}/${fileContentID}/${name}`);
|
|
52862
52872
|
this.observer = new IntersectionObserver(entries => this.updateEntries(entries), {
|
|
@@ -52870,7 +52880,40 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
|
|
|
52870
52880
|
pdfjsLib
|
|
52871
52881
|
} = globalThis;
|
|
52872
52882
|
pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://mozilla.github.io/pdf.js/build/pdf.worker.mjs';
|
|
52873
|
-
const
|
|
52883
|
+
const loaderTask = pdfjsLib.getDocument(pdf);
|
|
52884
|
+
let tries = 0;
|
|
52885
|
+
loaderTask.onPassword = (callback, reason) => {
|
|
52886
|
+
console.log(reason);
|
|
52887
|
+
tries++;
|
|
52888
|
+
if (tries > 3) {
|
|
52889
|
+
this.renderer = XNode.create("div", null, XNode.create("div", {
|
|
52890
|
+
"data-layout": "center-page-900px"
|
|
52891
|
+
}, "Failed..."));
|
|
52892
|
+
return;
|
|
52893
|
+
}
|
|
52894
|
+
this.renderer = XNode.create("div", null, XNode.create("div", {
|
|
52895
|
+
"data-layout": "center-page-900px"
|
|
52896
|
+
}, XNode.create(Form, {
|
|
52897
|
+
"event-submit-form": () => {
|
|
52898
|
+
const password = this.password;
|
|
52899
|
+
this.password = "";
|
|
52900
|
+
callback(password);
|
|
52901
|
+
}
|
|
52902
|
+
}, XNode.create("div", null, XNode.create("h4", {
|
|
52903
|
+
text: reason ? "Invalid Password, try again." : "Password is required to view this document."
|
|
52904
|
+
})), XNode.create(FormField, {
|
|
52905
|
+
label: "Password"
|
|
52906
|
+
}, XNode.create(PasswordBox, {
|
|
52907
|
+
type: "password",
|
|
52908
|
+
autofocus: true,
|
|
52909
|
+
value: Bind.twoWaysImmediate(() => this.password)
|
|
52910
|
+
})), XNode.create("div", null, XNode.create(IconButton, {
|
|
52911
|
+
type: "submit",
|
|
52912
|
+
disabled: Bind.oneWay(() => !this.password),
|
|
52913
|
+
text: "Open"
|
|
52914
|
+
})))));
|
|
52915
|
+
};
|
|
52916
|
+
const pdfDoc = yield loaderTask.promise;
|
|
52874
52917
|
this.renderer = XNode.create("div", null, XNode.create("div", {
|
|
52875
52918
|
class: "pdf-frame"
|
|
52876
52919
|
}, XNode.create("div", {
|