react-bricks 4.4.5 → 4.5.0-beta.0

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.
Files changed (42) hide show
  1. package/frontend/index.js +1 -2
  2. package/frontend/package.json +1 -1
  3. package/frontend/react-bricks-frontend.esm.js +1 -2
  4. package/index.js +1 -2
  5. package/package.json +1 -1
  6. package/react-bricks-B8MZELnG.esm.js +1 -0
  7. package/react-bricks-BFY3Mm0W.js +1 -0
  8. package/react-bricks-BMw1UWSb.js +1 -0
  9. package/react-bricks-BRx3XAAk.js +1 -0
  10. package/react-bricks-BT_2oGmr.js +1 -0
  11. package/react-bricks-Cg63sA5t.js +1 -0
  12. package/react-bricks-CxZgZoFD.esm.js +1 -0
  13. package/react-bricks-D3HhQUK7.js +1 -0
  14. package/react-bricks-DSo9s6x8.js +1 -0
  15. package/react-bricks-DlH6k_HV.esm.js +1 -0
  16. package/{react-bricks-1ae4982f.esm.js → react-bricks-Do754F2x.esm.js} +1 -2
  17. package/react-bricks-YhEwJgHv.esm.js +1 -0
  18. package/react-bricks-sZTFQcbv.esm.js +1 -0
  19. package/react-bricks-uFoP8-z1.esm.js +1 -0
  20. package/react-bricks.d.ts +55 -36
  21. package/react-bricks.esm.js +1 -2
  22. package/rsc/client/index.js +1 -2
  23. package/rsc/client/package.json +1 -1
  24. package/rsc/client/react-bricks-rsc-client.d.ts +18 -52
  25. package/rsc/client/react-bricks-rsc-client.esm.js +1 -2
  26. package/rsc/index.js +1 -2
  27. package/rsc/package.json +1 -1
  28. package/rsc/react-bricks-rsc.d.ts +37 -25
  29. package/rsc/react-bricks-rsc.esm.js +1 -2
  30. package/react-bricks-1dd969c0.esm.js +0 -2
  31. package/react-bricks-1e170bb3.js +0 -2
  32. package/react-bricks-5a2ec460.esm.js +0 -2
  33. package/react-bricks-6514aa6d.js +0 -2
  34. package/react-bricks-79150985.js +0 -2
  35. package/react-bricks-79e2563b.js +0 -2
  36. package/react-bricks-9a053932.js +0 -2
  37. package/react-bricks-9cd98c4f.js +0 -2
  38. package/react-bricks-c4a69a97.esm.js +0 -2
  39. package/react-bricks-cfeb8b4d.js +0 -2
  40. package/react-bricks-d3cee8ba.esm.js +0 -2
  41. package/react-bricks-ef274060.esm.js +0 -2
  42. package/react-bricks-f93aeda4.esm.js +0 -2
@@ -0,0 +1 @@
1
+ import{c as e,t,e as n,b as r,f as i,h as a,j as o,_ as s,a as l,g as u}from"./react-bricks-Do754F2x.esm.js";import{Md5 as c}from"ts-md5";import d from"react";var p=function(e,t){var n=e;if(/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\/.+\..{1,4}/.test(e)){var r=e.match(/(\/[^\/]+)\..{1,4}$/);(null==r?void 0:r.length)&&(null==r?void 0:r.length)>1&&(n=e.replace(r[1],""))}if(!t)return n;var i=n.lastIndexOf(".");return n.substring(0,i)+"/"+t+n.substring(i)},m=function(t,n){return t?n?t.split(",").map((function(t){var r=e(t.trim().split(" "),2),i=r[0],a=r[1];return i&&a?"".concat(p(i,n)," ").concat(a):p(t,n)})).join(", "):t:""},v=function(e){var t=e.lastIndexOf(".");return e.substring(t)},f=function(e){return function(e){var t,n;if(!1===g(e))return!1;if("function"!=typeof(t=e.constructor))return!1;if(!1===g(n=t.prototype))return!1;if(!1===n.hasOwnProperty("isPrototypeOf"))return!1;return!0}(e)&&"string"==typeof e.text};function h(e){return f(e)?e.text:e.children&&Array.isArray(e.children)?e.children.map(h).join(""):""}function g(e){return!0==(null!=(t=e)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(e);var t}var y,b={serialize:function(e){return Array.isArray(e)&&e.length>0?e.map(h).join("\n"):""},serializeLight:function(e){return Array.isArray(e)&&1===e.length&&(f(e[0])||e[0].children&&Array.isArray(e[0].children)&&1===e[0].children.length&&e[0].children[0].text&&!e[0].children[0].bold&&!e[0].children[0].italic&&!e[0].children[0].code&&!e[0].children[0].highlight&&!e[0].children[0].link)?e.map(h).join("\n"):e},deserialize:function(e){return e.split("\n").map((function(e){return{type:"paragraph",children:[{text:e}]}}))},isText:f,isSlateContent:function(e){return!!(e&&Array.isArray(e)&&e.length>0&&e[0]&&"paragraph"===e[0].type&&e[0].children)}},w=function(e,t,n){return!(n&&n.find((function(t){return t===e}))||t&&!t.find((function(t){return t===e})))},T={id:"",type:"",slug:"",name:"",meta:{},author:{id:"",firstName:"",lastName:"",email:""},lastEditedBy:{date:"",user:{id:"",firstName:"",lastName:"",company:"",email:""}},status:t.PageStatus.Draft,editStatus:t.EditStatus.Merged,isLocked:!1,content:[],tags:[],createdAt:"",language:"en",translations:[]},A=function(e,t,r){if(!e||!e.type||!e.content)return T;var i=t.find((function(t){return t.name===e.type}));if(!i)return e;var a=P(r,e.content,i.allowedBlockTypes,i.excludedBlockTypes,i.template);return n(n({},e),{content:a.blocks,invalidBlocksTypes:a.invalidBlocksTypes})},P=function(t,i,a,o,s){return i.reduce((function(i,l){var u=t[l.type];if(!("__RB_TEMPLATE_SLOT"===l.type||u&&w(l.type,a,o)))return n(n({},i),{invalidBlocksTypes:r(r([],e(i.invalidBlocksTypes),!1),[l.type],!1)});if("__RB_TEMPLATE_SLOT"===l.type){if(!s)return n(n({},i),{invalidBlocksTypes:r(r([],e(i.invalidBlocksTypes),!1),["Slot without template"],!1)});if(!(m=s.find((function(e){return e.slotName===l.props.slotName}))))return n(n({},i),{invalidBlocksTypes:r(r([],e(i.invalidBlocksTypes),!1),['Unknown slot "'.concat(l.props.slotName||"",'"')],!1)})}var c={};if("__RB_TEMPLATE_SLOT"!==l.type){var d=u.schema.sideEditProps?u.schema.sideEditProps.reduce((function(t,n){if(n.groupName||"BOOLEAN"!==n.type||t.push(n),n.groupName){var i=n.props.filter((function(e){return"BOOLEAN"===e.type}));t=r(r([],e(t),!1),e(i),!1)}return t}),[]):[];c=d.reduce((function(e,t){var r,i=l.props[t.name];return n(n({},e),((r={})[t.name]=!!i,r))}),{})}var p=n(n({},l),{props:n(n({},l.props),c)});if("__RB_TEMPLATE_SLOT"!==l.type){Object.keys(p.props).forEach((function(e){var n,r,i,a,o,s,l;p.props[e]&&(null===(r=null===(n=p.props[e])||void 0===n?void 0:n.document)||void 0===r?void 0:r.data)&&(null===(a=null===(i=p.props[e])||void 0===i?void 0:i.document)||void 0===a?void 0:a.nodes)&&"document"===(null===(s=null===(o=p.props[e])||void 0===o?void 0:o.document)||void 0===s?void 0:s.object)||(null===(l=u.schema.repeaterItems)||void 0===l?void 0:l.find((function(t){return t.name===e})))&&(p.props[e]=P(t,p.props[e]).blocks)}))}else{var m=null==s?void 0:s.find((function(e){return e.slotName===l.props.slotName}));p.props.slotItems=P(t,p.props.slotItems,null==m?void 0:m.allowedBlockTypes,null==m?void 0:m.excludedBlockTypes).blocks}return n(n({},i),{blocks:r(r([],e(i.blocks),!1),[p],!1)})}),{blocks:[],invalidBlocksTypes:[]})},x=function(e){var t=atob(e).split("|");if(3!==t.length)return null;var n=t[0],r=t[1],i=t[2],a=(new Date).getTime();if(Math.abs(a-parseInt(r,10))>3e5)return null;var o="".concat(n,"|").concat(r,"|").concat("r@sPX2").concat("q*7*&g".replace(String.fromCharCode(113),String.fromCharCode(81)));return c.hashStr(o)!==i?null:n},C=function(e){return"41192756"===x(e)},O=function(e){var t=x(e);return"77048934"===t||"91035396"===t},N=function(e){var t,r,i,a,o,s,l;return n(n(n(n(n({"@context":"https://schema.org/","@type":"Thing",name:e.name},1===(null===(t=e.alternateName)||void 0===t?void 0:t.length)&&{alternateName:e.alternateName[0].name}),(null===(r=e.alternateName)||void 0===r?void 0:r.length)&&(null===(i=e.alternateName)||void 0===i?void 0:i.length)>1&&{alternateName:e.alternateName.map((function(e){return e.name}))}),1===(null===(a=e.sameAs)||void 0===a?void 0:a.length)&&{sameAs:e.sameAs[0].url}),(null===(o=e.sameAs)||void 0===o?void 0:o.length)&&(null===(s=e.sameAs)||void 0===s?void 0:s.length)>1&&{sameAs:e.sameAs.map((function(e){return e.url}))}),{url:e.url,description:e.description,image:null===(l=e.image)||void 0===l?void 0:l.src})},k=function(e,t){switch(e){case"article":return function(e){var t,r,i,a,o;return n(n(n(n(n(n(n({"@context":"https://schema.org","@type":"Article"},e.url&&{mainEntityOfPage:{"@type":"WebPage","@id":e.url}}),e.description&&{description:e.description}),{headline:e.headline}),1===(null===(t=e.images)||void 0===t?void 0:t.length)&&{image:{"@type":"ImageObject",url:null===(r=e.images[0])||void 0===r?void 0:r.src,width:null===(i=e.images[0])||void 0===i?void 0:i.width,height:null===(a=e.images[0])||void 0===a?void 0:a.height}}),(null===(o=e.images)||void 0===o?void 0:o.length)&&e.images.length>1&&{image:e.images.map((function(e){return{"@type":"ImageObject",url:null==e?void 0:e.src,width:null==e?void 0:e.width,height:null==e?void 0:e.height}}))}),{author:n({"@type":e.authorType,name:e.authorName},e.authorUrl&&{url:e.authorUrl}),publisher:{"@type":"Organization",name:e.publisherName,logo:{"@type":"ImageObject",url:e.publisherLogoUrl,width:e.publisherLogoWidth,height:e.publisherLogoHeight}},datePublished:e.datePublished}),e.dateModified&&{dateModified:e.dateModified})}(t);case"breadcrumb":return function(e){var t;return{"@context":"https://schema.org/","@type":"BreadcrumbList",itemListElement:null===(t=e.itemListElement)||void 0===t?void 0:t.map((function(e,t){return{"@type":"ListItem",position:t+1,name:e.name,item:e.item}}))}}(t);case"event":return function(e){var t,r,i,a,o,s=void 0,l=void 0,u=void 0;switch(e.status){case"cancelled":s="Cancelled";break;case"moved-online":s="MovedOnline";break;case"postponed":s="Postponed";break;case"scheduled":s="Scheduled"}switch(e.attendanceMode){case"mixed":l="Mixed";break;case"online":l="Online";break;case"offline":l="Offline"}switch(e.performerType){case"dance-group":u="DanceGroup";break;case"music-group":u="MusicGroup";break;case"performing-group":u="PerformingGroup";break;case"person":u="Person";break;case"theater-group":u="TheaterGroup"}var c=function(e){switch(e){case"in-stock":return"InStock";case"sold-out":return"SoldOut";case"pre-order":return"PreOrder";default:return""}},d=null===(t=e.timeZone)||void 0===t?void 0:t.split(" | "),p=d&&d.length>0&&d[1];return n(n(n(n(n(n(n(n(n(n(n(n(n(n({"@context":"https://schema.org/","@type":"Event"},e.name&&{name:e.name}),e.description&&{description:e.description}),e.imageUrl&&{image:e.imageUrl}),e.startDate&&{startDate:""!==e.startTime&&e.startTime?e.startDate+"T"+e.startTime+p:e.startDate}),e.endDate&&{endDate:""!==e.endTime&&e.endTime?e.endDate+"T"+e.endTime+p:e.endDate}),e.status&&{eventStatus:s&&"https://schema.org/Event"+s}),e.attendanceMode&&{eventAttendanceMode:l&&"https://schema.org/"+l+"EventAttendanceMode"}),("online"===e.attendanceMode||"mixed"===e.attendanceMode)&&""!==e.streamUrl&&e.streamUrl&&{streamUrl:e.streamUrl}),"online"===e.attendanceMode&&{location:{"@type":"VirtualLocation",url:e.streamUrl}}),"offline"===e.attendanceMode&&{location:{"@type":"Place",name:e.venueName,address:{"@type":"PostalAddress",streetAddress:e.street,addressLocality:e.city,postalCode:e.zipCode,addressCountry:e.countryCode,addressRegion:e.regionCode}}}),"mixed"===e.attendanceMode&&{location:[{"@type":"VirtualLocation",url:e.streamUrl},{"@type":"Place",name:e.venueName,address:{"@type":"PostalAddress",streetAddress:e.street,addressLocality:e.city,postalCode:e.zipCode,addressCountry:e.countryCode,addressRegion:e.regionCode}}]}),e.performerType&&{performer:{"@type":u,name:e.performerName}}),1===(null===(r=e.offers)||void 0===r?void 0:r.length)&&{offers:{"@type":"Offer",name:e.offers[0].name,price:e.offers[0].price,priceCurrency:e.offers[0].priceCurrency,validFrom:e.offers[0].validFrom,url:e.offers[0].url,availability:""!==e.offers[0].availability?"https://schema.org/"+c(e.offers[0].availability):e.offers[0].availability}}),(null===(i=e.offers)||void 0===i?void 0:i.length)&&(null===(a=e.offers)||void 0===a?void 0:a.length)>1&&{offers:null===(o=e.offers)||void 0===o?void 0:o.map((function(e){return{"@type":"Offer",name:e.name,price:e.price,priceCurrency:e.priceCurrency,validFrom:e.validFrom,url:e.url,availability:""!==e.availability?"https://schema.org/"+c(e.availability):e.availability}}))})}(t);case"faq":return function(e){var t,r,i,a;return n(n({"@context":"https://schema.org","@type":"FAQPage"},(null===(t=e.faq)||void 0===t?void 0:t.length)&&(null===(r=e.faq)||void 0===r?void 0:r.length)<2&&{mainEntity:{"@type":"Question",name:e.faq[0].question,acceptedAnswer:{"@type":"Answer",text:e.faq[0].answer}}}),(null===(i=e.faq)||void 0===i?void 0:i.length)&&(null===(a=e.faq)||void 0===a?void 0:a.length)>=2&&{mainEntity:e.faq.map((function(e){return{"@type":"Question",name:e.question,acceptedAnswer:{"@type":"Answer",text:e.answer}}}))})}(t);case"how-to":return function(e){var t,r,i,a,o,s;return n(n(n(n(n(n(n(n(n(n({"@context":"https://schema.org/","@type":"HowTo",name:e.name},e.description&&{description:e.description}),e.totalTime&&{totalTime:"PT"+e.totalTime+"M"}),(""!==e.currency||!Number.isNaN(e.estimatedCost))&&{estimatedCost:{"@type":"MonetaryAmount",currency:e.currency,value:Number.isNaN(e.estimatedCost)?"":e.estimatedCost}}),e.imageUrl&&{image:e.imageUrl}),1===(null===(t=e.supplies)||void 0===t?void 0:t.length)&&{supply:{"@type":"HowToSupply",name:e.supplies[0].supply}}),(null===(r=e.supplies)||void 0===r?void 0:r.length)&&e.supplies.length>1&&{supply:e.supplies.map((function(e){return{"@type":"HowToSupply",name:e.supply}}))}),1===(null===(i=e.tools)||void 0===i?void 0:i.length)&&{tool:{"@type":"HowToTool",name:e.tools[0].tool}}),(null===(a=e.tools)||void 0===a?void 0:a.length)&&e.tools.length>1&&{tool:e.tools.map((function(e){return{"@type":"HowToTool",name:e.tool}}))}),1===(null===(o=e.steps)||void 0===o?void 0:o.length)&&{step:n(n(n({"@type":"HowToStep",text:e.steps[0].instructions},e.steps[0].imageUrl&&{image:e.steps[0].imageUrl}),e.steps[0].name&&{name:e.steps[0].name}),e.steps[0].url&&{url:e.steps[0].url})}),(null===(s=e.steps)||void 0===s?void 0:s.length)&&e.steps.length>1&&{step:e.steps.map((function(e){return n(n(n({"@type":"HowToStep",text:e.instructions},e.imageUrl&&{image:e.imageUrl}),e.name&&{name:e.name}),e.url&&{url:e.url})}))})}(t);case"job-posting":return function(e){var t;return n(n(n(n(n(n(n(n(n(n({"@context":"https://schema.org/","@type":"JobPosting",title:e.title,description:e.description},e.identifier&&{identifier:{"@type":"PropertyValue",name:e.company,value:e.identifier}}),{hiringOrganization:n(n({"@type":"Organization",name:e.company},e.companyUrl&&{sameAs:e.companyUrl}),e.companyLogo&&{logo:null===(t=e.companyLogo)||void 0===t?void 0:t.src})}),e.industry&&{industry:e.industry}),{employmentType:e.employmentType}),e.workHours&&{workHours:e.workHours}),{datePosted:e.datePosted,validThrough:e.validThrough}),!e.remoteJob&&{jobLocation:{"@type":"Place",address:{"@type":"PostalAddress",streetAddress:e.street,addressLocality:e.city,postalCode:e.zipCode,addressCountry:e.countryCode,addressRegion:e.regionCode}}}),e.remoteJob&&{applicantLocationRequirements:{"@type":"Country",name:e.countryCode},jobLocationType:"TELECOMMUTE"}),e.salaryMinValue&&{baseSalary:{"@type":"MonetaryAmount",currency:e.currency,value:n(n(n({"@type":"QuantitativeValue"},!e.salaryMaxValue&&{value:e.salaryMinValue}),e.salaryMaxValue&&{minValue:e.salaryMinValue,maxValue:e.salaryMaxValue}),{unitText:e.unitText})}}),{responsibilities:e.responsibilities,skills:e.skills,qualifications:e.qualifications,educationRequirements:e.educationRequirements,experienceRequirements:e.experienceRequirements})}(t);case"local-business":return function(e){var t,r,i,a,o,s,l,u=null===(t=e.paymentsAccepted)||void 0===t?void 0:t.filter((function(e){return!1!==e})),c=e.openingHours&&e.openingHours[0].dayOfWeek.filter((function(e){return!1!==e}));return n(n(n(n(n(n(n(n(n(n({"@context":"https://schema.org","@type":e.businessType,name:e.name,image:null===(r=e.image)||void 0===r?void 0:r.src,"@id":e.id,url:e.url,telephone:e.phone},e.priceRange&&{priceRange:e.priceRange}),{address:n({"@type":"PostalAddress",streetAddress:e.street,addressLocality:e.city,postalCode:e.zipCode,addressCountry:e.countryCode},e.regionCode&&{addressRegion:e.regionCode})}),(e.latitude||e.longitude)&&{geo:{"@type":"GeoCoordinates",latitude:e.latitude,longitude:e.longitude}}),1===(null==u?void 0:u.length)&&{paymentAccepted:u[0]}),(null==u?void 0:u.length)&&u.length>1&&{paymentAccepted:u}),e.open247&&{openingHoursSpecification:{"@type":"OpeningHoursSpecification",dayOfWeek:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],opens:"00:00",closes:"23:59"}}),!e.open247&&1===(null===(i=e.openingHours)||void 0===i?void 0:i.length)&&{openingHoursSpecification:{"@type":"OpeningHoursSpecification",dayOfWeek:1===(null==c?void 0:c.length)?c[0]:c,opens:e.openingHours[0].opens,closes:e.openingHours[0].closes}}),!e.open247&&(null===(a=e.openingHours)||void 0===a?void 0:a.length)&&(null===(o=e.openingHours)||void 0===o?void 0:o.length)>1&&{openingHoursSpecification:e.openingHours.map((function(e){var t=e.dayOfWeek.filter((function(e){return!1!==e}));return{"@type":"OpeningHoursSpecification",dayOfWeek:1===t.length?t[0]:t,opens:e.opens,closes:e.closes}}))}),1===(null===(s=e.socialProfiles)||void 0===s?void 0:s.length)&&{sameAs:e.socialProfiles[0].url}),(null===(l=e.socialProfiles)||void 0===l?void 0:l.length)&&e.socialProfiles.length>1&&{sameAs:e.socialProfiles.map((function(e){return e.url}))})}(t);case"organization":return function(e){var t,r,i,a,o,s,l,u,c=e.contacts&&(null===(t=e.contacts[0])||void 0===t?void 0:t.areas.filter((function(e){return 0!=!!e&&""!==e}))),d=e.contacts&&(null===(r=e.contacts[0])||void 0===r?void 0:r.languages.filter((function(e){return 0!=!!e&&""!==e}))),p=e.contacts&&(null===(i=e.contacts[0])||void 0===i?void 0:i.options.filter((function(e){return 0!=!!e&&""!==e})));return n(n(n(n(n(n({"@context":"https://schema.org","@type":e.type,name:e.name},e.alternateName&&{alternateName:e.alternateName}),{url:e.url,logo:null===(a=e.logo)||void 0===a?void 0:a.src}),1===(null===(o=e.contacts)||void 0===o?void 0:o.length)&&{contactPoint:n(n({"@type":"ContactPoint",telephone:e.contacts[0].phone},e.contacts[0].type&&{contactType:e.contacts[0].type}),{areaServed:0===(null==c?void 0:c.length)?"":1===(null==c?void 0:c.length)?c[0]:c,availableLanguage:0===(null==d?void 0:d.length)?"":1===(null==d?void 0:d.length)?d[0]:d,contactOption:0===(null==p?void 0:p.length)?"":1===(null==p?void 0:p.length)?p[0]:p})}),(null===(s=e.contacts)||void 0===s?void 0:s.length)&&e.contacts.length>1&&{contactPoint:e.contacts.map((function(t){var r=e.contacts&&t.areas.filter((function(e){return 0!=!!e&&""!==e})),i=e.contacts&&t.languages.filter((function(e){return 0!=!!e&&""!==e})),a=e.contacts&&t.options.filter((function(e){return 0!=!!e&&""!==e}));return n(n({"@type":"ContactPoint",telephone:t.phone},t.type&&{contactType:t.type}),{areaServed:0===(null==r?void 0:r.length)?"":1===(null==r?void 0:r.length)?r[0]:r,availableLanguage:0===(null==i?void 0:i.length)?"":1===(null==i?void 0:i.length)?i[0]:i,contactOption:0===(null==a?void 0:a.length)?"":1===(null==a?void 0:a.length)?a[0]:a})}))}),1===(null===(l=e.socials)||void 0===l?void 0:l.length)&&{sameAs:e.socials[0].url}),(null===(u=e.socials)||void 0===u?void 0:u.length)&&e.socials.length>1&&{sameAs:e.socials.map((function(e){return e.url}))})}(t);case"person":return function(e){var t,r,i;return n(n(n(n({"@context":"https://schema.org/","@type":"Person",name:e.name,url:e.url,image:null===(t=e.image)||void 0===t?void 0:t.src},1===(null===(r=e.socialProfiles)||void 0===r?void 0:r.length)&&{sameAs:e.socialProfiles[0].url}),(null===(i=e.socialProfiles)||void 0===i?void 0:i.length)&&e.socialProfiles.length>1&&{sameAs:e.socialProfiles.map((function(e){return e.url}))}),e.jobTitle&&{jobTitle:e.jobTitle}),e.company&&{worksFor:{"@type":"Organization",name:e.company}})}(t);case"product":return function(e){var t,r,i;return n(n(n(n(n(n(n(n(n(n(n(n({"@context":"https://schema.org/","@type":"Product",name:e.name,image:null===(t=e.image)||void 0===t?void 0:t.src},e.description&&{description:e.description}),e.brand&&{brand:{"@type":"Brand",name:e.brand}}),e.sku&&{sku:e.sku}),e.gtin8&&{gtin8:e.gtin8}),e.gtin13&&{gtin13:e.gtin13}),e.gtin14&&{gtin14:e.gtin14}),e.mpn&&{mpn:e.mpn}),e.ratingValue&&{aggregateRating:n(n({"@type":"AggregateRating",ratingValue:e.ratingValue,bestRating:e.bestRating},e.worstRating&&{worstRating:e.worstRating}),e.ratingCount&&{ratingCount:e.ratingCount})}),1===(null===(r=e.reviews)||void 0===r?void 0:r.length)&&{review:n(n(n(n(n({"@type":"Review",reviewBody:e.reviews[0].reviewBody},e.reviews[0].name&&{name:e.reviews[0].name}),e.reviews[0].datePublished&&{datePublished:e.reviews[0].datePublished}),{author:{"@type":"Person",name:e.reviews[0].author}}),e.reviews[0].publisher&&{publisher:{"@type":"Organization",name:e.reviews[0].publisher}}),e.reviews[0].ratingValue&&{reviewRating:{"@type":"Rating",ratingValue:e.reviews[0].ratingValue}})}),(null===(i=e.reviews)||void 0===i?void 0:i.length)&&e.reviews.length>1&&{review:e.reviews.map((function(e){return n(n(n(n(n({"@type":"Review",reviewBody:e.reviewBody},e.name&&{name:e.name}),e.datePublished&&{datePublished:e.datePublished}),{author:{"@type":"Person",name:e.author}}),e.publisher&&{publisher:{"@type":"Organization",name:e.publisher}}),e.ratingValue&&{reviewRating:{"@type":"Rating",ratingValue:e.ratingValue}})}))}),"offer"===e.offerType&&{offers:n(n(n({"@type":"Offer",url:e.url,priceCurrency:e.priceCurrency,price:Number.isNaN(e.price)?"":e.price},e.priceValidUntil&&{priceValidUntil:e.priceValidUntil}),"not-specified"!==e.availability&&{availability:"https://schema.org/"+e.availability}),"not-specified"!==e.itemCondition&&{itemCondition:"https://schema.org/"+e.itemCondition+"Condition"})}),"aggregate-offer"===e.offerType&&{offers:n(n(n({"@type":"AggregateOffer",url:e.url,priceCurrency:e.priceCurrency},e.lowPrice&&{lowPrice:e.lowPrice}),e.highPrice&&{highPrice:e.highPrice}),e.offerCount&&{offerCount:e.offerCount})})}(t);case"thing":default:return N(t);case"video":return function(e){var t,r,i;return n(n(n(n(n(n(n(n({"@context":"https://schema.org","@type":"VideoObject",name:e.name,description:e.description},1===(null===(t=e.thumbnail)||void 0===t?void 0:t.length)&&{thumbnailUrl:null===(r=e.thumbnail[0])||void 0===r?void 0:r.src}),(null===(i=e.thumbnail)||void 0===i?void 0:i.length)&&e.thumbnail.length>1&&{thumbnailUrl:e.thumbnail.map((function(e){return null==e?void 0:e.src}))}),{uploadDate:e.uploadDate}),(e.minutes||e.seconds)&&{duration:"PT"+(Number.isNaN(e.minutes)?0:e.minutes)+"M"+(Number.isNaN(e.seconds)?0:e.seconds)+"S"}),e.contentUrl&&{contentUrl:e.contentUrl}),e.embedUrl&&{embedUrl:e.embedUrl}),e.seekToAction&&{potentialAction:{"@type":"SeekToAction",target:e.seekToAction+"={seek_to_second_number}","startOffset-input":"required name=seek_to_second_number"}}),e.publisherName&&{publisher:{"@type":"Organization",name:e.publisherName,logo:{"@type":"ImageObject",url:e.publisherLogoUrl,width:Number.isNaN(e.publisherLogoWidth)?"":e.publisherLogoWidth,height:Number.isNaN(e.publisherLogoHeight)?"":e.publisherLogoHeight}}})}(t);case"website":return function(e){return{"@context":"https://schema.org/","@type":"WebSite",name:e.name,url:e.url,potentialAction:{"@type":"SearchAction",target:e.searchUrl+"{search_term_string}"+e.optionalStringAfterQuery,"query-input":"required name=search_term_string"}}}(t)}},E=function(e){if(!e.meta.schemaOrg)return null;var t=e.meta.schemaOrg,n=t.type,r=t.values;return JSON.stringify(k(n,r))},_=function(e){var t=e.page,n=E(t);return n?d.createElement("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:n}}):null},V=function(e,r,s,l){return i(void 0,void 0,void 0,(function(){var i,u,c,d,p,m,v,f,h,g,y,b,w,T,A,P,x,C,O,N,k;return a(this,(function(a){switch(a.label){case 0:i=[],a.label=1;case 1:a.trys.push([1,19,20,21]),u=o(e),c=u.next(),a.label=2;case 2:return c.done?[3,18]:(d=c.value,p=n(n({},d),{props:n({},d.props)}),(null==(m=s[d.type])?void 0:m.schema)&&m.schema.getExternalData&&"function"==typeof m.schema.getExternalData&&r?[4,m.schema.getExternalData(r,d.props,l)]:[3,4]);case 3:return v=a.sent(),p.props=n(n({},p.props),v),[3,6];case 4:return(null==m?void 0:m.schema)&&m.schema.getData&&"function"==typeof m.schema.getData&&r?[4,m.schema.getData(r,d.props,l)]:[3,6];case 5:v=a.sent(),p.props=n(n({},p.props),v),a.label=6;case 6:if(!((null==m?void 0:m.schema)&&m.schema.repeaterItems&&m.schema.repeaterItems.length>0))return[3,14];a.label=7;case 7:a.trys.push([7,12,13,14]),C=void 0,f=o(m.schema.repeaterItems),h=f.next(),a.label=8;case 8:return h.done?[3,11]:(g=h.value,p.props[g.name]&&p.props[g.name].length>0?(y=p.props,b=g.name,[4,V(p.props[g.name],r,s)]):[3,10]);case 9:y[b]=a.sent(),a.label=10;case 10:return h=f.next(),[3,8];case 11:return[3,14];case 12:return w=a.sent(),C={error:w},[3,14];case 13:try{h&&!h.done&&(O=f.return)&&O.call(f)}finally{if(C)throw C.error}return[7];case 14:return d.isEmbed&&(null===(k=null===(N=d.props)||void 0===N?void 0:N[t.EmbedContent])||void 0===k?void 0:k.content)?(T=d.props[t.EmbedContent],[4,V(d.props[t.EmbedContent].content,d.props[t.EmbedContent],s)]):[3,16];case 15:T.content=a.sent(),a.label=16;case 16:i.push(p),a.label=17;case 17:return c=u.next(),[3,2];case 18:return[3,21];case 19:return A=a.sent(),P={error:A},[3,21];case 20:try{c&&!c.done&&(x=u.return)&&x.call(u)}finally{if(P)throw P.error}return[7];case 21:return[2,i]}}))}))},L=function(e,t,n){return i(void 0,void 0,void 0,(function(){return a(this,(function(r){return[2,V(e.content,e,t,n)]}))}))},S=function(e,t,n){return i(void 0,void 0,void 0,(function(){var r,i;return a(this,(function(a){switch(a.label){case 0:return r=null,(null==(i=null==t?void 0:t.find((function(t){return t.name===e.type})))?void 0:i.getExternalData)&&"function"==typeof i.getExternalData?[4,i.getExternalData(e,n)]:[3,2];case 1:return(r=a.sent())&&"object"==typeof r?[2,r]:[2,null];case 2:return[2,null]}}))}))},M=function(o,s,l,u){return void 0===u&&(u=!0),i(void 0,void 0,void 0,(function(){var c,d,p,m,v;return a(this,(function(f){switch(f.label){case 0:return c=u?o.content.filter((function(e){return e.props[t.EmbedProp]})):[],[4,Promise.all(c.map((function(e){return i(void 0,void 0,void 0,(function(){var r,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:r=e.props[t.EmbedProp],i=U(r),a.label=1;case 1:return a.trys.push([1,5,,6]),i&&i.id&&i.language?[4,l(i)]:[3,3];case 2:return s=a.sent(),[3,4];case 3:s=null,a.label=4;case 4:return o=s,[2,n(n({},e),{isEmbed:!0,props:n(n({},e.props),(u={},u[t.EmbedContent]=o,u))})];case 5:return a.sent(),[2,null];case 6:return[2]}}))}))})))];case 1:return d=f.sent(),p=o.content.reduce((function(n,i){if(u&&i.props[t.EmbedProp]){var a=U(i.props[t.EmbedProp]),o=d.find((function(e){var n=U(null==e?void 0:e.props[t.EmbedProp]);return(null==n?void 0:n.id)===(null==a?void 0:a.id)&&(null==n?void 0:n.language)===(null==a?void 0:a.language)}));return o?r(r([],e(n),!1),[o],!1):n}return r(r([],e(n),!1),[i],!1)}),[]),[4,Promise.all(d.map((function(e){return i(void 0,void 0,void 0,(function(){return a(this,(function(n){return e?[2,S(e.props[t.EmbedContent],s)]:[2,null]}))}))})))];case 2:return m=f.sent(),v=m.reduce((function(e,t){return t?n(n({},e),t):e}),{}),[2,{contentWithEmbeds:p,externalDataEmbed:v}]}}))}))},U=function(t){if(!t)return null;var n,r;if("string"==typeof t){var i=t.split("_");if(!Array.isArray(i)||0===i.length)return null;var a=e(i);n=a[0],r=a.slice(1).join("_")}else{if(!t.id||!t.language)return null;n=null==t?void 0:t.id,r=t.language}return{id:n,language:r}},R=function(t,n){return i(void 0,void 0,void 0,(function(){var r,i,o,l,u,c;return a(this,(function(a){switch(a.label){case 0:if(!t)return[2,null];if(r=t&&"string"==typeof t?t.split("_"):null,!Array.isArray(r)||0===r.length)return[2,null];i=e(r),o=i[0],l=i.slice(1),u=l.join("_"),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,n({id:o,language:u})];case 2:return(c=a.sent()).content,[2,s(c,["content"])];case 3:return a.sent(),console.error("Page not found:",o,u),[3,4];case 4:return[2,null]}}))}))},j=function(t,s,l){return i(void 0,void 0,void 0,(function(){var i,u,c,d,p,m,v,f,h,g,y,b,w,T,A,P,x,C,O,N,k,E,_,V,L,S,M,U,H,B,I,D,q,z,W,F;return a(this,(function(a){switch(a.label){case 0:i=[],a.label=1;case 1:a.trys.push([1,30,31,32]),u=o(t),c=u.next(),a.label=2;case 2:if(c.done)return[3,29];if(d=c.value,p=n(n({},d),{props:n({},d.props)}),m=s[d.type],v=null===(F=null==m?void 0:m.schema.sideEditProps)||void 0===F?void 0:F.reduce((function(t,n){var i;if(n.groupName){var a=n.props.filter((function(e){var t;return!!(null===(t=e.relationshipOptions)||void 0===t?void 0:t.embedValues)}));return r(r([],e(t),!1),e(a),!1)}return(null===(i=n.relationshipOptions)||void 0===i?void 0:i.embedValues)?r(r([],e(t),!1),[n],!1):t}),[]),!(v&&v.length>0))return[3,19];a.label=3;case 3:a.trys.push([3,17,18,19]),B=void 0,f=o(v),h=f.next(),a.label=4;case 4:if(h.done)return[3,16];if(g=h.value,y=p.props[g.name],!Array.isArray(y))return[3,13];b=[],a.label=5;case 5:a.trys.push([5,10,11,12]),D=void 0,w=o(y),T=w.next(),a.label=6;case 6:return T.done?[3,9]:(A=T.value,[4,R(A,l)]);case 7:(P=a.sent())&&b.push(P),a.label=8;case 8:return T=w.next(),[3,6];case 9:return[3,12];case 10:return x=a.sent(),D={error:x},[3,12];case 11:try{T&&!T.done&&(q=w.return)&&q.call(w)}finally{if(D)throw D.error}return[7];case 12:return p.props["".concat(g.name,"_embed")]=b,[3,15];case 13:return C=p.props,O="".concat(g.name,"_embed"),[4,R(y,l)];case 14:C[O]=a.sent(),a.label=15;case 15:return h=f.next(),[3,4];case 16:return[3,19];case 17:return N=a.sent(),B={error:N},[3,19];case 18:try{h&&!h.done&&(I=f.return)&&I.call(f)}finally{if(B)throw B.error}return[7];case 19:if(!((null==m?void 0:m.schema)&&m.schema.repeaterItems&&m.schema.repeaterItems.length>0))return[3,27];a.label=20;case 20:a.trys.push([20,25,26,27]),z=void 0,k=o(m.schema.repeaterItems),E=k.next(),a.label=21;case 21:return E.done?[3,24]:(_=E.value,p.props[_.name]&&p.props[_.name].length>0?(V=p.props,L=_.name,[4,j(p.props[_.name],s,l)]):[3,23]);case 22:V[L]=a.sent(),a.label=23;case 23:return E=k.next(),[3,21];case 24:return[3,27];case 25:return S=a.sent(),z={error:S},[3,27];case 26:try{E&&!E.done&&(W=k.return)&&W.call(k)}finally{if(z)throw z.error}return[7];case 27:i.push(p),a.label=28;case 28:return c=u.next(),[3,2];case 29:return[3,32];case 30:return M=a.sent(),U={error:M},[3,32];case 31:try{c&&!c.done&&(H=u.return)&&H.call(u)}finally{if(U)throw U.error}return[7];case 32:return[2,i]}}))}))},H=function(t,i){var a,s,l,u,c,d,p,m=[];try{for(var v=o(t),f=v.next();!f.done;f=v.next()){var h=f.value,g=n(n({},h),{props:n({},h.props)});if("__RB_TEMPLATE_SLOT"===h.type&&h.props.slotName&&h.props.slotItems&&h.props.slotItems.length>0)g.props.slotItems=H(g.props.slotItems,i),m.push(g);else{var y=i[h.type],b=null===(p=null==y?void 0:y.schema.sideEditProps)||void 0===p?void 0:p.reduce((function(t,n){var i;if(n.groupName){var a=n.props.filter((function(e){var t;return!!(null===(t=e.relationshipOptions)||void 0===t?void 0:t.embedValues)}));return r(r([],e(t),!1),e(a),!1)}return(null===(i=n.relationshipOptions)||void 0===i?void 0:i.embedValues)?r(r([],e(t),!1),[n],!1):t}),[]);if(b&&b.length>0)try{for(var w=(l=void 0,o(b)),T=w.next();!T.done;T=w.next()){var A=T.value;delete g.props["".concat(A.name,"_embed")]}}catch(e){l={error:e}}finally{try{T&&!T.done&&(u=w.return)&&u.call(w)}finally{if(l)throw l.error}}if(y&&y.schema.repeaterItems&&y.schema.repeaterItems.length>0)try{for(var P=(c=void 0,o(y.schema.repeaterItems)),x=P.next();!x.done;x=P.next()){var C=x.value;g.props[C.name]&&g.props[C.name].length>0&&(g.props[C.name]=H(g.props[C.name],i))}}catch(e){c={error:e}}finally{try{x&&!x.done&&(d=P.return)&&d.call(P)}finally{if(c)throw c.error}}m.push(g)}}}catch(e){a={error:e}}finally{try{f&&!f.done&&(s=v.return)&&s.call(v)}finally{if(a)throw a.error}}return m},B=function(t,s,l){return i(void 0,void 0,void 0,(function(){var i,u,c,d,p,m,v,f,h,g,y,b,w,T,A,P,x,C,O,N,k;return a(this,(function(a){switch(a.label){case 0:if(!t.customValues)return[2,void 0];if(i=n({},t.customValues),u=s.find((function(e){return e.name===t.type})),c=null===(k=null==u?void 0:u.customFields)||void 0===k?void 0:k.reduce((function(t,n){var i;if(n.groupName){var a=n.props.filter((function(e){var t;return!!(null===(t=e.relationshipOptions)||void 0===t?void 0:t.embedValues)}));return r(r([],e(t),!1),e(a),!1)}return(null===(i=n.relationshipOptions)||void 0===i?void 0:i.embedValues)?r(r([],e(t),!1),[n],!1):t}),[]),!(c&&c.length>0))return[3,17];a.label=1;case 1:a.trys.push([1,15,16,17]),d=o(c),p=d.next(),a.label=2;case 2:if(p.done)return[3,14];if(m=p.value,v=t.customValues[m.name],!Array.isArray(v))return[3,11];f=[],a.label=3;case 3:a.trys.push([3,8,9,10]),O=void 0,h=o(v),g=h.next(),a.label=4;case 4:return g.done?[3,7]:(y=g.value,[4,R(y,l)]);case 5:(b=a.sent())&&f.push(b),a.label=6;case 6:return g=h.next(),[3,4];case 7:return[3,10];case 8:return w=a.sent(),O={error:w},[3,10];case 9:try{g&&!g.done&&(N=h.return)&&N.call(h)}finally{if(O)throw O.error}return[7];case 10:return i["".concat(m.name,"_embed")]=f,[3,13];case 11:return T=i,A="".concat(m.name,"_embed"),[4,R(v,l)];case 12:T[A]=a.sent(),a.label=13;case 13:return p=d.next(),[3,2];case 14:return[3,17];case 15:return P=a.sent(),x={error:P},[3,17];case 16:try{p&&!p.done&&(C=d.return)&&C.call(d)}finally{if(x)throw x.error}return[7];case 17:return[2,i]}}))}))},I=function(e,t,n,r){return i(void 0,void 0,void 0,(function(){var i,o;return a(this,(function(a){switch(a.label){case 0:return[4,j(e.content,n,r)];case 1:return i=a.sent(),[4,B(e,t,r)];case 2:return o=a.sent(),[2,{contentWithRelationshipValues:i,customValuesWithRelationshipValues:o}]}}))}))},D=function(t,i,a){var s=function(t,i){var a,s,l;if(t.customValues){var u=n({},t.customValues),c=i.find((function(e){return e.name===t.type})),d=null===(l=null==c?void 0:c.customFields)||void 0===l?void 0:l.reduce((function(t,n){var i;if(n.groupName){var a=n.props.filter((function(e){var t;return!!(null===(t=e.relationshipOptions)||void 0===t?void 0:t.embedValues)}));return r(r([],e(t),!1),e(a),!1)}return(null===(i=n.relationshipOptions)||void 0===i?void 0:i.embedValues)?r(r([],e(t),!1),[n],!1):t}),[]);if(d&&d.length>0)try{for(var p=o(d),m=p.next();!m.done;m=p.next()){var v=m.value;delete u["".concat(v.name,"_embed")]}}catch(e){a={error:e}}finally{try{m&&!m.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}return u}}(t,i),l=H(t.content,a);return n(n({},t),{customValues:s,content:l})},q=function(t){if(!t)return null;if(y)return y;var i,a=null==(i=l(t)?u(t):r([],e(t),!1))?void 0:i.reduce((function(e,t){var r;return n(n({},e),((r={})[t.schema.name]=t,r))}),{});return y=a,a},z=function(t){return t.reduce((function(t,n){var i=[];for(var a in n.props)Array.isArray(n.props[a])&&n.props[a].length>0&&n.props[a][0].props?i.push.apply(i,r([],e(z(n.props[a])),!1)):i.push(b.serialize(n.props[a]));return r(r([],e(t),!1),e(i),!1)}),[])};export{T as E,_ as J,b as P,E as a,L as b,A as c,M as d,S as e,O as f,z as g,q as h,I as i,B as j,p as k,m as l,C as m,v as n,w as o,P as p,D as r};
@@ -0,0 +1 @@
1
+ import{_ as e,a as r,b as n,c as t,g as o,d as i,p as a,e as c}from"./react-bricks-Do754F2x.esm.js";var s={isAdmin:!1,bricks:{}},p=new(function(){function p(){return p.instance?console.warn("Constructor - instance already created"):(p.instance=this,s.pid=Math.floor(1e3*Math.random())),p.instance}return p.prototype.register=function(e){s.config&&Object.keys(s.bricks).length>0||(s.config=e,s.bricks=p.instance.mapConfigToBricks(e))},p.prototype.setBlock=function(e){s.currentBlock=e},p.prototype.setPage=function(e){s.currentPage=e},p.prototype.setIsAdmin=function(e){s.isAdmin=e},p.prototype.getConfig=function(){if(!s.config)throw new Error("React Bricks RSC not registered [1]");return s.config},p.prototype.getBrick=function(e){if(!s.config)throw new Error("React Bricks RSC not registered [2]");return s.bricks[e.type]?s.bricks[e.type]:null},p.prototype.getBricks=function(){if(!s.config)throw new Error("React Bricks RSC not registered [3]");return s.bricks},p.prototype.getPage=function(){return s.currentPage},p.prototype.getPageValues=function(){if(!s.currentPage)return null;var r=s.currentPage;return r.content,e(r,["content"])},p.prototype.getBlock=function(){return s.currentBlock||null},p.prototype.getBlockValue=function(e){return s.currentBlock&&s.currentBlock.props[e]?s.currentBlock.props[e]:null},p.prototype.getPageType=function(e){var r,n;return e&&(null===(r=s.config)||void 0===r?void 0:r.pageTypes)&&(null===(n=s.config)||void 0===n?void 0:n.pageTypes.find((function(r){return r.name===e.type})))},p.prototype.isAdmin=function(){return s.isAdmin},p.prototype.isRegistered=function(){return!!s.config},p.prototype.mapConfigToBricks=function(e){var s,p=e.bricks;if(p&&0!==p.length||(console.warn("No bricks provided. Using default paragraph."),p=[]),e.pageTypes||console.warn("No Page type schema provided. Using default page."),!Array.isArray(p))throw console.error('"bricks" should be an array of Bricks or an array of Themes'),new Error('"bricks" should be an array of Bricks or an array of Themes');if(!Array.isArray(e.pageTypes))throw console.error('"pageTypes" should be an array'),new Error('"pageTypes" should be an array');r(p)?(s=n([],t(p),!1),p=o(s)):(s=i(p),p=n([],t(p),!1));var u=function(){return null};return u.schema={name:"default-embed-brick",label:"Embed Page",category:"Embed",sideEditProps:[{name:"RB_PAGE_EMBED",label:"Embed page / entity",type:"RELATIONSHIP",relationshipOptions:{references:"",multiple:!1,embedValues:!1},helperText:"Choose a page, save to view it."}]},e.enableDefaultEmbedBrick&&(null==p||p.push(u),s=a(s,u)),null==p?void 0:p.reduce((function(e,r){var n;return c(c({},e),((n={})[r.schema.name]=r,n))}),{})},p}());Object.freeze(p);export{p as r};
package/react-bricks.d.ts CHANGED
@@ -7,21 +7,6 @@ import * as react_query from 'react-query';
7
7
  import { UseQueryResult } from 'react-query';
8
8
  export { v4 as uuid } from 'uuid';
9
9
 
10
- declare const useAdminContext: () => types.IReadAdminContext;
11
-
12
- /**
13
- * Props for Link component
14
- */
15
- interface LinkProps {
16
- href: string;
17
- target?: string;
18
- className?: string;
19
- activeClassName?: string;
20
- simpleAnchor?: boolean;
21
- }
22
- declare type LinkPropsReal = React.PropsWithChildren<Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof LinkProps> & LinkProps>;
23
- declare const Link: React.FC<LinkPropsReal>;
24
-
25
10
  declare namespace types {
26
11
  export const EmbedProp = "RB_PAGE_EMBED";
27
12
  export const EmbedContent = "RB_PAGE_EMBED_CONTENT";
@@ -251,6 +236,7 @@ declare namespace types {
251
236
  advancedDam: boolean;
252
237
  workingCopy: boolean;
253
238
  approvalWorkflow: boolean;
239
+ template: boolean;
254
240
  };
255
241
  } | null;
256
242
  /**
@@ -603,6 +589,19 @@ declare namespace types {
603
589
  canAddAfter?: boolean;
604
590
  canAddBefore?: boolean;
605
591
  }
592
+ /**
593
+ * TemplateSlot type
594
+ */
595
+ export type TemplateSlot = {
596
+ slotName: string;
597
+ label: string;
598
+ min?: number;
599
+ max?: number;
600
+ allowedBlockTypes?: string[];
601
+ excludedBlockTypes?: string[];
602
+ editable?: boolean;
603
+ getDefaultContent?: () => (string | IBrickStory | IContentBlock)[];
604
+ };
606
605
  /**
607
606
  * Page type
608
607
  */
@@ -622,6 +621,7 @@ declare namespace types {
622
621
  metaImageAspectRatio?: number;
623
622
  categories?: ICategory[];
624
623
  slugPrefix?: ISlugPrefix;
624
+ template?: Array<TemplateSlot>;
625
625
  }
626
626
  /**
627
627
  * Structure returned by the cleanBlocks function
@@ -881,8 +881,23 @@ declare namespace types {
881
881
  * Constructor for a Block with Modal plugin
882
882
  */
883
883
  export type BlockWithModalPluginConstructor = (blockPlugin: BlockWithModalPlugin) => RichTextPlugin;
884
- export {};
884
+ export { };
885
+ }
886
+
887
+ declare const useAdminContext: () => types.IReadAdminContext;
888
+
889
+ /**
890
+ * Props for Link component
891
+ */
892
+ interface LinkProps {
893
+ href: string;
894
+ target?: string;
895
+ className?: string;
896
+ activeClassName?: string;
897
+ simpleAnchor?: boolean;
885
898
  }
899
+ declare type LinkPropsReal = React.PropsWithChildren<Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof LinkProps> & LinkProps>;
900
+ declare const Link: React.FC<LinkPropsReal>;
886
901
 
887
902
  /**
888
903
  * Props for Text
@@ -1148,6 +1163,8 @@ interface PageViewerProps {
1148
1163
  }
1149
1164
  declare const PageViewer: React.FC<PageViewerProps>;
1150
1165
 
1166
+ declare const Slot: React__default.FC<SlotProps>;
1167
+
1151
1168
  interface JsonLdProps {
1152
1169
  page: types.Page;
1153
1170
  }
@@ -1373,24 +1390,7 @@ declare const plugin$1: types.RichTextPlugin;
1373
1390
  declare const plugin: types.RichTextPlugin;
1374
1391
 
1375
1392
  declare namespace index {
1376
- export {
1377
- plugin$f as bold,
1378
- plugin$e as italic,
1379
- plugin$d as code,
1380
- plugin$c as highlight,
1381
- plugin$b as sub,
1382
- plugin$a as sup,
1383
- plugin$9 as link,
1384
- plugin$8 as heading1,
1385
- plugin$7 as heading2,
1386
- plugin$6 as heading3,
1387
- plugin$5 as heading4,
1388
- plugin$4 as heading5,
1389
- plugin$3 as heading6,
1390
- plugin$2 as quote,
1391
- plugin$1 as orderedList,
1392
- plugin as unorderedList,
1393
- };
1393
+ export { plugin$f as bold, plugin$d as code, plugin$8 as heading1, plugin$7 as heading2, plugin$6 as heading3, plugin$5 as heading4, plugin$4 as heading5, plugin$3 as heading6, plugin$c as highlight, plugin$e as italic, plugin$9 as link, plugin$1 as orderedList, plugin$2 as quote, plugin$b as sub, plugin$a as sup, plugin as unorderedList };
1394
1394
  }
1395
1395
 
1396
1396
  declare const AppSettings: React.FC;
@@ -1460,8 +1460,20 @@ declare const Admin: React.FC<AdminProps>;
1460
1460
 
1461
1461
  declare const Login: React.FC;
1462
1462
 
1463
+ declare const SsoLogin: React.FC;
1464
+
1465
+ declare const SsoLoginSuccess: React__default.FC;
1466
+
1467
+ declare const SsoLoginFailure: React__default.FC;
1468
+
1469
+ declare type EmailPasswordLoginUserCredentials = {
1470
+ email: string;
1471
+ password: string;
1472
+ keepLoggedIn: boolean;
1473
+ };
1474
+ declare type LoginUserCredentials = EmailPasswordLoginUserCredentials | SsoLoginUserCredentials;
1463
1475
  declare const useAuth: () => {
1464
- loginUser: (email: string, password: string, keepLoggedIn: boolean) => Promise<({
1476
+ loginUser: (credentials: LoginUserCredentials) => Promise<({
1465
1477
  id: string;
1466
1478
  email: string;
1467
1479
  firstName: string;
@@ -1520,11 +1532,18 @@ declare const useAuth: () => {
1520
1532
  advancedDam: boolean;
1521
1533
  workingCopy: boolean;
1522
1534
  approvalWorkflow: boolean;
1535
+ template: boolean;
1523
1536
  };
1524
1537
  } & {
1525
1538
  authToken: string;
1526
1539
  }) | null>;
1540
+ isLoggingIn: boolean;
1541
+ ssoStartLogin: (uniqueAppIdentifier: string) => Promise<{
1542
+ result: "OK" | "KO";
1543
+ redirectUrl: string;
1544
+ } | null>;
1545
+ isLogginInSso: boolean;
1527
1546
  logoutUser: () => void;
1528
1547
  };
1529
1548
 
1530
- export { Admin, AppSettings, Editor, File$1 as File, Image$1 as Image, JsonLd, Link, Login, MediaLibrary, Meta, PageViewer, _default as Plain, Playground, Preview, ReactBricks, Repeater, CompatibleRichText as RichText, RichText as RichTextExt, Text, blockPluginConstructor, blockWithModalPluginConstructor, cleanPage, fetchPage, fetchPages, fetchTags, getPagePlainText, getSchemaOrgData, markPluginConstructor, index as plugins, renderJsonLd, renderMeta, types, useAdminContext, useAuth, usePage$1 as usePage, usePage as usePagePublic, usePageValues, usePages, usePagesPublic, useReactBricksContext, useTagsPublic, useVisualEdit };
1549
+ export { Admin, AppSettings, Editor, File$1 as File, Image$1 as Image, JsonLd, Link, Login, MediaLibrary, Meta, PageViewer, _default as Plain, Playground, Preview, ReactBricks, Repeater, CompatibleRichText as RichText, RichText as RichTextExt, Slot, SsoLogin, SsoLoginFailure, SsoLoginSuccess, Text, blockPluginConstructor, blockWithModalPluginConstructor, cleanPage, fetchPage, fetchPages, fetchTags, getPagePlainText, getSchemaOrgData, markPluginConstructor, index as plugins, renderJsonLd, renderMeta, types, useAdminContext, useAuth, usePage$1 as usePage, usePage as usePagePublic, usePageValues, usePages, usePagesPublic, useReactBricksContext, useTagsPublic, useVisualEdit };