@themarioga/grid-editor 6.0.0-beta.3 → 6.0.0-beta.4
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/BUILDING.md +3 -1
- package/CHANGELOG.md +50 -1
- package/README.md +16 -5
- package/UPGRADING.md +36 -7
- package/dist/grideditor.css +14 -0
- package/dist/grideditor.min.css +1 -1
- package/dist/grideditor.min.css.map +1 -1
- package/dist/jquery.grideditor.bundle.min.js +2 -2
- package/dist/jquery.grideditor.js +303 -385
- package/dist/jquery.grideditor.min.js +1 -1
- package/dist/jquery.grideditor.min.js.map +1 -1
- package/dist/locales/grideditor.es.js +3 -0
- package/dist/locales/grideditor.es.min.js +1 -1
- package/dist/locales/grideditor.es.min.js.map +1 -1
- package/dist/plugins/grideditor.ckeditor.js +397 -3
- package/dist/plugins/grideditor.ckeditor.min.js +1 -1
- package/dist/plugins/grideditor.ckeditor.min.js.map +1 -1
- package/dist/plugins/grideditor.summernote.js +397 -3
- package/dist/plugins/grideditor.summernote.min.js +1 -1
- package/dist/plugins/grideditor.summernote.min.js.map +1 -1
- package/dist/plugins/grideditor.tinymce.js +397 -3
- package/dist/plugins/grideditor.tinymce.min.js +1 -1
- package/dist/plugins/grideditor.tinymce.min.js.map +1 -1
- package/dist/plugins/grideditor.visibility.js +1 -1
- package/dist/plugins/grideditor.visibility.min.js +1 -1
- package/dist/plugins/grideditor.visibility.min.js.map +1 -1
- package/docs/events.md +11 -2
- package/docs/locale-keys.md +12 -3
- package/docs/plugins.md +109 -46
- package/example/custom_editor.html +193 -0
- package/example/index.html +8 -0
- package/example/wrap_content.html +5 -3
- package/package.json +1 -1
- package/src/js/jquery.grideditor.js +303 -385
- package/src/js/locales/grideditor.es.js +3 -0
- package/src/js/plugins/grideditor.ckeditor.js +7 -3
- package/src/js/plugins/grideditor.summernote.js +7 -3
- package/src/js/plugins/grideditor.tinymce.js +7 -3
- package/src/js/plugins/grideditor.visibility.js +1 -1
- package/src/js/text/grideditor.text.js +389 -0
- package/src/less/grideditor.less +17 -0
|
@@ -1,9 +1,399 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text for grid-editor: what the text editor plugins share.
|
|
3
|
+
*
|
|
4
|
+
* Not a file a page loads. The build puts it at the top of each text editor
|
|
5
|
+
* plugin - grideditor.tinymce.js, grideditor.ckeditor.js,
|
|
6
|
+
* grideditor.summernote.js - and whichever of them loads first installs it:
|
|
7
|
+
* a page with two editors has one of these.
|
|
8
|
+
*
|
|
9
|
+
* It is a feature plugin, `text`, that the `plugins` setting does not choose
|
|
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.
|
|
15
|
+
*
|
|
16
|
+
* Each editor registers under $.fn.gridEditor.texts, which is this file's own
|
|
17
|
+
* registry and not a contract: an editor of a host's own is a feature plugin
|
|
18
|
+
* of its own, as example/custom_editor.html shows.
|
|
19
|
+
*/
|
|
20
|
+
(function($) {
|
|
21
|
+
|
|
22
|
+
if ($.fn.gridEditor.features.text) { return; }
|
|
23
|
+
|
|
24
|
+
$.extend($.fn.gridEditor.locales.en, {
|
|
25
|
+
'tool.add_text': 'Add text',
|
|
26
|
+
'tool.add_text_type': 'Add {editor} text',
|
|
27
|
+
'text.add': 'Text',
|
|
28
|
+
'text.add_type': 'Text ({editor})',
|
|
29
|
+
'panel.editor': 'Editor',
|
|
30
|
+
'panel.kind_text': 'Text',
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
/** The text editors, by the content type each edits. */
|
|
34
|
+
$.fn.gridEditor.texts = $.fn.gridEditor.texts || {};
|
|
35
|
+
|
|
36
|
+
/** What a text editor puts on a content area while it is open, whenever it likes. */
|
|
37
|
+
var EDITOR_CLASS = /^(mce-|cke|note-)|^(active|ge-rte-active)$/;
|
|
38
|
+
var EDITOR_ATTRIBUTE = /^(data-mce-|contenteditable$|spellcheck$)/;
|
|
39
|
+
|
|
40
|
+
function attributesOf(element) {
|
|
41
|
+
var found = {};
|
|
42
|
+
$.each($.makeArray(element.attributes), function(i, attribute) {
|
|
43
|
+
found[attribute.name] = attribute.value;
|
|
44
|
+
});
|
|
45
|
+
return found;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function classesIn(value) {
|
|
49
|
+
return (value || '').split(/\s+/).filter(function(name) {
|
|
50
|
+
return name !== '' && !EDITOR_CLASS.test(name);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** The host's markup, with what changed from `ready` to `open` played back onto it. */
|
|
55
|
+
function restoreAttributes(block, before, ready, open) {
|
|
56
|
+
var result = $.extend({}, before);
|
|
57
|
+
|
|
58
|
+
$.each($.extend({}, ready, open), function(name) {
|
|
59
|
+
if (name === 'class' || EDITOR_ATTRIBUTE.test(name) || ready[name] === open[name]) { return; }
|
|
60
|
+
|
|
61
|
+
if (open[name] === undefined) {
|
|
62
|
+
delete result[name];
|
|
63
|
+
} else {
|
|
64
|
+
result[name] = open[name];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
var readyClasses = classesIn(ready['class']);
|
|
69
|
+
var openClasses = classesIn(open['class']);
|
|
70
|
+
var classes = classesIn(before['class']).filter(function(name) {
|
|
71
|
+
return openClasses.indexOf(name) !== -1 || readyClasses.indexOf(name) === -1;
|
|
72
|
+
});
|
|
73
|
+
openClasses.forEach(function(name) {
|
|
74
|
+
if (readyClasses.indexOf(name) === -1 && classes.indexOf(name) === -1) { classes.push(name); }
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
// In the host's order, class where it was: getHtml should not
|
|
78
|
+
// shuffle a node's attributes because it was edited
|
|
79
|
+
if (classes.length) { result['class'] = classes.join(' '); } else { delete result['class']; }
|
|
80
|
+
|
|
81
|
+
$.each(attributesOf(block[0]), function(name) { block.removeAttr(name); });
|
|
82
|
+
$.each(result, function(name, value) { block.attr(name, value); });
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function textFeature(ge) {
|
|
86
|
+
|
|
87
|
+
var settings = ge.settings;
|
|
88
|
+
var TEXTS = {};
|
|
89
|
+
var warned = {};
|
|
90
|
+
|
|
91
|
+
$.each($.fn.gridEditor.texts, function(type, factory) {
|
|
92
|
+
TEXTS[type] = factory(ge);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// Every editor loaded, in the order the page loaded them, unless the
|
|
96
|
+
// host names the ones it wants
|
|
97
|
+
if (!Array.isArray(settings.content_types)) { settings.content_types = Object.keys(TEXTS); }
|
|
98
|
+
if (!Array.isArray(settings.text_tools)) { settings.text_tools = []; }
|
|
99
|
+
if (!Array.isArray(settings.text_classes)) { settings.text_classes = []; }
|
|
100
|
+
|
|
101
|
+
/** The text editors this editor offers, in content_types order: the ones loaded. */
|
|
102
|
+
function offeredTexts() {
|
|
103
|
+
return settings.content_types.filter(function(type) { return !!TEXTS[type]; });
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** What a text editor is called: its plugin's label, or its type. */
|
|
107
|
+
function textLabel(type) {
|
|
108
|
+
var text = TEXTS[type];
|
|
109
|
+
return text && text.labelKey ? ge.t(text.labelKey) : type;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** A detached content area of `type`, holding `content` or the editor's initial content. */
|
|
113
|
+
function makeText(type, content) {
|
|
114
|
+
var text = TEXTS[type];
|
|
115
|
+
|
|
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' });
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* createText(type?, options?): a content area of a text editor's,
|
|
129
|
+
* detached unless a placement is given. The type is the first one
|
|
130
|
+
* offered by default. `options.content` is its html.
|
|
131
|
+
*/
|
|
132
|
+
function apiCreateText(type, options) {
|
|
133
|
+
if (type && typeof type === 'object') {
|
|
134
|
+
options = type;
|
|
135
|
+
type = undefined;
|
|
136
|
+
}
|
|
137
|
+
options = options || {};
|
|
138
|
+
type = type || offeredTexts()[0];
|
|
139
|
+
|
|
140
|
+
if (!type || !TEXTS[type]) {
|
|
141
|
+
if (!warned['createText:' + type]) {
|
|
142
|
+
warned['createText:' + type] = true;
|
|
143
|
+
ge.warn('createText: no text editor "' + type + '" is loaded; ' +
|
|
144
|
+
'load its plugin and name it in content_types');
|
|
145
|
+
}
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return ge.place(makeText(type, options.content), 'text', options);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** Whether a content area is a text of one of the editors loaded here. */
|
|
153
|
+
function isOurs(block) {
|
|
154
|
+
return !!TEXTS[block.attr('data-ge-content-type')];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** Open the editor on a text, once: until it is closed again. */
|
|
158
|
+
function startText(block) {
|
|
159
|
+
if (block.hasClass('ge-rte-active')) { return; }
|
|
160
|
+
|
|
161
|
+
// A content area nobody can see - a tab that is not the open one,
|
|
162
|
+
// a closed accordion item - has no geometry for an editor to lay
|
|
163
|
+
// its toolbar out against, and nothing anyone can type into
|
|
164
|
+
if (!block.is(':visible')) { return; }
|
|
165
|
+
|
|
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')];
|
|
169
|
+
if (!text) { return; }
|
|
170
|
+
|
|
171
|
+
// Not marked active, so the next click tries again: the library
|
|
172
|
+
// may be loaded by then
|
|
173
|
+
if (text.available && !text.available()) {
|
|
174
|
+
if (text.missingKey) { console.error(ge.t(text.missingKey)); }
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
block.data('ge-text-before', attributesOf(block[0])).removeData('ge-text-ready');
|
|
179
|
+
block.addClass('ge-rte-active');
|
|
180
|
+
text.start(block);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function onClick() {
|
|
184
|
+
startText($(this));
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Close the text editor on one content area, and leave the content
|
|
189
|
+
* area's own attributes as the host left them.
|
|
190
|
+
*
|
|
191
|
+
* An editor adds attributes of its own while it is open, and takes
|
|
192
|
+
* them off again, more or less: CKEditor leaves aria-readonly behind.
|
|
193
|
+
* tinyMCE does worse, and puts back every attribute as it was when it
|
|
194
|
+
* opened, so an id, a class or a plugin's attribute given while it was
|
|
195
|
+
* open is lost. So the attributes are read three times - before the
|
|
196
|
+
* editor opens, once it has opened, and before it closes - and what
|
|
197
|
+
* changed between the second and the third, the host's doing, is
|
|
198
|
+
* played back onto the first, the host's markup. What the editor did
|
|
199
|
+
* is left out either way.
|
|
200
|
+
*/
|
|
201
|
+
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;
|
|
205
|
+
|
|
206
|
+
// Every content area is told, as in 5.x: one whose editor never
|
|
207
|
+
// started is the plugin's to ignore
|
|
208
|
+
if (text) { text.stop(block); }
|
|
209
|
+
|
|
210
|
+
// After stop, not before: an editor that restores the class
|
|
211
|
+
// attribute it snapshotted would put ge-rte-active back
|
|
212
|
+
block.removeClass('ge-rte-active');
|
|
213
|
+
|
|
214
|
+
if (before) {
|
|
215
|
+
restoreAttributes(block, before, block.data('ge-text-ready') || before, open);
|
|
216
|
+
block.removeData('ge-text-before').removeData('ge-text-ready');
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
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);
|
|
224
|
+
|
|
225
|
+
ge.createMoveTool(drawer);
|
|
226
|
+
|
|
227
|
+
var details = ge.addSettingsTool(drawer, block, settings.text_classes);
|
|
228
|
+
|
|
229
|
+
// Which editor edits it, first in its settings: something to
|
|
230
|
+
// 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'));
|
|
235
|
+
|
|
236
|
+
settings.text_tools.forEach(function(hostTool) {
|
|
237
|
+
ge.createTool(drawer, hostTool.title || '', hostTool.className || '',
|
|
238
|
+
hostTool.iconClass || 'bi bi-wrench', hostTool.on);
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
ge.createTool(drawer, ge.t('tool.delete_text'), 'ge-delete-text', 'bi bi-trash', function() {
|
|
242
|
+
ge.deleteNode('text', block, ge.t('confirm.delete_text'), function(removed) {
|
|
243
|
+
// Its editor lets go first: removed while open, it would
|
|
244
|
+
// be left behind, attached to nothing
|
|
245
|
+
closeText(block);
|
|
246
|
+
textBlock.slideUp(function() {
|
|
247
|
+
textBlock.remove();
|
|
248
|
+
removed();
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/** A drawer for each text of ours in a text block that has none yet. */
|
|
255
|
+
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
|
+
}
|
|
264
|
+
|
|
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; }
|
|
277
|
+
|
|
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
|
+
}
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
var texts = offeredTexts();
|
|
304
|
+
|
|
305
|
+
return {
|
|
306
|
+
methods: {
|
|
307
|
+
createText: apiCreateText,
|
|
308
|
+
},
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* The types this plugin edits, for the core: every editor loaded
|
|
312
|
+
* is the owner of its texts, and the ones offered are what the
|
|
313
|
+
* host's plain content can be made.
|
|
314
|
+
*/
|
|
315
|
+
textTypes: function() {
|
|
316
|
+
var offered = offeredTexts();
|
|
317
|
+
var others = Object.keys(TEXTS).filter(function(type) { return offered.indexOf(type) === -1; });
|
|
318
|
+
|
|
319
|
+
return offered.concat(others).map(function(type) {
|
|
320
|
+
var text = TEXTS[type];
|
|
321
|
+
|
|
322
|
+
return {
|
|
323
|
+
type: type,
|
|
324
|
+
label: textLabel(type),
|
|
325
|
+
offered: offered.indexOf(type) !== -1,
|
|
326
|
+
available: text.available ? function() { return text.available(); } : null,
|
|
327
|
+
missingKey: text.missingKey,
|
|
328
|
+
edit: function(block) {
|
|
329
|
+
var textBlock = block.parent('.ge-text-block');
|
|
330
|
+
if (textBlock.length && !textBlock.children('.ge-tools-drawer').length) {
|
|
331
|
+
createTextControls(textBlock);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
startText(block);
|
|
335
|
+
},
|
|
336
|
+
};
|
|
337
|
+
});
|
|
338
|
+
},
|
|
339
|
+
|
|
340
|
+
// A text block of each editor offered. Like a container, it goes
|
|
341
|
+
// into a row of its own when clicked, or where it is dropped
|
|
342
|
+
toolbar: texts.map(function(type) {
|
|
343
|
+
return {
|
|
344
|
+
label: function() {
|
|
345
|
+
return texts.length > 1 ? ge.t('text.add_type', { editor: textLabel(type) }) : ge.t('text.add');
|
|
346
|
+
},
|
|
347
|
+
iconClass: TEXTS[type].iconClass,
|
|
348
|
+
className: 'ge-add-text-button',
|
|
349
|
+
kind: 'text',
|
|
350
|
+
inColumn: true,
|
|
351
|
+
create: function() { return makeText(type); },
|
|
352
|
+
};
|
|
353
|
+
}),
|
|
354
|
+
|
|
355
|
+
onInit: function() {
|
|
356
|
+
markTexts();
|
|
357
|
+
addTextTools();
|
|
358
|
+
|
|
359
|
+
ge.canvas.off('click.ge-text').on('click.ge-text', '.ge-content', onClick);
|
|
360
|
+
},
|
|
361
|
+
|
|
362
|
+
// While the drawers and the text blocks are still there, as the
|
|
363
|
+
// editors left them
|
|
364
|
+
onBeforeDeinit: function() {
|
|
365
|
+
ge.canvas.find('.ge-content').each(function() {
|
|
366
|
+
if (isOurs($(this))) { closeText($(this)); }
|
|
367
|
+
});
|
|
368
|
+
},
|
|
369
|
+
|
|
370
|
+
onDeinit: function() {
|
|
371
|
+
ge.canvas.off('click.ge-text');
|
|
372
|
+
},
|
|
373
|
+
|
|
374
|
+
// The first time only: an undo says ready again, and by then the
|
|
375
|
+
// host may have changed the content area itself
|
|
376
|
+
onContentReady: function(area) {
|
|
377
|
+
if (area.data('ge-text-before') && !area.data('ge-text-ready')) {
|
|
378
|
+
area.data('ge-text-ready', attributesOf(area[0]));
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// Whatever the plugins setting says: content_types chooses the editors
|
|
385
|
+
textFeature.always = true;
|
|
386
|
+
|
|
387
|
+
$.fn.gridEditor.features.text = textFeature;
|
|
388
|
+
|
|
389
|
+
})(jQuery);
|
|
390
|
+
|
|
1
391
|
/**
|
|
2
392
|
* tinyMCE for grid-editor's content areas.
|
|
3
393
|
*
|
|
4
394
|
* A text editor plugin: load this file after the editor, and tinyMCE 6
|
|
5
|
-
* after or before it, and
|
|
6
|
-
*
|
|
395
|
+
* after or before it, and a text of the tinymce type is edited with an
|
|
396
|
+
* inline tinyMCE. What it can ask the editor for is the handle its
|
|
7
397
|
* factory is called with, described in docs/plugins.md.
|
|
8
398
|
*
|
|
9
399
|
* <script src="tinymce/tinymce.min.js"></script>
|
|
@@ -11,7 +401,11 @@
|
|
|
11
401
|
* <script src="dist/plugins/grideditor.tinymce.min.js"></script>
|
|
12
402
|
*
|
|
13
403
|
* Up to 5.x the main bundle carried a copy of this file; since 6.0 it is
|
|
14
|
-
* loaded on its own, like every plugin.
|
|
404
|
+
* loaded on its own, like every plugin. The built file starts with what
|
|
405
|
+
* every text editor shares - text blocks, the Text button and the Add text
|
|
406
|
+
* tool, createText, making the host's plain content a text - from
|
|
407
|
+
* src/js/text/grideditor.text.js, installed once however many editors a
|
|
408
|
+
* page loads.
|
|
15
409
|
*/
|
|
16
410
|
(function($) {
|
|
17
411
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(
|
|
1
|
+
(x=>{var t,v;function m(e){var n={};return x.each(x.makeArray(e.attributes),function(e,t){n[t.name]=t.value}),n}function y(e){return(e||"").split(/\s+/).filter(function(e){return""!==e&&!t.test(e)})}function e(o){var r=o.settings,u={},n={};function i(){return r.content_types.filter(function(e){return!!u[e]})}function c(e){var t=u[e];return t&&t.labelKey?o.t(t.labelKey):e}function a(e,t){var n=u[e];return x('<div class="ge-content" />').addClass("ge-content-type-"+e).attr("data-ge-content-type",e).html(void 0!==t?t:n&&n.initialContent||"")}function l(e,t){o.place(a(t),"text",{appendTo:e,source:"tool"})}function t(e){return u[e.attr("data-ge-content-type")]}function d(e){var t;e.hasClass("ge-rte-active")||e.is(":visible")&&(t=u[e.attr("data-ge-content-type")])&&(t.available&&!t.available()?t.missingKey&&console.error(o.t(t.missingKey)):(e.data("ge-text-before",m(e[0])).removeData("ge-text-ready"),e.addClass("ge-rte-active"),t.start(e)))}function e(){d(x(this))}function s(e){var n,t,a,i,o,r,c,l=u[e.attr("data-ge-content-type")],d=e.data("ge-text-before"),s=d?m(e[0]):null;l&&l.stop(e),e.removeClass("ge-rte-active"),d&&(l=d,t=(n=e).data("ge-text-ready")||d,a=s,i=x.extend({},l),x.each(x.extend({},t,a),function(e){"class"===e||v.test(e)||t[e]===a[e]||(void 0===a[e]?delete i[e]:i[e]=a[e])}),o=y(t.class),r=y(a.class),c=y(l.class).filter(function(e){return-1!==r.indexOf(e)||-1===o.indexOf(e)}),r.forEach(function(e){-1===o.indexOf(e)&&-1===c.indexOf(e)&&c.push(e)}),c.length?i.class=c.join(" "):delete i.class,x.each(m(n[0]),function(e){n.removeAttr(e)}),x.each(i,function(e,t){n.attr(e,t)}),e.removeData("ge-text-before").removeData("ge-text-ready"))}function f(t){var n=t.children(".ge-content"),e=n.attr("data-ge-content-type"),a=x('<div class="ge-tools-drawer ge-text-drawer" />').prependTo(t),i=(o.createMoveTool(a),o.addSettingsTool(a,n,r.text_classes));x('<div class="ge-field ge-text-editor" />').append(x('<span class="ge-field-label" />').text(o.t("panel.editor"))).append(x('<span class="ge-field-value" />').text(c(e))).prependTo(i.children(".ge-details-general")),r.text_tools.forEach(function(e){o.createTool(a,e.title||"",e.className||"",e.iconClass||"bi bi-wrench",e.on)}),o.createTool(a,o.t("tool.delete_text"),"ge-delete-text","bi bi-trash",function(){o.deleteNode("text",n,o.t("confirm.delete_text"),function(e){s(n),t.slideUp(function(){t.remove(),e()})})})}x.each(x.fn.gridEditor.texts,function(e,t){u[e]=t(o)}),Array.isArray(r.content_types)||(r.content_types=Object.keys(u)),Array.isArray(r.text_tools)||(r.text_tools=[]),Array.isArray(r.text_classes)||(r.text_classes=[]);var g=i();return{methods:{createText:function(e,t){return e&&"object"==typeof e&&(t=e,e=void 0),t=t||{},(e=e||i()[0])&&u[e]?o.place(a(e,t.content),"text",t):(n["createText:"+e]||(n["createText:"+e]=!0,o.warn('createText: no text editor "'+e+'" is loaded; load its plugin and name it in content_types')),null)}},textTypes:function(){var n=i(),e=Object.keys(u).filter(function(e){return-1===n.indexOf(e)});return n.concat(e).map(function(e){var t=u[e];return{type:e,label:c(e),offered:-1!==n.indexOf(e),available:t.available?function(){return t.available()}:null,missingKey:t.missingKey,edit:function(e){var t=e.parent(".ge-text-block");t.length&&!t.children(".ge-tools-drawer").length&&f(t),d(e)}}})},toolbar:g.map(function(e){return{label:function(){return 1<g.length?o.t("text.add_type",{editor:c(e)}):o.t("text.add")},iconClass:u[e].iconClass,className:"ge-add-text-button",kind:"text",inColumn:!0,create:function(){return a(e)}}}),onInit:function(){var a;o.canvas.find(".ge-text-block").each(function(){var e=x(this);e.children(".ge-tools-drawer").length||t(e.children(".ge-content"))&&f(e)}),(a=i()).length&&o.canvas.find(".column").each(function(){var e,t=x(this),n=t.children(".ge-tools-drawer");n.length&&!n.children(".ge-add-text").length&&(o.createTool(n,o.t("tool.add_text"),"ge-add-text","bi bi-type",function(){o.closePicker()||l(t,a[0])}),e=n.children(".ge-add-text"),(n=n.children(".ge-add-row")).length&&e.insertBefore(n),1<a.length)&&o.attachPicker(e,function(){o.openPicker(e,a.map(function(e){return{label:c(e),title:o.t("tool.add_text_type",{editor:c(e)}),attributes:{"data-ge-content-type":e},choose:function(){l(t,e)}}}),"ge-text-picker")})}),o.canvas.off("click.ge-text").on("click.ge-text",".ge-content",e)},onBeforeDeinit:function(){o.canvas.find(".ge-content").each(function(){t(x(this))&&s(x(this))})},onDeinit:function(){o.canvas.off("click.ge-text")},onContentReady:function(e){e.data("ge-text-before")&&!e.data("ge-text-ready")&&e.data("ge-text-ready",m(e[0]))}}}x.fn.gridEditor.features.text||(x.extend(x.fn.gridEditor.locales.en,{"tool.add_text":"Add text","tool.add_text_type":"Add {editor} text","text.add":"Text","text.add_type":"Text ({editor})","panel.editor":"Editor","panel.kind_text":"Text"}),x.fn.gridEditor.texts=x.fn.gridEditor.texts||{},t=/^(mce-|cke|note-)|^(active|ge-rte-active)$/,v=/^(data-mce-|contenteditable$|spellcheck$)/,e.always=!0,x.fn.gridEditor.features.text=e)})(jQuery),(i=>{function o(e){e.removeClass("active").removeClass("ge-rte-active").removeAttr("id").removeAttr("style").removeAttr("spellcheck").removeAttr("contenteditable").removeAttr("data-mce-style")}i.extend(i.fn.gridEditor.locales.en,{"text.tinymce":"tinyMCE"});var r="<p>Lorem ipsum dolores</p>";i.fn.gridEditor.texts.tinymce=function(a){return{labelKey:"text.tinymce",initialContent:r,missingKey:"error.tinymce_missing",available:function(){return!!window.tinymce},start:function(e){var t=a.settings,n=t.tinymce&&t.tinymce.config?t.tinymce.config:{};e.each(function(){var e,t=i(this);t.hasClass("active")||(t.html()==r&&t.html(""),t.addClass("active"),delete(e=i.extend({promotion:!1},n,{target:this,inline:!0,init_instance_callback:function(e){t.data("ge-tinymce-pending-remove")?(t.removeData("ge-tinymce-pending-remove"),e.remove(),o(t)):(t.data("ge-tinymce",e),a.textReady(t),e.on("Undo Redo",function(){a.textReady(t)}),window.requestAnimationFrame(function(){!e.removed&&e.ui&&e.ui.show&&e.ui.show()}),e.on("focus",function(){window.requestAnimationFrame(function(){!e.removed&&e.ui&&e.ui.show&&e.ui.show()})}),e.focus(),n.init_instance_callback&&n.init_instance_callback.call(this,e),n.oninit&&n.oninit.call(this,e))}})).selector,window.tinymce.init(e))})},stop:function(e){e.filter(".active").each(function(){var e=i(this),t=e.data("ge-tinymce");t?(e.removeData("ge-tinymce"),t.remove()):e.data("ge-tinymce-pending-remove",!0),o(e)})}}}})(jQuery);
|
|
2
2
|
//# sourceMappingURL=grideditor.tinymce.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grideditor.tinymce.min.js","sources":["../../src/js/plugins/grideditor.tinymce.js"],"names":["$","cleanUp","contentArea","removeClass","removeAttr","extend","fn","gridEditor","locales","en","text.tinymce","INITIAL_CONTENT","texts","tinymce","ge","labelKey","initialContent","missingKey","available","window","start","contentAreas","settings","userConfig","config","each","configuration","this","hasClass","html","addClass","promotion","target","inline","init_instance_callback","editor","data","removeData","remove","textReady","on","requestAnimationFrame","removed","ui","show","focus","call","oninit","selector","init","stop","filter","jQuery"],"mappings":"CAeUA,IASN,SAASC,EAAQC,GACbA,EACKC,YAAY,QAAQ,EACpBA,YAAY,eAAe,EAC3BC,WAAW,IAAI,EACfA,WAAW,OAAO,EAClBA,WAAW,YAAY,EACvBA,WAAW,iBAAiB,EAC5BA,WAAW,gBAAgB,CAEpC,CAjBAJ,EAAEK,OAAOL,EAAEM,GAAGC,WAAWC,QAAQC,GAAI,CACjCC,eA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KAAMQ,CAAM,EAGnDZ,EAAWwB,QACXxB,EAAWwB,OAAOD,KAAKnB,KAAMQ,CAAM,EAE3C,CACJ,CAAC,GAGoBa,SAErB7B,OAAON,QAAQoC,KAAKvB,CAAa,EACrC,CAAC,CACL,EAEAwB,KAAM,SAAS7B,GACXA,EAAa8B,OAAO,SAAS,EAAE1B,KAAK,WAChC,IAAIvB,EAAcF,EAAE2B,IAAI,EACpBQ,EAASjC,EAAYkC,KAAK,YAAY,EAEtCD,GACAjC,EAAYmC,WAAW,YAAY,EACnCF,EAAOG,OAAO,GAIdpC,EAAYkC,KAAK,4BAA6B,CAAA,CAAI,EAGtDnC,EAAQC,CAAW,CACvB,CAAC,CACL,CACJ,CACJ,CACH,GAAEkD,MAAM"}
|
|
1
|
+
{"version":3,"file":"grideditor.tinymce.min.js","sources":["../../src/js/text/grideditor.text.js","../../src/js/plugins/grideditor.tinymce.js"],"names":["$","EDITOR_CLASS","EDITOR_ATTRIBUTE","attributesOf","element","found","each","makeArray","attributes","i","attribute","name","value","classesIn","split","filter","test","textFeature","ge","settings","TEXTS","warned","offeredTexts","content_types","type","textLabel","text","labelKey","t","makeText","content","addClass","attr","html","undefined","initialContent","addTextTo","col","place","appendTo","source","isOurs","block","startText","hasClass","is","available","missingKey","console","error","data","removeData","start","onClick","this","closeText","ready","open","result","readyClasses","openClasses","classes","before","stop","removeClass","extend","indexOf","forEach","push","length","join","removeAttr","createTextControls","textBlock","children","drawer","prependTo","details","createMoveTool","addSettingsTool","text_classes","append","text_tools","hostTool","createTool","title","className","iconClass","on","deleteNode","removed","slideUp","remove","fn","gridEditor","texts","factory","Array","isArray","Object","keys","methods","createText","options","warn","textTypes","offered","others","concat","map","label","edit","parent","toolbar","editor","kind","inColumn","create","onInit","canvas","find","tool","closePicker","addRow","insertBefore","attachPicker","openPicker","data-ge-content-type","choose","off","onBeforeDeinit","onDeinit","onContentReady","area","features","locales","en","tool.add_text","tool.add_text_type","text.add","text.add_type","panel.editor","panel.kind_text","always","jQuery","cleanUp","contentArea","text.tinymce","INITIAL_CONTENT","tinymce","window","contentAreas","userConfig","config","configuration","promotion","target","inline","init_instance_callback","textReady","requestAnimationFrame","ui","show","focus","call","oninit","selector","init"],"mappings":"CAmBUA,IAEN,IAeIC,EACAC,EAEJ,SAASC,EAAaC,GAClB,IAAIC,EAAQ,GAIZ,OAHAL,EAAEM,KAAKN,EAAEO,UAAUH,EAAQI,UAAU,EAAG,SAASC,EAAGC,GAChDL,EAAMK,EAAUC,MAAQD,EAAUE,KACtC,CAAC,EACMP,CACX,CAEA,SAASQ,EAAUD,GACf,OAAQA,GAAS,IAAIE,MAAM,KAAK,EAAEC,OAAO,SAASJ,GAC9C,MAAgB,KAATA,GAAe,CAACV,EAAae,KAAKL,CAAI,CACjD,CAAC,CACL,CAiCA,SAASM,EAAYC,GAEjB,IAAIC,EAAWD,EAAGC,SACdC,EAAQ,GACRC,EAAS,GAab,SAASC,IACL,OAAOH,EAASI,cAAcR,OAAO,SAASS,GAAQ,MAAO,CAAC,CAACJ,EAAMI,EAAO,CAAC,CACjF,CAGA,SAASC,EAAUD,GACf,IAAIE,EAAON,EAAMI,GACjB,OAAOE,GAAQA,EAAKC,SAAWT,EAAGU,EAAEF,EAAKC,QAAQ,EAAIH,CACzD,CAGA,SAASK,EAASL,EAAMM,GACpB,IAAIJ,EAAON,EAAMI,GAEjB,OAAOxB,EAAE,4BAA4B,EAChC+B,SAAS,mBAAqBP,CAAI,EAClCQ,KAAK,uBAAwBR,CAAI,EACjCS,KAAiBC,KAAAA,IAAZJ,EAAwBA,EAAWJ,GAAQA,EAAKS,gBAAmB,EAAE,CACnF,CAGA,SAASC,EAAUC,EAAKb,GACbN,EAAGoB,MAAMT,EAASL,CAAI,EAAG,OAAQ,CAAEe,SAAUF,EAAKG,OAAQ,MAAO,CAAC,CAC7E,CA4BA,SAASC,EAAOC,GACZ,OAAStB,EAAMsB,EAAMV,KAAK,sBAAsB,EACpD,CAGA,SAASW,EAAUD,GACf,I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AAOtB,OAAO,EAGdqD,EAAQC,CAAW,IAIvBA,EAAYhG,KAAK,aAAcgE,CAAM,EAMrChG,EAAG6I,UAAUb,CAAW,EAMxBhC,EAAO1B,GAAG,YAAa,WACnBtE,EAAG6I,UAAUb,CAAW,CAC5B,CAAC,EAUDI,OAAOU,sBAAsB,WACrB9C,CAAAA,EAAOxB,SAAYwB,EAAO+C,IAAO/C,EAAO+C,GAAGC,MAE/ChD,EAAO+C,GAAGC,KAAK,CACnB,CAAC,EAODhD,EAAO1B,GAAG,QAAS,WACf8D,OAAOU,sBAAsB,WACrB9C,CAAAA,EAAOxB,SAAYwB,EAAO+C,IAAO/C,EAAO+C,GAAGC,MAE/ChD,EAAO+C,GAAGC,KAAK,CACnB,CAAC,CACL,CAAC,EAGDhD,EAAOiD,MAAM,EAGTX,EAAWM,wBACXN,EAAWM,uBAAuBM,KAAK9G,KAAM4D,CAAM,EAGnDsC,EAAWa,QACXb,EAAWa,OAAOD,KAAK9G,KAAM4D,CAAM,EAE3C,CACJ,CAAC,GAGoBoD,SAErBhB,OAAOD,QAAQkB,KAAKb,CAAa,EACrC,CAAC,CACL,EAEA3F,KAAM,SAASwF,GACXA,EAAaxI,OAAO,SAAS,EAAET,KAAK,WAChC,IAAI4I,EAAclJ,EAAEsD,IAAI,EACpB4D,EAASgC,EAAYhG,KAAK,YAAY,EAEtCgE,GACAgC,EAAY/F,WAAW,YAAY,EACnC+D,EAAOtB,OAAO,GAIdsD,EAAYhG,KAAK,4BAA6B,CAAA,CAAI,EAGtD+F,EAAQC,CAAW,CACvB,CAAC,CACL,CACJ,CACJ,CACH,GAAEF,MAAM"}
|
|
@@ -44,7 +44,7 @@ $.fn.gridEditor.utilities.visibility = function(ge) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
function applies(node, kind) {
|
|
47
|
-
return kind === 'row' || kind === 'column' || kind === 'element' || kind === 'text' ||
|
|
47
|
+
return kind === 'row' || kind === 'column' || kind === 'element' || kind === 'text' || kind === 'plain' ||
|
|
48
48
|
node.is('[data-ge-container]');
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(c=>{c.extend(c.fn.gridEditor.locales.en,{"utility.visibility":"Visibility","utility.visibility_hidden":"Hidden","utility.visibility_shown":"Shown","tool.hide_in_view":"Hide in this view","tool.show_in_view":"Show in this view","badge.hidden_in":"Hidden at {breakpoints}"});var v=/(?:^|\s)d-(?:(?:sm|md|lg|xl|xxl)-)?(?:none|block|flex)(?:\s|$)/,n=".row, .column, .ge-content, .ge-element, [data-ge-container]";c.fn.gridEditor.utilities.visibility=function(o){var e=c.extend({drawer:!0},o.settings.utilities.visibility);function r(i){return"row"===i?"flex":"block"}function s(i,e){return"row"===e||"column"===e||"element"===e||"text"===e||i.is("[data-ge-container]")}function t(i,e){return"none"===o.getUtility(i,"visibility",e)}function a(e){return o.breakpoints.filter(function(i){return t(e,i)})}function d(i){return"all"===o.view()?a(i).length===o.breakpoints.length:t(i,o.view())}function u(i){var e=o.breakpoints.indexOf(o.view());return 0<e&&t(i,o.breakpoints[e-1])}return{families:[{name:"visibility",prefix:"d",values:["none","block","flex"],appliesTo:["row","column","text","element","container"],labelKey:"utility.visibility",choices:function(i,e){return["none",r(e)]},label:function(i){return"none"===i?o.t("utility.visibility_hidden"):o.t("utility.visibility_shown")}}],drawerTools:function(i,n,l){e.drawer&&s(n,l)&&o.createTool(i,o.t("tool.hide_in_view"),"ge-visibility-tool","bi bi-eye",function(){var i,e,t;e=l,t=!d(i=n),t="all"===o.view()?t?"none":null:t?u(i)?null:"none":u(i)?r(e):null,o.setUtility(i,"visibility",t,{source:"tool"})})},onRefresh:function(i){i.find(n).addBack(n).each(function(){var i=c(this),e=s(i,o.kindOf(i))&&v.test(i.attr("class")||""),t=e?a(i):[],n=e&&d(i),l=e&&"all"===o.view()&&0<t.length&&!n;i.toggleClass("ge-visibility",e).toggleClass("ge-hidden-in-view",n),l?i.attr("data-ge-hidden-in",o.t("badge.hidden_in",{breakpoints:t.join(", ")})):i.removeAttr("data-ge-hidden-in"),i.children(".ge-tools-drawer").children(".ge-visibility-tool").each(function(){c(this).attr("title",n?o.t("tool.show_in_view"):o.t("tool.hide_in_view")).find("i").attr("class",n?"bi bi-eye-slash":"bi bi-eye")})})},onDeinit:function(){o.canvas.find(".ge-visibility, .ge-hidden-in-view, [data-ge-hidden-in]").each(function(){var i=c(this).removeClass("ge-visibility ge-hidden-in-view").removeAttr("data-ge-hidden-in");i.attr("class")||i.removeAttr("class")})}}}})(jQuery);
|
|
1
|
+
(c=>{c.extend(c.fn.gridEditor.locales.en,{"utility.visibility":"Visibility","utility.visibility_hidden":"Hidden","utility.visibility_shown":"Shown","tool.hide_in_view":"Hide in this view","tool.show_in_view":"Show in this view","badge.hidden_in":"Hidden at {breakpoints}"});var v=/(?:^|\s)d-(?:(?:sm|md|lg|xl|xxl)-)?(?:none|block|flex)(?:\s|$)/,n=".row, .column, .ge-content, .ge-element, [data-ge-container]";c.fn.gridEditor.utilities.visibility=function(o){var e=c.extend({drawer:!0},o.settings.utilities.visibility);function r(i){return"row"===i?"flex":"block"}function s(i,e){return"row"===e||"column"===e||"element"===e||"text"===e||"plain"===e||i.is("[data-ge-container]")}function t(i,e){return"none"===o.getUtility(i,"visibility",e)}function a(e){return o.breakpoints.filter(function(i){return t(e,i)})}function d(i){return"all"===o.view()?a(i).length===o.breakpoints.length:t(i,o.view())}function u(i){var e=o.breakpoints.indexOf(o.view());return 0<e&&t(i,o.breakpoints[e-1])}return{families:[{name:"visibility",prefix:"d",values:["none","block","flex"],appliesTo:["row","column","text","element","container"],labelKey:"utility.visibility",choices:function(i,e){return["none",r(e)]},label:function(i){return"none"===i?o.t("utility.visibility_hidden"):o.t("utility.visibility_shown")}}],drawerTools:function(i,n,l){e.drawer&&s(n,l)&&o.createTool(i,o.t("tool.hide_in_view"),"ge-visibility-tool","bi bi-eye",function(){var i,e,t;e=l,t=!d(i=n),t="all"===o.view()?t?"none":null:t?u(i)?null:"none":u(i)?r(e):null,o.setUtility(i,"visibility",t,{source:"tool"})})},onRefresh:function(i){i.find(n).addBack(n).each(function(){var i=c(this),e=s(i,o.kindOf(i))&&v.test(i.attr("class")||""),t=e?a(i):[],n=e&&d(i),l=e&&"all"===o.view()&&0<t.length&&!n;i.toggleClass("ge-visibility",e).toggleClass("ge-hidden-in-view",n),l?i.attr("data-ge-hidden-in",o.t("badge.hidden_in",{breakpoints:t.join(", ")})):i.removeAttr("data-ge-hidden-in"),i.children(".ge-tools-drawer").children(".ge-visibility-tool").each(function(){c(this).attr("title",n?o.t("tool.show_in_view"):o.t("tool.hide_in_view")).find("i").attr("class",n?"bi bi-eye-slash":"bi bi-eye")})})},onDeinit:function(){o.canvas.find(".ge-visibility, .ge-hidden-in-view, [data-ge-hidden-in]").each(function(){var i=c(this).removeClass("ge-visibility ge-hidden-in-view").removeAttr("data-ge-hidden-in");i.attr("class")||i.removeAttr("class")})}}}})(jQuery);
|
|
2
2
|
//# sourceMappingURL=grideditor.visibility.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grideditor.visibility.min.js","sources":["../../src/js/plugins/grideditor.visibility.js"],"names":["$","extend","fn","gridEditor","locales","en","utility.visibility","utility.visibility_hidden","utility.visibility_shown","tool.hide_in_view","tool.show_in_view","badge.hidden_in","CLASS_PATTERN","NODES","utilities","visibility","ge","options","drawer","settings","shown","kind","applies","node","is","hiddenAt","view","getUtility","hiddenTiers","breakpoints","filter","key","hiddenHere","length","hiddenBelow","index","indexOf","families","name","prefix","values","appliesTo","labelKey","choices","label","value","t","drawerTools","createTool","hide","setUtility","source","onRefresh","scope","find","addBack","each","this","carries","kindOf","test","attr","tiers","here","partly","toggleClass","join","removeAttr","children","onDeinit","canvas","removeClass","jQuery"],"mappings":"CAoBUA,IAEVA,EAAEC,OAAOD,EAAEE,GAAGC,WAAWC,QAAQC,GAAI,CACjCC,qBAAsB,aACtBC,4BAA6B,SAC7BC,2BAA4B,QAC5BC,oBAAqB,oBACrBC,oBAAqB,oBACrBC,kBAAmB,yBACvB,CAAC,EAGD,IAAIC,EAAgB,iEAEhBC,EAAQ,+DAEZb,EAAEE,GAAGC,WAAWW,UAAUC,WAAa,SAASC,GAE5C,IAAIC,EAAUjB,EAAEC,OAAO,CAAEiB,OAAQ,CAAA,CAAK,EAAGF,EAAGG,SAASL,UAAUC,UAAU,EAGzE,SAASK,EAAMC,GACX,MAAgB,QAATA,EAAiB,OAAS,OACrC,CAEA,SAASC,EAAQC,EAAMF,GACnB,MAAgB,QAATA,GAA2B,WAATA,GAA8B,YAATA,GAA+B,SAATA,
|
|
1
|
+
{"version":3,"file":"grideditor.visibility.min.js","sources":["../../src/js/plugins/grideditor.visibility.js"],"names":["$","extend","fn","gridEditor","locales","en","utility.visibility","utility.visibility_hidden","utility.visibility_shown","tool.hide_in_view","tool.show_in_view","badge.hidden_in","CLASS_PATTERN","NODES","utilities","visibility","ge","options","drawer","settings","shown","kind","applies","node","is","hiddenAt","view","getUtility","hiddenTiers","breakpoints","filter","key","hiddenHere","length","hiddenBelow","index","indexOf","families","name","prefix","values","appliesTo","labelKey","choices","label","value","t","drawerTools","createTool","hide","setUtility","source","onRefresh","scope","find","addBack","each","this","carries","kindOf","test","attr","tiers","here","partly","toggleClass","join","removeAttr","children","onDeinit","canvas","removeClass","jQuery"],"mappings":"CAoBUA,IAEVA,EAAEC,OAAOD,EAAEE,GAAGC,WAAWC,QAAQC,GAAI,CACjCC,qBAAsB,aACtBC,4BAA6B,SAC7BC,2BAA4B,QAC5BC,oBAAqB,oBACrBC,oBAAqB,oBACrBC,kBAAmB,yBACvB,CAAC,EAGD,IAAIC,EAAgB,iEAEhBC,EAAQ,+DAEZb,EAAEE,GAAGC,WAAWW,UAAUC,WAAa,SAASC,GAE5C,IAAIC,EAAUjB,EAAEC,OAAO,CAAEiB,OAAQ,CAAA,CAAK,EAAGF,EAAGG,SAASL,UAAUC,UAAU,EAGzE,SAASK,EAAMC,GACX,MA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AAOvB,EAAEyD,IAAI,EACZc,YAAY,iCAAiC,EAC7CJ,WAAW,mBAAmB,EAG9B5C,EAAKsC,KAAK,OAAO,GAAKtC,EAAK4C,WAAW,OAAO,CACtD,CAAC,CACL,CA8BA,CACJ,CAEC,GAAEK,MAAM"}
|
package/docs/events.md
CHANGED
|
@@ -49,6 +49,8 @@ about every insertion can bind `grideditor:before-add` and switch on
|
|
|
49
49
|
| `grideditor:after-add-element` | `grideditor:after-add` | no | |
|
|
50
50
|
| `grideditor:before-add-text` | `grideditor:before-add` | yes | before a text block is inserted, from the add text tool, the toolbar or `createText` |
|
|
51
51
|
| `grideditor:after-add-text` | `grideditor:after-add` | no | |
|
|
52
|
+
| `grideditor:before-convert` | — | yes | before the host's plain content is made a text, on a click, with the type chosen |
|
|
53
|
+
| `grideditor:after-convert` | — | no | once the type is on it, before its editor has finished opening |
|
|
52
54
|
| `grideditor:before-delete` | — | yes | before any node is removed, whatever its kind |
|
|
53
55
|
| `grideditor:after-delete` | — | no | after removal completes, animation included |
|
|
54
56
|
| `grideditor:before-move` | — | yes | on drag start (see *Canceling*) |
|
|
@@ -74,7 +76,7 @@ The payload
|
|
|
74
76
|
|
|
75
77
|
```javascript
|
|
76
78
|
{
|
|
77
|
-
kind: 'row', // row | column |
|
|
79
|
+
kind: 'row', // row | column | text | plain | element
|
|
78
80
|
// tabs | accordion | popup | tab | accordion-item
|
|
79
81
|
// section, with the sections plugin
|
|
80
82
|
node: jQuery, // the node added, deleted, moved or resized
|
|
@@ -98,6 +100,10 @@ The payload
|
|
|
98
100
|
// a pane inside a container
|
|
99
101
|
container: jQuery,
|
|
100
102
|
|
|
103
|
+
// convert only
|
|
104
|
+
from: 'plain',
|
|
105
|
+
to: 'tinymce', // the text type it is made
|
|
106
|
+
|
|
101
107
|
// popup-orphan only
|
|
102
108
|
missing: 'ge-popup-3-a91', // the id the trigger pointed at
|
|
103
109
|
|
|
@@ -131,7 +137,10 @@ like any other, so canceling its `before-add-*` turns it away.
|
|
|
131
137
|
|
|
132
138
|
A text block is `kind: 'text'`, with its content area as the node, when it is
|
|
133
139
|
added, deleted or moved, and in `drawerTools`. Up to 5.x a content area
|
|
134
|
-
dragged between columns was `kind: 'content'`. The
|
|
140
|
+
dragged between columns was `kind: 'content'`. The host's plain content - a
|
|
141
|
+
content area with no text type on it - is `kind: 'plain'` when it is deleted,
|
|
142
|
+
moved or converted; the convert pair's `source` is `tool`, and canceling
|
|
143
|
+
`before-convert` leaves it plain, with no editor opened. The kinds for containers are
|
|
135
144
|
the container's own type, so a listener can tell a tabs container from an
|
|
136
145
|
accordion without reading the markup.
|
|
137
146
|
|
package/docs/locale-keys.md
CHANGED
|
@@ -127,9 +127,15 @@ The sections plugin: Bootstrap's `.container` and its kin, on the canvas.
|
|
|
127
127
|
text.*
|
|
128
128
|
------
|
|
129
129
|
|
|
130
|
-
Text blocks: a content area, the text editor that edits it, and its drawer
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
Text blocks: a content area, the text editor that edits it, and its drawer;
|
|
131
|
+
and the host's plain content, which a click makes a text. `{editor}` is an
|
|
132
|
+
editor's label, one of the `text.<type>` keys below or, for a plugin with no
|
|
133
|
+
label, its type.
|
|
134
|
+
|
|
135
|
+
The keys a text needs once an editor is loaded - `text.add`, `text.add_type`,
|
|
136
|
+
`tool.add_text`, `tool.add_text_type`, `panel.editor` and `panel.kind_text` -
|
|
137
|
+
are the text editor plugins' since 6.0, and come with any of them. The rest
|
|
138
|
+
are the main bundle's: what the editor shows with no text editor loaded.
|
|
133
139
|
|
|
134
140
|
| Key | English | Where |
|
|
135
141
|
| --- | --- | --- |
|
|
@@ -142,6 +148,8 @@ plugin with no label, its type.
|
|
|
142
148
|
| `tool.add_text` | Add text | Column drawer, adds a text block of the first editor offered |
|
|
143
149
|
| `tool.add_text_type` | Add {editor} text | Title of each choice the add text tool offers, held, when several editors are |
|
|
144
150
|
| `tool.delete_text` | Remove text | Text drawer |
|
|
151
|
+
| `tool.delete_plain` | Remove content | Plain content's drawer |
|
|
152
|
+
| `tool.convert_type` | Edit as {editor} text | Title of each choice a click on plain content offers, when several editors are |
|
|
145
153
|
|
|
146
154
|
|
|
147
155
|
clipboard.*
|
|
@@ -175,6 +183,7 @@ browser's own confirm instead.
|
|
|
175
183
|
| `confirm.delete_row` | Delete row? | Before a row is removed |
|
|
176
184
|
| `confirm.delete_column` | Delete column? | Before a column is removed |
|
|
177
185
|
| `confirm.delete_text` | Delete this text? | Before a text block is removed |
|
|
186
|
+
| `confirm.delete_plain` | Delete this content? | Before the host's plain content is removed |
|
|
178
187
|
| `confirm.delete_element` | Delete element? | Before an element is removed |
|
|
179
188
|
| `confirm.delete_container` | Delete this container and everything in it? | Before a container is removed |
|
|
180
189
|
| `confirm.delete_tab` | Delete this tab and everything in it? | Before a tab and its pane are removed |
|