@social-mail/social-mail-client 1.2.305 → 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.
@@ -35325,10 +35325,10 @@ System.register(["tslib"], function (_export, _context) {
35325
35325
 
35326
35326
  AmdLoader.instance.setup("@social-mail/social-mail-client/dist/common/Modules");
35327
35327
 
35328
- 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) {
35328
+ 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) {
35329
35329
  "use strict";
35330
35330
 
35331
- var __awaiter, ContentPage, XNode, apiPath, styled, Bind, Modules, App, PreviewDocument, installStyleSheet;
35331
+ var __awaiter, ContentPage, XNode, IconButton, apiPath, styled, Bind, Modules, App, Form, FormField, PasswordBox, PreviewDocument, installStyleSheet;
35332
35332
  _export("default", void 0);
35333
35333
  return {
35334
35334
  setters: [function (_tslib) {
@@ -35337,6 +35337,8 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
35337
35337
  ContentPage = _webAtomsWebControlsDistMobileAppMobileApp.ContentPage;
35338
35338
  }, function (_webAtomsCoreDistCoreXNode) {
35339
35339
  XNode = _webAtomsCoreDistCoreXNode.default;
35340
+ }, function (_commonControlsButtonsIconButton) {
35341
+ IconButton = _commonControlsButtonsIconButton.IconButton;
35340
35342
  }, function (_commonApiPath) {
35341
35343
  apiPath = _commonApiPath.apiPath;
35342
35344
  }, function (_webAtomsCoreDistStyleStyled) {
@@ -35347,6 +35349,12 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
35347
35349
  Modules = _commonModules.default;
35348
35350
  }, function (_webAtomsCoreDistApp) {
35349
35351
  App = _webAtomsCoreDistApp.App;
35352
+ }, function (_webAtomsWebControlsDistBasicForm) {
35353
+ Form = _webAtomsWebControlsDistBasicForm.default;
35354
+ }, function (_webAtomsWebControlsDistBasicFormField) {
35355
+ FormField = _webAtomsWebControlsDistBasicFormField.default;
35356
+ }, function (_webAtomsWebControlsDistBasicPasswordBox) {
35357
+ PasswordBox = _webAtomsWebControlsDistBasicPasswordBox.default;
35350
35358
  }],
35351
35359
  execute: function () {
35352
35360
  styled.css`
@@ -35419,6 +35427,10 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
35419
35427
  left: 10px;
35420
35428
  top: 10px;
35421
35429
  }
35430
+ & > * {
35431
+ left: 10px;
35432
+ top: 10px;
35433
+ }
35422
35434
  }
35423
35435
  }
35424
35436
 
@@ -35490,6 +35502,7 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
35490
35502
  constructor() {
35491
35503
  super(...arguments);
35492
35504
  this.scale = 1;
35505
+ this.password = "";
35493
35506
  }
35494
35507
  init() {
35495
35508
  return __awaiter(this, void 0, void 0, function* () {
@@ -35499,6 +35512,7 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
35499
35512
  fileContentID,
35500
35513
  name
35501
35514
  } = this.parameters;
35515
+ this.title = name;
35502
35516
  const pdf = apiPath(`/api/files/pdf/${appFileID}/${fileContentID}/${name}/${name}.pdf`);
35503
35517
  const downloadUrl = apiPath(`/api/files/download/${appFileID}/${fileContentID}/${name}`);
35504
35518
  this.observer = new IntersectionObserver(entries => this.updateEntries(entries), {
@@ -35512,7 +35526,40 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
35512
35526
  pdfjsLib
35513
35527
  } = globalThis;
35514
35528
  pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://mozilla.github.io/pdf.js/build/pdf.worker.mjs';
35515
- const pdfDoc = yield pdfjsLib.getDocument(pdf).promise;
35529
+ const loaderTask = pdfjsLib.getDocument(pdf);
35530
+ let tries = 0;
35531
+ loaderTask.onPassword = (callback, reason) => {
35532
+ console.log(reason);
35533
+ tries++;
35534
+ if (tries > 3) {
35535
+ this.renderer = XNode.create("div", null, XNode.create("div", {
35536
+ "data-layout": "center-page-900px"
35537
+ }, "Failed..."));
35538
+ return;
35539
+ }
35540
+ this.renderer = XNode.create("div", null, XNode.create("div", {
35541
+ "data-layout": "center-page-900px"
35542
+ }, XNode.create(Form, {
35543
+ "event-submit-form": () => {
35544
+ const password = this.password;
35545
+ this.password = "";
35546
+ callback(password);
35547
+ }
35548
+ }, XNode.create("div", null, XNode.create("h4", {
35549
+ text: reason ? "Invalid Password, try again." : "Password is required to view this document."
35550
+ })), XNode.create(FormField, {
35551
+ label: "Password"
35552
+ }, XNode.create(PasswordBox, {
35553
+ type: "password",
35554
+ autofocus: true,
35555
+ value: Bind.twoWaysImmediate(() => this.password)
35556
+ })), XNode.create("div", null, XNode.create(IconButton, {
35557
+ type: "submit",
35558
+ disabled: Bind.oneWay(() => !this.password),
35559
+ text: "Open"
35560
+ })))));
35561
+ };
35562
+ const pdfDoc = yield loaderTask.promise;
35516
35563
  this.renderer = XNode.create("div", null, XNode.create("div", {
35517
35564
  class: "pdf-frame"
35518
35565
  }, XNode.create("div", {