91ded026 by acetousk

Upgrade grapesjs

1 parent 3fcb0754
......@@ -21,7 +21,7 @@ along with this software (see the LICENSE.md file). If not, see
<moqui.screen.ScreenThemeResource screenThemeId="MJML_DEFAULT" sequenceNum="52" resourceTypeEnumId="STRT_STYLESHEET" resourceValue="/mjmlstatic/css/grapesjs-mjml.css"/>
<delete-moqui.screen.ScreenThemeResource screenThemeId="MJML_DEFAULT" sequenceNum="10" resourceTypeEnumId="STRT_SCRIPT" resourceValue="/js/MoquiLib.js"/>
<moqui.screen.ScreenThemeResource screenThemeId="MJML_DEFAULT" sequenceNum="51" resourceTypeEnumId="STRT_SCRIPT" resourceValue="/mjmlstatic/js/grapesjs.min.js"/>
<moqui.screen.ScreenThemeResource screenThemeId="MJML_DEFAULT" sequenceNum="51" resourceTypeEnumId="STRT_SCRIPT" resourceValue="/mjmlstatic/js/grapes.min.js"/>
<moqui.screen.ScreenThemeResource screenThemeId="MJML_DEFAULT" sequenceNum="52" resourceTypeEnumId="STRT_SCRIPT" resourceValue="/mjmlstatic/js/grapesjs-mjml.min.js"/>
<!-- <moqui.screen.ScreenThemeResource screenThemeId="MJML_DEFAULT" sequenceNum="100" resourceTypeEnumId="STRT_HEADER_LOGO"-->
......
......@@ -178,7 +178,7 @@ along with this software (see the LICENSE.md file). If not, see
<script type="text/javascript">
// Wait for the plugin to be injected by the dev server
window.onload = () => {
const resourceId = new URLSearchParams(window.location.search).get('resourceId');
let resourceId = new URLSearchParams(window.location.search).get('resourceId');
window.editor = grapesjs.init({
// projectData: {
......@@ -216,11 +216,13 @@ along with this software (see the LICENSE.md file). If not, see
// project data from the response result.
onStore: data => {
console.log('onStore', ({ id: resourceId, data }))
console.log('resourceId', resourceId)
console.log('onStore resourceId', resourceId)
console.log('onStore editor', editor)
console.log('onStore this ', this)
// const url = new URL(window.location.href)
// url.searchParams.set('resourceId', resourceId);
// window.history.pushState({}, '', url)
return { id: resourceId, data }
return { resourceId: resourceId, data }
},
onLoad: result => {
const url = new URL(window.location.href)
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
......@@ -30,6 +30,7 @@ along with this software (see the LICENSE.md file). If not, see
<if condition="!resourceId">
<then>
<return error="true" message="Resource not found"/>
<set field="grapesJsResource" from="ec.resource.getLocationReference('dbresource://grapesjs/project')"/>
<service-call name="create#moqui.resource.DbResource" in-map="[parentResourceId:grapesJsResource.getDbResourceId(),isFile:'Y']" out-map="dbResource"/>
<service-call name="update#moqui.resource.DbResource" in-map="[resourceId:dbResource.resourceId,filename:dbResource.resourceId]" out-map="dbResource"/>
......@@ -39,6 +40,7 @@ along with this software (see the LICENSE.md file). If not, see
<service-call name="create#moqui.resource.DbResourceFile" in-map="[resourceId: dbResource.resourceId,mimeType: 'text/json',versionName: versionName,rootVersionName: versionName,fileData:data]"/>
<service-call name="create#moqui.resource.DbResourceFileHistory" in-map="[resourceId: dbResource.resourceId,versionDate: ec.user.nowTimestamp,userId: ec.user.userId,isDiff: 'N']"/>
<set field="resourceId" from="dbResource.resourceId"/>
</then>
<else>
<entity-find-one entity-name="moqui.resource.DbResource" value-field="dbResource" auto-field-map="[resourceId:resourceId]"/>
......