@themarioga/grid-editor 7.3.0 → 8.0.0-beta.3

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 (103) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/README.md +34 -30
  3. package/UPGRADING.md +55 -0
  4. package/dist/grideditor.bundle.min.js +3 -3
  5. package/dist/grideditor.css +72 -6
  6. package/dist/grideditor.d.ts +24 -3
  7. package/dist/grideditor.esm.js +7 -58
  8. package/dist/grideditor.jquery.js +0 -13
  9. package/dist/grideditor.jquery.min.js +1 -1
  10. package/dist/grideditor.jquery.min.js.map +3 -3
  11. package/dist/grideditor.js +7 -58
  12. package/dist/grideditor.min.css +1 -1
  13. package/dist/grideditor.min.css.map +1 -1
  14. package/dist/grideditor.min.js +2 -2
  15. package/dist/grideditor.min.js.map +3 -3
  16. package/dist/locales/grideditor.es.esm.js +30 -6
  17. package/dist/locales/grideditor.es.js +30 -6
  18. package/dist/locales/grideditor.es.min.js +1 -1
  19. package/dist/locales/grideditor.es.min.js.map +2 -2
  20. package/dist/plugins/grideditor.accordion.min.js.map +2 -2
  21. package/dist/plugins/grideditor.alignment.esm.js +11 -38
  22. package/dist/plugins/grideditor.alignment.js +11 -38
  23. package/dist/plugins/grideditor.alignment.min.js +1 -1
  24. package/dist/plugins/grideditor.alignment.min.js.map +3 -3
  25. package/dist/plugins/grideditor.card.min.js.map +1 -1
  26. package/dist/plugins/grideditor.ckeditor.esm.js +0 -5
  27. package/dist/plugins/grideditor.ckeditor.js +0 -5
  28. package/dist/plugins/grideditor.ckeditor.min.js +1 -1
  29. package/dist/plugins/grideditor.ckeditor.min.js.map +3 -3
  30. package/dist/plugins/grideditor.clipboard.min.js.map +1 -1
  31. package/dist/plugins/grideditor.codemirror-inline.min.js.map +1 -1
  32. package/dist/plugins/grideditor.codemirror.min.js.map +1 -1
  33. package/dist/plugins/grideditor.elements.min.js.map +2 -2
  34. package/dist/plugins/grideditor.gutters.min.js.map +1 -1
  35. package/dist/plugins/grideditor.order.min.js.map +1 -1
  36. package/dist/plugins/grideditor.popup.min.js.map +1 -1
  37. package/dist/plugins/grideditor.sections.min.js.map +2 -2
  38. package/dist/plugins/grideditor.style.esm.js +393 -60
  39. package/dist/plugins/grideditor.style.js +387 -56
  40. package/dist/plugins/grideditor.style.min.js +4 -2
  41. package/dist/plugins/grideditor.style.min.js.map +4 -4
  42. package/dist/plugins/grideditor.summernote.min.js.map +2 -2
  43. package/dist/plugins/grideditor.tabs.esm.js +274 -6
  44. package/dist/plugins/grideditor.tabs.js +274 -6
  45. package/dist/plugins/grideditor.tabs.min.js +1 -1
  46. package/dist/plugins/grideditor.tabs.min.js.map +3 -3
  47. package/dist/plugins/grideditor.tinymce.esm.js +1 -8
  48. package/dist/plugins/grideditor.tinymce.js +1 -8
  49. package/dist/plugins/grideditor.tinymce.min.js +1 -1
  50. package/dist/plugins/grideditor.tinymce.min.js.map +3 -3
  51. package/docs/events.md +4 -6
  52. package/docs/locale-keys.md +35 -13
  53. package/docs/plugins.md +15 -35
  54. package/example/ckeditor.html +0 -5
  55. package/example/containers.html +64 -2
  56. package/example/index.html +5 -4
  57. package/example/style.html +16 -4
  58. package/example/utilities.html +12 -11
  59. package/package.json +1 -1
  60. package/src/js/dom.js +1 -2
  61. package/src/js/grideditor.jquery.js +7 -28
  62. package/src/js/grideditor.js +12 -81
  63. package/src/js/locales/grideditor.es.js +30 -6
  64. package/src/js/plugins/grideditor.alignment.js +21 -50
  65. package/src/js/plugins/grideditor.ckeditor.js +10 -23
  66. package/src/js/plugins/grideditor.style.js +18 -12
  67. package/src/js/plugins/grideditor.summernote.js +4 -5
  68. package/src/js/plugins/grideditor.tabs.js +311 -5
  69. package/src/js/plugins/grideditor.tinymce.js +4 -17
  70. package/src/js/style/accordion.js +14 -3
  71. package/src/js/style/display.js +229 -0
  72. package/src/js/style/drawerflow.js +118 -0
  73. package/src/js/style/flex.js +156 -0
  74. package/src/js/style/float.js +2 -4
  75. package/src/js/style/options.js +5 -20
  76. package/src/js/style/sections.js +42 -15
  77. package/src/js/style/spacing.js +2 -4
  78. package/src/js/style/sticky.js +39 -0
  79. package/src/js/style/textalign.js +2 -4
  80. package/src/js/text/grideditor.text.js +1 -1
  81. package/src/less/grideditor.less +68 -10
  82. package/types/grideditor.d.ts +24 -3
  83. package/dist/plugins/grideditor.float.esm.js +0 -43
  84. package/dist/plugins/grideditor.float.js +0 -47
  85. package/dist/plugins/grideditor.float.min.js +0 -1
  86. package/dist/plugins/grideditor.float.min.js.map +0 -7
  87. package/dist/plugins/grideditor.spacing.esm.js +0 -327
  88. package/dist/plugins/grideditor.spacing.js +0 -329
  89. package/dist/plugins/grideditor.spacing.min.js +0 -1
  90. package/dist/plugins/grideditor.spacing.min.js.map +0 -7
  91. package/dist/plugins/grideditor.textalign.esm.js +0 -49
  92. package/dist/plugins/grideditor.textalign.js +0 -53
  93. package/dist/plugins/grideditor.textalign.min.js +0 -1
  94. package/dist/plugins/grideditor.textalign.min.js.map +0 -7
  95. package/dist/plugins/grideditor.visibility.esm.js +0 -167
  96. package/dist/plugins/grideditor.visibility.js +0 -169
  97. package/dist/plugins/grideditor.visibility.min.js +0 -1
  98. package/dist/plugins/grideditor.visibility.min.js.map +0 -7
  99. package/src/js/plugins/grideditor.float.js +0 -29
  100. package/src/js/plugins/grideditor.spacing.js +0 -31
  101. package/src/js/plugins/grideditor.textalign.js +0 -27
  102. package/src/js/plugins/grideditor.visibility.js +0 -32
  103. package/src/js/style/visibility.js +0 -160
@@ -422,8 +422,7 @@
422
422
 
423
423
  // src/js/plugins/grideditor.tinymce.js
424
424
  Object.assign(GridEditor.locales.en, {
425
- "text.tinymce": "tinyMCE",
426
- "warning.oninit_removed": "tinyMCE's oninit option was removed in 7.0 and is ignored: use init_instance_callback."
425
+ "text.tinymce": "tinyMCE"
427
426
  });
428
427
  function cleanUp(contentArea) {
429
428
  removeClass(contentArea, "active ge-rte-active");
@@ -434,7 +433,6 @@
434
433
  var INITIAL_CONTENT = "<p>Lorem ipsum dolores</p>";
435
434
  var editors = /* @__PURE__ */ new WeakMap();
436
435
  var pendingRemove = /* @__PURE__ */ new WeakSet();
437
- var warnedOninit = false;
438
436
  GridEditor.texts.tinymce = function(ge) {
439
437
  return {
440
438
  labelKey: "text.tinymce",
@@ -446,10 +444,6 @@
446
444
  start: function(contentAreas) {
447
445
  var settings = ge.settings;
448
446
  var userConfig = settings.tinymce && settings.tinymce.config ? settings.tinymce.config : {};
449
- if (userConfig.oninit && !warnedOninit) {
450
- warnedOninit = true;
451
- ge.warn(ge.t("warning.oninit_removed"));
452
- }
453
447
  contentAreas.forEach(function(contentArea) {
454
448
  if (hasClass(contentArea, "active")) {
455
449
  return;
@@ -500,7 +494,6 @@
500
494
  }
501
495
  });
502
496
  delete configuration.selector;
503
- delete configuration.oninit;
504
497
  window.tinymce.init(configuration);
505
498
  });
506
499
  },
@@ -1 +1 @@
1
- (()=>{var p=window.GridEditor;if(!p||typeof p.get!="function")throw new Error("grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, its locales and grideditor.jquery.js");function k(e,r){return e?Array.prototype.slice.call(e.querySelectorAll(r)):[]}function Q(e,r){return e?Array.prototype.filter.call(e.children,function(o){return!r||o.matches(r)}):[]}function w(e,r){return Q(e,r)[0]||null}function V(e,r,o){var u=e&&e.nodeType===1?e.closest(r):null;return u&&o&&u!==o&&!o.contains(u)?null:u}function b(e,r,o){var u=document.createElement(e);return Object.keys(r||{}).forEach(function(n){var s=r[n];s!=null&&s!==!1&&u.setAttribute(n,s)}),o!=null&&(u.textContent=o),u}function q(e,r){return e.innerHTML=r==null?"":String(r),e}function j(e,r){return S(r).forEach(function(o){e.classList.add(o)}),e}function A(e,r){return S(r).forEach(function(o){e.classList.remove(o)}),e}function E(e,r){return!!e&&e.nodeType===1&&e.classList.contains(r)}function S(e){return String(e||"").split(/\s+/).filter(Boolean)}function Z(e){return e.style.display="none",e}function N(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function B(e,r,o,u,n){var s=function(i){var f=V(i.target,o,e);if(f&&e.contains(f))return u.call(f,i)};return S(r).forEach(function(i){e.addEventListener(i,s,n)}),s}var R=400;function tt(e,r,o,u){o=o===void 0?R:o;var n=function(){Z(e),u&&u()};if(!N(e)||!e.animate||o<=0){window.setTimeout(n,0);return}var s=e.animate(r(getComputedStyle(e)),{duration:o,easing:"ease-in-out"}),i=!1,f=function(){i||(i=!0,n())};s.onfinish=f,s.oncancel=f}function G(e,r,o){typeof r=="function"&&(o=r,r=void 0),e.style.overflow="hidden",tt(e,function(u){return[{height:u.height,paddingTop:u.paddingTop,paddingBottom:u.paddingBottom,marginTop:u.marginTop,marginBottom:u.marginBottom},{height:"0px",paddingTop:"0px",paddingBottom:"0px",marginTop:"0px",marginBottom:"0px"}]},r,function(){e.style.removeProperty("overflow"),o&&o()})}if(!p.features.text){let e=function(n){var s={};return Array.prototype.slice.call(n.attributes).forEach(function(i){s[i.name]=i.value}),s},r=function(n){return(n||"").split(/\s+/).filter(function(s){return s!==""&&!$.test(s)})},o=function(n,s,i,f){var m=Object.assign({},s);Object.keys(Object.assign({},i,f)).forEach(function(l){l==="class"||D.test(l)||i[l]===f[l]||(f[l]===void 0?delete m[l]:m[l]=f[l])});var v=r(i.class),T=r(f.class),x=r(s.class).filter(function(l){return T.indexOf(l)!==-1||v.indexOf(l)===-1});T.forEach(function(l){v.indexOf(l)===-1&&x.indexOf(l)===-1&&x.push(l)}),x.length?m.class=x.join(" "):delete m.class,Object.keys(e(n)).forEach(function(l){n.removeAttribute(l)}),Object.keys(m).forEach(function(l){n.setAttribute(l,m[l])})},u=function(n){var s=n.settings,i={},f={};Object.keys(p.texts).forEach(function(t){i[t]=p.texts[t](n)}),Array.isArray(s.content_types)||(s.content_types=Object.keys(i)),Array.isArray(s.text_tools)||(s.text_tools=[]),Array.isArray(s.text_classes)||(s.text_classes=[]);function m(){return s.content_types.filter(function(t){return!!i[t]})}function v(t){var a=i[t];return a&&a.labelKey?n.t(a.labelKey):t}function T(t,a){var c=i[t],d=b("div",{class:"ge-content ge-content-type-"+t,"data-ge-content-type":t});return a&&a.nodeType?d.appendChild(a):q(d,a!==void 0?a:c&&c.initialContent||""),d}function x(t,a){return t&&typeof t=="object"&&(a=t,t=void 0),a=a||{},t=t||m()[0],!t||!i[t]?(f["createText:"+t]||(f["createText:"+t]=!0,n.warn('createText: no text editor "'+t+'" is loaded; load its plugin and name it in content_types')),null):n.place(T(t,a.content),"text",a)}function l(t){return!!i[t.getAttribute("data-ge-content-type")]}function K(t){if(!E(t,"ge-rte-active")&&N(t)){var a=i[t.getAttribute("data-ge-content-type")];if(a){if(a.available&&!a.available()){a.missingKey&&console.error(n.t(a.missingKey));return}O.set(t,e(t)),C.delete(t),j(t,"ge-rte-active"),a.start([t])}}}function Y(){K(this)}function F(t){var a=i[t.getAttribute("data-ge-content-type")],c=O.get(t),d=c?e(t):null;a&&a.stop([t]),A(t,"ge-rte-active"),c&&(o(t,c,C.get(t)||c,d),O.delete(t),C.delete(t))}function U(t){var a=w(t,".ge-content"),c=a.getAttribute("data-ge-content-type"),d=b("div",{class:"ge-tools-drawer ge-text-drawer"});t.insertBefore(d,t.firstChild),n.createMoveTool(d);var _=n.addSettingsTool(d,a,s.text_classes),h=w(_,".ge-details-general"),L=b("div",{class:"ge-field ge-text-editor"});L.appendChild(b("span",{class:"ge-field-label"},n.t("panel.editor"))),L.appendChild(b("span",{class:"ge-field-value"},v(c))),h.insertBefore(L,h.firstChild),s.text_tools.forEach(function(y){n.createTool(d,y.title||"",y.className||"",y.iconClass||"bi bi-wrench",y.on)}),n.createTool(d,n.t("tool.delete_text"),"ge-delete-text","bi bi-trash",function(){n.deleteNode("text",a,n.t("confirm.delete_text"),function(y){F(a),G(t,function(){t.remove(),y()})})})}function J(){k(n.canvas,".ge-text-block").forEach(function(t){if(!w(t,".ge-tools-drawer")){var a=w(t,".ge-content");!a||!l(a)||U(t)}})}var W=m(),g=null;return{methods:{createText:x},textTypes:function(){var t=m(),a=Object.keys(i).filter(function(c){return t.indexOf(c)===-1});return t.concat(a).map(function(c){var d=i[c];return{type:c,label:v(c),offered:t.indexOf(c)!==-1,available:d.available?function(){return d.available()}:null,missingKey:d.missingKey,edit:function(_){var h=_.parentElement;E(h,"ge-text-block")&&!w(h,".ge-tools-drawer")&&U(h),K(_)}}})},toolbar:W.map(function(t){return{label:function(){return W.length>1?n.t("text.add_type",{editor:v(t)}):n.t("text.add")},iconClass:i[t].iconClass,className:"ge-add-text-button",kind:"text",inColumn:!0,create:function(){return T(t)}}}),onInit:function(){J(),g&&n.canvas.removeEventListener("click",g),g=B(n.canvas,"click",".ge-content",Y)},onBeforeDeinit:function(){k(n.canvas,".ge-content").forEach(function(t){l(t)&&F(t)})},onDeinit:function(){g&&n.canvas.removeEventListener("click",g),g=null},onContentReady:function(t){O.has(t)&&!C.has(t)&&C.set(t,e(t))}}};Object.assign(p.locales.en,{"text.add":"Text","text.add_type":"Text ({editor})","panel.editor":"Editor","panel.kind_text":"Text"}),O=new WeakMap,C=new WeakMap,$=/^(mce-|cke|ck-|note-)|^(ck|active|ge-rte-active)$/,D=/^(data-mce-|contenteditable$|spellcheck$)/,u.always=!0,p.features.text=u}var O,C,$,D;Object.assign(p.locales.en,{"text.tinymce":"tinyMCE","warning.oninit_removed":"tinyMCE's oninit option was removed in 7.0 and is ignored: use init_instance_callback."});function I(e){A(e,"active ge-rte-active"),["id","style","spellcheck","contenteditable","data-mce-style"].forEach(function(r){e.removeAttribute(r)})}var X="<p>Lorem ipsum dolores</p>",M=new WeakMap,H=new WeakSet,z=!1;p.texts.tinymce=function(e){return{labelKey:"text.tinymce",initialContent:X,missingKey:"error.tinymce_missing",available:function(){return!!window.tinymce},start:function(r){var o=e.settings,u=o.tinymce&&o.tinymce.config?o.tinymce.config:{};u.oninit&&!z&&(z=!0,e.warn(e.t("warning.oninit_removed"))),r.forEach(function(n){if(!E(n,"active")){n.innerHTML==X&&(n.innerHTML=""),j(n,"active");var s=Object.assign({promotion:!1},u,{target:n,inline:!0,init_instance_callback:function(i){if(H.has(n)){H.delete(n),i.remove(),I(n);return}M.set(n,i),e.textReady(n),i.on("Undo Redo",function(){e.textReady(n)}),window.requestAnimationFrame(function(){i.removed||!i.ui||!i.ui.show||i.ui.show()}),i.on("focus",function(){window.requestAnimationFrame(function(){i.removed||!i.ui||!i.ui.show||i.ui.show()})}),i.focus(),u.init_instance_callback&&u.init_instance_callback.call(this,i)}});delete s.selector,delete s.oninit,window.tinymce.init(s)}})},stop:function(r){r.filter(function(o){return E(o,"active")}).forEach(function(o){var u=M.get(o);u?(M.delete(o),u.remove()):H.add(o),I(o)})}}};})();
1
+ (()=>{var p=window.GridEditor;if(!p||typeof p.get!="function")throw new Error("grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, its locales and grideditor.jquery.js");function k(e,r){return e?Array.prototype.slice.call(e.querySelectorAll(r)):[]}function J(e,r){return e?Array.prototype.filter.call(e.children,function(o){return!r||o.matches(r)}):[]}function b(e,r){return J(e,r)[0]||null}function Q(e,r,o){var u=e&&e.nodeType===1?e.closest(r):null;return u&&o&&u!==o&&!o.contains(u)?null:u}function w(e,r,o){var u=document.createElement(e);return Object.keys(r||{}).forEach(function(n){var s=r[n];s!=null&&s!==!1&&u.setAttribute(n,s)}),o!=null&&(u.textContent=o),u}function q(e,r){return e.innerHTML=r==null?"":String(r),e}function _(e,r){return S(r).forEach(function(o){e.classList.add(o)}),e}function A(e,r){return S(r).forEach(function(o){e.classList.remove(o)}),e}function E(e,r){return!!e&&e.nodeType===1&&e.classList.contains(r)}function S(e){return String(e||"").split(/\s+/).filter(Boolean)}function V(e){return e.style.display="none",e}function N(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function B(e,r,o,u,n){var s=function(i){var f=Q(i.target,o,e);if(f&&e.contains(f))return u.call(f,i)};return S(r).forEach(function(i){e.addEventListener(i,s,n)}),s}var Z=400;function R(e,r,o,u){o=o===void 0?Z:o;var n=function(){V(e),u&&u()};if(!N(e)||!e.animate||o<=0){window.setTimeout(n,0);return}var s=e.animate(r(getComputedStyle(e)),{duration:o,easing:"ease-in-out"}),i=!1,f=function(){i||(i=!0,n())};s.onfinish=f,s.oncancel=f}function G(e,r,o){typeof r=="function"&&(o=r,r=void 0),e.style.overflow="hidden",R(e,function(u){return[{height:u.height,paddingTop:u.paddingTop,paddingBottom:u.paddingBottom,marginTop:u.marginTop,marginBottom:u.marginBottom},{height:"0px",paddingTop:"0px",paddingBottom:"0px",marginTop:"0px",marginBottom:"0px"}]},r,function(){e.style.removeProperty("overflow"),o&&o()})}if(!p.features.text){let e=function(n){var s={};return Array.prototype.slice.call(n.attributes).forEach(function(i){s[i.name]=i.value}),s},r=function(n){return(n||"").split(/\s+/).filter(function(s){return s!==""&&!$.test(s)})},o=function(n,s,i,f){var m=Object.assign({},s);Object.keys(Object.assign({},i,f)).forEach(function(l){l==="class"||D.test(l)||i[l]===f[l]||(f[l]===void 0?delete m[l]:m[l]=f[l])});var v=r(i.class),T=r(f.class),x=r(s.class).filter(function(l){return T.indexOf(l)!==-1||v.indexOf(l)===-1});T.forEach(function(l){v.indexOf(l)===-1&&x.indexOf(l)===-1&&x.push(l)}),x.length?m.class=x.join(" "):delete m.class,Object.keys(e(n)).forEach(function(l){n.removeAttribute(l)}),Object.keys(m).forEach(function(l){n.setAttribute(l,m[l])})},u=function(n){var s=n.settings,i={},f={};Object.keys(p.texts).forEach(function(t){i[t]=p.texts[t](n)}),Array.isArray(s.content_types)||(s.content_types=Object.keys(i)),Array.isArray(s.text_tools)||(s.text_tools=[]),Array.isArray(s.text_classes)||(s.text_classes=[]);function m(){return s.content_types.filter(function(t){return!!i[t]})}function v(t){var a=i[t];return a&&a.labelKey?n.t(a.labelKey):t}function T(t,a){var c=i[t],d=w("div",{class:"ge-content ge-content-type-"+t,"data-ge-content-type":t});return a&&a.nodeType?d.appendChild(a):q(d,a!==void 0?a:c&&c.initialContent||""),d}function x(t,a){return t&&typeof t=="object"&&(a=t,t=void 0),a=a||{},t=t||m()[0],!t||!i[t]?(f["createText:"+t]||(f["createText:"+t]=!0,n.warn('createText: no text editor "'+t+'" is loaded; load its plugin and name it in content_types')),null):n.place(T(t,a.content),"text",a)}function l(t){return!!i[t.getAttribute("data-ge-content-type")]}function K(t){if(!E(t,"ge-rte-active")&&N(t)){var a=i[t.getAttribute("data-ge-content-type")];if(a){if(a.available&&!a.available()){a.missingKey&&console.error(n.t(a.missingKey));return}O.set(t,e(t)),C.delete(t),_(t,"ge-rte-active"),a.start([t])}}}function z(){K(this)}function F(t){var a=i[t.getAttribute("data-ge-content-type")],c=O.get(t),d=c?e(t):null;a&&a.stop([t]),A(t,"ge-rte-active"),c&&(o(t,c,C.get(t)||c,d),O.delete(t),C.delete(t))}function U(t){var a=b(t,".ge-content"),c=a.getAttribute("data-ge-content-type"),d=w("div",{class:"ge-tools-drawer ge-text-drawer"});t.insertBefore(d,t.firstChild),n.createMoveTool(d);var j=n.addSettingsTool(d,a,s.text_classes),h=b(j,".ge-details-general"),L=w("div",{class:"ge-field ge-text-editor"});L.appendChild(w("span",{class:"ge-field-label"},n.t("panel.editor"))),L.appendChild(w("span",{class:"ge-field-value"},v(c))),h.insertBefore(L,h.firstChild),s.text_tools.forEach(function(y){n.createTool(d,y.title||"",y.className||"",y.iconClass||"bi bi-wrench",y.on)}),n.createTool(d,n.t("tool.delete_text"),"ge-delete-text","bi bi-trash",function(){n.deleteNode("text",a,n.t("confirm.delete_text"),function(y){F(a),G(t,function(){t.remove(),y()})})})}function Y(){k(n.canvas,".ge-text-block").forEach(function(t){if(!b(t,".ge-tools-drawer")){var a=b(t,".ge-content");!a||!l(a)||U(t)}})}var W=m(),g=null;return{methods:{createText:x},textTypes:function(){var t=m(),a=Object.keys(i).filter(function(c){return t.indexOf(c)===-1});return t.concat(a).map(function(c){var d=i[c];return{type:c,label:v(c),offered:t.indexOf(c)!==-1,available:d.available?function(){return d.available()}:null,missingKey:d.missingKey,edit:function(j){var h=j.parentElement;E(h,"ge-text-block")&&!b(h,".ge-tools-drawer")&&U(h),K(j)}}})},toolbar:W.map(function(t){return{label:function(){return W.length>1?n.t("text.add_type",{editor:v(t)}):n.t("text.add")},iconClass:i[t].iconClass,className:"ge-add-text-button",kind:"text",inColumn:!0,create:function(){return T(t)}}}),onInit:function(){Y(),g&&n.canvas.removeEventListener("click",g),g=B(n.canvas,"click",".ge-content",z)},onBeforeDeinit:function(){k(n.canvas,".ge-content").forEach(function(t){l(t)&&F(t)})},onDeinit:function(){g&&n.canvas.removeEventListener("click",g),g=null},onContentReady:function(t){O.has(t)&&!C.has(t)&&C.set(t,e(t))}}};Object.assign(p.locales.en,{"text.add":"Text","text.add_type":"Text ({editor})","panel.editor":"Editor","panel.kind_text":"Text"}),O=new WeakMap,C=new WeakMap,$=/^(mce-|cke|ck-|note-)|^(ck|active|ge-rte-active)$/,D=/^(data-mce-|contenteditable$|spellcheck$)/,u.always=!0,p.features.text=u}var O,C,$,D;Object.assign(p.locales.en,{"text.tinymce":"tinyMCE"});function I(e){A(e,"active ge-rte-active"),["id","style","spellcheck","contenteditable","data-mce-style"].forEach(function(r){e.removeAttribute(r)})}var X="<p>Lorem ipsum dolores</p>",H=new WeakMap,M=new WeakSet;p.texts.tinymce=function(e){return{labelKey:"text.tinymce",initialContent:X,missingKey:"error.tinymce_missing",available:function(){return!!window.tinymce},start:function(r){var o=e.settings,u=o.tinymce&&o.tinymce.config?o.tinymce.config:{};r.forEach(function(n){if(!E(n,"active")){n.innerHTML==X&&(n.innerHTML=""),_(n,"active");var s=Object.assign({promotion:!1},u,{target:n,inline:!0,init_instance_callback:function(i){if(M.has(n)){M.delete(n),i.remove(),I(n);return}H.set(n,i),e.textReady(n),i.on("Undo Redo",function(){e.textReady(n)}),window.requestAnimationFrame(function(){i.removed||!i.ui||!i.ui.show||i.ui.show()}),i.on("focus",function(){window.requestAnimationFrame(function(){i.removed||!i.ui||!i.ui.show||i.ui.show()})}),i.focus(),u.init_instance_callback&&u.init_instance_callback.call(this,i)}});delete s.selector,window.tinymce.init(s)}})},stop:function(r){r.filter(function(o){return E(o,"active")}).forEach(function(o){var u=H.get(o);u?(H.delete(o),u.remove()):M.add(o),I(o)})}}};})();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/js/register.js", "../../src/js/dom.js", "../../src/js/text/grideditor.text.js", "../../src/js/plugins/grideditor.tinymce.js"],
4
- "sourcesContent": ["/**\n * What a plugin's or a locale's classic script imports in place of the\n * editor: the GridEditor the page already loaded.\n *\n * The build points `import { GridEditor } from '../grideditor.js'` here for\n * the classic scripts, so each registers on the editor the page has rather\n * than bringing its own. Loaded before the editor there is nothing to\n * register on, and saying so is better than a TypeError three calls later.\n */\nvar GridEditor = window.GridEditor;\n\nif (!GridEditor || typeof GridEditor.get !== 'function') {\n throw new Error('grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, ' +\n 'its locales and grideditor.jquery.js');\n}\n\nexport { GridEditor };\nexport default GridEditor;\n", "/**\n * The DOM, the way grid-editor uses it.\n *\n * Small helpers over the browser's own API, for the core and the shipped\n * plugins. Not a public API: a plugin of a host's own is free to write its\n * DOM code however it likes, and this file makes no promise to it.\n *\n * Stateless on purpose. The build puts a copy of this file in each plugin's\n * classic script, so anything kept here would be kept once per copy; a\n * module that needs to remember something about a node keeps its own\n * WeakMap.\n */\n\n/** Every element under `root` matching `selector`, as an array. */\nexport function all(root, selector) {\n return root ? Array.prototype.slice.call(root.querySelectorAll(selector)) : [];\n}\n\n/** The first element under `root` matching `selector`, or null. */\nexport function one(root, selector) {\n return root ? root.querySelector(selector) : null;\n}\n\n/** `root` itself when it matches, then every element under it that does. */\nexport function selfAndAll(root, selector) {\n if (!root) { return []; }\n\n var found = all(root, selector);\n if (root.nodeType === 1 && root.matches(selector)) { found.unshift(root); }\n return found;\n}\n\n/** The element children of `node`, those matching `selector` if one is given. */\nexport function children(node, selector) {\n if (!node) { return []; }\n\n return Array.prototype.filter.call(node.children, function(each) {\n return !selector || each.matches(selector);\n });\n}\n\n/** The first element child matching `selector`, or null. */\nexport function child(node, selector) {\n return children(node, selector)[0] || null;\n}\n\n/** The nearest ancestor-or-self matching `selector` below `stopAt`, or null. */\nexport function closest(node, selector, stopAt) {\n var found = node && node.nodeType === 1 ? node.closest(selector) : null;\n\n if (found && stopAt && found !== stopAt && !stopAt.contains(found)) { return null; }\n return found;\n}\n\n/** Whether `node` is an element matching `selector`. */\nexport function is(node, selector) {\n return !!node && node.nodeType === 1 && node.matches(selector);\n}\n\n/** Whether `node` is in the document. */\nexport function attached(node) {\n return !!node && document.documentElement.contains(node);\n}\n\n/** The element siblings after `node` that match `selector`. */\nexport function nextAll(node, selector) {\n var found = [];\n\n for (var next = node.nextElementSibling; next; next = next.nextElementSibling) {\n if (!selector || next.matches(selector)) { found.push(next); }\n }\n return found;\n}\n\n/** The ancestors of `node` up to, and not including, `stop`, nearest first. */\nexport function parentsUntil(node, stop) {\n var found = [];\n\n for (var parent = node.parentElement; parent && parent !== stop; parent = parent.parentElement) {\n found.push(parent);\n }\n return found;\n}\n\n/**\n * The nodes the html parses into, detached. Parsed the way innerHTML parses,\n * so a <script> in it never runs, here or once it is in the page.\n */\nexport function parse(html) {\n var template = document.createElement('template');\n template.innerHTML = html;\n return Array.prototype.slice.call(template.content.childNodes);\n}\n\n/** The one element the html is, detached. */\nexport function create(html) {\n var nodes = parse(html.trim());\n\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].nodeType === 1) { return nodes[i]; }\n }\n return null;\n}\n\n/** An element of `tag`, with `attributes` and `text`. */\nexport function element(tag, attributes, text) {\n var node = document.createElement(tag);\n\n Object.keys(attributes || {}).forEach(function(name) {\n var value = attributes[name];\n if (value !== null && value !== undefined && value !== false) { node.setAttribute(name, value); }\n });\n if (text !== undefined && text !== null) { node.textContent = text; }\n\n return node;\n}\n\n/** Replace what `node` holds with `html`. A <script> in it does not run. */\nexport function setHtml(node, html) {\n node.innerHTML = html === undefined || html === null ? '' : String(html);\n return node;\n}\n\n/** Add one or several space separated classes. */\nexport function addClass(node, names) {\n split(names).forEach(function(name) { node.classList.add(name); });\n return node;\n}\n\nexport function removeClass(node, names) {\n split(names).forEach(function(name) { node.classList.remove(name); });\n return node;\n}\n\n/** Each class on, or off, or flipped when `on` is not given. */\nexport function toggleClass(node, names, state) {\n split(names).forEach(function(name) {\n if (state === undefined) {\n node.classList.toggle(name);\n } else {\n node.classList.toggle(name, !!state);\n }\n });\n return node;\n}\n\nexport function hasClass(node, name) {\n return !!node && node.nodeType === 1 && node.classList.contains(name);\n}\n\nfunction split(names) {\n return String(names || '').split(/\\s+/).filter(Boolean);\n}\n\n/** Take the class attribute off when there is nothing left in it. */\nexport function dropEmptyClass(node) {\n if (!node.getAttribute('class')) { node.removeAttribute('class'); }\n return node;\n}\n\n/** Take the style attribute off when there is nothing left in it. */\nexport function dropEmptyStyle(node) {\n if (!node.getAttribute('style')) { node.removeAttribute('style'); }\n return node;\n}\n\n/** Set attributes; a null or undefined value takes the attribute off. */\nexport function attr(node, attributes) {\n Object.keys(attributes).forEach(function(name) {\n var value = attributes[name];\n\n if (value === null || value === undefined) {\n node.removeAttribute(name);\n } else {\n node.setAttribute(name, value);\n }\n });\n return node;\n}\n\n/**\n * Inline styles, by css property name. A number is pixels for the properties\n * that take a length, as jQuery had it; an empty string takes one off.\n */\nexport function css(node, styles) {\n Object.keys(styles).forEach(function(property) {\n var value = styles[property];\n\n if (typeof value === 'number' && !UNITLESS[property]) { value = value + 'px'; }\n node.style.setProperty(property, value === null || value === undefined ? '' : String(value));\n });\n return node;\n}\n\nvar UNITLESS = { opacity: true, 'z-index': true, 'flex-grow': true, 'flex-shrink': true, order: true };\n\n/** What an element of this tag shows as when nothing hides it. */\nvar defaultDisplays = {};\n\nfunction defaultDisplay(node) {\n var tag = node.nodeName;\n\n if (!defaultDisplays[tag]) {\n var probe = document.body.appendChild(document.createElement(tag));\n defaultDisplays[tag] = getComputedStyle(probe).display;\n probe.remove();\n if (defaultDisplays[tag] === 'none') { defaultDisplays[tag] = 'block'; }\n }\n return defaultDisplays[tag];\n}\n\n/** Show a node: its inline display:none off, and a display of its own if a stylesheet hides it. */\nexport function show(node) {\n node.style.removeProperty('display');\n if (getComputedStyle(node).display === 'none') { node.style.display = defaultDisplay(node); }\n return node;\n}\n\nexport function hide(node) {\n node.style.display = 'none';\n return node;\n}\n\n/** Show or hide; flip when `on` is not given. */\nexport function toggle(node, state) {\n if (state === undefined) { state = !visible(node); }\n return state ? show(node) : hide(node);\n}\n\n/** Whether a node takes up room: what jQuery's :visible meant. */\nexport function visible(node) {\n return !!(node.offsetWidth || node.offsetHeight || node.getClientRects().length);\n}\n\n/** The border box's width, fractions included. */\nexport function outerWidth(node) {\n return node.getBoundingClientRect().width;\n}\n\nexport function outerHeight(node) {\n return node.getBoundingClientRect().height;\n}\n\n/** The content box's height, which is what jQuery's height() gave. */\nexport function contentHeight(node) {\n var style = getComputedStyle(node);\n return node.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n}\n\n/** Where a node is on the page, not in the window. */\nexport function offset(node) {\n var box = node.getBoundingClientRect();\n return { top: box.top + window.pageYOffset, left: box.left + window.pageXOffset };\n}\n\n/** Its index among its parent's element children, those matching `selector` if given. */\nexport function indexIn(node, selector) {\n return children(node.parentElement, selector).indexOf(node);\n}\n\n/** Put `node` right after `reference`. */\nexport function insertAfter(node, reference) {\n reference.parentNode.insertBefore(node, reference.nextSibling);\n return node;\n}\n\n/** Replace `node` with what it holds. */\nexport function unwrap(node) {\n var parent = node.parentNode;\n\n while (node.firstChild) { parent.insertBefore(node.firstChild, node); }\n node.remove();\n}\n\n/** Put `node` inside `wrapper`, where `node` was. */\nexport function wrap(node, wrapper) {\n node.parentNode.insertBefore(wrapper, node);\n wrapper.appendChild(node);\n return wrapper;\n}\n\n/**\n * Listen on `root` for `types` (space separated) on descendants that match\n * `selector`, with `this` the matched element, as jQuery's delegated\n * handlers had it. Hands back the listener, for removeEventListener; a\n * signal in `options` removes it too.\n */\nexport function delegate(root, types, selector, handler, options) {\n var listener = function(event) {\n var match = closest(event.target, selector, root);\n if (match && root.contains(match)) { return handler.call(match, event); }\n return undefined;\n };\n\n split(types).forEach(function(type) { root.addEventListener(type, listener, options); });\n return listener;\n}\n\n/** Listen for several space separated event types with one handler. */\nexport function on(target, types, handler, options) {\n split(types).forEach(function(type) { target.addEventListener(type, handler, options); });\n return handler;\n}\n\nexport function off(target, types, handler, options) {\n split(types).forEach(function(type) { target.removeEventListener(type, handler, options); });\n}\n\n/** A mouse event of `type` sent to `node`, the way a pointer would. */\nexport function fire(node, type) {\n node.dispatchEvent(new MouseEvent(type, { bubbles: type !== 'mouseenter' && type !== 'mouseleave' }));\n}\n\n/* ------------------------------------------------------------------\n * Taking a node away, visibly.\n *\n * The durations are the ones 6.x had through jQuery: 400 ms unless the\n * caller says otherwise. `done` runs once the node is out of sight, which is\n * when the caller removes it; a node that is already out of sight is done at\n * once, on the next task, as jQuery had it.\n * ------------------------------------------------------------------ */\n\nvar DEFAULT_DURATION = 400;\n\nfunction animateAway(node, frames, duration, done) {\n duration = duration === undefined ? DEFAULT_DURATION : duration;\n\n var finish = function() {\n hide(node);\n if (done) { done(); }\n };\n\n if (!visible(node) || !node.animate || duration <= 0) {\n window.setTimeout(finish, 0);\n return;\n }\n\n var animation = node.animate(frames(getComputedStyle(node)), {\n duration: duration,\n easing: 'ease-in-out',\n });\n var called = false;\n var once = function() {\n if (called) { return; }\n called = true;\n finish();\n };\n\n animation.onfinish = once;\n animation.oncancel = once;\n}\n\n/** Fold a node up to nothing, then hide it. */\nexport function slideUp(node, duration, done) {\n if (typeof duration === 'function') {\n done = duration;\n duration = undefined;\n }\n\n node.style.overflow = 'hidden';\n animateAway(node, function(style) {\n return [\n {\n height: style.height,\n paddingTop: style.paddingTop,\n paddingBottom: style.paddingBottom,\n marginTop: style.marginTop,\n marginBottom: style.marginBottom,\n },\n { height: '0px', paddingTop: '0px', paddingBottom: '0px', marginTop: '0px', marginBottom: '0px' },\n ];\n }, duration, function() {\n node.style.removeProperty('overflow');\n if (done) { done(); }\n });\n}\n\n/** Fade a node out, then hide it. */\nexport function fadeOut(node, duration, done) {\n animateAway(node, function(style) {\n return [{ opacity: style.opacity }, { opacity: 0 }];\n }, duration, done);\n}\n\n/** Fade and fold a node, in height and, with `width`, sideways too, then hide it. */\nexport function shrinkAway(node, duration, done, width) {\n node.style.overflow = 'hidden';\n animateAway(node, function(style) {\n var from = { opacity: style.opacity, height: style.height };\n var to = { opacity: 0, height: '0px' };\n\n if (width) {\n from.width = style.width;\n to.width = '0px';\n }\n return [from, to];\n }, duration, function() {\n node.style.removeProperty('overflow');\n if (done) { done(); }\n });\n}\n", "/**\n * Text for grid-editor: what the text editor plugins share.\n *\n * Not a file a page loads. The build puts it at the top of each text editor\n * plugin - grideditor.tinymce.js, grideditor.ckeditor.js,\n * grideditor.summernote.js - and whichever of them loads first installs it:\n * a page with two editors has one of these.\n *\n * It is a feature plugin, `text`, that the `plugins` setting does not choose\n * (content_types does), and it is everything a text is to the editor: the\n * text block's drawer, the Text buttons in the toolbar, createText, opening\n * an editor on a click and closing it again with the host's attributes put\n * back, and making the host's plain content a text through the core's\n * `textTypes` hook.\n *\n * Each editor registers under GridEditor.texts, which is this file's own\n * registry and not a contract: an editor of a host's own is a feature plugin\n * of its own, as example/custom_editor.html shows.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\n\n// However many editors a page loads, each with a copy of this file in its\n// classic script: the first one installs it\nif (!GridEditor.features.text) {\n\n Object.assign(GridEditor.locales.en, {\n 'text.add': 'Text',\n 'text.add_type': 'Text ({editor})',\n 'panel.editor': 'Editor',\n 'panel.kind_text': 'Text',\n });\n\n /**\n * What a content area's attributes were before its editor opened, and\n * once it had: the two readings closeText plays the host's changes\n * back from. Shared by every editor on the page, like the nodes.\n */\n var readBefore = new WeakMap();\n var readReady = new WeakMap();\n\n /** What a text editor puts on a content area while it is open, whenever it likes. */\n var EDITOR_CLASS = /^(mce-|cke|ck-|note-)|^(ck|active|ge-rte-active)$/;\n var EDITOR_ATTRIBUTE = /^(data-mce-|contenteditable$|spellcheck$)/;\n\n function attributesOf(element) {\n var found = {};\n Array.prototype.slice.call(element.attributes).forEach(function(attribute) {\n found[attribute.name] = attribute.value;\n });\n return found;\n }\n\n function classesIn(value) {\n return (value || '').split(/\\s+/).filter(function(name) {\n return name !== '' && !EDITOR_CLASS.test(name);\n });\n }\n\n /** The host's markup, with what changed from `ready` to `open` played back onto it. */\n function restoreAttributes(block, before, ready, open) {\n var result = Object.assign({}, before);\n\n Object.keys(Object.assign({}, ready, open)).forEach(function(name) {\n if (name === 'class' || EDITOR_ATTRIBUTE.test(name) || ready[name] === open[name]) { return; }\n\n if (open[name] === undefined) {\n delete result[name];\n } else {\n result[name] = open[name];\n }\n });\n\n var readyClasses = classesIn(ready['class']);\n var openClasses = classesIn(open['class']);\n var classes = classesIn(before['class']).filter(function(name) {\n return openClasses.indexOf(name) !== -1 || readyClasses.indexOf(name) === -1;\n });\n openClasses.forEach(function(name) {\n if (readyClasses.indexOf(name) === -1 && classes.indexOf(name) === -1) { classes.push(name); }\n });\n\n // In the host's order, class where it was: getHtml should not\n // shuffle a node's attributes because it was edited\n if (classes.length) { result['class'] = classes.join(' '); } else { delete result['class']; }\n\n Object.keys(attributesOf(block)).forEach(function(name) { block.removeAttribute(name); });\n Object.keys(result).forEach(function(name) { block.setAttribute(name, result[name]); });\n }\n\n function textFeature(ge) {\n\n var settings = ge.settings;\n var TEXTS = {};\n var warned = {};\n\n Object.keys(GridEditor.texts).forEach(function(type) {\n TEXTS[type] = GridEditor.texts[type](ge);\n });\n\n // Every editor loaded, in the order the page loaded them, unless the\n // host names the ones it wants\n if (!Array.isArray(settings.content_types)) { settings.content_types = Object.keys(TEXTS); }\n if (!Array.isArray(settings.text_tools)) { settings.text_tools = []; }\n if (!Array.isArray(settings.text_classes)) { settings.text_classes = []; }\n\n /** The text editors this editor offers, in content_types order: the ones loaded. */\n function offeredTexts() {\n return settings.content_types.filter(function(type) { return !!TEXTS[type]; });\n }\n\n /** What a text editor is called: its plugin's label, or its type. */\n function textLabel(type) {\n var text = TEXTS[type];\n return text && text.labelKey ? ge.t(text.labelKey) : type;\n }\n\n /** A detached content area of `type`, holding `content` or the editor's initial content. */\n function makeText(type, content) {\n var text = TEXTS[type];\n var block = dom.element('div', {\n 'class': 'ge-content ge-content-type-' + type,\n 'data-ge-content-type': type,\n });\n\n if (content && content.nodeType) {\n block.appendChild(content);\n } else {\n dom.setHtml(block, content !== undefined ? content : (text && text.initialContent) || '');\n }\n return block;\n }\n\n /**\n * createText(type?, options?): a content area of a text editor's,\n * detached unless a placement is given. The type is the first one\n * offered by default. `options.content` is its html.\n */\n function apiCreateText(type, options) {\n if (type && typeof type === 'object') {\n options = type;\n type = undefined;\n }\n options = options || {};\n type = type || offeredTexts()[0];\n\n if (!type || !TEXTS[type]) {\n if (!warned['createText:' + type]) {\n warned['createText:' + type] = true;\n ge.warn('createText: no text editor \"' + type + '\" is loaded; ' +\n 'load its plugin and name it in content_types');\n }\n return null;\n }\n\n return ge.place(makeText(type, options.content), 'text', options);\n }\n\n /** Whether a content area is a text of one of the editors loaded here. */\n function isOurs(block) {\n return !!TEXTS[block.getAttribute('data-ge-content-type')];\n }\n\n /** Open the editor on a text, once: until it is closed again. */\n function startText(block) {\n if (dom.hasClass(block, 'ge-rte-active')) { return; }\n\n // A content area nobody can see - a tab that is not the open one,\n // a closed accordion item - has no geometry for an editor to lay\n // its toolbar out against, and nothing anyone can type into\n if (!dom.visible(block)) { return; }\n\n // The attribute: it is markup, and the drawer reads it the same way\n var text = TEXTS[block.getAttribute('data-ge-content-type')];\n if (!text) { return; }\n\n // Not marked active, so the next click tries again: the library\n // may be loaded by then\n if (text.available && !text.available()) {\n if (text.missingKey) { console.error(ge.t(text.missingKey)); }\n return;\n }\n\n readBefore.set(block, attributesOf(block));\n readReady.delete(block);\n dom.addClass(block, 'ge-rte-active');\n text.start([block]);\n }\n\n function onClick() {\n startText(this);\n }\n\n /**\n * Close the text editor on one content area, and leave the content\n * area's own attributes as the host left them.\n *\n * An editor adds attributes of its own while it is open, and takes\n * them off again, more or less: CKEditor leaves aria-readonly behind.\n * tinyMCE does worse, and puts back every attribute as it was when it\n * opened, so an id, a class or a plugin's attribute given while it was\n * open is lost. So the attributes are read three times - before the\n * editor opens, once it has opened, and before it closes - and what\n * changed between the second and the third, the host's doing, is\n * played back onto the first, the host's markup. What the editor did\n * is left out either way.\n */\n function closeText(block) {\n var text = TEXTS[block.getAttribute('data-ge-content-type')];\n var before = readBefore.get(block);\n var open = before ? attributesOf(block) : null;\n\n // Every content area is told, as in 5.x: one whose editor never\n // started is the plugin's to ignore\n if (text) { text.stop([block]); }\n\n // After stop, not before: an editor that restores the class\n // attribute it snapshotted would put ge-rte-active back\n dom.removeClass(block, 'ge-rte-active');\n\n if (before) {\n restoreAttributes(block, before, readReady.get(block) || before, open);\n readBefore.delete(block);\n readReady.delete(block);\n }\n }\n\n function createTextControls(textBlock) {\n var block = dom.child(textBlock, '.ge-content');\n var type = block.getAttribute('data-ge-content-type');\n var drawer = dom.element('div', { 'class': 'ge-tools-drawer ge-text-drawer' });\n textBlock.insertBefore(drawer, textBlock.firstChild);\n\n ge.createMoveTool(drawer);\n\n var details = ge.addSettingsTool(drawer, block, settings.text_classes);\n\n // Which editor edits it, first in its settings: something to\n // know about it, not something to do with it\n var general = dom.child(details, '.ge-details-general');\n var editor = dom.element('div', { 'class': 'ge-field ge-text-editor' });\n editor.appendChild(dom.element('span', { 'class': 'ge-field-label' }, ge.t('panel.editor')));\n editor.appendChild(dom.element('span', { 'class': 'ge-field-value' }, textLabel(type)));\n general.insertBefore(editor, general.firstChild);\n\n settings.text_tools.forEach(function(hostTool) {\n ge.createTool(drawer, hostTool.title || '', hostTool.className || '',\n hostTool.iconClass || 'bi bi-wrench', hostTool.on);\n });\n\n ge.createTool(drawer, ge.t('tool.delete_text'), 'ge-delete-text', 'bi bi-trash', function() {\n ge.deleteNode('text', block, ge.t('confirm.delete_text'), function(removed) {\n // Its editor lets go first: removed while open, it would\n // be left behind, attached to nothing\n closeText(block);\n dom.slideUp(textBlock, function() {\n textBlock.remove();\n removed();\n });\n });\n });\n }\n\n /** A drawer for each text of ours in a text block that has none yet. */\n function markTexts() {\n dom.all(ge.canvas, '.ge-text-block').forEach(function(textBlock) {\n if (dom.child(textBlock, '.ge-tools-drawer')) { return; }\n\n var block = dom.child(textBlock, '.ge-content');\n if (!block || !isOurs(block)) { return; }\n\n createTextControls(textBlock);\n });\n }\n\n var texts = offeredTexts();\n var clicks = null; // The delegated click listener, while editing\n\n return {\n methods: {\n createText: apiCreateText,\n },\n\n /**\n * The types this plugin edits, for the core: every editor loaded\n * is the owner of its texts, and the ones offered are what the\n * host's plain content can be made.\n */\n textTypes: function() {\n var offered = offeredTexts();\n var others = Object.keys(TEXTS).filter(function(type) { return offered.indexOf(type) === -1; });\n\n return offered.concat(others).map(function(type) {\n var text = TEXTS[type];\n\n return {\n type: type,\n label: textLabel(type),\n offered: offered.indexOf(type) !== -1,\n available: text.available ? function() { return text.available(); } : null,\n missingKey: text.missingKey,\n edit: function(block) {\n var textBlock = block.parentElement;\n if (dom.hasClass(textBlock, 'ge-text-block') && !dom.child(textBlock, '.ge-tools-drawer')) {\n createTextControls(textBlock);\n }\n\n startText(block);\n },\n };\n });\n },\n\n // A text block of each editor offered. Like a container, it goes\n // into a row of its own when clicked, or where it is dropped\n toolbar: texts.map(function(type) {\n return {\n label: function() {\n return texts.length > 1 ? ge.t('text.add_type', { editor: textLabel(type) }) : ge.t('text.add');\n },\n iconClass: TEXTS[type].iconClass,\n className: 'ge-add-text-button',\n kind: 'text',\n inColumn: true,\n create: function() { return makeText(type); },\n };\n }),\n\n onInit: function() {\n markTexts();\n\n if (clicks) { ge.canvas.removeEventListener('click', clicks); }\n clicks = dom.delegate(ge.canvas, 'click', '.ge-content', onClick);\n },\n\n // While the drawers and the text blocks are still there, as the\n // editors left them\n onBeforeDeinit: function() {\n dom.all(ge.canvas, '.ge-content').forEach(function(block) {\n if (isOurs(block)) { closeText(block); }\n });\n },\n\n onDeinit: function() {\n if (clicks) { ge.canvas.removeEventListener('click', clicks); }\n clicks = null;\n },\n\n // The first time only: an undo says ready again, and by then the\n // host may have changed the content area itself\n onContentReady: function(area) {\n if (readBefore.has(area) && !readReady.has(area)) {\n readReady.set(area, attributesOf(area));\n }\n },\n };\n }\n\n // Whatever the plugins setting says: content_types chooses the editors\n textFeature.always = true;\n\n GridEditor.features.text = textFeature;\n\n}\n", "/**\n * tinyMCE for grid-editor's content areas.\n *\n * A text editor plugin: load this file after the editor, and tinyMCE 7\n * after or before it, and a text of the tinymce type is edited with an\n * inline tinyMCE. What it can ask the editor for is the handle its\n * factory is called with, described in docs/plugins.md.\n *\n * <script src=\"tinymce/tinymce.min.js\"></script>\n * <script src=\"dist/grideditor.min.js\"></script>\n * <script src=\"dist/plugins/grideditor.tinymce.min.js\"></script>\n *\n * Up to 5.x the main bundle carried a copy of this file; since 6.0 it is\n * loaded on its own, like every plugin. It imports what every text editor\n * shares - text blocks, the Text button, createText, making the host's plain\n * content a text - from src/js/text/grideditor.text.js, which the build puts\n * in its classic script, installed once however many editors a page loads.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\nimport '../text/grideditor.text.js';\n\nObject.assign(GridEditor.locales.en, {\n 'text.tinymce': 'tinyMCE',\n 'warning.oninit_removed': 'tinyMCE\\'s oninit option was removed in 7.0 and is ignored: use init_instance_callback.',\n});\n\n// tinyMCE snapshots the target element's attributes when an inline editor is\n// created and restores them on remove(), so this has to run *after* remove()\n// to keep the grid editor's own class and tinyMCE's leftovers off the element.\nfunction cleanUp(contentArea) {\n dom.removeClass(contentArea, 'active ge-rte-active');\n ['id', 'style', 'spellcheck', 'contenteditable', 'data-mce-style'].forEach(function(name) {\n contentArea.removeAttribute(name);\n });\n}\n\nvar INITIAL_CONTENT = '<p>Lorem ipsum dolores</p>';\n\n// What this file remembers about a content area: its editor, and whether a\n// deinit came before that editor was ready\nvar editors = new WeakMap();\nvar pendingRemove = new WeakSet();\n\n// Said once per page, however many editors are on it\nvar warnedOninit = false;\n\nGridEditor.texts.tinymce = function(ge) {\n return {\n labelKey: 'text.tinymce',\n initialContent: INITIAL_CONTENT,\n missingKey: 'error.tinymce_missing',\n\n available: function() { return !!window.tinymce; },\n\n start: function(contentAreas) {\n var settings = ge.settings;\n var userConfig = (settings.tinymce && settings.tinymce.config) ? settings.tinymce.config : {};\n\n // 'oninit' was the pre-6 name for init_instance_callback, honoured\n // through 6.x and gone in 7.0\n if (userConfig.oninit && !warnedOninit) {\n warnedOninit = true;\n ge.warn(ge.t('warning.oninit_removed'));\n }\n\n contentAreas.forEach(function(contentArea) {\n if (dom.hasClass(contentArea, 'active')) { return; }\n\n if (contentArea.innerHTML == INITIAL_CONTENT) {\n contentArea.innerHTML = '';\n }\n dom.addClass(contentArea, 'active');\n\n var configuration = Object.assign({\n // tinyMCE's own \"Upgrade\" badge in the menubar. Off by\n // default because an inline editor here is a column of\n // someone's page, not tinyMCE's own interface; a host that\n // wants it back passes promotion: true.\n promotion: false,\n }, userConfig, {\n target: contentArea,\n inline: true,\n init_instance_callback: function(editor) {\n // deinit ran before this init finished, so tear it down again\n if (pendingRemove.has(contentArea)) {\n pendingRemove.delete(contentArea);\n editor.remove();\n // deinit already ran and cannot clean up after this\n // late remove(), so do it here instead\n cleanUp(contentArea);\n return;\n }\n\n editors.set(contentArea, editor);\n\n // The editor rewrote what is inside this content area\n // while it took it over, so whatever the grid editor\n // had in there is gone. Saying so lets it put its own\n // furniture back.\n ge.textReady(contentArea);\n\n // Undo and redo rewrite it too, from snapshots that\n // leave out whatever is marked data-mce-bogus - an\n // element's drawer among them - so it goes back in\n // after each of those as well\n editor.on('Undo Redo', function() {\n ge.textReady(contentArea);\n });\n\n // The inline toolbar is laid out against the element's\n // geometry at the moment tinyMCE draws it, and an\n // element that has just appeared - a tab pane, an\n // accordion body, a column whose width is still\n // settling - may not have its own width yet. Asking\n // for the ui again once the browser has laid the frame\n // out measures it as it now is, instead of leaving a\n // toolbar wrapped into a narrow column.\n window.requestAnimationFrame(function() {\n if (editor.removed || !editor.ui || !editor.ui.show) { return; }\n\n editor.ui.show();\n });\n\n // And again whenever the user comes back to this\n // editor: by then the element may have been resized,\n // hidden and shown again - a tab switched away from\n // and back, a column made narrower - and the toolbar\n // is only ever as right as its last measurement.\n editor.on('focus', function() {\n window.requestAnimationFrame(function() {\n if (editor.removed || !editor.ui || !editor.ui.show) { return; }\n\n editor.ui.show();\n });\n });\n\n // Bring focus to text field\n editor.focus();\n\n // Call the original callback, if one was passed in the config\n if (userConfig.init_instance_callback) {\n userConfig.init_instance_callback.call(this, editor);\n }\n }\n });\n // We always edit the element we were handed, so a selector in the\n // user config would only fight with target\n delete configuration.selector;\n delete configuration.oninit;\n\n window.tinymce.init(configuration);\n });\n },\n\n stop: function(contentAreas) {\n contentAreas.filter(function(contentArea) {\n return dom.hasClass(contentArea, 'active');\n }).forEach(function(contentArea) {\n var editor = editors.get(contentArea);\n\n if (editor) {\n editors.delete(contentArea);\n editor.remove();\n } else {\n // tinymce.init() is asynchronous, so the editor may not exist\n // yet. Leave a note for init_instance_callback to remove it.\n pendingRemove.add(contentArea);\n }\n\n cleanUp(contentArea);\n });\n },\n };\n};\n"],
5
- "mappings": "MASA,IAAIA,EAAa,OAAO,WAExB,GAAI,CAACA,GAAc,OAAOA,EAAW,KAAQ,WACzC,MAAM,IAAI,MAAM,wHAC0B,ECCvC,SAASC,EAAIC,EAAMC,EAAU,CAChC,OAAOD,EAAO,MAAM,UAAU,MAAM,KAAKA,EAAK,iBAAiBC,CAAQ,CAAC,EAAI,CAAC,CACjF,CAiBO,SAASC,EAASC,EAAMC,EAAU,CACrC,OAAKD,EAEE,MAAM,UAAU,OAAO,KAAKA,EAAK,SAAU,SAASE,EAAM,CAC7D,MAAO,CAACD,GAAYC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TJ,EAAW,wBACXA,EAAW,uBAAuB,KAAK,KAAMI,CAAM,CAE3D,CACJ,CAAC,EAGD,OAAOD,EAAc,SACrB,OAAOA,EAAc,OAErB,OAAO,QAAQ,KAAKA,CAAa,EACrC,CAAC,CACL,EAEA,KAAM,SAASL,EAAc,CACzBA,EAAa,OAAO,SAASR,EAAa,CACtC,OAAWW,EAASX,EAAa,QAAQ,CAC7C,CAAC,EAAE,QAAQ,SAASA,EAAa,CAC7B,IAAIc,EAASV,EAAQ,IAAIJ,CAAW,EAEhCc,GACAV,EAAQ,OAAOJ,CAAW,EAC1Bc,EAAO,OAAO,GAIdT,EAAc,IAAIL,CAAW,EAGjCD,EAAQC,CAAW,CACvB,CAAC,CACL,CACJ,CACJ",
6
- "names": ["GridEditor", "all", "root", "selector", "children", "node", "selector", "each", "child", "closest", "stopAt", "found", "element", "tag", "attributes", "text", "node", "name", "value", "setHtml", "html", "addClass", "names", "split", "removeClass", "hasClass", "node", "name", "split", "names", "hide", "node", "visible", "node", "delegate", "root", "types", "selector", "handler", "options", "listener", "event", "match", "closest", "split", "type", "DEFAULT_DURATION", "animateAway", "node", "frames", "duration", "done", "finish", "hide", "visible", "animation", "called", "once", "slideUp", "style", "GridEditor", "attributesOf", "element", "found", "attribute", "classesIn", "value", "name", "EDITOR_CLASS", "restoreAttributes", "block", "before", "ready", "open", "result", "EDITOR_ATTRIBUTE", "readyClasses", "openClasses", "classes", "textFeature", "ge", "settings", "TEXTS", "warned", "type", "offeredTexts", "textLabel", "text", "makeText", "content", "setHtml", "apiCreateText", "options", "isOurs", "startText", "hasClass", "visible", "readBefore", "readReady", "addClass", "onClick", "closeText", "removeClass", "createTextControls", "textBlock", "child", "drawer", "details", "general", "editor", "hostTool", "removed", "slideUp", "markTexts", "all", "texts", "clicks", "offered", "others", "delegate", "area", "GridEditor", "cleanUp", "contentArea", "removeClass", "name", "INITIAL_CONTENT", "editors", "pendingRemove", "warnedOninit", "ge", "contentAreas", "settings", "userConfig", "hasClass", "addClass", "configuration", "editor"]
4
+ "sourcesContent": ["/**\n * What a plugin's or a locale's classic script imports in place of the\n * editor: the GridEditor the page already loaded.\n *\n * The build points `import { GridEditor } from '../grideditor.js'` here for\n * the classic scripts, so each registers on the editor the page has rather\n * than bringing its own. Loaded before the editor there is nothing to\n * register on, and saying so is better than a TypeError three calls later.\n */\nvar GridEditor = window.GridEditor;\n\nif (!GridEditor || typeof GridEditor.get !== 'function') {\n throw new Error('grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, ' +\n 'its locales and grideditor.jquery.js');\n}\n\nexport { GridEditor };\nexport default GridEditor;\n", "/**\n * The DOM, the way grid-editor uses it.\n *\n * Small helpers over the browser's own API, for the core and the shipped\n * plugins. Not a public API: a plugin of a host's own is free to write its\n * DOM code however it likes, and this file makes no promise to it.\n *\n * Stateless on purpose. The build puts a copy of this file in each plugin's\n * classic script, so anything kept here would be kept once per copy; a\n * module that needs to remember something about a node keeps its own\n * WeakMap.\n */\n\n/** Every element under `root` matching `selector`, as an array. */\nexport function all(root, selector) {\n return root ? Array.prototype.slice.call(root.querySelectorAll(selector)) : [];\n}\n\n/** The first element under `root` matching `selector`, or null. */\nexport function one(root, selector) {\n return root ? root.querySelector(selector) : null;\n}\n\n/** `root` itself when it matches, then every element under it that does. */\nexport function selfAndAll(root, selector) {\n if (!root) { return []; }\n\n var found = all(root, selector);\n if (root.nodeType === 1 && root.matches(selector)) { found.unshift(root); }\n return found;\n}\n\n/** The element children of `node`, those matching `selector` if one is given. */\nexport function children(node, selector) {\n if (!node) { return []; }\n\n return Array.prototype.filter.call(node.children, function(each) {\n return !selector || each.matches(selector);\n });\n}\n\n/** The first element child matching `selector`, or null. */\nexport function child(node, selector) {\n return children(node, selector)[0] || null;\n}\n\n/** The nearest ancestor-or-self matching `selector` below `stopAt`, or null. */\nexport function closest(node, selector, stopAt) {\n var found = node && node.nodeType === 1 ? node.closest(selector) : null;\n\n if (found && stopAt && found !== stopAt && !stopAt.contains(found)) { return null; }\n return found;\n}\n\n/** Whether `node` is an element matching `selector`. */\nexport function is(node, selector) {\n return !!node && node.nodeType === 1 && node.matches(selector);\n}\n\n/** Whether `node` is in the document. */\nexport function attached(node) {\n return !!node && document.documentElement.contains(node);\n}\n\n/** The element siblings after `node` that match `selector`. */\nexport function nextAll(node, selector) {\n var found = [];\n\n for (var next = node.nextElementSibling; next; next = next.nextElementSibling) {\n if (!selector || next.matches(selector)) { found.push(next); }\n }\n return found;\n}\n\n/** The ancestors of `node` up to, and not including, `stop`, nearest first. */\nexport function parentsUntil(node, stop) {\n var found = [];\n\n for (var parent = node.parentElement; parent && parent !== stop; parent = parent.parentElement) {\n found.push(parent);\n }\n return found;\n}\n\n/**\n * The nodes the html parses into, detached. Parsed the way innerHTML parses,\n * so a <script> in it never runs, here or once it is in the page.\n */\nexport function parse(html) {\n var template = document.createElement('template');\n template.innerHTML = html;\n return Array.prototype.slice.call(template.content.childNodes);\n}\n\n/** The one element the html is, detached. */\nexport function create(html) {\n var nodes = parse(html.trim());\n\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].nodeType === 1) { return nodes[i]; }\n }\n return null;\n}\n\n/** An element of `tag`, with `attributes` and `text`. */\nexport function element(tag, attributes, text) {\n var node = document.createElement(tag);\n\n Object.keys(attributes || {}).forEach(function(name) {\n var value = attributes[name];\n if (value !== null && value !== undefined && value !== false) { node.setAttribute(name, value); }\n });\n if (text !== undefined && text !== null) { node.textContent = text; }\n\n return node;\n}\n\n/** Replace what `node` holds with `html`. A <script> in it does not run. */\nexport function setHtml(node, html) {\n node.innerHTML = html === undefined || html === null ? '' : String(html);\n return node;\n}\n\n/** Add one or several space separated classes. */\nexport function addClass(node, names) {\n split(names).forEach(function(name) { node.classList.add(name); });\n return node;\n}\n\nexport function removeClass(node, names) {\n split(names).forEach(function(name) { node.classList.remove(name); });\n return node;\n}\n\n/** Each class on, or off, or flipped when `on` is not given. */\nexport function toggleClass(node, names, state) {\n split(names).forEach(function(name) {\n if (state === undefined) {\n node.classList.toggle(name);\n } else {\n node.classList.toggle(name, !!state);\n }\n });\n return node;\n}\n\nexport function hasClass(node, name) {\n return !!node && node.nodeType === 1 && node.classList.contains(name);\n}\n\nfunction split(names) {\n return String(names || '').split(/\\s+/).filter(Boolean);\n}\n\n/** Take the class attribute off when there is nothing left in it. */\nexport function dropEmptyClass(node) {\n if (!node.getAttribute('class')) { node.removeAttribute('class'); }\n return node;\n}\n\n/** Take the style attribute off when there is nothing left in it. */\nexport function dropEmptyStyle(node) {\n if (!node.getAttribute('style')) { node.removeAttribute('style'); }\n return node;\n}\n\n/** Set attributes; a null or undefined value takes the attribute off. */\nexport function attr(node, attributes) {\n Object.keys(attributes).forEach(function(name) {\n var value = attributes[name];\n\n if (value === null || value === undefined) {\n node.removeAttribute(name);\n } else {\n node.setAttribute(name, value);\n }\n });\n return node;\n}\n\n/**\n * Inline styles, by css property name. A number is pixels for the properties\n * that take a length, as jQuery had it; an empty string takes one off.\n */\nexport function css(node, styles) {\n Object.keys(styles).forEach(function(property) {\n var value = styles[property];\n\n if (typeof value === 'number' && !UNITLESS[property]) { value = value + 'px'; }\n node.style.setProperty(property, value === null || value === undefined ? '' : String(value));\n });\n return node;\n}\n\nvar UNITLESS = { opacity: true, 'z-index': true, 'flex-grow': true, 'flex-shrink': true, order: true };\n\n/** What an element of this tag shows as when nothing hides it. */\nvar defaultDisplays = {};\n\nfunction defaultDisplay(node) {\n var tag = node.nodeName;\n\n if (!defaultDisplays[tag]) {\n var probe = document.body.appendChild(document.createElement(tag));\n defaultDisplays[tag] = getComputedStyle(probe).display;\n probe.remove();\n if (defaultDisplays[tag] === 'none') { defaultDisplays[tag] = 'block'; }\n }\n return defaultDisplays[tag];\n}\n\n/** Show a node: its inline display:none off, and a display of its own if a stylesheet hides it. */\nexport function show(node) {\n node.style.removeProperty('display');\n if (getComputedStyle(node).display === 'none') { node.style.display = defaultDisplay(node); }\n return node;\n}\n\nexport function hide(node) {\n node.style.display = 'none';\n return node;\n}\n\n/** Show or hide; flip when `on` is not given. */\nexport function toggle(node, state) {\n if (state === undefined) { state = !visible(node); }\n return state ? show(node) : hide(node);\n}\n\n/** Whether a node takes up room: what jQuery's :visible meant. */\nexport function visible(node) {\n return !!(node.offsetWidth || node.offsetHeight || node.getClientRects().length);\n}\n\n/** The border box's width, fractions included. */\nexport function outerWidth(node) {\n return node.getBoundingClientRect().width;\n}\n\nexport function outerHeight(node) {\n return node.getBoundingClientRect().height;\n}\n\n/** The content box's height, which is what jQuery's height() gave. */\nexport function contentHeight(node) {\n var style = getComputedStyle(node);\n return node.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n}\n\n/** Where a node is on the page, not in the window. */\nexport function offset(node) {\n var box = node.getBoundingClientRect();\n return { top: box.top + window.pageYOffset, left: box.left + window.pageXOffset };\n}\n\n/** Its index among its parent's element children, those matching `selector` if given. */\nexport function indexIn(node, selector) {\n return children(node.parentElement, selector).indexOf(node);\n}\n\n/** Put `node` right after `reference`. */\nexport function insertAfter(node, reference) {\n reference.parentNode.insertBefore(node, reference.nextSibling);\n return node;\n}\n\n/** Replace `node` with what it holds. */\nexport function unwrap(node) {\n var parent = node.parentNode;\n\n while (node.firstChild) { parent.insertBefore(node.firstChild, node); }\n node.remove();\n}\n\n/** Put `node` inside `wrapper`, where `node` was. */\nexport function wrap(node, wrapper) {\n node.parentNode.insertBefore(wrapper, node);\n wrapper.appendChild(node);\n return wrapper;\n}\n\n/**\n * Listen on `root` for `types` (space separated) on descendants that match\n * `selector`, with `this` the matched element, as jQuery's delegated\n * handlers had it. Hands back the listener, for removeEventListener; a\n * signal in `options` removes it too.\n */\nexport function delegate(root, types, selector, handler, options) {\n var listener = function(event) {\n var match = closest(event.target, selector, root);\n if (match && root.contains(match)) { return handler.call(match, event); }\n return undefined;\n };\n\n split(types).forEach(function(type) { root.addEventListener(type, listener, options); });\n return listener;\n}\n\n/** Listen for several space separated event types with one handler. */\nexport function on(target, types, handler, options) {\n split(types).forEach(function(type) { target.addEventListener(type, handler, options); });\n return handler;\n}\n\nexport function off(target, types, handler, options) {\n split(types).forEach(function(type) { target.removeEventListener(type, handler, options); });\n}\n\n/** A mouse event of `type` sent to `node`, the way a pointer would. */\nexport function fire(node, type) {\n node.dispatchEvent(new MouseEvent(type, { bubbles: type !== 'mouseenter' && type !== 'mouseleave' }));\n}\n\n/* ------------------------------------------------------------------\n * Taking a node away, visibly.\n *\n * The durations are jQuery's: 400 ms unless the caller says otherwise. `done` runs once the node is out of sight, which is\n * when the caller removes it; a node that is already out of sight is done at\n * once, on the next task, as jQuery had it.\n * ------------------------------------------------------------------ */\n\nvar DEFAULT_DURATION = 400;\n\nfunction animateAway(node, frames, duration, done) {\n duration = duration === undefined ? DEFAULT_DURATION : duration;\n\n var finish = function() {\n hide(node);\n if (done) { done(); }\n };\n\n if (!visible(node) || !node.animate || duration <= 0) {\n window.setTimeout(finish, 0);\n return;\n }\n\n var animation = node.animate(frames(getComputedStyle(node)), {\n duration: duration,\n easing: 'ease-in-out',\n });\n var called = false;\n var once = function() {\n if (called) { return; }\n called = true;\n finish();\n };\n\n animation.onfinish = once;\n animation.oncancel = once;\n}\n\n/** Fold a node up to nothing, then hide it. */\nexport function slideUp(node, duration, done) {\n if (typeof duration === 'function') {\n done = duration;\n duration = undefined;\n }\n\n node.style.overflow = 'hidden';\n animateAway(node, function(style) {\n return [\n {\n height: style.height,\n paddingTop: style.paddingTop,\n paddingBottom: style.paddingBottom,\n marginTop: style.marginTop,\n marginBottom: style.marginBottom,\n },\n { height: '0px', paddingTop: '0px', paddingBottom: '0px', marginTop: '0px', marginBottom: '0px' },\n ];\n }, duration, function() {\n node.style.removeProperty('overflow');\n if (done) { done(); }\n });\n}\n\n/** Fade a node out, then hide it. */\nexport function fadeOut(node, duration, done) {\n animateAway(node, function(style) {\n return [{ opacity: style.opacity }, { opacity: 0 }];\n }, duration, done);\n}\n\n/** Fade and fold a node, in height and, with `width`, sideways too, then hide it. */\nexport function shrinkAway(node, duration, done, width) {\n node.style.overflow = 'hidden';\n animateAway(node, function(style) {\n var from = { opacity: style.opacity, height: style.height };\n var to = { opacity: 0, height: '0px' };\n\n if (width) {\n from.width = style.width;\n to.width = '0px';\n }\n return [from, to];\n }, duration, function() {\n node.style.removeProperty('overflow');\n if (done) { done(); }\n });\n}\n", "/**\n * Text for grid-editor: what the text editor plugins share.\n *\n * Not a file a page loads. The build puts it at the top of each text editor\n * plugin - grideditor.tinymce.js, grideditor.ckeditor.js,\n * grideditor.summernote.js - and whichever of them loads first installs it:\n * a page with two editors has one of these.\n *\n * It is a feature plugin, `text`, that the `plugins` setting does not choose\n * (content_types does), and it is everything a text is to the editor: the\n * text block's drawer, the Text buttons in the toolbar, createText, opening\n * an editor on a click and closing it again with the host's attributes put\n * back, and making the host's plain content a text through the core's\n * `textTypes` hook.\n *\n * Each editor registers under GridEditor.texts, which is this file's own\n * registry and not a contract: an editor of a host's own is a feature plugin\n * of its own, as example/custom_editor.html shows.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\n\n// However many editors a page loads, each with a copy of this file in its\n// classic script: the first one installs it\nif (!GridEditor.features.text) {\n\n Object.assign(GridEditor.locales.en, {\n 'text.add': 'Text',\n 'text.add_type': 'Text ({editor})',\n 'panel.editor': 'Editor',\n 'panel.kind_text': 'Text',\n });\n\n /**\n * What a content area's attributes were before its editor opened, and\n * once it had: the two readings closeText plays the host's changes\n * back from. Shared by every editor on the page, like the nodes.\n */\n var readBefore = new WeakMap();\n var readReady = new WeakMap();\n\n /** What a text editor puts on a content area while it is open, whenever it likes. */\n var EDITOR_CLASS = /^(mce-|cke|ck-|note-)|^(ck|active|ge-rte-active)$/;\n var EDITOR_ATTRIBUTE = /^(data-mce-|contenteditable$|spellcheck$)/;\n\n function attributesOf(element) {\n var found = {};\n Array.prototype.slice.call(element.attributes).forEach(function(attribute) {\n found[attribute.name] = attribute.value;\n });\n return found;\n }\n\n function classesIn(value) {\n return (value || '').split(/\\s+/).filter(function(name) {\n return name !== '' && !EDITOR_CLASS.test(name);\n });\n }\n\n /** The host's markup, with what changed from `ready` to `open` played back onto it. */\n function restoreAttributes(block, before, ready, open) {\n var result = Object.assign({}, before);\n\n Object.keys(Object.assign({}, ready, open)).forEach(function(name) {\n if (name === 'class' || EDITOR_ATTRIBUTE.test(name) || ready[name] === open[name]) { return; }\n\n if (open[name] === undefined) {\n delete result[name];\n } else {\n result[name] = open[name];\n }\n });\n\n var readyClasses = classesIn(ready['class']);\n var openClasses = classesIn(open['class']);\n var classes = classesIn(before['class']).filter(function(name) {\n return openClasses.indexOf(name) !== -1 || readyClasses.indexOf(name) === -1;\n });\n openClasses.forEach(function(name) {\n if (readyClasses.indexOf(name) === -1 && classes.indexOf(name) === -1) { classes.push(name); }\n });\n\n // In the host's order, class where it was: getHtml should not\n // shuffle a node's attributes because it was edited\n if (classes.length) { result['class'] = classes.join(' '); } else { delete result['class']; }\n\n Object.keys(attributesOf(block)).forEach(function(name) { block.removeAttribute(name); });\n Object.keys(result).forEach(function(name) { block.setAttribute(name, result[name]); });\n }\n\n function textFeature(ge) {\n\n var settings = ge.settings;\n var TEXTS = {};\n var warned = {};\n\n Object.keys(GridEditor.texts).forEach(function(type) {\n TEXTS[type] = GridEditor.texts[type](ge);\n });\n\n // Every editor loaded, in the order the page loaded them, unless the\n // host names the ones it wants\n if (!Array.isArray(settings.content_types)) { settings.content_types = Object.keys(TEXTS); }\n if (!Array.isArray(settings.text_tools)) { settings.text_tools = []; }\n if (!Array.isArray(settings.text_classes)) { settings.text_classes = []; }\n\n /** The text editors this editor offers, in content_types order: the ones loaded. */\n function offeredTexts() {\n return settings.content_types.filter(function(type) { return !!TEXTS[type]; });\n }\n\n /** What a text editor is called: its plugin's label, or its type. */\n function textLabel(type) {\n var text = TEXTS[type];\n return text && text.labelKey ? ge.t(text.labelKey) : type;\n }\n\n /** A detached content area of `type`, holding `content` or the editor's initial content. */\n function makeText(type, content) {\n var text = TEXTS[type];\n var block = dom.element('div', {\n 'class': 'ge-content ge-content-type-' + type,\n 'data-ge-content-type': type,\n });\n\n if (content && content.nodeType) {\n block.appendChild(content);\n } else {\n dom.setHtml(block, content !== undefined ? content : (text && text.initialContent) || '');\n }\n return block;\n }\n\n /**\n * createText(type?, options?): a content area of a text editor's,\n * detached unless a placement is given. The type is the first one\n * offered by default. `options.content` is its html.\n */\n function apiCreateText(type, options) {\n if (type && typeof type === 'object') {\n options = type;\n type = undefined;\n }\n options = options || {};\n type = type || offeredTexts()[0];\n\n if (!type || !TEXTS[type]) {\n if (!warned['createText:' + type]) {\n warned['createText:' + type] = true;\n ge.warn('createText: no text editor \"' + type + '\" is loaded; ' +\n 'load its plugin and name it in content_types');\n }\n return null;\n }\n\n return ge.place(makeText(type, options.content), 'text', options);\n }\n\n /** Whether a content area is a text of one of the editors loaded here. */\n function isOurs(block) {\n return !!TEXTS[block.getAttribute('data-ge-content-type')];\n }\n\n /** Open the editor on a text, once: until it is closed again. */\n function startText(block) {\n if (dom.hasClass(block, 'ge-rte-active')) { return; }\n\n // A content area nobody can see - a tab that is not the open one,\n // a closed accordion item - has no geometry for an editor to lay\n // its toolbar out against, and nothing anyone can type into\n if (!dom.visible(block)) { return; }\n\n // The attribute: it is markup, and the drawer reads it the same way\n var text = TEXTS[block.getAttribute('data-ge-content-type')];\n if (!text) { return; }\n\n // Not marked active, so the next click tries again: the library\n // may be loaded by then\n if (text.available && !text.available()) {\n if (text.missingKey) { console.error(ge.t(text.missingKey)); }\n return;\n }\n\n readBefore.set(block, attributesOf(block));\n readReady.delete(block);\n dom.addClass(block, 'ge-rte-active');\n text.start([block]);\n }\n\n function onClick() {\n startText(this);\n }\n\n /**\n * Close the text editor on one content area, and leave the content\n * area's own attributes as the host left them.\n *\n * An editor adds attributes of its own while it is open, and takes\n * them off again, more or less: CKEditor leaves aria-readonly behind.\n * tinyMCE does worse, and puts back every attribute as it was when it\n * opened, so an id, a class or a plugin's attribute given while it was\n * open is lost. So the attributes are read three times - before the\n * editor opens, once it has opened, and before it closes - and what\n * changed between the second and the third, the host's doing, is\n * played back onto the first, the host's markup. What the editor did\n * is left out either way.\n */\n function closeText(block) {\n var text = TEXTS[block.getAttribute('data-ge-content-type')];\n var before = readBefore.get(block);\n var open = before ? attributesOf(block) : null;\n\n // Every content area is told: one whose editor never\n // started is the plugin's to ignore\n if (text) { text.stop([block]); }\n\n // After stop, not before: an editor that restores the class\n // attribute it snapshotted would put ge-rte-active back\n dom.removeClass(block, 'ge-rte-active');\n\n if (before) {\n restoreAttributes(block, before, readReady.get(block) || before, open);\n readBefore.delete(block);\n readReady.delete(block);\n }\n }\n\n function createTextControls(textBlock) {\n var block = dom.child(textBlock, '.ge-content');\n var type = block.getAttribute('data-ge-content-type');\n var drawer = dom.element('div', { 'class': 'ge-tools-drawer ge-text-drawer' });\n textBlock.insertBefore(drawer, textBlock.firstChild);\n\n ge.createMoveTool(drawer);\n\n var details = ge.addSettingsTool(drawer, block, settings.text_classes);\n\n // Which editor edits it, first in its settings: something to\n // know about it, not something to do with it\n var general = dom.child(details, '.ge-details-general');\n var editor = dom.element('div', { 'class': 'ge-field ge-text-editor' });\n editor.appendChild(dom.element('span', { 'class': 'ge-field-label' }, ge.t('panel.editor')));\n editor.appendChild(dom.element('span', { 'class': 'ge-field-value' }, textLabel(type)));\n general.insertBefore(editor, general.firstChild);\n\n settings.text_tools.forEach(function(hostTool) {\n ge.createTool(drawer, hostTool.title || '', hostTool.className || '',\n hostTool.iconClass || 'bi bi-wrench', hostTool.on);\n });\n\n ge.createTool(drawer, ge.t('tool.delete_text'), 'ge-delete-text', 'bi bi-trash', function() {\n ge.deleteNode('text', block, ge.t('confirm.delete_text'), function(removed) {\n // Its editor lets go first: removed while open, it would\n // be left behind, attached to nothing\n closeText(block);\n dom.slideUp(textBlock, function() {\n textBlock.remove();\n removed();\n });\n });\n });\n }\n\n /** A drawer for each text of ours in a text block that has none yet. */\n function markTexts() {\n dom.all(ge.canvas, '.ge-text-block').forEach(function(textBlock) {\n if (dom.child(textBlock, '.ge-tools-drawer')) { return; }\n\n var block = dom.child(textBlock, '.ge-content');\n if (!block || !isOurs(block)) { return; }\n\n createTextControls(textBlock);\n });\n }\n\n var texts = offeredTexts();\n var clicks = null; // The delegated click listener, while editing\n\n return {\n methods: {\n createText: apiCreateText,\n },\n\n /**\n * The types this plugin edits, for the core: every editor loaded\n * is the owner of its texts, and the ones offered are what the\n * host's plain content can be made.\n */\n textTypes: function() {\n var offered = offeredTexts();\n var others = Object.keys(TEXTS).filter(function(type) { return offered.indexOf(type) === -1; });\n\n return offered.concat(others).map(function(type) {\n var text = TEXTS[type];\n\n return {\n type: type,\n label: textLabel(type),\n offered: offered.indexOf(type) !== -1,\n available: text.available ? function() { return text.available(); } : null,\n missingKey: text.missingKey,\n edit: function(block) {\n var textBlock = block.parentElement;\n if (dom.hasClass(textBlock, 'ge-text-block') && !dom.child(textBlock, '.ge-tools-drawer')) {\n createTextControls(textBlock);\n }\n\n startText(block);\n },\n };\n });\n },\n\n // A text block of each editor offered. Like a container, it goes\n // into a row of its own when clicked, or where it is dropped\n toolbar: texts.map(function(type) {\n return {\n label: function() {\n return texts.length > 1 ? ge.t('text.add_type', { editor: textLabel(type) }) : ge.t('text.add');\n },\n iconClass: TEXTS[type].iconClass,\n className: 'ge-add-text-button',\n kind: 'text',\n inColumn: true,\n create: function() { return makeText(type); },\n };\n }),\n\n onInit: function() {\n markTexts();\n\n if (clicks) { ge.canvas.removeEventListener('click', clicks); }\n clicks = dom.delegate(ge.canvas, 'click', '.ge-content', onClick);\n },\n\n // While the drawers and the text blocks are still there, as the\n // editors left them\n onBeforeDeinit: function() {\n dom.all(ge.canvas, '.ge-content').forEach(function(block) {\n if (isOurs(block)) { closeText(block); }\n });\n },\n\n onDeinit: function() {\n if (clicks) { ge.canvas.removeEventListener('click', clicks); }\n clicks = null;\n },\n\n // The first time only: an undo says ready again, and by then the\n // host may have changed the content area itself\n onContentReady: function(area) {\n if (readBefore.has(area) && !readReady.has(area)) {\n readReady.set(area, attributesOf(area));\n }\n },\n };\n }\n\n // Whatever the plugins setting says: content_types chooses the editors\n textFeature.always = true;\n\n GridEditor.features.text = textFeature;\n\n}\n", "/**\n * tinyMCE for grid-editor's content areas.\n *\n * A text editor plugin: load this file after the editor, and tinyMCE 7\n * after or before it, and a text of the tinymce type is edited with an\n * inline tinyMCE. What it can ask the editor for is the handle its\n * factory is called with, described in docs/plugins.md.\n *\n * <script src=\"tinymce/tinymce.min.js\"></script>\n * <script src=\"dist/grideditor.min.js\"></script>\n * <script src=\"dist/plugins/grideditor.tinymce.min.js\"></script>\n *\n * It imports what every text editor shares - text blocks, the Text button,\n * createText, making the host's plain content a text - from\n * src/js/text/grideditor.text.js, which the build puts in its classic\n * script, installed once however many editors a page loads.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\nimport '../text/grideditor.text.js';\n\nObject.assign(GridEditor.locales.en, {\n 'text.tinymce': 'tinyMCE',\n});\n\n// tinyMCE snapshots the target element's attributes when an inline editor is\n// created and restores them on remove(), so this has to run *after* remove()\n// to keep the grid editor's own class and tinyMCE's leftovers off the element.\nfunction cleanUp(contentArea) {\n dom.removeClass(contentArea, 'active ge-rte-active');\n ['id', 'style', 'spellcheck', 'contenteditable', 'data-mce-style'].forEach(function(name) {\n contentArea.removeAttribute(name);\n });\n}\n\nvar INITIAL_CONTENT = '<p>Lorem ipsum dolores</p>';\n\n// What this file remembers about a content area: its editor, and whether a\n// deinit came before that editor was ready\nvar editors = new WeakMap();\nvar pendingRemove = new WeakSet();\n\nGridEditor.texts.tinymce = function(ge) {\n return {\n labelKey: 'text.tinymce',\n initialContent: INITIAL_CONTENT,\n missingKey: 'error.tinymce_missing',\n\n available: function() { return !!window.tinymce; },\n\n start: function(contentAreas) {\n var settings = ge.settings;\n var userConfig = (settings.tinymce && settings.tinymce.config) ? settings.tinymce.config : {};\n\n contentAreas.forEach(function(contentArea) {\n if (dom.hasClass(contentArea, 'active')) { return; }\n\n if (contentArea.innerHTML == INITIAL_CONTENT) {\n contentArea.innerHTML = '';\n }\n dom.addClass(contentArea, 'active');\n\n var configuration = Object.assign({\n // tinyMCE's own \"Upgrade\" badge in the menubar. Off by\n // default because an inline editor here is a column of\n // someone's page, not tinyMCE's own interface; a host that\n // wants it back passes promotion: true.\n promotion: false,\n }, userConfig, {\n target: contentArea,\n inline: true,\n init_instance_callback: function(editor) {\n // deinit ran before this init finished, so tear it down again\n if (pendingRemove.has(contentArea)) {\n pendingRemove.delete(contentArea);\n editor.remove();\n // deinit already ran and cannot clean up after this\n // late remove(), so do it here instead\n cleanUp(contentArea);\n return;\n }\n\n editors.set(contentArea, editor);\n\n // The editor rewrote what is inside this content area\n // while it took it over, so whatever the grid editor\n // had in there is gone. Saying so lets it put its own\n // furniture back.\n ge.textReady(contentArea);\n\n // Undo and redo rewrite it too, from snapshots that\n // leave out whatever is marked data-mce-bogus - an\n // element's drawer among them - so it goes back in\n // after each of those as well\n editor.on('Undo Redo', function() {\n ge.textReady(contentArea);\n });\n\n // The inline toolbar is laid out against the element's\n // geometry at the moment tinyMCE draws it, and an\n // element that has just appeared - a tab pane, an\n // accordion body, a column whose width is still\n // settling - may not have its own width yet. Asking\n // for the ui again once the browser has laid the frame\n // out measures it as it now is, instead of leaving a\n // toolbar wrapped into a narrow column.\n window.requestAnimationFrame(function() {\n if (editor.removed || !editor.ui || !editor.ui.show) { return; }\n\n editor.ui.show();\n });\n\n // And again whenever the user comes back to this\n // editor: by then the element may have been resized,\n // hidden and shown again - a tab switched away from\n // and back, a column made narrower - and the toolbar\n // is only ever as right as its last measurement.\n editor.on('focus', function() {\n window.requestAnimationFrame(function() {\n if (editor.removed || !editor.ui || !editor.ui.show) { return; }\n\n editor.ui.show();\n });\n });\n\n // Bring focus to text field\n editor.focus();\n\n // Call the original callback, if one was passed in the config\n if (userConfig.init_instance_callback) {\n userConfig.init_instance_callback.call(this, editor);\n }\n }\n });\n // We always edit the element we were handed, so a selector in the\n // user config would only fight with target\n delete configuration.selector;\n\n window.tinymce.init(configuration);\n });\n },\n\n stop: function(contentAreas) {\n contentAreas.filter(function(contentArea) {\n return dom.hasClass(contentArea, 'active');\n }).forEach(function(contentArea) {\n var editor = editors.get(contentArea);\n\n if (editor) {\n editors.delete(contentArea);\n editor.remove();\n } else {\n // tinymce.init() is asynchronous, so the editor may not exist\n // yet. Leave a note for init_instance_callback to remove it.\n pendingRemove.add(contentArea);\n }\n\n cleanUp(contentArea);\n });\n },\n };\n};\n"],
5
+ "mappings": "MASA,IAAIA,EAAa,OAAO,WAExB,GAAI,CAACA,GAAc,OAAOA,EAAW,KAAQ,WACzC,MAAM,IAAI,MAAM,wHAC0B,ECCvC,SAASC,EAAIC,EAAMC,EAAU,CAChC,OAAOD,EAAO,MAAM,UAAU,MAAM,KAAKA,EAAK,iBAAiBC,CAAQ,CAAC,EAAI,CAAC,CACjF,CAiBO,SAASC,EAASC,EAAMC,EAAU,CACrC,OAAKD,EAEE,MAAM,UAAU,OAAO,KAAKA,EAAK,SAAU,SAASE,EAAM,CAC7D,MAAO,CAACD,GAAYC,EAAK,QAAQD,CAAQ,CAC7C,CAAC,EAJmB,CAAC,CAKzB,CAGO,SAASE,EAAMH,EAAMC,EAAU,CAClC,OAAOF,EAASC,EAAMC,CAAQ,EAAE,CAAC,GAAK,IAC1C,CAGO,SAASG,EAAQJ,EAAMC,EAAUI,EAAQ,CAC5C,IAAIC,EAAQN,GAAQA,EAAK,WAAa,EAAIA,EAAK,QAAQC,CAAQ,EAAI,KAEnE,OAAIK,GAASD,GAAUC,IAAUD,GAAU,CAACA,EAAO,SAASC,CAAK,EAAY,KACtEA,CACX,CAqDO,SAASC,EAAQC,EAAKC,EAAYC,EAAM,CAC3C,IAAIC,EAAO,SAAS,cAAcH,CAAG,EAErC,cAAO,KAAKC,GAAc,CAAC,CAAC,EAAE,QAAQ,SAASG,EAAM,CACjD,IAAIC,EAAQJ,EAAWG,CAAI,EACvBC,GAAU,MAA+BA,IAAU,IAASF,EAAK,aAAaC,EA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AAIL,CAAW,EAAG,CAChCK,EAAc,OAAOL,CAAW,EAChCa,EAAO,OAAO,EAGdd,EAAQC,CAAW,EACnB,MACJ,CAEAI,EAAQ,IAAIJ,EAAaa,CAAM,EAM/BP,EAAG,UAAUN,CAAW,EAMxBa,EAAO,GAAG,YAAa,UAAW,CAC9BP,EAAG,UAAUN,CAAW,CAC5B,CAAC,EAUD,OAAO,sBAAsB,UAAW,CAChCa,EAAO,SAAW,CAACA,EAAO,IAAM,CAACA,EAAO,GAAG,MAE/CA,EAAO,GAAG,KAAK,CACnB,CAAC,EAODA,EAAO,GAAG,QAAS,UAAW,CAC1B,OAAO,sBAAsB,UAAW,CAChCA,EAAO,SAAW,CAACA,EAAO,IAAM,CAACA,EAAO,GAAG,MAE/CA,EAAO,GAAG,KAAK,CACnB,CAAC,CACL,CAAC,EAGDA,EAAO,MAAM,EAGTJ,EAAW,wBACXA,EAAW,uBAAuB,KAAK,KAAMI,CAAM,CAE3D,CACJ,CAAC,EAGD,OAAOD,EAAc,SAErB,OAAO,QAAQ,KAAKA,CAAa,EACrC,CAAC,CACL,EAEA,KAAM,SAASL,EAAc,CACzBA,EAAa,OAAO,SAASP,EAAa,CACtC,OAAWU,EAASV,EAAa,QAAQ,CAC7C,CAAC,EAAE,QAAQ,SAASA,EAAa,CAC7B,IAAIa,EAAST,EAAQ,IAAIJ,CAAW,EAEhCa,GACAT,EAAQ,OAAOJ,CAAW,EAC1Ba,EAAO,OAAO,GAIdR,EAAc,IAAIL,CAAW,EAGjCD,EAAQC,CAAW,CACvB,CAAC,CACL,CACJ,CACJ",
6
+ "names": ["GridEditor", "all", "root", "selector", "children", "node", "selector", "each", "child", "closest", "stopAt", "found", "element", "tag", "attributes", "text", "node", "name", "value", "setHtml", "html", "addClass", "names", "split", "removeClass", "hasClass", "node", "name", "split", "names", "hide", "node", "visible", "node", "delegate", "root", "types", "selector", "handler", "options", "listener", "event", "match", "closest", "split", "type", "DEFAULT_DURATION", "animateAway", "node", "frames", "duration", "done", "finish", "hide", "visible", "animation", "called", "once", "slideUp", "style", "GridEditor", "attributesOf", "element", "found", "attribute", "classesIn", "value", "name", "EDITOR_CLASS", "restoreAttributes", "block", "before", "ready", "open", "result", "EDITOR_ATTRIBUTE", "readyClasses", "openClasses", "classes", "textFeature", "ge", "settings", "TEXTS", "warned", "type", "offeredTexts", "textLabel", "text", "makeText", "content", "setHtml", "apiCreateText", "options", "isOurs", "startText", "hasClass", "visible", "readBefore", "readReady", "addClass", "onClick", "closeText", "removeClass", "createTextControls", "textBlock", "child", "drawer", "details", "general", "editor", "hostTool", "removed", "slideUp", "markTexts", "all", "texts", "clicks", "offered", "others", "delegate", "area", "GridEditor", "cleanUp", "contentArea", "removeClass", "name", "INITIAL_CONTENT", "editors", "pendingRemove", "ge", "contentAreas", "settings", "userConfig", "hasClass", "addClass", "configuration", "editor"]
7
7
  }
package/docs/events.md CHANGED
@@ -38,11 +38,10 @@ listener and every callback hears each notification, whatever the ones before
38
38
  it did.
39
39
 
40
40
  A listener that throws is the browser's to report, as any listener's error
41
- is: the other listeners, the callbacks and the operation go on. Up to 6.x an
42
- error thrown in a jQuery handler stopped the operation where it was.
41
+ is: the other listeners, the callbacks and the operation go on.
43
42
 
44
- The payload's nodes are elements. Up to 6.x they were jQuery objects, and
45
- they still are for a page that loads `grideditor.jquery.js`: through the
43
+ The payload's nodes are elements. They are jQuery objects for a page that
44
+ loads `grideditor.jquery.js`: through the
46
45
  adapter, a jQuery listener - bound on the canvas or delegated from an
47
46
  ancestor - runs once per notification with `(event, payload)`, the payload's
48
47
  nodes wrapped, and `preventDefault()` on its event cancels as before. The
@@ -168,8 +167,7 @@ the clipboard plugin put in, from a paste tool or the toolbar. A paste is an add
168
167
  like any other, so canceling its `before-add-*` turns it away.
169
168
 
170
169
  A text block is `kind: 'text'`, with its content area as the node, when it is
171
- added, deleted or moved, and in `drawerTools`. Up to 5.x a content area
172
- dragged between columns was `kind: 'content'`. The host's plain content - a
170
+ added, deleted or moved, and in `drawerTools`. The host's plain content - a
173
171
  content area with no text type on it - is `kind: 'plain'` when it is deleted,
174
172
  moved or converted; the convert pair's `source` is `tool`, and canceling
175
173
  `before-convert` leaves it plain, with no editor opened. The kinds for containers are
@@ -96,6 +96,23 @@ The containers: tabs, accordions and popups, and the panes inside them.
96
96
  | `container.add_tabs` | Tabs | Toolbar button that adds a tabs container |
97
97
  | `container.add_tab` | Add tab | Container drawer, adds a pane |
98
98
  | `container.tab_label` | Tab {number} | Label of a new tab. `{number}` is its position |
99
+ | `container.tabs_section` | Tabs | The tabs container's section of its settings panel |
100
+ | `container.tabs_style` | Style | Its strip's style select |
101
+ | `container.tabs_style_tabs` | Tabs | Its choice for `nav-tabs` |
102
+ | `container.tabs_style_pills` | Pills | Its choice for `nav-pills` |
103
+ | `container.tabs_style_underline` | Underline | Its choice for `nav-underline` |
104
+ | `container.tabs_width` | Width | The strip's width select |
105
+ | `container.tabs_width_natural` | Natural | Its choice for no width class |
106
+ | `container.tabs_width_fill` | Fill | Its choice for `nav-fill` |
107
+ | `container.tabs_width_justified` | Justified | Its choice for `nav-justified` |
108
+ | `container.tabs_align` | Alignment | The strip's alignment select, with the natural width and horizontal only |
109
+ | `container.tabs_align_start` | Start | Its choice for no alignment class |
110
+ | `container.tabs_align_center` | Center | Its choice for `justify-content-center` |
111
+ | `container.tabs_align_end` | End | Its choice for `justify-content-end` |
112
+ | `container.tabs_layout` | Layout | The container's layout select |
113
+ | `container.tabs_layout_horizontal` | Horizontal | Its choice for the strip above the panes |
114
+ | `container.tabs_layout_vertical` | Vertical | Its choice for the strip beside the panes at every size: `d-flex`, `flex-column` |
115
+ | `container.tabs_layout_vertical_from` | Vertical from {breakpoint} | Its choices for vertical from a breakpoint up, `d-{bp}-flex`, `flex-{bp}-column`. `{breakpoint}` is its key, `md` |
99
116
  | `container.add_accordion` | Accordion | Toolbar button that adds an accordion |
100
117
  | `container.add_accordion_item` | Add item | Container drawer, adds an item |
101
118
  | `container.accordion_label` | Item {number} | Label of a new accordion item |
@@ -133,7 +150,7 @@ editor's label, one of the `text.<type>` keys below or, for a plugin with no
133
150
  label, its type.
134
151
 
135
152
  The keys a text needs once an editor is loaded - `text.add`, `text.add_type`,
136
- `panel.editor` and `panel.kind_text` - are the text editor plugins' since 6.0, and come with any of them. The rest
153
+ `panel.editor` and `panel.kind_text` - are the text editor plugins', and come with any of them. The rest
137
154
  are the main bundle's: what the editor shows with no text editor loaded.
138
155
 
139
156
  | Key | English | Where |
@@ -223,9 +240,7 @@ utility.*
223
240
 
224
241
  The Responsive section of a settings panel, which the utility plugins fill,
225
242
  and the per breakpoint fields of the style plugin's sections. The labels of
226
- each utility and its values are the plugins' own keys. The spacing,
227
- textalign, visibility and float fields were plugins of their own up to 7.2,
228
- and are the style plugin's now.
243
+ each utility and its values are the plugins' own keys.
229
244
 
230
245
  | Key | English | Where |
231
246
  | --- | --- | --- |
@@ -238,19 +253,16 @@ and are the style plugin's now.
238
253
  | `utility.default` | Default | The empty choice of a field when nothing below the view sets the utility, and always in the all view |
239
254
  | `utility.inherit` | Inherit: {value} (from {breakpoint}) | The empty choice in a breakpoint view when a smaller breakpoint sets the utility. `{breakpoint}` is its key, `sm` |
240
255
  | `utility.varies` | Changes at {breakpoints}; choosing here replaces that | Note under a field in the all view when breakpoints set their own value. `{breakpoints}` is a list of keys |
241
- | `utility.visibility` | Visibility | Label of the visibility field, in the style plugin's Display section |
256
+ | `utility.display` | Display | Label of the display field, `d-*`, in the style plugin's Display section. Its other choices are the values themselves |
242
257
  | `utility.visibility_hidden` | Hidden | Its choice for `d-*-none` |
243
- | `utility.visibility_shown` | Shown | Its choice for `d-*-block`, or `d-*-flex` on a row |
244
- | `tool.hide_in_view` | Hide in this view | The style plugin's visibility eye, on a node shown in the view being edited |
258
+ | `tool.hide_in_view` | Hide in this view | The style plugin's eye, on a node shown in the view being edited |
245
259
  | `tool.show_in_view` | Show in this view | The same eye, on a node hidden there |
246
260
  | `utility.order` | Order | Label of the order plugin's field |
247
261
  | `utility.order_first` | First | Its choice for `order-*-first` |
248
262
  | `utility.order_last` | Last | Its choice for `order-*-last` |
249
263
  | `tool.order_earlier` | Earlier in this view | The order plugin's left arrow in a column drawer |
250
264
  | `tool.order_later` | Later in this view | Its right arrow |
251
- | `utility.justify_content` | Justify columns | The alignment plugin's `justify-content-*` field, on a row |
252
- | `utility.align_items` | Align columns | Its `align-items-*` field, on a row |
253
- | `utility.align_self` | Align self | Its `align-self-*` field, on a column |
265
+ | `utility.align_self` | Align self | The alignment plugin's `align-self-*` field, on a column |
254
266
  | `utility.gutters` | Gutters | The gutters plugin's `g-*` field, on a row |
255
267
  | `utility.gutters_x` | Horizontal gutters | Its `gx-*` field |
256
268
  | `utility.gutters_y` | Vertical gutters | Its `gy-*` field |
@@ -267,6 +279,18 @@ and are the style plugin's now.
267
279
  | `utility.text_start` | Start | Its choice for `text-*-start` |
268
280
  | `utility.text_center` | Center | Its choice for `text-*-center` |
269
281
  | `utility.text_end` | End | Its choice for `text-*-end` |
282
+ | `utility.flex_direction` | Direction | The `flex-*-row` / `-column` field, in the style plugin's Flex section |
283
+ | `utility.flex_wrap` | Wrap | Its `flex-*-wrap` / `-nowrap` field |
284
+ | `utility.justify_content` | Justify columns | Its `justify-content-*` field |
285
+ | `utility.align_items` | Align columns | Its `align-items-*` field |
286
+ | `utility.align_content` | Align lines | Its `align-content-*` field |
287
+ | `utility.gap` | Gap | Its `gap-*` field, on anything but a row |
288
+ | `utility.row_gap` | Row gap | Its `row-gap-*` field |
289
+ | `utility.column_gap` | Column gap | Its `column-gap-*` field |
290
+ | `utility.flex_fill` | Fill | Its `flex-*-fill` field, on anything but a row |
291
+ | `utility.flex_grow` | Grow | Its `flex-*-grow-*` field |
292
+ | `utility.flex_shrink` | Shrink | Its `flex-*-shrink-*` field |
293
+ | `utility.sticky` | Sticky | The `sticky-*-top` / `-bottom` field, in the style plugin's Position section |
270
294
  | `utility.float` | Float | Label of the float field, in the style plugin's Position section, on an element |
271
295
  | `utility.float_start` | Start | Its choice for `float-*-start` |
272
296
  | `utility.float_end` | End | Its choice for `float-*-end` |
@@ -290,6 +314,7 @@ The style plugin's accordion, in a node's settings panel or in the dialog.
290
314
  | `style.section_text` | Text | The accordion's section header |
291
315
  | `style.section_typography` | Typography | The accordion's section header |
292
316
  | `style.section_display` | Display | The accordion's section header |
317
+ | `style.section_flex` | Flex | The accordion's section header |
293
318
  | `style.section_position` | Position | The accordion's section header |
294
319
  | `style.section_custom` | Custom css | The accordion's section header |
295
320
  | `style.all_sizes` | Applies to every size | Note over a section's inline fields in a breakpoint view: the style attribute is not responsive |
@@ -373,13 +398,10 @@ all the same: the developer reading them is the one who chose the locale.
373
398
  | Key | English | Where |
374
399
  | --- | --- | --- |
375
400
  | `error.sortable_missing` | SortableJS not available! … | Logged once when the drag library is not on the page |
376
- | `warning.setting_removed` | The {setting} setting was removed in 4.0. Use {replacement} instead. | Logged once per removed setting a host still passes |
377
401
  | `warning.already_editing` | This element already has an editor: … | An editor asked for on an element that has one; the one it has is handed back |
378
402
  | `warning.destroyed` | {method}() was called on an editor that has been destroyed, … | Logged once per method called on a destroyed editor |
379
403
  | `warning.duplicate_build` | grideditor.js was loaded twice: … | A second copy of the classic script, which keeps the first `GridEditor` |
380
- | `warning.plugin_6x` | The "{name}" plugin is written for grid-editor 6 … | `grideditor.jquery.js`: a plugin registered on `$.fn.gridEditor.*`, which is left out |
381
404
  | `warning.adapter_no_jquery` | grideditor.jquery.js needs jQuery 4, … | `grideditor.jquery.js` loaded on a page with no jQuery |
382
- | `warning.oninit_removed` | tinyMCE's oninit option was removed in 7.0 … | A `tinymce.config` that still has `oninit`; `init_instance_callback` is called |
383
405
  | `error.tinymce_missing` | tinyMCE not available! … | `content_types: ['tinymce']` with no tinyMCE loaded |
384
406
  | `error.ckeditor_missing` | CKEditor 5 not available! … | `content_types: ['ckeditor']` with no CKEditor 5 loaded, CKEditor 4 included |
385
407
  | `error.ckeditor_start` | CKEditor could not start: {message} | `InlineEditor.create` failed: most likely no `licenseKey` in `ckeditor.config` |
package/docs/plugins.md CHANGED
@@ -92,10 +92,10 @@ A page or an app imports it for that side effect, after the editor:
92
92
  editors made after a plugin registered have it.
93
93
 
94
94
  Everything the editor hands a plugin, and everything a plugin hands back, is
95
- DOM: elements, and arrays of them where there may be several. Up to 6.x it was
96
- jQuery objects; a plugin written for 6.x is ported by taking that out, and
97
- [UPGRADING.md](../UPGRADING.md) says how. The shipped plugins are written in
98
- plain DOM, and a plugin of your own is free to use whatever it likes.
95
+ DOM: elements, and arrays of them where there may be several. The shipped
96
+ plugins are written in plain DOM, and a plugin of your own is free to use
97
+ whatever it likes. [UPGRADING.md](../UPGRADING.md) says how to port a plugin
98
+ written for 6.x.
99
99
 
100
100
  - **`iconClass`**, when given, is the toolbar button's face: the icon alone,
101
101
  with the label as its title. Without one the button shows a plus and the
@@ -118,9 +118,8 @@ The handle
118
118
 
119
119
  Everything a plugin needs from the editor comes through the handle its factory
120
120
  is called with. It is the plugin contract: these names, and what they do, do
121
- not change without a major version. 7.0 was one: every node it takes or gives
122
- is an element, and where 6.x gave a jQuery set that may hold several, an
123
- array.
121
+ not change without a major version. Every node it takes or gives is an
122
+ element, and where there may be several, an array.
124
123
 
125
124
  | | |
126
125
  | --- | --- |
@@ -243,7 +242,7 @@ so `ge.detailsOf(node)` finds what is in it.
243
242
  A field made with `ge.utilityField` in a section follows the view and the
244
243
  classes field as the Responsive section's do, wherever the section is at the
245
244
  time. The style plugin's accordion is a section, and what the spacing,
246
- textalign, visibility and float fields are in: its families are
245
+ textalign, display, flex, sticky and float fields are in: its families are
247
246
  `panel: false`, and it makes their fields itself.
248
247
 
249
248
  A section that writes css should write it with `ge.setHostStyle` and read it
@@ -251,20 +250,6 @@ with `ge.hostStyle`: in a breakpoint view the node's `style` holds the
251
250
  preview's `!important` values too, and they come off on `deinit` with
252
251
  whatever was written under them.
253
252
 
254
- ### A plugin that takes the place of others
255
-
256
- A factory with **`replaces: ['old', …]`** on it - the function, not what it
257
- returns, since it is read before any factory is called - stands in for those
258
- plugins. Loaded beside it, they stand down, with a warning, and none of their
259
- families is declared twice; an old name in the `plugins` setting asks for it,
260
- with a warning that the name is deprecated. This is how the style plugin
261
- takes the spacing, textalign, visibility and float plugins' place:
262
-
263
- ```javascript
264
- GridEditor.utilities.style = function(ge) { … };
265
- GridEditor.utilities.style.replaces = ['spacing', 'textalign', 'visibility', 'float'];
266
- ```
267
-
268
253
  ### Settings of your own, saved on the node
269
254
 
270
255
  A tool that opens a dialog and saves what the user chose on the node is a
@@ -278,11 +263,9 @@ animation for rows, columns, containers and elements, kept in a
278
263
  - **The dialog lives outside the canvas**, appended to `body`, so it is never
279
264
  part of the markup.
280
265
  - **Nothing else.** A plain `attr()` on any node. An element is never inside a
281
- text editor since 6.0, and a text's own attributes, given while its editor
282
- is open, are kept by grid-editor when the editor closes - tinyMCE would put
283
- back the ones it found when it opened. Up to 5.x an element sat inside the
284
- text, and an attribute written behind the editor's back was lost to its
285
- undo.
266
+ text editor, and a text's own attributes, given while its editor is open,
267
+ are kept by grid-editor when the editor closes - tinyMCE would put back the
268
+ ones it found when it opened.
286
269
 
287
270
  A node's drawer is built again on every `init`, so a tool reads the node
288
271
  rather than remembering anything about it.
@@ -440,11 +423,7 @@ editor, and `onBeforeDeinit` to close it.
440
423
  on the browser's `contenteditable`, on a page that loads none of the shipped
441
424
  editors.
442
425
 
443
- Up to 5.x an editor of a host's own registered under
444
- `$.fn.gridEditor.RTEs`, and in 5.x and the 6.0 betas under
445
- `$.fn.gridEditor.texts`. 6.0 ignored the first, with a warning, and 7.0 has
446
- neither: `GridEditor.texts` is the shipped editors' own registry, not a
447
- contract.
426
+ `GridEditor.texts` is the shipped editors' own registry, not a contract.
448
427
 
449
428
 
450
429
  Utility plugins
@@ -518,8 +497,9 @@ tool does not belong. A tool writes with `ge.setUtility(node, family, value,
518
497
  `onRefresh(scope)` runs whenever the preview is redrawn — on `init`, on a view
519
498
  change, after a write, after the user types in a classes field — with the node
520
499
  whose utilities changed, or the canvas. It is for what a plugin marks the canvas
521
- with beyond inline styles: the style plugin's visibility keeps hidden nodes on the
522
- canvas and fades them there. Whatever it adds, `onDeinit` takes away.
500
+ with beyond inline styles: the style plugin's display keeps hidden nodes on the
501
+ canvas and fades them there, and takes the drawer of a flex node out of the
502
+ flow. Whatever it adds, `onDeinit` takes away.
523
503
 
524
504
  ### A panel of your own
525
505
 
@@ -554,5 +534,5 @@ Plugin options live in the `utilities` setting, under the plugin's name:
554
534
  `utilities: { gutters: { scale: [...] } }`. The editor passes the
555
535
  setting through as it is; each plugin fills in its own defaults. The style
556
536
  plugin's are the `style` setting, since most of them are about its inline
557
- css; `utilities.spacing` and `utilities.visibility` are read there until 8.0.
537
+ css.
558
538
 
@@ -35,11 +35,6 @@
35
35
  // CKEditor 5 is GPL-2.0-or-later: 'GPL' accepts that
36
36
  // licence. A commercial licence passes its own key.
37
37
  licenseKey: 'GPL',
38
- on: {
39
- instanceReady: function(evt) {
40
- console.log('instance ready', evt.editor);
41
- }
42
- }
43
38
  }
44
39
  }
45
40
  });