@apollosproject/canvas-embeds 2.1.2721 → 2.1.2723
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/package.json +1 -1
- package/widget/index.js +1 -1
package/package.json
CHANGED
package/widget/index.js
CHANGED
|
@@ -754,7 +754,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
754
754
|
height
|
|
755
755
|
url
|
|
756
756
|
}
|
|
757
|
-
`);function $Fr(e){return e?.__typename===`HtmlFeature`?e.content??null:e?.__typename===`TextFeature`?e.body??null:null}var eIr=new Set([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`p`,`li`]);function tIr(e){return e.map(e=>e.type===`text`?e.data:`children`in e?tIr(e.children):``).join(``)}function nIr(e){return tIr(e).replace(/\s+/g,` `).trim()}function rIr(e){return nIr((0,CT.htmlToDOM)(e))}function iIr(e,t){for(let n of e){if(t.length>=2)return;if(`name`in n&&`children`in n){if(eIr.has(n.name.toLowerCase())){let e=nIr([n]);e&&t.push(e);continue}iIr(n.children,t)}}}function aIr(e){let t=[];if(iIr((0,CT.htmlToDOM)(e),t),t.length===0){let n=rIr(e);n&&t.push(n)}return t}function oIr(e){let t=[];for(let n of e??[]){let e=$Fr(n);if(e){for(let n of aIr(e))if(t.push(n),t.length===2)return{heading:t[0],sub:t[1]}}}return{heading:t[0]??`Untitled`,sub:null}}Oxe(),Nxe();var sIr=`truncate overflow-hidden text-ellipsis whitespace-nowrap`,w7={card:[`z-0 overflow-visible px-4`],contractedCard:[`cursor-pointer py-4`],expandedCard:[`is-expanded cursor-text -mx-4 pt-12 pb-8`],expandedFill:`bg-gray-0/25 dark:bg-gray-900/25`,content:[`overflow-hidden`],summary:[`pr-14`],catchClicks:[`absolute inset-0 z-[5] cursor-pointer`],button:[`absolute right-4 z-10 flex items-center`],buttonContracted:[`top-1/2 -translate-y-1/2`],buttonExpanded:[`top-4`],children:[`flex flex-col gap-4 cursor-text`]};function cIr({heading:e,sub:t,empty:n=!1,expanded:r=!1,lockHeight:i=!0,onClick:a,children:o}){return(0,q.jsx)(cw,{childRadius:!1,interactive:!r,backgroundColor:r?w7.expandedFill:``,className:Yx(w7.card,r?w7.expandedCard:w7.contractedCard),onMouseDown:r?void 0:e=>{e.preventDefault(),e.stopPropagation()},onClick:r?void 0:()=>a?.(),children:(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`div`,{className:Yx(i&&!r&&w7.content),"data-testid":`section-summary-body`,children:[(0,q.jsx)(`div`,{"aria-hidden":!r||void 0,className:Yx(r?w7.children:i?`hidden`:`pointer-events-none invisible h-0 overflow-hidden`),children:o}),
|
|
757
|
+
`);function $Fr(e){return e?.__typename===`HtmlFeature`?e.content??null:e?.__typename===`TextFeature`?e.body??null:null}var eIr=new Set([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`p`,`li`]);function tIr(e){return e.map(e=>e.type===`text`?e.data:`children`in e?tIr(e.children):``).join(``)}function nIr(e){return tIr(e).replace(/\s+/g,` `).trim()}function rIr(e){return nIr((0,CT.htmlToDOM)(e))}function iIr(e,t){for(let n of e){if(t.length>=2)return;if(`name`in n&&`children`in n){if(eIr.has(n.name.toLowerCase())){let e=nIr([n]);e&&t.push(e);continue}iIr(n.children,t)}}}function aIr(e){let t=[];if(iIr((0,CT.htmlToDOM)(e),t),t.length===0){let n=rIr(e);n&&t.push(n)}return t}function oIr(e){let t=[];for(let n of e??[]){let e=$Fr(n);if(e){for(let n of aIr(e))if(t.push(n),t.length===2)return{heading:t[0],sub:t[1]}}}return{heading:t[0]??`Untitled`,sub:null}}Oxe(),Nxe();var sIr=`truncate overflow-hidden text-ellipsis whitespace-nowrap`,w7={card:[`z-0 overflow-visible px-4`],contractedCard:[`cursor-pointer py-4`],expandedCard:[`is-expanded cursor-text -mx-4 pt-12 pb-8`],expandedFill:`bg-gray-0/25 dark:bg-gray-900/25`,content:[`overflow-hidden`],summary:[`pr-14`],catchClicks:[`absolute inset-0 z-[5] cursor-pointer`],button:[`absolute right-4 z-10 flex items-center`],buttonContracted:[`top-1/2 -translate-y-1/2`],buttonExpanded:[`top-4`],children:[`flex flex-col gap-4 cursor-text`]};function cIr({heading:e,sub:t,empty:n=!1,expanded:r=!1,lockHeight:i=!0,onClick:a,children:o}){return(0,q.jsx)(cw,{childRadius:!1,interactive:!r,backgroundColor:r?w7.expandedFill:``,className:Yx(w7.card,r?w7.expandedCard:w7.contractedCard),onMouseDown:r?void 0:e=>{e.preventDefault(),e.stopPropagation()},onClick:r?void 0:()=>a?.(),children:(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`div`,{className:Yx(i&&!r&&w7.content),"data-testid":`section-summary-body`,children:[(0,q.jsx)(`div`,{"aria-hidden":!r||void 0,className:Yx(r?w7.children:i?`hidden`:`pointer-events-none invisible h-0 overflow-hidden`),children:o}),(0,q.jsxs)(`div`,{className:Yx(w7.summary,r&&`hidden`),contentEditable:!1,"aria-hidden":r||void 0,children:[(0,q.jsx)(`p`,{className:Yx(`m-0 text-base font-bold leading-6`,sIr,n?`italic text-fg-secondary dark:text-fg-secondary-dark`:`text-fg-primary dark:text-fg-primary-dark`),children:e}),(0,q.jsx)(`p`,{className:Yx(`m-0 mt-0.5 text-sm leading-[21px]`,sIr,t?`text-fg-secondary dark:text-fg-secondary-dark`:`text-fg-tertiary dark:text-fg-tertiary-dark`),children:t??`View More`})]})]}),(0,q.jsx)(`div`,{"data-testid":`expandable-section-catch`,"data-drag-handle":!0,contentEditable:!1,"aria-hidden":r||void 0,className:Yx(w7.catchClicks,r&&`hidden`)}),(0,q.jsx)(`div`,{contentEditable:!1,className:Yx(w7.button,r?w7.buttonExpanded:w7.buttonContracted),children:(0,q.jsx)(nw,{type:`button`,onClick:e=>{e.preventDefault(),e.stopPropagation(),a?.()},surface:r?`chrome`:`material`,circular:!0,"aria-label":r?`Close ${e}`:`Open ${e}`,children:r?(0,q.jsx)(hw,{size:16}):(0,q.jsx)(vw,{size:16})})})]})})}var lIr=({feature:e,children:t})=>{let[n,r]=(0,S.useState)(!1),i=Rke(),a=n||i,o=oIr(e?.features),s=o.heading===`Untitled`&&o.sub===null;return(0,q.jsx)(cIr,{heading:o.heading,sub:o.sub,empty:s,expanded:a,onClick:()=>r(e=>!e),children:a?t:null})};Xw(`
|
|
758
758
|
fragment ExpandableSectionFeatureFragment on ExpandableSectionFeature {
|
|
759
759
|
id
|
|
760
760
|
features {
|