@web-atoms/web-controls 2.2.0 → 2.2.2
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/ModuleFiles.js +45 -46
- package/dist/ModuleFiles.js.map +1 -1
- package/dist/PageNavigator.d.ts +2 -2
- package/dist/PageNavigator.d.ts.map +1 -1
- package/dist/PageNavigator.js +54 -39
- package/dist/PageNavigator.js.map +1 -1
- package/dist/animations/Animations.js +38 -52
- package/dist/animations/Animations.js.map +1 -1
- package/dist/auto-complete/AppComboBoxViewModel.js +16 -17
- package/dist/auto-complete/AppComboBoxViewModel.js.map +1 -1
- package/dist/auto-complete/AutoCompleteBox.js +296 -273
- package/dist/auto-complete/AutoCompleteBox.js.map +1 -1
- package/dist/auto-complete/AutoCompleteBoxStyle.js +69 -65
- package/dist/auto-complete/AutoCompleteBoxStyle.js.map +1 -1
- package/dist/auto-complete/ItemHost.js +39 -28
- package/dist/auto-complete/ItemHost.js.map +1 -1
- package/dist/basic/AtomChips.js +348 -355
- package/dist/basic/AtomChips.js.map +1 -1
- package/dist/basic/AtomRepeater.js +1000 -1041
- package/dist/basic/AtomRepeater.js.map +1 -1
- package/dist/basic/AtomSuggestions.js +154 -161
- package/dist/basic/AtomSuggestions.js.map +1 -1
- package/dist/basic/Button.js +63 -60
- package/dist/basic/Button.js.map +1 -1
- package/dist/basic/Calendar.js +215 -255
- package/dist/basic/Calendar.js.map +1 -1
- package/dist/basic/CheckBoxList.js +73 -66
- package/dist/basic/CheckBoxList.js.map +1 -1
- package/dist/basic/Checkbox.js +30 -37
- package/dist/basic/Checkbox.js.map +1 -1
- package/dist/basic/Chip.js +52 -76
- package/dist/basic/Chip.js.map +1 -1
- package/dist/basic/ComboBox.js +75 -70
- package/dist/basic/ComboBox.js.map +1 -1
- package/dist/basic/DataGrid.js +289 -306
- package/dist/basic/DataGrid.js.map +1 -1
- package/dist/basic/DateField.js +90 -97
- package/dist/basic/DateField.js.map +1 -1
- package/dist/basic/DropDown.js +162 -142
- package/dist/basic/DropDown.js.map +1 -1
- package/dist/basic/Editable.js +109 -107
- package/dist/basic/Editable.js.map +1 -1
- package/dist/basic/Expander.js +111 -185
- package/dist/basic/Expander.js.map +1 -1
- package/dist/basic/Form.js +269 -264
- package/dist/basic/Form.js.map +1 -1
- package/dist/basic/FormDialog.js +27 -29
- package/dist/basic/FormDialog.js.map +1 -1
- package/dist/basic/FormField.js +183 -203
- package/dist/basic/FormField.js.map +1 -1
- package/dist/basic/IElement.js +8 -12
- package/dist/basic/IElement.js.map +1 -1
- package/dist/basic/InlinePopup.js +291 -262
- package/dist/basic/InlinePopup.js.map +1 -1
- package/dist/basic/InlinePopupControl.js +34 -33
- package/dist/basic/InlinePopupControl.js.map +1 -1
- package/dist/basic/Input.js +28 -28
- package/dist/basic/Input.js.map +1 -1
- package/dist/basic/ListRepeater.js +45 -61
- package/dist/basic/ListRepeater.js.map +1 -1
- package/dist/basic/MaskedInput.js +53 -66
- package/dist/basic/MaskedInput.js.map +1 -1
- package/dist/basic/MaskedInputDiv.js +78 -99
- package/dist/basic/MaskedInputDiv.js.map +1 -1
- package/dist/basic/Mix.js +34 -33
- package/dist/basic/Mix.js.map +1 -1
- package/dist/basic/Panel.js +34 -34
- package/dist/basic/Panel.js.map +1 -1
- package/dist/basic/PasswordBox.js +46 -49
- package/dist/basic/PasswordBox.js.map +1 -1
- package/dist/basic/PinchZoomView.js +250 -255
- package/dist/basic/PinchZoomView.js.map +1 -1
- package/dist/basic/PopupButton.js +70 -128
- package/dist/basic/PopupButton.js.map +1 -1
- package/dist/basic/RadioButtonList.js +63 -51
- package/dist/basic/RadioButtonList.js.map +1 -1
- package/dist/basic/RefreshLock.js +76 -60
- package/dist/basic/RefreshLock.js.map +1 -1
- package/dist/basic/Row.js +41 -43
- package/dist/basic/Row.js.map +1 -1
- package/dist/basic/Swipe.js +94 -101
- package/dist/basic/Swipe.js.map +1 -1
- package/dist/basic/Switch.js +58 -105
- package/dist/basic/Switch.js.map +1 -1
- package/dist/basic/TableRepeater.js +42 -43
- package/dist/basic/TableRepeater.js.map +1 -1
- package/dist/basic/ToggleButtonBar.js +58 -71
- package/dist/basic/ToggleButtonBar.js.map +1 -1
- package/dist/basic/Tooltip.js +89 -81
- package/dist/basic/Tooltip.js.map +1 -1
- package/dist/basic/combineClasses.js +12 -16
- package/dist/basic/combineClasses.js.map +1 -1
- package/dist/basic/in-built/InBuiltStyles.js +44 -43
- package/dist/basic/in-built/InBuiltStyles.js.map +1 -1
- package/dist/button-bar/AtomButtonBar.js +40 -50
- package/dist/button-bar/AtomButtonBar.js.map +1 -1
- package/dist/buttons/AtomPopupButton.js +18 -18
- package/dist/buttons/AtomPopupButton.js.map +1 -1
- package/dist/buttons/AtomPopupButtonStyle.js +28 -29
- package/dist/buttons/AtomPopupButtonStyle.js.map +1 -1
- package/dist/calendar/AtomCalendar.js +93 -61
- package/dist/calendar/AtomCalendar.js.map +1 -1
- package/dist/calendar/AtomCalendarStyle.js +165 -136
- package/dist/calendar/AtomCalendarStyle.js.map +1 -1
- package/dist/calendar/CalendarViewModel.js +105 -114
- package/dist/calendar/CalendarViewModel.js.map +1 -1
- package/dist/calendar/res/SRCalendar.js +85 -51
- package/dist/calendar/res/SRCalendar.js.map +1 -1
- package/dist/calendar/res/en-US/SRCalendar.js +74 -39
- package/dist/calendar/res/en-US/SRCalendar.js.map +1 -1
- package/dist/data-grid/AtomColumn.js +55 -72
- package/dist/data-grid/AtomColumn.js.map +1 -1
- package/dist/data-grid/AtomDataGrid.js +64 -63
- package/dist/data-grid/AtomDataGrid.js.map +1 -1
- package/dist/data-grid/AtomDataGridStyle.js +50 -50
- package/dist/data-grid/AtomDataGridStyle.js.map +1 -1
- package/dist/data-grid/AtomDataGridViewModel.js +71 -77
- package/dist/data-grid/AtomDataGridViewModel.js.map +1 -1
- package/dist/data-grid/GridTemplate.js +64 -66
- package/dist/data-grid/GridTemplate.js.map +1 -1
- package/dist/data-pager/AtomDataPager.js +104 -94
- package/dist/data-pager/AtomDataPager.js.map +1 -1
- package/dist/date-field/AtomDateField.js +52 -47
- package/dist/date-field/AtomDateField.js.map +1 -1
- package/dist/desktop-app/DesktopApp.js +87 -123
- package/dist/desktop-app/DesktopApp.js.map +1 -1
- package/dist/form/AtomField.js +131 -133
- package/dist/form/AtomField.js.map +1 -1
- package/dist/form/AtomForm.js +84 -98
- package/dist/form/AtomForm.js.map +1 -1
- package/dist/form/AtomFormGroup.js +15 -19
- package/dist/form/AtomFormGroup.js.map +1 -1
- package/dist/form/AtomFormStyle.js +67 -67
- package/dist/form/AtomFormStyle.js.map +1 -1
- package/dist/form/HelpPopup.js +23 -19
- package/dist/form/HelpPopup.js.map +1 -1
- package/dist/html-editor/AtomHtmlEditor.js +295 -383
- package/dist/html-editor/AtomHtmlEditor.js.map +1 -1
- package/dist/html-editor/commands/AddImage.js +79 -65
- package/dist/html-editor/commands/AddImage.js.map +1 -1
- package/dist/html-editor/commands/AddLink.js +98 -88
- package/dist/html-editor/commands/AddLink.js.map +1 -1
- package/dist/html-editor/commands/Align.js +40 -23
- package/dist/html-editor/commands/Align.js.map +1 -1
- package/dist/html-editor/commands/AttachFile.js +93 -73
- package/dist/html-editor/commands/AttachFile.js.map +1 -1
- package/dist/html-editor/commands/Bold.js +23 -19
- package/dist/html-editor/commands/Bold.js.map +1 -1
- package/dist/html-editor/commands/ChangeColor.js +55 -144
- package/dist/html-editor/commands/ChangeColor.js.map +1 -1
- package/dist/html-editor/commands/ChangeFont.js +67 -75
- package/dist/html-editor/commands/ChangeFont.js.map +1 -1
- package/dist/html-editor/commands/ChangeFontSize.js +32 -21
- package/dist/html-editor/commands/ChangeFontSize.js.map +1 -1
- package/dist/html-editor/commands/Command.js +53 -39
- package/dist/html-editor/commands/Command.js.map +1 -1
- package/dist/html-editor/commands/CommandButton.js +93 -56
- package/dist/html-editor/commands/CommandButton.js.map +1 -1
- package/dist/html-editor/commands/Headings.js +42 -25
- package/dist/html-editor/commands/Headings.js.map +1 -1
- package/dist/html-editor/commands/HorizontalRule.js +22 -19
- package/dist/html-editor/commands/HorizontalRule.js.map +1 -1
- package/dist/html-editor/commands/HtmlCommands.js +73 -76
- package/dist/html-editor/commands/HtmlCommands.js.map +1 -1
- package/dist/html-editor/commands/IndentLess.js +23 -19
- package/dist/html-editor/commands/IndentLess.js.map +1 -1
- package/dist/html-editor/commands/IndentMore.js +23 -19
- package/dist/html-editor/commands/IndentMore.js.map +1 -1
- package/dist/html-editor/commands/Italic.js +23 -19
- package/dist/html-editor/commands/Italic.js.map +1 -1
- package/dist/html-editor/commands/NumberedList.js +23 -19
- package/dist/html-editor/commands/NumberedList.js.map +1 -1
- package/dist/html-editor/commands/Quote.js +23 -19
- package/dist/html-editor/commands/Quote.js.map +1 -1
- package/dist/html-editor/commands/RemoveFormat.js +23 -19
- package/dist/html-editor/commands/RemoveFormat.js.map +1 -1
- package/dist/html-editor/commands/Separator.js +24 -27
- package/dist/html-editor/commands/Separator.js.map +1 -1
- package/dist/html-editor/commands/Source.js +95 -67
- package/dist/html-editor/commands/Source.js.map +1 -1
- package/dist/html-editor/commands/StrikeThrough.js +23 -19
- package/dist/html-editor/commands/StrikeThrough.js.map +1 -1
- package/dist/html-editor/commands/Underline.js +23 -19
- package/dist/html-editor/commands/Underline.js.map +1 -1
- package/dist/html-editor/commands/Unlink.js +24 -23
- package/dist/html-editor/commands/Unlink.js.map +1 -1
- package/dist/html-editor/commands/UnorderedList.js +23 -19
- package/dist/html-editor/commands/UnorderedList.js.map +1 -1
- package/dist/mobile/pages/AtomPageFrame.js +177 -192
- package/dist/mobile/pages/AtomPageFrame.js.map +1 -1
- package/dist/mobile/pages/AtomPageFrameStyle.js +56 -54
- package/dist/mobile/pages/AtomPageFrameStyle.js.map +1 -1
- package/dist/mobile/pages/AtomPageFrameTemplate.js +48 -32
- package/dist/mobile/pages/AtomPageFrameTemplate.js.map +1 -1
- package/dist/mobile/pages/Page.js +23 -23
- package/dist/mobile/pages/Page.js.map +1 -1
- package/dist/mobile/pages/PageFrameViewModel.js +154 -148
- package/dist/mobile/pages/PageFrameViewModel.js.map +1 -1
- package/dist/mobile/pages/TitleTemplate.js +22 -22
- package/dist/mobile/pages/TitleTemplate.js.map +1 -1
- package/dist/mobile-app/BottomPopup.js +206 -240
- package/dist/mobile-app/BottomPopup.js.map +1 -1
- package/dist/mobile-app/MobileApp.js +552 -654
- package/dist/mobile-app/MobileApp.js.map +1 -1
- package/dist/player/AtomVideoPlayer.js +221 -267
- package/dist/player/AtomVideoPlayer.js.map +1 -1
- package/dist/player/TrackProgress.js +28 -27
- package/dist/player/TrackProgress.js.map +1 -1
- package/dist/setupBridge.js +74 -98
- package/dist/setupBridge.js.map +1 -1
- package/dist/switch/AtomSwitch.js +43 -37
- package/dist/switch/AtomSwitch.js.map +1 -1
- package/dist/switch/AtomSwitchStyle.js +68 -68
- package/dist/switch/AtomSwitchStyle.js.map +1 -1
- package/dist/time-field/AtomTimeField.js +97 -83
- package/dist/time-field/AtomTimeField.js.map +1 -1
- package/dist/time-field/AtomTimeFieldStyle.js +24 -25
- package/dist/time-field/AtomTimeFieldStyle.js.map +1 -1
- package/dist/toggle-view/AtomToggleView.js +96 -115
- package/dist/toggle-view/AtomToggleView.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/src/PageNavigator.ts +2 -2
|
@@ -1,424 +1,336 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
})(function (require, exports) {
|
|
19
|
-
"use strict";
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.Toolbar = void 0;
|
|
22
|
-
const AtomBinder_1 = require("@web-atoms/core/dist/core/AtomBinder");
|
|
23
|
-
const Bind_1 = require("@web-atoms/core/dist/core/Bind");
|
|
24
|
-
const BindableProperty_1 = require("@web-atoms/core/dist/core/BindableProperty");
|
|
25
|
-
const Colors_1 = require("@web-atoms/core/dist/core/Colors");
|
|
26
|
-
const XNode_1 = require("@web-atoms/core/dist/core/XNode");
|
|
27
|
-
const StyleRule_1 = require("@web-atoms/core/dist/style/StyleRule");
|
|
28
|
-
const AtomControl_1 = require("@web-atoms/core/dist/web/controls/AtomControl");
|
|
29
|
-
const CSS_1 = require("@web-atoms/core/dist/web/styles/CSS");
|
|
30
|
-
const AtomRepeater_1 = require("../basic/AtomRepeater");
|
|
31
|
-
const AddImage_1 = require("./commands/AddImage");
|
|
32
|
-
const AddLink_1 = require("./commands/AddLink");
|
|
33
|
-
const Align_1 = require("./commands/Align");
|
|
34
|
-
const AttachFile_1 = require("./commands/AttachFile");
|
|
35
|
-
const Bold_1 = require("./commands/Bold");
|
|
36
|
-
const ChangeColor_1 = require("./commands/ChangeColor");
|
|
37
|
-
const ChangeFont_1 = require("./commands/ChangeFont");
|
|
38
|
-
const ChangeFontSize_1 = require("./commands/ChangeFontSize");
|
|
39
|
-
const Headings_1 = require("./commands/Headings");
|
|
40
|
-
const HorizontalRule_1 = require("./commands/HorizontalRule");
|
|
41
|
-
const IndentLess_1 = require("./commands/IndentLess");
|
|
42
|
-
const IndentMore_1 = require("./commands/IndentMore");
|
|
43
|
-
const Italic_1 = require("./commands/Italic");
|
|
44
|
-
const NumberedList_1 = require("./commands/NumberedList");
|
|
45
|
-
const RemoveFormat_1 = require("./commands/RemoveFormat");
|
|
46
|
-
const Separator_1 = require("./commands/Separator");
|
|
47
|
-
const Source_1 = require("./commands/Source");
|
|
48
|
-
const StrikeThrough_1 = require("./commands/StrikeThrough");
|
|
49
|
-
const Underline_1 = require("./commands/Underline");
|
|
50
|
-
const Unlink_1 = require("./commands/Unlink");
|
|
51
|
-
const UnorderedList_1 = require("./commands/UnorderedList");
|
|
52
|
-
const link = document.createElement("link");
|
|
53
|
-
link.href = "https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css";
|
|
54
|
-
link.rel = "stylesheet";
|
|
55
|
-
document.head.appendChild(link);
|
|
56
|
-
const css = (0, CSS_1.default)((0, StyleRule_1.default)()
|
|
57
|
-
.display("flex")
|
|
58
|
-
.flexDirection("column")
|
|
59
|
-
.minHeight(500)
|
|
60
|
-
.child((0, StyleRule_1.default)("iframe")
|
|
61
|
-
.flexStretch())
|
|
62
|
-
.child((0, StyleRule_1.default)(".files")
|
|
63
|
-
.child((0, StyleRule_1.default)(".file")
|
|
64
|
-
.flexLayout({ inline: true })
|
|
65
|
-
.borderColor(Colors_1.default.lightGray.withAlphaPercent(0.5))
|
|
66
|
-
.borderWidth(1)
|
|
67
|
-
.borderStyle("solid")
|
|
68
|
-
.borderRadius(15)
|
|
69
|
-
.paddingLeft(10)
|
|
70
|
-
.paddingRight(10)
|
|
71
|
-
.child((0, StyleRule_1.default)("label")
|
|
72
|
-
.maxWidth(100)
|
|
73
|
-
.textEllipsis())))
|
|
74
|
-
.nested((0, StyleRule_1.default)(".toolbar")
|
|
75
|
-
.display("flex")
|
|
76
|
-
.flexWrap("wrap")
|
|
77
|
-
.alignItems("center")
|
|
78
|
-
.child((0, StyleRule_1.default)(".command")
|
|
79
|
-
.display("inline-flex")
|
|
80
|
-
.alignItems("center")
|
|
81
|
-
.justifyContent("space-evenly")
|
|
82
|
-
.border("none")
|
|
83
|
-
.cursor("pointer")
|
|
84
|
-
.backgroundColor(Colors_1.default.transparent)
|
|
85
|
-
.hoverBackgroundColor(Colors_1.default.lightGreen)
|
|
86
|
-
.minWidth(28)
|
|
87
|
-
.height(28)
|
|
88
|
-
.and((0, StyleRule_1.default)(".pressed")
|
|
89
|
-
.backgroundColor(Colors_1.default.lightGray)
|
|
90
|
-
.hoverBackgroundColor(Colors_1.default.lightGreen))
|
|
91
|
-
.nested((0, StyleRule_1.default)(".ri-bold")
|
|
92
|
-
.fontWeight("bold")))));
|
|
93
|
-
function Toolbar(a, ...nodes) {
|
|
94
|
-
return XNode_1.default.create("div", { class: "toolbar" }, ...nodes);
|
|
95
|
-
}
|
|
96
|
-
exports.Toolbar = Toolbar;
|
|
97
|
-
function preventLinkClick(e, editor, doc) {
|
|
98
|
-
let target = e.target;
|
|
99
|
-
const body = doc.body;
|
|
100
|
-
while (target) {
|
|
101
|
-
if (target === body) {
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
if (target.isContentEditable) {
|
|
105
|
-
editor.dispatchEvent(new MouseEvent("click", {
|
|
106
|
-
bubbles: true,
|
|
107
|
-
cancelable: true
|
|
108
|
-
}));
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
if (target.tagName === "A") {
|
|
112
|
-
e.preventDefault();
|
|
113
|
-
}
|
|
114
|
-
target = target.parentElement;
|
|
115
|
-
}
|
|
116
|
-
target = e.target;
|
|
117
|
-
const originalTarget = target;
|
|
118
|
-
const data = new Proxy(originalTarget, {
|
|
119
|
-
get(target, p) {
|
|
120
|
-
if (typeof p !== "string") {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
while (target) {
|
|
124
|
-
const value = target.dataset[p];
|
|
125
|
-
if (value !== void 0) {
|
|
126
|
-
return value;
|
|
127
|
-
}
|
|
128
|
-
target = target.parentElement;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
editor.dispatchEvent(new CustomEvent("editorClick", {
|
|
133
|
-
detail: {
|
|
134
|
-
target,
|
|
135
|
-
data
|
|
136
|
-
},
|
|
137
|
-
bubbles: true,
|
|
138
|
-
cancelable: true
|
|
139
|
-
}));
|
|
1
|
+
System.register(["@web-atoms/core/dist/core/AtomBinder", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/core/BindableProperty", "@web-atoms/core/dist/core/Colors", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/style/StyleRule", "@web-atoms/core/dist/web/controls/AtomControl", "@web-atoms/core/dist/web/styles/CSS", "../basic/AtomRepeater", "./commands/AddImage", "./commands/AddLink", "./commands/Align", "./commands/AttachFile", "./commands/Bold", "./commands/ChangeColor", "./commands/ChangeFont", "./commands/ChangeFontSize", "./commands/Headings", "./commands/HorizontalRule", "./commands/IndentLess", "./commands/IndentMore", "./commands/Italic", "./commands/NumberedList", "./commands/RemoveFormat", "./commands/Separator", "./commands/Source", "./commands/StrikeThrough", "./commands/Underline", "./commands/Unlink", "./commands/UnorderedList"], function (_export, _context) {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var AtomBinder, Bind, BindableProperty, Colors, XNode, StyleRule, AtomControl, CSS, AtomRepeater, AddImage, showImageDialog, AddLink, Align, AttachFile, Bold, ChangeColor, ChangeFont, ChangeFontSize, Headings, HorizontalRule, IndentLess, IndentMore, Italic, NumberedList, RemoveFormat, Separator, Source, StrikeThrough, Underline, Unlink, UnorderedList, AtomHtmlEditor, __decorate, __metadata, link, css;
|
|
5
|
+
function Toolbar(a, ...nodes) {
|
|
6
|
+
return XNode.create("div", {
|
|
7
|
+
class: "toolbar"
|
|
8
|
+
}, ...nodes);
|
|
9
|
+
}
|
|
10
|
+
function preventLinkClick(e, editor, doc) {
|
|
11
|
+
let target = e.target;
|
|
12
|
+
const body = doc.body;
|
|
13
|
+
while (target) {
|
|
14
|
+
if (target === body) {
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
if (target.isContentEditable) {
|
|
140
18
|
editor.dispatchEvent(new MouseEvent("click", {
|
|
141
|
-
|
|
142
|
-
|
|
19
|
+
bubbles: true,
|
|
20
|
+
cancelable: true
|
|
143
21
|
}));
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
// commandParameter = ds.commandParameters;
|
|
151
|
-
// if (commandParameter) {
|
|
152
|
-
// commandParameter = JSON.parse(commandParameter);
|
|
153
|
-
// }
|
|
154
|
-
// }
|
|
155
|
-
// // this will force currentTarget/lastTarget to be updated
|
|
156
|
-
// // in navigation and popup service
|
|
157
|
-
// editor.dispatchEvent(new CustomEvent("click", {
|
|
158
|
-
// bubbles: true
|
|
159
|
-
// }));
|
|
160
|
-
// editor.dispatchEvent(new CustomEvent<IEditorCommand>("command", {
|
|
161
|
-
// bubbles: true,
|
|
162
|
-
// detail: {
|
|
163
|
-
// target,
|
|
164
|
-
// command,
|
|
165
|
-
// commandParameter
|
|
166
|
-
// }
|
|
167
|
-
// }));
|
|
168
|
-
// e.preventDefault();
|
|
169
|
-
// return;
|
|
170
|
-
// }
|
|
171
|
-
// const click = ds.click;
|
|
172
|
-
// if (click) {
|
|
173
|
-
// editor.dispatchEvent(new CustomEvent("click", {
|
|
174
|
-
// bubbles: true
|
|
175
|
-
// }));
|
|
176
|
-
// editor.dispatchEvent(new CustomEvent("htmlEditorClick", {
|
|
177
|
-
// detail: {
|
|
178
|
-
// target,
|
|
179
|
-
// command: click
|
|
180
|
-
// }
|
|
181
|
-
// }));
|
|
182
|
-
// }
|
|
183
|
-
// if (target.isContentEditable) {
|
|
184
|
-
// break;
|
|
185
|
-
// }
|
|
186
|
-
// if (target.tagName === "A") {
|
|
187
|
-
// editor.dispatchEvent(new CustomEvent("click", {
|
|
188
|
-
// bubbles: true
|
|
189
|
-
// }));
|
|
190
|
-
// e.preventDefault();
|
|
191
|
-
// return false;
|
|
192
|
-
// }
|
|
193
|
-
// target = target.parentElement;
|
|
194
|
-
// }
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (target.tagName === "A") {
|
|
25
|
+
e.preventDefault();
|
|
26
|
+
}
|
|
27
|
+
target = target.parentElement;
|
|
195
28
|
}
|
|
196
|
-
|
|
29
|
+
target = e.target;
|
|
30
|
+
const originalTarget = target;
|
|
31
|
+
const data = new Proxy(originalTarget, {
|
|
32
|
+
get(target, p) {
|
|
33
|
+
if (typeof p !== "string") {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
while (target) {
|
|
37
|
+
const value = target.dataset[p];
|
|
38
|
+
if (value !== void 0) {
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
target = target.parentElement;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
editor.dispatchEvent(new CustomEvent("editorClick", {
|
|
46
|
+
detail: {
|
|
47
|
+
target,
|
|
48
|
+
data
|
|
49
|
+
},
|
|
50
|
+
bubbles: true,
|
|
51
|
+
cancelable: true
|
|
52
|
+
}));
|
|
53
|
+
editor.dispatchEvent(new MouseEvent("click", {
|
|
54
|
+
bubbles: true,
|
|
55
|
+
cancelable: true
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
_export({
|
|
59
|
+
Toolbar: Toolbar,
|
|
60
|
+
default: void 0
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
setters: [function (_webAtomsCoreDistCoreAtomBinder) {
|
|
64
|
+
AtomBinder = _webAtomsCoreDistCoreAtomBinder.AtomBinder;
|
|
65
|
+
}, function (_webAtomsCoreDistCoreBind) {
|
|
66
|
+
Bind = _webAtomsCoreDistCoreBind.default;
|
|
67
|
+
}, function (_webAtomsCoreDistCoreBindableProperty) {
|
|
68
|
+
BindableProperty = _webAtomsCoreDistCoreBindableProperty.BindableProperty;
|
|
69
|
+
}, function (_webAtomsCoreDistCoreColors) {
|
|
70
|
+
Colors = _webAtomsCoreDistCoreColors.default;
|
|
71
|
+
}, function (_webAtomsCoreDistCoreXNode) {
|
|
72
|
+
XNode = _webAtomsCoreDistCoreXNode.default;
|
|
73
|
+
}, function (_webAtomsCoreDistStyleStyleRule) {
|
|
74
|
+
StyleRule = _webAtomsCoreDistStyleStyleRule.default;
|
|
75
|
+
}, function (_webAtomsCoreDistWebControlsAtomControl) {
|
|
76
|
+
AtomControl = _webAtomsCoreDistWebControlsAtomControl.AtomControl;
|
|
77
|
+
}, function (_webAtomsCoreDistWebStylesCSS) {
|
|
78
|
+
CSS = _webAtomsCoreDistWebStylesCSS.default;
|
|
79
|
+
}, function (_basicAtomRepeater) {
|
|
80
|
+
AtomRepeater = _basicAtomRepeater.default;
|
|
81
|
+
}, function (_commandsAddImage) {
|
|
82
|
+
AddImage = _commandsAddImage.default;
|
|
83
|
+
showImageDialog = _commandsAddImage.showImageDialog;
|
|
84
|
+
}, function (_commandsAddLink) {
|
|
85
|
+
AddLink = _commandsAddLink.default;
|
|
86
|
+
}, function (_commandsAlign) {
|
|
87
|
+
Align = _commandsAlign.default;
|
|
88
|
+
}, function (_commandsAttachFile) {
|
|
89
|
+
AttachFile = _commandsAttachFile.default;
|
|
90
|
+
}, function (_commandsBold) {
|
|
91
|
+
Bold = _commandsBold.default;
|
|
92
|
+
}, function (_commandsChangeColor) {
|
|
93
|
+
ChangeColor = _commandsChangeColor.default;
|
|
94
|
+
}, function (_commandsChangeFont) {
|
|
95
|
+
ChangeFont = _commandsChangeFont.default;
|
|
96
|
+
}, function (_commandsChangeFontSize) {
|
|
97
|
+
ChangeFontSize = _commandsChangeFontSize.default;
|
|
98
|
+
}, function (_commandsHeadings) {
|
|
99
|
+
Headings = _commandsHeadings.default;
|
|
100
|
+
}, function (_commandsHorizontalRule) {
|
|
101
|
+
HorizontalRule = _commandsHorizontalRule.default;
|
|
102
|
+
}, function (_commandsIndentLess) {
|
|
103
|
+
IndentLess = _commandsIndentLess.default;
|
|
104
|
+
}, function (_commandsIndentMore) {
|
|
105
|
+
IndentMore = _commandsIndentMore.default;
|
|
106
|
+
}, function (_commandsItalic) {
|
|
107
|
+
Italic = _commandsItalic.default;
|
|
108
|
+
}, function (_commandsNumberedList) {
|
|
109
|
+
NumberedList = _commandsNumberedList.default;
|
|
110
|
+
}, function (_commandsRemoveFormat) {
|
|
111
|
+
RemoveFormat = _commandsRemoveFormat.default;
|
|
112
|
+
}, function (_commandsSeparator) {
|
|
113
|
+
Separator = _commandsSeparator.default;
|
|
114
|
+
}, function (_commandsSource) {
|
|
115
|
+
Source = _commandsSource.default;
|
|
116
|
+
}, function (_commandsStrikeThrough) {
|
|
117
|
+
StrikeThrough = _commandsStrikeThrough.default;
|
|
118
|
+
}, function (_commandsUnderline) {
|
|
119
|
+
Underline = _commandsUnderline.default;
|
|
120
|
+
}, function (_commandsUnlink) {
|
|
121
|
+
Unlink = _commandsUnlink.default;
|
|
122
|
+
}, function (_commandsUnorderedList) {
|
|
123
|
+
UnorderedList = _commandsUnorderedList.default;
|
|
124
|
+
}],
|
|
125
|
+
execute: function () {
|
|
126
|
+
__decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
|
|
127
|
+
var c = arguments.length,
|
|
128
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
129
|
+
d;
|
|
130
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
131
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
132
|
+
};
|
|
133
|
+
__metadata = void 0 && (void 0).__metadata || function (k, v) {
|
|
134
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
135
|
+
};
|
|
136
|
+
link = document.createElement("link");
|
|
137
|
+
link.href = "https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css";
|
|
138
|
+
link.rel = "stylesheet";
|
|
139
|
+
document.head.appendChild(link);
|
|
140
|
+
css = CSS(StyleRule().display("flex").flexDirection("column").minHeight(500).child(StyleRule("iframe").flexStretch()).child(StyleRule(".files").child(StyleRule(".file").flexLayout({
|
|
141
|
+
inline: true
|
|
142
|
+
}).borderColor(Colors.lightGray.withAlphaPercent(0.5)).borderWidth(1).borderStyle("solid").borderRadius(15).paddingLeft(10).paddingRight(10).child(StyleRule("label").maxWidth(100).textEllipsis()))).nested(StyleRule(".toolbar").display("flex").flexWrap("wrap").alignItems("center").child(StyleRule(".command").display("inline-flex").alignItems("center").justifyContent("space-evenly").border("none").cursor("pointer").backgroundColor(Colors.transparent).hoverBackgroundColor(Colors.lightGreen).minWidth(28).height(28).and(StyleRule(".pressed").backgroundColor(Colors.lightGray).hoverBackgroundColor(Colors.lightGreen)).nested(StyleRule(".ri-bold").fontWeight("bold")))));
|
|
143
|
+
_export("default", AtomHtmlEditor = class AtomHtmlEditor extends AtomControl {
|
|
197
144
|
get htmlContent() {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
console.warn(ex);
|
|
205
|
-
}
|
|
145
|
+
var _a, _b;
|
|
146
|
+
try {
|
|
147
|
+
return (_b = (_a = this.editor) === null || _a === void 0 ? void 0 : _a.innerHTML) !== null && _b !== void 0 ? _b : this.initialContent;
|
|
148
|
+
} catch (ex) {
|
|
149
|
+
console.warn(ex);
|
|
150
|
+
}
|
|
206
151
|
}
|
|
207
152
|
set htmlContent(v) {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
AtomBinder_1.AtomBinder.refreshValue(this, "htmlContent");
|
|
153
|
+
if (this.editor) {
|
|
154
|
+
this.editor.innerHTML = v;
|
|
155
|
+
} else {
|
|
156
|
+
this.initialContent = v;
|
|
157
|
+
}
|
|
158
|
+
AtomBinder.refreshValue(this, "htmlContent");
|
|
215
159
|
}
|
|
216
160
|
insertImage(s, e) {
|
|
217
|
-
|
|
161
|
+
return showImageDialog(s, e);
|
|
218
162
|
}
|
|
219
163
|
executeCommand(cmd, showUI, value) {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
164
|
+
const r = this.editorDocument.execCommand(cmd, showUI, value);
|
|
165
|
+
setTimeout(() => this.version++, 1);
|
|
166
|
+
return r;
|
|
223
167
|
}
|
|
224
168
|
queryCommandState(cmd, ...a) {
|
|
225
|
-
|
|
169
|
+
return this.editorDocument.queryCommandState(cmd);
|
|
226
170
|
}
|
|
227
171
|
getStyle(name, v) {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
172
|
+
try {
|
|
173
|
+
const node = this.editorWindow.getSelection().getRangeAt(0);
|
|
174
|
+
const e = node.startContainer.parentElement;
|
|
175
|
+
return this.editorWindow.getComputedStyle(e)[name];
|
|
176
|
+
} catch (ex) {
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
236
179
|
}
|
|
237
180
|
onPropertyChanged(name) {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
181
|
+
super.onPropertyChanged(name);
|
|
182
|
+
if (name === "tags") {
|
|
183
|
+
this.setupTags();
|
|
184
|
+
}
|
|
242
185
|
}
|
|
243
186
|
setupTags() {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
187
|
+
const doc = this.editorDocument;
|
|
188
|
+
if (!doc) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
if (Array.isArray(this.tags)) {
|
|
192
|
+
for (const {
|
|
193
|
+
name,
|
|
194
|
+
style
|
|
195
|
+
} of this.tags) {
|
|
196
|
+
if (style) {
|
|
197
|
+
const styleElement = doc.createElement("style");
|
|
198
|
+
styleElement.textContent = `*[data-command=${name}] {
|
|
253
199
|
${style.toStyleSheet()}
|
|
254
200
|
}`;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
201
|
+
doc.head.appendChild(styleElement);
|
|
202
|
+
}
|
|
258
203
|
}
|
|
204
|
+
}
|
|
259
205
|
}
|
|
260
206
|
preCreate() {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
207
|
+
this.version = 1;
|
|
208
|
+
this.files = [];
|
|
209
|
+
this.runAfterInit(() => {
|
|
210
|
+
this.setup();
|
|
211
|
+
});
|
|
212
|
+
this.element.classList.add(css);
|
|
213
|
+
this.element.classList.add("html-editor");
|
|
268
214
|
}
|
|
269
215
|
onPasteEvent(e) {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
e.preventDefault();
|
|
216
|
+
if (!e.clipboardData.types.find(x => x === "text/html")) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
const d = e.clipboardData.getData("text/plain");
|
|
220
|
+
if (d) {
|
|
221
|
+
const s = window.getSelection();
|
|
222
|
+
const r = s.getRangeAt(0);
|
|
223
|
+
const p = document.createElement("p");
|
|
224
|
+
const span = document.createElement("span");
|
|
225
|
+
span.textContent = d;
|
|
226
|
+
p.appendChild(span);
|
|
227
|
+
r.insertNode(p);
|
|
228
|
+
r.setStartAfter(p);
|
|
229
|
+
}
|
|
230
|
+
e.preventDefault();
|
|
287
231
|
}
|
|
288
232
|
onInputEvent(e) {
|
|
289
|
-
|
|
290
|
-
console.log(e);
|
|
233
|
+
console.log(e);
|
|
291
234
|
}
|
|
292
235
|
setup() {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
236
|
+
var _a;
|
|
237
|
+
const frame = this.element.getElementsByTagName("iframe")[0];
|
|
238
|
+
const doc = frame.contentWindow.document;
|
|
239
|
+
doc.open();
|
|
240
|
+
const baseUrl = `${location.protocol}//${location.host}`;
|
|
241
|
+
doc.writeln(`<base href="${baseUrl}"></base><div id="editor"><p> </p></div>`);
|
|
242
|
+
doc.close();
|
|
243
|
+
const style = doc.createElement("style");
|
|
244
|
+
style.textContent = `body {
|
|
302
245
|
font-family: arial,sans-serif
|
|
303
246
|
}
|
|
304
247
|
#editor {
|
|
305
248
|
min-height: 500px;
|
|
306
249
|
}
|
|
307
250
|
`;
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
AtomBinder_1.AtomBinder.refreshValue(this, "htmlContent");
|
|
321
|
-
this.element.dispatchEvent(new CustomEvent("documentUpdated", {
|
|
322
|
-
detail: this.editor
|
|
323
|
-
}));
|
|
324
|
-
this.documentUpdated(this.editor);
|
|
325
|
-
}, 1);
|
|
326
|
-
this.editor.addEventListener("click", updateVersion);
|
|
327
|
-
this.editor.addEventListener("keydown", updateVersion);
|
|
328
|
-
this.editor.addEventListener("keypress", updateVersion);
|
|
329
|
-
this.editor.addEventListener("input", updateVersion);
|
|
330
|
-
this.editorWindow = frame.contentWindow;
|
|
331
|
-
this.editorDocument = doc;
|
|
332
|
-
updateVersion();
|
|
333
|
-
this.documentCreated(this.editor);
|
|
334
|
-
this.element.dispatchEvent(new CustomEvent("documentCreated", {
|
|
335
|
-
detail: this.editor
|
|
251
|
+
doc.head.appendChild(style);
|
|
252
|
+
doc.body.addEventListener("click", e => preventLinkClick(e, this.element, doc));
|
|
253
|
+
this.editor = doc.getElementById("editor");
|
|
254
|
+
this.editor.contentEditable = "true";
|
|
255
|
+
this.editor.innerHTML = (_a = this.initialContent) !== null && _a !== void 0 ? _a : "";
|
|
256
|
+
doc.execCommand("styleWithCSS");
|
|
257
|
+
doc.execCommand("insertBrOnReturn");
|
|
258
|
+
const updateVersion = () => setTimeout(() => {
|
|
259
|
+
this.version++;
|
|
260
|
+
AtomBinder.refreshValue(this, "htmlContent");
|
|
261
|
+
this.element.dispatchEvent(new CustomEvent("documentUpdated", {
|
|
262
|
+
detail: this.editor
|
|
336
263
|
}));
|
|
337
|
-
this.
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
264
|
+
this.documentUpdated(this.editor);
|
|
265
|
+
}, 1);
|
|
266
|
+
this.editor.addEventListener("click", updateVersion);
|
|
267
|
+
this.editor.addEventListener("keydown", updateVersion);
|
|
268
|
+
this.editor.addEventListener("keypress", updateVersion);
|
|
269
|
+
this.editor.addEventListener("input", updateVersion);
|
|
270
|
+
this.editorWindow = frame.contentWindow;
|
|
271
|
+
this.editorDocument = doc;
|
|
272
|
+
updateVersion();
|
|
273
|
+
this.documentCreated(this.editor);
|
|
274
|
+
this.element.dispatchEvent(new CustomEvent("documentCreated", {
|
|
275
|
+
detail: this.editor
|
|
276
|
+
}));
|
|
277
|
+
this.registerDisposable({
|
|
278
|
+
dispose: () => {
|
|
279
|
+
this.editor.removeEventListener("click", updateVersion);
|
|
280
|
+
this.editor.removeEventListener("keydown", updateVersion);
|
|
281
|
+
this.editor.removeEventListener("keypress", updateVersion);
|
|
282
|
+
this.editor.removeEventListener("input", updateVersion);
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
this.bindEvent(this.element, "editorClick", ce => {
|
|
286
|
+
const {
|
|
287
|
+
detail: {
|
|
288
|
+
data
|
|
289
|
+
}
|
|
290
|
+
} = ce;
|
|
291
|
+
for (const {
|
|
292
|
+
name,
|
|
293
|
+
handler
|
|
294
|
+
} of this.tags) {
|
|
295
|
+
if (name === data.command || name === data.clickEvent) {
|
|
296
|
+
handler(ce);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
this.setupTags();
|
|
360
301
|
}
|
|
302
|
+
documentCreated(e) {}
|
|
303
|
+
documentUpdated(e) {}
|
|
361
304
|
render(node, e, creator) {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
XNode_1.default.create(Separator_1.default, null),
|
|
384
|
-
XNode_1.default.create(AddImage_1.default, null),
|
|
385
|
-
XNode_1.default.create(AttachFile_1.default, null),
|
|
386
|
-
XNode_1.default.create(Separator_1.default, null),
|
|
387
|
-
XNode_1.default.create(AddLink_1.default, null),
|
|
388
|
-
XNode_1.default.create(Unlink_1.default, null),
|
|
389
|
-
XNode_1.default.create(RemoveFormat_1.default, null),
|
|
390
|
-
XNode_1.default.create(Separator_1.default, null),
|
|
391
|
-
XNode_1.default.create(Source_1.default, null));
|
|
392
|
-
}
|
|
393
|
-
super.render(XNode_1.default.create("div", Object.assign({}, node.attributes),
|
|
394
|
-
...node.children,
|
|
395
|
-
XNode_1.default.create(AtomRepeater_1.default, { class: "files", "event-item-delete": (ce) => this.files.remove(ce.detail), items: Bind_1.default.oneWay(() => this.files), itemRenderer: (file) => XNode_1.default.create("div", { class: "file" },
|
|
396
|
-
XNode_1.default.create("i", { class: "ri-attachment-2" }),
|
|
397
|
-
XNode_1.default.create("label", { text: file.name }),
|
|
398
|
-
XNode_1.default.create("i", { "data-click-event": "item-delete", class: "ri-close-circle-fill" })) }),
|
|
399
|
-
XNode_1.default.create("iframe", { class: "editor-frame" })));
|
|
305
|
+
this.render = super.render;
|
|
306
|
+
if (!node.children || node.children.length === 0) {
|
|
307
|
+
node.children[0] = 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(AddImage, 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));
|
|
308
|
+
}
|
|
309
|
+
super.render(XNode.create("div", Object.assign({}, node.attributes), ...node.children, XNode.create(AtomRepeater, {
|
|
310
|
+
class: "files",
|
|
311
|
+
"event-item-delete": ce => this.files.remove(ce.detail),
|
|
312
|
+
items: Bind.oneWay(() => this.files),
|
|
313
|
+
itemRenderer: file => XNode.create("div", {
|
|
314
|
+
class: "file"
|
|
315
|
+
}, XNode.create("i", {
|
|
316
|
+
class: "ri-attachment-2"
|
|
317
|
+
}), XNode.create("label", {
|
|
318
|
+
text: file.name
|
|
319
|
+
}), XNode.create("i", {
|
|
320
|
+
"data-click-event": "item-delete",
|
|
321
|
+
class: "ri-close-circle-fill"
|
|
322
|
+
}))
|
|
323
|
+
}), XNode.create("iframe", {
|
|
324
|
+
class: "editor-frame"
|
|
325
|
+
})));
|
|
400
326
|
}
|
|
327
|
+
});
|
|
328
|
+
__decorate([BindableProperty, __metadata("design:type", String)], AtomHtmlEditor.prototype, "content", void 0);
|
|
329
|
+
__decorate([BindableProperty, __metadata("design:type", Array)], AtomHtmlEditor.prototype, "header", void 0);
|
|
330
|
+
__decorate([BindableProperty, __metadata("design:type", Number)], AtomHtmlEditor.prototype, "version", void 0);
|
|
331
|
+
__decorate([BindableProperty, __metadata("design:type", Array)], AtomHtmlEditor.prototype, "files", void 0);
|
|
332
|
+
__decorate([BindableProperty, __metadata("design:type", Array)], AtomHtmlEditor.prototype, "tags", void 0);
|
|
401
333
|
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
__metadata("design:type", String)
|
|
405
|
-
], AtomHtmlEditor.prototype, "content", void 0);
|
|
406
|
-
__decorate([
|
|
407
|
-
BindableProperty_1.BindableProperty,
|
|
408
|
-
__metadata("design:type", Array)
|
|
409
|
-
], AtomHtmlEditor.prototype, "header", void 0);
|
|
410
|
-
__decorate([
|
|
411
|
-
BindableProperty_1.BindableProperty,
|
|
412
|
-
__metadata("design:type", Number)
|
|
413
|
-
], AtomHtmlEditor.prototype, "version", void 0);
|
|
414
|
-
__decorate([
|
|
415
|
-
BindableProperty_1.BindableProperty,
|
|
416
|
-
__metadata("design:type", Array)
|
|
417
|
-
], AtomHtmlEditor.prototype, "files", void 0);
|
|
418
|
-
__decorate([
|
|
419
|
-
BindableProperty_1.BindableProperty,
|
|
420
|
-
__metadata("design:type", Array)
|
|
421
|
-
], AtomHtmlEditor.prototype, "tags", void 0);
|
|
422
|
-
exports.default = AtomHtmlEditor;
|
|
423
|
-
});
|
|
334
|
+
};
|
|
335
|
+
});
|
|
424
336
|
//# sourceMappingURL=AtomHtmlEditor.js.map
|