@social-mail/social-mail-client 1.0.21 → 1.0.22
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 +11 -0
- package/dist/admin/AdminAppIndex.pack.js.map +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
- package/dist/common/controls/html/InlineHtmlEditorWithToolbar.js +85 -7
- package/dist/common/controls/html/InlineHtmlEditorWithToolbar.js.map +1 -1
- package/dist/services/files/LocalFileService.js +11 -0
- package/dist/services/files/LocalFileService.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web/AppIndex.pack.js +451 -394
- package/dist/web/AppIndex.pack.js.map +1 -1
- package/dist/web/AppIndex.pack.min.js +46 -34
- package/dist/web/AppIndex.pack.min.js.map +1 -1
- package/dist/web/page/mails/ComposeMailPage.js +1 -1
- package/dist/web/page/mails/ComposeMailPage.js.map +1 -1
- package/dist/web/page/mails/MailsPage.js +1 -1
- package/dist/web/page/mails/MailsPage.js.map +1 -1
- package/node_modules/@web-atoms/web-controls/dist/html-editor/InlineHtmlEditor.d.ts +1 -1
- package/node_modules/@web-atoms/web-controls/dist/html-editor/InlineHtmlEditor.d.ts.map +1 -1
- package/node_modules/@web-atoms/web-controls/dist/html-editor/InlineHtmlEditor.js +29 -2
- package/node_modules/@web-atoms/web-controls/dist/html-editor/InlineHtmlEditor.js.map +1 -1
- package/node_modules/@web-atoms/web-controls/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@web-atoms/web-controls/package.json +1 -1
- package/node_modules/@web-atoms/web-controls/src/html-editor/InlineHtmlEditor.tsx +37 -2
- package/package.json +2 -2
- package/src/common/controls/html/InlineHtmlEditorWithToolbar.tsx +78 -3
- package/src/services/files/LocalFileService.tsx +5 -0
- package/src/web/page/mails/ComposeMailPage.tsx +1 -1
- package/src/web/page/mails/MailsPage.tsx +1 -1
|
@@ -1864,7 +1864,7 @@ const UMD = new UMDClass();
|
|
|
1864
1864
|
|
|
1865
1865
|
AmdLoader.instance.register(
|
|
1866
1866
|
["@social-mail/social-mail-client","@web-atoms/core","reflect-metadata","@web-atoms/web-controls","@web-atoms/date-time","@web-atoms/entity","@web-atoms/data-styles"],
|
|
1867
|
-
["@social-mail/social-mail-client/dist/web/AppIndex","@web-atoms/core/dist/core/InjectProperty","@web-atoms/core/dist/core/XNode","@web-atoms/core/dist/core/Bind","@web-atoms/core/dist/core/ExpressionParser","@web-atoms/core/dist/core/types","reflect-metadata","@web-atoms/core/dist/core/AtomMap","@web-atoms/core/dist/Pack","@web-atoms/web-controls/dist/desktop-app/MobileDesktopApp","@web-atoms/web-controls/dist/mobile-app/MobileApp","@web-atoms/core/dist/core/AtomLoader","@web-atoms/core/dist/services/JsonService","@web-atoms/core/dist/core/StringHelper","@web-atoms/core/dist/di/RegisterSingleton","@web-atoms/core/dist/di/Register","@web-atoms/core/dist/di/ServiceCollection","@web-atoms/core/dist/di/TypeKey","@web-atoms/date-time/dist/DateTime","@web-atoms/date-time/dist/TimeSpan","@web-atoms/core/dist/services/ReferenceService","@web-atoms/core/dist/di/DISingleton","@web-atoms/core/dist/core/AtomUri","@web-atoms/core/dist/web/core/AtomUI","@web-atoms/core/dist/core/Command","@web-atoms/core/dist/core/EventScope","@web-atoms/core/dist/core/Route","@web-atoms/core/dist/core/InheritedProperty","@web-atoms/core/dist/core/AtomBinder","@web-atoms/core/dist/core/sleep","@web-atoms/core/dist/services/NavigationService","@web-atoms/core/dist/core/AtomComponent","@web-atoms/core/dist/App","@web-atoms/core/dist/core/AtomDispatcher","@web-atoms/core/dist/di/ServiceProvider","@web-atoms/core/dist/core/TransientDisposable","@web-atoms/core/dist/di/Inject","@web-atoms/core/dist/services/BusyIndicatorService","@web-atoms/core/dist/core/AtomBridge","@web-atoms/core/dist/core/AtomDisposableList","@web-atoms/core/dist/core/AtomWatcher","@web-atoms/core/dist/core/PropertyMap","@web-atoms/core/dist/core/FormattedString","@web-atoms/core/dist/web/controls/AtomControl","@web-atoms/core/dist/core/BindableProperty","@web-atoms/core/dist/core/WebImage","@web-atoms/core/dist/web/styles/AtomStyle","@web-atoms/core/dist/web/styles/AtomStyleSheet","@web-atoms/core/dist/web/services/PopupService","@web-atoms/core/dist/style/styled","@web-atoms/core/dist/web/services/PopupWindow","@web-atoms/web-controls/dist/PageNavigator","@web-atoms/web-controls/dist/desktop-app/DesktopApp","@social-mail/social-mail-client/dist/web/commands/AppCommands","@social-mail/social-mail-client/dist/web/page/home/HomePage","@social-mail/social-mail-client/dist/common/pages/mailboxes/MailboxListPage","@web-atoms/web-controls/dist/basic/AtomRepeater","@web-atoms/core/dist/core/Colors","@web-atoms/core/dist/core/WatchProperty","@web-atoms/web-controls/dist/basic/InlinePopup","@web-atoms/web-controls/dist/basic/styles/inline-popup-style","@web-atoms/web-controls/dist/basic/MergeNode","@web-atoms/web-controls/dist/basic/ItemPath","@web-atoms/web-controls/dist/basic/styles/ui-display-none-style","@web-atoms/web-controls/dist/basic/styles/popup-style","@web-atoms/web-controls/dist/basic/styles/suggestion-popup","@web-atoms/web-controls/dist/basic/styles/repeater-style","@social-mail/social-mail-client/dist/common/controls/repeater/InfiniteRepeater","@social-mail/social-mail-client/dist/common/pages/mailboxes/services/MailboxService","@web-atoms/core/dist/di/DITransient","@social-mail/social-mail-client/dist/services/EntityService","@web-atoms/entity/dist/services/BaseEntityService","@web-atoms/entity/dist/models/Cloner","@web-atoms/entity/dist/models/cloneSource","@web-atoms/entity/dist/models/IEntityModel","@web-atoms/entity/dist/services/HttpSession","@web-atoms/core/dist/services/http/JsonError","@web-atoms/entity/dist/services/mergeProperties","@web-atoms/entity/dist/services/Query","@web-atoms/entity/dist/services/StringHelper","@web-atoms/entity/dist/services/resolve","@social-mail/social-mail-client/dist/services/BusyProgress","@social-mail/social-mail-client/dist/model/model","@social-mail/social-mail-client/dist/common/Sql","@web-atoms/core/dist/view-model/Action","@social-mail/social-mail-client/dist/common/pages/mailboxes/MailboxEditorPage","@web-atoms/web-controls/dist/basic/Form","@social-mail/social-mail-client/dist/common/controls/form/RequiredFormField","@web-atoms/web-controls/dist/basic/FormField","@web-atoms/web-controls/dist/basic/styles/form-field-style","@web-atoms/web-controls/dist/basic/PasswordBox","@web-atoms/web-controls/dist/basic/styles/password-box-style","@web-atoms/web-controls/dist/basic/ComboBox","@social-mail/social-mail-client/dist/common/NumberFormats","@social-mail/social-mail-client/dist/web/page/mails/MailsPage","@web-atoms/web-controls/dist/basic/DropDown","@web-atoms/web-controls/dist/basic/styles/drop-down-style","@social-mail/social-mail-client/dist/web/page/mails/service/MailService","@web-atoms/web-controls/dist/mobile-app/MasterDetailPage","@social-mail/social-mail-client/dist/web/page/mails/ConversationPage","@social-mail/social-mail-client/dist/web/page/mails/service/ConversationService","@social-mail/social-mail-client/dist/web/page/mails/ComposeMailPage","@social-mail/social-mail-client/dist/common/controls/html/InlineHtmlEditorWithToolbar","@web-atoms/web-controls/dist/html-editor/InlineHtmlEditor","@web-atoms/data-styles/data-styles","@web-atoms/web-controls/dist/html-editor/commands/AddImage","@web-atoms/web-controls/dist/html-editor/commands/CommandButton","@web-atoms/web-controls/dist/html-editor/commands/HtmlCommands","@web-atoms/web-controls/dist/html-editor/commands/Toolbar","@web-atoms/web-controls/dist/html-editor/commands/Bold","@web-atoms/web-controls/dist/html-editor/commands/Command","@web-atoms/web-controls/dist/html-editor/commands/Italic","@web-atoms/web-controls/dist/html-editor/commands/Underline","@web-atoms/web-controls/dist/html-editor/commands/StrikeThrough","@web-atoms/web-controls/dist/html-editor/commands/Align","@web-atoms/web-controls/dist/basic/PopupButton","@web-atoms/web-controls/dist/basic/styles/popup-button-style","@web-atoms/web-controls/dist/html-editor/commands/HorizontalRule","@web-atoms/web-controls/dist/html-editor/commands/Separator","@web-atoms/web-controls/dist/html-editor/commands/Headings","@web-atoms/web-controls/dist/html-editor/commands/ChangeColor","@web-atoms/web-controls/dist/html-editor/commands/ChangeFont","@web-atoms/web-controls/dist/html-editor/commands/ChangeFontSize","@web-atoms/web-controls/dist/html-editor/commands/NumberedList","@web-atoms/web-controls/dist/html-editor/commands/UnorderedList","@web-atoms/web-controls/dist/html-editor/commands/IndentLess","@web-atoms/web-controls/dist/html-editor/commands/IndentMore","@web-atoms/web-controls/dist/html-editor/commands/
|
|
1867
|
+
["@social-mail/social-mail-client/dist/web/AppIndex","@web-atoms/core/dist/core/InjectProperty","@web-atoms/core/dist/core/XNode","@web-atoms/core/dist/core/Bind","@web-atoms/core/dist/core/ExpressionParser","@web-atoms/core/dist/core/types","reflect-metadata","@web-atoms/core/dist/core/AtomMap","@web-atoms/core/dist/Pack","@web-atoms/web-controls/dist/desktop-app/MobileDesktopApp","@web-atoms/web-controls/dist/mobile-app/MobileApp","@web-atoms/core/dist/core/AtomLoader","@web-atoms/core/dist/services/JsonService","@web-atoms/core/dist/core/StringHelper","@web-atoms/core/dist/di/RegisterSingleton","@web-atoms/core/dist/di/Register","@web-atoms/core/dist/di/ServiceCollection","@web-atoms/core/dist/di/TypeKey","@web-atoms/date-time/dist/DateTime","@web-atoms/date-time/dist/TimeSpan","@web-atoms/core/dist/services/ReferenceService","@web-atoms/core/dist/di/DISingleton","@web-atoms/core/dist/core/AtomUri","@web-atoms/core/dist/web/core/AtomUI","@web-atoms/core/dist/core/Command","@web-atoms/core/dist/core/EventScope","@web-atoms/core/dist/core/Route","@web-atoms/core/dist/core/InheritedProperty","@web-atoms/core/dist/core/AtomBinder","@web-atoms/core/dist/core/sleep","@web-atoms/core/dist/services/NavigationService","@web-atoms/core/dist/core/AtomComponent","@web-atoms/core/dist/App","@web-atoms/core/dist/core/AtomDispatcher","@web-atoms/core/dist/di/ServiceProvider","@web-atoms/core/dist/core/TransientDisposable","@web-atoms/core/dist/di/Inject","@web-atoms/core/dist/services/BusyIndicatorService","@web-atoms/core/dist/core/AtomBridge","@web-atoms/core/dist/core/AtomDisposableList","@web-atoms/core/dist/core/AtomWatcher","@web-atoms/core/dist/core/PropertyMap","@web-atoms/core/dist/core/FormattedString","@web-atoms/core/dist/web/controls/AtomControl","@web-atoms/core/dist/core/BindableProperty","@web-atoms/core/dist/core/WebImage","@web-atoms/core/dist/web/styles/AtomStyle","@web-atoms/core/dist/web/styles/AtomStyleSheet","@web-atoms/core/dist/web/services/PopupService","@web-atoms/core/dist/style/styled","@web-atoms/core/dist/web/services/PopupWindow","@web-atoms/web-controls/dist/PageNavigator","@web-atoms/web-controls/dist/desktop-app/DesktopApp","@social-mail/social-mail-client/dist/web/commands/AppCommands","@social-mail/social-mail-client/dist/web/page/home/HomePage","@social-mail/social-mail-client/dist/common/pages/mailboxes/MailboxListPage","@web-atoms/web-controls/dist/basic/AtomRepeater","@web-atoms/core/dist/core/Colors","@web-atoms/core/dist/core/WatchProperty","@web-atoms/web-controls/dist/basic/InlinePopup","@web-atoms/web-controls/dist/basic/styles/inline-popup-style","@web-atoms/web-controls/dist/basic/MergeNode","@web-atoms/web-controls/dist/basic/ItemPath","@web-atoms/web-controls/dist/basic/styles/ui-display-none-style","@web-atoms/web-controls/dist/basic/styles/popup-style","@web-atoms/web-controls/dist/basic/styles/suggestion-popup","@web-atoms/web-controls/dist/basic/styles/repeater-style","@social-mail/social-mail-client/dist/common/controls/repeater/InfiniteRepeater","@social-mail/social-mail-client/dist/common/pages/mailboxes/services/MailboxService","@web-atoms/core/dist/di/DITransient","@social-mail/social-mail-client/dist/services/EntityService","@web-atoms/entity/dist/services/BaseEntityService","@web-atoms/entity/dist/models/Cloner","@web-atoms/entity/dist/models/cloneSource","@web-atoms/entity/dist/models/IEntityModel","@web-atoms/entity/dist/services/HttpSession","@web-atoms/core/dist/services/http/JsonError","@web-atoms/entity/dist/services/mergeProperties","@web-atoms/entity/dist/services/Query","@web-atoms/entity/dist/services/StringHelper","@web-atoms/entity/dist/services/resolve","@social-mail/social-mail-client/dist/services/BusyProgress","@social-mail/social-mail-client/dist/model/model","@social-mail/social-mail-client/dist/common/Sql","@web-atoms/core/dist/view-model/Action","@social-mail/social-mail-client/dist/common/pages/mailboxes/MailboxEditorPage","@web-atoms/web-controls/dist/basic/Form","@social-mail/social-mail-client/dist/common/controls/form/RequiredFormField","@web-atoms/web-controls/dist/basic/FormField","@web-atoms/web-controls/dist/basic/styles/form-field-style","@web-atoms/web-controls/dist/basic/PasswordBox","@web-atoms/web-controls/dist/basic/styles/password-box-style","@web-atoms/web-controls/dist/basic/ComboBox","@social-mail/social-mail-client/dist/common/NumberFormats","@social-mail/social-mail-client/dist/web/page/mails/MailsPage","@web-atoms/web-controls/dist/basic/DropDown","@web-atoms/web-controls/dist/basic/styles/drop-down-style","@social-mail/social-mail-client/dist/web/page/mails/service/MailService","@web-atoms/web-controls/dist/mobile-app/MasterDetailPage","@social-mail/social-mail-client/dist/web/page/mails/ConversationPage","@social-mail/social-mail-client/dist/web/page/mails/service/ConversationService","@social-mail/social-mail-client/dist/web/page/mails/ComposeMailPage","@social-mail/social-mail-client/dist/common/controls/html/InlineHtmlEditorWithToolbar","@web-atoms/web-controls/dist/html-editor/InlineHtmlEditor","@web-atoms/data-styles/data-styles","@web-atoms/web-controls/dist/html-editor/commands/AddImage","@web-atoms/web-controls/dist/html-editor/commands/CommandButton","@web-atoms/web-controls/dist/html-editor/commands/HtmlCommands","@web-atoms/web-controls/dist/html-editor/commands/Toolbar","@web-atoms/web-controls/dist/html-editor/commands/Bold","@web-atoms/web-controls/dist/html-editor/commands/Command","@web-atoms/web-controls/dist/html-editor/commands/Italic","@web-atoms/web-controls/dist/html-editor/commands/Underline","@web-atoms/web-controls/dist/html-editor/commands/StrikeThrough","@web-atoms/web-controls/dist/html-editor/commands/Align","@web-atoms/web-controls/dist/basic/PopupButton","@web-atoms/web-controls/dist/basic/styles/popup-button-style","@web-atoms/web-controls/dist/html-editor/commands/HorizontalRule","@web-atoms/web-controls/dist/html-editor/commands/Separator","@web-atoms/web-controls/dist/html-editor/commands/Headings","@web-atoms/web-controls/dist/html-editor/commands/ChangeColor","@web-atoms/web-controls/dist/html-editor/commands/ChangeFont","@web-atoms/web-controls/dist/html-editor/commands/ChangeFontSize","@web-atoms/web-controls/dist/html-editor/commands/NumberedList","@web-atoms/web-controls/dist/html-editor/commands/UnorderedList","@web-atoms/web-controls/dist/html-editor/commands/IndentLess","@web-atoms/web-controls/dist/html-editor/commands/IndentMore","@web-atoms/web-controls/dist/html-editor/commands/AttachFile","@web-atoms/web-controls/dist/basic/UploadEvent","@web-atoms/web-controls/dist/html-editor/commands/AddLink","@web-atoms/core/dist/web/controls/AtomToggleButtonBar","@web-atoms/core/dist/web/styles/AtomToggleButtonBarStyle","@web-atoms/core/dist/web/styles/AtomListBoxStyle","@web-atoms/core/dist/web/controls/AtomListBox","@web-atoms/core/dist/web/controls/AtomItemsControl","@web-atoms/core/dist/core/AtomEnumerator","@web-atoms/core/dist/core/AtomList","@web-atoms/web-controls/dist/html-editor/commands/Unlink","@web-atoms/web-controls/dist/html-editor/commands/RemoveFormat","@web-atoms/web-controls/dist/html-editor/commands/Source","@social-mail/social-mail-client/dist/services/files/LocalFileService","@web-atoms/web-controls/dist/basic/AtomChips","@web-atoms/web-controls/dist/basic/Chip","@web-atoms/web-controls/dist/basic/styles/chip-style","@web-atoms/web-controls/dist/basic/styles/chips-style","@web-atoms/web-controls/dist/basic/styles/item-suggestion-style","@social-mail/social-mail-client/dist/style/GlobalStyle","@social-mail/social-mail-client/dist/style/OverrideAppStyle","@social-mail/social-mail-client/dist/services/UserService","@social-mail/social-mail-client/dist/common/SocialMailApp","@social-mail/social-mail-client/dist/common/pages/user/LoginPage","@social-mail/social-mail-client/dist/common/controls/password/PasswordStrength","@social-mail/social-mail-client/dist/common/validators/Validators","@social-mail/social-mail-client/dist/web/drawer/AppDrawer","@social-mail/social-mail-client/dist/common/controls/menu/MenuItem","@social-mail/social-mail-client/dist/common/controls/ModuleInfo","@web-atoms/core/dist/web/WebApp","@web-atoms/core/dist/core/AtomOnce","@web-atoms/core/dist/web/services/WebBusyIndicatorService","@web-atoms/core/dist/web/styles/StyleBuilder","@web-atoms/core/dist/web/services/WindowService","@web-atoms/core/dist/Atom","@web-atoms/core/dist/core/FormattedError","@web-atoms/core/dist/view-model/AtomWindowViewModel","@web-atoms/core/dist/view-model/AtomViewModel","@web-atoms/core/dist/view-model/baseTypes","@web-atoms/core/dist/web/controls/AtomAlertWindow","@web-atoms/core/dist/web/styles/AtomAlertWindowStyle","@web-atoms/core/dist/web/styles/AtomWindowStyle","@web-atoms/core/src/web/images/close-button-hover.svg","@web-atoms/core/dist/web/controls/AtomWindow","@web-atoms/core/dist/web/controls/AtomTemplate","@web-atoms/core/dist/web/controls/AtomNotification","@web-atoms/core/dist/web/styles/AtomNotificationStyle","@web-atoms/core/dist/web/styles/AtomPopupStyle","@web-atoms/core/dist/web/services/NotificationPopup","@web-atoms/core/dist/web/styles/AtomTheme"]);
|
|
1868
1868
|
|
|
1869
1869
|
System.register([], function (_export, _context) {
|
|
1870
1870
|
"use strict";
|
|
@@ -17639,6 +17639,18 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
|
|
|
17639
17639
|
execute: function () {
|
|
17640
17640
|
styled.css`
|
|
17641
17641
|
|
|
17642
|
+
& > [data-element=editor] {
|
|
17643
|
+
|
|
17644
|
+
padding: var(--spacing, 5px);
|
|
17645
|
+
border: solid 1px lightgray;
|
|
17646
|
+
border-radius: var(--spacing, 5px);
|
|
17647
|
+
margin: var(--spacing, 5px);
|
|
17648
|
+
|
|
17649
|
+
& > * {
|
|
17650
|
+
outline: none;
|
|
17651
|
+
}
|
|
17652
|
+
}
|
|
17653
|
+
|
|
17642
17654
|
& > [data-element=toolbar] {
|
|
17643
17655
|
flex-direction: column;
|
|
17644
17656
|
align-items: center;
|
|
@@ -17759,12 +17771,26 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
|
|
|
17759
17771
|
this.bindEvent(this.editor, "blur", () => this.saveSelection(), void 0, true);
|
|
17760
17772
|
this.bindEvent(this.editor, "input", e => this.onContentInput(e));
|
|
17761
17773
|
this.bindEvent(this.editor, "keydown", e => this.updateQueryCommand());
|
|
17762
|
-
this.bindEvent(this.editor, "click", e => this.updateQueryCommand());
|
|
17774
|
+
this.bindEvent(this.editor, "click", e => this.updateQueryCommand(e));
|
|
17763
17775
|
this.bindEvent(this.editor, "paste", e => this.onPasteEvent(e));
|
|
17764
17776
|
this.bindEvent(this.editor, "cut", () => this.onContentInput());
|
|
17765
17777
|
this.bindEvent(this.editor, "drop", e => this.onDrop(e));
|
|
17766
17778
|
}
|
|
17767
|
-
updateQueryCommand() {
|
|
17779
|
+
updateQueryCommand(e) {
|
|
17780
|
+
if ((e === null || e === void 0 ? void 0 : e.type) === "click") {
|
|
17781
|
+
if (!this.editor.textContent) {
|
|
17782
|
+
let first = this.editor.firstElementChild;
|
|
17783
|
+
if (!first) {
|
|
17784
|
+
first = document.createElement("div");
|
|
17785
|
+
first.innerHTML = "<p><br/></p>";
|
|
17786
|
+
this.editor.appendChild(first);
|
|
17787
|
+
} else {
|
|
17788
|
+
if (!first.lastChild) {
|
|
17789
|
+
first.innerHTML = "<p></br></b>";
|
|
17790
|
+
}
|
|
17791
|
+
}
|
|
17792
|
+
}
|
|
17793
|
+
}
|
|
17768
17794
|
this.version++;
|
|
17769
17795
|
}
|
|
17770
17796
|
onDrop(e) {
|
|
@@ -17786,6 +17812,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
|
|
|
17786
17812
|
}
|
|
17787
17813
|
onPasteEvent(e) {
|
|
17788
17814
|
if (!e.clipboardData.types.find(x => x === "text/html")) {
|
|
17815
|
+
this.onContentInput();
|
|
17789
17816
|
return;
|
|
17790
17817
|
}
|
|
17791
17818
|
const d = e.clipboardData.getData("text/plain");
|
|
@@ -18789,65 +18816,6 @@ System.register(["tslib", "@web-atoms/core/dist/App", "@web-atoms/core/dist/core
|
|
|
18789
18816
|
|
|
18790
18817
|
AmdLoader.instance.setup("@web-atoms/web-controls/dist/basic/UploadEvent");
|
|
18791
18818
|
|
|
18792
|
-
System.register(["tslib", "@web-atoms/core/dist/core/XNode", "../../basic/UploadEvent", "@web-atoms/core/dist/web/controls/AtomControl"], function (_export, _context) {
|
|
18793
|
-
"use strict";
|
|
18794
|
-
|
|
18795
|
-
var __awaiter, XNode, UploadEvent, AtomControl, onAttachImage;
|
|
18796
|
-
function AttachImage({
|
|
18797
|
-
accept = "image/*",
|
|
18798
|
-
maxSize = 1024 * 1024 * 5,
|
|
18799
|
-
authorize = true,
|
|
18800
|
-
capture = null,
|
|
18801
|
-
ariaLabel = "upload"
|
|
18802
|
-
}) {
|
|
18803
|
-
return XNode.create("button", Object.assign({
|
|
18804
|
-
title: "Insert Image",
|
|
18805
|
-
class: "command"
|
|
18806
|
-
}, UploadEvent.AttachUploadAction({
|
|
18807
|
-
accept,
|
|
18808
|
-
forceType: true,
|
|
18809
|
-
maxSize,
|
|
18810
|
-
authorize,
|
|
18811
|
-
capture,
|
|
18812
|
-
multiple: false,
|
|
18813
|
-
ariaLabel,
|
|
18814
|
-
"event-files-available": onAttachImage
|
|
18815
|
-
})), XNode.create("i", {
|
|
18816
|
-
class: "ri-image-add-fill"
|
|
18817
|
-
}));
|
|
18818
|
-
}
|
|
18819
|
-
_export("default", AttachImage);
|
|
18820
|
-
return {
|
|
18821
|
-
setters: [function (_tslib) {
|
|
18822
|
-
__awaiter = _tslib.__awaiter;
|
|
18823
|
-
}, function (_webAtomsCoreDistCoreXNode) {
|
|
18824
|
-
XNode = _webAtomsCoreDistCoreXNode.default;
|
|
18825
|
-
}, function (_basicUploadEvent) {
|
|
18826
|
-
UploadEvent = _basicUploadEvent.default;
|
|
18827
|
-
}, function (_webAtomsCoreDistWebControlsAtomControl) {
|
|
18828
|
-
AtomControl = _webAtomsCoreDistWebControlsAtomControl.AtomControl;
|
|
18829
|
-
}],
|
|
18830
|
-
execute: function () {
|
|
18831
|
-
onAttachImage = ce => __awaiter(void 0, void 0, void 0, function* () {
|
|
18832
|
-
var _a, _b;
|
|
18833
|
-
const c = AtomControl.from(ce.target);
|
|
18834
|
-
if (!((_b = (_a = ce.detail) === null || _a === void 0 ? void 0 : _a.files) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
18835
|
-
return;
|
|
18836
|
-
}
|
|
18837
|
-
const file = ce.detail.files[0];
|
|
18838
|
-
const fr = new FileReader();
|
|
18839
|
-
fr.onload = () => {
|
|
18840
|
-
c.executeCommand("insertHTML", void 0, `<div><img data-content="data-url" src="${fr.result}" style='max-height: 700px;'/></div>`);
|
|
18841
|
-
};
|
|
18842
|
-
fr.readAsDataURL(file);
|
|
18843
|
-
});
|
|
18844
|
-
}
|
|
18845
|
-
};
|
|
18846
|
-
});
|
|
18847
|
-
//# sourceMappingURL=AttachImage.js.map
|
|
18848
|
-
|
|
18849
|
-
AmdLoader.instance.setup("@web-atoms/web-controls/dist/html-editor/commands/AttachImage");
|
|
18850
|
-
|
|
18851
18819
|
System.register(["@web-atoms/core/dist/core/XNode", "../../basic/UploadEvent"], function (_export, _context) {
|
|
18852
18820
|
"use strict";
|
|
18853
18821
|
|
|
@@ -20317,149 +20285,442 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
20317
20285
|
|
|
20318
20286
|
AmdLoader.instance.setup("@web-atoms/web-controls/dist/html-editor/commands/Source");
|
|
20319
20287
|
|
|
20320
|
-
System.register(["
|
|
20321
|
-
"use strict";
|
|
20322
|
-
|
|
20323
|
-
var XNode, InlineHtmlEditor, Toolbar, Bold, Italic, Underline, StrikeThrough, Align, HorizontalRule, Separator, Headings, ChangeColor, ChangeFont, ChangeFontSize, NumberedList, UnorderedList, IndentLess, IndentMore, AttachImage, AttachFile, AddLink, Unlink, RemoveFormat, Source, link;
|
|
20324
|
-
function InlineHtmlEditorWithToolbar(a) {
|
|
20325
|
-
const toolbar = () => XNode.create("div", null, XNode.create(Toolbar, null, XNode.create(Bold, null), XNode.create(Italic, null), XNode.create(Underline, null), XNode.create(StrikeThrough, null), XNode.create(Align, null), XNode.create(Separator, null), XNode.create(Headings, null), XNode.create(ChangeColor, null), XNode.create(HorizontalRule, null), XNode.create(Separator, null), XNode.create(ChangeFont, null), XNode.create(ChangeFontSize, null), XNode.create(Separator, null), XNode.create(NumberedList, null), XNode.create(UnorderedList, null), XNode.create(IndentLess, null), XNode.create(IndentMore, null), XNode.create(Separator, null)), XNode.create(Toolbar, null, XNode.create(AttachImage, null), XNode.create(AttachFile, null), XNode.create(Separator, null), XNode.create(AddLink, null), XNode.create(Unlink, null), XNode.create(RemoveFormat, null), XNode.create(Separator, null), XNode.create(Source, null)));
|
|
20326
|
-
return XNode.create(InlineHtmlEditor, Object.assign({}, a, {
|
|
20327
|
-
toolbar: toolbar
|
|
20328
|
-
}));
|
|
20329
|
-
}
|
|
20330
|
-
_export("default", InlineHtmlEditorWithToolbar);
|
|
20331
|
-
return {
|
|
20332
|
-
setters: [function (_webAtomsCoreDistCoreXNode) {
|
|
20333
|
-
XNode = _webAtomsCoreDistCoreXNode.default;
|
|
20334
|
-
}, function (_webAtomsWebControlsDistHtmlEditorInlineHtmlEditor) {
|
|
20335
|
-
InlineHtmlEditor = _webAtomsWebControlsDistHtmlEditorInlineHtmlEditor.default;
|
|
20336
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsToolbar) {
|
|
20337
|
-
Toolbar = _webAtomsWebControlsDistHtmlEditorCommandsToolbar.default;
|
|
20338
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsBold) {
|
|
20339
|
-
Bold = _webAtomsWebControlsDistHtmlEditorCommandsBold.default;
|
|
20340
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsItalic) {
|
|
20341
|
-
Italic = _webAtomsWebControlsDistHtmlEditorCommandsItalic.default;
|
|
20342
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsUnderline) {
|
|
20343
|
-
Underline = _webAtomsWebControlsDistHtmlEditorCommandsUnderline.default;
|
|
20344
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsStrikeThrough) {
|
|
20345
|
-
StrikeThrough = _webAtomsWebControlsDistHtmlEditorCommandsStrikeThrough.default;
|
|
20346
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsAlign) {
|
|
20347
|
-
Align = _webAtomsWebControlsDistHtmlEditorCommandsAlign.default;
|
|
20348
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsHorizontalRule) {
|
|
20349
|
-
HorizontalRule = _webAtomsWebControlsDistHtmlEditorCommandsHorizontalRule.default;
|
|
20350
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsSeparator) {
|
|
20351
|
-
Separator = _webAtomsWebControlsDistHtmlEditorCommandsSeparator.default;
|
|
20352
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsHeadings) {
|
|
20353
|
-
Headings = _webAtomsWebControlsDistHtmlEditorCommandsHeadings.default;
|
|
20354
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsChangeColor) {
|
|
20355
|
-
ChangeColor = _webAtomsWebControlsDistHtmlEditorCommandsChangeColor.default;
|
|
20356
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsChangeFont) {
|
|
20357
|
-
ChangeFont = _webAtomsWebControlsDistHtmlEditorCommandsChangeFont.default;
|
|
20358
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsChangeFontSize) {
|
|
20359
|
-
ChangeFontSize = _webAtomsWebControlsDistHtmlEditorCommandsChangeFontSize.default;
|
|
20360
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsNumberedList) {
|
|
20361
|
-
NumberedList = _webAtomsWebControlsDistHtmlEditorCommandsNumberedList.default;
|
|
20362
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsUnorderedList) {
|
|
20363
|
-
UnorderedList = _webAtomsWebControlsDistHtmlEditorCommandsUnorderedList.default;
|
|
20364
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsIndentLess) {
|
|
20365
|
-
IndentLess = _webAtomsWebControlsDistHtmlEditorCommandsIndentLess.default;
|
|
20366
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsIndentMore) {
|
|
20367
|
-
IndentMore = _webAtomsWebControlsDistHtmlEditorCommandsIndentMore.default;
|
|
20368
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsAttachImage) {
|
|
20369
|
-
AttachImage = _webAtomsWebControlsDistHtmlEditorCommandsAttachImage.default;
|
|
20370
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsAttachFile) {
|
|
20371
|
-
AttachFile = _webAtomsWebControlsDistHtmlEditorCommandsAttachFile.default;
|
|
20372
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsAddLink) {
|
|
20373
|
-
AddLink = _webAtomsWebControlsDistHtmlEditorCommandsAddLink.default;
|
|
20374
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsUnlink) {
|
|
20375
|
-
Unlink = _webAtomsWebControlsDistHtmlEditorCommandsUnlink.default;
|
|
20376
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsRemoveFormat) {
|
|
20377
|
-
RemoveFormat = _webAtomsWebControlsDistHtmlEditorCommandsRemoveFormat.default;
|
|
20378
|
-
}, function (_webAtomsWebControlsDistHtmlEditorCommandsSource) {
|
|
20379
|
-
Source = _webAtomsWebControlsDistHtmlEditorCommandsSource.default;
|
|
20380
|
-
}],
|
|
20381
|
-
execute: function () {
|
|
20382
|
-
link = document.createElement("link");
|
|
20383
|
-
link.href = "https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css";
|
|
20384
|
-
link.rel = "preload";
|
|
20385
|
-
link.as = "style";
|
|
20386
|
-
link.onload = () => {
|
|
20387
|
-
link.onload = null;
|
|
20388
|
-
link.rel = "stylesheet";
|
|
20389
|
-
};
|
|
20390
|
-
document.head.appendChild(link);
|
|
20391
|
-
}
|
|
20392
|
-
};
|
|
20393
|
-
});
|
|
20394
|
-
//# sourceMappingURL=InlineHtmlEditorWithToolbar.js.map
|
|
20395
|
-
|
|
20396
|
-
AmdLoader.instance.setup("@social-mail/social-mail-client/dist/common/controls/html/InlineHtmlEditorWithToolbar");
|
|
20397
|
-
|
|
20398
|
-
System.register(["@web-atoms/core/dist/style/styled"], function (_export, _context) {
|
|
20288
|
+
System.register(["tslib", "@web-atoms/core/dist/App", "@web-atoms/core/dist/core/types", "@web-atoms/core/dist/di/DISingleton", "@web-atoms/core/dist/di/Inject", "@web-atoms/core/dist/style/styled", "@web-atoms/core/dist/web/services/PopupWindow", "@web-atoms/core/dist/core/InjectProperty", "@web-atoms/core/dist/core/XNode", "@web-atoms/web-controls/dist/basic/AtomRepeater", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/web/services/PopupService"], function (_export, _context) {
|
|
20399
20289
|
"use strict";
|
|
20400
20290
|
|
|
20401
|
-
var styled;
|
|
20291
|
+
var __awaiter, __decorate, __metadata, App, CancelToken, DISingleton, Inject, styled, PopupWindow, InjectProperty, XNode, AtomRepeater, Bind, PopupService, FileUploadWindow, acceptDocumentAndMedia, LocalFileService;
|
|
20402
20292
|
return {
|
|
20403
|
-
setters: [function (
|
|
20293
|
+
setters: [function (_tslib) {
|
|
20294
|
+
__awaiter = _tslib.__awaiter;
|
|
20295
|
+
__decorate = _tslib.__decorate;
|
|
20296
|
+
__metadata = _tslib.__metadata;
|
|
20297
|
+
}, function (_webAtomsCoreDistApp) {
|
|
20298
|
+
App = _webAtomsCoreDistApp.App;
|
|
20299
|
+
}, function (_webAtomsCoreDistCoreTypes) {
|
|
20300
|
+
CancelToken = _webAtomsCoreDistCoreTypes.CancelToken;
|
|
20301
|
+
}, function (_webAtomsCoreDistDiDISingleton) {
|
|
20302
|
+
DISingleton = _webAtomsCoreDistDiDISingleton.default;
|
|
20303
|
+
}, function (_webAtomsCoreDistDiInject) {
|
|
20304
|
+
Inject = _webAtomsCoreDistDiInject.Inject;
|
|
20305
|
+
}, function (_webAtomsCoreDistStyleStyled) {
|
|
20404
20306
|
styled = _webAtomsCoreDistStyleStyled.default;
|
|
20307
|
+
}, function (_webAtomsCoreDistWebServicesPopupWindow) {
|
|
20308
|
+
PopupWindow = _webAtomsCoreDistWebServicesPopupWindow.default;
|
|
20309
|
+
}, function (_webAtomsCoreDistCoreInjectProperty) {
|
|
20310
|
+
InjectProperty = _webAtomsCoreDistCoreInjectProperty.default;
|
|
20311
|
+
}, function (_webAtomsCoreDistCoreXNode) {
|
|
20312
|
+
XNode = _webAtomsCoreDistCoreXNode.default;
|
|
20313
|
+
}, function (_webAtomsWebControlsDistBasicAtomRepeater) {
|
|
20314
|
+
AtomRepeater = _webAtomsWebControlsDistBasicAtomRepeater.default;
|
|
20315
|
+
}, function (_webAtomsCoreDistCoreBind) {
|
|
20316
|
+
Bind = _webAtomsCoreDistCoreBind.default;
|
|
20317
|
+
}, function (_webAtomsCoreDistWebServicesPopupService) {
|
|
20318
|
+
PopupService = _webAtomsCoreDistWebServicesPopupService.default;
|
|
20405
20319
|
}],
|
|
20406
20320
|
execute: function () {
|
|
20321
|
+
_export("acceptDocumentAndMedia", acceptDocumentAndMedia = ".doc, .docx, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, video/*, application/pdf, .pdf, .txt, audio/*, image/*, .csv, text/csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, text/plain, text/html");
|
|
20407
20322
|
styled.css`
|
|
20408
|
-
|
|
20409
|
-
|
|
20410
|
-
padding-right: 10px;
|
|
20411
|
-
border-radius: 9999px;
|
|
20412
|
-
display: grid;
|
|
20413
|
-
align-items: center;
|
|
20414
|
-
grid-template-rows: auto 1fr;
|
|
20323
|
+
display: inline-grid;
|
|
20324
|
+
grid-template-rows: auto auto;
|
|
20415
20325
|
grid-template-columns: auto 1fr auto;
|
|
20416
20326
|
|
|
20417
|
-
& > [data-
|
|
20418
|
-
grid-row
|
|
20419
|
-
grid-column
|
|
20327
|
+
& > [data-element=preview] {
|
|
20328
|
+
grid-row: 1 / span 2;
|
|
20329
|
+
grid-column: 1;
|
|
20420
20330
|
}
|
|
20421
20331
|
|
|
20422
|
-
& >
|
|
20423
|
-
grid-
|
|
20424
|
-
grid-
|
|
20425
|
-
|
|
20426
|
-
|
|
20427
|
-
|
|
20428
|
-
align-self: center;
|
|
20332
|
+
& > [data-element=file-name] {
|
|
20333
|
+
grid-row: 1;
|
|
20334
|
+
grid-column: 2;
|
|
20335
|
+
overflow: hidden;
|
|
20336
|
+
white-space: nowrap;
|
|
20337
|
+
text-overflow: ellipsis;
|
|
20429
20338
|
}
|
|
20430
20339
|
|
|
20431
|
-
& >
|
|
20432
|
-
grid-
|
|
20433
|
-
grid-
|
|
20434
|
-
|
|
20435
|
-
align-self: center;
|
|
20436
|
-
font-size: small;
|
|
20437
|
-
background-color: transparent;
|
|
20438
|
-
border-radius: 4px;
|
|
20439
|
-
padding: 2px;
|
|
20440
|
-
padding-left: 4px;
|
|
20441
|
-
color: gray;
|
|
20442
|
-
&:hover {
|
|
20443
|
-
background-color: lightgray;
|
|
20444
|
-
color: red;
|
|
20445
|
-
}
|
|
20340
|
+
& > [data-element=progress] {
|
|
20341
|
+
grid-row: 2;
|
|
20342
|
+
grid-column: 2 / span 2;
|
|
20343
|
+
width: 100%;
|
|
20446
20344
|
}
|
|
20447
20345
|
|
|
20448
|
-
& >
|
|
20449
|
-
|
|
20450
|
-
grid-
|
|
20451
|
-
grid-column-start: 2;
|
|
20452
|
-
text-align: center;
|
|
20346
|
+
& > [data-element=delete] {
|
|
20347
|
+
grid-row: 1;
|
|
20348
|
+
grid-column: 3;
|
|
20453
20349
|
}
|
|
20454
|
-
|
|
20455
|
-
|
|
20456
|
-
|
|
20457
|
-
|
|
20350
|
+
`.installGlobal("[data-attachment-file]");
|
|
20351
|
+
LocalFileService = class LocalFileService {
|
|
20352
|
+
constructor() {
|
|
20353
|
+
document.body.addEventListener("uploadRequested", ce => {
|
|
20354
|
+
const {
|
|
20355
|
+
target,
|
|
20356
|
+
detail: {
|
|
20357
|
+
files,
|
|
20358
|
+
extra,
|
|
20359
|
+
uploadEvent
|
|
20360
|
+
}
|
|
20361
|
+
} = ce;
|
|
20362
|
+
ce.preventDefault();
|
|
20363
|
+
this.app.runAsync(() => __awaiter(this, void 0, void 0, function* () {
|
|
20364
|
+
const detail = yield FileUploadWindow.showModal({
|
|
20365
|
+
parameters: {
|
|
20366
|
+
files,
|
|
20367
|
+
extra
|
|
20368
|
+
}
|
|
20369
|
+
});
|
|
20370
|
+
target.dispatchEvent(new CustomEvent(uploadEvent, {
|
|
20371
|
+
detail,
|
|
20372
|
+
bubbles: true
|
|
20373
|
+
}));
|
|
20374
|
+
}));
|
|
20375
|
+
});
|
|
20458
20376
|
}
|
|
20459
|
-
|
|
20460
|
-
|
|
20461
|
-
|
|
20462
|
-
|
|
20377
|
+
uploadWithProgress(files) {
|
|
20378
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20379
|
+
const detail = yield FileUploadWindow.showModal({
|
|
20380
|
+
parameters: {
|
|
20381
|
+
files,
|
|
20382
|
+
extra: ""
|
|
20383
|
+
}
|
|
20384
|
+
});
|
|
20385
|
+
return detail.files;
|
|
20386
|
+
});
|
|
20387
|
+
}
|
|
20388
|
+
upload(files) {
|
|
20389
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20390
|
+
return files.map(file => {
|
|
20391
|
+
const uploadFile = {
|
|
20392
|
+
name: file.name
|
|
20393
|
+
};
|
|
20394
|
+
uploadFile.promise = new Promise((resolve, reject) => {
|
|
20395
|
+
const body = new FormData();
|
|
20396
|
+
body.append(file.name, file, file.name);
|
|
20397
|
+
const xhr = new XMLHttpRequest();
|
|
20398
|
+
const onError = () => {
|
|
20399
|
+
reject(new Error(xhr.responseText || "Error"));
|
|
20400
|
+
};
|
|
20401
|
+
xhr.upload.addEventListener("progress", event => {
|
|
20402
|
+
if (event.lengthComputable) {
|
|
20403
|
+
uploadFile.progress = event.loaded / event.total;
|
|
20404
|
+
}
|
|
20405
|
+
});
|
|
20406
|
+
xhr.upload.addEventListener("timeout", onError);
|
|
20407
|
+
xhr.upload.addEventListener("error", onError);
|
|
20408
|
+
xhr.upload.addEventListener("abort", onError);
|
|
20409
|
+
xhr.addEventListener("timeout", onError);
|
|
20410
|
+
xhr.addEventListener("abort", onError);
|
|
20411
|
+
xhr.addEventListener("error", onError);
|
|
20412
|
+
xhr.upload.addEventListener("progress", event => {
|
|
20413
|
+
if (event.lengthComputable) {
|
|
20414
|
+
uploadFile.progress = event.loaded / event.total;
|
|
20415
|
+
}
|
|
20416
|
+
});
|
|
20417
|
+
xhr.addEventListener("load", () => {
|
|
20418
|
+
if (xhr.status <= 300) {
|
|
20419
|
+
const r = Object.assign(Object.assign({}, JSON.parse(xhr.responseText)), {
|
|
20420
|
+
file
|
|
20421
|
+
});
|
|
20422
|
+
resolve(r);
|
|
20423
|
+
}
|
|
20424
|
+
});
|
|
20425
|
+
xhr.open("POST", "/api/upload", true);
|
|
20426
|
+
xhr.send(body);
|
|
20427
|
+
});
|
|
20428
|
+
return uploadFile;
|
|
20429
|
+
});
|
|
20430
|
+
});
|
|
20431
|
+
}
|
|
20432
|
+
};
|
|
20433
|
+
__decorate([Inject, __metadata("design:type", App)], LocalFileService.prototype, "app", void 0);
|
|
20434
|
+
LocalFileService = __decorate([DISingleton(), __metadata("design:paramtypes", [])], LocalFileService);
|
|
20435
|
+
_export("default", LocalFileService);
|
|
20436
|
+
FileUploadWindow = class FileUploadWindow extends PopupWindow {
|
|
20437
|
+
constructor() {
|
|
20438
|
+
super(...arguments);
|
|
20439
|
+
this.parameters = {};
|
|
20440
|
+
}
|
|
20441
|
+
init() {
|
|
20442
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20443
|
+
this.title = "Uploading...";
|
|
20444
|
+
this.closeWarning = "Are you sure you want to cancel the upload?";
|
|
20445
|
+
this.bindEvent(window, "backButton", e => __awaiter(this, void 0, void 0, function* () {
|
|
20446
|
+
var _a;
|
|
20447
|
+
e.preventDefault();
|
|
20448
|
+
(_a = e.stopImmediatePropagation) === null || _a === void 0 ? void 0 : _a.call(e);
|
|
20449
|
+
e.stopPropagation();
|
|
20450
|
+
yield this.requestCancel();
|
|
20451
|
+
}), null, {
|
|
20452
|
+
capture: true
|
|
20453
|
+
});
|
|
20454
|
+
this.files = yield this.localFileService.upload(this.parameters.files);
|
|
20455
|
+
this.render(XNode.create("div", null, XNode.create(AtomRepeater, {
|
|
20456
|
+
items: this.files,
|
|
20457
|
+
itemRenderer: file => XNode.create("div", {
|
|
20458
|
+
"data-attachment-file": "file"
|
|
20459
|
+
}, XNode.create("div", {
|
|
20460
|
+
"data-element": "file-name",
|
|
20461
|
+
text: file.name
|
|
20462
|
+
}), XNode.create("progress", {
|
|
20463
|
+
min: 0,
|
|
20464
|
+
max: 100,
|
|
20465
|
+
value: Bind.source(file, x => x.source.progress)
|
|
20466
|
+
}))
|
|
20467
|
+
})));
|
|
20468
|
+
try {
|
|
20469
|
+
const ct = new CancelToken();
|
|
20470
|
+
this.registerDisposable({
|
|
20471
|
+
dispose: () => {
|
|
20472
|
+
ct.cancel();
|
|
20473
|
+
}
|
|
20474
|
+
});
|
|
20475
|
+
const tasks = this.files.map(x => x.promise);
|
|
20476
|
+
const files = yield Promise.all(tasks);
|
|
20477
|
+
const extra = this.parameters.extra;
|
|
20478
|
+
this.close({
|
|
20479
|
+
files,
|
|
20480
|
+
extra
|
|
20481
|
+
});
|
|
20482
|
+
} catch (error) {
|
|
20483
|
+
if (CancelToken.isCancelled(error)) {
|
|
20484
|
+
this.cancel(error);
|
|
20485
|
+
return;
|
|
20486
|
+
}
|
|
20487
|
+
yield PopupService.alert({
|
|
20488
|
+
message: error
|
|
20489
|
+
});
|
|
20490
|
+
this.cancel(error);
|
|
20491
|
+
}
|
|
20492
|
+
});
|
|
20493
|
+
}
|
|
20494
|
+
};
|
|
20495
|
+
__decorate([InjectProperty, __metadata("design:type", LocalFileService)], FileUploadWindow.prototype, "localFileService", void 0);
|
|
20496
|
+
}
|
|
20497
|
+
};
|
|
20498
|
+
});
|
|
20499
|
+
//# sourceMappingURL=LocalFileService.js.map
|
|
20500
|
+
|
|
20501
|
+
AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/files/LocalFileService");
|
|
20502
|
+
|
|
20503
|
+
System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/web-controls/dist/html-editor/InlineHtmlEditor", "@web-atoms/web-controls/dist/html-editor/commands/Toolbar", "@web-atoms/web-controls/dist/html-editor/commands/Bold", "@web-atoms/web-controls/dist/html-editor/commands/Italic", "@web-atoms/web-controls/dist/html-editor/commands/Underline", "@web-atoms/web-controls/dist/html-editor/commands/StrikeThrough", "@web-atoms/web-controls/dist/html-editor/commands/Align", "@web-atoms/web-controls/dist/html-editor/commands/HorizontalRule", "@web-atoms/web-controls/dist/html-editor/commands/Separator", "@web-atoms/web-controls/dist/html-editor/commands/Headings", "@web-atoms/web-controls/dist/html-editor/commands/ChangeColor", "@web-atoms/web-controls/dist/html-editor/commands/ChangeFont", "@web-atoms/web-controls/dist/html-editor/commands/ChangeFontSize", "@web-atoms/web-controls/dist/html-editor/commands/NumberedList", "@web-atoms/web-controls/dist/html-editor/commands/UnorderedList", "@web-atoms/web-controls/dist/html-editor/commands/IndentLess", "@web-atoms/web-controls/dist/html-editor/commands/IndentMore", "@web-atoms/web-controls/dist/html-editor/commands/AttachFile", "@web-atoms/web-controls/dist/html-editor/commands/AddLink", "@web-atoms/web-controls/dist/html-editor/commands/Unlink", "@web-atoms/web-controls/dist/html-editor/commands/RemoveFormat", "@web-atoms/web-controls/dist/html-editor/commands/Source", "@web-atoms/web-controls/dist/basic/UploadEvent", "../../../services/files/LocalFileService", "@web-atoms/core/dist/web/controls/AtomControl", "@web-atoms/core/dist/core/InjectProperty"], function (_export, _context) {
|
|
20504
|
+
"use strict";
|
|
20505
|
+
|
|
20506
|
+
var __awaiter, __decorate, __metadata, XNode, InlineHtmlEditor, Toolbar, Bold, Italic, Underline, StrikeThrough, Align, HorizontalRule, Separator, Headings, ChangeColor, ChangeFont, ChangeFontSize, NumberedList, UnorderedList, IndentLess, IndentMore, AttachFile, AddLink, Unlink, RemoveFormat, Source, UploadEvent, LocalFileService, AtomControl, InjectProperty, MailHtmlEditor, link, onAttachImage;
|
|
20507
|
+
function AttachImage({
|
|
20508
|
+
accept = "image/*",
|
|
20509
|
+
maxSize = 1024 * 1024 * 5,
|
|
20510
|
+
authorize = true,
|
|
20511
|
+
capture = null,
|
|
20512
|
+
ariaLabel = "upload"
|
|
20513
|
+
}) {
|
|
20514
|
+
return XNode.create("button", Object.assign({
|
|
20515
|
+
title: "Insert Image",
|
|
20516
|
+
class: "command"
|
|
20517
|
+
}, UploadEvent.AttachUploadAction({
|
|
20518
|
+
accept,
|
|
20519
|
+
forceType: true,
|
|
20520
|
+
maxSize,
|
|
20521
|
+
authorize,
|
|
20522
|
+
capture,
|
|
20523
|
+
multiple: false,
|
|
20524
|
+
ariaLabel,
|
|
20525
|
+
"event-files-available": onAttachImage
|
|
20526
|
+
})), XNode.create("i", {
|
|
20527
|
+
class: "ri-image-add-fill"
|
|
20528
|
+
}));
|
|
20529
|
+
}
|
|
20530
|
+
function InlineHtmlEditorWithToolbar(a) {
|
|
20531
|
+
const toolbar = () => XNode.create("div", null, XNode.create(Toolbar, null, XNode.create(Bold, null), XNode.create(Italic, null), XNode.create(Underline, null), XNode.create(StrikeThrough, null), XNode.create(Align, null), XNode.create(Separator, null), XNode.create(Headings, null), XNode.create(ChangeColor, null), XNode.create(HorizontalRule, null), XNode.create(Separator, null), XNode.create(ChangeFont, null), XNode.create(ChangeFontSize, null), XNode.create(Separator, null), XNode.create(NumberedList, null), XNode.create(UnorderedList, null), XNode.create(IndentLess, null), XNode.create(IndentMore, null), XNode.create(Separator, null)), XNode.create(Toolbar, null, XNode.create(AttachImage, null), XNode.create(AttachFile, null), XNode.create(Separator, null), XNode.create(AddLink, null), XNode.create(Unlink, null), XNode.create(RemoveFormat, null), XNode.create(Separator, null), XNode.create(Source, null)));
|
|
20532
|
+
return XNode.create(MailHtmlEditor, Object.assign({}, a, {
|
|
20533
|
+
toolbar: toolbar
|
|
20534
|
+
}));
|
|
20535
|
+
}
|
|
20536
|
+
_export({
|
|
20537
|
+
MailHtmlEditor: void 0,
|
|
20538
|
+
default: InlineHtmlEditorWithToolbar
|
|
20539
|
+
});
|
|
20540
|
+
return {
|
|
20541
|
+
setters: [function (_tslib) {
|
|
20542
|
+
__awaiter = _tslib.__awaiter;
|
|
20543
|
+
__decorate = _tslib.__decorate;
|
|
20544
|
+
__metadata = _tslib.__metadata;
|
|
20545
|
+
}, function (_webAtomsCoreDistCoreXNode) {
|
|
20546
|
+
XNode = _webAtomsCoreDistCoreXNode.default;
|
|
20547
|
+
}, function (_webAtomsWebControlsDistHtmlEditorInlineHtmlEditor) {
|
|
20548
|
+
InlineHtmlEditor = _webAtomsWebControlsDistHtmlEditorInlineHtmlEditor.default;
|
|
20549
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsToolbar) {
|
|
20550
|
+
Toolbar = _webAtomsWebControlsDistHtmlEditorCommandsToolbar.default;
|
|
20551
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsBold) {
|
|
20552
|
+
Bold = _webAtomsWebControlsDistHtmlEditorCommandsBold.default;
|
|
20553
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsItalic) {
|
|
20554
|
+
Italic = _webAtomsWebControlsDistHtmlEditorCommandsItalic.default;
|
|
20555
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsUnderline) {
|
|
20556
|
+
Underline = _webAtomsWebControlsDistHtmlEditorCommandsUnderline.default;
|
|
20557
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsStrikeThrough) {
|
|
20558
|
+
StrikeThrough = _webAtomsWebControlsDistHtmlEditorCommandsStrikeThrough.default;
|
|
20559
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsAlign) {
|
|
20560
|
+
Align = _webAtomsWebControlsDistHtmlEditorCommandsAlign.default;
|
|
20561
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsHorizontalRule) {
|
|
20562
|
+
HorizontalRule = _webAtomsWebControlsDistHtmlEditorCommandsHorizontalRule.default;
|
|
20563
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsSeparator) {
|
|
20564
|
+
Separator = _webAtomsWebControlsDistHtmlEditorCommandsSeparator.default;
|
|
20565
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsHeadings) {
|
|
20566
|
+
Headings = _webAtomsWebControlsDistHtmlEditorCommandsHeadings.default;
|
|
20567
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsChangeColor) {
|
|
20568
|
+
ChangeColor = _webAtomsWebControlsDistHtmlEditorCommandsChangeColor.default;
|
|
20569
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsChangeFont) {
|
|
20570
|
+
ChangeFont = _webAtomsWebControlsDistHtmlEditorCommandsChangeFont.default;
|
|
20571
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsChangeFontSize) {
|
|
20572
|
+
ChangeFontSize = _webAtomsWebControlsDistHtmlEditorCommandsChangeFontSize.default;
|
|
20573
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsNumberedList) {
|
|
20574
|
+
NumberedList = _webAtomsWebControlsDistHtmlEditorCommandsNumberedList.default;
|
|
20575
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsUnorderedList) {
|
|
20576
|
+
UnorderedList = _webAtomsWebControlsDistHtmlEditorCommandsUnorderedList.default;
|
|
20577
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsIndentLess) {
|
|
20578
|
+
IndentLess = _webAtomsWebControlsDistHtmlEditorCommandsIndentLess.default;
|
|
20579
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsIndentMore) {
|
|
20580
|
+
IndentMore = _webAtomsWebControlsDistHtmlEditorCommandsIndentMore.default;
|
|
20581
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsAttachFile) {
|
|
20582
|
+
AttachFile = _webAtomsWebControlsDistHtmlEditorCommandsAttachFile.default;
|
|
20583
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsAddLink) {
|
|
20584
|
+
AddLink = _webAtomsWebControlsDistHtmlEditorCommandsAddLink.default;
|
|
20585
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsUnlink) {
|
|
20586
|
+
Unlink = _webAtomsWebControlsDistHtmlEditorCommandsUnlink.default;
|
|
20587
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsRemoveFormat) {
|
|
20588
|
+
RemoveFormat = _webAtomsWebControlsDistHtmlEditorCommandsRemoveFormat.default;
|
|
20589
|
+
}, function (_webAtomsWebControlsDistHtmlEditorCommandsSource) {
|
|
20590
|
+
Source = _webAtomsWebControlsDistHtmlEditorCommandsSource.default;
|
|
20591
|
+
}, function (_webAtomsWebControlsDistBasicUploadEvent) {
|
|
20592
|
+
UploadEvent = _webAtomsWebControlsDistBasicUploadEvent.default;
|
|
20593
|
+
}, function (_servicesFilesLocalFileService) {
|
|
20594
|
+
LocalFileService = _servicesFilesLocalFileService.default;
|
|
20595
|
+
}, function (_webAtomsCoreDistWebControlsAtomControl) {
|
|
20596
|
+
AtomControl = _webAtomsCoreDistWebControlsAtomControl.AtomControl;
|
|
20597
|
+
}, function (_webAtomsCoreDistCoreInjectProperty) {
|
|
20598
|
+
InjectProperty = _webAtomsCoreDistCoreInjectProperty.default;
|
|
20599
|
+
}],
|
|
20600
|
+
execute: function () {
|
|
20601
|
+
link = document.createElement("link");
|
|
20602
|
+
link.href = "https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css";
|
|
20603
|
+
link.rel = "preload";
|
|
20604
|
+
link.as = "style";
|
|
20605
|
+
link.onload = () => {
|
|
20606
|
+
link.onload = null;
|
|
20607
|
+
link.rel = "stylesheet";
|
|
20608
|
+
};
|
|
20609
|
+
document.head.appendChild(link);
|
|
20610
|
+
onAttachImage = ce => __awaiter(void 0, void 0, void 0, function* () {
|
|
20611
|
+
var _a, _b;
|
|
20612
|
+
const c = AtomControl.from(ce.target);
|
|
20613
|
+
if (!((_b = (_a = ce.detail) === null || _a === void 0 ? void 0 : _a.files) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
20614
|
+
return;
|
|
20615
|
+
}
|
|
20616
|
+
const file = ce.detail.files[0];
|
|
20617
|
+
c.executeCommand("insertHTML", void 0, `<div><img data-content="data-url" data-content-id=${file.appFileID} src="${file.url}" style='max-height: 700px;'/></div>`);
|
|
20618
|
+
});
|
|
20619
|
+
_export("MailHtmlEditor", MailHtmlEditor = class MailHtmlEditor extends InlineHtmlEditor {
|
|
20620
|
+
onPasteEvent(e) {
|
|
20621
|
+
if (e.clipboardData.files.length) {
|
|
20622
|
+
e.preventDefault();
|
|
20623
|
+
e.stopPropagation();
|
|
20624
|
+
this.app.runAsync(() => __awaiter(this, void 0, void 0, function* () {
|
|
20625
|
+
const files = yield this.localFileService.uploadWithProgress(Array.from(e.clipboardData.files));
|
|
20626
|
+
for (const file of files) {
|
|
20627
|
+
this.executeCommand("insertHTML", void 0, `<div><img data-content="data-url" data-content-id=${file.appFileID} src="${file.url}" style='max-height: 700px;'/></div>`);
|
|
20628
|
+
}
|
|
20629
|
+
this.element.dispatchEvent(new CustomEvent("filesAvailable", {
|
|
20630
|
+
detail: {
|
|
20631
|
+
files,
|
|
20632
|
+
extra: "none"
|
|
20633
|
+
},
|
|
20634
|
+
bubbles: true
|
|
20635
|
+
}));
|
|
20636
|
+
}));
|
|
20637
|
+
return;
|
|
20638
|
+
}
|
|
20639
|
+
super.onPasteEvent(e);
|
|
20640
|
+
}
|
|
20641
|
+
preCreate() {
|
|
20642
|
+
super.preCreate();
|
|
20643
|
+
this.sanitizeHtml = node => {
|
|
20644
|
+
const images = Array.from(node.querySelectorAll(`img[data-content-id]`));
|
|
20645
|
+
for (const image of images) {
|
|
20646
|
+
image.setAttribute("src", `cid:${image.getAttribute("data-content-id")}`);
|
|
20647
|
+
}
|
|
20648
|
+
};
|
|
20649
|
+
}
|
|
20650
|
+
});
|
|
20651
|
+
__decorate([InjectProperty, __metadata("design:type", LocalFileService)], MailHtmlEditor.prototype, "localFileService", void 0);
|
|
20652
|
+
}
|
|
20653
|
+
};
|
|
20654
|
+
});
|
|
20655
|
+
//# sourceMappingURL=InlineHtmlEditorWithToolbar.js.map
|
|
20656
|
+
|
|
20657
|
+
AmdLoader.instance.setup("@social-mail/social-mail-client/dist/common/controls/html/InlineHtmlEditorWithToolbar");
|
|
20658
|
+
|
|
20659
|
+
System.register(["@web-atoms/core/dist/style/styled"], function (_export, _context) {
|
|
20660
|
+
"use strict";
|
|
20661
|
+
|
|
20662
|
+
var styled;
|
|
20663
|
+
return {
|
|
20664
|
+
setters: [function (_webAtomsCoreDistStyleStyled) {
|
|
20665
|
+
styled = _webAtomsCoreDistStyleStyled.default;
|
|
20666
|
+
}],
|
|
20667
|
+
execute: function () {
|
|
20668
|
+
styled.css`
|
|
20669
|
+
padding: 2px;
|
|
20670
|
+
padding-left: 10px;
|
|
20671
|
+
padding-right: 10px;
|
|
20672
|
+
border-radius: 9999px;
|
|
20673
|
+
display: grid;
|
|
20674
|
+
align-items: center;
|
|
20675
|
+
grid-template-rows: auto 1fr;
|
|
20676
|
+
grid-template-columns: auto 1fr auto;
|
|
20677
|
+
|
|
20678
|
+
& > [data-content] {
|
|
20679
|
+
grid-row-start: 2;
|
|
20680
|
+
grid-column-start: 2;
|
|
20681
|
+
}
|
|
20682
|
+
|
|
20683
|
+
& > .icon {
|
|
20684
|
+
grid-column-start: 1;
|
|
20685
|
+
grid-row-start: 1;
|
|
20686
|
+
grid-row-end: span 2;
|
|
20687
|
+
padding: 2px;
|
|
20688
|
+
padding-right: 4px;
|
|
20689
|
+
align-self: center;
|
|
20690
|
+
}
|
|
20691
|
+
|
|
20692
|
+
& > .delete {
|
|
20693
|
+
grid-column-start: 3;
|
|
20694
|
+
grid-row-start: 1;
|
|
20695
|
+
grid-row-end: span 2;
|
|
20696
|
+
align-self: center;
|
|
20697
|
+
font-size: small;
|
|
20698
|
+
background-color: transparent;
|
|
20699
|
+
border-radius: 4px;
|
|
20700
|
+
padding: 2px;
|
|
20701
|
+
padding-left: 4px;
|
|
20702
|
+
color: gray;
|
|
20703
|
+
&:hover {
|
|
20704
|
+
background-color: lightgray;
|
|
20705
|
+
color: red;
|
|
20706
|
+
}
|
|
20707
|
+
}
|
|
20708
|
+
|
|
20709
|
+
& > .header {
|
|
20710
|
+
font-size: x-small;
|
|
20711
|
+
grid-row-start: 1;
|
|
20712
|
+
grid-column-start: 2;
|
|
20713
|
+
text-align: center;
|
|
20714
|
+
}
|
|
20715
|
+
|
|
20716
|
+
& > .label {
|
|
20717
|
+
grid-row-start: 2;
|
|
20718
|
+
grid-column-start: 2;
|
|
20719
|
+
}
|
|
20720
|
+
|
|
20721
|
+
& > .delete-strike {
|
|
20722
|
+
grid-row: 1 / span 2;
|
|
20723
|
+
grid-column: 1 / span 2;
|
|
20463
20724
|
height: 2px;
|
|
20464
20725
|
background-color: red;
|
|
20465
20726
|
align-self: center;
|
|
@@ -21063,7 +21324,7 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
|
|
|
21063
21324
|
this.model = (_a = this.parameters.model) !== null && _a !== void 0 ? _a : Email.create({
|
|
21064
21325
|
subject: (_b = this.parameters.subject) !== null && _b !== void 0 ? _b : "",
|
|
21065
21326
|
textBody: "",
|
|
21066
|
-
htmlBody: `<div contentEditable="true"
|
|
21327
|
+
htmlBody: `<div contentEditable="true"><p><br/><br/><br/><br/><br/></p></div>`,
|
|
21067
21328
|
recipients: [],
|
|
21068
21329
|
attachments: []
|
|
21069
21330
|
});
|
|
@@ -21242,7 +21503,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
|
|
|
21242
21503
|
"data-list-selection": "default",
|
|
21243
21504
|
"data-items-updated-event": "mails-available",
|
|
21244
21505
|
"data-selection-updated-event": "mail-selected",
|
|
21245
|
-
selectedItem: Bind.
|
|
21506
|
+
selectedItem: Bind.twoWays(() => this.selectedThread),
|
|
21246
21507
|
selectOnClick: true,
|
|
21247
21508
|
items: this.mails
|
|
21248
21509
|
}, InfiniteRepeater.pagedItems(start => (c, e, cancelToken) => this.mailService.list({
|
|
@@ -21838,210 +22099,6 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/web-con
|
|
|
21838
22099
|
|
|
21839
22100
|
AmdLoader.instance.setup("@social-mail/social-mail-client/dist/web/drawer/AppDrawer");
|
|
21840
22101
|
|
|
21841
|
-
System.register(["tslib", "@web-atoms/core/dist/App", "@web-atoms/core/dist/core/types", "@web-atoms/core/dist/di/DISingleton", "@web-atoms/core/dist/di/Inject", "@web-atoms/core/dist/style/styled", "@web-atoms/core/dist/web/services/PopupWindow", "@web-atoms/core/dist/core/InjectProperty", "@web-atoms/core/dist/core/XNode", "@web-atoms/web-controls/dist/basic/AtomRepeater", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/web/services/PopupService"], function (_export, _context) {
|
|
21842
|
-
"use strict";
|
|
21843
|
-
|
|
21844
|
-
var __awaiter, __decorate, __metadata, App, CancelToken, DISingleton, Inject, styled, PopupWindow, InjectProperty, XNode, AtomRepeater, Bind, PopupService, FileUploadWindow, acceptDocumentAndMedia, LocalFileService;
|
|
21845
|
-
return {
|
|
21846
|
-
setters: [function (_tslib) {
|
|
21847
|
-
__awaiter = _tslib.__awaiter;
|
|
21848
|
-
__decorate = _tslib.__decorate;
|
|
21849
|
-
__metadata = _tslib.__metadata;
|
|
21850
|
-
}, function (_webAtomsCoreDistApp) {
|
|
21851
|
-
App = _webAtomsCoreDistApp.App;
|
|
21852
|
-
}, function (_webAtomsCoreDistCoreTypes) {
|
|
21853
|
-
CancelToken = _webAtomsCoreDistCoreTypes.CancelToken;
|
|
21854
|
-
}, function (_webAtomsCoreDistDiDISingleton) {
|
|
21855
|
-
DISingleton = _webAtomsCoreDistDiDISingleton.default;
|
|
21856
|
-
}, function (_webAtomsCoreDistDiInject) {
|
|
21857
|
-
Inject = _webAtomsCoreDistDiInject.Inject;
|
|
21858
|
-
}, function (_webAtomsCoreDistStyleStyled) {
|
|
21859
|
-
styled = _webAtomsCoreDistStyleStyled.default;
|
|
21860
|
-
}, function (_webAtomsCoreDistWebServicesPopupWindow) {
|
|
21861
|
-
PopupWindow = _webAtomsCoreDistWebServicesPopupWindow.default;
|
|
21862
|
-
}, function (_webAtomsCoreDistCoreInjectProperty) {
|
|
21863
|
-
InjectProperty = _webAtomsCoreDistCoreInjectProperty.default;
|
|
21864
|
-
}, function (_webAtomsCoreDistCoreXNode) {
|
|
21865
|
-
XNode = _webAtomsCoreDistCoreXNode.default;
|
|
21866
|
-
}, function (_webAtomsWebControlsDistBasicAtomRepeater) {
|
|
21867
|
-
AtomRepeater = _webAtomsWebControlsDistBasicAtomRepeater.default;
|
|
21868
|
-
}, function (_webAtomsCoreDistCoreBind) {
|
|
21869
|
-
Bind = _webAtomsCoreDistCoreBind.default;
|
|
21870
|
-
}, function (_webAtomsCoreDistWebServicesPopupService) {
|
|
21871
|
-
PopupService = _webAtomsCoreDistWebServicesPopupService.default;
|
|
21872
|
-
}],
|
|
21873
|
-
execute: function () {
|
|
21874
|
-
_export("acceptDocumentAndMedia", acceptDocumentAndMedia = ".doc, .docx, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, video/*, application/pdf, .pdf, .txt, audio/*, image/*, .csv, text/csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, text/plain, text/html");
|
|
21875
|
-
styled.css`
|
|
21876
|
-
display: inline-grid;
|
|
21877
|
-
grid-template-rows: auto auto;
|
|
21878
|
-
grid-template-columns: auto 1fr auto;
|
|
21879
|
-
|
|
21880
|
-
& > [data-element=preview] {
|
|
21881
|
-
grid-row: 1 / span 2;
|
|
21882
|
-
grid-column: 1;
|
|
21883
|
-
}
|
|
21884
|
-
|
|
21885
|
-
& > [data-element=file-name] {
|
|
21886
|
-
grid-row: 1;
|
|
21887
|
-
grid-column: 2;
|
|
21888
|
-
overflow: hidden;
|
|
21889
|
-
white-space: nowrap;
|
|
21890
|
-
text-overflow: ellipsis;
|
|
21891
|
-
}
|
|
21892
|
-
|
|
21893
|
-
& > [data-element=progress] {
|
|
21894
|
-
grid-row: 2;
|
|
21895
|
-
grid-column: 2 / span 2;
|
|
21896
|
-
width: 100%;
|
|
21897
|
-
}
|
|
21898
|
-
|
|
21899
|
-
& > [data-element=delete] {
|
|
21900
|
-
grid-row: 1;
|
|
21901
|
-
grid-column: 3;
|
|
21902
|
-
}
|
|
21903
|
-
`.installGlobal("[data-attachment-file]");
|
|
21904
|
-
LocalFileService = class LocalFileService {
|
|
21905
|
-
constructor() {
|
|
21906
|
-
document.body.addEventListener("uploadRequested", ce => {
|
|
21907
|
-
const {
|
|
21908
|
-
target,
|
|
21909
|
-
detail: {
|
|
21910
|
-
files,
|
|
21911
|
-
extra,
|
|
21912
|
-
uploadEvent
|
|
21913
|
-
}
|
|
21914
|
-
} = ce;
|
|
21915
|
-
ce.preventDefault();
|
|
21916
|
-
this.app.runAsync(() => __awaiter(this, void 0, void 0, function* () {
|
|
21917
|
-
const detail = yield FileUploadWindow.showModal({
|
|
21918
|
-
parameters: {
|
|
21919
|
-
files,
|
|
21920
|
-
extra
|
|
21921
|
-
}
|
|
21922
|
-
});
|
|
21923
|
-
target.dispatchEvent(new CustomEvent(uploadEvent, {
|
|
21924
|
-
detail,
|
|
21925
|
-
bubbles: true
|
|
21926
|
-
}));
|
|
21927
|
-
}));
|
|
21928
|
-
});
|
|
21929
|
-
}
|
|
21930
|
-
upload(files) {
|
|
21931
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
21932
|
-
return files.map(file => {
|
|
21933
|
-
const uploadFile = {
|
|
21934
|
-
name: file.name
|
|
21935
|
-
};
|
|
21936
|
-
uploadFile.promise = new Promise((resolve, reject) => {
|
|
21937
|
-
const body = new FormData();
|
|
21938
|
-
body.append(file.name, file, file.name);
|
|
21939
|
-
const xhr = new XMLHttpRequest();
|
|
21940
|
-
const onError = () => {
|
|
21941
|
-
reject(new Error(xhr.responseText || "Error"));
|
|
21942
|
-
};
|
|
21943
|
-
xhr.upload.addEventListener("progress", event => {
|
|
21944
|
-
if (event.lengthComputable) {
|
|
21945
|
-
uploadFile.progress = event.loaded / event.total;
|
|
21946
|
-
}
|
|
21947
|
-
});
|
|
21948
|
-
xhr.upload.addEventListener("timeout", onError);
|
|
21949
|
-
xhr.upload.addEventListener("error", onError);
|
|
21950
|
-
xhr.upload.addEventListener("abort", onError);
|
|
21951
|
-
xhr.addEventListener("timeout", onError);
|
|
21952
|
-
xhr.addEventListener("abort", onError);
|
|
21953
|
-
xhr.addEventListener("error", onError);
|
|
21954
|
-
xhr.upload.addEventListener("progress", event => {
|
|
21955
|
-
if (event.lengthComputable) {
|
|
21956
|
-
uploadFile.progress = event.loaded / event.total;
|
|
21957
|
-
}
|
|
21958
|
-
});
|
|
21959
|
-
xhr.addEventListener("load", () => {
|
|
21960
|
-
if (xhr.status <= 300) {
|
|
21961
|
-
const r = Object.assign(Object.assign({}, JSON.parse(xhr.responseText)), {
|
|
21962
|
-
file
|
|
21963
|
-
});
|
|
21964
|
-
resolve(r);
|
|
21965
|
-
}
|
|
21966
|
-
});
|
|
21967
|
-
xhr.open("POST", "/api/upload", true);
|
|
21968
|
-
xhr.send(body);
|
|
21969
|
-
});
|
|
21970
|
-
return uploadFile;
|
|
21971
|
-
});
|
|
21972
|
-
});
|
|
21973
|
-
}
|
|
21974
|
-
};
|
|
21975
|
-
__decorate([Inject, __metadata("design:type", App)], LocalFileService.prototype, "app", void 0);
|
|
21976
|
-
LocalFileService = __decorate([DISingleton(), __metadata("design:paramtypes", [])], LocalFileService);
|
|
21977
|
-
_export("default", LocalFileService);
|
|
21978
|
-
FileUploadWindow = class FileUploadWindow extends PopupWindow {
|
|
21979
|
-
constructor() {
|
|
21980
|
-
super(...arguments);
|
|
21981
|
-
this.parameters = {};
|
|
21982
|
-
}
|
|
21983
|
-
init() {
|
|
21984
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
21985
|
-
this.title = "Uploading...";
|
|
21986
|
-
this.closeWarning = "Are you sure you want to cancel the upload?";
|
|
21987
|
-
this.bindEvent(window, "backButton", e => __awaiter(this, void 0, void 0, function* () {
|
|
21988
|
-
var _a;
|
|
21989
|
-
e.preventDefault();
|
|
21990
|
-
(_a = e.stopImmediatePropagation) === null || _a === void 0 ? void 0 : _a.call(e);
|
|
21991
|
-
e.stopPropagation();
|
|
21992
|
-
yield this.requestCancel();
|
|
21993
|
-
}), null, {
|
|
21994
|
-
capture: true
|
|
21995
|
-
});
|
|
21996
|
-
this.files = yield this.localFileService.upload(this.parameters.files);
|
|
21997
|
-
this.render(XNode.create("div", null, XNode.create(AtomRepeater, {
|
|
21998
|
-
items: this.files,
|
|
21999
|
-
itemRenderer: file => XNode.create("div", {
|
|
22000
|
-
"data-attachment-file": "file"
|
|
22001
|
-
}, XNode.create("div", {
|
|
22002
|
-
"data-element": "file-name",
|
|
22003
|
-
text: file.name
|
|
22004
|
-
}), XNode.create("progress", {
|
|
22005
|
-
min: 0,
|
|
22006
|
-
max: 100,
|
|
22007
|
-
value: Bind.source(file, x => x.source.progress)
|
|
22008
|
-
}))
|
|
22009
|
-
})));
|
|
22010
|
-
try {
|
|
22011
|
-
const ct = new CancelToken();
|
|
22012
|
-
this.registerDisposable({
|
|
22013
|
-
dispose: () => {
|
|
22014
|
-
ct.cancel();
|
|
22015
|
-
}
|
|
22016
|
-
});
|
|
22017
|
-
const tasks = this.files.map(x => x.promise);
|
|
22018
|
-
const files = yield Promise.all(tasks);
|
|
22019
|
-
const extra = this.parameters.extra;
|
|
22020
|
-
this.close({
|
|
22021
|
-
files,
|
|
22022
|
-
extra
|
|
22023
|
-
});
|
|
22024
|
-
} catch (error) {
|
|
22025
|
-
if (CancelToken.isCancelled(error)) {
|
|
22026
|
-
this.cancel(error);
|
|
22027
|
-
return;
|
|
22028
|
-
}
|
|
22029
|
-
yield PopupService.alert({
|
|
22030
|
-
message: error
|
|
22031
|
-
});
|
|
22032
|
-
this.cancel(error);
|
|
22033
|
-
}
|
|
22034
|
-
});
|
|
22035
|
-
}
|
|
22036
|
-
};
|
|
22037
|
-
__decorate([InjectProperty, __metadata("design:type", LocalFileService)], FileUploadWindow.prototype, "localFileService", void 0);
|
|
22038
|
-
}
|
|
22039
|
-
};
|
|
22040
|
-
});
|
|
22041
|
-
//# sourceMappingURL=LocalFileService.js.map
|
|
22042
|
-
|
|
22043
|
-
AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/files/LocalFileService");
|
|
22044
|
-
|
|
22045
22102
|
System.register(["@web-atoms/core/dist/core/XNode"], function (_export, _context) {
|
|
22046
22103
|
"use strict";
|
|
22047
22104
|
|