@imgly/plugin-cutout-library-web 1.68.0-rc.1 → 1.68.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var c="@imgly/plugin-cutout-library-web.canvasMenu",p=`${c}.button`,g=`${p}.label`;var l="ly.img.cutout",N=`${l}.entry`,d="@imgly/plugin-cutout-library-web.notifications.selectCutoutBlock",f="@imgly/plugin-cutout-library-web.notifications.cutoutBlockSelected",m="@imgly/plugin-cutout-library-web.notifications.differentPages",S={en:{[`libraries.${N}.label`]:"Cutouts",[d]:"Please select a block to cutout",[f]:"Cutout blocks cannot be cutout from selection",[m]:"Selected Blocks are from different pages. Please select blocks from the same page.",[g]:"Cutout"},de:{[`libraries.${N}.label`]:"Schnittlinien",[d]:"Bitte w\xE4hlen Sie einen Block zum Ausschneiden aus",[f]:"Schnittlinienbl\xF6cke k\xF6nnen nicht ausgeschnitten werden",[m]:"Ausgew\xE4hlte Bl\xF6cke stammen aus verschiedenen Seiten. Bitte w\xE4hlen Sie Bl\xF6cke von derselben Seite aus.",[g]:"Ausschneiden"}};function A(e,{createCutoutFromBlocks:n}){e.ui.registerComponent(c,({builder:{Button:t},engine:o})=>{let i=["//ly.img.ubq/group","//ly.img.ubq/graphic","//ly.img.ubq/text"],a=o.block.findAllSelected();if(a.length!==1||!i.includes(o.block.getType(a[0])))return null;t(p,{label:g,icon:({theme:r})=>`${E}/dock-${r}.svg`,onClick:()=>{I(e,n)}})})}async function U(e,n,t="",o){let{assets:i,id:a}=n;e.asset.addLocalSource(a,void 0,o),i.forEach(r=>{r.meta&&Object.entries(r.meta).forEach(([s,u])=>{let _=u.toString();if(_.includes("{{base_url}}")){let b=_.replace("{{base_url}}",t);r.meta&&(r.meta[s]=b)}}),r.payload?.sourceSet&&r.payload.sourceSet.forEach(s=>{s.uri=s.uri.replace("{{base_url}}",t)}),e.asset.addAssetToSource(a,r)})}var T=U;function B({assetBaseUri:e,ui:n,createCutoutFromBlocks:t}){return{initialize:({cesdk:o})=>{o!=null&&(L(o,{assetBaseUri:e,createCutoutFromBlocks:t}),y(o,{assetBaseUri:e}),A(o,{createCutoutFromBlocks:t}),n?.locations.includes("canvasMenu")&&o.ui.setCanvasMenuOrder([c,...o.ui.getCanvasMenuOrder()]),o.setTranslations(S))}}}function y(e,n=C){let{assetBaseUri:t}=P(n);e.ui.addAssetLibraryEntry({id:N,sourceIds:[l],icon:({theme:o})=>`${t}/dock-${o}.svg`,gridColumns:2,gridItemHeight:"square",cardLabel:o=>o.label,cardLabelPosition:()=>"below",cardBackgroundPreferences:[{path:"meta.thumbUri",type:"image"}]})}async function L(e,{assetBaseUri:n,createCutoutFromBlocks:t}){let o=await fetch(`${n}/${l}/content.json`).then(i=>i.json());T(e.engine,o,`${n}/${l}/assets`,async i=>i.id==="cutout-selection"?await I(e,t):await e.engine.asset.defaultApplyAsset(i))}async function I(e,n){let t=e.engine.block.findAllSelected();if(t.length===0){e.ui.showNotification({message:d,type:"error"});return}if(t.some(u=>e.engine.block.getType(u)==="//ly.img.ubq/cutout")){e.ui.showNotification({message:f,type:"error"});return}let i=t.map(u=>k(e.engine,u)),a=Array.from(new Set(i));if(a.length>1){e.ui.showNotification({message:m,type:"error"});return}let r=a[0],s=n(t,e.engine);return e.engine.block.appendChild(r,s),e.engine.block.setAlwaysOnTop(s,!0),e.engine.block.select(s),e.engine.editor.addUndoStep(),s}function k(e,n){let t=n;for(;t&&e.block.getType(t)!=="//ly.img.ubq/page";){let o=e.block.getParent(t);if(!o||o===t)return t;t=o}return t}var O=B;var E=`https://staticimgly.com/${"@imgly/plugin-cutout-library-web".replace("@","")}/1.68.0-rc.
|
|
1
|
+
var c="@imgly/plugin-cutout-library-web.canvasMenu",p=`${c}.button`,g=`${p}.label`;var l="ly.img.cutout",N=`${l}.entry`,d="@imgly/plugin-cutout-library-web.notifications.selectCutoutBlock",f="@imgly/plugin-cutout-library-web.notifications.cutoutBlockSelected",m="@imgly/plugin-cutout-library-web.notifications.differentPages",S={en:{[`libraries.${N}.label`]:"Cutouts",[d]:"Please select a block to cutout",[f]:"Cutout blocks cannot be cutout from selection",[m]:"Selected Blocks are from different pages. Please select blocks from the same page.",[g]:"Cutout"},de:{[`libraries.${N}.label`]:"Schnittlinien",[d]:"Bitte w\xE4hlen Sie einen Block zum Ausschneiden aus",[f]:"Schnittlinienbl\xF6cke k\xF6nnen nicht ausgeschnitten werden",[m]:"Ausgew\xE4hlte Bl\xF6cke stammen aus verschiedenen Seiten. Bitte w\xE4hlen Sie Bl\xF6cke von derselben Seite aus.",[g]:"Ausschneiden"}};function A(e,{createCutoutFromBlocks:n}){e.ui.registerComponent(c,({builder:{Button:t},engine:o})=>{let i=["//ly.img.ubq/group","//ly.img.ubq/graphic","//ly.img.ubq/text"],a=o.block.findAllSelected();if(a.length!==1||!i.includes(o.block.getType(a[0])))return null;t(p,{label:g,icon:({theme:r})=>`${E}/dock-${r}.svg`,onClick:()=>{I(e,n)}})})}async function U(e,n,t="",o){let{assets:i,id:a}=n;e.asset.addLocalSource(a,void 0,o),i.forEach(r=>{r.meta&&Object.entries(r.meta).forEach(([s,u])=>{let _=u.toString();if(_.includes("{{base_url}}")){let b=_.replace("{{base_url}}",t);r.meta&&(r.meta[s]=b)}}),r.payload?.sourceSet&&r.payload.sourceSet.forEach(s=>{s.uri=s.uri.replace("{{base_url}}",t)}),e.asset.addAssetToSource(a,r)})}var T=U;function B({assetBaseUri:e,ui:n,createCutoutFromBlocks:t}){return{initialize:({cesdk:o})=>{o!=null&&(L(o,{assetBaseUri:e,createCutoutFromBlocks:t}),y(o,{assetBaseUri:e}),A(o,{createCutoutFromBlocks:t}),n?.locations.includes("canvasMenu")&&o.ui.setCanvasMenuOrder([c,...o.ui.getCanvasMenuOrder()]),o.setTranslations(S))}}}function y(e,n=C){let{assetBaseUri:t}=P(n);e.ui.addAssetLibraryEntry({id:N,sourceIds:[l],icon:({theme:o})=>`${t}/dock-${o}.svg`,gridColumns:2,gridItemHeight:"square",cardLabel:o=>o.label,cardLabelPosition:()=>"below",cardBackgroundPreferences:[{path:"meta.thumbUri",type:"image"}]})}async function L(e,{assetBaseUri:n,createCutoutFromBlocks:t}){let o=await fetch(`${n}/${l}/content.json`).then(i=>i.json());T(e.engine,o,`${n}/${l}/assets`,async i=>i.id==="cutout-selection"?await I(e,t):await e.engine.asset.defaultApplyAsset(i))}async function I(e,n){let t=e.engine.block.findAllSelected();if(t.length===0){e.ui.showNotification({message:d,type:"error"});return}if(t.some(u=>e.engine.block.getType(u)==="//ly.img.ubq/cutout")){e.ui.showNotification({message:f,type:"error"});return}let i=t.map(u=>k(e.engine,u)),a=Array.from(new Set(i));if(a.length>1){e.ui.showNotification({message:m,type:"error"});return}let r=a[0],s=n(t,e.engine);return e.engine.block.appendChild(r,s),e.engine.block.setAlwaysOnTop(s,!0),e.engine.block.select(s),e.engine.editor.addUndoStep(),s}function k(e,n){let t=n;for(;t&&e.block.getType(t)!=="//ly.img.ubq/page";){let o=e.block.getParent(t);if(!o||o===t)return t;t=o}return t}var O=B;var E=`https://staticimgly.com/${"@imgly/plugin-cutout-library-web".replace("@","")}/1.68.0-rc.2/dist/assets`,C={assetBaseUri:E,createCutoutFromBlocks:(e,n)=>n.block.createCutoutFromBlocks(e,0,2,!1)};function P(e){return{...C,...e}}var F=(e=C)=>({name:"@imgly/plugin-cutout-library-web",version:"1.68.0-rc.2",...O({...C,...e})}),H=F;export{E as DEFAULT_ASSET_BASE_URI,C as DEFAULT_PLUGIN_CONFIGURATION,H as default,I as generateCutoutFromSelection,P as getPluginConfiguration};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imgly/plugin-cutout-library-web",
|
|
3
|
-
"version": "1.68.0-rc.
|
|
3
|
+
"version": "1.68.0-rc.2",
|
|
4
4
|
"description": "Cutout Library plugin for the CE.SDK editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CE.SDK",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"typescript": "^5.7.3"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@cesdk/cesdk-js": "1.68.0-rc.
|
|
45
|
+
"@cesdk/cesdk-js": "1.68.0-rc.2"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"lodash": "^4.17.21"
|