@themarioga/grid-editor 6.0.0-beta.5 → 7.0.0

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 (147) hide show
  1. package/AUTO_SAVE.md +2 -2
  2. package/BUILDING.md +45 -29
  3. package/CHANGELOG.md +54 -0
  4. package/README.md +140 -89
  5. package/UPGRADING.md +146 -2
  6. package/dist/grideditor.bundle.min.js +14 -0
  7. package/dist/grideditor.d.ts +335 -0
  8. package/dist/grideditor.esm.js +3977 -0
  9. package/dist/grideditor.jquery.js +253 -0
  10. package/dist/grideditor.jquery.min.js +1 -0
  11. package/dist/grideditor.jquery.min.js.map +7 -0
  12. package/dist/grideditor.js +3983 -0
  13. package/dist/grideditor.min.js +6 -0
  14. package/dist/grideditor.min.js.map +7 -0
  15. package/dist/locales/grideditor.es.esm.js +158 -0
  16. package/dist/locales/grideditor.es.js +164 -170
  17. package/dist/locales/grideditor.es.min.js +6 -2
  18. package/dist/locales/grideditor.es.min.js.map +7 -1
  19. package/dist/plugins/grideditor.accordion.esm.js +294 -0
  20. package/dist/plugins/grideditor.accordion.js +286 -180
  21. package/dist/plugins/grideditor.accordion.min.js +1 -2
  22. package/dist/plugins/grideditor.accordion.min.js.map +7 -1
  23. package/dist/plugins/grideditor.alignment.esm.js +55 -0
  24. package/dist/plugins/grideditor.alignment.js +58 -77
  25. package/dist/plugins/grideditor.alignment.min.js +1 -2
  26. package/dist/plugins/grideditor.alignment.min.js.map +7 -1
  27. package/dist/plugins/grideditor.card.esm.js +73 -0
  28. package/dist/plugins/grideditor.card.js +74 -64
  29. package/dist/plugins/grideditor.card.min.js +1 -2
  30. package/dist/plugins/grideditor.card.min.js.map +7 -1
  31. package/dist/plugins/grideditor.ckeditor.esm.js +500 -0
  32. package/dist/plugins/grideditor.ckeditor.js +482 -493
  33. package/dist/plugins/grideditor.ckeditor.min.js +1 -2
  34. package/dist/plugins/grideditor.ckeditor.min.js.map +7 -1
  35. package/dist/plugins/grideditor.clipboard.esm.js +326 -0
  36. package/dist/plugins/grideditor.clipboard.js +298 -235
  37. package/dist/plugins/grideditor.clipboard.min.js +1 -2
  38. package/dist/plugins/grideditor.clipboard.min.js.map +7 -1
  39. package/dist/plugins/grideditor.codemirror-inline.esm.js +205 -0
  40. package/dist/plugins/grideditor.codemirror-inline.js +188 -168
  41. package/dist/plugins/grideditor.codemirror-inline.min.js +1 -2
  42. package/dist/plugins/grideditor.codemirror-inline.min.js.map +7 -1
  43. package/dist/plugins/grideditor.codemirror.esm.js +63 -0
  44. package/dist/plugins/grideditor.codemirror.js +60 -71
  45. package/dist/plugins/grideditor.codemirror.min.js +1 -2
  46. package/dist/plugins/grideditor.codemirror.min.js.map +7 -1
  47. package/dist/plugins/grideditor.elements.esm.js +271 -0
  48. package/dist/plugins/grideditor.elements.js +256 -149
  49. package/dist/plugins/grideditor.elements.min.js +1 -2
  50. package/dist/plugins/grideditor.elements.min.js.map +7 -1
  51. package/dist/plugins/grideditor.float.esm.js +34 -0
  52. package/dist/plugins/grideditor.float.js +37 -52
  53. package/dist/plugins/grideditor.float.min.js +1 -2
  54. package/dist/plugins/grideditor.float.min.js.map +7 -1
  55. package/dist/plugins/grideditor.gutters.esm.js +143 -0
  56. package/dist/plugins/grideditor.gutters.js +134 -131
  57. package/dist/plugins/grideditor.gutters.min.js +1 -2
  58. package/dist/plugins/grideditor.gutters.min.js.map +7 -1
  59. package/dist/plugins/grideditor.order.esm.js +189 -0
  60. package/dist/plugins/grideditor.order.js +170 -182
  61. package/dist/plugins/grideditor.order.min.js +1 -2
  62. package/dist/plugins/grideditor.order.min.js.map +7 -1
  63. package/dist/plugins/grideditor.popup.esm.js +187 -0
  64. package/dist/plugins/grideditor.popup.js +183 -134
  65. package/dist/plugins/grideditor.popup.min.js +1 -2
  66. package/dist/plugins/grideditor.popup.min.js.map +7 -1
  67. package/dist/plugins/grideditor.sections.esm.js +271 -0
  68. package/dist/plugins/grideditor.sections.js +250 -173
  69. package/dist/plugins/grideditor.sections.min.js +1 -2
  70. package/dist/plugins/grideditor.sections.min.js.map +7 -1
  71. package/dist/plugins/grideditor.spacing.esm.js +318 -0
  72. package/dist/plugins/grideditor.spacing.js +296 -272
  73. package/dist/plugins/grideditor.spacing.min.js +1 -2
  74. package/dist/plugins/grideditor.spacing.min.js.map +7 -1
  75. package/dist/plugins/grideditor.summernote.esm.js +509 -0
  76. package/dist/plugins/grideditor.summernote.js +491 -471
  77. package/dist/plugins/grideditor.summernote.min.js +1 -2
  78. package/dist/plugins/grideditor.summernote.min.js.map +7 -1
  79. package/dist/plugins/grideditor.tabs.esm.js +237 -0
  80. package/dist/plugins/grideditor.tabs.js +233 -139
  81. package/dist/plugins/grideditor.tabs.min.js +1 -2
  82. package/dist/plugins/grideditor.tabs.min.js.map +7 -1
  83. package/dist/plugins/grideditor.textalign.esm.js +40 -0
  84. package/dist/plugins/grideditor.textalign.js +43 -56
  85. package/dist/plugins/grideditor.textalign.min.js +1 -2
  86. package/dist/plugins/grideditor.textalign.min.js.map +7 -1
  87. package/dist/plugins/grideditor.tinymce.esm.js +519 -0
  88. package/dist/plugins/grideditor.tinymce.js +500 -534
  89. package/dist/plugins/grideditor.tinymce.min.js +1 -2
  90. package/dist/plugins/grideditor.tinymce.min.js.map +7 -1
  91. package/dist/plugins/grideditor.visibility.esm.js +158 -0
  92. package/dist/plugins/grideditor.visibility.js +140 -149
  93. package/dist/plugins/grideditor.visibility.min.js +1 -2
  94. package/dist/plugins/grideditor.visibility.min.js.map +7 -1
  95. package/docs/events.md +47 -21
  96. package/docs/locale-keys.md +7 -4
  97. package/docs/plugins.md +49 -27
  98. package/example/adapter.html +112 -0
  99. package/example/attributes.html +85 -61
  100. package/example/autocols.html +9 -9
  101. package/example/autosave.html +13 -14
  102. package/example/basic.html +4 -5
  103. package/example/breakpoints.html +5 -6
  104. package/example/ckeditor.html +4 -5
  105. package/example/clipboard.html +11 -10
  106. package/example/codemirror.html +9 -7
  107. package/example/containers.html +7 -8
  108. package/example/custom_editor.html +53 -34
  109. package/example/elements.html +10 -11
  110. package/example/index.html +16 -2
  111. package/example/locale.html +6 -7
  112. package/example/plugins.html +44 -29
  113. package/example/summernote.html +6 -5
  114. package/example/utilities.html +17 -13
  115. package/example/wrap_content.html +9 -9
  116. package/package.json +43 -12
  117. package/src/js/dom.js +401 -0
  118. package/src/js/grideditor.classic.js +16 -0
  119. package/src/js/grideditor.jquery.js +325 -0
  120. package/src/js/{jquery.grideditor.js → grideditor.js} +1284 -1124
  121. package/src/js/locales/grideditor.es.js +163 -158
  122. package/src/js/plugins/grideditor.accordion.js +97 -77
  123. package/src/js/plugins/grideditor.alignment.js +5 -7
  124. package/src/js/plugins/grideditor.card.js +23 -23
  125. package/src/js/plugins/grideditor.ckeditor.js +107 -106
  126. package/src/js/plugins/grideditor.clipboard.js +49 -37
  127. package/src/js/plugins/grideditor.codemirror-inline.js +50 -37
  128. package/src/js/plugins/grideditor.codemirror.js +9 -10
  129. package/src/js/plugins/grideditor.elements.js +57 -33
  130. package/src/js/plugins/grideditor.float.js +4 -6
  131. package/src/js/plugins/grideditor.gutters.js +20 -15
  132. package/src/js/plugins/grideditor.order.js +28 -25
  133. package/src/js/plugins/grideditor.popup.js +63 -51
  134. package/src/js/plugins/grideditor.sections.js +39 -32
  135. package/src/js/plugins/grideditor.spacing.js +42 -45
  136. package/src/js/plugins/grideditor.summernote.js +112 -76
  137. package/src/js/plugins/grideditor.tabs.js +65 -57
  138. package/src/js/plugins/grideditor.textalign.js +4 -6
  139. package/src/js/plugins/grideditor.tinymce.js +147 -139
  140. package/src/js/plugins/grideditor.visibility.js +24 -25
  141. package/src/js/register.js +18 -0
  142. package/src/js/text/grideditor.text.js +81 -106
  143. package/types/grideditor.d.ts +335 -0
  144. package/dist/jquery.grideditor.bundle.min.js +0 -10
  145. package/dist/jquery.grideditor.js +0 -4927
  146. package/dist/jquery.grideditor.min.js +0 -2
  147. package/dist/jquery.grideditor.min.js.map +0 -1
@@ -8,30 +8,36 @@
8
8
  *
9
9
  * It is a feature plugin, `text`, that the `plugins` setting does not choose
10
10
  * (content_types does), and it is everything a text is to the editor: the
11
- * text block's drawer, the Text buttons in the toolbar and the Add text tool
12
- * in each column, createText, opening an editor on a click and closing it
13
- * again with the host's attributes put back, and making the host's plain
14
- * content a text through the core's `textTypes` hook.
11
+ * text block's drawer, the Text buttons in the toolbar, createText, opening
12
+ * an editor on a click and closing it again with the host's attributes put
13
+ * back, and making the host's plain content a text through the core's
14
+ * `textTypes` hook.
15
15
  *
16
- * Each editor registers under $.fn.gridEditor.texts, which is this file's own
16
+ * Each editor registers under GridEditor.texts, which is this file's own
17
17
  * registry and not a contract: an editor of a host's own is a feature plugin
18
18
  * of its own, as example/custom_editor.html shows.
19
19
  */
20
- (function($) {
20
+ import { GridEditor } from '../grideditor.js';
21
+ import * as dom from '../dom.js';
21
22
 
22
- if ($.fn.gridEditor.features.text) { return; }
23
+ // However many editors a page loads, each with a copy of this file in its
24
+ // classic script: the first one installs it
25
+ if (!GridEditor.features.text) {
23
26
 
24
- $.extend($.fn.gridEditor.locales.en, {
25
- 'tool.add_text': 'Add text',
26
- 'tool.add_text_type': 'Add {editor} text',
27
+ Object.assign(GridEditor.locales.en, {
27
28
  'text.add': 'Text',
28
29
  'text.add_type': 'Text ({editor})',
29
30
  'panel.editor': 'Editor',
30
31
  'panel.kind_text': 'Text',
31
32
  });
32
33
 
33
- /** The text editors, by the content type each edits. */
34
- $.fn.gridEditor.texts = $.fn.gridEditor.texts || {};
34
+ /**
35
+ * What a content area's attributes were before its editor opened, and
36
+ * once it had: the two readings closeText plays the host's changes
37
+ * back from. Shared by every editor on the page, like the nodes.
38
+ */
39
+ var readBefore = new WeakMap();
40
+ var readReady = new WeakMap();
35
41
 
36
42
  /** What a text editor puts on a content area while it is open, whenever it likes. */
37
43
  var EDITOR_CLASS = /^(mce-|cke|note-)|^(active|ge-rte-active)$/;
@@ -39,7 +45,7 @@
39
45
 
40
46
  function attributesOf(element) {
41
47
  var found = {};
42
- $.each($.makeArray(element.attributes), function(i, attribute) {
48
+ Array.prototype.slice.call(element.attributes).forEach(function(attribute) {
43
49
  found[attribute.name] = attribute.value;
44
50
  });
45
51
  return found;
@@ -53,9 +59,9 @@
53
59
 
54
60
  /** The host's markup, with what changed from `ready` to `open` played back onto it. */
55
61
  function restoreAttributes(block, before, ready, open) {
56
- var result = $.extend({}, before);
62
+ var result = Object.assign({}, before);
57
63
 
58
- $.each($.extend({}, ready, open), function(name) {
64
+ Object.keys(Object.assign({}, ready, open)).forEach(function(name) {
59
65
  if (name === 'class' || EDITOR_ATTRIBUTE.test(name) || ready[name] === open[name]) { return; }
60
66
 
61
67
  if (open[name] === undefined) {
@@ -78,8 +84,8 @@
78
84
  // shuffle a node's attributes because it was edited
79
85
  if (classes.length) { result['class'] = classes.join(' '); } else { delete result['class']; }
80
86
 
81
- $.each(attributesOf(block[0]), function(name) { block.removeAttr(name); });
82
- $.each(result, function(name, value) { block.attr(name, value); });
87
+ Object.keys(attributesOf(block)).forEach(function(name) { block.removeAttribute(name); });
88
+ Object.keys(result).forEach(function(name) { block.setAttribute(name, result[name]); });
83
89
  }
84
90
 
85
91
  function textFeature(ge) {
@@ -88,8 +94,8 @@
88
94
  var TEXTS = {};
89
95
  var warned = {};
90
96
 
91
- $.each($.fn.gridEditor.texts, function(type, factory) {
92
- TEXTS[type] = factory(ge);
97
+ Object.keys(GridEditor.texts).forEach(function(type) {
98
+ TEXTS[type] = GridEditor.texts[type](ge);
93
99
  });
94
100
 
95
101
  // Every editor loaded, in the order the page loaded them, unless the
@@ -112,16 +118,17 @@
112
118
  /** A detached content area of `type`, holding `content` or the editor's initial content. */
113
119
  function makeText(type, content) {
114
120
  var text = TEXTS[type];
121
+ var block = dom.element('div', {
122
+ 'class': 'ge-content ge-content-type-' + type,
123
+ 'data-ge-content-type': type,
124
+ });
115
125
 
116
- return $('<div class="ge-content" />')
117
- .addClass('ge-content-type-' + type)
118
- .attr('data-ge-content-type', type)
119
- .html(content !== undefined ? content : (text && text.initialContent) || '');
120
- }
121
-
122
- /** A text block at the end of a column, through the add events. */
123
- function addTextTo(col, type) {
124
- return ge.place(makeText(type), 'text', { appendTo: col, source: 'tool' });
126
+ if (content && content.nodeType) {
127
+ block.appendChild(content);
128
+ } else {
129
+ dom.setHtml(block, content !== undefined ? content : (text && text.initialContent) || '');
130
+ }
131
+ return block;
125
132
  }
126
133
 
127
134
  /**
@@ -151,21 +158,20 @@
151
158
 
152
159
  /** Whether a content area is a text of one of the editors loaded here. */
153
160
  function isOurs(block) {
154
- return !!TEXTS[block.attr('data-ge-content-type')];
161
+ return !!TEXTS[block.getAttribute('data-ge-content-type')];
155
162
  }
156
163
 
157
164
  /** Open the editor on a text, once: until it is closed again. */
158
165
  function startText(block) {
159
- if (block.hasClass('ge-rte-active')) { return; }
166
+ if (dom.hasClass(block, 'ge-rte-active')) { return; }
160
167
 
161
168
  // A content area nobody can see - a tab that is not the open one,
162
169
  // a closed accordion item - has no geometry for an editor to lay
163
170
  // its toolbar out against, and nothing anyone can type into
164
- if (!block.is(':visible')) { return; }
171
+ if (!dom.visible(block)) { return; }
165
172
 
166
- // The attribute, not jQuery's cached copy of it: it is markup, and
167
- // the drawer reads it the same way
168
- var text = TEXTS[block.attr('data-ge-content-type')];
173
+ // The attribute: it is markup, and the drawer reads it the same way
174
+ var text = TEXTS[block.getAttribute('data-ge-content-type')];
169
175
  if (!text) { return; }
170
176
 
171
177
  // Not marked active, so the next click tries again: the library
@@ -175,13 +181,14 @@
175
181
  return;
176
182
  }
177
183
 
178
- block.data('ge-text-before', attributesOf(block[0])).removeData('ge-text-ready');
179
- block.addClass('ge-rte-active');
180
- text.start(block);
184
+ readBefore.set(block, attributesOf(block));
185
+ readReady.delete(block);
186
+ dom.addClass(block, 'ge-rte-active');
187
+ text.start([block]);
181
188
  }
182
189
 
183
190
  function onClick() {
184
- startText($(this));
191
+ startText(this);
185
192
  }
186
193
 
187
194
  /**
@@ -199,28 +206,30 @@
199
206
  * is left out either way.
200
207
  */
201
208
  function closeText(block) {
202
- var text = TEXTS[block.attr('data-ge-content-type')];
203
- var before = block.data('ge-text-before');
204
- var open = before ? attributesOf(block[0]) : null;
209
+ var text = TEXTS[block.getAttribute('data-ge-content-type')];
210
+ var before = readBefore.get(block);
211
+ var open = before ? attributesOf(block) : null;
205
212
 
206
213
  // Every content area is told, as in 5.x: one whose editor never
207
214
  // started is the plugin's to ignore
208
- if (text) { text.stop(block); }
215
+ if (text) { text.stop([block]); }
209
216
 
210
217
  // After stop, not before: an editor that restores the class
211
218
  // attribute it snapshotted would put ge-rte-active back
212
- block.removeClass('ge-rte-active');
219
+ dom.removeClass(block, 'ge-rte-active');
213
220
 
214
221
  if (before) {
215
- restoreAttributes(block, before, block.data('ge-text-ready') || before, open);
216
- block.removeData('ge-text-before').removeData('ge-text-ready');
222
+ restoreAttributes(block, before, readReady.get(block) || before, open);
223
+ readBefore.delete(block);
224
+ readReady.delete(block);
217
225
  }
218
226
  }
219
227
 
220
228
  function createTextControls(textBlock) {
221
- var block = textBlock.children('.ge-content');
222
- var type = block.attr('data-ge-content-type');
223
- var drawer = $('<div class="ge-tools-drawer ge-text-drawer" />').prependTo(textBlock);
229
+ var block = dom.child(textBlock, '.ge-content');
230
+ var type = block.getAttribute('data-ge-content-type');
231
+ var drawer = dom.element('div', { 'class': 'ge-tools-drawer ge-text-drawer' });
232
+ textBlock.insertBefore(drawer, textBlock.firstChild);
224
233
 
225
234
  ge.createMoveTool(drawer);
226
235
 
@@ -228,10 +237,11 @@
228
237
 
229
238
  // Which editor edits it, first in its settings: something to
230
239
  // know about it, not something to do with it
231
- $('<div class="ge-field ge-text-editor" />')
232
- .append($('<span class="ge-field-label" />').text(ge.t('panel.editor')))
233
- .append($('<span class="ge-field-value" />').text(textLabel(type)))
234
- .prependTo(details.children('.ge-details-general'));
240
+ var general = dom.child(details, '.ge-details-general');
241
+ var editor = dom.element('div', { 'class': 'ge-field ge-text-editor' });
242
+ editor.appendChild(dom.element('span', { 'class': 'ge-field-label' }, ge.t('panel.editor')));
243
+ editor.appendChild(dom.element('span', { 'class': 'ge-field-value' }, textLabel(type)));
244
+ general.insertBefore(editor, general.firstChild);
235
245
 
236
246
  settings.text_tools.forEach(function(hostTool) {
237
247
  ge.createTool(drawer, hostTool.title || '', hostTool.className || '',
@@ -243,7 +253,7 @@
243
253
  // Its editor lets go first: removed while open, it would
244
254
  // be left behind, attached to nothing
245
255
  closeText(block);
246
- textBlock.slideUp(function() {
256
+ dom.slideUp(textBlock, function() {
247
257
  textBlock.remove();
248
258
  removed();
249
259
  });
@@ -253,54 +263,18 @@
253
263
 
254
264
  /** A drawer for each text of ours in a text block that has none yet. */
255
265
  function markTexts() {
256
- ge.canvas.find('.ge-text-block').each(function() {
257
- var textBlock = $(this);
258
- if (textBlock.children('.ge-tools-drawer').length) { return; }
259
- if (!isOurs(textBlock.children('.ge-content'))) { return; }
260
-
261
- createTextControls(textBlock);
262
- });
263
- }
266
+ dom.all(ge.canvas, '.ge-text-block').forEach(function(textBlock) {
267
+ if (dom.child(textBlock, '.ge-tools-drawer')) { return; }
264
268
 
265
- /**
266
- * The add text tool, in each column's drawer before its add row tool:
267
- * a text of the first editor offered, or, held, of the one chosen.
268
- */
269
- function addTextTools() {
270
- var texts = offeredTexts();
271
- if (!texts.length) { return; }
272
-
273
- ge.canvas.find('.column').each(function() {
274
- var col = $(this);
275
- var drawer = col.children('.ge-tools-drawer');
276
- if (!drawer.length || drawer.children('.ge-add-text').length) { return; }
269
+ var block = dom.child(textBlock, '.ge-content');
270
+ if (!block || !isOurs(block)) { return; }
277
271
 
278
- ge.createTool(drawer, ge.t('tool.add_text'), 'ge-add-text', 'bi bi-type', function() {
279
- if (ge.closePicker()) { return; } // The picker was open: that was the answer
280
-
281
- addTextTo(col, texts[0]);
282
- });
283
-
284
- var tool = drawer.children('.ge-add-text');
285
- var addRow = drawer.children('.ge-add-row');
286
- if (addRow.length) { tool.insertBefore(addRow); }
287
-
288
- if (texts.length > 1) {
289
- ge.attachPicker(tool, function() {
290
- ge.openPicker(tool, texts.map(function(type) {
291
- return {
292
- label: textLabel(type),
293
- title: ge.t('tool.add_text_type', { editor: textLabel(type) }),
294
- attributes: { 'data-ge-content-type': type },
295
- choose: function() { addTextTo(col, type); },
296
- };
297
- }), 'ge-text-picker');
298
- });
299
- }
272
+ createTextControls(textBlock);
300
273
  });
301
274
  }
302
275
 
303
276
  var texts = offeredTexts();
277
+ var clicks = null; // The delegated click listener, while editing
304
278
 
305
279
  return {
306
280
  methods: {
@@ -326,8 +300,8 @@
326
300
  available: text.available ? function() { return text.available(); } : null,
327
301
  missingKey: text.missingKey,
328
302
  edit: function(block) {
329
- var textBlock = block.parent('.ge-text-block');
330
- if (textBlock.length && !textBlock.children('.ge-tools-drawer').length) {
303
+ var textBlock = block.parentElement;
304
+ if (dom.hasClass(textBlock, 'ge-text-block') && !dom.child(textBlock, '.ge-tools-drawer')) {
331
305
  createTextControls(textBlock);
332
306
  }
333
307
 
@@ -354,28 +328,29 @@
354
328
 
355
329
  onInit: function() {
356
330
  markTexts();
357
- addTextTools();
358
331
 
359
- ge.canvas.off('click.ge-text').on('click.ge-text', '.ge-content', onClick);
332
+ if (clicks) { ge.canvas.removeEventListener('click', clicks); }
333
+ clicks = dom.delegate(ge.canvas, 'click', '.ge-content', onClick);
360
334
  },
361
335
 
362
336
  // While the drawers and the text blocks are still there, as the
363
337
  // editors left them
364
338
  onBeforeDeinit: function() {
365
- ge.canvas.find('.ge-content').each(function() {
366
- if (isOurs($(this))) { closeText($(this)); }
339
+ dom.all(ge.canvas, '.ge-content').forEach(function(block) {
340
+ if (isOurs(block)) { closeText(block); }
367
341
  });
368
342
  },
369
343
 
370
344
  onDeinit: function() {
371
- ge.canvas.off('click.ge-text');
345
+ if (clicks) { ge.canvas.removeEventListener('click', clicks); }
346
+ clicks = null;
372
347
  },
373
348
 
374
349
  // The first time only: an undo says ready again, and by then the
375
350
  // host may have changed the content area itself
376
351
  onContentReady: function(area) {
377
- if (area.data('ge-text-before') && !area.data('ge-text-ready')) {
378
- area.data('ge-text-ready', attributesOf(area[0]));
352
+ if (readBefore.has(area) && !readReady.has(area)) {
353
+ readReady.set(area, attributesOf(area));
379
354
  }
380
355
  },
381
356
  };
@@ -384,6 +359,6 @@
384
359
  // Whatever the plugins setting says: content_types chooses the editors
385
360
  textFeature.always = true;
386
361
 
387
- $.fn.gridEditor.features.text = textFeature;
362
+ GridEditor.features.text = textFeature;
388
363
 
389
- })(jQuery);
364
+ }