From 5ef177ea39fb85fc5a7ba02539608243f3e563e0 Mon Sep 17 00:00:00 2001 From: Paul Spenke Date: Sun, 2 Jul 2023 21:31:38 +0800 Subject: [PATCH] origin commit 63d49fe --- plugi-core/dist/PageBuilderBody.js | 2 +- plugi-core/dist/PageBuilderBody.umd.cjs | 2 +- .../GrapesJS/resources/assets/js/manage-editable-components.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugi-core/dist/PageBuilderBody.js b/plugi-core/dist/PageBuilderBody.js index 8fe8d35..16ad7a3 100644 --- a/plugi-core/dist/PageBuilderBody.js +++ b/plugi-core/dist/PageBuilderBody.js @@ -384,7 +384,7 @@ function J(t) { function p(t) { let e = !1; t.getClasses().forEach((i) => { - i.startsWith("ID") && i.length === 16 && (e = i); + i.startsWith("ID") && i.length >= 16 && (e = i); }), t.attributes["style-identifier"] === void 0 && (t.attributes["style-identifier"] = e || D()), t.addClass(t.attributes["style-identifier"]); } function j(t) { diff --git a/plugi-core/dist/PageBuilderBody.umd.cjs b/plugi-core/dist/PageBuilderBody.umd.cjs index 342f698..14a312f 100644 --- a/plugi-core/dist/PageBuilderBody.umd.cjs +++ b/plugi-core/dist/PageBuilderBody.umd.cjs @@ -1 +1 @@ -(function(d){typeof define=="function"&&define.amd?define(d):d()})(function(){"use strict";$(".gjs-editor").append($("#toggle-sidebar")),$(".gjs-pn-panels").prepend($("#sidebar-header")),$(".gjs-pn-panels").append($("#sidebar-bottom-buttons")),$("#toggle-sidebar").click(function(){$("#gjs").toggleClass("sidebar-collapsed"),m()}),d(),window.editor.on("run:open-sm",function(t){$(".gjs-trt-traits").parent().parent().css("display","none"),$(".gjs-sm-sectors").parent().parent().css("display","block"),$("#gjs-sm-advanced .gjs-sm-properties").append($(".gjs-clm-tags"))}),window.editor.on("run:open-tm",function(t){$(".gjs-sm-sectors").parent().parent().css("display","none"),$(".gjs-trt-traits").parent().parent().css("display","block")}),window.editor.on("block:drag:start",function(t){d()}),window.editor.on("rteToolbarPosUpdate",function(t){!window.editor||!window.editor.getSelected()||!window.editor.getSelected().getEl()||setTimeout(function(){let i=$(".gjs-rte-toolbar").first();if(i.offset().top0&&i.css("top",s+"px")}},0)});function d(){$(window).width()<1e3&&($("#gjs").addClass("sidebar-collapsed"),m())}function m(){window.editor.trigger("change:canvasOffset canvasScroll")}let b=!1;$(document).keydown(function(t){t.which===8&&(b=!0)}).keyup(function(t){t.which===8&&(b=!1)}),$(window).on("beforeunload",function(t){b&&t.preventDefault()});function _(){$(".gjs-blocks-cs").prepend($("#block-search"))}window.addEventListener("message",A,!1);function A(t){t.data==="page-loaded"?($("#phpb-loading").addClass("loaded"),_(),window.isLoaded=!0,$(window).trigger("pagebuilder-page-loaded")):t.data==="touch-start"&&window.touchStart()}$(document).on("input","#block-search input",function(){let t=$(this).val().toLowerCase();$(".gjs-block-category").each(function(){let e=!1;$(this).find(".gjs-block").each(function(){$(this).data("original-html")||$(this).data("original-html",$(this).html());let i=$(this).text();if(i.toLowerCase().includes(t)){$(this).removeClass("d-none"),e=!0;let n=new RegExp("("+t+")","gi"),s=i.replace(n,"$1");$(this).find(".gjs-block-label").html($(this).data("original-html").replace(i.trim(),s))}else $(this).addClass("d-none")}),$(this).removeClass("d-none"),e||$(this).addClass("d-none")})}),window.customBuilderScripts={},window.editor.on("component:create",t=>{if(t.components().length){let e=t.components().models[t.components().length-1];if(e.attributes.type==="script"){let i=t.attributes.attributes["block-id"];i===void 0&&(i=t.attributes.attributes.id);let n=e,s=!1;for(;n.parent();)if(n=n.parent(),n.attributes.attributes["phpb-content-container"]){s=!0;break}s&&(window.customBuilderScripts[i]=e.toHTML(),e.remove())}}}),window.editor.on("component:add",function(t){if(t.attributes["run-builder-script"]!==void 0){let e=customBuilderScripts;window.customBuilderScripts[t.attributes["block-id"]]=customBuilderScripts[t.attributes["run-builder-script"]],runScriptsOfComponentAndChildren(t),window.customBuilderScripts=e,delete t.attributes["run-builder-script"]}}),window.editor.on("sorter:drag:end",function(t){let e=t.modelToDrop;e&&e.attributes&&(e.attributes["block-id"]||e.attributes.id)&&window.runScriptsOfComponentAndChildren(e);for(let i in CKEDITOR.instances)CKEDITOR.instances[i].destroy(!0)}),window.runScriptsOfComponentAndChildren=function(t){V(t),t.components().each(function(e){runScriptsOfComponentAndChildren(e)})};function V(t){let e=t.attributes["block-id"];if(e===void 0&&(e=t.attributes.attributes.id),e&&window.customBuilderScripts[e]!==void 0){let i=t.attributes["style-identifier"],n=$("").append(window.customBuilderScripts[e]);n.find("script").prepend("let inPageBuilder = true;"),n.find("script").prepend('let blockSelector = ".'+i+'";'),n.find("script").prepend('let block = document.getElementsByClassName("'+i+'")[0];'),n.find("script").prepend("(function(){"),n.find("script").append("})();");let s=document.createElement("script");s.type="text/javascript",s.innerHTML=n.find("script").html(),window.editor.Canvas.getDocument().body.appendChild(s)}}function H(){R();let t=document.createElement("script");t.type="text/javascript",t.src=window.injectionScriptUrl;let e=t.outerHTML+"