From 4825b2645c7d5c3aa6de34b6b31242e2c6bd15c7 Mon Sep 17 00:00:00 2001 From: Jon Uhlmann Date: Tue, 7 Jan 2025 21:01:53 +0100 Subject: [PATCH] Update: Metadata Editor --- Resources/Private/MetadataEditor/Editor/index.jsx | 6 +++--- Resources/Public/Plugin/Metadata.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Resources/Private/MetadataEditor/Editor/index.jsx b/Resources/Private/MetadataEditor/Editor/index.jsx index 8a9240a..62274f2 100644 --- a/Resources/Private/MetadataEditor/Editor/index.jsx +++ b/Resources/Private/MetadataEditor/Editor/index.jsx @@ -1,4 +1,4 @@ -import React, { Fragment } from 'react'; +import React from 'react'; import { neos } from '@neos-project/neos-ui-decorators'; import style from './style.module.css'; @@ -30,10 +30,10 @@ function Editor(props) { return (
{array.map(({ label, value }) => ( - + <>
{label}
-
+ ))}
); diff --git a/Resources/Public/Plugin/Metadata.js b/Resources/Public/Plugin/Metadata.js index 5e52f25..e4d67c5 100644 --- a/Resources/Public/Plugin/Metadata.js +++ b/Resources/Public/Plugin/Metadata.js @@ -1 +1 @@ -(()=>{var W=Object.create;var g=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var X=(t,e)=>()=>(t&&(e=t(t=0)),e);var u=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var B=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of x(e))!Z.call(t,r)&&r!==o&&g(t,r,{get:()=>e[r],enumerable:!(i=O(e,r))||i.enumerable});return t};var m=(t,e,o)=>(o=t!=null?W(N(t)):{},B(e||!t||!t.__esModule?g(o,"default",{value:t,enumerable:!0}):o,t));function a(t){return(...e)=>{if(window["@Neos:HostPluginAPI"]&&window["@Neos:HostPluginAPI"][`@${t}`])return window["@Neos:HostPluginAPI"][`@${t}`](...e);throw new Error("You are trying to read from a consumer api that hasn't been initialized yet!")}}var p=X(()=>{});var y=u((st,h)=>{p();h.exports=a("vendor")().React});var A=u((at,I)=>{p();I.exports=a("NeosProjectPackages")().NeosUiDecorators});p();var f=a("manifest");var n=m(y(),1),w=m(A(),1);var d={"--space-between":"--jonnitto-prettyembed-00i6NG-space-between",propertyLabel:"jonnitto-prettyembed-00i6NG-propertyLabel",propertyValue:"jonnitto-prettyembed-00i6NG-propertyValue",infoView:"jonnitto-prettyembed-00i6NG-infoView"};var v=(0,w.neos)(t=>({i18nRegistry:t.get("i18n")}));function V(t){let{value:e,options:o,i18nRegistry:i}=t,r=Object.entries(o).map(([s,c])=>{let l=e[s];if(!l)return null;let G=s==="duration"?Y(l):null;return{label:i.translate(c+".label"),value:i.translate(c+".value",l,[l,G])}}).filter(s=>!!s);return r.length?n.default.createElement("dl",{className:d.infoView},r.map(({label:s,value:c})=>n.default.createElement(n.Fragment,null,n.default.createElement("dt",{className:d.propertyLabel},s),n.default.createElement("dd",{className:d.propertyValue,dangerouslySetInnerHTML:{__html:c}})))):n.default.createElement("div",null,i.translate("Jonnitto.PrettyEmbedHelper:NodeTypes.Mixin.Metadata:noMetadataSet"))}var Y=t=>{let e=s=>`0${s}`.slice(-2),o=~~(t/3600),i=~~(t%3600/60),r=t%60;return o?`${o}:${e(i)}:${e(r)}`:i?`${i}:${e(r)}`:r},C=v(V);f("Jonnitto.PrettyEmbed:Metadata",{},t=>{t.get("inspector").get("editors").set("Jonnitto.PrettyEmbed/Metadata",{component:C})});})(); +(()=>{var W=Object.create;var u=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var X=(t,e)=>()=>(t&&(e=t(t=0)),e);var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var B=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of x(e))!Z.call(t,r)&&r!==o&&u(t,r,{get:()=>e[r],enumerable:!(i=O(e,r))||i.enumerable});return t};var b=(t,e,o)=>(o=t!=null?W(N(t)):{},B(e||!t||!t.__esModule?u(o,"default",{value:t,enumerable:!0}):o,t));function n(t){return(...e)=>{if(window["@Neos:HostPluginAPI"]&&window["@Neos:HostPluginAPI"][`@${t}`])return window["@Neos:HostPluginAPI"][`@${t}`](...e);throw new Error("You are trying to read from a consumer api that hasn't been initialized yet!")}}var p=X(()=>{});var y=g((st,h)=>{p();h.exports=n("vendor")().React});var A=g((at,I)=>{p();I.exports=n("NeosProjectPackages")().NeosUiDecorators});p();var f=n("manifest");var a=b(y(),1),w=b(A(),1);var d={propertyLabel:"jonnitto-prettyembed-00i6NG-propertyLabel","--space-between":"--jonnitto-prettyembed-00i6NG-space-between",infoView:"jonnitto-prettyembed-00i6NG-infoView",propertyValue:"jonnitto-prettyembed-00i6NG-propertyValue"};var v=(0,w.neos)(t=>({i18nRegistry:t.get("i18n")}));function V(t){let{value:e,options:o,i18nRegistry:i}=t,r=Object.entries(o).map(([s,c])=>{let l=e[s];if(!l)return null;let G=s==="duration"?Y(l):null;return{label:i.translate(c+".label"),value:i.translate(c+".value",l,[l,G])}}).filter(s=>!!s);return r.length?a.default.createElement("dl",{className:d.infoView},r.map(({label:s,value:c})=>a.default.createElement(a.default.Fragment,null,a.default.createElement("dt",{className:d.propertyLabel},s),a.default.createElement("dd",{className:d.propertyValue,dangerouslySetInnerHTML:{__html:c}})))):a.default.createElement("div",null,i.translate("Jonnitto.PrettyEmbedHelper:NodeTypes.Mixin.Metadata:noMetadataSet"))}var Y=t=>{let e=s=>`0${s}`.slice(-2),o=~~(t/3600),i=~~(t%3600/60),r=t%60;return o?`${o}:${e(i)}:${e(r)}`:i?`${i}:${e(r)}`:r},C=v(V);f("Jonnitto.PrettyEmbed:Metadata",{},t=>{t.get("inspector").get("editors").set("Jonnitto.PrettyEmbed/Metadata",{component:C})});})();