@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,282 @@
1
+ // @ts-ignore
2
+ import * as Vue from 'vue';
3
+ var allVue = Vue;
4
+ var gh = allVue.h;
5
+ import { Dialog, DialogActionsBar } from '@progress/kendo-vue-dialogs';
6
+ import { Button as KButton } from '@progress/kendo-vue-buttons';
7
+ import { NodeSelection, insertNode } from '@progress/kendo-editor-common';
8
+ import { provideLocalizationService } from '@progress/kendo-vue-intl';
9
+ import { messages } from './../messages'; // tslint:enable:max-line-length
10
+
11
+ var InsertImageDialog = {
12
+ name: 'KendoInsertImageDialog',
13
+ props: {
14
+ view: Object,
15
+ settings: Object,
16
+ dir: String
17
+ },
18
+ inject: {
19
+ kendoLocalizationService: {
20
+ default: null
21
+ }
22
+ },
23
+ mounted: function mounted() {
24
+ this.src = this.v3 ? this.srcRef : this.$refs.src;
25
+ this.altText = this.v3 ? this.altTextRef : this.$refs.altText;
26
+ this.title = this.v3 ? this.titleRef : this.$refs.title;
27
+ this.width = this.v3 ? this.widthRef : this.$refs.width;
28
+ this.height = this.v3 ? this.heightRef : this.$refs.height;
29
+ },
30
+ // @ts-ignore
31
+ setup: !gh ? undefined : function () {
32
+ var v3 = !!gh;
33
+ return {
34
+ v3: v3
35
+ };
36
+ },
37
+ // @ts-ignore
38
+ render: function render(createElement) {
39
+ var _this2 = this;
40
+
41
+ var _this = this;
42
+
43
+ var h = gh || createElement;
44
+ var _a = this.$props,
45
+ view = _a.view,
46
+ settings = _a.settings,
47
+ dir = _a.dir;
48
+ var _b = settings.messages,
49
+ insertImageDialogTitle = _b.insertImageDialogTitle,
50
+ insertImageAddress = _b.insertImageAddress,
51
+ insertImageTitle = _b.insertImageTitle,
52
+ insertImageAltText = _b.insertImageAltText,
53
+ insertImageWidth = _b.insertImageWidth,
54
+ insertImageHeight = _b.insertImageHeight,
55
+ insertImageCancel = _b.insertImageCancel,
56
+ insertImageInsert = _b.insertImageInsert;
57
+ var localization = provideLocalizationService(this);
58
+ var state = view && view.state;
59
+ var attrs = {};
60
+
61
+ if (state && state.selection instanceof NodeSelection && state.selection.node.type === state.schema.nodes[settings.node]) {
62
+ attrs = state.selection.node.attrs;
63
+ }
64
+
65
+ var content = h("div", {
66
+ "class": "k-edit-form-container"
67
+ }, [h("div", {
68
+ "class": "k-edit-label"
69
+ }, [h("label", {
70
+ "for": "k-editor-image-url",
71
+ attrs: this.v3 ? undefined : {
72
+ "for": "k-editor-image-url"
73
+ }
74
+ }, [localization.toLanguageString(insertImageAddress, messages[insertImageAddress])])]), h("div", {
75
+ "class": "k-edit-field"
76
+ }, [h("input", {
77
+ type: "text",
78
+ attrs: this.v3 ? undefined : {
79
+ type: "text",
80
+ id: "k-editor-image-url",
81
+ autoFocus: true
82
+ },
83
+ "class": "k-textbox",
84
+ id: "k-editor-image-url",
85
+ value: this.v3 ? attrs.src : null,
86
+ domProps: this.v3 ? undefined : {
87
+ "value": attrs.src
88
+ },
89
+ ref: this.v3 ? function (el) {
90
+ _this.srcRef = el;
91
+ } : 'src',
92
+ autoFocus: true
93
+ })]), h("div", {
94
+ "class": "k-edit-label"
95
+ }, [h("label", {
96
+ "for": "k-editor-image-alt",
97
+ attrs: this.v3 ? undefined : {
98
+ "for": "k-editor-image-alt"
99
+ }
100
+ }, [localization.toLanguageString(insertImageAltText, messages[insertImageAltText])])]), h("div", {
101
+ "class": "k-edit-field"
102
+ }, [h("input", {
103
+ type: "text",
104
+ attrs: this.v3 ? undefined : {
105
+ type: "text",
106
+ id: "k-editor-image-alt"
107
+ },
108
+ "class": "k-textbox",
109
+ id: "k-editor-image-alt",
110
+ value: this.v3 ? attrs.alt : null,
111
+ domProps: this.v3 ? undefined : {
112
+ "value": attrs.alt
113
+ },
114
+ ref: this.v3 ? function (el) {
115
+ _this.altTextRef = el;
116
+ } : 'altText'
117
+ })]), h("div", {
118
+ "class": "k-edit-label"
119
+ }, [h("label", {
120
+ "for": "k-editor-image-title",
121
+ attrs: this.v3 ? undefined : {
122
+ "for": "k-editor-image-title"
123
+ }
124
+ }, [localization.toLanguageString(insertImageTitle, messages[insertImageTitle])])]), h("div", {
125
+ "class": "k-edit-field"
126
+ }, [h("input", {
127
+ type: "text",
128
+ attrs: this.v3 ? undefined : {
129
+ type: "text",
130
+ id: "k-editor-image-title"
131
+ },
132
+ "class": "k-textbox",
133
+ id: "k-editor-image-title",
134
+ value: this.v3 ? attrs.title : null,
135
+ domProps: this.v3 ? undefined : {
136
+ "value": attrs.title
137
+ },
138
+ ref: this.v3 ? function (el) {
139
+ _this.titleRef = el;
140
+ } : 'title'
141
+ })]), h("div", {
142
+ "class": "k-edit-label"
143
+ }, [h("label", {
144
+ "for": "k-editor-image-width",
145
+ attrs: this.v3 ? undefined : {
146
+ "for": "k-editor-image-width"
147
+ }
148
+ }, [localization.toLanguageString(insertImageWidth, messages[insertImageWidth])])]), h("div", {
149
+ "class": "k-edit-field"
150
+ }, [h("input", {
151
+ type: "text",
152
+ attrs: this.v3 ? undefined : {
153
+ type: "text",
154
+ id: "k-editor-image-width"
155
+ },
156
+ "class": "k-textbox",
157
+ id: "k-editor-image-width",
158
+ value: this.v3 ? attrs.width : null,
159
+ domProps: this.v3 ? undefined : {
160
+ "value": attrs.width
161
+ },
162
+ ref: this.v3 ? function (el) {
163
+ _this.widthRef = el;
164
+ } : 'width'
165
+ })]), h("div", {
166
+ "class": "k-edit-label"
167
+ }, [h("label", {
168
+ "for": "k-editor-image-height",
169
+ attrs: this.v3 ? undefined : {
170
+ "for": "k-editor-image-height"
171
+ }
172
+ }, [localization.toLanguageString(insertImageHeight, messages[insertImageHeight])])]), h("div", {
173
+ "class": "k-edit-field"
174
+ }, [h("input", {
175
+ type: "text",
176
+ attrs: this.v3 ? undefined : {
177
+ type: "text",
178
+ id: "k-editor-image-height"
179
+ },
180
+ "class": "k-textbox",
181
+ id: "k-editor-image-height",
182
+ value: this.v3 ? attrs.height : null,
183
+ domProps: this.v3 ? undefined : {
184
+ "value": attrs.height
185
+ },
186
+ ref: this.v3 ? function (el) {
187
+ _this.heightRef = el;
188
+ } : 'height'
189
+ })])]);
190
+ var actionButtons = [// @ts-ignore function children
191
+ h(KButton, {
192
+ onClick: this.onClose,
193
+ on: this.v3 ? undefined : {
194
+ "click": this.onClose
195
+ },
196
+ dir: dir,
197
+ attrs: this.v3 ? undefined : {
198
+ dir: dir
199
+ },
200
+ key: "cancel"
201
+ }, this.v3 ? function () {
202
+ return [localization.toLanguageString(insertImageCancel, messages[insertImageCancel])];
203
+ } : [localization.toLanguageString(insertImageCancel, messages[insertImageCancel])]), // @ts-ignore function children
204
+ h(KButton, {
205
+ onClick: this.onInsert,
206
+ on: this.v3 ? undefined : {
207
+ "click": this.onInsert
208
+ },
209
+ themeColor: 'primary',
210
+ attrs: this.v3 ? undefined : {
211
+ themeColor: 'primary',
212
+ dir: dir
213
+ },
214
+ dir: dir,
215
+ key: "insert"
216
+ }, this.v3 ? function () {
217
+ return [localization.toLanguageString(insertImageInsert, messages[insertImageInsert])];
218
+ } : [localization.toLanguageString(insertImageInsert, messages[insertImageInsert])])];
219
+ var dialog = // @ts-ignore function children
220
+ h(Dialog, {
221
+ title: localization.toLanguageString(insertImageDialogTitle, messages[insertImageDialogTitle]),
222
+ attrs: this.v3 ? undefined : {
223
+ title: localization.toLanguageString(insertImageDialogTitle, messages[insertImageDialogTitle]),
224
+ closeIcon: true,
225
+ dir: dir
226
+ },
227
+ onClose: this.onClose,
228
+ on: this.v3 ? undefined : {
229
+ "close": this.onClose
230
+ },
231
+ key: "dialog",
232
+ closeIcon: true,
233
+ dir: dir,
234
+ style: dir === 'rtl' ? {
235
+ textAlign: 'right'
236
+ } : undefined
237
+ }, this.v3 ? function () {
238
+ return [content, // @ts-ignore function children
239
+ h(DialogActionsBar, _this2.v3 ? function () {
240
+ return [actionButtons];
241
+ } : [actionButtons])];
242
+ } : [content, h(DialogActionsBar, _this2.v3 ? function () {
243
+ return [actionButtons];
244
+ } : [actionButtons])]);
245
+ return dialog;
246
+ },
247
+ methods: {
248
+ onClose: function onClose() {
249
+ this.$props.view.focus();
250
+ this.$emit('close');
251
+ },
252
+ onInsert: function onInsert() {
253
+ var _a = this.$props,
254
+ view = _a.view,
255
+ settings = _a.settings;
256
+ var nodes = view.state.schema.nodes;
257
+ var nodeType = nodes[settings.node];
258
+ var data = {
259
+ src: this.src ? this.src.value : null,
260
+ title: this.title ? this.title.value : null,
261
+ alt: this.altText ? this.altText.value : null,
262
+ width: this.width ? this.width.value : null,
263
+ height: this.height ? this.height.value : null
264
+ };
265
+ var attrs = Object.keys(data).filter(function (key) {
266
+ return data[key] !== null && data[key] !== '';
267
+ }).reduce(function (acc, curr) {
268
+ var _a;
269
+
270
+ return Object.assign(acc, (_a = {}, _a[curr] = data[curr], _a));
271
+ }, {});
272
+ var newImage = nodeType.createAndFill(attrs);
273
+ var insertImageCmd = insertNode(newImage, true);
274
+ insertImageCmd(view.state, function (tr) {
275
+ return view.dispatch(tr.setMeta('commandName', settings.commandName).setMeta('args', attrs));
276
+ });
277
+ this.onClose();
278
+ }
279
+ }
280
+ };
281
+ var InsertImageDialogVue3 = InsertImageDialog;
282
+ export { InsertImageDialog, 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,286 @@
1
+ // @ts-ignore
2
+ import * as Vue from 'vue';
3
+ var allVue = Vue;
4
+ var gh = allVue.h;
5
+ import { Dialog, DialogActionsBar } from '@progress/kendo-vue-dialogs';
6
+ import { Button as KButton } from '@progress/kendo-vue-buttons';
7
+ import { getMark, applyLink } from '@progress/kendo-editor-common';
8
+ import { provideLocalizationService } from '@progress/kendo-vue-intl';
9
+ import { messages } from './../messages'; // tslint:enable:max-line-length
10
+
11
+ var InsertLinkDialog = {
12
+ name: 'KendoInsertLinkDialog',
13
+ props: {
14
+ view: Object,
15
+ settings: Object,
16
+ dir: String
17
+ },
18
+ inject: {
19
+ kendoLocalizationService: {
20
+ default: null
21
+ }
22
+ },
23
+ // @ts-ignore
24
+ setup: !gh ? undefined : function () {
25
+ var v3 = !!gh;
26
+ return {
27
+ v3: v3
28
+ };
29
+ },
30
+ mounted: function mounted() {
31
+ this.href = this.v3 ? this.hrefRef : this.$refs.href;
32
+ this.title = this.v3 ? this.titleRef : this.$refs.title;
33
+ this.target = this.v3 ? this.targetRef : this.$refs.target;
34
+ },
35
+ // @ts-ignore
36
+ render: function render(createElement) {
37
+ var _this2 = this;
38
+
39
+ var _this = this;
40
+
41
+ var h = gh || createElement;
42
+ var _a = this.$props,
43
+ view = _a.view,
44
+ settings = _a.settings,
45
+ dir = _a.dir;
46
+ var localization = provideLocalizationService(this);
47
+ var _b = settings.messages,
48
+ insertHyperlinkDialogTitle = _b.insertHyperlinkDialogTitle,
49
+ insertHyperlinkAddress = _b.insertHyperlinkAddress,
50
+ insertHyperlinkTitle = _b.insertHyperlinkTitle,
51
+ insertHyperlinkNewWindow = _b.insertHyperlinkNewWindow,
52
+ insertHyperlinkCancel = _b.insertHyperlinkCancel,
53
+ insertHyperlinkInsert = _b.insertHyperlinkInsert;
54
+ var linkMark = view ? getMark(view.state, view.state.schema.marks[settings.mark]) : false;
55
+ var content = h("div", {
56
+ "class": "k-edit-form-container"
57
+ }, [h("div", {
58
+ "class": "k-edit-label"
59
+ }, [h("label", {
60
+ "for": "k-editor-link-url",
61
+ attrs: this.v3 ? undefined : {
62
+ "for": "k-editor-link-url"
63
+ }
64
+ }, [localization.toLanguageString(insertHyperlinkAddress, messages[insertHyperlinkAddress])])]), h("div", {
65
+ "class": "k-edit-field"
66
+ }, [h("input", {
67
+ type: "text",
68
+ attrs: this.v3 ? undefined : {
69
+ type: "text",
70
+ id: "k-editor-link-url",
71
+ autoFocus: true
72
+ },
73
+ "class": "k-textbox",
74
+ ref: this.v3 ? function (el) {
75
+ _this.hrefRef = el;
76
+ } : 'href',
77
+ id: "k-editor-link-url",
78
+ value: this.v3 ? linkMark && linkMark.attrs.href || undefined : null,
79
+ domProps: this.v3 ? undefined : {
80
+ "value": linkMark && linkMark.attrs.href || undefined
81
+ },
82
+ autoFocus: true
83
+ })]), h("div", {
84
+ "class": "k-edit-label k-editor-link-text-row"
85
+ }, [h("label", {
86
+ "for": "k-editor-link-text",
87
+ attrs: this.v3 ? undefined : {
88
+ "for": "k-editor-link-text"
89
+ }
90
+ }, [localization.toLanguageString(insertHyperlinkTitle, messages[insertHyperlinkTitle])])]), h("div", {
91
+ "class": "k-edit-field k-editor-link-text-row"
92
+ }, [h("input", {
93
+ type: "text",
94
+ attrs: this.v3 ? undefined : {
95
+ type: "text",
96
+ id: "k-editor-link-text"
97
+ },
98
+ "class": "k-textbox",
99
+ id: "k-editor-link-text",
100
+ ref: this.v3 ? function (el) {
101
+ _this.titleRef = el;
102
+ } : 'title',
103
+ value: this.v3 ? linkMark && linkMark.attrs.title || undefined : null,
104
+ domProps: this.v3 ? undefined : {
105
+ "value": linkMark && linkMark.attrs.title || undefined
106
+ }
107
+ })]), settings.linkTarget !== false && h("div", {
108
+ "class": "k-edit-field"
109
+ }, [h("input", {
110
+ type: "checkbox",
111
+ attrs: this.v3 ? undefined : {
112
+ type: "checkbox",
113
+ id: "k-editor-link-target"
114
+ },
115
+ "class": "k-checkbox",
116
+ id: "k-editor-link-target",
117
+ ref: this.v3 ? function (el) {
118
+ _this.targetRef = el;
119
+ } : 'target',
120
+ checked: this.v3 ? linkMark && !!linkMark.attrs.target || undefined : null,
121
+ domProps: this.v3 ? undefined : {
122
+ "checked": linkMark && !!linkMark.attrs.target || undefined
123
+ }
124
+ }), h("label", {
125
+ "for": "k-editor-link-target",
126
+ attrs: this.v3 ? undefined : {
127
+ "for": "k-editor-link-target"
128
+ },
129
+ "class": "k-checkbox-label"
130
+ }, [localization.toLanguageString(insertHyperlinkNewWindow, messages[insertHyperlinkNewWindow])])])]);
131
+ var dialog = // @ts-ignore function children
132
+ h(Dialog, {
133
+ title: localization.toLanguageString(insertHyperlinkDialogTitle, messages[insertHyperlinkDialogTitle]),
134
+ attrs: this.v3 ? undefined : {
135
+ title: localization.toLanguageString(insertHyperlinkDialogTitle, messages[insertHyperlinkDialogTitle]),
136
+ closeIcon: true,
137
+ dir: dir
138
+ },
139
+ onClose: this.onClose,
140
+ on: this.v3 ? undefined : {
141
+ "close": this.onClose
142
+ },
143
+ closeIcon: true,
144
+ dir: dir,
145
+ style: dir === 'rtl' ? {
146
+ textAlign: 'right'
147
+ } : undefined
148
+ }, this.v3 ? function () {
149
+ return [content, // @ts-ignore function children
150
+ h(DialogActionsBar, _this2.v3 ? function () {
151
+ return [// @ts-ignore function children
152
+ h(KButton, {
153
+ onClick: _this2.onClose,
154
+ on: _this2.v3 ? undefined : {
155
+ "click": _this2.onClose
156
+ },
157
+ dir: dir,
158
+ attrs: _this2.v3 ? undefined : {
159
+ dir: dir
160
+ },
161
+ key: "cancel"
162
+ }, _this2.v3 ? function () {
163
+ return [localization.toLanguageString(insertHyperlinkCancel, messages[insertHyperlinkCancel])];
164
+ } : [localization.toLanguageString(insertHyperlinkCancel, messages[insertHyperlinkCancel])]), // @ts-ignore function children
165
+ h(KButton, {
166
+ onClick: _this2.onInsert,
167
+ on: _this2.v3 ? undefined : {
168
+ "click": _this2.onInsert
169
+ },
170
+ themeColor: 'primary',
171
+ attrs: _this2.v3 ? undefined : {
172
+ themeColor: 'primary',
173
+ dir: dir
174
+ },
175
+ dir: dir,
176
+ key: "insert"
177
+ }, _this2.v3 ? function () {
178
+ return [localization.toLanguageString(insertHyperlinkInsert, messages[insertHyperlinkInsert])];
179
+ } : [localization.toLanguageString(insertHyperlinkInsert, messages[insertHyperlinkInsert])])];
180
+ } : [h(KButton, {
181
+ onClick: _this2.onClose,
182
+ on: _this2.v3 ? undefined : {
183
+ "click": _this2.onClose
184
+ },
185
+ dir: dir,
186
+ attrs: _this2.v3 ? undefined : {
187
+ dir: dir
188
+ },
189
+ key: "cancel"
190
+ }, _this2.v3 ? function () {
191
+ return [localization.toLanguageString(insertHyperlinkCancel, messages[insertHyperlinkCancel])];
192
+ } : [localization.toLanguageString(insertHyperlinkCancel, messages[insertHyperlinkCancel])]), h(KButton, {
193
+ onClick: _this2.onInsert,
194
+ on: _this2.v3 ? undefined : {
195
+ "click": _this2.onInsert
196
+ },
197
+ themeColor: 'primary',
198
+ attrs: _this2.v3 ? undefined : {
199
+ themeColor: 'primary',
200
+ dir: dir
201
+ },
202
+ dir: dir,
203
+ key: "insert"
204
+ }, _this2.v3 ? function () {
205
+ return [localization.toLanguageString(insertHyperlinkInsert, messages[insertHyperlinkInsert])];
206
+ } : [localization.toLanguageString(insertHyperlinkInsert, messages[insertHyperlinkInsert])])])];
207
+ } : [content, h(DialogActionsBar, _this2.v3 ? function () {
208
+ return [h(KButton, {
209
+ onClick: _this2.onClose,
210
+ on: _this2.v3 ? undefined : {
211
+ "click": _this2.onClose
212
+ },
213
+ dir: dir,
214
+ attrs: _this2.v3 ? undefined : {
215
+ dir: dir
216
+ },
217
+ key: "cancel"
218
+ }, _this2.v3 ? function () {
219
+ return [localization.toLanguageString(insertHyperlinkCancel, messages[insertHyperlinkCancel])];
220
+ } : [localization.toLanguageString(insertHyperlinkCancel, messages[insertHyperlinkCancel])]), h(KButton, {
221
+ onClick: _this2.onInsert,
222
+ on: _this2.v3 ? undefined : {
223
+ "click": _this2.onInsert
224
+ },
225
+ themeColor: 'primary',
226
+ attrs: _this2.v3 ? undefined : {
227
+ themeColor: 'primary',
228
+ dir: dir
229
+ },
230
+ dir: dir,
231
+ key: "insert"
232
+ }, _this2.v3 ? function () {
233
+ return [localization.toLanguageString(insertHyperlinkInsert, messages[insertHyperlinkInsert])];
234
+ } : [localization.toLanguageString(insertHyperlinkInsert, messages[insertHyperlinkInsert])])];
235
+ } : [h(KButton, {
236
+ onClick: _this2.onClose,
237
+ on: _this2.v3 ? undefined : {
238
+ "click": _this2.onClose
239
+ },
240
+ dir: dir,
241
+ attrs: _this2.v3 ? undefined : {
242
+ dir: dir
243
+ },
244
+ key: "cancel"
245
+ }, _this2.v3 ? function () {
246
+ return [localization.toLanguageString(insertHyperlinkCancel, messages[insertHyperlinkCancel])];
247
+ } : [localization.toLanguageString(insertHyperlinkCancel, messages[insertHyperlinkCancel])]), h(KButton, {
248
+ onClick: _this2.onInsert,
249
+ on: _this2.v3 ? undefined : {
250
+ "click": _this2.onInsert
251
+ },
252
+ themeColor: 'primary',
253
+ attrs: _this2.v3 ? undefined : {
254
+ themeColor: 'primary',
255
+ dir: dir
256
+ },
257
+ dir: dir,
258
+ key: "insert"
259
+ }, _this2.v3 ? function () {
260
+ return [localization.toLanguageString(insertHyperlinkInsert, messages[insertHyperlinkInsert])];
261
+ } : [localization.toLanguageString(insertHyperlinkInsert, messages[insertHyperlinkInsert])])])]);
262
+ return dialog;
263
+ },
264
+ methods: {
265
+ onClose: function onClose() {
266
+ this.$props.view.focus();
267
+ this.$emit('close');
268
+ },
269
+ onInsert: function onInsert() {
270
+ var view = this.$props.view;
271
+ var mark = this.$props.settings.mark;
272
+ var attrs = {
273
+ href: this.href ? this.href.value : undefined,
274
+ title: this.title ? this.title.value : undefined,
275
+ target: this.target && this.target.checked ? '_blank' : undefined
276
+ };
277
+ applyLink({
278
+ mark: mark,
279
+ attrs: attrs
280
+ }, this.$props.settings.commandName)(view.state, view.dispatch);
281
+ this.onClose();
282
+ }
283
+ }
284
+ };
285
+ var InsertLinkDialogVue3 = InsertLinkDialog;
286
+ export { InsertLinkDialog, InsertLinkDialogVue3 };
@@ -0,0 +1 @@
1
+