@progress/kendo-vue-editor 2.7.1-dev.202112201220 → 2.7.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.
Files changed (192) hide show
  1. package/dist/es/Editor.d.ts +295 -0
  2. package/dist/es/Editor.js +697 -0
  3. package/dist/es/EditorProps.d.ts +176 -0
  4. package/dist/es/EditorProps.js +0 -0
  5. package/dist/es/additionalTypes.ts +3 -0
  6. package/dist/es/config/defaultStyles.d.ts +12 -0
  7. package/dist/es/config/defaultStyles.js +12 -0
  8. package/dist/es/config/pasteSettings.d.ts +6 -0
  9. package/dist/es/config/pasteSettings.js +0 -0
  10. package/dist/es/config/schema.d.ts +8 -0
  11. package/dist/es/config/schema.js +51 -0
  12. package/dist/es/config/shortcuts.d.ts +22 -0
  13. package/dist/es/config/shortcuts.js +70 -0
  14. package/dist/es/config/toolsSettings.d.ts +481 -0
  15. package/dist/es/config/toolsSettings.js +523 -0
  16. package/dist/es/dialogs/EditorDialogProps.d.ts +26 -0
  17. package/dist/es/dialogs/EditorDialogProps.js +0 -0
  18. package/dist/es/dialogs/FindReplace.d.ts +65 -0
  19. package/dist/es/dialogs/FindReplace.js +789 -0
  20. package/dist/es/dialogs/insertImage.d.ts +52 -0
  21. package/dist/es/dialogs/insertImage.js +282 -0
  22. package/dist/es/dialogs/insertLink.d.ts +50 -0
  23. package/dist/es/dialogs/insertLink.js +286 -0
  24. package/dist/es/dialogs/main.d.ts +1 -0
  25. package/dist/es/dialogs/main.js +42 -0
  26. package/dist/es/dialogs/viewHtml.d.ts +49 -0
  27. package/dist/es/dialogs/viewHtml.js +144 -0
  28. package/dist/es/main.d.ts +166 -1
  29. package/dist/es/main.js +110 -0
  30. package/dist/es/messages/index.d.ts +479 -0
  31. package/dist/es/messages/index.js +485 -0
  32. package/dist/es/package-metadata.d.ts +5 -0
  33. package/dist/es/package-metadata.js +11 -0
  34. package/dist/es/tools/Align.d.ts +37 -0
  35. package/dist/es/tools/Align.js +116 -0
  36. package/dist/es/tools/Indent.d.ts +42 -0
  37. package/dist/es/tools/Indent.js +127 -0
  38. package/dist/es/tools/InlineFormat.d.ts +72 -0
  39. package/dist/es/tools/InlineFormat.js +125 -0
  40. package/dist/es/tools/Outdent.d.ts +42 -0
  41. package/dist/es/tools/Outdent.js +129 -0
  42. package/dist/es/tools/ToolProps.d.ts +34 -0
  43. package/dist/es/tools/ToolProps.js +0 -0
  44. package/dist/es/tools/applyColor.d.ts +43 -0
  45. package/dist/es/tools/applyColor.js +92 -0
  46. package/dist/es/tools/cleanFormatting.d.ts +47 -0
  47. package/dist/es/tools/cleanFormatting.js +114 -0
  48. package/dist/es/tools/findReplace.d.ts +41 -0
  49. package/dist/es/tools/findReplace.js +119 -0
  50. package/dist/es/tools/fontStyle.d.ts +53 -0
  51. package/dist/es/tools/fontStyle.js +158 -0
  52. package/dist/es/tools/formatBlock.d.ts +43 -0
  53. package/dist/es/tools/formatBlock.js +150 -0
  54. package/dist/es/tools/history.d.ts +18 -0
  55. package/dist/es/tools/history.js +4 -0
  56. package/dist/es/tools/insertImage.d.ts +44 -0
  57. package/dist/es/tools/insertImage.js +130 -0
  58. package/dist/es/tools/insertLink.d.ts +44 -0
  59. package/dist/es/tools/insertLink.js +130 -0
  60. package/dist/es/tools/insertTable/index.d.ts +1 -0
  61. package/dist/es/tools/insertTable/index.js +6 -0
  62. package/dist/es/tools/insertTable/popup.d.ts +78 -0
  63. package/dist/es/tools/insertTable/popup.js +168 -0
  64. package/dist/es/tools/insertTable/popupGrid.d.ts +49 -0
  65. package/dist/es/tools/insertTable/popupGrid.js +131 -0
  66. package/dist/es/tools/insertTable/tool.d.ts +51 -0
  67. package/dist/es/tools/insertTable/tool.js +165 -0
  68. package/dist/es/tools/lists.d.ts +52 -0
  69. package/dist/es/tools/lists.js +132 -0
  70. package/dist/es/tools/main.d.ts +137 -0
  71. package/dist/es/tools/main.js +0 -0
  72. package/dist/es/tools/pdf.d.ts +56 -0
  73. package/dist/es/tools/pdf.js +105 -0
  74. package/dist/es/tools/print.d.ts +47 -0
  75. package/dist/es/tools/print.js +109 -0
  76. package/dist/es/tools/proseMirrorTool.d.ts +43 -0
  77. package/dist/es/tools/proseMirrorTool.js +110 -0
  78. package/dist/es/tools/selectAll.d.ts +47 -0
  79. package/dist/es/tools/selectAll.js +102 -0
  80. package/dist/es/tools/tableEdit.d.ts +51 -0
  81. package/dist/es/tools/tableEdit.js +42 -0
  82. package/dist/es/tools/unlink.d.ts +42 -0
  83. package/dist/es/tools/unlink.js +110 -0
  84. package/dist/es/tools/utils.d.ts +18 -0
  85. package/dist/es/tools/utils.js +36 -0
  86. package/dist/es/tools/viewHtml.d.ts +49 -0
  87. package/dist/es/tools/viewHtml.js +125 -0
  88. package/dist/es/utils/browser-detection.d.ts +4 -0
  89. package/dist/es/utils/browser-detection.js +5 -0
  90. package/dist/es/utils/controlled-value.d.ts +5 -0
  91. package/dist/es/utils/controlled-value.js +31 -0
  92. package/dist/es/utils/index.d.ts +358 -0
  93. package/dist/es/utils/index.js +422 -0
  94. package/dist/es/utils/props-key.d.ts +5 -0
  95. package/dist/es/utils/props-key.js +5 -0
  96. package/dist/npm/Editor.d.ts +295 -0
  97. package/dist/npm/Editor.js +738 -0
  98. package/dist/npm/EditorProps.d.ts +176 -0
  99. package/dist/npm/EditorProps.js +2 -0
  100. package/dist/npm/additionalTypes.ts +3 -0
  101. package/dist/npm/config/defaultStyles.d.ts +12 -0
  102. package/dist/npm/config/defaultStyles.js +15 -0
  103. package/dist/npm/config/pasteSettings.d.ts +6 -0
  104. package/dist/npm/config/pasteSettings.js +2 -0
  105. package/dist/npm/config/schema.d.ts +8 -0
  106. package/dist/npm/config/schema.js +55 -0
  107. package/dist/npm/config/shortcuts.d.ts +22 -0
  108. package/dist/npm/config/shortcuts.js +79 -0
  109. package/dist/npm/config/toolsSettings.d.ts +481 -0
  110. package/dist/npm/config/toolsSettings.js +526 -0
  111. package/dist/npm/dialogs/EditorDialogProps.d.ts +26 -0
  112. package/dist/npm/dialogs/EditorDialogProps.js +2 -0
  113. package/dist/npm/dialogs/FindReplace.d.ts +65 -0
  114. package/dist/npm/dialogs/FindReplace.js +805 -0
  115. package/dist/npm/dialogs/insertImage.d.ts +52 -0
  116. package/dist/npm/dialogs/insertImage.js +296 -0
  117. package/dist/npm/dialogs/insertLink.d.ts +50 -0
  118. package/dist/npm/dialogs/insertLink.js +300 -0
  119. package/dist/npm/dialogs/main.d.ts +1 -0
  120. package/dist/npm/dialogs/main.js +42 -0
  121. package/dist/npm/dialogs/viewHtml.d.ts +49 -0
  122. package/dist/npm/dialogs/viewHtml.js +159 -0
  123. package/dist/npm/main.d.ts +166 -1
  124. package/dist/npm/main.js +89 -0
  125. package/dist/npm/messages/index.d.ts +479 -0
  126. package/dist/npm/messages/index.js +488 -0
  127. package/dist/npm/package-metadata.d.ts +5 -0
  128. package/dist/npm/package-metadata.js +14 -0
  129. package/dist/npm/tools/Align.d.ts +37 -0
  130. package/dist/npm/tools/Align.js +130 -0
  131. package/dist/npm/tools/Indent.d.ts +42 -0
  132. package/dist/npm/tools/Indent.js +140 -0
  133. package/dist/npm/tools/InlineFormat.d.ts +72 -0
  134. package/dist/npm/tools/InlineFormat.js +138 -0
  135. package/dist/npm/tools/Outdent.d.ts +42 -0
  136. package/dist/npm/tools/Outdent.js +142 -0
  137. package/dist/npm/tools/ToolProps.d.ts +34 -0
  138. package/dist/npm/tools/ToolProps.js +2 -0
  139. package/dist/npm/tools/applyColor.d.ts +43 -0
  140. package/dist/npm/tools/applyColor.js +105 -0
  141. package/dist/npm/tools/cleanFormatting.d.ts +47 -0
  142. package/dist/npm/tools/cleanFormatting.js +128 -0
  143. package/dist/npm/tools/findReplace.d.ts +41 -0
  144. package/dist/npm/tools/findReplace.js +133 -0
  145. package/dist/npm/tools/fontStyle.d.ts +53 -0
  146. package/dist/npm/tools/fontStyle.js +172 -0
  147. package/dist/npm/tools/formatBlock.d.ts +43 -0
  148. package/dist/npm/tools/formatBlock.js +164 -0
  149. package/dist/npm/tools/history.d.ts +18 -0
  150. package/dist/npm/tools/history.js +10 -0
  151. package/dist/npm/tools/insertImage.d.ts +44 -0
  152. package/dist/npm/tools/insertImage.js +144 -0
  153. package/dist/npm/tools/insertLink.d.ts +44 -0
  154. package/dist/npm/tools/insertLink.js +144 -0
  155. package/dist/npm/tools/insertTable/index.d.ts +1 -0
  156. package/dist/npm/tools/insertTable/index.js +6 -0
  157. package/dist/npm/tools/insertTable/popup.d.ts +78 -0
  158. package/dist/npm/tools/insertTable/popup.js +179 -0
  159. package/dist/npm/tools/insertTable/popupGrid.d.ts +49 -0
  160. package/dist/npm/tools/insertTable/popupGrid.js +141 -0
  161. package/dist/npm/tools/insertTable/tool.d.ts +51 -0
  162. package/dist/npm/tools/insertTable/tool.js +180 -0
  163. package/dist/npm/tools/lists.d.ts +52 -0
  164. package/dist/npm/tools/lists.js +145 -0
  165. package/dist/npm/tools/main.d.ts +137 -0
  166. package/dist/npm/tools/main.js +5 -0
  167. package/dist/npm/tools/pdf.d.ts +56 -0
  168. package/dist/npm/tools/pdf.js +119 -0
  169. package/dist/npm/tools/print.d.ts +47 -0
  170. package/dist/npm/tools/print.js +122 -0
  171. package/dist/npm/tools/proseMirrorTool.d.ts +43 -0
  172. package/dist/npm/tools/proseMirrorTool.js +123 -0
  173. package/dist/npm/tools/selectAll.d.ts +47 -0
  174. package/dist/npm/tools/selectAll.js +116 -0
  175. package/dist/npm/tools/tableEdit.d.ts +51 -0
  176. package/dist/npm/tools/tableEdit.js +50 -0
  177. package/dist/npm/tools/unlink.d.ts +42 -0
  178. package/dist/npm/tools/unlink.js +123 -0
  179. package/dist/npm/tools/utils.d.ts +18 -0
  180. package/dist/npm/tools/utils.js +45 -0
  181. package/dist/npm/tools/viewHtml.d.ts +49 -0
  182. package/dist/npm/tools/viewHtml.js +138 -0
  183. package/dist/npm/utils/browser-detection.d.ts +4 -0
  184. package/dist/npm/utils/browser-detection.js +8 -0
  185. package/dist/npm/utils/controlled-value.d.ts +5 -0
  186. package/dist/npm/utils/controlled-value.js +34 -0
  187. package/dist/npm/utils/index.d.ts +358 -0
  188. package/dist/npm/utils/index.js +425 -0
  189. package/dist/npm/utils/props-key.d.ts +5 -0
  190. package/dist/npm/utils/props-key.js +8 -0
  191. package/package.json +20 -20
  192. package/dist/cdn/js/kendo-vue-editor.js +0 -1
@@ -0,0 +1,52 @@
1
+ import { DefineComponent } from '../additionalTypes';
2
+ import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
3
+ declare type DefaultData<V> = object | ((this: V) => {});
4
+ declare type DefaultMethods<V> = {
5
+ [key: string]: (this: V, ...args: any[]) => any;
6
+ };
7
+ import { EditorToolsSettings } from '../config/toolsSettings';
8
+ import { EditorDialogProps } from './EditorDialogProps';
9
+ /**
10
+ * @hidden
11
+ */
12
+ export interface InsertImageDialogProps extends EditorDialogProps {
13
+ /**
14
+ * The `ImageSettings` object.
15
+ */
16
+ settings: EditorToolsSettings.ImageSettings;
17
+ }
18
+ /**
19
+ * @hidden
20
+ */
21
+ export interface InsertImageDialogState {
22
+ src: HTMLInputElement | null;
23
+ altText: HTMLInputElement | null;
24
+ title: HTMLInputElement | null;
25
+ width: HTMLInputElement | null;
26
+ height: HTMLInputElement | null;
27
+ }
28
+ /**
29
+ * @hidden
30
+ */
31
+ export interface InsertImageDialogComputed {
32
+ [key: string]: any;
33
+ }
34
+ /**
35
+ * @hidden
36
+ */
37
+ export interface InsertImageDialogMethods {
38
+ [key: string]: any;
39
+ }
40
+ /**
41
+ * @hidden
42
+ */
43
+ export interface InsertImageDialogData {
44
+ }
45
+ /**
46
+ * @hidden
47
+ */
48
+ export interface InsertImageDialogAll extends Vue, InsertImageDialogMethods, InsertImageDialogData, InsertImageDialogComputed, InsertImageDialogState {
49
+ }
50
+ declare let InsertImageDialog: ComponentOptions<InsertImageDialogAll, DefaultData<InsertImageDialogData>, DefaultMethods<InsertImageDialogAll>, InsertImageDialogComputed, RecordPropsDefinition<InsertImageDialogProps>>;
51
+ declare const InsertImageDialogVue3: DefineComponent<InsertImageDialogProps, any, InsertImageDialogData, InsertImageDialogComputed, InsertImageDialogMethods, {}, {}, {}, string, InsertImageDialogProps, InsertImageDialogProps, {}>;
52
+ export { InsertImageDialog, InsertImageDialogVue3 };
@@ -0,0 +1,296 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.InsertImageDialogVue3 = exports.InsertImageDialog = void 0; // @ts-ignore
7
+
8
+ var Vue = require("vue");
9
+
10
+ var allVue = Vue;
11
+ var gh = allVue.h;
12
+
13
+ var kendo_vue_dialogs_1 = require("@progress/kendo-vue-dialogs");
14
+
15
+ var kendo_vue_buttons_1 = require("@progress/kendo-vue-buttons");
16
+
17
+ var kendo_editor_common_1 = require("@progress/kendo-editor-common");
18
+
19
+ var kendo_vue_intl_1 = require("@progress/kendo-vue-intl");
20
+
21
+ var messages_1 = require("./../messages"); // tslint:enable:max-line-length
22
+
23
+
24
+ var InsertImageDialog = {
25
+ name: 'KendoInsertImageDialog',
26
+ props: {
27
+ view: Object,
28
+ settings: Object,
29
+ dir: String
30
+ },
31
+ inject: {
32
+ kendoLocalizationService: {
33
+ default: null
34
+ }
35
+ },
36
+ mounted: function mounted() {
37
+ this.src = this.v3 ? this.srcRef : this.$refs.src;
38
+ this.altText = this.v3 ? this.altTextRef : this.$refs.altText;
39
+ this.title = this.v3 ? this.titleRef : this.$refs.title;
40
+ this.width = this.v3 ? this.widthRef : this.$refs.width;
41
+ this.height = this.v3 ? this.heightRef : this.$refs.height;
42
+ },
43
+ // @ts-ignore
44
+ setup: !gh ? undefined : function () {
45
+ var v3 = !!gh;
46
+ return {
47
+ v3: v3
48
+ };
49
+ },
50
+ // @ts-ignore
51
+ render: function render(createElement) {
52
+ var _this2 = this;
53
+
54
+ var _this = this;
55
+
56
+ var h = gh || createElement;
57
+ var _a = this.$props,
58
+ view = _a.view,
59
+ settings = _a.settings,
60
+ dir = _a.dir;
61
+ var _b = settings.messages,
62
+ insertImageDialogTitle = _b.insertImageDialogTitle,
63
+ insertImageAddress = _b.insertImageAddress,
64
+ insertImageTitle = _b.insertImageTitle,
65
+ insertImageAltText = _b.insertImageAltText,
66
+ insertImageWidth = _b.insertImageWidth,
67
+ insertImageHeight = _b.insertImageHeight,
68
+ insertImageCancel = _b.insertImageCancel,
69
+ insertImageInsert = _b.insertImageInsert;
70
+ var localization = kendo_vue_intl_1.provideLocalizationService(this);
71
+ var state = view && view.state;
72
+ var attrs = {};
73
+
74
+ if (state && state.selection instanceof kendo_editor_common_1.NodeSelection && state.selection.node.type === state.schema.nodes[settings.node]) {
75
+ attrs = state.selection.node.attrs;
76
+ }
77
+
78
+ var content = h("div", {
79
+ "class": "k-edit-form-container"
80
+ }, [h("div", {
81
+ "class": "k-edit-label"
82
+ }, [h("label", {
83
+ "for": "k-editor-image-url",
84
+ attrs: this.v3 ? undefined : {
85
+ "for": "k-editor-image-url"
86
+ }
87
+ }, [localization.toLanguageString(insertImageAddress, messages_1.messages[insertImageAddress])])]), h("div", {
88
+ "class": "k-edit-field"
89
+ }, [h("input", {
90
+ type: "text",
91
+ attrs: this.v3 ? undefined : {
92
+ type: "text",
93
+ id: "k-editor-image-url",
94
+ autoFocus: true
95
+ },
96
+ "class": "k-textbox",
97
+ id: "k-editor-image-url",
98
+ value: this.v3 ? attrs.src : null,
99
+ domProps: this.v3 ? undefined : {
100
+ "value": attrs.src
101
+ },
102
+ ref: this.v3 ? function (el) {
103
+ _this.srcRef = el;
104
+ } : 'src',
105
+ autoFocus: true
106
+ })]), h("div", {
107
+ "class": "k-edit-label"
108
+ }, [h("label", {
109
+ "for": "k-editor-image-alt",
110
+ attrs: this.v3 ? undefined : {
111
+ "for": "k-editor-image-alt"
112
+ }
113
+ }, [localization.toLanguageString(insertImageAltText, messages_1.messages[insertImageAltText])])]), h("div", {
114
+ "class": "k-edit-field"
115
+ }, [h("input", {
116
+ type: "text",
117
+ attrs: this.v3 ? undefined : {
118
+ type: "text",
119
+ id: "k-editor-image-alt"
120
+ },
121
+ "class": "k-textbox",
122
+ id: "k-editor-image-alt",
123
+ value: this.v3 ? attrs.alt : null,
124
+ domProps: this.v3 ? undefined : {
125
+ "value": attrs.alt
126
+ },
127
+ ref: this.v3 ? function (el) {
128
+ _this.altTextRef = el;
129
+ } : 'altText'
130
+ })]), h("div", {
131
+ "class": "k-edit-label"
132
+ }, [h("label", {
133
+ "for": "k-editor-image-title",
134
+ attrs: this.v3 ? undefined : {
135
+ "for": "k-editor-image-title"
136
+ }
137
+ }, [localization.toLanguageString(insertImageTitle, messages_1.messages[insertImageTitle])])]), h("div", {
138
+ "class": "k-edit-field"
139
+ }, [h("input", {
140
+ type: "text",
141
+ attrs: this.v3 ? undefined : {
142
+ type: "text",
143
+ id: "k-editor-image-title"
144
+ },
145
+ "class": "k-textbox",
146
+ id: "k-editor-image-title",
147
+ value: this.v3 ? attrs.title : null,
148
+ domProps: this.v3 ? undefined : {
149
+ "value": attrs.title
150
+ },
151
+ ref: this.v3 ? function (el) {
152
+ _this.titleRef = el;
153
+ } : 'title'
154
+ })]), h("div", {
155
+ "class": "k-edit-label"
156
+ }, [h("label", {
157
+ "for": "k-editor-image-width",
158
+ attrs: this.v3 ? undefined : {
159
+ "for": "k-editor-image-width"
160
+ }
161
+ }, [localization.toLanguageString(insertImageWidth, messages_1.messages[insertImageWidth])])]), h("div", {
162
+ "class": "k-edit-field"
163
+ }, [h("input", {
164
+ type: "text",
165
+ attrs: this.v3 ? undefined : {
166
+ type: "text",
167
+ id: "k-editor-image-width"
168
+ },
169
+ "class": "k-textbox",
170
+ id: "k-editor-image-width",
171
+ value: this.v3 ? attrs.width : null,
172
+ domProps: this.v3 ? undefined : {
173
+ "value": attrs.width
174
+ },
175
+ ref: this.v3 ? function (el) {
176
+ _this.widthRef = el;
177
+ } : 'width'
178
+ })]), h("div", {
179
+ "class": "k-edit-label"
180
+ }, [h("label", {
181
+ "for": "k-editor-image-height",
182
+ attrs: this.v3 ? undefined : {
183
+ "for": "k-editor-image-height"
184
+ }
185
+ }, [localization.toLanguageString(insertImageHeight, messages_1.messages[insertImageHeight])])]), h("div", {
186
+ "class": "k-edit-field"
187
+ }, [h("input", {
188
+ type: "text",
189
+ attrs: this.v3 ? undefined : {
190
+ type: "text",
191
+ id: "k-editor-image-height"
192
+ },
193
+ "class": "k-textbox",
194
+ id: "k-editor-image-height",
195
+ value: this.v3 ? attrs.height : null,
196
+ domProps: this.v3 ? undefined : {
197
+ "value": attrs.height
198
+ },
199
+ ref: this.v3 ? function (el) {
200
+ _this.heightRef = el;
201
+ } : 'height'
202
+ })])]);
203
+ var actionButtons = [// @ts-ignore function children
204
+ h(kendo_vue_buttons_1.Button, {
205
+ onClick: this.onClose,
206
+ on: this.v3 ? undefined : {
207
+ "click": this.onClose
208
+ },
209
+ dir: dir,
210
+ attrs: this.v3 ? undefined : {
211
+ dir: dir
212
+ },
213
+ key: "cancel"
214
+ }, this.v3 ? function () {
215
+ return [localization.toLanguageString(insertImageCancel, messages_1.messages[insertImageCancel])];
216
+ } : [localization.toLanguageString(insertImageCancel, messages_1.messages[insertImageCancel])]), // @ts-ignore function children
217
+ h(kendo_vue_buttons_1.Button, {
218
+ onClick: this.onInsert,
219
+ on: this.v3 ? undefined : {
220
+ "click": this.onInsert
221
+ },
222
+ themeColor: 'primary',
223
+ attrs: this.v3 ? undefined : {
224
+ themeColor: 'primary',
225
+ dir: dir
226
+ },
227
+ dir: dir,
228
+ key: "insert"
229
+ }, this.v3 ? function () {
230
+ return [localization.toLanguageString(insertImageInsert, messages_1.messages[insertImageInsert])];
231
+ } : [localization.toLanguageString(insertImageInsert, messages_1.messages[insertImageInsert])])];
232
+ var dialog = // @ts-ignore function children
233
+ h(kendo_vue_dialogs_1.Dialog, {
234
+ title: localization.toLanguageString(insertImageDialogTitle, messages_1.messages[insertImageDialogTitle]),
235
+ attrs: this.v3 ? undefined : {
236
+ title: localization.toLanguageString(insertImageDialogTitle, messages_1.messages[insertImageDialogTitle]),
237
+ closeIcon: true,
238
+ dir: dir
239
+ },
240
+ onClose: this.onClose,
241
+ on: this.v3 ? undefined : {
242
+ "close": this.onClose
243
+ },
244
+ key: "dialog",
245
+ closeIcon: true,
246
+ dir: dir,
247
+ style: dir === 'rtl' ? {
248
+ textAlign: 'right'
249
+ } : undefined
250
+ }, this.v3 ? function () {
251
+ return [content, // @ts-ignore function children
252
+ h(kendo_vue_dialogs_1.DialogActionsBar, _this2.v3 ? function () {
253
+ return [actionButtons];
254
+ } : [actionButtons])];
255
+ } : [content, h(kendo_vue_dialogs_1.DialogActionsBar, _this2.v3 ? function () {
256
+ return [actionButtons];
257
+ } : [actionButtons])]);
258
+ return dialog;
259
+ },
260
+ methods: {
261
+ onClose: function onClose() {
262
+ this.$props.view.focus();
263
+ this.$emit('close');
264
+ },
265
+ onInsert: function onInsert() {
266
+ var _a = this.$props,
267
+ view = _a.view,
268
+ settings = _a.settings;
269
+ var nodes = view.state.schema.nodes;
270
+ var nodeType = nodes[settings.node];
271
+ var data = {
272
+ src: this.src ? this.src.value : null,
273
+ title: this.title ? this.title.value : null,
274
+ alt: this.altText ? this.altText.value : null,
275
+ width: this.width ? this.width.value : null,
276
+ height: this.height ? this.height.value : null
277
+ };
278
+ var attrs = Object.keys(data).filter(function (key) {
279
+ return data[key] !== null && data[key] !== '';
280
+ }).reduce(function (acc, curr) {
281
+ var _a;
282
+
283
+ return Object.assign(acc, (_a = {}, _a[curr] = data[curr], _a));
284
+ }, {});
285
+ var newImage = nodeType.createAndFill(attrs);
286
+ var insertImageCmd = kendo_editor_common_1.insertNode(newImage, true);
287
+ insertImageCmd(view.state, function (tr) {
288
+ return view.dispatch(tr.setMeta('commandName', settings.commandName).setMeta('args', attrs));
289
+ });
290
+ this.onClose();
291
+ }
292
+ }
293
+ };
294
+ exports.InsertImageDialog = InsertImageDialog;
295
+ var InsertImageDialogVue3 = InsertImageDialog;
296
+ exports.InsertImageDialogVue3 = InsertImageDialogVue3;
@@ -0,0 +1,50 @@
1
+ import { DefineComponent } from '../additionalTypes';
2
+ import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
3
+ declare type DefaultData<V> = object | ((this: V) => {});
4
+ declare type DefaultMethods<V> = {
5
+ [key: string]: (this: V, ...args: any[]) => any;
6
+ };
7
+ import { EditorToolsSettings } from '../config/toolsSettings';
8
+ import { EditorDialogProps } from './EditorDialogProps';
9
+ /**
10
+ * @hidden
11
+ */
12
+ export interface InsertLinkDialogProps extends EditorDialogProps {
13
+ /**
14
+ * The `LinkSettings` object.
15
+ */
16
+ settings: EditorToolsSettings.LinkSettings;
17
+ }
18
+ /**
19
+ * @hidden
20
+ */
21
+ export interface InsertLinkDialogState {
22
+ href: HTMLInputElement | null;
23
+ title: HTMLInputElement | null;
24
+ target: HTMLInputElement | null;
25
+ }
26
+ /**
27
+ * @hidden
28
+ */
29
+ export interface InsertLinkDialogComputed {
30
+ [key: string]: any;
31
+ }
32
+ /**
33
+ * @hidden
34
+ */
35
+ export interface InsertLinkDialogMethods {
36
+ [key: string]: any;
37
+ }
38
+ /**
39
+ * @hidden
40
+ */
41
+ export interface InsertLinkDialogData {
42
+ }
43
+ /**
44
+ * @hidden
45
+ */
46
+ export interface InsertLinkDialogAll extends Vue, InsertLinkDialogMethods, InsertLinkDialogData, InsertLinkDialogComputed, InsertLinkDialogState {
47
+ }
48
+ declare let InsertLinkDialog: ComponentOptions<InsertLinkDialogAll, DefaultData<InsertLinkDialogData>, DefaultMethods<InsertLinkDialogAll>, InsertLinkDialogComputed, RecordPropsDefinition<InsertLinkDialogProps>>;
49
+ declare const InsertLinkDialogVue3: DefineComponent<InsertLinkDialogProps, any, InsertLinkDialogData, InsertLinkDialogComputed, InsertLinkDialogMethods, {}, {}, {}, string, InsertLinkDialogProps, InsertLinkDialogProps, {}>;
50
+ export { InsertLinkDialog, InsertLinkDialogVue3 };
@@ -0,0 +1,300 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.InsertLinkDialogVue3 = exports.InsertLinkDialog = void 0; // @ts-ignore
7
+
8
+ var Vue = require("vue");
9
+
10
+ var allVue = Vue;
11
+ var gh = allVue.h;
12
+
13
+ var kendo_vue_dialogs_1 = require("@progress/kendo-vue-dialogs");
14
+
15
+ var kendo_vue_buttons_1 = require("@progress/kendo-vue-buttons");
16
+
17
+ var kendo_editor_common_1 = require("@progress/kendo-editor-common");
18
+
19
+ var kendo_vue_intl_1 = require("@progress/kendo-vue-intl");
20
+
21
+ var messages_1 = require("./../messages"); // tslint:enable:max-line-length
22
+
23
+
24
+ var InsertLinkDialog = {
25
+ name: 'KendoInsertLinkDialog',
26
+ props: {
27
+ view: Object,
28
+ settings: Object,
29
+ dir: String
30
+ },
31
+ inject: {
32
+ kendoLocalizationService: {
33
+ default: null
34
+ }
35
+ },
36
+ // @ts-ignore
37
+ setup: !gh ? undefined : function () {
38
+ var v3 = !!gh;
39
+ return {
40
+ v3: v3
41
+ };
42
+ },
43
+ mounted: function mounted() {
44
+ this.href = this.v3 ? this.hrefRef : this.$refs.href;
45
+ this.title = this.v3 ? this.titleRef : this.$refs.title;
46
+ this.target = this.v3 ? this.targetRef : this.$refs.target;
47
+ },
48
+ // @ts-ignore
49
+ render: function render(createElement) {
50
+ var _this2 = this;
51
+
52
+ var _this = this;
53
+
54
+ var h = gh || createElement;
55
+ var _a = this.$props,
56
+ view = _a.view,
57
+ settings = _a.settings,
58
+ dir = _a.dir;
59
+ var localization = kendo_vue_intl_1.provideLocalizationService(this);
60
+ var _b = settings.messages,
61
+ insertHyperlinkDialogTitle = _b.insertHyperlinkDialogTitle,
62
+ insertHyperlinkAddress = _b.insertHyperlinkAddress,
63
+ insertHyperlinkTitle = _b.insertHyperlinkTitle,
64
+ insertHyperlinkNewWindow = _b.insertHyperlinkNewWindow,
65
+ insertHyperlinkCancel = _b.insertHyperlinkCancel,
66
+ insertHyperlinkInsert = _b.insertHyperlinkInsert;
67
+ var linkMark = view ? kendo_editor_common_1.getMark(view.state, view.state.schema.marks[settings.mark]) : false;
68
+ var content = h("div", {
69
+ "class": "k-edit-form-container"
70
+ }, [h("div", {
71
+ "class": "k-edit-label"
72
+ }, [h("label", {
73
+ "for": "k-editor-link-url",
74
+ attrs: this.v3 ? undefined : {
75
+ "for": "k-editor-link-url"
76
+ }
77
+ }, [localization.toLanguageString(insertHyperlinkAddress, messages_1.messages[insertHyperlinkAddress])])]), h("div", {
78
+ "class": "k-edit-field"
79
+ }, [h("input", {
80
+ type: "text",
81
+ attrs: this.v3 ? undefined : {
82
+ type: "text",
83
+ id: "k-editor-link-url",
84
+ autoFocus: true
85
+ },
86
+ "class": "k-textbox",
87
+ ref: this.v3 ? function (el) {
88
+ _this.hrefRef = el;
89
+ } : 'href',
90
+ id: "k-editor-link-url",
91
+ value: this.v3 ? linkMark && linkMark.attrs.href || undefined : null,
92
+ domProps: this.v3 ? undefined : {
93
+ "value": linkMark && linkMark.attrs.href || undefined
94
+ },
95
+ autoFocus: true
96
+ })]), h("div", {
97
+ "class": "k-edit-label k-editor-link-text-row"
98
+ }, [h("label", {
99
+ "for": "k-editor-link-text",
100
+ attrs: this.v3 ? undefined : {
101
+ "for": "k-editor-link-text"
102
+ }
103
+ }, [localization.toLanguageString(insertHyperlinkTitle, messages_1.messages[insertHyperlinkTitle])])]), h("div", {
104
+ "class": "k-edit-field k-editor-link-text-row"
105
+ }, [h("input", {
106
+ type: "text",
107
+ attrs: this.v3 ? undefined : {
108
+ type: "text",
109
+ id: "k-editor-link-text"
110
+ },
111
+ "class": "k-textbox",
112
+ id: "k-editor-link-text",
113
+ ref: this.v3 ? function (el) {
114
+ _this.titleRef = el;
115
+ } : 'title',
116
+ value: this.v3 ? linkMark && linkMark.attrs.title || undefined : null,
117
+ domProps: this.v3 ? undefined : {
118
+ "value": linkMark && linkMark.attrs.title || undefined
119
+ }
120
+ })]), settings.linkTarget !== false && h("div", {
121
+ "class": "k-edit-field"
122
+ }, [h("input", {
123
+ type: "checkbox",
124
+ attrs: this.v3 ? undefined : {
125
+ type: "checkbox",
126
+ id: "k-editor-link-target"
127
+ },
128
+ "class": "k-checkbox",
129
+ id: "k-editor-link-target",
130
+ ref: this.v3 ? function (el) {
131
+ _this.targetRef = el;
132
+ } : 'target',
133
+ checked: this.v3 ? linkMark && !!linkMark.attrs.target || undefined : null,
134
+ domProps: this.v3 ? undefined : {
135
+ "checked": linkMark && !!linkMark.attrs.target || undefined
136
+ }
137
+ }), h("label", {
138
+ "for": "k-editor-link-target",
139
+ attrs: this.v3 ? undefined : {
140
+ "for": "k-editor-link-target"
141
+ },
142
+ "class": "k-checkbox-label"
143
+ }, [localization.toLanguageString(insertHyperlinkNewWindow, messages_1.messages[insertHyperlinkNewWindow])])])]);
144
+ var dialog = // @ts-ignore function children
145
+ h(kendo_vue_dialogs_1.Dialog, {
146
+ title: localization.toLanguageString(insertHyperlinkDialogTitle, messages_1.messages[insertHyperlinkDialogTitle]),
147
+ attrs: this.v3 ? undefined : {
148
+ title: localization.toLanguageString(insertHyperlinkDialogTitle, messages_1.messages[insertHyperlinkDialogTitle]),
149
+ closeIcon: true,
150
+ dir: dir
151
+ },
152
+ onClose: this.onClose,
153
+ on: this.v3 ? undefined : {
154
+ "close": this.onClose
155
+ },
156
+ closeIcon: true,
157
+ dir: dir,
158
+ style: dir === 'rtl' ? {
159
+ textAlign: 'right'
160
+ } : undefined
161
+ }, this.v3 ? function () {
162
+ return [content, // @ts-ignore function children
163
+ h(kendo_vue_dialogs_1.DialogActionsBar, _this2.v3 ? function () {
164
+ return [// @ts-ignore function children
165
+ h(kendo_vue_buttons_1.Button, {
166
+ onClick: _this2.onClose,
167
+ on: _this2.v3 ? undefined : {
168
+ "click": _this2.onClose
169
+ },
170
+ dir: dir,
171
+ attrs: _this2.v3 ? undefined : {
172
+ dir: dir
173
+ },
174
+ key: "cancel"
175
+ }, _this2.v3 ? function () {
176
+ return [localization.toLanguageString(insertHyperlinkCancel, messages_1.messages[insertHyperlinkCancel])];
177
+ } : [localization.toLanguageString(insertHyperlinkCancel, messages_1.messages[insertHyperlinkCancel])]), // @ts-ignore function children
178
+ h(kendo_vue_buttons_1.Button, {
179
+ onClick: _this2.onInsert,
180
+ on: _this2.v3 ? undefined : {
181
+ "click": _this2.onInsert
182
+ },
183
+ themeColor: 'primary',
184
+ attrs: _this2.v3 ? undefined : {
185
+ themeColor: 'primary',
186
+ dir: dir
187
+ },
188
+ dir: dir,
189
+ key: "insert"
190
+ }, _this2.v3 ? function () {
191
+ return [localization.toLanguageString(insertHyperlinkInsert, messages_1.messages[insertHyperlinkInsert])];
192
+ } : [localization.toLanguageString(insertHyperlinkInsert, messages_1.messages[insertHyperlinkInsert])])];
193
+ } : [h(kendo_vue_buttons_1.Button, {
194
+ onClick: _this2.onClose,
195
+ on: _this2.v3 ? undefined : {
196
+ "click": _this2.onClose
197
+ },
198
+ dir: dir,
199
+ attrs: _this2.v3 ? undefined : {
200
+ dir: dir
201
+ },
202
+ key: "cancel"
203
+ }, _this2.v3 ? function () {
204
+ return [localization.toLanguageString(insertHyperlinkCancel, messages_1.messages[insertHyperlinkCancel])];
205
+ } : [localization.toLanguageString(insertHyperlinkCancel, messages_1.messages[insertHyperlinkCancel])]), h(kendo_vue_buttons_1.Button, {
206
+ onClick: _this2.onInsert,
207
+ on: _this2.v3 ? undefined : {
208
+ "click": _this2.onInsert
209
+ },
210
+ themeColor: 'primary',
211
+ attrs: _this2.v3 ? undefined : {
212
+ themeColor: 'primary',
213
+ dir: dir
214
+ },
215
+ dir: dir,
216
+ key: "insert"
217
+ }, _this2.v3 ? function () {
218
+ return [localization.toLanguageString(insertHyperlinkInsert, messages_1.messages[insertHyperlinkInsert])];
219
+ } : [localization.toLanguageString(insertHyperlinkInsert, messages_1.messages[insertHyperlinkInsert])])])];
220
+ } : [content, h(kendo_vue_dialogs_1.DialogActionsBar, _this2.v3 ? function () {
221
+ return [h(kendo_vue_buttons_1.Button, {
222
+ onClick: _this2.onClose,
223
+ on: _this2.v3 ? undefined : {
224
+ "click": _this2.onClose
225
+ },
226
+ dir: dir,
227
+ attrs: _this2.v3 ? undefined : {
228
+ dir: dir
229
+ },
230
+ key: "cancel"
231
+ }, _this2.v3 ? function () {
232
+ return [localization.toLanguageString(insertHyperlinkCancel, messages_1.messages[insertHyperlinkCancel])];
233
+ } : [localization.toLanguageString(insertHyperlinkCancel, messages_1.messages[insertHyperlinkCancel])]), h(kendo_vue_buttons_1.Button, {
234
+ onClick: _this2.onInsert,
235
+ on: _this2.v3 ? undefined : {
236
+ "click": _this2.onInsert
237
+ },
238
+ themeColor: 'primary',
239
+ attrs: _this2.v3 ? undefined : {
240
+ themeColor: 'primary',
241
+ dir: dir
242
+ },
243
+ dir: dir,
244
+ key: "insert"
245
+ }, _this2.v3 ? function () {
246
+ return [localization.toLanguageString(insertHyperlinkInsert, messages_1.messages[insertHyperlinkInsert])];
247
+ } : [localization.toLanguageString(insertHyperlinkInsert, messages_1.messages[insertHyperlinkInsert])])];
248
+ } : [h(kendo_vue_buttons_1.Button, {
249
+ onClick: _this2.onClose,
250
+ on: _this2.v3 ? undefined : {
251
+ "click": _this2.onClose
252
+ },
253
+ dir: dir,
254
+ attrs: _this2.v3 ? undefined : {
255
+ dir: dir
256
+ },
257
+ key: "cancel"
258
+ }, _this2.v3 ? function () {
259
+ return [localization.toLanguageString(insertHyperlinkCancel, messages_1.messages[insertHyperlinkCancel])];
260
+ } : [localization.toLanguageString(insertHyperlinkCancel, messages_1.messages[insertHyperlinkCancel])]), h(kendo_vue_buttons_1.Button, {
261
+ onClick: _this2.onInsert,
262
+ on: _this2.v3 ? undefined : {
263
+ "click": _this2.onInsert
264
+ },
265
+ themeColor: 'primary',
266
+ attrs: _this2.v3 ? undefined : {
267
+ themeColor: 'primary',
268
+ dir: dir
269
+ },
270
+ dir: dir,
271
+ key: "insert"
272
+ }, _this2.v3 ? function () {
273
+ return [localization.toLanguageString(insertHyperlinkInsert, messages_1.messages[insertHyperlinkInsert])];
274
+ } : [localization.toLanguageString(insertHyperlinkInsert, messages_1.messages[insertHyperlinkInsert])])])]);
275
+ return dialog;
276
+ },
277
+ methods: {
278
+ onClose: function onClose() {
279
+ this.$props.view.focus();
280
+ this.$emit('close');
281
+ },
282
+ onInsert: function onInsert() {
283
+ var view = this.$props.view;
284
+ var mark = this.$props.settings.mark;
285
+ var attrs = {
286
+ href: this.href ? this.href.value : undefined,
287
+ title: this.title ? this.title.value : undefined,
288
+ target: this.target && this.target.checked ? '_blank' : undefined
289
+ };
290
+ kendo_editor_common_1.applyLink({
291
+ mark: mark,
292
+ attrs: attrs
293
+ }, this.$props.settings.commandName)(view.state, view.dispatch);
294
+ this.onClose();
295
+ }
296
+ }
297
+ };
298
+ exports.InsertLinkDialog = InsertLinkDialog;
299
+ var InsertLinkDialogVue3 = InsertLinkDialog;
300
+ exports.InsertLinkDialogVue3 = InsertLinkDialogVue3;
@@ -0,0 +1 @@
1
+