diff --git a/core-web/libs/sdk/angular/package.json b/core-web/libs/sdk/angular/package.json index f14414418401..49dd4ea45040 100644 --- a/core-web/libs/sdk/angular/package.json +++ b/core-web/libs/sdk/angular/package.json @@ -1,11 +1,11 @@ { "name": "@dotcms/angular", - "version": "0.0.1-alpha.30", + "version": "0.0.1-alpha.31", "peerDependencies": { "@angular/common": "^17.1.0", "@angular/core": "^17.1.0", "@angular/router": "^17.1.0", - "@dotcms/client": "0.0.1-alpha.30", + "@dotcms/client": "0.0.1-alpha.31", "@tinymce/tinymce-angular": "^8.0.0", "rxjs": "^7.8.0" }, diff --git a/core-web/libs/sdk/client/package.json b/core-web/libs/sdk/client/package.json index 57af4e9f3af2..9a8c56e50ee7 100644 --- a/core-web/libs/sdk/client/package.json +++ b/core-web/libs/sdk/client/package.json @@ -1,6 +1,6 @@ { "name": "@dotcms/client", - "version": "0.0.1-alpha.30", + "version": "0.0.1-alpha.31", "type": "module", "description": "Official JavaScript library for interacting with DotCMS REST APIs.", "repository": { diff --git a/core-web/libs/sdk/experiments/package.json b/core-web/libs/sdk/experiments/package.json index 3c846b220109..e2429154a078 100644 --- a/core-web/libs/sdk/experiments/package.json +++ b/core-web/libs/sdk/experiments/package.json @@ -1,6 +1,6 @@ { "name": "@dotcms/experiments", - "version": "0.0.1-alpha.30", + "version": "0.0.1-alpha.31", "description": "Official JavaScript library to use Experiments with DotCMS.", "repository": { "type": "git", @@ -25,6 +25,6 @@ "peerDependencies": { "react": ">=18", "react-dom": ">=18", - "@dotcms/client": "0.0.1-alpha.30" + "@dotcms/client": "0.0.1-alpha.31" } } diff --git a/core-web/libs/sdk/react/package.json b/core-web/libs/sdk/react/package.json index 892a512110b7..64ce599625a9 100644 --- a/core-web/libs/sdk/react/package.json +++ b/core-web/libs/sdk/react/package.json @@ -1,10 +1,10 @@ { "name": "@dotcms/react", - "version": "0.0.1-alpha.30", + "version": "0.0.1-alpha.31", "peerDependencies": { "react": ">=18", "react-dom": ">=18", - "@dotcms/client": "0.0.1-alpha.30" + "@dotcms/client": "0.0.1-alpha.31" }, "description": "Official React Components library to render a dotCMS page.", "repository": { diff --git a/dotCMS/src/main/webapp/html/js/editor-js/sdk-editor.js b/dotCMS/src/main/webapp/html/js/editor-js/sdk-editor.js index 0357eafa4c49..b91791756786 100644 --- a/dotCMS/src/main/webapp/html/js/editor-js/sdk-editor.js +++ b/dotCMS/src/main/webapp/html/js/editor-js/sdk-editor.js @@ -1 +1 @@ -function r(t){window.parent.postMessage(t,"*")}function E(t){return t.map(n=>{let e=n.getBoundingClientRect(),o=Array.from(n.querySelectorAll('[data-dot-object="contentlet"]'));return{x:e.x,y:e.y,width:e.width,height:e.height,payload:JSON.stringify({container:p(n)}),contentlets:C(e,o)}})}function C(t,n){return n.map(e=>{let o=e.getBoundingClientRect();return{x:0,y:o.y-t.y,width:o.width,height:o.height,payload:JSON.stringify({container:e.dataset?.dotContainer?JSON.parse(e.dataset?.dotContainer):a(e),contentlet:{identifier:e.dataset?.dotIdentifier,title:e.dataset?.dotTitle,inode:e.dataset?.dotInode,contentType:e.dataset?.dotType}})}})}function p(t){return{acceptTypes:t.dataset?.dotAcceptTypes||"",identifier:t.dataset?.dotIdentifier||"",maxContentlets:t.dataset?.maxContentlets||"",uuid:t.dataset?.dotUuid||""}}function a(t){let n=t.closest('[data-dot-object="container"]');return n?p(n):(console.warn("No container found for the contentlet"),null)}function s(t){return t?t?.dataset?.dotObject==="contentlet"||t?.dataset?.dotObject==="container"&&t.children.length===0?t:s(t?.parentElement):null}function u(t){let n=t.querySelectorAll('[data-dot-object="vtl-file"]');return n.length?Array.from(n).map(e=>({inode:e.dataset?.dotInode,name:e.dataset?.dotUrl})):null}function f(){let t=document.documentElement.scrollHeight,n=window.innerHeight;return window.scrollY+n>=t}var i=[];function h(){let t=Array.from(document.querySelectorAll('[data-dot-object="container"]')),n=E(t);r({action:"set-bounds",payload:n})}function l(){let t=n=>{switch(n.data){case"ema-request-bounds":{h();break}}if(n.data.name==="scroll-inside-iframe"){let e=n.data.direction;if(window.scrollY===0&&e==="up"||f()&&e==="down")return;let o=e==="up"?-120:120;window.scrollBy({left:0,top:o,behavior:"smooth"})}};window.addEventListener("message",t),i.push({type:"listener",event:"message",callback:t})}function d(){let t=n=>{let e=s(n.target);if(!e)return;let{x:o,y,width:L,height:b}=e.getBoundingClientRect(),P=e.dataset?.dotObject==="container",M={identifier:"TEMP_EMPTY_CONTENTLET",title:"TEMP_EMPTY_CONTENTLET",contentType:"TEMP_EMPTY_CONTENTLET_TYPE",inode:"TEMPY_EMPTY_CONTENTLET_INODE",widgetTitle:"TEMP_EMPTY_CONTENTLET",baseType:"TEMP_EMPTY_CONTENTLET",onNumberOfPages:1},w={identifier:e.dataset?.dotIdentifier,title:e.dataset?.dotTitle,inode:e.dataset?.dotInode,contentType:e.dataset?.dotType,baseType:e.dataset?.dotBasetype,widgetTitle:e.dataset?.dotWidgetTitle,onNumberOfPages:e.dataset?.dotOnNumberOfPages},v=u(e),D={container:e.dataset?.dotContainer?JSON.parse(e.dataset?.dotContainer):a(e),contentlet:P?M:w,vtlFiles:v};r({action:"set-contentlet",payload:{x:o,y,width:L,height:b,payload:D}})};document.addEventListener("pointermove",t),i.push({type:"listener",event:"pointermove",callback:t})}function c(){let t=()=>{r({action:"scroll"}),window.lastScrollYPosition=window.scrollY},n=()=>{r({action:"scroll-end"})};window.addEventListener("scroll",t),window.addEventListener("scrollend",n),i.push({type:"listener",event:"scroll",callback:n}),i.push({type:"listener",event:"scroll",callback:t})}function m(){let t=()=>{window.scrollTo(0,window.lastScrollYPosition)};window.addEventListener("load",t),i.push({type:"listener",event:"scroll",callback:t})}function g(){return typeof window>"u"?!1:window.parent!==window}function T(){document.querySelectorAll('[data-dot-object="contentlet"]').forEach(n=>{n.clientHeight||n.classList.add("empty-contentlet")})}g()&&(l(),c(),m(),d(),T()); +function r(t){window.parent.postMessage(t,"*")}function E(t){return t.map(n=>{let e=n.getBoundingClientRect(),o=Array.from(n.querySelectorAll('[data-dot-object="contentlet"]'));return{x:e.x,y:e.y,width:e.width,height:e.height,payload:JSON.stringify({container:p(n)}),contentlets:N(e,o)}})}function N(t,n){return n.map(e=>{let o=e.getBoundingClientRect();return{x:0,y:o.y-t.y,width:o.width,height:o.height,payload:JSON.stringify({container:e.dataset?.dotContainer?JSON.parse(e.dataset?.dotContainer):a(e),contentlet:{identifier:e.dataset?.dotIdentifier,title:e.dataset?.dotTitle,inode:e.dataset?.dotInode,contentType:e.dataset?.dotType}})}})}function p(t){return{acceptTypes:t.dataset?.dotAcceptTypes||"",identifier:t.dataset?.dotIdentifier||"",maxContentlets:t.dataset?.maxContentlets||"",uuid:t.dataset?.dotUuid||""}}function a(t){let n=t.closest('[data-dot-object="container"]');return n?p(n):(console.warn("No container found for the contentlet"),null)}function s(t){return t?t?.dataset?.dotObject==="contentlet"||t?.dataset?.dotObject==="container"&&t.children.length===0?t:s(t?.parentElement):null}function u(t){let n=t.querySelectorAll('[data-dot-object="vtl-file"]');return n.length?Array.from(n).map(e=>({inode:e.dataset?.dotInode,name:e.dataset?.dotUrl})):null}function f(){let t=document.documentElement.scrollHeight,n=window.innerHeight;return window.scrollY+n>=t}var i=[];function h(){let t=Array.from(document.querySelectorAll('[data-dot-object="container"]')),n=E(t);r({action:"set-bounds",payload:n})}function l(){let t=n=>{switch(n.data){case"ema-request-bounds":{h();break}}if(n.data.name==="scroll-inside-iframe"){let e=n.data.direction;if(window.scrollY===0&&e==="up"||f()&&e==="down")return;let o=e==="up"?-120:120;window.scrollBy({left:0,top:o,behavior:"smooth"})}};window.addEventListener("message",t),i.push({type:"listener",event:"message",callback:t})}function d(){let t=n=>{let e=s(n.target);if(!e)return;let{x:o,y,width:L,height:b}=e.getBoundingClientRect(),P=e.dataset?.dotObject==="container",w={identifier:"TEMP_EMPTY_CONTENTLET",title:"TEMP_EMPTY_CONTENTLET",contentType:"TEMP_EMPTY_CONTENTLET_TYPE",inode:"TEMPY_EMPTY_CONTENTLET_INODE",widgetTitle:"TEMP_EMPTY_CONTENTLET",baseType:"TEMP_EMPTY_CONTENTLET",onNumberOfPages:1},M={identifier:e.dataset?.dotIdentifier,title:e.dataset?.dotTitle,inode:e.dataset?.dotInode,contentType:e.dataset?.dotType,baseType:e.dataset?.dotBasetype,widgetTitle:e.dataset?.dotWidgetTitle,onNumberOfPages:e.dataset?.dotOnNumberOfPages},v=u(e),D={container:e.dataset?.dotContainer?JSON.parse(e.dataset?.dotContainer):a(e),contentlet:P?w:M,vtlFiles:v};r({action:"set-contentlet",payload:{x:o,y,width:L,height:b,payload:D}})};document.addEventListener("pointermove",t),i.push({type:"listener",event:"pointermove",callback:t})}function c(){let t=()=>{r({action:"scroll"}),window.lastScrollYPosition=window.scrollY},n=()=>{r({action:"scroll-end"})};window.addEventListener("scroll",t),window.addEventListener("scrollend",n),i.push({type:"listener",event:"scroll",callback:n}),i.push({type:"listener",event:"scroll",callback:t})}function m(){let t=()=>{window.scrollTo(0,window.lastScrollYPosition)};window.addEventListener("load",t),i.push({type:"listener",event:"scroll",callback:t})}function g(){return typeof window>"u"?!1:window.parent!==window}function T(){document.querySelectorAll('[data-dot-object="contentlet"]').forEach(n=>{n.clientHeight||n.classList.add("empty-contentlet")})}g()&&(l(),c(),m(),d(),T()); diff --git a/examples/angular/package.json b/examples/angular/package.json index 62b62e382c7e..1f03317a969b 100644 --- a/examples/angular/package.json +++ b/examples/angular/package.json @@ -21,8 +21,8 @@ "@angular/platform-browser": "^17.1.0", "@angular/platform-browser-dynamic": "^17.1.0", "@angular/router": "^17.1.0", - "@dotcms/client": "0.0.1-alpha.30", - "@dotcms/angular": "0.0.1-alpha.30", + "@dotcms/client": "0.0.1-alpha.31", + "@dotcms/angular": "0.0.1-alpha.31", "@tinymce/tinymce-angular": "^8.0.0" }, "devDependencies": { diff --git a/examples/nextjs/package.json b/examples/nextjs/package.json index 0a38658c3c37..05a29df463f1 100644 --- a/examples/nextjs/package.json +++ b/examples/nextjs/package.json @@ -9,9 +9,9 @@ "lint": "next lint" }, "dependencies": { - "@dotcms/client": "0.0.1-alpha.30", - "@dotcms/react": "0.0.1-alpha.30", - "@dotcms/experiments": "0.0.1-alpha.30", + "@dotcms/client": "0.0.1-alpha.31", + "@dotcms/react": "0.0.1-alpha.31", + "@dotcms/experiments": "0.0.1-alpha.31", "next": "14.1.1", "react": "^18", "react-dom": "^18" diff --git a/examples/vuejs/package.json b/examples/vuejs/package.json index 85d31b450b5e..ea548ce66863 100644 --- a/examples/vuejs/package.json +++ b/examples/vuejs/package.json @@ -11,7 +11,7 @@ "format": "prettier --write src/" }, "dependencies": { - "@dotcms/client": "^0.0.1-alpha.30", + "@dotcms/client": "^0.0.1-alpha.31", "vue": "^3.4.15", "vue-router": "^4.2.5" },