@uniformdev/mesh-sdk-react 12.2.1-alpha.171 → 12.2.1-alpha.184
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.d.ts +1 -3
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/tailwind/plugin.js +1 -1
- package/dist/tailwind/plugin.mjs +1 -1
- package/package.json +10 -10
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,8 @@ import * as _uniformdev_mesh_sdk from '@uniformdev/mesh-sdk';
|
|
|
2
2
|
import { UniformMeshSDK, MeshLocation } from '@uniformdev/mesh-sdk';
|
|
3
3
|
export * from '@uniformdev/mesh-sdk';
|
|
4
4
|
import React, { ReactNode, SVGProps } from 'react';
|
|
5
|
-
import { ButtonProps as ButtonProps$1 } from 'reakit
|
|
5
|
+
import { ButtonProps as ButtonProps$1, MenuItemHTMLProps, InputProps as InputProps$1 } from 'reakit';
|
|
6
6
|
import { MenuHTMLProps, MenuProps as MenuProps$1, MenuStateReturn } from 'reakit/Menu';
|
|
7
|
-
import { MenuItemHTMLProps } from 'reakit';
|
|
8
|
-
import { InputProps as InputProps$1 } from 'reakit/Input';
|
|
9
7
|
import { TDate } from 'timeago.js';
|
|
10
8
|
|
|
11
9
|
/**
|
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var dt=Object.defineProperty;var mt=(e,t)=>{for(var o in t)dt(e,o,{get:t[o],enumerable:!0})};import ut,{createContext as ct,useContext as pt,useState as ft}from"react";var Ee=ct(void 0),Pe=({children:e})=>{let[t,o]=ft(),n;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let r=t||window.UniformMeshSDK.getCurrentLocation();n={location:{getValue:r.getValue,getMetadata:r.getMetadata,setValue:async s=>{await r.setValue(s),o(window.UniformMeshSDK.getCurrentLocation())}}}}return ut.createElement(Ee.Provider,{value:n},e)},ke=()=>{let e=pt(Ee);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function oo(){let{location:e}=ke();return{value:e==null?void 0:e.getValue(),setValue:e==null?void 0:e.setValue,metadata:e==null?void 0:e.getMetadata()}}import{initializeUniformMeshSDK as gt}from"@uniformdev/mesh-sdk";import{useEffect as vt,useState as Ve}from"react";var so=({autoResizingDisabled:e}={})=>{let[t,o]=Ve(),[n,r]=Ve();return vt(()=>{typeof window=="undefined"||n||(typeof window.UniformMeshSDK=="undefined"?gt({autoResizingDisabled:e}).then(s=>{r(s)}).catch(s=>{o(s)}):r(window.UniformMeshSDK))},[e]),{initializing:!n&&!t,error:t,sdk:n}};import Te,{createContext as ht,useContext as xt}from"react";var De=ht(void 0),co=({children:e})=>{let t;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(t={sdk:window.UniformMeshSDK}),Te.createElement(De.Provider,{value:t},Te.createElement(Pe,null,e))},Be=()=>{let e=xt(De);if(!e)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return e};function go(){let{sdk:e}=Be();return e}import Ge from"react";import{Button as bt}from"reakit/Button";var ee={primary:{default:"bg-primary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},secondary:{default:"bg-secondary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},tertiary:{default:"bg-tertiary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},quaternary:{default:"bg-primary text-white hover:bg-opacity-75 border-2 border-gray-500 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},unimportant:{default:"bg-brand-secondary-2 text-primary hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-brand-secondary-2 text-gray-600 cursor-not-allowed"}},te={base:"inline-flex items-center border-transparent font-medium focus:outline-none focus:ring",size:(e,t)=>({xs:`${t?"px-2.5 py-1.5 ":""}text-xs leading-4 ${e?"rounded":""}`,sm:`${t?"px-3 py-2 ":""}text-sm leading-4 ${e?"rounded-md":""}`,md:`${t?"px-4 py-2 ":""}text-sm leading-5 tracking-wider ${e?"rounded-md":""}`,lg:`${t?"px-4 py-2 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`,xl:`${t?"px-6 py-3 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`}),buttonType:(e,t)=>{if(!(!e||!ee[e]))return t?ee[e].disabled:ee[e].default}},K=Ge.forwardRef(({size:e="md",buttonType:t="primary",children:o,className:n,rounded:r=!1,disablePadding:s=!1,...f},g)=>{let p=[te.base,te.size(r,!s)[e],te.buttonType(t,f.disabled),n].join(" ");return Ge.createElement(bt,{className:p,ref:g,...f},o)});import E from"react";import*as oe from"react";var Ct=e=>oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...e},oe.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})),O=Ct;import*as ne from"react";var yt=e=>ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},ne.createElement("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})),A=yt;import*as _ from"react";var wt=e=>_.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},_.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11 10.98a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0v-6zm1-4.929a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}),_.createElement("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0z"})),N=wt;import*as re from"react";var St=e=>re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},re.createElement("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})),j=St;import*as ae from"react";var Mt=e=>ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...e},ae.createElement("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})),D=Mt;import*as ie from"react";var Nt=e=>ie.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},ie.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 39.2A19.2 19.2 0 1 0 20 .8a19.2 19.2 0 0 0 0 38.4Zm8.897-22.303a2.4 2.4 0 0 0-3.394-3.394L17.6 21.407l-3.103-3.104a2.4 2.4 0 0 0-3.394 3.394l4.8 4.8a2.4 2.4 0 0 0 3.394 0l9.6-9.6Z"})),R=Nt;var Lt={caution:{icon:D,descriptionColor:"text-yellow-700",iconColor:"text-yellow-400",titleColor:"text-yellow-800",containerColor:"bg-yellow-50"},danger:{icon:A,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},error:{icon:D,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},info:{icon:O,descriptionColor:"text-blue-700",iconColor:"text-blue-400",titleColor:"text-blue-800",containerColor:"bg-blue-50"},note:{icon:N,descriptionColor:"text-gray-700",iconColor:"text-gray-400",titleColor:"text-gray-800",containerColor:"bg-gray-50"},success:{icon:R,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"},tip:{icon:j,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"}},Ue=({type:e="info",title:t,children:o,className:n})=>{let r=Lt[e];if(!r)return null;let s=r.icon;return E.createElement("div",{"data-testid":"sdk-ui-callout",className:`rounded-md p-4 ${r.containerColor} ${n||""}`},E.createElement("div",{className:"flex"},E.createElement("div",{className:"flex-shrink-0"},E.createElement(s,{className:`h-5 w-5 ${r.iconColor}`})),E.createElement("div",{className:"ml-3"},t?E.createElement("h3",{className:`text-sm font-medium mb-2 ${r.titleColor}`},t):null,o?E.createElement("div",{className:`text-sm ${r.descriptionColor}`},o):null)))};import P from"react";import{Input as Et}from"reakit/Input";var se=({classNameContainer:e,classNameControl:t,classNameLabel:o,label:n,icon:r,id:s,disabled:f,...g})=>{let p={container:`uniform-input-container ${e||""}`,control:`uniform-input uniform-input-text${f?" uniform-input-disabled":""}${r?" pr-10":""} ${t||""}`,label:`uniform-input-label ${o||""}`};return P.createElement(P.Fragment,null,n?P.createElement("label",{htmlFor:s,className:p.label},n):null,P.createElement("div",{className:p.container},P.createElement(Et,{className:p.control,id:s,disabled:f,...g},v=>P.createElement("input",{...v,style:g.style})),r?P.createElement("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},r):null))};se.displayName="Input";import le from"react";import*as L from"react";var Pt=e=>L.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("g",{clipPath:"url(#magnifying-glass_svg__a)"},L.createElement("path",{d:"M11.539 0C5.484 0 .559 4.741.559 10.57c0 5.827 4.925 10.568 10.98 10.568 6.055 0 10.98-4.74 10.98-10.569C22.52 4.741 17.595 0 11.54 0Zm0 19.187c-4.937 0-8.954-3.866-8.954-8.618 0-4.752 4.017-8.618 8.954-8.618s8.954 3.866 8.954 8.618c0 4.752-4.017 8.618-8.954 8.618Z"}),L.createElement("path",{d:"m25.196 22.334-5.811-5.593a1.041 1.041 0 0 0-1.434 0 .95.95 0 0 0 0 1.38l5.812 5.593c.198.19.457.286.716.286.26 0 .519-.096.717-.286a.95.95 0 0 0 0-1.38Z"})),L.createElement("defs",null,L.createElement("clipPath",{id:"magnifying-glass_svg__a"},L.createElement("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),Z=Pt;function ze({onSearchTextChanged:e,disabled:t=!1,placeholder:o="Keyword search",inputFieldName:n="keywordSearch",disabledFieldSubmission:r=!1}){return le.createElement(se,{type:"text",name:n,placeholder:o,icon:le.createElement("div",{className:"pr-1"},le.createElement(Z,{className:"w-5 h-5 text-primary"})),onChange:g=>{e==null||e(g.currentTarget.value)},onKeyPress:g=>{g.key==="Enter"&&r&&g.preventDefault()},className:"uniform-input uniform-input-text pr-12 bg-gray-100",disabled:t,"aria-label":o})}import J from"react";var de=()=>J.createElement("span",{className:"loader",role:"presentation"},J.createElement("i",{className:"loader__dot"}),J.createElement("i",{className:"loader__dot"}),J.createElement("i",{className:"loader__dot"}));import V from"react";import{useMenuState as kt,Menu as Vt,MenuButton as Tt}from"reakit/Menu";var Ie=V.createContext({}),$e=()=>V.useContext(Ie),He=({menuLabel:e,menuTrigger:t,menuItemsContainerCssClasses:o,placement:n="auto",children:r})=>{let s=kt();return V.createElement(Ie.Provider,{value:s},V.createElement(Tt,{...s,ref:t.ref,...t.props},f=>V.cloneElement(t,f)),V.createElement(Vt,{...s,placement:n,"aria-label":e,className:`uniform-menu divide-y divide-gray-500 shadow-xl z-50 ${o}`},r))};import B from"react";import{MenuItem as Fe}from"reakit";var Oe=({children:e,className:t,hideMenuOnClick:o=!0,icon:n,...r})=>{let s=$e(),f=`uniform-menu-item bg-white ${(r==null?void 0:r.disabled)?"text-gray-500":"text-primary"} ${t||""}`,g=v=>{let h={...v};if(h.onClick){let y=h.onClick;h.onClick=m=>{s.hide(),y(m)}}return h};if(typeof e=="function")return B.createElement(Fe,{...s,...r,className:f},v=>{let h=o?g(v):v,y=e(h);return n?Ke(y,n):y});let p=o?g(r):r;return B.createElement(Fe,{...s,...p,className:f},n?Ke(e,n):e)};function Ke(e,t){return B.createElement("div",{className:"flex items-center justify-between"},B.createElement("div",null,e),B.createElement("div",{className:"ml-4"},t))}import i,{useState as z,useEffect as Kt,useRef as Ot}from"react";var pe={};mt(pe,{Caution:()=>D,Checkmark:()=>R,ChevronDown:()=>W,Close:()=>X,Danger:()=>A,ExclamationPoint:()=>O,Info:()=>N,Lightbulb:()=>j,MagnifyingGlass:()=>Z,MaximizeAlt:()=>Ae,MoreVerticalAlt:()=>U});import*as me from"react";var Dt=e=>me.createElement("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e},me.createElement("path",{d:"M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414Z"})),W=Dt;import*as G from"react";var Bt=e=>G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e},G.createElement("g",{fillRule:"evenodd"},G.createElement("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),G.createElement("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"}))),X=Bt;import*as ue from"react";var Gt=e=>ue.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},ue.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M3 3h6v2H6.462l4.843 4.843-1.415 1.414L5 6.367V9H3V3zm0 18h6v-2H6.376l4.929-4.928-1.415-1.414L5 17.548V15H3v6zm12 0h6v-6h-2v2.524l-4.867-4.866-1.414 1.414L17.647 19H15v2zm6-18h-6v2h2.562l-4.843 4.843 1.414 1.414L19 6.39V9h2V3z"})),Ae=Gt;import*as ce from"react";var Ut=e=>ce.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},ce.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M14 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})),U=Ut;import{useThrottle as At}from"react-use";import{v4 as _t}from"uuid";import u,{useState as zt,useRef as je,useEffect as It}from"react";function _e(e,t){let o=window.open(e,"_blank"),n=setInterval(()=>{(o==null?void 0:o.closed)&&(clearInterval(n),t())},500)}import{format as $t}from"timeago.js";var Re=({selectedItem:e,logoIcon:t,onDeselect:o,onEditClosed:n})=>{var y;let r=je(null),s=je(null),[f,g]=zt(!1);It(()=>{let m=S=>{r.current&&!r.current.contains(S.target)&&s.current&&!s.current.contains(S.target)&&g(!1)},x=()=>{g(!1)};return window.addEventListener("resize",x,!0),document.addEventListener("scroll",m,!0),document.addEventListener("mousedown",m),()=>{window.removeEventListener("resize",x,!0),document.removeEventListener("scroll",m,!0),document.removeEventListener("mousedown",m)}},[s]);let p=()=>{var m;if(g(!f),s.current&&r.current){let x=(m=r==null?void 0:r.current)==null?void 0:m.getBoundingClientRect();s.current.style.top=`${x.top+30}px`}},v=t&&typeof t!="string"?t:null,h=v?u.createElement(v,{className:"h-7 w-7"}):u.createElement("img",{src:t,alt:"CMS logo",className:"h-7 w-7"});return u.createElement("div",{className:"flex w-full border border-gray-300 rounded-md bg-gray-100",key:e.id},u.createElement("div",{className:"p-4 pl-8 flex flex-grow mr-2 gap-2 items-center relative"},u.createElement("div",{className:"flex-grow"},u.createElement("div",{className:"inline-flex relative items-start"},u.createElement("h4",{className:"text-primary font-bold leading-none mb-2",title:`ID: ${e.id}`,"data-test-id":"entry-id"},e.title||e.id||""),e.popoverData&&u.createElement(u.Fragment,null,u.createElement("button",{type:"button",ref:r,className:"ml-2 -my-1","aria-controls":"path-details",onClick:p},u.createElement(N,{className:"text-gray-700"})),u.createElement("div",{ref:s,className:`fixed bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 ${f?"visible":"invisible"}`},Object.entries(e.popoverData).map(([m,x],S)=>u.createElement("div",{className:"text-xs",key:S},u.createElement("span",{className:"font-bold mr-2"},m,":"),x))))),e.createdDate&&u.createElement("div",{className:"text-xs"},u.createElement("span",{className:"font-bold mr-2"},"Created:"),$t((y=e.createdDate)!=null?y:0)),u.createElement("div",{className:"flex gap-4"},e.metadata?Object.entries(e.metadata).filter(([m])=>["type","status"].includes(m.toLocaleLowerCase())).map(([m,x])=>u.createElement("span",{className:"text-sm",key:m},x)):null),e.metadata?Object.entries(e.metadata).filter(([m])=>!["type","status"].includes(m.toLocaleLowerCase())).map(([m,x])=>u.createElement("div",{className:"text-xs order-1",key:m},u.createElement("span",{className:"font-bold mr-2 order-1"},m,":"),x)):null),u.createElement("div",{className:"flex md:flex-row flex-col gap-2"},e.editLink?u.createElement("a",{href:e.editLink,title:"edit",rel:"noopener",target:"__blank",onClick:m=>{n&&(_e(m.currentTarget.href,()=>n(e)),m.preventDefault())},className:"flex justify-between items-center pl-4 pr-2 bg-white rounded border-2 border-gray-400 hover:bg-gray-100"},u.createElement("span",{className:"mr-2 text-sm"},"Edit"),h):null,u.createElement("button",{type:"button",onClick:m=>{m.preventDefault(),o(e)},className:"flex justify-between items-center px-4 bg-white rounded border-2 border-gray-400 h-10 hover:bg-gray-100"},u.createElement("span",{className:"mr-2 text-sm"},"Unlink"),u.createElement(X,{className:"w-4 h-4 text-red-600"})))))};import w,{useState as Ht,useRef as Ze,useEffect as Ft}from"react";var Je=({result:e,isSelected:t,triggerSelection:o})=>{let n=Ze(null),r=Ze(null),[s,f]=Ht(!1);Ft(()=>{function p(v){n.current&&!n.current.contains(v.target)&&r.current&&!r.current.contains(v.target)&&f(!1)}return document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[r]);let g=p=>{p.stopPropagation(),f(!s)};return w.createElement("div",{key:e.id,className:`p-2 cursor-pointer relative ${t?"bg-green-400 text-white":""}`,"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o()},e.title,e.popoverData&&t?w.createElement(w.Fragment,null,w.createElement("button",{type:"button",ref:n,className:"absolute top-0 bottom-0 right-2","aria-controls":"path-details",onClick:p=>g(p)},w.createElement(N,null)),w.createElement("div",{ref:r,className:`absolute top-4 right-10 bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 text-black ${s?"visible":"invisible"}`},e.metadata&&Object.entries(e.metadata).map(([p,v],h)=>w.createElement("div",{className:"text-xs",key:h},w.createElement("span",{className:"font-bold mr-2"},p,":"),v)),Object.entries(e.popoverData).map(([p,v],h)=>w.createElement("div",{className:"text-xs",key:h},w.createElement("span",{className:"font-bold mr-2"},p,":"),v)))):null)};import{Droppable as jt,DragDropContext as Rt,Draggable as Zt}from"react-beautiful-dnd";var Jt=({searchText:e,selectedContentType:t})=>{let o="No content found";return t&&(o=`No ${t} content was found`),e&&(o=`${o} for keyword '${e}'.`),i.createElement(Ue,{type:"info"},o)},Kn=({search:e,results:t,contentTypes:o,selectedItems:n,logoIcon:r,select:s,multiSelect:f,multiSelectId:g,rowComponent:p,selectedItemComponent:v,totalResults:h,resultsLoading:y,requireContentType:m,onAddNew:x,onEditClosed:S,onCancel:fe,noResultsComponent:We,helpComponent:Xe,onSort:q})=>{var Me,Ne,Le;let ge=()=>m?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[ve,he]=z(""),[M,xe]=z(ge),[I,Q]=z(!1),[$,H]=z([]),[qe,be]=z(!1),F=At(ve,750);Kt(()=>{e(F,{count:5,offset:0,contentType:M==="any"?void 0:M})},[F,M]);let Qe=a=>{$.includes(a.id)?H(c=>c.filter(k=>k!==a.id)):H(f?c=>[...c,a==null?void 0:a.id]:[a.id])},Ye=()=>{xe(ge()),he(""),H((n==null?void 0:n.length)?n.map(a=>a.id):[])},et=()=>{Q(a=>!a),I||Ye()},Ce=a=>{s((n==null?void 0:n.filter(c=>c.id!==a.id).map(c=>c.id))||[],"")},tt=a=>{a.preventDefault(),s($,M),Q(!1)},ot=a=>{a.preventDefault(),Q(!1),fe&&fe()},nt=a=>{a.preventDefault(),e(F,{count:5,offset:(t==null?void 0:t.length)||0,contentType:M==="any"?void 0:M}),be(!0);let c=setTimeout(()=>{be(!1)},750);return()=>clearTimeout(c)},ye=Ot(_t()),rt=!(n==null?void 0:n.length)||f,at=p||Je,we=v||Re,it=We||Jt,Se=r&&typeof r!="string"?r:null,st=Se?i.createElement(Se,{className:"h-9 w-9"}):i.createElement("img",{src:r,alt:"CMS logo",className:"h-9 w-9"}),lt=a=>{var c,k;if(a.destination&&a.source.droppableId===((c=a.destination)==null?void 0:c.droppableId)){let b=[...n||[]],[Y]=(k=b==null?void 0:b.splice(a.source.index,1))!=null?k:[];return b==null||b.splice(a.destination.index,0,Y),q==null||q(b.map(T=>T.id)),b}};return i.createElement("div",{className:"w-full"},i.createElement("div",{className:"relative my-4"},rt&&i.createElement("div",{className:"space-y-2"},i.createElement("div",{className:"py-3 px-2 bg-white rounded-lg border border-gray-300 mb-4","data-test-id":"component-search"},i.createElement("button",{className:"flex items-center w-full text-base relative",onClick:et,type:"button","aria-haspopup":!0,"aria-expanded":I,"aria-controls":ye.current},st,i.createElement("span",{className:"ml-4"},"Select"),i.createElement("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},i.createElement(W,{className:`w-5 h-5 text-standard transform transition-transform ${I?"rotate-180":"rotate-0"}`})))),i.createElement("div",{className:`${I?"block":"hidden"} py-3 px-4 space-y-4 bg-white rounded-lg border border-gray-300`},Xe||null,i.createElement("div",{className:"flex space-x-3"},i.createElement("select",{className:"uniform-input uniform-input-select w-1/3 bg-gray-100",onChange:a=>xe(a.target.value)},m?null:i.createElement("option",{value:"any",className:"bg-white text-primary"},"All content types"),o==null?void 0:o.map(a=>i.createElement("option",{value:a.id,key:a.id,className:"bg-white text-primary"},a.name))),i.createElement("div",{className:"flex-grow"},i.createElement(ze,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:he,disabledFieldSubmission:!0}))),i.createElement("div",{className:"overflow-y-scroll max-h-64 divide-y divide-gray-200 scrollbar",id:ye.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},(t==null?void 0:t.length)?t.map(a=>i.createElement(at,{key:a.id,isSelected:$.includes(a.id),result:a,triggerSelection:()=>Qe(a)})):y?null:i.createElement(it,{searchText:F||ve,selectedContentType:(Ne=(Me=o==null?void 0:o.find(a=>a.id===M))==null?void 0:Me.name)!=null?Ne:M}),!y&&typeof h!="undefined"&&t&&(t==null?void 0:t.length)<h&&i.createElement("button",{className:"block p-4 text-center w-full hover:bg-gray-100 focus:bg-gray-100 font-bold text-primary text-sm focus:outline-none",onClick:nt},qe?i.createElement(de,null):"Load More"),y&&!(t==null?void 0:t.length)?i.createElement("div",{className:"p-4 text-center w-full"},i.createElement(de,null)):null),i.createElement("div",{className:"flex justify-between"},i.createElement("div",null,x&&((Le=o==null?void 0:o.length)!=null?Le:0)>0?i.createElement(He,{menuLabel:"Add new menu",menuTrigger:i.createElement(K,{buttonType:"secondary"},"Add New")},o==null?void 0:o.map(a=>i.createElement(Oe,{key:a.id,className:"bg-white text-primary",onClick:()=>x(a)},a.name))):null),i.createElement("div",null,i.createElement(K,{buttonType:"unimportant",onClick:ot},"Cancel"),i.createElement(K,{className:"ml-5",disabled:!$.length,onClick:tt,"data-test-id":"entry-accept-button"},"Accept"))))),f?i.createElement(Rt,{onDragEnd:a=>lt(a)},i.createElement(jt,{droppableId:g||"canvas-multi-select"},a=>i.createElement("div",{...a.droppableProps,ref:a.innerRef,className:"space-y-1"},n==null?void 0:n.map((c,k)=>{if(c==null?void 0:c.id)return i.createElement(Zt,{key:c.id,draggableId:c.id,index:k},(b,Y)=>i.createElement("div",{className:"relative group",ref:b.innerRef,...b.draggableProps,...b.dragHandleProps},i.createElement("span",{className:`absolute left-0 top-0 bottom-0 my-auto flex items-center ${Y.isDragging?"":"opacity-0 group-hover:opacity-30"}`},i.createElement(U,{className:"text-brand-secondary-1 absolute left-1.5",width:24,height:24}),i.createElement(U,{className:"text-brand-secondary-1",width:24,height:24})),i.createElement(we,{key:`selected-item-${c.id}`,logoIcon:r,selectedItem:c,onDeselect:T=>Ce(T),onEditClosed:S?T=>S(T):void 0})))}),a.placeholder))):n==null?void 0:n.map(a=>i.createElement(we,{key:`selected-item-${a.id}`,logoIcon:r,selectedItem:a,onDeselect:c=>Ce(c),onEditClosed:S?c=>S(c):void 0}))))};import C from"react";var _n=({isActive:e,statusMessage:t})=>C.createElement("div",{className:`${e?"flex":"hidden"} absolute bottom-0 left-0 right-0 top-0 items-center justify-center overflow-hidden z-50`,style:{zIndex:9999}},C.createElement("div",{className:"absolute bottom-0 left-0 right-0 top-0 bg-white bg-opacity-50"}),C.createElement("div",{className:"relative"},C.createElement("div",{className:"flex flex-col items-center"},C.createElement(Wt,{height:128,width:128}),t?C.createElement("div",{className:"mt-4 text-gray-500"},t):null))),Wt=({height:e,width:t})=>C.createElement("svg",{"data-testid":"svg",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",width:t!=null?t:40,height:e!=null?e:40,className:"stroke-current"},C.createElement("g",{fill:"none",fillRule:"evenodd"},C.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},C.createElement("circle",{strokeOpacity:".25",cx:"18",cy:"18",r:"18"}),C.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18",transform:"rotate(166.645 18 18)"},C.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"0.8s",repeatCount:"indefinite"})))));export*from"@uniformdev/mesh-sdk";export{K as Button,Ue as Callout,Kn as CmsEntrySearch,Je as DefaultSearchRow,Re as DefaultSelectedItem,pe as Icons,se as Input,ze as KeywordSearchInput,Wt as LoadingIcon,de as LoadingIndicator,_n as LoadingOverlay,He as Menu,Ie as MenuContext,Oe as MenuItem,Ee as UniformMeshLocationContext,Pe as UniformMeshLocationContextProvider,De as UniformMeshSdkContext,co as UniformMeshSdkContextProvider,so as useInitializeUniformMeshSdk,$e as useMenuContext,oo as useUniformMeshLocation,ke as useUniformMeshLocationContext,go as useUniformMeshSdk,Be as useUniformMeshSdkContext};
|
|
1
|
+
var dt=Object.defineProperty;var mt=(e,t)=>{for(var o in t)dt(e,o,{get:t[o],enumerable:!0})};import ut,{createContext as ct,useContext as pt,useState as ft}from"react";var Ee=ct(void 0),Pe=({children:e})=>{let[t,o]=ft(),n;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let r=t||window.UniformMeshSDK.getCurrentLocation();n={location:{getValue:r.getValue,getMetadata:r.getMetadata,setValue:async s=>{await r.setValue(s),o(window.UniformMeshSDK.getCurrentLocation())}}}}return ut.createElement(Ee.Provider,{value:n},e)},ke=()=>{let e=pt(Ee);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function oo(){let{location:e}=ke();return{value:e==null?void 0:e.getValue(),setValue:e==null?void 0:e.setValue,metadata:e==null?void 0:e.getMetadata()}}import{initializeUniformMeshSDK as gt}from"@uniformdev/mesh-sdk";import{useEffect as vt,useState as Ve}from"react";var so=({autoResizingDisabled:e}={})=>{let[t,o]=Ve(),[n,r]=Ve();return vt(()=>{typeof window=="undefined"||n||(typeof window.UniformMeshSDK=="undefined"?gt({autoResizingDisabled:e}).then(s=>{r(s)}).catch(s=>{o(s)}):r(window.UniformMeshSDK))},[e]),{initializing:!n&&!t,error:t,sdk:n}};import Te,{createContext as ht,useContext as xt}from"react";var De=ht(void 0),co=({children:e})=>{let t;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(t={sdk:window.UniformMeshSDK}),Te.createElement(De.Provider,{value:t},Te.createElement(Pe,null,e))},Be=()=>{let e=xt(De);if(!e)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return e};function go(){let{sdk:e}=Be();return e}import Ge from"react";import{Button as bt}from"reakit";var ee={primary:{default:"bg-primary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},secondary:{default:"bg-secondary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},tertiary:{default:"bg-tertiary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},quaternary:{default:"bg-primary text-white hover:bg-opacity-75 border-2 border-gray-500 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},unimportant:{default:"bg-brand-secondary-2 text-primary hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-brand-secondary-2 text-gray-600 cursor-not-allowed"}},te={base:"inline-flex items-center border-transparent font-medium focus:outline-none focus:ring",size:(e,t)=>({xs:`${t?"px-2.5 py-1.5 ":""}text-xs leading-4 ${e?"rounded":""}`,sm:`${t?"px-3 py-2 ":""}text-sm leading-4 ${e?"rounded-md":""}`,md:`${t?"px-4 py-2 ":""}text-sm leading-5 tracking-wider ${e?"rounded-md":""}`,lg:`${t?"px-4 py-2 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`,xl:`${t?"px-6 py-3 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`}),buttonType:(e,t)=>{if(!(!e||!ee[e]))return t?ee[e].disabled:ee[e].default}},K=Ge.forwardRef(({size:e="md",buttonType:t="primary",children:o,className:n,rounded:r=!1,disablePadding:s=!1,...f},g)=>{let p=[te.base,te.size(r,!s)[e],te.buttonType(t,f.disabled),n].join(" ");return Ge.createElement(bt,{className:p,ref:g,...f},o)});import E from"react";import*as oe from"react";var Ct=e=>oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...e},oe.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})),O=Ct;import*as ne from"react";var yt=e=>ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},ne.createElement("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})),A=yt;import*as _ from"react";var wt=e=>_.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},_.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11 10.98a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0v-6zm1-4.929a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}),_.createElement("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0z"})),N=wt;import*as re from"react";var St=e=>re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},re.createElement("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})),j=St;import*as ae from"react";var Mt=e=>ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...e},ae.createElement("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})),D=Mt;import*as ie from"react";var Nt=e=>ie.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},ie.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 39.2A19.2 19.2 0 1 0 20 .8a19.2 19.2 0 0 0 0 38.4Zm8.897-22.303a2.4 2.4 0 0 0-3.394-3.394L17.6 21.407l-3.103-3.104a2.4 2.4 0 0 0-3.394 3.394l4.8 4.8a2.4 2.4 0 0 0 3.394 0l9.6-9.6Z"})),R=Nt;var Lt={caution:{icon:D,descriptionColor:"text-yellow-700",iconColor:"text-yellow-400",titleColor:"text-yellow-800",containerColor:"bg-yellow-50"},danger:{icon:A,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},error:{icon:D,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},info:{icon:O,descriptionColor:"text-blue-700",iconColor:"text-blue-400",titleColor:"text-blue-800",containerColor:"bg-blue-50"},note:{icon:N,descriptionColor:"text-gray-700",iconColor:"text-gray-400",titleColor:"text-gray-800",containerColor:"bg-gray-50"},success:{icon:R,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"},tip:{icon:j,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"}},Ue=({type:e="info",title:t,children:o,className:n})=>{let r=Lt[e];if(!r)return null;let s=r.icon;return E.createElement("div",{"data-testid":"sdk-ui-callout",className:`rounded-md p-4 ${r.containerColor} ${n||""}`},E.createElement("div",{className:"flex"},E.createElement("div",{className:"flex-shrink-0"},E.createElement(s,{className:`h-5 w-5 ${r.iconColor}`})),E.createElement("div",{className:"ml-3"},t?E.createElement("h3",{className:`text-sm font-medium mb-2 ${r.titleColor}`},t):null,o?E.createElement("div",{className:`text-sm ${r.descriptionColor}`},o):null)))};import P from"react";import{Input as Et}from"reakit";var se=({classNameContainer:e,classNameControl:t,classNameLabel:o,label:n,icon:r,id:s,disabled:f,...g})=>{let p={container:`uniform-input-container ${e||""}`,control:`uniform-input uniform-input-text${f?" uniform-input-disabled":""}${r?" pr-10":""} ${t||""}`,label:`uniform-input-label ${o||""}`};return P.createElement(P.Fragment,null,n?P.createElement("label",{htmlFor:s,className:p.label},n):null,P.createElement("div",{className:p.container},P.createElement(Et,{className:p.control,id:s,disabled:f,...g},v=>P.createElement("input",{...v,style:g.style})),r?P.createElement("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},r):null))};se.displayName="Input";import le from"react";import*as L from"react";var Pt=e=>L.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("g",{clipPath:"url(#magnifying-glass_svg__a)"},L.createElement("path",{d:"M11.539 0C5.484 0 .559 4.741.559 10.57c0 5.827 4.925 10.568 10.98 10.568 6.055 0 10.98-4.74 10.98-10.569C22.52 4.741 17.595 0 11.54 0Zm0 19.187c-4.937 0-8.954-3.866-8.954-8.618 0-4.752 4.017-8.618 8.954-8.618s8.954 3.866 8.954 8.618c0 4.752-4.017 8.618-8.954 8.618Z"}),L.createElement("path",{d:"m25.196 22.334-5.811-5.593a1.041 1.041 0 0 0-1.434 0 .95.95 0 0 0 0 1.38l5.812 5.593c.198.19.457.286.716.286.26 0 .519-.096.717-.286a.95.95 0 0 0 0-1.38Z"})),L.createElement("defs",null,L.createElement("clipPath",{id:"magnifying-glass_svg__a"},L.createElement("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),Z=Pt;function ze({onSearchTextChanged:e,disabled:t=!1,placeholder:o="Keyword search",inputFieldName:n="keywordSearch",disabledFieldSubmission:r=!1}){return le.createElement(se,{type:"text",name:n,placeholder:o,icon:le.createElement("div",{className:"pr-1"},le.createElement(Z,{className:"w-5 h-5 text-primary"})),onChange:g=>{e==null||e(g.currentTarget.value)},onKeyPress:g=>{g.key==="Enter"&&r&&g.preventDefault()},className:"uniform-input uniform-input-text pr-12 bg-gray-100",disabled:t,"aria-label":o})}import J from"react";var de=()=>J.createElement("span",{className:"loader",role:"presentation"},J.createElement("i",{className:"loader__dot"}),J.createElement("i",{className:"loader__dot"}),J.createElement("i",{className:"loader__dot"}));import V from"react";import{useMenuState as kt,Menu as Vt,MenuButton as Tt}from"reakit/Menu";var Ie=V.createContext({}),$e=()=>V.useContext(Ie),He=({menuLabel:e,menuTrigger:t,menuItemsContainerCssClasses:o,placement:n="auto",children:r})=>{let s=kt();return V.createElement(Ie.Provider,{value:s},V.createElement(Tt,{...s,ref:t.ref,...t.props},f=>V.cloneElement(t,f)),V.createElement(Vt,{...s,placement:n,"aria-label":e,className:`uniform-menu divide-y divide-gray-500 shadow-xl z-50 ${o}`},r))};import B from"react";import{MenuItem as Fe}from"reakit";var Oe=({children:e,className:t,hideMenuOnClick:o=!0,icon:n,...r})=>{let s=$e(),f=`uniform-menu-item bg-white ${(r==null?void 0:r.disabled)?"text-gray-500":"text-primary"} ${t||""}`,g=v=>{let h={...v};if(h.onClick){let y=h.onClick;h.onClick=m=>{s.hide(),y(m)}}return h};if(typeof e=="function")return B.createElement(Fe,{...s,...r,className:f},v=>{let h=o?g(v):v,y=e(h);return n?Ke(y,n):y});let p=o?g(r):r;return B.createElement(Fe,{...s,...p,className:f},n?Ke(e,n):e)};function Ke(e,t){return B.createElement("div",{className:"flex items-center justify-between"},B.createElement("div",null,e),B.createElement("div",{className:"ml-4"},t))}import i,{useState as z,useEffect as Kt,useRef as Ot}from"react";var pe={};mt(pe,{Caution:()=>D,Checkmark:()=>R,ChevronDown:()=>W,Close:()=>X,Danger:()=>A,ExclamationPoint:()=>O,Info:()=>N,Lightbulb:()=>j,MagnifyingGlass:()=>Z,MaximizeAlt:()=>Ae,MoreVerticalAlt:()=>U});import*as me from"react";var Dt=e=>me.createElement("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e},me.createElement("path",{d:"M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414Z"})),W=Dt;import*as G from"react";var Bt=e=>G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e},G.createElement("g",{fillRule:"evenodd"},G.createElement("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),G.createElement("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"}))),X=Bt;import*as ue from"react";var Gt=e=>ue.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},ue.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M3 3h6v2H6.462l4.843 4.843-1.415 1.414L5 6.367V9H3V3zm0 18h6v-2H6.376l4.929-4.928-1.415-1.414L5 17.548V15H3v6zm12 0h6v-6h-2v2.524l-4.867-4.866-1.414 1.414L17.647 19H15v2zm6-18h-6v2h2.562l-4.843 4.843 1.414 1.414L19 6.39V9h2V3z"})),Ae=Gt;import*as ce from"react";var Ut=e=>ce.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},ce.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M14 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})),U=Ut;import{useThrottle as At}from"react-use";import{v4 as _t}from"uuid";import u,{useState as zt,useRef as je,useEffect as It}from"react";function _e(e,t){let o=window.open(e,"_blank"),n=setInterval(()=>{(o==null?void 0:o.closed)&&(clearInterval(n),t())},500)}import{format as $t}from"timeago.js";var Re=({selectedItem:e,logoIcon:t,onDeselect:o,onEditClosed:n})=>{var y;let r=je(null),s=je(null),[f,g]=zt(!1);It(()=>{let m=S=>{r.current&&!r.current.contains(S.target)&&s.current&&!s.current.contains(S.target)&&g(!1)},x=()=>{g(!1)};return window.addEventListener("resize",x,!0),document.addEventListener("scroll",m,!0),document.addEventListener("mousedown",m),()=>{window.removeEventListener("resize",x,!0),document.removeEventListener("scroll",m,!0),document.removeEventListener("mousedown",m)}},[s]);let p=()=>{var m;if(g(!f),s.current&&r.current){let x=(m=r==null?void 0:r.current)==null?void 0:m.getBoundingClientRect();s.current.style.top=`${x.top+30}px`}},v=t&&typeof t!="string"?t:null,h=v?u.createElement(v,{className:"h-7 w-7"}):u.createElement("img",{src:t,alt:"CMS logo",className:"h-7 w-7"});return u.createElement("div",{className:"flex w-full border border-gray-300 rounded-md bg-gray-100",key:e.id},u.createElement("div",{className:"p-4 pl-8 flex flex-grow mr-2 gap-2 items-center relative"},u.createElement("div",{className:"flex-grow"},u.createElement("div",{className:"inline-flex relative items-start"},u.createElement("h4",{className:"text-primary font-bold leading-none mb-2",title:`ID: ${e.id}`,"data-test-id":"entry-id"},e.title||e.id||""),e.popoverData&&u.createElement(u.Fragment,null,u.createElement("button",{type:"button",ref:r,className:"ml-2 -my-1","aria-controls":"path-details",onClick:p},u.createElement(N,{className:"text-gray-700"})),u.createElement("div",{ref:s,className:`fixed bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 ${f?"visible":"invisible"}`},Object.entries(e.popoverData).map(([m,x],S)=>u.createElement("div",{className:"text-xs",key:S},u.createElement("span",{className:"font-bold mr-2"},m,":"),x))))),e.createdDate&&u.createElement("div",{className:"text-xs"},u.createElement("span",{className:"font-bold mr-2"},"Created:"),$t((y=e.createdDate)!=null?y:0)),u.createElement("div",{className:"flex gap-4"},e.metadata?Object.entries(e.metadata).filter(([m])=>["type","status"].includes(m.toLocaleLowerCase())).map(([m,x])=>u.createElement("span",{className:"text-sm",key:m},x)):null),e.metadata?Object.entries(e.metadata).filter(([m])=>!["type","status"].includes(m.toLocaleLowerCase())).map(([m,x])=>u.createElement("div",{className:"text-xs order-1",key:m},u.createElement("span",{className:"font-bold mr-2 order-1"},m,":"),x)):null),u.createElement("div",{className:"flex md:flex-row flex-col gap-2"},e.editLink?u.createElement("a",{href:e.editLink,title:"edit",rel:"noopener",target:"__blank",onClick:m=>{n&&(_e(m.currentTarget.href,()=>n(e)),m.preventDefault())},className:"flex justify-between items-center pl-4 pr-2 bg-white rounded border-2 border-gray-400 hover:bg-gray-100"},u.createElement("span",{className:"mr-2 text-sm"},"Edit"),h):null,u.createElement("button",{type:"button",onClick:m=>{m.preventDefault(),o(e)},className:"flex justify-between items-center px-4 bg-white rounded border-2 border-gray-400 h-10 hover:bg-gray-100"},u.createElement("span",{className:"mr-2 text-sm"},"Unlink"),u.createElement(X,{className:"w-4 h-4 text-red-600"})))))};import w,{useState as Ht,useRef as Ze,useEffect as Ft}from"react";var Je=({result:e,isSelected:t,triggerSelection:o})=>{let n=Ze(null),r=Ze(null),[s,f]=Ht(!1);Ft(()=>{function p(v){n.current&&!n.current.contains(v.target)&&r.current&&!r.current.contains(v.target)&&f(!1)}return document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[r]);let g=p=>{p.stopPropagation(),f(!s)};return w.createElement("div",{key:e.id,className:`p-2 cursor-pointer relative ${t?"bg-green-400 text-white":""}`,"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o()},e.title,e.popoverData&&t?w.createElement(w.Fragment,null,w.createElement("button",{type:"button",ref:n,className:"absolute top-0 bottom-0 right-2","aria-controls":"path-details",onClick:p=>g(p)},w.createElement(N,null)),w.createElement("div",{ref:r,className:`absolute top-4 right-10 bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 text-black ${s?"visible":"invisible"}`},e.metadata&&Object.entries(e.metadata).map(([p,v],h)=>w.createElement("div",{className:"text-xs",key:h},w.createElement("span",{className:"font-bold mr-2"},p,":"),v)),Object.entries(e.popoverData).map(([p,v],h)=>w.createElement("div",{className:"text-xs",key:h},w.createElement("span",{className:"font-bold mr-2"},p,":"),v)))):null)};import{Droppable as jt,DragDropContext as Rt,Draggable as Zt}from"react-beautiful-dnd";var Jt=({searchText:e,selectedContentType:t})=>{let o="No content found";return t&&(o=`No ${t} content was found`),e&&(o=`${o} for keyword '${e}'.`),i.createElement(Ue,{type:"info"},o)},Kn=({search:e,results:t,contentTypes:o,selectedItems:n,logoIcon:r,select:s,multiSelect:f,multiSelectId:g,rowComponent:p,selectedItemComponent:v,totalResults:h,resultsLoading:y,requireContentType:m,onAddNew:x,onEditClosed:S,onCancel:fe,noResultsComponent:We,helpComponent:Xe,onSort:q})=>{var Me,Ne,Le;let ge=()=>m?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[ve,he]=z(""),[M,xe]=z(ge),[I,Q]=z(!1),[$,H]=z([]),[qe,be]=z(!1),F=At(ve,750);Kt(()=>{e(F,{count:5,offset:0,contentType:M==="any"?void 0:M})},[F,M]);let Qe=a=>{$.includes(a.id)?H(c=>c.filter(k=>k!==a.id)):H(f?c=>[...c,a==null?void 0:a.id]:[a.id])},Ye=()=>{xe(ge()),he(""),H((n==null?void 0:n.length)?n.map(a=>a.id):[])},et=()=>{Q(a=>!a),I||Ye()},Ce=a=>{s((n==null?void 0:n.filter(c=>c.id!==a.id).map(c=>c.id))||[],"")},tt=a=>{a.preventDefault(),s($,M),Q(!1)},ot=a=>{a.preventDefault(),Q(!1),fe&&fe()},nt=a=>{a.preventDefault(),e(F,{count:5,offset:(t==null?void 0:t.length)||0,contentType:M==="any"?void 0:M}),be(!0);let c=setTimeout(()=>{be(!1)},750);return()=>clearTimeout(c)},ye=Ot(_t()),rt=!(n==null?void 0:n.length)||f,at=p||Je,we=v||Re,it=We||Jt,Se=r&&typeof r!="string"?r:null,st=Se?i.createElement(Se,{className:"h-9 w-9"}):i.createElement("img",{src:r,alt:"CMS logo",className:"h-9 w-9"}),lt=a=>{var c,k;if(a.destination&&a.source.droppableId===((c=a.destination)==null?void 0:c.droppableId)){let b=[...n||[]],[Y]=(k=b==null?void 0:b.splice(a.source.index,1))!=null?k:[];return b==null||b.splice(a.destination.index,0,Y),q==null||q(b.map(T=>T.id)),b}};return i.createElement("div",{className:"w-full"},i.createElement("div",{className:"relative my-4"},rt&&i.createElement("div",{className:"space-y-2"},i.createElement("div",{className:"py-3 px-2 bg-white rounded-lg border border-gray-300 mb-4","data-test-id":"component-search"},i.createElement("button",{className:"flex items-center w-full text-base relative",onClick:et,type:"button","aria-haspopup":!0,"aria-expanded":I,"aria-controls":ye.current},st,i.createElement("span",{className:"ml-4"},"Select"),i.createElement("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},i.createElement(W,{className:`w-5 h-5 text-standard transform transition-transform ${I?"rotate-180":"rotate-0"}`})))),i.createElement("div",{className:`${I?"block":"hidden"} py-3 px-4 space-y-4 bg-white rounded-lg border border-gray-300`},Xe||null,i.createElement("div",{className:"flex space-x-3"},i.createElement("select",{className:"uniform-input uniform-input-select w-1/3 bg-gray-100",onChange:a=>xe(a.target.value)},m?null:i.createElement("option",{value:"any",className:"bg-white text-primary"},"All content types"),o==null?void 0:o.map(a=>i.createElement("option",{value:a.id,key:a.id,className:"bg-white text-primary"},a.name))),i.createElement("div",{className:"flex-grow"},i.createElement(ze,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:he,disabledFieldSubmission:!0}))),i.createElement("div",{className:"overflow-y-scroll max-h-64 divide-y divide-gray-200 scrollbar",id:ye.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},(t==null?void 0:t.length)?t.map(a=>i.createElement(at,{key:a.id,isSelected:$.includes(a.id),result:a,triggerSelection:()=>Qe(a)})):y?null:i.createElement(it,{searchText:F||ve,selectedContentType:(Ne=(Me=o==null?void 0:o.find(a=>a.id===M))==null?void 0:Me.name)!=null?Ne:M}),!y&&typeof h!="undefined"&&t&&(t==null?void 0:t.length)<h&&i.createElement("button",{className:"block p-4 text-center w-full hover:bg-gray-100 focus:bg-gray-100 font-bold text-primary text-sm focus:outline-none",onClick:nt},qe?i.createElement(de,null):"Load More"),y&&!(t==null?void 0:t.length)?i.createElement("div",{className:"p-4 text-center w-full"},i.createElement(de,null)):null),i.createElement("div",{className:"flex justify-between"},i.createElement("div",null,x&&((Le=o==null?void 0:o.length)!=null?Le:0)>0?i.createElement(He,{menuLabel:"Add new menu",menuTrigger:i.createElement(K,{buttonType:"secondary"},"Add New")},o==null?void 0:o.map(a=>i.createElement(Oe,{key:a.id,className:"bg-white text-primary",onClick:()=>x(a)},a.name))):null),i.createElement("div",null,i.createElement(K,{buttonType:"unimportant",onClick:ot},"Cancel"),i.createElement(K,{className:"ml-5",disabled:!$.length,onClick:tt,"data-test-id":"entry-accept-button"},"Accept"))))),f?i.createElement(Rt,{onDragEnd:a=>lt(a)},i.createElement(jt,{droppableId:g||"canvas-multi-select"},a=>i.createElement("div",{...a.droppableProps,ref:a.innerRef,className:"space-y-1"},n==null?void 0:n.map((c,k)=>{if(c==null?void 0:c.id)return i.createElement(Zt,{key:c.id,draggableId:c.id,index:k},(b,Y)=>i.createElement("div",{className:"relative group",ref:b.innerRef,...b.draggableProps,...b.dragHandleProps},i.createElement("span",{className:`absolute left-0 top-0 bottom-0 my-auto flex items-center ${Y.isDragging?"":"opacity-0 group-hover:opacity-30"}`},i.createElement(U,{className:"text-brand-secondary-1 absolute left-1.5",width:24,height:24}),i.createElement(U,{className:"text-brand-secondary-1",width:24,height:24})),i.createElement(we,{key:`selected-item-${c.id}`,logoIcon:r,selectedItem:c,onDeselect:T=>Ce(T),onEditClosed:S?T=>S(T):void 0})))}),a.placeholder))):n==null?void 0:n.map(a=>i.createElement(we,{key:`selected-item-${a.id}`,logoIcon:r,selectedItem:a,onDeselect:c=>Ce(c),onEditClosed:S?c=>S(c):void 0}))))};import C from"react";var _n=({isActive:e,statusMessage:t})=>C.createElement("div",{className:`${e?"flex":"hidden"} absolute bottom-0 left-0 right-0 top-0 items-center justify-center overflow-hidden z-50`,style:{zIndex:9999}},C.createElement("div",{className:"absolute bottom-0 left-0 right-0 top-0 bg-white bg-opacity-50"}),C.createElement("div",{className:"relative"},C.createElement("div",{className:"flex flex-col items-center"},C.createElement(Wt,{height:128,width:128}),t?C.createElement("div",{className:"mt-4 text-gray-500"},t):null))),Wt=({height:e,width:t})=>C.createElement("svg",{"data-testid":"svg",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",width:t!=null?t:40,height:e!=null?e:40,className:"stroke-current"},C.createElement("g",{fill:"none",fillRule:"evenodd"},C.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},C.createElement("circle",{strokeOpacity:".25",cx:"18",cy:"18",r:"18"}),C.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18",transform:"rotate(166.645 18 18)"},C.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"0.8s",repeatCount:"indefinite"})))));export*from"@uniformdev/mesh-sdk";export{K as Button,Ue as Callout,Kn as CmsEntrySearch,Je as DefaultSearchRow,Re as DefaultSelectedItem,pe as Icons,se as Input,ze as KeywordSearchInput,Wt as LoadingIcon,de as LoadingIndicator,_n as LoadingOverlay,He as Menu,Ie as MenuContext,Oe as MenuItem,Ee as UniformMeshLocationContext,Pe as UniformMeshLocationContextProvider,De as UniformMeshSdkContext,co as UniformMeshSdkContextProvider,so as useInitializeUniformMeshSdk,$e as useMenuContext,oo as useUniformMeshLocation,ke as useUniformMeshLocationContext,go as useUniformMeshSdk,Be as useUniformMeshSdkContext};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var yt=Object.create;var W=Object.defineProperty;var wt=Object.getOwnPropertyDescriptor;var St=Object.getOwnPropertyNames;var Mt=Object.getPrototypeOf,Nt=Object.prototype.hasOwnProperty;var We=e=>W(e,"__esModule",{value:!0});var Xe=(e,t)=>{for(var o in t)W(e,o,{get:t[o],enumerable:!0})},S=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of St(t))!Nt.call(e,n)&&(o||n!=="default")&&W(e,n,{get:()=>t[n],enumerable:!(a=wt(t,n))||a.enumerable});return e},c=(e,t)=>S(We(W(e!=null?yt(Mt(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Lt=(e=>(t,o)=>e&&e.get(t)||(o=S(We({}),t,1),e&&e.set(t,o),o))(typeof WeakMap!="undefined"?new WeakMap:0);var M={};Xe(M,{Button:()=>F,Callout:()=>Me,CmsEntrySearch:()=>_t,DefaultSearchRow:()=>Ue,DefaultSelectedItem:()=>Ge,Icons:()=>se,Input:()=>te,KeywordSearchInput:()=>Ne,LoadingIcon:()=>it,LoadingIndicator:()=>re,LoadingOverlay:()=>jt,Menu:()=>Pe,MenuContext:()=>Le,MenuItem:()=>Ve,UniformMeshLocationContext:()=>ue,UniformMeshLocationContextProvider:()=>ce,UniformMeshSdkContext:()=>fe,UniformMeshSdkContextProvider:()=>kt,useInitializeUniformMeshSdk:()=>Pt,useMenuContext:()=>Ee,useUniformMeshLocation:()=>Et,useUniformMeshLocationContext:()=>pe,useUniformMeshSdk:()=>Vt,useUniformMeshSdkContext:()=>ge});var E=c(require("react")),ue=(0,E.createContext)(void 0),ce=({children:e})=>{let[t,o]=(0,E.useState)(),a;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let n=t||window.UniformMeshSDK.getCurrentLocation();a={location:{getValue:n.getValue,getMetadata:n.getMetadata,setValue:async s=>{await n.setValue(s),o(window.UniformMeshSDK.getCurrentLocation())}}}}return E.default.createElement(ue.Provider,{value:a},e)},pe=()=>{let e=(0,E.useContext)(ue);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function Et(){let{location:e}=pe();return{value:e==null?void 0:e.getValue(),setValue:e==null?void 0:e.setValue,metadata:e==null?void 0:e.getMetadata()}}var qe=require("@uniformdev/mesh-sdk"),H=require("react"),Pt=({autoResizingDisabled:e}={})=>{let[t,o]=(0,H.useState)(),[a,n]=(0,H.useState)();return(0,H.useEffect)(()=>{typeof window=="undefined"||a||(typeof window.UniformMeshSDK=="undefined"?(0,qe.initializeUniformMeshSDK)({autoResizingDisabled:e}).then(s=>{n(s)}).catch(s=>{o(s)}):n(window.UniformMeshSDK))},[e]),{initializing:!a&&!t,error:t,sdk:a}};var D=c(require("react"));var fe=(0,D.createContext)(void 0),kt=({children:e})=>{let t;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(t={sdk:window.UniformMeshSDK}),D.default.createElement(fe.Provider,{value:t},D.default.createElement(ce,null,e))},ge=()=>{let e=(0,D.useContext)(fe);if(!e)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return e};function Vt(){let{sdk:e}=ge();return e}var xe=c(require("react")),Qe=require("reakit/Button"),ve={primary:{default:"bg-primary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},secondary:{default:"bg-secondary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},tertiary:{default:"bg-tertiary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},quaternary:{default:"bg-primary text-white hover:bg-opacity-75 border-2 border-gray-500 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},unimportant:{default:"bg-brand-secondary-2 text-primary hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-brand-secondary-2 text-gray-600 cursor-not-allowed"}},he={base:"inline-flex items-center border-transparent font-medium focus:outline-none focus:ring",size:(e,t)=>({xs:`${t?"px-2.5 py-1.5 ":""}text-xs leading-4 ${e?"rounded":""}`,sm:`${t?"px-3 py-2 ":""}text-sm leading-4 ${e?"rounded-md":""}`,md:`${t?"px-4 py-2 ":""}text-sm leading-5 tracking-wider ${e?"rounded-md":""}`,lg:`${t?"px-4 py-2 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`,xl:`${t?"px-6 py-3 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`}),buttonType:(e,t)=>{if(!(!e||!ve[e]))return t?ve[e].disabled:ve[e].default}},F=xe.default.forwardRef(({size:e="md",buttonType:t="primary",children:o,className:a,rounded:n=!1,disablePadding:s=!1,...f},g)=>{let p=[he.base,he.size(n,!s)[e],he.buttonType(t,f.disabled),a].join(" ");return xe.default.createElement(Qe.Button,{className:p,ref:g,...f},o)});var k=c(require("react"));var be=c(require("react")),Tt=e=>be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...e},be.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})),X=Tt;var Ce=c(require("react")),Dt=e=>Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},Ce.createElement("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})),q=Dt;var Q=c(require("react")),Bt=e=>Q.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},Q.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11 10.98a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0v-6zm1-4.929a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}),Q.createElement("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0z"})),P=Bt;var ye=c(require("react")),Gt=e=>ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},ye.createElement("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})),Y=Gt;var we=c(require("react")),Ut=e=>we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...e},we.createElement("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})),K=Ut;var Se=c(require("react")),zt=e=>Se.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 39.2A19.2 19.2 0 1 0 20 .8a19.2 19.2 0 0 0 0 38.4Zm8.897-22.303a2.4 2.4 0 0 0-3.394-3.394L17.6 21.407l-3.103-3.104a2.4 2.4 0 0 0-3.394 3.394l4.8 4.8a2.4 2.4 0 0 0 3.394 0l9.6-9.6Z"})),ee=zt;var It={caution:{icon:K,descriptionColor:"text-yellow-700",iconColor:"text-yellow-400",titleColor:"text-yellow-800",containerColor:"bg-yellow-50"},danger:{icon:q,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},error:{icon:K,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},info:{icon:X,descriptionColor:"text-blue-700",iconColor:"text-blue-400",titleColor:"text-blue-800",containerColor:"bg-blue-50"},note:{icon:P,descriptionColor:"text-gray-700",iconColor:"text-gray-400",titleColor:"text-gray-800",containerColor:"bg-gray-50"},success:{icon:ee,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"},tip:{icon:Y,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"}},Me=({type:e="info",title:t,children:o,className:a})=>{let n=It[e];if(!n)return null;let s=n.icon;return k.default.createElement("div",{"data-testid":"sdk-ui-callout",className:`rounded-md p-4 ${n.containerColor} ${a||""}`},k.default.createElement("div",{className:"flex"},k.default.createElement("div",{className:"flex-shrink-0"},k.default.createElement(s,{className:`h-5 w-5 ${n.iconColor}`})),k.default.createElement("div",{className:"ml-3"},t?k.default.createElement("h3",{className:`text-sm font-medium mb-2 ${n.titleColor}`},t):null,o?k.default.createElement("div",{className:`text-sm ${n.descriptionColor}`},o):null)))};var V=c(require("react")),Ye=require("reakit/Input"),te=({classNameContainer:e,classNameControl:t,classNameLabel:o,label:a,icon:n,id:s,disabled:f,...g})=>{let p={container:`uniform-input-container ${e||""}`,control:`uniform-input uniform-input-text${f?" uniform-input-disabled":""}${n?" pr-10":""} ${t||""}`,label:`uniform-input-label ${o||""}`};return V.default.createElement(V.default.Fragment,null,a?V.default.createElement("label",{htmlFor:s,className:p.label},a):null,V.default.createElement("div",{className:p.container},V.default.createElement(Ye.Input,{className:p.control,id:s,disabled:f,...g},v=>V.default.createElement("input",{...v,style:g.style})),n?V.default.createElement("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},n):null))};te.displayName="Input";var ne=c(require("react"));var T=c(require("react")),$t=e=>T.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},T.createElement("g",{clipPath:"url(#magnifying-glass_svg__a)"},T.createElement("path",{d:"M11.539 0C5.484 0 .559 4.741.559 10.57c0 5.827 4.925 10.568 10.98 10.568 6.055 0 10.98-4.74 10.98-10.569C22.52 4.741 17.595 0 11.54 0Zm0 19.187c-4.937 0-8.954-3.866-8.954-8.618 0-4.752 4.017-8.618 8.954-8.618s8.954 3.866 8.954 8.618c0 4.752-4.017 8.618-8.954 8.618Z"}),T.createElement("path",{d:"m25.196 22.334-5.811-5.593a1.041 1.041 0 0 0-1.434 0 .95.95 0 0 0 0 1.38l5.812 5.593c.198.19.457.286.716.286.26 0 .519-.096.717-.286a.95.95 0 0 0 0-1.38Z"})),T.createElement("defs",null,T.createElement("clipPath",{id:"magnifying-glass_svg__a"},T.createElement("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),oe=$t;function Ne({onSearchTextChanged:e,disabled:t=!1,placeholder:o="Keyword search",inputFieldName:a="keywordSearch",disabledFieldSubmission:n=!1}){return ne.default.createElement(te,{type:"text",name:a,placeholder:o,icon:ne.default.createElement("div",{className:"pr-1"},ne.default.createElement(oe,{className:"w-5 h-5 text-primary"})),onChange:g=>{e==null||e(g.currentTarget.value)},onKeyPress:g=>{g.key==="Enter"&&n&&g.preventDefault()},className:"uniform-input uniform-input-text pr-12 bg-gray-100",disabled:t,"aria-label":o})}var O=c(require("react")),re=()=>O.default.createElement("span",{className:"loader",role:"presentation"},O.default.createElement("i",{className:"loader__dot"}),O.default.createElement("i",{className:"loader__dot"}),O.default.createElement("i",{className:"loader__dot"}));var B=c(require("react")),U=require("reakit/Menu"),Le=B.default.createContext({}),Ee=()=>B.default.useContext(Le),Pe=({menuLabel:e,menuTrigger:t,menuItemsContainerCssClasses:o,placement:a="auto",children:n})=>{let s=(0,U.useMenuState)();return B.default.createElement(Le.Provider,{value:s},B.default.createElement(U.MenuButton,{...s,ref:t.ref,...t.props},f=>B.default.cloneElement(t,f)),B.default.createElement(U.Menu,{...s,placement:a,"aria-label":e,className:`uniform-menu divide-y divide-gray-500 shadow-xl z-50 ${o}`},n))};var z=c(require("react")),ke=require("reakit");var Ve=({children:e,className:t,hideMenuOnClick:o=!0,icon:a,...n})=>{let s=Ee(),f=`uniform-menu-item bg-white ${(n==null?void 0:n.disabled)?"text-gray-500":"text-primary"} ${t||""}`,g=v=>{let x={...v};if(x.onClick){let w=x.onClick;x.onClick=m=>{s.hide(),w(m)}}return x};if(typeof e=="function")return z.default.createElement(ke.MenuItem,{...s,...n,className:f},v=>{let x=o?g(v):v,w=e(x);return a?et(w,a):w});let p=o?g(n):n;return z.default.createElement(ke.MenuItem,{...s,...p,className:f},a?et(e,a):e)};function et(e,t){return z.default.createElement("div",{className:"flex items-center justify-between"},z.default.createElement("div",null,e),z.default.createElement("div",{className:"ml-4"},t))}var r=c(require("react"));var se={};Xe(se,{Caution:()=>K,Checkmark:()=>ee,ChevronDown:()=>ae,Close:()=>ie,Danger:()=>q,ExclamationPoint:()=>X,Info:()=>P,Lightbulb:()=>Y,MagnifyingGlass:()=>oe,MaximizeAlt:()=>tt,MoreVerticalAlt:()=>_});var Te=c(require("react")),Ht=e=>Te.createElement("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e},Te.createElement("path",{d:"M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414Z"})),ae=Ht;var A=c(require("react")),Ft=e=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e},A.createElement("g",{fillRule:"evenodd"},A.createElement("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),A.createElement("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"}))),ie=Ft;var De=c(require("react")),Kt=e=>De.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},De.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M3 3h6v2H6.462l4.843 4.843-1.415 1.414L5 6.367V9H3V3zm0 18h6v-2H6.376l4.929-4.928-1.415-1.414L5 17.548V15H3v6zm12 0h6v-6h-2v2.524l-4.867-4.866-1.414 1.414L17.647 19H15v2zm6-18h-6v2h2.562l-4.843 4.843 1.414 1.414L19 6.39V9h2V3z"})),tt=Kt;var Be=c(require("react")),Ot=e=>Be.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},Be.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M14 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})),_=Ot;var rt=require("react-use"),at=require("uuid");var l=c(require("react"));function ot(e,t){let o=window.open(e,"_blank"),a=setInterval(()=>{(o==null?void 0:o.closed)&&(clearInterval(a),t())},500)}var nt=require("timeago.js"),Ge=({selectedItem:e,logoIcon:t,onDeselect:o,onEditClosed:a})=>{var w;let n=(0,l.useRef)(null),s=(0,l.useRef)(null),[f,g]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let m=N=>{n.current&&!n.current.contains(N.target)&&s.current&&!s.current.contains(N.target)&&g(!1)},b=()=>{g(!1)};return window.addEventListener("resize",b,!0),document.addEventListener("scroll",m,!0),document.addEventListener("mousedown",m),()=>{window.removeEventListener("resize",b,!0),document.removeEventListener("scroll",m,!0),document.removeEventListener("mousedown",m)}},[s]);let p=()=>{var m;if(g(!f),s.current&&n.current){let b=(m=n==null?void 0:n.current)==null?void 0:m.getBoundingClientRect();s.current.style.top=`${b.top+30}px`}},v=t&&typeof t!="string"?t:null,x=v?l.default.createElement(v,{className:"h-7 w-7"}):l.default.createElement("img",{src:t,alt:"CMS logo",className:"h-7 w-7"});return l.default.createElement("div",{className:"flex w-full border border-gray-300 rounded-md bg-gray-100",key:e.id},l.default.createElement("div",{className:"p-4 pl-8 flex flex-grow mr-2 gap-2 items-center relative"},l.default.createElement("div",{className:"flex-grow"},l.default.createElement("div",{className:"inline-flex relative items-start"},l.default.createElement("h4",{className:"text-primary font-bold leading-none mb-2",title:`ID: ${e.id}`,"data-test-id":"entry-id"},e.title||e.id||""),e.popoverData&&l.default.createElement(l.default.Fragment,null,l.default.createElement("button",{type:"button",ref:n,className:"ml-2 -my-1","aria-controls":"path-details",onClick:p},l.default.createElement(P,{className:"text-gray-700"})),l.default.createElement("div",{ref:s,className:`fixed bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 ${f?"visible":"invisible"}`},Object.entries(e.popoverData).map(([m,b],N)=>l.default.createElement("div",{className:"text-xs",key:N},l.default.createElement("span",{className:"font-bold mr-2"},m,":"),b))))),e.createdDate&&l.default.createElement("div",{className:"text-xs"},l.default.createElement("span",{className:"font-bold mr-2"},"Created:"),(0,nt.format)((w=e.createdDate)!=null?w:0)),l.default.createElement("div",{className:"flex gap-4"},e.metadata?Object.entries(e.metadata).filter(([m])=>["type","status"].includes(m.toLocaleLowerCase())).map(([m,b])=>l.default.createElement("span",{className:"text-sm",key:m},b)):null),e.metadata?Object.entries(e.metadata).filter(([m])=>!["type","status"].includes(m.toLocaleLowerCase())).map(([m,b])=>l.default.createElement("div",{className:"text-xs order-1",key:m},l.default.createElement("span",{className:"font-bold mr-2 order-1"},m,":"),b)):null),l.default.createElement("div",{className:"flex md:flex-row flex-col gap-2"},e.editLink?l.default.createElement("a",{href:e.editLink,title:"edit",rel:"noopener",target:"__blank",onClick:m=>{a&&(ot(m.currentTarget.href,()=>a(e)),m.preventDefault())},className:"flex justify-between items-center pl-4 pr-2 bg-white rounded border-2 border-gray-400 hover:bg-gray-100"},l.default.createElement("span",{className:"mr-2 text-sm"},"Edit"),x):null,l.default.createElement("button",{type:"button",onClick:m=>{m.preventDefault(),o(e)},className:"flex justify-between items-center px-4 bg-white rounded border-2 border-gray-400 h-10 hover:bg-gray-100"},l.default.createElement("span",{className:"mr-2 text-sm"},"Unlink"),l.default.createElement(ie,{className:"w-4 h-4 text-red-600"})))))};var h=c(require("react"));var Ue=({result:e,isSelected:t,triggerSelection:o})=>{let a=(0,h.useRef)(null),n=(0,h.useRef)(null),[s,f]=(0,h.useState)(!1);(0,h.useEffect)(()=>{function p(v){a.current&&!a.current.contains(v.target)&&n.current&&!n.current.contains(v.target)&&f(!1)}return document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[n]);let g=p=>{p.stopPropagation(),f(!s)};return h.default.createElement("div",{key:e.id,className:`p-2 cursor-pointer relative ${t?"bg-green-400 text-white":""}`,"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o()},e.title,e.popoverData&&t?h.default.createElement(h.default.Fragment,null,h.default.createElement("button",{type:"button",ref:a,className:"absolute top-0 bottom-0 right-2","aria-controls":"path-details",onClick:p=>g(p)},h.default.createElement(P,null)),h.default.createElement("div",{ref:n,className:`absolute top-4 right-10 bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 text-black ${s?"visible":"invisible"}`},e.metadata&&Object.entries(e.metadata).map(([p,v],x)=>h.default.createElement("div",{className:"text-xs",key:x},h.default.createElement("span",{className:"font-bold mr-2"},p,":"),v)),Object.entries(e.popoverData).map(([p,v],x)=>h.default.createElement("div",{className:"text-xs",key:x},h.default.createElement("span",{className:"font-bold mr-2"},p,":"),v)))):null)};var I=require("react-beautiful-dnd"),At=({searchText:e,selectedContentType:t})=>{let o="No content found";return t&&(o=`No ${t} content was found`),e&&(o=`${o} for keyword '${e}'.`),r.default.createElement(Me,{type:"info"},o)},_t=({search:e,results:t,contentTypes:o,selectedItems:a,logoIcon:n,select:s,multiSelect:f,multiSelectId:g,rowComponent:p,selectedItemComponent:v,totalResults:x,resultsLoading:w,requireContentType:m,onAddNew:b,onEditClosed:N,onCancel:ze,noResultsComponent:st,helpComponent:lt,onSort:le})=>{var Re,Ze,Je;let Ie=()=>m?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[$e,He]=(0,r.useState)(""),[L,Fe]=(0,r.useState)(Ie),[j,de]=(0,r.useState)(!1),[R,Z]=(0,r.useState)([]),[dt,Ke]=(0,r.useState)(!1),J=(0,rt.useThrottle)($e,750);(0,r.useEffect)(()=>{e(J,{count:5,offset:0,contentType:L==="any"?void 0:L})},[J,L]);let mt=i=>{R.includes(i.id)?Z(u=>u.filter(G=>G!==i.id)):Z(f?u=>[...u,i==null?void 0:i.id]:[i.id])},ut=()=>{Fe(Ie()),He(""),Z((a==null?void 0:a.length)?a.map(i=>i.id):[])},ct=()=>{de(i=>!i),j||ut()},Oe=i=>{s((a==null?void 0:a.filter(u=>u.id!==i.id).map(u=>u.id))||[],"")},pt=i=>{i.preventDefault(),s(R,L),de(!1)},ft=i=>{i.preventDefault(),de(!1),ze&&ze()},gt=i=>{i.preventDefault(),e(J,{count:5,offset:(t==null?void 0:t.length)||0,contentType:L==="any"?void 0:L}),Ke(!0);let u=setTimeout(()=>{Ke(!1)},750);return()=>clearTimeout(u)},Ae=(0,r.useRef)((0,at.v4)()),vt=!(a==null?void 0:a.length)||f,ht=p||Ue,_e=v||Ge,xt=st||At,je=n&&typeof n!="string"?n:null,bt=je?r.default.createElement(je,{className:"h-9 w-9"}):r.default.createElement("img",{src:n,alt:"CMS logo",className:"h-9 w-9"}),Ct=i=>{var u,G;if(i.destination&&i.source.droppableId===((u=i.destination)==null?void 0:u.droppableId)){let y=[...a||[]],[me]=(G=y==null?void 0:y.splice(i.source.index,1))!=null?G:[];return y==null||y.splice(i.destination.index,0,me),le==null||le(y.map($=>$.id)),y}};return r.default.createElement("div",{className:"w-full"},r.default.createElement("div",{className:"relative my-4"},vt&&r.default.createElement("div",{className:"space-y-2"},r.default.createElement("div",{className:"py-3 px-2 bg-white rounded-lg border border-gray-300 mb-4","data-test-id":"component-search"},r.default.createElement("button",{className:"flex items-center w-full text-base relative",onClick:ct,type:"button","aria-haspopup":!0,"aria-expanded":j,"aria-controls":Ae.current},bt,r.default.createElement("span",{className:"ml-4"},"Select"),r.default.createElement("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},r.default.createElement(ae,{className:`w-5 h-5 text-standard transform transition-transform ${j?"rotate-180":"rotate-0"}`})))),r.default.createElement("div",{className:`${j?"block":"hidden"} py-3 px-4 space-y-4 bg-white rounded-lg border border-gray-300`},lt||null,r.default.createElement("div",{className:"flex space-x-3"},r.default.createElement("select",{className:"uniform-input uniform-input-select w-1/3 bg-gray-100",onChange:i=>Fe(i.target.value)},m?null:r.default.createElement("option",{value:"any",className:"bg-white text-primary"},"All content types"),o==null?void 0:o.map(i=>r.default.createElement("option",{value:i.id,key:i.id,className:"bg-white text-primary"},i.name))),r.default.createElement("div",{className:"flex-grow"},r.default.createElement(Ne,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:He,disabledFieldSubmission:!0}))),r.default.createElement("div",{className:"overflow-y-scroll max-h-64 divide-y divide-gray-200 scrollbar",id:Ae.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},(t==null?void 0:t.length)?t.map(i=>r.default.createElement(ht,{key:i.id,isSelected:R.includes(i.id),result:i,triggerSelection:()=>mt(i)})):w?null:r.default.createElement(xt,{searchText:J||$e,selectedContentType:(Ze=(Re=o==null?void 0:o.find(i=>i.id===L))==null?void 0:Re.name)!=null?Ze:L}),!w&&typeof x!="undefined"&&t&&(t==null?void 0:t.length)<x&&r.default.createElement("button",{className:"block p-4 text-center w-full hover:bg-gray-100 focus:bg-gray-100 font-bold text-primary text-sm focus:outline-none",onClick:gt},dt?r.default.createElement(re,null):"Load More"),w&&!(t==null?void 0:t.length)?r.default.createElement("div",{className:"p-4 text-center w-full"},r.default.createElement(re,null)):null),r.default.createElement("div",{className:"flex justify-between"},r.default.createElement("div",null,b&&((Je=o==null?void 0:o.length)!=null?Je:0)>0?r.default.createElement(Pe,{menuLabel:"Add new menu",menuTrigger:r.default.createElement(F,{buttonType:"secondary"},"Add New")},o==null?void 0:o.map(i=>r.default.createElement(Ve,{key:i.id,className:"bg-white text-primary",onClick:()=>b(i)},i.name))):null),r.default.createElement("div",null,r.default.createElement(F,{buttonType:"unimportant",onClick:ft},"Cancel"),r.default.createElement(F,{className:"ml-5",disabled:!R.length,onClick:pt,"data-test-id":"entry-accept-button"},"Accept"))))),f?r.default.createElement(I.DragDropContext,{onDragEnd:i=>Ct(i)},r.default.createElement(I.Droppable,{droppableId:g||"canvas-multi-select"},i=>r.default.createElement("div",{...i.droppableProps,ref:i.innerRef,className:"space-y-1"},a==null?void 0:a.map((u,G)=>{if(u==null?void 0:u.id)return r.default.createElement(I.Draggable,{key:u.id,draggableId:u.id,index:G},(y,me)=>r.default.createElement("div",{className:"relative group",ref:y.innerRef,...y.draggableProps,...y.dragHandleProps},r.default.createElement("span",{className:`absolute left-0 top-0 bottom-0 my-auto flex items-center ${me.isDragging?"":"opacity-0 group-hover:opacity-30"}`},r.default.createElement(_,{className:"text-brand-secondary-1 absolute left-1.5",width:24,height:24}),r.default.createElement(_,{className:"text-brand-secondary-1",width:24,height:24})),r.default.createElement(_e,{key:`selected-item-${u.id}`,logoIcon:n,selectedItem:u,onDeselect:$=>Oe($),onEditClosed:N?$=>N($):void 0})))}),i.placeholder))):a==null?void 0:a.map(i=>r.default.createElement(_e,{key:`selected-item-${i.id}`,logoIcon:n,selectedItem:i,onDeselect:u=>Oe(u),onEditClosed:N?u=>N(u):void 0}))))};var C=c(require("react")),jt=({isActive:e,statusMessage:t})=>C.default.createElement("div",{className:`${e?"flex":"hidden"} absolute bottom-0 left-0 right-0 top-0 items-center justify-center overflow-hidden z-50`,style:{zIndex:9999}},C.default.createElement("div",{className:"absolute bottom-0 left-0 right-0 top-0 bg-white bg-opacity-50"}),C.default.createElement("div",{className:"relative"},C.default.createElement("div",{className:"flex flex-col items-center"},C.default.createElement(it,{height:128,width:128}),t?C.default.createElement("div",{className:"mt-4 text-gray-500"},t):null))),it=({height:e,width:t})=>C.default.createElement("svg",{"data-testid":"svg",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",width:t!=null?t:40,height:e!=null?e:40,className:"stroke-current"},C.default.createElement("g",{fill:"none",fillRule:"evenodd"},C.default.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},C.default.createElement("circle",{strokeOpacity:".25",cx:"18",cy:"18",r:"18"}),C.default.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18",transform:"rotate(166.645 18 18)"},C.default.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"0.8s",repeatCount:"indefinite"})))));S(M,require("@uniformdev/mesh-sdk"));module.exports=Lt(M);0&&(module.exports={Button,Callout,CmsEntrySearch,DefaultSearchRow,DefaultSelectedItem,Icons,Input,KeywordSearchInput,LoadingIcon,LoadingIndicator,LoadingOverlay,Menu,MenuContext,MenuItem,UniformMeshLocationContext,UniformMeshLocationContextProvider,UniformMeshSdkContext,UniformMeshSdkContextProvider,useInitializeUniformMeshSdk,useMenuContext,useUniformMeshLocation,useUniformMeshLocationContext,useUniformMeshSdk,useUniformMeshSdkContext});
|
|
1
|
+
var yt=Object.create;var W=Object.defineProperty;var wt=Object.getOwnPropertyDescriptor;var St=Object.getOwnPropertyNames;var Mt=Object.getPrototypeOf,Nt=Object.prototype.hasOwnProperty;var We=e=>W(e,"__esModule",{value:!0});var Xe=(e,t)=>{for(var o in t)W(e,o,{get:t[o],enumerable:!0})},S=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of St(t))!Nt.call(e,n)&&(o||n!=="default")&&W(e,n,{get:()=>t[n],enumerable:!(a=wt(t,n))||a.enumerable});return e},c=(e,t)=>S(We(W(e!=null?yt(Mt(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Lt=(e=>(t,o)=>e&&e.get(t)||(o=S(We({}),t,1),e&&e.set(t,o),o))(typeof WeakMap!="undefined"?new WeakMap:0);var M={};Xe(M,{Button:()=>F,Callout:()=>Me,CmsEntrySearch:()=>_t,DefaultSearchRow:()=>Ue,DefaultSelectedItem:()=>Ge,Icons:()=>se,Input:()=>te,KeywordSearchInput:()=>Ne,LoadingIcon:()=>it,LoadingIndicator:()=>re,LoadingOverlay:()=>jt,Menu:()=>Pe,MenuContext:()=>Le,MenuItem:()=>Ve,UniformMeshLocationContext:()=>ue,UniformMeshLocationContextProvider:()=>ce,UniformMeshSdkContext:()=>fe,UniformMeshSdkContextProvider:()=>kt,useInitializeUniformMeshSdk:()=>Pt,useMenuContext:()=>Ee,useUniformMeshLocation:()=>Et,useUniformMeshLocationContext:()=>pe,useUniformMeshSdk:()=>Vt,useUniformMeshSdkContext:()=>ge});var E=c(require("react")),ue=(0,E.createContext)(void 0),ce=({children:e})=>{let[t,o]=(0,E.useState)(),a;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let n=t||window.UniformMeshSDK.getCurrentLocation();a={location:{getValue:n.getValue,getMetadata:n.getMetadata,setValue:async s=>{await n.setValue(s),o(window.UniformMeshSDK.getCurrentLocation())}}}}return E.default.createElement(ue.Provider,{value:a},e)},pe=()=>{let e=(0,E.useContext)(ue);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function Et(){let{location:e}=pe();return{value:e==null?void 0:e.getValue(),setValue:e==null?void 0:e.setValue,metadata:e==null?void 0:e.getMetadata()}}var qe=require("@uniformdev/mesh-sdk"),H=require("react"),Pt=({autoResizingDisabled:e}={})=>{let[t,o]=(0,H.useState)(),[a,n]=(0,H.useState)();return(0,H.useEffect)(()=>{typeof window=="undefined"||a||(typeof window.UniformMeshSDK=="undefined"?(0,qe.initializeUniformMeshSDK)({autoResizingDisabled:e}).then(s=>{n(s)}).catch(s=>{o(s)}):n(window.UniformMeshSDK))},[e]),{initializing:!a&&!t,error:t,sdk:a}};var D=c(require("react"));var fe=(0,D.createContext)(void 0),kt=({children:e})=>{let t;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(t={sdk:window.UniformMeshSDK}),D.default.createElement(fe.Provider,{value:t},D.default.createElement(ce,null,e))},ge=()=>{let e=(0,D.useContext)(fe);if(!e)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return e};function Vt(){let{sdk:e}=ge();return e}var xe=c(require("react")),Qe=require("reakit"),ve={primary:{default:"bg-primary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},secondary:{default:"bg-secondary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},tertiary:{default:"bg-tertiary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},quaternary:{default:"bg-primary text-white hover:bg-opacity-75 border-2 border-gray-500 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},unimportant:{default:"bg-brand-secondary-2 text-primary hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-brand-secondary-2 text-gray-600 cursor-not-allowed"}},he={base:"inline-flex items-center border-transparent font-medium focus:outline-none focus:ring",size:(e,t)=>({xs:`${t?"px-2.5 py-1.5 ":""}text-xs leading-4 ${e?"rounded":""}`,sm:`${t?"px-3 py-2 ":""}text-sm leading-4 ${e?"rounded-md":""}`,md:`${t?"px-4 py-2 ":""}text-sm leading-5 tracking-wider ${e?"rounded-md":""}`,lg:`${t?"px-4 py-2 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`,xl:`${t?"px-6 py-3 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`}),buttonType:(e,t)=>{if(!(!e||!ve[e]))return t?ve[e].disabled:ve[e].default}},F=xe.default.forwardRef(({size:e="md",buttonType:t="primary",children:o,className:a,rounded:n=!1,disablePadding:s=!1,...f},g)=>{let p=[he.base,he.size(n,!s)[e],he.buttonType(t,f.disabled),a].join(" ");return xe.default.createElement(Qe.Button,{className:p,ref:g,...f},o)});var k=c(require("react"));var be=c(require("react")),Tt=e=>be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...e},be.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})),X=Tt;var Ce=c(require("react")),Dt=e=>Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},Ce.createElement("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})),q=Dt;var Q=c(require("react")),Bt=e=>Q.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},Q.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11 10.98a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0v-6zm1-4.929a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}),Q.createElement("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0z"})),P=Bt;var ye=c(require("react")),Gt=e=>ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},ye.createElement("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})),Y=Gt;var we=c(require("react")),Ut=e=>we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...e},we.createElement("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})),K=Ut;var Se=c(require("react")),zt=e=>Se.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},Se.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 39.2A19.2 19.2 0 1 0 20 .8a19.2 19.2 0 0 0 0 38.4Zm8.897-22.303a2.4 2.4 0 0 0-3.394-3.394L17.6 21.407l-3.103-3.104a2.4 2.4 0 0 0-3.394 3.394l4.8 4.8a2.4 2.4 0 0 0 3.394 0l9.6-9.6Z"})),ee=zt;var It={caution:{icon:K,descriptionColor:"text-yellow-700",iconColor:"text-yellow-400",titleColor:"text-yellow-800",containerColor:"bg-yellow-50"},danger:{icon:q,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},error:{icon:K,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},info:{icon:X,descriptionColor:"text-blue-700",iconColor:"text-blue-400",titleColor:"text-blue-800",containerColor:"bg-blue-50"},note:{icon:P,descriptionColor:"text-gray-700",iconColor:"text-gray-400",titleColor:"text-gray-800",containerColor:"bg-gray-50"},success:{icon:ee,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"},tip:{icon:Y,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"}},Me=({type:e="info",title:t,children:o,className:a})=>{let n=It[e];if(!n)return null;let s=n.icon;return k.default.createElement("div",{"data-testid":"sdk-ui-callout",className:`rounded-md p-4 ${n.containerColor} ${a||""}`},k.default.createElement("div",{className:"flex"},k.default.createElement("div",{className:"flex-shrink-0"},k.default.createElement(s,{className:`h-5 w-5 ${n.iconColor}`})),k.default.createElement("div",{className:"ml-3"},t?k.default.createElement("h3",{className:`text-sm font-medium mb-2 ${n.titleColor}`},t):null,o?k.default.createElement("div",{className:`text-sm ${n.descriptionColor}`},o):null)))};var V=c(require("react")),Ye=require("reakit"),te=({classNameContainer:e,classNameControl:t,classNameLabel:o,label:a,icon:n,id:s,disabled:f,...g})=>{let p={container:`uniform-input-container ${e||""}`,control:`uniform-input uniform-input-text${f?" uniform-input-disabled":""}${n?" pr-10":""} ${t||""}`,label:`uniform-input-label ${o||""}`};return V.default.createElement(V.default.Fragment,null,a?V.default.createElement("label",{htmlFor:s,className:p.label},a):null,V.default.createElement("div",{className:p.container},V.default.createElement(Ye.Input,{className:p.control,id:s,disabled:f,...g},v=>V.default.createElement("input",{...v,style:g.style})),n?V.default.createElement("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},n):null))};te.displayName="Input";var ne=c(require("react"));var T=c(require("react")),$t=e=>T.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},T.createElement("g",{clipPath:"url(#magnifying-glass_svg__a)"},T.createElement("path",{d:"M11.539 0C5.484 0 .559 4.741.559 10.57c0 5.827 4.925 10.568 10.98 10.568 6.055 0 10.98-4.74 10.98-10.569C22.52 4.741 17.595 0 11.54 0Zm0 19.187c-4.937 0-8.954-3.866-8.954-8.618 0-4.752 4.017-8.618 8.954-8.618s8.954 3.866 8.954 8.618c0 4.752-4.017 8.618-8.954 8.618Z"}),T.createElement("path",{d:"m25.196 22.334-5.811-5.593a1.041 1.041 0 0 0-1.434 0 .95.95 0 0 0 0 1.38l5.812 5.593c.198.19.457.286.716.286.26 0 .519-.096.717-.286a.95.95 0 0 0 0-1.38Z"})),T.createElement("defs",null,T.createElement("clipPath",{id:"magnifying-glass_svg__a"},T.createElement("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),oe=$t;function Ne({onSearchTextChanged:e,disabled:t=!1,placeholder:o="Keyword search",inputFieldName:a="keywordSearch",disabledFieldSubmission:n=!1}){return ne.default.createElement(te,{type:"text",name:a,placeholder:o,icon:ne.default.createElement("div",{className:"pr-1"},ne.default.createElement(oe,{className:"w-5 h-5 text-primary"})),onChange:g=>{e==null||e(g.currentTarget.value)},onKeyPress:g=>{g.key==="Enter"&&n&&g.preventDefault()},className:"uniform-input uniform-input-text pr-12 bg-gray-100",disabled:t,"aria-label":o})}var O=c(require("react")),re=()=>O.default.createElement("span",{className:"loader",role:"presentation"},O.default.createElement("i",{className:"loader__dot"}),O.default.createElement("i",{className:"loader__dot"}),O.default.createElement("i",{className:"loader__dot"}));var B=c(require("react")),U=require("reakit/Menu"),Le=B.default.createContext({}),Ee=()=>B.default.useContext(Le),Pe=({menuLabel:e,menuTrigger:t,menuItemsContainerCssClasses:o,placement:a="auto",children:n})=>{let s=(0,U.useMenuState)();return B.default.createElement(Le.Provider,{value:s},B.default.createElement(U.MenuButton,{...s,ref:t.ref,...t.props},f=>B.default.cloneElement(t,f)),B.default.createElement(U.Menu,{...s,placement:a,"aria-label":e,className:`uniform-menu divide-y divide-gray-500 shadow-xl z-50 ${o}`},n))};var z=c(require("react")),ke=require("reakit");var Ve=({children:e,className:t,hideMenuOnClick:o=!0,icon:a,...n})=>{let s=Ee(),f=`uniform-menu-item bg-white ${(n==null?void 0:n.disabled)?"text-gray-500":"text-primary"} ${t||""}`,g=v=>{let x={...v};if(x.onClick){let w=x.onClick;x.onClick=m=>{s.hide(),w(m)}}return x};if(typeof e=="function")return z.default.createElement(ke.MenuItem,{...s,...n,className:f},v=>{let x=o?g(v):v,w=e(x);return a?et(w,a):w});let p=o?g(n):n;return z.default.createElement(ke.MenuItem,{...s,...p,className:f},a?et(e,a):e)};function et(e,t){return z.default.createElement("div",{className:"flex items-center justify-between"},z.default.createElement("div",null,e),z.default.createElement("div",{className:"ml-4"},t))}var r=c(require("react"));var se={};Xe(se,{Caution:()=>K,Checkmark:()=>ee,ChevronDown:()=>ae,Close:()=>ie,Danger:()=>q,ExclamationPoint:()=>X,Info:()=>P,Lightbulb:()=>Y,MagnifyingGlass:()=>oe,MaximizeAlt:()=>tt,MoreVerticalAlt:()=>_});var Te=c(require("react")),Ht=e=>Te.createElement("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e},Te.createElement("path",{d:"M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414Z"})),ae=Ht;var A=c(require("react")),Ft=e=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e},A.createElement("g",{fillRule:"evenodd"},A.createElement("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),A.createElement("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"}))),ie=Ft;var De=c(require("react")),Kt=e=>De.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},De.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M3 3h6v2H6.462l4.843 4.843-1.415 1.414L5 6.367V9H3V3zm0 18h6v-2H6.376l4.929-4.928-1.415-1.414L5 17.548V15H3v6zm12 0h6v-6h-2v2.524l-4.867-4.866-1.414 1.414L17.647 19H15v2zm6-18h-6v2h2.562l-4.843 4.843 1.414 1.414L19 6.39V9h2V3z"})),tt=Kt;var Be=c(require("react")),Ot=e=>Be.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},Be.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M14 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})),_=Ot;var rt=require("react-use"),at=require("uuid");var l=c(require("react"));function ot(e,t){let o=window.open(e,"_blank"),a=setInterval(()=>{(o==null?void 0:o.closed)&&(clearInterval(a),t())},500)}var nt=require("timeago.js"),Ge=({selectedItem:e,logoIcon:t,onDeselect:o,onEditClosed:a})=>{var w;let n=(0,l.useRef)(null),s=(0,l.useRef)(null),[f,g]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let m=N=>{n.current&&!n.current.contains(N.target)&&s.current&&!s.current.contains(N.target)&&g(!1)},b=()=>{g(!1)};return window.addEventListener("resize",b,!0),document.addEventListener("scroll",m,!0),document.addEventListener("mousedown",m),()=>{window.removeEventListener("resize",b,!0),document.removeEventListener("scroll",m,!0),document.removeEventListener("mousedown",m)}},[s]);let p=()=>{var m;if(g(!f),s.current&&n.current){let b=(m=n==null?void 0:n.current)==null?void 0:m.getBoundingClientRect();s.current.style.top=`${b.top+30}px`}},v=t&&typeof t!="string"?t:null,x=v?l.default.createElement(v,{className:"h-7 w-7"}):l.default.createElement("img",{src:t,alt:"CMS logo",className:"h-7 w-7"});return l.default.createElement("div",{className:"flex w-full border border-gray-300 rounded-md bg-gray-100",key:e.id},l.default.createElement("div",{className:"p-4 pl-8 flex flex-grow mr-2 gap-2 items-center relative"},l.default.createElement("div",{className:"flex-grow"},l.default.createElement("div",{className:"inline-flex relative items-start"},l.default.createElement("h4",{className:"text-primary font-bold leading-none mb-2",title:`ID: ${e.id}`,"data-test-id":"entry-id"},e.title||e.id||""),e.popoverData&&l.default.createElement(l.default.Fragment,null,l.default.createElement("button",{type:"button",ref:n,className:"ml-2 -my-1","aria-controls":"path-details",onClick:p},l.default.createElement(P,{className:"text-gray-700"})),l.default.createElement("div",{ref:s,className:`fixed bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 ${f?"visible":"invisible"}`},Object.entries(e.popoverData).map(([m,b],N)=>l.default.createElement("div",{className:"text-xs",key:N},l.default.createElement("span",{className:"font-bold mr-2"},m,":"),b))))),e.createdDate&&l.default.createElement("div",{className:"text-xs"},l.default.createElement("span",{className:"font-bold mr-2"},"Created:"),(0,nt.format)((w=e.createdDate)!=null?w:0)),l.default.createElement("div",{className:"flex gap-4"},e.metadata?Object.entries(e.metadata).filter(([m])=>["type","status"].includes(m.toLocaleLowerCase())).map(([m,b])=>l.default.createElement("span",{className:"text-sm",key:m},b)):null),e.metadata?Object.entries(e.metadata).filter(([m])=>!["type","status"].includes(m.toLocaleLowerCase())).map(([m,b])=>l.default.createElement("div",{className:"text-xs order-1",key:m},l.default.createElement("span",{className:"font-bold mr-2 order-1"},m,":"),b)):null),l.default.createElement("div",{className:"flex md:flex-row flex-col gap-2"},e.editLink?l.default.createElement("a",{href:e.editLink,title:"edit",rel:"noopener",target:"__blank",onClick:m=>{a&&(ot(m.currentTarget.href,()=>a(e)),m.preventDefault())},className:"flex justify-between items-center pl-4 pr-2 bg-white rounded border-2 border-gray-400 hover:bg-gray-100"},l.default.createElement("span",{className:"mr-2 text-sm"},"Edit"),x):null,l.default.createElement("button",{type:"button",onClick:m=>{m.preventDefault(),o(e)},className:"flex justify-between items-center px-4 bg-white rounded border-2 border-gray-400 h-10 hover:bg-gray-100"},l.default.createElement("span",{className:"mr-2 text-sm"},"Unlink"),l.default.createElement(ie,{className:"w-4 h-4 text-red-600"})))))};var h=c(require("react"));var Ue=({result:e,isSelected:t,triggerSelection:o})=>{let a=(0,h.useRef)(null),n=(0,h.useRef)(null),[s,f]=(0,h.useState)(!1);(0,h.useEffect)(()=>{function p(v){a.current&&!a.current.contains(v.target)&&n.current&&!n.current.contains(v.target)&&f(!1)}return document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[n]);let g=p=>{p.stopPropagation(),f(!s)};return h.default.createElement("div",{key:e.id,className:`p-2 cursor-pointer relative ${t?"bg-green-400 text-white":""}`,"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o()},e.title,e.popoverData&&t?h.default.createElement(h.default.Fragment,null,h.default.createElement("button",{type:"button",ref:a,className:"absolute top-0 bottom-0 right-2","aria-controls":"path-details",onClick:p=>g(p)},h.default.createElement(P,null)),h.default.createElement("div",{ref:n,className:`absolute top-4 right-10 bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 text-black ${s?"visible":"invisible"}`},e.metadata&&Object.entries(e.metadata).map(([p,v],x)=>h.default.createElement("div",{className:"text-xs",key:x},h.default.createElement("span",{className:"font-bold mr-2"},p,":"),v)),Object.entries(e.popoverData).map(([p,v],x)=>h.default.createElement("div",{className:"text-xs",key:x},h.default.createElement("span",{className:"font-bold mr-2"},p,":"),v)))):null)};var I=require("react-beautiful-dnd"),At=({searchText:e,selectedContentType:t})=>{let o="No content found";return t&&(o=`No ${t} content was found`),e&&(o=`${o} for keyword '${e}'.`),r.default.createElement(Me,{type:"info"},o)},_t=({search:e,results:t,contentTypes:o,selectedItems:a,logoIcon:n,select:s,multiSelect:f,multiSelectId:g,rowComponent:p,selectedItemComponent:v,totalResults:x,resultsLoading:w,requireContentType:m,onAddNew:b,onEditClosed:N,onCancel:ze,noResultsComponent:st,helpComponent:lt,onSort:le})=>{var Re,Ze,Je;let Ie=()=>m?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[$e,He]=(0,r.useState)(""),[L,Fe]=(0,r.useState)(Ie),[j,de]=(0,r.useState)(!1),[R,Z]=(0,r.useState)([]),[dt,Ke]=(0,r.useState)(!1),J=(0,rt.useThrottle)($e,750);(0,r.useEffect)(()=>{e(J,{count:5,offset:0,contentType:L==="any"?void 0:L})},[J,L]);let mt=i=>{R.includes(i.id)?Z(u=>u.filter(G=>G!==i.id)):Z(f?u=>[...u,i==null?void 0:i.id]:[i.id])},ut=()=>{Fe(Ie()),He(""),Z((a==null?void 0:a.length)?a.map(i=>i.id):[])},ct=()=>{de(i=>!i),j||ut()},Oe=i=>{s((a==null?void 0:a.filter(u=>u.id!==i.id).map(u=>u.id))||[],"")},pt=i=>{i.preventDefault(),s(R,L),de(!1)},ft=i=>{i.preventDefault(),de(!1),ze&&ze()},gt=i=>{i.preventDefault(),e(J,{count:5,offset:(t==null?void 0:t.length)||0,contentType:L==="any"?void 0:L}),Ke(!0);let u=setTimeout(()=>{Ke(!1)},750);return()=>clearTimeout(u)},Ae=(0,r.useRef)((0,at.v4)()),vt=!(a==null?void 0:a.length)||f,ht=p||Ue,_e=v||Ge,xt=st||At,je=n&&typeof n!="string"?n:null,bt=je?r.default.createElement(je,{className:"h-9 w-9"}):r.default.createElement("img",{src:n,alt:"CMS logo",className:"h-9 w-9"}),Ct=i=>{var u,G;if(i.destination&&i.source.droppableId===((u=i.destination)==null?void 0:u.droppableId)){let y=[...a||[]],[me]=(G=y==null?void 0:y.splice(i.source.index,1))!=null?G:[];return y==null||y.splice(i.destination.index,0,me),le==null||le(y.map($=>$.id)),y}};return r.default.createElement("div",{className:"w-full"},r.default.createElement("div",{className:"relative my-4"},vt&&r.default.createElement("div",{className:"space-y-2"},r.default.createElement("div",{className:"py-3 px-2 bg-white rounded-lg border border-gray-300 mb-4","data-test-id":"component-search"},r.default.createElement("button",{className:"flex items-center w-full text-base relative",onClick:ct,type:"button","aria-haspopup":!0,"aria-expanded":j,"aria-controls":Ae.current},bt,r.default.createElement("span",{className:"ml-4"},"Select"),r.default.createElement("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},r.default.createElement(ae,{className:`w-5 h-5 text-standard transform transition-transform ${j?"rotate-180":"rotate-0"}`})))),r.default.createElement("div",{className:`${j?"block":"hidden"} py-3 px-4 space-y-4 bg-white rounded-lg border border-gray-300`},lt||null,r.default.createElement("div",{className:"flex space-x-3"},r.default.createElement("select",{className:"uniform-input uniform-input-select w-1/3 bg-gray-100",onChange:i=>Fe(i.target.value)},m?null:r.default.createElement("option",{value:"any",className:"bg-white text-primary"},"All content types"),o==null?void 0:o.map(i=>r.default.createElement("option",{value:i.id,key:i.id,className:"bg-white text-primary"},i.name))),r.default.createElement("div",{className:"flex-grow"},r.default.createElement(Ne,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:He,disabledFieldSubmission:!0}))),r.default.createElement("div",{className:"overflow-y-scroll max-h-64 divide-y divide-gray-200 scrollbar",id:Ae.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},(t==null?void 0:t.length)?t.map(i=>r.default.createElement(ht,{key:i.id,isSelected:R.includes(i.id),result:i,triggerSelection:()=>mt(i)})):w?null:r.default.createElement(xt,{searchText:J||$e,selectedContentType:(Ze=(Re=o==null?void 0:o.find(i=>i.id===L))==null?void 0:Re.name)!=null?Ze:L}),!w&&typeof x!="undefined"&&t&&(t==null?void 0:t.length)<x&&r.default.createElement("button",{className:"block p-4 text-center w-full hover:bg-gray-100 focus:bg-gray-100 font-bold text-primary text-sm focus:outline-none",onClick:gt},dt?r.default.createElement(re,null):"Load More"),w&&!(t==null?void 0:t.length)?r.default.createElement("div",{className:"p-4 text-center w-full"},r.default.createElement(re,null)):null),r.default.createElement("div",{className:"flex justify-between"},r.default.createElement("div",null,b&&((Je=o==null?void 0:o.length)!=null?Je:0)>0?r.default.createElement(Pe,{menuLabel:"Add new menu",menuTrigger:r.default.createElement(F,{buttonType:"secondary"},"Add New")},o==null?void 0:o.map(i=>r.default.createElement(Ve,{key:i.id,className:"bg-white text-primary",onClick:()=>b(i)},i.name))):null),r.default.createElement("div",null,r.default.createElement(F,{buttonType:"unimportant",onClick:ft},"Cancel"),r.default.createElement(F,{className:"ml-5",disabled:!R.length,onClick:pt,"data-test-id":"entry-accept-button"},"Accept"))))),f?r.default.createElement(I.DragDropContext,{onDragEnd:i=>Ct(i)},r.default.createElement(I.Droppable,{droppableId:g||"canvas-multi-select"},i=>r.default.createElement("div",{...i.droppableProps,ref:i.innerRef,className:"space-y-1"},a==null?void 0:a.map((u,G)=>{if(u==null?void 0:u.id)return r.default.createElement(I.Draggable,{key:u.id,draggableId:u.id,index:G},(y,me)=>r.default.createElement("div",{className:"relative group",ref:y.innerRef,...y.draggableProps,...y.dragHandleProps},r.default.createElement("span",{className:`absolute left-0 top-0 bottom-0 my-auto flex items-center ${me.isDragging?"":"opacity-0 group-hover:opacity-30"}`},r.default.createElement(_,{className:"text-brand-secondary-1 absolute left-1.5",width:24,height:24}),r.default.createElement(_,{className:"text-brand-secondary-1",width:24,height:24})),r.default.createElement(_e,{key:`selected-item-${u.id}`,logoIcon:n,selectedItem:u,onDeselect:$=>Oe($),onEditClosed:N?$=>N($):void 0})))}),i.placeholder))):a==null?void 0:a.map(i=>r.default.createElement(_e,{key:`selected-item-${i.id}`,logoIcon:n,selectedItem:i,onDeselect:u=>Oe(u),onEditClosed:N?u=>N(u):void 0}))))};var C=c(require("react")),jt=({isActive:e,statusMessage:t})=>C.default.createElement("div",{className:`${e?"flex":"hidden"} absolute bottom-0 left-0 right-0 top-0 items-center justify-center overflow-hidden z-50`,style:{zIndex:9999}},C.default.createElement("div",{className:"absolute bottom-0 left-0 right-0 top-0 bg-white bg-opacity-50"}),C.default.createElement("div",{className:"relative"},C.default.createElement("div",{className:"flex flex-col items-center"},C.default.createElement(it,{height:128,width:128}),t?C.default.createElement("div",{className:"mt-4 text-gray-500"},t):null))),it=({height:e,width:t})=>C.default.createElement("svg",{"data-testid":"svg",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",width:t!=null?t:40,height:e!=null?e:40,className:"stroke-current"},C.default.createElement("g",{fill:"none",fillRule:"evenodd"},C.default.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},C.default.createElement("circle",{strokeOpacity:".25",cx:"18",cy:"18",r:"18"}),C.default.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18",transform:"rotate(166.645 18 18)"},C.default.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"0.8s",repeatCount:"indefinite"})))));S(M,require("@uniformdev/mesh-sdk"));module.exports=Lt(M);0&&(module.exports={Button,Callout,CmsEntrySearch,DefaultSearchRow,DefaultSelectedItem,Icons,Input,KeywordSearchInput,LoadingIcon,LoadingIndicator,LoadingOverlay,Menu,MenuContext,MenuItem,UniformMeshLocationContext,UniformMeshLocationContextProvider,UniformMeshSdkContext,UniformMeshSdkContextProvider,useInitializeUniformMeshSdk,useMenuContext,useUniformMeshLocation,useUniformMeshLocationContext,useUniformMeshSdk,useUniformMeshSdkContext});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var dt=Object.defineProperty;var mt=(e,t)=>{for(var o in t)dt(e,o,{get:t[o],enumerable:!0})};import ut,{createContext as ct,useContext as pt,useState as ft}from"react";var Ee=ct(void 0),Pe=({children:e})=>{let[t,o]=ft(),n;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let r=t||window.UniformMeshSDK.getCurrentLocation();n={location:{getValue:r.getValue,getMetadata:r.getMetadata,setValue:async s=>{await r.setValue(s),o(window.UniformMeshSDK.getCurrentLocation())}}}}return ut.createElement(Ee.Provider,{value:n},e)},ke=()=>{let e=pt(Ee);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function oo(){let{location:e}=ke();return{value:e==null?void 0:e.getValue(),setValue:e==null?void 0:e.setValue,metadata:e==null?void 0:e.getMetadata()}}import{initializeUniformMeshSDK as gt}from"@uniformdev/mesh-sdk";import{useEffect as vt,useState as Ve}from"react";var so=({autoResizingDisabled:e}={})=>{let[t,o]=Ve(),[n,r]=Ve();return vt(()=>{typeof window=="undefined"||n||(typeof window.UniformMeshSDK=="undefined"?gt({autoResizingDisabled:e}).then(s=>{r(s)}).catch(s=>{o(s)}):r(window.UniformMeshSDK))},[e]),{initializing:!n&&!t,error:t,sdk:n}};import Te,{createContext as ht,useContext as xt}from"react";var De=ht(void 0),co=({children:e})=>{let t;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(t={sdk:window.UniformMeshSDK}),Te.createElement(De.Provider,{value:t},Te.createElement(Pe,null,e))},Be=()=>{let e=xt(De);if(!e)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return e};function go(){let{sdk:e}=Be();return e}import Ge from"react";import{Button as bt}from"reakit/Button";var ee={primary:{default:"bg-primary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},secondary:{default:"bg-secondary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},tertiary:{default:"bg-tertiary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},quaternary:{default:"bg-primary text-white hover:bg-opacity-75 border-2 border-gray-500 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},unimportant:{default:"bg-brand-secondary-2 text-primary hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-brand-secondary-2 text-gray-600 cursor-not-allowed"}},te={base:"inline-flex items-center border-transparent font-medium focus:outline-none focus:ring",size:(e,t)=>({xs:`${t?"px-2.5 py-1.5 ":""}text-xs leading-4 ${e?"rounded":""}`,sm:`${t?"px-3 py-2 ":""}text-sm leading-4 ${e?"rounded-md":""}`,md:`${t?"px-4 py-2 ":""}text-sm leading-5 tracking-wider ${e?"rounded-md":""}`,lg:`${t?"px-4 py-2 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`,xl:`${t?"px-6 py-3 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`}),buttonType:(e,t)=>{if(!(!e||!ee[e]))return t?ee[e].disabled:ee[e].default}},K=Ge.forwardRef(({size:e="md",buttonType:t="primary",children:o,className:n,rounded:r=!1,disablePadding:s=!1,...f},g)=>{let p=[te.base,te.size(r,!s)[e],te.buttonType(t,f.disabled),n].join(" ");return Ge.createElement(bt,{className:p,ref:g,...f},o)});import E from"react";import*as oe from"react";var Ct=e=>oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...e},oe.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})),O=Ct;import*as ne from"react";var yt=e=>ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},ne.createElement("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})),A=yt;import*as _ from"react";var wt=e=>_.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},_.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11 10.98a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0v-6zm1-4.929a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}),_.createElement("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0z"})),N=wt;import*as re from"react";var St=e=>re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},re.createElement("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})),j=St;import*as ae from"react";var Mt=e=>ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...e},ae.createElement("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})),D=Mt;import*as ie from"react";var Nt=e=>ie.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},ie.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 39.2A19.2 19.2 0 1 0 20 .8a19.2 19.2 0 0 0 0 38.4Zm8.897-22.303a2.4 2.4 0 0 0-3.394-3.394L17.6 21.407l-3.103-3.104a2.4 2.4 0 0 0-3.394 3.394l4.8 4.8a2.4 2.4 0 0 0 3.394 0l9.6-9.6Z"})),R=Nt;var Lt={caution:{icon:D,descriptionColor:"text-yellow-700",iconColor:"text-yellow-400",titleColor:"text-yellow-800",containerColor:"bg-yellow-50"},danger:{icon:A,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},error:{icon:D,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},info:{icon:O,descriptionColor:"text-blue-700",iconColor:"text-blue-400",titleColor:"text-blue-800",containerColor:"bg-blue-50"},note:{icon:N,descriptionColor:"text-gray-700",iconColor:"text-gray-400",titleColor:"text-gray-800",containerColor:"bg-gray-50"},success:{icon:R,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"},tip:{icon:j,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"}},Ue=({type:e="info",title:t,children:o,className:n})=>{let r=Lt[e];if(!r)return null;let s=r.icon;return E.createElement("div",{"data-testid":"sdk-ui-callout",className:`rounded-md p-4 ${r.containerColor} ${n||""}`},E.createElement("div",{className:"flex"},E.createElement("div",{className:"flex-shrink-0"},E.createElement(s,{className:`h-5 w-5 ${r.iconColor}`})),E.createElement("div",{className:"ml-3"},t?E.createElement("h3",{className:`text-sm font-medium mb-2 ${r.titleColor}`},t):null,o?E.createElement("div",{className:`text-sm ${r.descriptionColor}`},o):null)))};import P from"react";import{Input as Et}from"reakit/Input";var se=({classNameContainer:e,classNameControl:t,classNameLabel:o,label:n,icon:r,id:s,disabled:f,...g})=>{let p={container:`uniform-input-container ${e||""}`,control:`uniform-input uniform-input-text${f?" uniform-input-disabled":""}${r?" pr-10":""} ${t||""}`,label:`uniform-input-label ${o||""}`};return P.createElement(P.Fragment,null,n?P.createElement("label",{htmlFor:s,className:p.label},n):null,P.createElement("div",{className:p.container},P.createElement(Et,{className:p.control,id:s,disabled:f,...g},v=>P.createElement("input",{...v,style:g.style})),r?P.createElement("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},r):null))};se.displayName="Input";import le from"react";import*as L from"react";var Pt=e=>L.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("g",{clipPath:"url(#magnifying-glass_svg__a)"},L.createElement("path",{d:"M11.539 0C5.484 0 .559 4.741.559 10.57c0 5.827 4.925 10.568 10.98 10.568 6.055 0 10.98-4.74 10.98-10.569C22.52 4.741 17.595 0 11.54 0Zm0 19.187c-4.937 0-8.954-3.866-8.954-8.618 0-4.752 4.017-8.618 8.954-8.618s8.954 3.866 8.954 8.618c0 4.752-4.017 8.618-8.954 8.618Z"}),L.createElement("path",{d:"m25.196 22.334-5.811-5.593a1.041 1.041 0 0 0-1.434 0 .95.95 0 0 0 0 1.38l5.812 5.593c.198.19.457.286.716.286.26 0 .519-.096.717-.286a.95.95 0 0 0 0-1.38Z"})),L.createElement("defs",null,L.createElement("clipPath",{id:"magnifying-glass_svg__a"},L.createElement("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),Z=Pt;function ze({onSearchTextChanged:e,disabled:t=!1,placeholder:o="Keyword search",inputFieldName:n="keywordSearch",disabledFieldSubmission:r=!1}){return le.createElement(se,{type:"text",name:n,placeholder:o,icon:le.createElement("div",{className:"pr-1"},le.createElement(Z,{className:"w-5 h-5 text-primary"})),onChange:g=>{e==null||e(g.currentTarget.value)},onKeyPress:g=>{g.key==="Enter"&&r&&g.preventDefault()},className:"uniform-input uniform-input-text pr-12 bg-gray-100",disabled:t,"aria-label":o})}import J from"react";var de=()=>J.createElement("span",{className:"loader",role:"presentation"},J.createElement("i",{className:"loader__dot"}),J.createElement("i",{className:"loader__dot"}),J.createElement("i",{className:"loader__dot"}));import V from"react";import{useMenuState as kt,Menu as Vt,MenuButton as Tt}from"reakit/Menu";var Ie=V.createContext({}),$e=()=>V.useContext(Ie),He=({menuLabel:e,menuTrigger:t,menuItemsContainerCssClasses:o,placement:n="auto",children:r})=>{let s=kt();return V.createElement(Ie.Provider,{value:s},V.createElement(Tt,{...s,ref:t.ref,...t.props},f=>V.cloneElement(t,f)),V.createElement(Vt,{...s,placement:n,"aria-label":e,className:`uniform-menu divide-y divide-gray-500 shadow-xl z-50 ${o}`},r))};import B from"react";import{MenuItem as Fe}from"reakit";var Oe=({children:e,className:t,hideMenuOnClick:o=!0,icon:n,...r})=>{let s=$e(),f=`uniform-menu-item bg-white ${(r==null?void 0:r.disabled)?"text-gray-500":"text-primary"} ${t||""}`,g=v=>{let h={...v};if(h.onClick){let y=h.onClick;h.onClick=m=>{s.hide(),y(m)}}return h};if(typeof e=="function")return B.createElement(Fe,{...s,...r,className:f},v=>{let h=o?g(v):v,y=e(h);return n?Ke(y,n):y});let p=o?g(r):r;return B.createElement(Fe,{...s,...p,className:f},n?Ke(e,n):e)};function Ke(e,t){return B.createElement("div",{className:"flex items-center justify-between"},B.createElement("div",null,e),B.createElement("div",{className:"ml-4"},t))}import i,{useState as z,useEffect as Kt,useRef as Ot}from"react";var pe={};mt(pe,{Caution:()=>D,Checkmark:()=>R,ChevronDown:()=>W,Close:()=>X,Danger:()=>A,ExclamationPoint:()=>O,Info:()=>N,Lightbulb:()=>j,MagnifyingGlass:()=>Z,MaximizeAlt:()=>Ae,MoreVerticalAlt:()=>U});import*as me from"react";var Dt=e=>me.createElement("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e},me.createElement("path",{d:"M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414Z"})),W=Dt;import*as G from"react";var Bt=e=>G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e},G.createElement("g",{fillRule:"evenodd"},G.createElement("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),G.createElement("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"}))),X=Bt;import*as ue from"react";var Gt=e=>ue.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},ue.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M3 3h6v2H6.462l4.843 4.843-1.415 1.414L5 6.367V9H3V3zm0 18h6v-2H6.376l4.929-4.928-1.415-1.414L5 17.548V15H3v6zm12 0h6v-6h-2v2.524l-4.867-4.866-1.414 1.414L17.647 19H15v2zm6-18h-6v2h2.562l-4.843 4.843 1.414 1.414L19 6.39V9h2V3z"})),Ae=Gt;import*as ce from"react";var Ut=e=>ce.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},ce.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M14 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})),U=Ut;import{useThrottle as At}from"react-use";import{v4 as _t}from"uuid";import u,{useState as zt,useRef as je,useEffect as It}from"react";function _e(e,t){let o=window.open(e,"_blank"),n=setInterval(()=>{(o==null?void 0:o.closed)&&(clearInterval(n),t())},500)}import{format as $t}from"timeago.js";var Re=({selectedItem:e,logoIcon:t,onDeselect:o,onEditClosed:n})=>{var y;let r=je(null),s=je(null),[f,g]=zt(!1);It(()=>{let m=S=>{r.current&&!r.current.contains(S.target)&&s.current&&!s.current.contains(S.target)&&g(!1)},x=()=>{g(!1)};return window.addEventListener("resize",x,!0),document.addEventListener("scroll",m,!0),document.addEventListener("mousedown",m),()=>{window.removeEventListener("resize",x,!0),document.removeEventListener("scroll",m,!0),document.removeEventListener("mousedown",m)}},[s]);let p=()=>{var m;if(g(!f),s.current&&r.current){let x=(m=r==null?void 0:r.current)==null?void 0:m.getBoundingClientRect();s.current.style.top=`${x.top+30}px`}},v=t&&typeof t!="string"?t:null,h=v?u.createElement(v,{className:"h-7 w-7"}):u.createElement("img",{src:t,alt:"CMS logo",className:"h-7 w-7"});return u.createElement("div",{className:"flex w-full border border-gray-300 rounded-md bg-gray-100",key:e.id},u.createElement("div",{className:"p-4 pl-8 flex flex-grow mr-2 gap-2 items-center relative"},u.createElement("div",{className:"flex-grow"},u.createElement("div",{className:"inline-flex relative items-start"},u.createElement("h4",{className:"text-primary font-bold leading-none mb-2",title:`ID: ${e.id}`,"data-test-id":"entry-id"},e.title||e.id||""),e.popoverData&&u.createElement(u.Fragment,null,u.createElement("button",{type:"button",ref:r,className:"ml-2 -my-1","aria-controls":"path-details",onClick:p},u.createElement(N,{className:"text-gray-700"})),u.createElement("div",{ref:s,className:`fixed bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 ${f?"visible":"invisible"}`},Object.entries(e.popoverData).map(([m,x],S)=>u.createElement("div",{className:"text-xs",key:S},u.createElement("span",{className:"font-bold mr-2"},m,":"),x))))),e.createdDate&&u.createElement("div",{className:"text-xs"},u.createElement("span",{className:"font-bold mr-2"},"Created:"),$t((y=e.createdDate)!=null?y:0)),u.createElement("div",{className:"flex gap-4"},e.metadata?Object.entries(e.metadata).filter(([m])=>["type","status"].includes(m.toLocaleLowerCase())).map(([m,x])=>u.createElement("span",{className:"text-sm",key:m},x)):null),e.metadata?Object.entries(e.metadata).filter(([m])=>!["type","status"].includes(m.toLocaleLowerCase())).map(([m,x])=>u.createElement("div",{className:"text-xs order-1",key:m},u.createElement("span",{className:"font-bold mr-2 order-1"},m,":"),x)):null),u.createElement("div",{className:"flex md:flex-row flex-col gap-2"},e.editLink?u.createElement("a",{href:e.editLink,title:"edit",rel:"noopener",target:"__blank",onClick:m=>{n&&(_e(m.currentTarget.href,()=>n(e)),m.preventDefault())},className:"flex justify-between items-center pl-4 pr-2 bg-white rounded border-2 border-gray-400 hover:bg-gray-100"},u.createElement("span",{className:"mr-2 text-sm"},"Edit"),h):null,u.createElement("button",{type:"button",onClick:m=>{m.preventDefault(),o(e)},className:"flex justify-between items-center px-4 bg-white rounded border-2 border-gray-400 h-10 hover:bg-gray-100"},u.createElement("span",{className:"mr-2 text-sm"},"Unlink"),u.createElement(X,{className:"w-4 h-4 text-red-600"})))))};import w,{useState as Ht,useRef as Ze,useEffect as Ft}from"react";var Je=({result:e,isSelected:t,triggerSelection:o})=>{let n=Ze(null),r=Ze(null),[s,f]=Ht(!1);Ft(()=>{function p(v){n.current&&!n.current.contains(v.target)&&r.current&&!r.current.contains(v.target)&&f(!1)}return document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[r]);let g=p=>{p.stopPropagation(),f(!s)};return w.createElement("div",{key:e.id,className:`p-2 cursor-pointer relative ${t?"bg-green-400 text-white":""}`,"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o()},e.title,e.popoverData&&t?w.createElement(w.Fragment,null,w.createElement("button",{type:"button",ref:n,className:"absolute top-0 bottom-0 right-2","aria-controls":"path-details",onClick:p=>g(p)},w.createElement(N,null)),w.createElement("div",{ref:r,className:`absolute top-4 right-10 bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 text-black ${s?"visible":"invisible"}`},e.metadata&&Object.entries(e.metadata).map(([p,v],h)=>w.createElement("div",{className:"text-xs",key:h},w.createElement("span",{className:"font-bold mr-2"},p,":"),v)),Object.entries(e.popoverData).map(([p,v],h)=>w.createElement("div",{className:"text-xs",key:h},w.createElement("span",{className:"font-bold mr-2"},p,":"),v)))):null)};import{Droppable as jt,DragDropContext as Rt,Draggable as Zt}from"react-beautiful-dnd";var Jt=({searchText:e,selectedContentType:t})=>{let o="No content found";return t&&(o=`No ${t} content was found`),e&&(o=`${o} for keyword '${e}'.`),i.createElement(Ue,{type:"info"},o)},Kn=({search:e,results:t,contentTypes:o,selectedItems:n,logoIcon:r,select:s,multiSelect:f,multiSelectId:g,rowComponent:p,selectedItemComponent:v,totalResults:h,resultsLoading:y,requireContentType:m,onAddNew:x,onEditClosed:S,onCancel:fe,noResultsComponent:We,helpComponent:Xe,onSort:q})=>{var Me,Ne,Le;let ge=()=>m?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[ve,he]=z(""),[M,xe]=z(ge),[I,Q]=z(!1),[$,H]=z([]),[qe,be]=z(!1),F=At(ve,750);Kt(()=>{e(F,{count:5,offset:0,contentType:M==="any"?void 0:M})},[F,M]);let Qe=a=>{$.includes(a.id)?H(c=>c.filter(k=>k!==a.id)):H(f?c=>[...c,a==null?void 0:a.id]:[a.id])},Ye=()=>{xe(ge()),he(""),H((n==null?void 0:n.length)?n.map(a=>a.id):[])},et=()=>{Q(a=>!a),I||Ye()},Ce=a=>{s((n==null?void 0:n.filter(c=>c.id!==a.id).map(c=>c.id))||[],"")},tt=a=>{a.preventDefault(),s($,M),Q(!1)},ot=a=>{a.preventDefault(),Q(!1),fe&&fe()},nt=a=>{a.preventDefault(),e(F,{count:5,offset:(t==null?void 0:t.length)||0,contentType:M==="any"?void 0:M}),be(!0);let c=setTimeout(()=>{be(!1)},750);return()=>clearTimeout(c)},ye=Ot(_t()),rt=!(n==null?void 0:n.length)||f,at=p||Je,we=v||Re,it=We||Jt,Se=r&&typeof r!="string"?r:null,st=Se?i.createElement(Se,{className:"h-9 w-9"}):i.createElement("img",{src:r,alt:"CMS logo",className:"h-9 w-9"}),lt=a=>{var c,k;if(a.destination&&a.source.droppableId===((c=a.destination)==null?void 0:c.droppableId)){let b=[...n||[]],[Y]=(k=b==null?void 0:b.splice(a.source.index,1))!=null?k:[];return b==null||b.splice(a.destination.index,0,Y),q==null||q(b.map(T=>T.id)),b}};return i.createElement("div",{className:"w-full"},i.createElement("div",{className:"relative my-4"},rt&&i.createElement("div",{className:"space-y-2"},i.createElement("div",{className:"py-3 px-2 bg-white rounded-lg border border-gray-300 mb-4","data-test-id":"component-search"},i.createElement("button",{className:"flex items-center w-full text-base relative",onClick:et,type:"button","aria-haspopup":!0,"aria-expanded":I,"aria-controls":ye.current},st,i.createElement("span",{className:"ml-4"},"Select"),i.createElement("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},i.createElement(W,{className:`w-5 h-5 text-standard transform transition-transform ${I?"rotate-180":"rotate-0"}`})))),i.createElement("div",{className:`${I?"block":"hidden"} py-3 px-4 space-y-4 bg-white rounded-lg border border-gray-300`},Xe||null,i.createElement("div",{className:"flex space-x-3"},i.createElement("select",{className:"uniform-input uniform-input-select w-1/3 bg-gray-100",onChange:a=>xe(a.target.value)},m?null:i.createElement("option",{value:"any",className:"bg-white text-primary"},"All content types"),o==null?void 0:o.map(a=>i.createElement("option",{value:a.id,key:a.id,className:"bg-white text-primary"},a.name))),i.createElement("div",{className:"flex-grow"},i.createElement(ze,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:he,disabledFieldSubmission:!0}))),i.createElement("div",{className:"overflow-y-scroll max-h-64 divide-y divide-gray-200 scrollbar",id:ye.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},(t==null?void 0:t.length)?t.map(a=>i.createElement(at,{key:a.id,isSelected:$.includes(a.id),result:a,triggerSelection:()=>Qe(a)})):y?null:i.createElement(it,{searchText:F||ve,selectedContentType:(Ne=(Me=o==null?void 0:o.find(a=>a.id===M))==null?void 0:Me.name)!=null?Ne:M}),!y&&typeof h!="undefined"&&t&&(t==null?void 0:t.length)<h&&i.createElement("button",{className:"block p-4 text-center w-full hover:bg-gray-100 focus:bg-gray-100 font-bold text-primary text-sm focus:outline-none",onClick:nt},qe?i.createElement(de,null):"Load More"),y&&!(t==null?void 0:t.length)?i.createElement("div",{className:"p-4 text-center w-full"},i.createElement(de,null)):null),i.createElement("div",{className:"flex justify-between"},i.createElement("div",null,x&&((Le=o==null?void 0:o.length)!=null?Le:0)>0?i.createElement(He,{menuLabel:"Add new menu",menuTrigger:i.createElement(K,{buttonType:"secondary"},"Add New")},o==null?void 0:o.map(a=>i.createElement(Oe,{key:a.id,className:"bg-white text-primary",onClick:()=>x(a)},a.name))):null),i.createElement("div",null,i.createElement(K,{buttonType:"unimportant",onClick:ot},"Cancel"),i.createElement(K,{className:"ml-5",disabled:!$.length,onClick:tt,"data-test-id":"entry-accept-button"},"Accept"))))),f?i.createElement(Rt,{onDragEnd:a=>lt(a)},i.createElement(jt,{droppableId:g||"canvas-multi-select"},a=>i.createElement("div",{...a.droppableProps,ref:a.innerRef,className:"space-y-1"},n==null?void 0:n.map((c,k)=>{if(c==null?void 0:c.id)return i.createElement(Zt,{key:c.id,draggableId:c.id,index:k},(b,Y)=>i.createElement("div",{className:"relative group",ref:b.innerRef,...b.draggableProps,...b.dragHandleProps},i.createElement("span",{className:`absolute left-0 top-0 bottom-0 my-auto flex items-center ${Y.isDragging?"":"opacity-0 group-hover:opacity-30"}`},i.createElement(U,{className:"text-brand-secondary-1 absolute left-1.5",width:24,height:24}),i.createElement(U,{className:"text-brand-secondary-1",width:24,height:24})),i.createElement(we,{key:`selected-item-${c.id}`,logoIcon:r,selectedItem:c,onDeselect:T=>Ce(T),onEditClosed:S?T=>S(T):void 0})))}),a.placeholder))):n==null?void 0:n.map(a=>i.createElement(we,{key:`selected-item-${a.id}`,logoIcon:r,selectedItem:a,onDeselect:c=>Ce(c),onEditClosed:S?c=>S(c):void 0}))))};import C from"react";var _n=({isActive:e,statusMessage:t})=>C.createElement("div",{className:`${e?"flex":"hidden"} absolute bottom-0 left-0 right-0 top-0 items-center justify-center overflow-hidden z-50`,style:{zIndex:9999}},C.createElement("div",{className:"absolute bottom-0 left-0 right-0 top-0 bg-white bg-opacity-50"}),C.createElement("div",{className:"relative"},C.createElement("div",{className:"flex flex-col items-center"},C.createElement(Wt,{height:128,width:128}),t?C.createElement("div",{className:"mt-4 text-gray-500"},t):null))),Wt=({height:e,width:t})=>C.createElement("svg",{"data-testid":"svg",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",width:t!=null?t:40,height:e!=null?e:40,className:"stroke-current"},C.createElement("g",{fill:"none",fillRule:"evenodd"},C.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},C.createElement("circle",{strokeOpacity:".25",cx:"18",cy:"18",r:"18"}),C.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18",transform:"rotate(166.645 18 18)"},C.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"0.8s",repeatCount:"indefinite"})))));export*from"@uniformdev/mesh-sdk";export{K as Button,Ue as Callout,Kn as CmsEntrySearch,Je as DefaultSearchRow,Re as DefaultSelectedItem,pe as Icons,se as Input,ze as KeywordSearchInput,Wt as LoadingIcon,de as LoadingIndicator,_n as LoadingOverlay,He as Menu,Ie as MenuContext,Oe as MenuItem,Ee as UniformMeshLocationContext,Pe as UniformMeshLocationContextProvider,De as UniformMeshSdkContext,co as UniformMeshSdkContextProvider,so as useInitializeUniformMeshSdk,$e as useMenuContext,oo as useUniformMeshLocation,ke as useUniformMeshLocationContext,go as useUniformMeshSdk,Be as useUniformMeshSdkContext};
|
|
1
|
+
var dt=Object.defineProperty;var mt=(e,t)=>{for(var o in t)dt(e,o,{get:t[o],enumerable:!0})};import ut,{createContext as ct,useContext as pt,useState as ft}from"react";var Ee=ct(void 0),Pe=({children:e})=>{let[t,o]=ft(),n;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let r=t||window.UniformMeshSDK.getCurrentLocation();n={location:{getValue:r.getValue,getMetadata:r.getMetadata,setValue:async s=>{await r.setValue(s),o(window.UniformMeshSDK.getCurrentLocation())}}}}return ut.createElement(Ee.Provider,{value:n},e)},ke=()=>{let e=pt(Ee);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function oo(){let{location:e}=ke();return{value:e==null?void 0:e.getValue(),setValue:e==null?void 0:e.setValue,metadata:e==null?void 0:e.getMetadata()}}import{initializeUniformMeshSDK as gt}from"@uniformdev/mesh-sdk";import{useEffect as vt,useState as Ve}from"react";var so=({autoResizingDisabled:e}={})=>{let[t,o]=Ve(),[n,r]=Ve();return vt(()=>{typeof window=="undefined"||n||(typeof window.UniformMeshSDK=="undefined"?gt({autoResizingDisabled:e}).then(s=>{r(s)}).catch(s=>{o(s)}):r(window.UniformMeshSDK))},[e]),{initializing:!n&&!t,error:t,sdk:n}};import Te,{createContext as ht,useContext as xt}from"react";var De=ht(void 0),co=({children:e})=>{let t;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(t={sdk:window.UniformMeshSDK}),Te.createElement(De.Provider,{value:t},Te.createElement(Pe,null,e))},Be=()=>{let e=xt(De);if(!e)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return e};function go(){let{sdk:e}=Be();return e}import Ge from"react";import{Button as bt}from"reakit";var ee={primary:{default:"bg-primary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},secondary:{default:"bg-secondary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},tertiary:{default:"bg-tertiary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},quaternary:{default:"bg-primary text-white hover:bg-opacity-75 border-2 border-gray-500 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},unimportant:{default:"bg-brand-secondary-2 text-primary hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-brand-secondary-2 text-gray-600 cursor-not-allowed"}},te={base:"inline-flex items-center border-transparent font-medium focus:outline-none focus:ring",size:(e,t)=>({xs:`${t?"px-2.5 py-1.5 ":""}text-xs leading-4 ${e?"rounded":""}`,sm:`${t?"px-3 py-2 ":""}text-sm leading-4 ${e?"rounded-md":""}`,md:`${t?"px-4 py-2 ":""}text-sm leading-5 tracking-wider ${e?"rounded-md":""}`,lg:`${t?"px-4 py-2 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`,xl:`${t?"px-6 py-3 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`}),buttonType:(e,t)=>{if(!(!e||!ee[e]))return t?ee[e].disabled:ee[e].default}},K=Ge.forwardRef(({size:e="md",buttonType:t="primary",children:o,className:n,rounded:r=!1,disablePadding:s=!1,...f},g)=>{let p=[te.base,te.size(r,!s)[e],te.buttonType(t,f.disabled),n].join(" ");return Ge.createElement(bt,{className:p,ref:g,...f},o)});import E from"react";import*as oe from"react";var Ct=e=>oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...e},oe.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})),O=Ct;import*as ne from"react";var yt=e=>ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},ne.createElement("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})),A=yt;import*as _ from"react";var wt=e=>_.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},_.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11 10.98a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0v-6zm1-4.929a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}),_.createElement("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0z"})),N=wt;import*as re from"react";var St=e=>re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},re.createElement("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})),j=St;import*as ae from"react";var Mt=e=>ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...e},ae.createElement("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})),D=Mt;import*as ie from"react";var Nt=e=>ie.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},ie.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 39.2A19.2 19.2 0 1 0 20 .8a19.2 19.2 0 0 0 0 38.4Zm8.897-22.303a2.4 2.4 0 0 0-3.394-3.394L17.6 21.407l-3.103-3.104a2.4 2.4 0 0 0-3.394 3.394l4.8 4.8a2.4 2.4 0 0 0 3.394 0l9.6-9.6Z"})),R=Nt;var Lt={caution:{icon:D,descriptionColor:"text-yellow-700",iconColor:"text-yellow-400",titleColor:"text-yellow-800",containerColor:"bg-yellow-50"},danger:{icon:A,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},error:{icon:D,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},info:{icon:O,descriptionColor:"text-blue-700",iconColor:"text-blue-400",titleColor:"text-blue-800",containerColor:"bg-blue-50"},note:{icon:N,descriptionColor:"text-gray-700",iconColor:"text-gray-400",titleColor:"text-gray-800",containerColor:"bg-gray-50"},success:{icon:R,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"},tip:{icon:j,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"}},Ue=({type:e="info",title:t,children:o,className:n})=>{let r=Lt[e];if(!r)return null;let s=r.icon;return E.createElement("div",{"data-testid":"sdk-ui-callout",className:`rounded-md p-4 ${r.containerColor} ${n||""}`},E.createElement("div",{className:"flex"},E.createElement("div",{className:"flex-shrink-0"},E.createElement(s,{className:`h-5 w-5 ${r.iconColor}`})),E.createElement("div",{className:"ml-3"},t?E.createElement("h3",{className:`text-sm font-medium mb-2 ${r.titleColor}`},t):null,o?E.createElement("div",{className:`text-sm ${r.descriptionColor}`},o):null)))};import P from"react";import{Input as Et}from"reakit";var se=({classNameContainer:e,classNameControl:t,classNameLabel:o,label:n,icon:r,id:s,disabled:f,...g})=>{let p={container:`uniform-input-container ${e||""}`,control:`uniform-input uniform-input-text${f?" uniform-input-disabled":""}${r?" pr-10":""} ${t||""}`,label:`uniform-input-label ${o||""}`};return P.createElement(P.Fragment,null,n?P.createElement("label",{htmlFor:s,className:p.label},n):null,P.createElement("div",{className:p.container},P.createElement(Et,{className:p.control,id:s,disabled:f,...g},v=>P.createElement("input",{...v,style:g.style})),r?P.createElement("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},r):null))};se.displayName="Input";import le from"react";import*as L from"react";var Pt=e=>L.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("g",{clipPath:"url(#magnifying-glass_svg__a)"},L.createElement("path",{d:"M11.539 0C5.484 0 .559 4.741.559 10.57c0 5.827 4.925 10.568 10.98 10.568 6.055 0 10.98-4.74 10.98-10.569C22.52 4.741 17.595 0 11.54 0Zm0 19.187c-4.937 0-8.954-3.866-8.954-8.618 0-4.752 4.017-8.618 8.954-8.618s8.954 3.866 8.954 8.618c0 4.752-4.017 8.618-8.954 8.618Z"}),L.createElement("path",{d:"m25.196 22.334-5.811-5.593a1.041 1.041 0 0 0-1.434 0 .95.95 0 0 0 0 1.38l5.812 5.593c.198.19.457.286.716.286.26 0 .519-.096.717-.286a.95.95 0 0 0 0-1.38Z"})),L.createElement("defs",null,L.createElement("clipPath",{id:"magnifying-glass_svg__a"},L.createElement("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),Z=Pt;function ze({onSearchTextChanged:e,disabled:t=!1,placeholder:o="Keyword search",inputFieldName:n="keywordSearch",disabledFieldSubmission:r=!1}){return le.createElement(se,{type:"text",name:n,placeholder:o,icon:le.createElement("div",{className:"pr-1"},le.createElement(Z,{className:"w-5 h-5 text-primary"})),onChange:g=>{e==null||e(g.currentTarget.value)},onKeyPress:g=>{g.key==="Enter"&&r&&g.preventDefault()},className:"uniform-input uniform-input-text pr-12 bg-gray-100",disabled:t,"aria-label":o})}import J from"react";var de=()=>J.createElement("span",{className:"loader",role:"presentation"},J.createElement("i",{className:"loader__dot"}),J.createElement("i",{className:"loader__dot"}),J.createElement("i",{className:"loader__dot"}));import V from"react";import{useMenuState as kt,Menu as Vt,MenuButton as Tt}from"reakit/Menu";var Ie=V.createContext({}),$e=()=>V.useContext(Ie),He=({menuLabel:e,menuTrigger:t,menuItemsContainerCssClasses:o,placement:n="auto",children:r})=>{let s=kt();return V.createElement(Ie.Provider,{value:s},V.createElement(Tt,{...s,ref:t.ref,...t.props},f=>V.cloneElement(t,f)),V.createElement(Vt,{...s,placement:n,"aria-label":e,className:`uniform-menu divide-y divide-gray-500 shadow-xl z-50 ${o}`},r))};import B from"react";import{MenuItem as Fe}from"reakit";var Oe=({children:e,className:t,hideMenuOnClick:o=!0,icon:n,...r})=>{let s=$e(),f=`uniform-menu-item bg-white ${(r==null?void 0:r.disabled)?"text-gray-500":"text-primary"} ${t||""}`,g=v=>{let h={...v};if(h.onClick){let y=h.onClick;h.onClick=m=>{s.hide(),y(m)}}return h};if(typeof e=="function")return B.createElement(Fe,{...s,...r,className:f},v=>{let h=o?g(v):v,y=e(h);return n?Ke(y,n):y});let p=o?g(r):r;return B.createElement(Fe,{...s,...p,className:f},n?Ke(e,n):e)};function Ke(e,t){return B.createElement("div",{className:"flex items-center justify-between"},B.createElement("div",null,e),B.createElement("div",{className:"ml-4"},t))}import i,{useState as z,useEffect as Kt,useRef as Ot}from"react";var pe={};mt(pe,{Caution:()=>D,Checkmark:()=>R,ChevronDown:()=>W,Close:()=>X,Danger:()=>A,ExclamationPoint:()=>O,Info:()=>N,Lightbulb:()=>j,MagnifyingGlass:()=>Z,MaximizeAlt:()=>Ae,MoreVerticalAlt:()=>U});import*as me from"react";var Dt=e=>me.createElement("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e},me.createElement("path",{d:"M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414Z"})),W=Dt;import*as G from"react";var Bt=e=>G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e},G.createElement("g",{fillRule:"evenodd"},G.createElement("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),G.createElement("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"}))),X=Bt;import*as ue from"react";var Gt=e=>ue.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},ue.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M3 3h6v2H6.462l4.843 4.843-1.415 1.414L5 6.367V9H3V3zm0 18h6v-2H6.376l4.929-4.928-1.415-1.414L5 17.548V15H3v6zm12 0h6v-6h-2v2.524l-4.867-4.866-1.414 1.414L17.647 19H15v2zm6-18h-6v2h2.562l-4.843 4.843 1.414 1.414L19 6.39V9h2V3z"})),Ae=Gt;import*as ce from"react";var Ut=e=>ce.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},ce.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M14 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})),U=Ut;import{useThrottle as At}from"react-use";import{v4 as _t}from"uuid";import u,{useState as zt,useRef as je,useEffect as It}from"react";function _e(e,t){let o=window.open(e,"_blank"),n=setInterval(()=>{(o==null?void 0:o.closed)&&(clearInterval(n),t())},500)}import{format as $t}from"timeago.js";var Re=({selectedItem:e,logoIcon:t,onDeselect:o,onEditClosed:n})=>{var y;let r=je(null),s=je(null),[f,g]=zt(!1);It(()=>{let m=S=>{r.current&&!r.current.contains(S.target)&&s.current&&!s.current.contains(S.target)&&g(!1)},x=()=>{g(!1)};return window.addEventListener("resize",x,!0),document.addEventListener("scroll",m,!0),document.addEventListener("mousedown",m),()=>{window.removeEventListener("resize",x,!0),document.removeEventListener("scroll",m,!0),document.removeEventListener("mousedown",m)}},[s]);let p=()=>{var m;if(g(!f),s.current&&r.current){let x=(m=r==null?void 0:r.current)==null?void 0:m.getBoundingClientRect();s.current.style.top=`${x.top+30}px`}},v=t&&typeof t!="string"?t:null,h=v?u.createElement(v,{className:"h-7 w-7"}):u.createElement("img",{src:t,alt:"CMS logo",className:"h-7 w-7"});return u.createElement("div",{className:"flex w-full border border-gray-300 rounded-md bg-gray-100",key:e.id},u.createElement("div",{className:"p-4 pl-8 flex flex-grow mr-2 gap-2 items-center relative"},u.createElement("div",{className:"flex-grow"},u.createElement("div",{className:"inline-flex relative items-start"},u.createElement("h4",{className:"text-primary font-bold leading-none mb-2",title:`ID: ${e.id}`,"data-test-id":"entry-id"},e.title||e.id||""),e.popoverData&&u.createElement(u.Fragment,null,u.createElement("button",{type:"button",ref:r,className:"ml-2 -my-1","aria-controls":"path-details",onClick:p},u.createElement(N,{className:"text-gray-700"})),u.createElement("div",{ref:s,className:`fixed bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 ${f?"visible":"invisible"}`},Object.entries(e.popoverData).map(([m,x],S)=>u.createElement("div",{className:"text-xs",key:S},u.createElement("span",{className:"font-bold mr-2"},m,":"),x))))),e.createdDate&&u.createElement("div",{className:"text-xs"},u.createElement("span",{className:"font-bold mr-2"},"Created:"),$t((y=e.createdDate)!=null?y:0)),u.createElement("div",{className:"flex gap-4"},e.metadata?Object.entries(e.metadata).filter(([m])=>["type","status"].includes(m.toLocaleLowerCase())).map(([m,x])=>u.createElement("span",{className:"text-sm",key:m},x)):null),e.metadata?Object.entries(e.metadata).filter(([m])=>!["type","status"].includes(m.toLocaleLowerCase())).map(([m,x])=>u.createElement("div",{className:"text-xs order-1",key:m},u.createElement("span",{className:"font-bold mr-2 order-1"},m,":"),x)):null),u.createElement("div",{className:"flex md:flex-row flex-col gap-2"},e.editLink?u.createElement("a",{href:e.editLink,title:"edit",rel:"noopener",target:"__blank",onClick:m=>{n&&(_e(m.currentTarget.href,()=>n(e)),m.preventDefault())},className:"flex justify-between items-center pl-4 pr-2 bg-white rounded border-2 border-gray-400 hover:bg-gray-100"},u.createElement("span",{className:"mr-2 text-sm"},"Edit"),h):null,u.createElement("button",{type:"button",onClick:m=>{m.preventDefault(),o(e)},className:"flex justify-between items-center px-4 bg-white rounded border-2 border-gray-400 h-10 hover:bg-gray-100"},u.createElement("span",{className:"mr-2 text-sm"},"Unlink"),u.createElement(X,{className:"w-4 h-4 text-red-600"})))))};import w,{useState as Ht,useRef as Ze,useEffect as Ft}from"react";var Je=({result:e,isSelected:t,triggerSelection:o})=>{let n=Ze(null),r=Ze(null),[s,f]=Ht(!1);Ft(()=>{function p(v){n.current&&!n.current.contains(v.target)&&r.current&&!r.current.contains(v.target)&&f(!1)}return document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[r]);let g=p=>{p.stopPropagation(),f(!s)};return w.createElement("div",{key:e.id,className:`p-2 cursor-pointer relative ${t?"bg-green-400 text-white":""}`,"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o()},e.title,e.popoverData&&t?w.createElement(w.Fragment,null,w.createElement("button",{type:"button",ref:n,className:"absolute top-0 bottom-0 right-2","aria-controls":"path-details",onClick:p=>g(p)},w.createElement(N,null)),w.createElement("div",{ref:r,className:`absolute top-4 right-10 bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 text-black ${s?"visible":"invisible"}`},e.metadata&&Object.entries(e.metadata).map(([p,v],h)=>w.createElement("div",{className:"text-xs",key:h},w.createElement("span",{className:"font-bold mr-2"},p,":"),v)),Object.entries(e.popoverData).map(([p,v],h)=>w.createElement("div",{className:"text-xs",key:h},w.createElement("span",{className:"font-bold mr-2"},p,":"),v)))):null)};import{Droppable as jt,DragDropContext as Rt,Draggable as Zt}from"react-beautiful-dnd";var Jt=({searchText:e,selectedContentType:t})=>{let o="No content found";return t&&(o=`No ${t} content was found`),e&&(o=`${o} for keyword '${e}'.`),i.createElement(Ue,{type:"info"},o)},Kn=({search:e,results:t,contentTypes:o,selectedItems:n,logoIcon:r,select:s,multiSelect:f,multiSelectId:g,rowComponent:p,selectedItemComponent:v,totalResults:h,resultsLoading:y,requireContentType:m,onAddNew:x,onEditClosed:S,onCancel:fe,noResultsComponent:We,helpComponent:Xe,onSort:q})=>{var Me,Ne,Le;let ge=()=>m?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[ve,he]=z(""),[M,xe]=z(ge),[I,Q]=z(!1),[$,H]=z([]),[qe,be]=z(!1),F=At(ve,750);Kt(()=>{e(F,{count:5,offset:0,contentType:M==="any"?void 0:M})},[F,M]);let Qe=a=>{$.includes(a.id)?H(c=>c.filter(k=>k!==a.id)):H(f?c=>[...c,a==null?void 0:a.id]:[a.id])},Ye=()=>{xe(ge()),he(""),H((n==null?void 0:n.length)?n.map(a=>a.id):[])},et=()=>{Q(a=>!a),I||Ye()},Ce=a=>{s((n==null?void 0:n.filter(c=>c.id!==a.id).map(c=>c.id))||[],"")},tt=a=>{a.preventDefault(),s($,M),Q(!1)},ot=a=>{a.preventDefault(),Q(!1),fe&&fe()},nt=a=>{a.preventDefault(),e(F,{count:5,offset:(t==null?void 0:t.length)||0,contentType:M==="any"?void 0:M}),be(!0);let c=setTimeout(()=>{be(!1)},750);return()=>clearTimeout(c)},ye=Ot(_t()),rt=!(n==null?void 0:n.length)||f,at=p||Je,we=v||Re,it=We||Jt,Se=r&&typeof r!="string"?r:null,st=Se?i.createElement(Se,{className:"h-9 w-9"}):i.createElement("img",{src:r,alt:"CMS logo",className:"h-9 w-9"}),lt=a=>{var c,k;if(a.destination&&a.source.droppableId===((c=a.destination)==null?void 0:c.droppableId)){let b=[...n||[]],[Y]=(k=b==null?void 0:b.splice(a.source.index,1))!=null?k:[];return b==null||b.splice(a.destination.index,0,Y),q==null||q(b.map(T=>T.id)),b}};return i.createElement("div",{className:"w-full"},i.createElement("div",{className:"relative my-4"},rt&&i.createElement("div",{className:"space-y-2"},i.createElement("div",{className:"py-3 px-2 bg-white rounded-lg border border-gray-300 mb-4","data-test-id":"component-search"},i.createElement("button",{className:"flex items-center w-full text-base relative",onClick:et,type:"button","aria-haspopup":!0,"aria-expanded":I,"aria-controls":ye.current},st,i.createElement("span",{className:"ml-4"},"Select"),i.createElement("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},i.createElement(W,{className:`w-5 h-5 text-standard transform transition-transform ${I?"rotate-180":"rotate-0"}`})))),i.createElement("div",{className:`${I?"block":"hidden"} py-3 px-4 space-y-4 bg-white rounded-lg border border-gray-300`},Xe||null,i.createElement("div",{className:"flex space-x-3"},i.createElement("select",{className:"uniform-input uniform-input-select w-1/3 bg-gray-100",onChange:a=>xe(a.target.value)},m?null:i.createElement("option",{value:"any",className:"bg-white text-primary"},"All content types"),o==null?void 0:o.map(a=>i.createElement("option",{value:a.id,key:a.id,className:"bg-white text-primary"},a.name))),i.createElement("div",{className:"flex-grow"},i.createElement(ze,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:he,disabledFieldSubmission:!0}))),i.createElement("div",{className:"overflow-y-scroll max-h-64 divide-y divide-gray-200 scrollbar",id:ye.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},(t==null?void 0:t.length)?t.map(a=>i.createElement(at,{key:a.id,isSelected:$.includes(a.id),result:a,triggerSelection:()=>Qe(a)})):y?null:i.createElement(it,{searchText:F||ve,selectedContentType:(Ne=(Me=o==null?void 0:o.find(a=>a.id===M))==null?void 0:Me.name)!=null?Ne:M}),!y&&typeof h!="undefined"&&t&&(t==null?void 0:t.length)<h&&i.createElement("button",{className:"block p-4 text-center w-full hover:bg-gray-100 focus:bg-gray-100 font-bold text-primary text-sm focus:outline-none",onClick:nt},qe?i.createElement(de,null):"Load More"),y&&!(t==null?void 0:t.length)?i.createElement("div",{className:"p-4 text-center w-full"},i.createElement(de,null)):null),i.createElement("div",{className:"flex justify-between"},i.createElement("div",null,x&&((Le=o==null?void 0:o.length)!=null?Le:0)>0?i.createElement(He,{menuLabel:"Add new menu",menuTrigger:i.createElement(K,{buttonType:"secondary"},"Add New")},o==null?void 0:o.map(a=>i.createElement(Oe,{key:a.id,className:"bg-white text-primary",onClick:()=>x(a)},a.name))):null),i.createElement("div",null,i.createElement(K,{buttonType:"unimportant",onClick:ot},"Cancel"),i.createElement(K,{className:"ml-5",disabled:!$.length,onClick:tt,"data-test-id":"entry-accept-button"},"Accept"))))),f?i.createElement(Rt,{onDragEnd:a=>lt(a)},i.createElement(jt,{droppableId:g||"canvas-multi-select"},a=>i.createElement("div",{...a.droppableProps,ref:a.innerRef,className:"space-y-1"},n==null?void 0:n.map((c,k)=>{if(c==null?void 0:c.id)return i.createElement(Zt,{key:c.id,draggableId:c.id,index:k},(b,Y)=>i.createElement("div",{className:"relative group",ref:b.innerRef,...b.draggableProps,...b.dragHandleProps},i.createElement("span",{className:`absolute left-0 top-0 bottom-0 my-auto flex items-center ${Y.isDragging?"":"opacity-0 group-hover:opacity-30"}`},i.createElement(U,{className:"text-brand-secondary-1 absolute left-1.5",width:24,height:24}),i.createElement(U,{className:"text-brand-secondary-1",width:24,height:24})),i.createElement(we,{key:`selected-item-${c.id}`,logoIcon:r,selectedItem:c,onDeselect:T=>Ce(T),onEditClosed:S?T=>S(T):void 0})))}),a.placeholder))):n==null?void 0:n.map(a=>i.createElement(we,{key:`selected-item-${a.id}`,logoIcon:r,selectedItem:a,onDeselect:c=>Ce(c),onEditClosed:S?c=>S(c):void 0}))))};import C from"react";var _n=({isActive:e,statusMessage:t})=>C.createElement("div",{className:`${e?"flex":"hidden"} absolute bottom-0 left-0 right-0 top-0 items-center justify-center overflow-hidden z-50`,style:{zIndex:9999}},C.createElement("div",{className:"absolute bottom-0 left-0 right-0 top-0 bg-white bg-opacity-50"}),C.createElement("div",{className:"relative"},C.createElement("div",{className:"flex flex-col items-center"},C.createElement(Wt,{height:128,width:128}),t?C.createElement("div",{className:"mt-4 text-gray-500"},t):null))),Wt=({height:e,width:t})=>C.createElement("svg",{"data-testid":"svg",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",width:t!=null?t:40,height:e!=null?e:40,className:"stroke-current"},C.createElement("g",{fill:"none",fillRule:"evenodd"},C.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},C.createElement("circle",{strokeOpacity:".25",cx:"18",cy:"18",r:"18"}),C.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18",transform:"rotate(166.645 18 18)"},C.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"0.8s",repeatCount:"indefinite"})))));export*from"@uniformdev/mesh-sdk";export{K as Button,Ue as Callout,Kn as CmsEntrySearch,Je as DefaultSearchRow,Re as DefaultSelectedItem,pe as Icons,se as Input,ze as KeywordSearchInput,Wt as LoadingIcon,de as LoadingIndicator,_n as LoadingOverlay,He as Menu,Ie as MenuContext,Oe as MenuItem,Ee as UniformMeshLocationContext,Pe as UniformMeshLocationContextProvider,De as UniformMeshSdkContext,co as UniformMeshSdkContextProvider,so as useInitializeUniformMeshSdk,$e as useMenuContext,oo as useUniformMeshLocation,ke as useUniformMeshLocationContext,go as useUniformMeshSdk,Be as useUniformMeshSdkContext};
|
package/dist/tailwind/plugin.js
CHANGED
|
@@ -3,4 +3,4 @@ var er=Object.create;var de=Object.defineProperty;var tr=Object.getOwnPropertyDe
|
|
|
3
3
|
`)+r,o=n+1,n=e.indexOf(`
|
|
4
4
|
`,o)}while(n!==-1);return a+=e.substr(o),a};bn.exports={stringReplaceAll:zr,stringEncaseCRLFWithFirstIndex:$r}});var Mn=S((Ya,Cn)=>{"use strict";i();var jr=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,vn=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,qr=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,Hr=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,Kr=new Map([["n",`
|
|
5
5
|
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function wn(e){let t=e[0]==="u",r=e[1]==="{";return t&&!r&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(parseInt(e.slice(2,-1),16)):Kr.get(e)||e}function Wr(e,t){let r=[],n=t.trim().split(/\s*,\s*/g),o;for(let a of n){let s=Number(a);if(!Number.isNaN(s))r.push(s);else if(o=a.match(qr))r.push(o[2].replace(Hr,(l,c,m)=>c?wn(c):m));else throw new Error(`Invalid Chalk template style argument: ${a} (in style '${e}')`)}return r}function Yr(e){vn.lastIndex=0;let t=[],r;for(;(r=vn.exec(e))!==null;){let n=r[1];if(r[2]){let o=Wr(n,r[2]);t.push([n].concat(o))}else t.push([n])}return t}function xn(e,t){let r={};for(let o of t)for(let a of o.styles)r[a[0]]=o.inverse?null:a.slice(1);let n=e;for(let[o,a]of Object.entries(r))if(!!Array.isArray(a)){if(!(o in n))throw new Error(`Unknown Chalk style: ${o}`);n=a.length>0?n[o](...a):n[o]}return n}Cn.exports=(e,t)=>{let r=[],n=[],o=[];if(t.replace(jr,(a,s,l,c,m,y)=>{if(s)o.push(wn(s));else if(c){let x=o.join("");o=[],n.push(r.length===0?x:xn(e,r)(x)),r.push({inverse:l,styles:Yr(c)})}else if(m){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(xn(e,r)(o.join(""))),o=[],r.pop()}else o.push(y)}),n.push(o.join("")),r.length>0){let a=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(a)}return n.join("")}});var On=S((Xa,Tn)=>{"use strict";i();var oe=dn(),{stdout:gt,stderr:bt}=gn(),{stringReplaceAll:Xr,stringEncaseCRLFWithFirstIndex:Zr}=yn(),{isArray:Le}=Array,kn=["ansi","ansi","ansi256","ansi16m"],W=Object.create(null),Jr=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=gt?gt.level:0;e.level=t.level===void 0?r:t.level},En=class{constructor(t){return Pn(t)}},Pn=e=>{let t={};return Jr(t,e),t.template=(...r)=>Nn(t.template,...r),Object.setPrototypeOf(t,Ne.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=En,t.template};function Ne(e){return Pn(e)}for(let[e,t]of Object.entries(oe))W[e]={get(){let r=Te(this,yt(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};W.visible={get(){let e=Te(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Ln=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of Ln)W[e]={get(){let{level:t}=this;return function(...r){let n=yt(oe.color[kn[t]][e](...r),oe.color.close,this._styler);return Te(this,n,this._isEmpty)}}};for(let e of Ln){let t="bg"+e[0].toUpperCase()+e.slice(1);W[t]={get(){let{level:r}=this;return function(...n){let o=yt(oe.bgColor[kn[r]][e](...n),oe.bgColor.close,this._styler);return Te(this,o,this._isEmpty)}}}}var Qr=Object.defineProperties(()=>{},{...W,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),yt=(e,t,r)=>{let n,o;return r===void 0?(n=e,o=t):(n=r.openAll+e,o=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:o,parent:r}},Te=(e,t,r)=>{let n=(...o)=>Le(o[0])&&Le(o[0].raw)?Sn(n,Nn(n,...o)):Sn(n,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(n,Qr),n._generator=e,n._styler=t,n._isEmpty=r,n},Sn=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let r=e._styler;if(r===void 0)return t;let{openAll:n,closeAll:o}=r;if(t.indexOf("\x1B")!==-1)for(;r!==void 0;)t=Xr(t,r.close,r.open),r=r.parent;let a=t.indexOf(`
|
|
6
|
-
`);return a!==-1&&(t=Zr(t,o,n,a)),n+t+o},ht,Nn=(e,...t)=>{let[r]=t;if(!Le(r)||!Le(r.raw))return t.join(" ");let n=t.slice(1),o=[r.raw[0]];for(let a=1;a<r.length;a++)o.push(String(n[a-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[a]));return ht===void 0&&(ht=Mn()),ht(e,o.join(""))};Object.defineProperties(Ne.prototype,W);var Oe=Ne();Oe.supportsColor=gt;Oe.stderr=Ne({level:bt?bt.level:0});Oe.stderr.supportsColor=bt;Tn.exports=Oe});var _n=S(ae=>{"use strict";i();Object.defineProperty(ae,"__esModule",{value:!0});ae.dim=to;ae.default=void 0;var Be=eo(On());function eo(e){return e&&e.__esModule?e:{default:e}}var Bn=new Set;function vt(e,t,r){process.env.JEST_WORKER_ID===void 0&&(r&&Bn.has(r)||(r&&Bn.add(r),console.warn(""),t.forEach(n=>console.warn(e,"-",n))))}function to(e){return Be.default.dim(e)}var no={info(e,t){vt(Be.default.bold.cyan("info"),...Array.isArray(e)?[e]:[t,e])},warn(e,t){vt(Be.default.bold.yellow("warn"),...Array.isArray(e)?[e]:[t,e])},risk(e,t){vt(Be.default.bold.magenta("risk"),...Array.isArray(e)?[e]:[t,e])}};ae.default=no});var Vn=S(_e=>{"use strict";i();Object.defineProperty(_e,"__esModule",{value:!0});_e.default=void 0;var ro=oo(_n());function oo(e){return e&&e.__esModule?e:{default:e}}function se({version:e,from:t,to:r}){ro.default.warn(`${t}-color-renamed`,[`As of Tailwind CSS ${e}, \`${t}\` has been renamed to \`${r}\`.`,"Update your configuration file to silence this warning."])}var ao={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},get lightBlue(){return se({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return se({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return se({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return se({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return se({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}};_e.default=ao});var In=S((Qa,Dn)=>{i();var xt=Vn();Dn.exports=(xt.__esModule?xt:{default:xt}).default});var uo={};Ge(uo,{uniformMeshPlugin:()=>so});i();var Rn=v(At()),An=v(require("path"));var P={};Ge(P,{Button:()=>J,Callout:()=>Je,CmsEntrySearch:()=>Lr,DefaultSearchRow:()=>ct,DefaultSelectedItem:()=>lt,Icons:()=>ke,Input:()=>ve,KeywordSearchInput:()=>Qe,LoadingIcon:()=>Yt,LoadingIndicator:()=>Ce,LoadingOverlay:()=>Nr,Menu:()=>nt,MenuContext:()=>et,MenuItem:()=>ot,UniformMeshLocationContext:()=>Ae,UniformMeshLocationContextProvider:()=>Ue,UniformMeshSdkContext:()=>ze,UniformMeshSdkContextProvider:()=>mr,useInitializeUniformMeshSdk:()=>fr,useMenuContext:()=>tt,useUniformMeshLocation:()=>dr,useUniformMeshLocationContext:()=>Fe,useUniformMeshSdk:()=>pr,useUniformMeshSdkContext:()=>$e});i();i();i();var _=v(require("react")),Ae=(0,_.createContext)(void 0),Ue=({children:e})=>{let[t,r]=(0,_.useState)(),n;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let o=t||window.UniformMeshSDK.getCurrentLocation();n={location:{getValue:o.getValue,getMetadata:o.getMetadata,setValue:async a=>{await o.setValue(a),r(window.UniformMeshSDK.getCurrentLocation())}}}}return _.default.createElement(Ae.Provider,{value:n},e)},Fe=()=>{let e=(0,_.useContext)(Ae);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function dr(){let{location:e}=Fe();return{value:e==null?void 0:e.getValue(),setValue:e==null?void 0:e.setValue,metadata:e==null?void 0:e.getMetadata()}}i();var Ut=require("@uniformdev/mesh-sdk"),Z=require("react"),fr=({autoResizingDisabled:e}={})=>{let[t,r]=(0,Z.useState)(),[n,o]=(0,Z.useState)();return(0,Z.useEffect)(()=>{typeof window=="undefined"||n||(typeof window.UniformMeshSDK=="undefined"?(0,Ut.initializeUniformMeshSDK)({autoResizingDisabled:e}).then(a=>{o(a)}).catch(a=>{r(a)}):o(window.UniformMeshSDK))},[e]),{initializing:!n&&!t,error:t,sdk:n}};i();i();var A=v(require("react"));var ze=(0,A.createContext)(void 0),mr=({children:e})=>{let t;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(t={sdk:window.UniformMeshSDK}),A.default.createElement(ze.Provider,{value:t},A.default.createElement(Ue,null,e))},$e=()=>{let e=(0,A.useContext)(ze);if(!e)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return e};function pr(){let{sdk:e}=$e();return e}i();var He=v(require("react")),Ft=require("reakit/Button"),je={primary:{default:"bg-primary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},secondary:{default:"bg-secondary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},tertiary:{default:"bg-tertiary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},quaternary:{default:"bg-primary text-white hover:bg-opacity-75 border-2 border-gray-500 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},unimportant:{default:"bg-brand-secondary-2 text-primary hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-brand-secondary-2 text-gray-600 cursor-not-allowed"}},qe={base:"inline-flex items-center border-transparent font-medium focus:outline-none focus:ring",size:(e,t)=>({xs:`${t?"px-2.5 py-1.5 ":""}text-xs leading-4 ${e?"rounded":""}`,sm:`${t?"px-3 py-2 ":""}text-sm leading-4 ${e?"rounded-md":""}`,md:`${t?"px-4 py-2 ":""}text-sm leading-5 tracking-wider ${e?"rounded-md":""}`,lg:`${t?"px-4 py-2 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`,xl:`${t?"px-6 py-3 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`}),buttonType:(e,t)=>{if(!(!e||!je[e]))return t?je[e].disabled:je[e].default}},J=He.default.forwardRef(({size:e="md",buttonType:t="primary",children:r,className:n,rounded:o=!1,disablePadding:a=!1,...s},l)=>{let c=[qe.base,qe.size(o,!a)[e],qe.buttonType(t,s.disabled),n].join(" ");return He.default.createElement(Ft.Button,{className:c,ref:l,...s},r)});i();var D=v(require("react"));i();var Ke=v(require("react")),hr=e=>Ke.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...e},Ke.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})),pe=hr;i();var We=v(require("react")),gr=e=>We.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},We.createElement("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})),he=gr;i();var ge=v(require("react")),br=e=>ge.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},ge.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11 10.98a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0v-6zm1-4.929a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}),ge.createElement("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0z"})),V=br;i();var Ye=v(require("react")),yr=e=>Ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},Ye.createElement("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})),be=yr;i();var Xe=v(require("react")),vr=e=>Xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...e},Xe.createElement("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})),Q=vr;i();var Ze=v(require("react")),xr=e=>Ze.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},Ze.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 39.2A19.2 19.2 0 1 0 20 .8a19.2 19.2 0 0 0 0 38.4Zm8.897-22.303a2.4 2.4 0 0 0-3.394-3.394L17.6 21.407l-3.103-3.104a2.4 2.4 0 0 0-3.394 3.394l4.8 4.8a2.4 2.4 0 0 0 3.394 0l9.6-9.6Z"})),ye=xr;var wr={caution:{icon:Q,descriptionColor:"text-yellow-700",iconColor:"text-yellow-400",titleColor:"text-yellow-800",containerColor:"bg-yellow-50"},danger:{icon:he,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},error:{icon:Q,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},info:{icon:pe,descriptionColor:"text-blue-700",iconColor:"text-blue-400",titleColor:"text-blue-800",containerColor:"bg-blue-50"},note:{icon:V,descriptionColor:"text-gray-700",iconColor:"text-gray-400",titleColor:"text-gray-800",containerColor:"bg-gray-50"},success:{icon:ye,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"},tip:{icon:be,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"}},Je=({type:e="info",title:t,children:r,className:n})=>{let o=wr[e];if(!o)return null;let a=o.icon;return D.default.createElement("div",{"data-testid":"sdk-ui-callout",className:`rounded-md p-4 ${o.containerColor} ${n||""}`},D.default.createElement("div",{className:"flex"},D.default.createElement("div",{className:"flex-shrink-0"},D.default.createElement(a,{className:`h-5 w-5 ${o.iconColor}`})),D.default.createElement("div",{className:"ml-3"},t?D.default.createElement("h3",{className:`text-sm font-medium mb-2 ${o.titleColor}`},t):null,r?D.default.createElement("div",{className:`text-sm ${o.descriptionColor}`},r):null)))};i();i();var I=v(require("react")),zt=require("reakit/Input"),ve=({classNameContainer:e,classNameControl:t,classNameLabel:r,label:n,icon:o,id:a,disabled:s,...l})=>{let c={container:`uniform-input-container ${e||""}`,control:`uniform-input uniform-input-text${s?" uniform-input-disabled":""}${o?" pr-10":""} ${t||""}`,label:`uniform-input-label ${r||""}`};return I.default.createElement(I.default.Fragment,null,n?I.default.createElement("label",{htmlFor:a,className:c.label},n):null,I.default.createElement("div",{className:c.container},I.default.createElement(zt.Input,{className:c.control,id:a,disabled:s,...l},m=>I.default.createElement("input",{...m,style:l.style})),o?I.default.createElement("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},o):null))};ve.displayName="Input";var we=v(require("react"));i();var G=v(require("react")),Cr=e=>G.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},G.createElement("g",{clipPath:"url(#magnifying-glass_svg__a)"},G.createElement("path",{d:"M11.539 0C5.484 0 .559 4.741.559 10.57c0 5.827 4.925 10.568 10.98 10.568 6.055 0 10.98-4.74 10.98-10.569C22.52 4.741 17.595 0 11.54 0Zm0 19.187c-4.937 0-8.954-3.866-8.954-8.618 0-4.752 4.017-8.618 8.954-8.618s8.954 3.866 8.954 8.618c0 4.752-4.017 8.618-8.954 8.618Z"}),G.createElement("path",{d:"m25.196 22.334-5.811-5.593a1.041 1.041 0 0 0-1.434 0 .95.95 0 0 0 0 1.38l5.812 5.593c.198.19.457.286.716.286.26 0 .519-.096.717-.286a.95.95 0 0 0 0-1.38Z"})),G.createElement("defs",null,G.createElement("clipPath",{id:"magnifying-glass_svg__a"},G.createElement("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),xe=Cr;function Qe({onSearchTextChanged:e,disabled:t=!1,placeholder:r="Keyword search",inputFieldName:n="keywordSearch",disabledFieldSubmission:o=!1}){return we.default.createElement(ve,{type:"text",name:n,placeholder:r,icon:we.default.createElement("div",{className:"pr-1"},we.default.createElement(xe,{className:"w-5 h-5 text-primary"})),onChange:l=>{e==null||e(l.currentTarget.value)},onKeyPress:l=>{l.key==="Enter"&&o&&l.preventDefault()},className:"uniform-input uniform-input-text pr-12 bg-gray-100",disabled:t,"aria-label":r})}i();var ee=v(require("react")),Ce=()=>ee.default.createElement("span",{className:"loader",role:"presentation"},ee.default.createElement("i",{className:"loader__dot"}),ee.default.createElement("i",{className:"loader__dot"}),ee.default.createElement("i",{className:"loader__dot"}));i();var U=v(require("react")),z=require("reakit/Menu"),et=U.default.createContext({}),tt=()=>U.default.useContext(et),nt=({menuLabel:e,menuTrigger:t,menuItemsContainerCssClasses:r,placement:n="auto",children:o})=>{let a=(0,z.useMenuState)();return U.default.createElement(et.Provider,{value:a},U.default.createElement(z.MenuButton,{...a,ref:t.ref,...t.props},s=>U.default.cloneElement(t,s)),U.default.createElement(z.Menu,{...a,placement:n,"aria-label":e,className:`uniform-menu divide-y divide-gray-500 shadow-xl z-50 ${r}`},o))};i();var $=v(require("react")),rt=require("reakit");var ot=({children:e,className:t,hideMenuOnClick:r=!0,icon:n,...o})=>{let a=tt(),s=`uniform-menu-item bg-white ${(o==null?void 0:o.disabled)?"text-gray-500":"text-primary"} ${t||""}`,l=m=>{let y={...m};if(y.onClick){let x=y.onClick;y.onClick=b=>{a.hide(),x(b)}}return y};if(typeof e=="function")return $.default.createElement(rt.MenuItem,{...a,...o,className:s},m=>{let y=r?l(m):m,x=e(y);return n?$t(x,n):x});let c=r?l(o):o;return $.default.createElement(rt.MenuItem,{...a,...c,className:s},n?$t(e,n):e)};function $t(e,t){return $.default.createElement("div",{className:"flex items-center justify-between"},$.default.createElement("div",null,e),$.default.createElement("div",{className:"ml-4"},t))}i();var d=v(require("react"));var ke={};Ge(ke,{Caution:()=>Q,Checkmark:()=>ye,ChevronDown:()=>Me,Close:()=>Se,Danger:()=>he,ExclamationPoint:()=>pe,Info:()=>V,Lightbulb:()=>be,MagnifyingGlass:()=>xe,MaximizeAlt:()=>jt,MoreVerticalAlt:()=>ne});i();i();var at=v(require("react")),Mr=e=>at.createElement("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e},at.createElement("path",{d:"M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414Z"})),Me=Mr;i();var te=v(require("react")),Sr=e=>te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e},te.createElement("g",{fillRule:"evenodd"},te.createElement("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),te.createElement("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"}))),Se=Sr;i();var st=v(require("react")),kr=e=>st.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},st.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M3 3h6v2H6.462l4.843 4.843-1.415 1.414L5 6.367V9H3V3zm0 18h6v-2H6.376l4.929-4.928-1.415-1.414L5 17.548V15H3v6zm12 0h6v-6h-2v2.524l-4.867-4.866-1.414 1.414L17.647 19H15v2zm6-18h-6v2h2.562l-4.843 4.843 1.414 1.414L19 6.39V9h2V3z"})),jt=kr;i();var it=v(require("react")),Er=e=>it.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},it.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M14 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})),ne=Er;var Kt=require("react-use"),Wt=require("uuid");i();var h=v(require("react"));i();function qt(e,t){let r=window.open(e,"_blank"),n=setInterval(()=>{(r==null?void 0:r.closed)&&(clearInterval(n),t())},500)}var Ht=require("timeago.js"),lt=({selectedItem:e,logoIcon:t,onDeselect:r,onEditClosed:n})=>{var x;let o=(0,h.useRef)(null),a=(0,h.useRef)(null),[s,l]=(0,h.useState)(!1);(0,h.useEffect)(()=>{let b=O=>{o.current&&!o.current.contains(O.target)&&a.current&&!a.current.contains(O.target)&&l(!1)},k=()=>{l(!1)};return window.addEventListener("resize",k,!0),document.addEventListener("scroll",b,!0),document.addEventListener("mousedown",b),()=>{window.removeEventListener("resize",k,!0),document.removeEventListener("scroll",b,!0),document.removeEventListener("mousedown",b)}},[a]);let c=()=>{var b;if(l(!s),a.current&&o.current){let k=(b=o==null?void 0:o.current)==null?void 0:b.getBoundingClientRect();a.current.style.top=`${k.top+30}px`}},m=t&&typeof t!="string"?t:null,y=m?h.default.createElement(m,{className:"h-7 w-7"}):h.default.createElement("img",{src:t,alt:"CMS logo",className:"h-7 w-7"});return h.default.createElement("div",{className:"flex w-full border border-gray-300 rounded-md bg-gray-100",key:e.id},h.default.createElement("div",{className:"p-4 pl-8 flex flex-grow mr-2 gap-2 items-center relative"},h.default.createElement("div",{className:"flex-grow"},h.default.createElement("div",{className:"inline-flex relative items-start"},h.default.createElement("h4",{className:"text-primary font-bold leading-none mb-2",title:`ID: ${e.id}`,"data-test-id":"entry-id"},e.title||e.id||""),e.popoverData&&h.default.createElement(h.default.Fragment,null,h.default.createElement("button",{type:"button",ref:o,className:"ml-2 -my-1","aria-controls":"path-details",onClick:c},h.default.createElement(V,{className:"text-gray-700"})),h.default.createElement("div",{ref:a,className:`fixed bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 ${s?"visible":"invisible"}`},Object.entries(e.popoverData).map(([b,k],O)=>h.default.createElement("div",{className:"text-xs",key:O},h.default.createElement("span",{className:"font-bold mr-2"},b,":"),k))))),e.createdDate&&h.default.createElement("div",{className:"text-xs"},h.default.createElement("span",{className:"font-bold mr-2"},"Created:"),(0,Ht.format)((x=e.createdDate)!=null?x:0)),h.default.createElement("div",{className:"flex gap-4"},e.metadata?Object.entries(e.metadata).filter(([b])=>["type","status"].includes(b.toLocaleLowerCase())).map(([b,k])=>h.default.createElement("span",{className:"text-sm",key:b},k)):null),e.metadata?Object.entries(e.metadata).filter(([b])=>!["type","status"].includes(b.toLocaleLowerCase())).map(([b,k])=>h.default.createElement("div",{className:"text-xs order-1",key:b},h.default.createElement("span",{className:"font-bold mr-2 order-1"},b,":"),k)):null),h.default.createElement("div",{className:"flex md:flex-row flex-col gap-2"},e.editLink?h.default.createElement("a",{href:e.editLink,title:"edit",rel:"noopener",target:"__blank",onClick:b=>{n&&(qt(b.currentTarget.href,()=>n(e)),b.preventDefault())},className:"flex justify-between items-center pl-4 pr-2 bg-white rounded border-2 border-gray-400 hover:bg-gray-100"},h.default.createElement("span",{className:"mr-2 text-sm"},"Edit"),y):null,h.default.createElement("button",{type:"button",onClick:b=>{b.preventDefault(),r(e)},className:"flex justify-between items-center px-4 bg-white rounded border-2 border-gray-400 h-10 hover:bg-gray-100"},h.default.createElement("span",{className:"mr-2 text-sm"},"Unlink"),h.default.createElement(Se,{className:"w-4 h-4 text-red-600"})))))};i();var C=v(require("react"));var ct=({result:e,isSelected:t,triggerSelection:r})=>{let n=(0,C.useRef)(null),o=(0,C.useRef)(null),[a,s]=(0,C.useState)(!1);(0,C.useEffect)(()=>{function c(m){n.current&&!n.current.contains(m.target)&&o.current&&!o.current.contains(m.target)&&s(!1)}return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[o]);let l=c=>{c.stopPropagation(),s(!a)};return C.default.createElement("div",{key:e.id,className:`p-2 cursor-pointer relative ${t?"bg-green-400 text-white":""}`,"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>r()},e.title,e.popoverData&&t?C.default.createElement(C.default.Fragment,null,C.default.createElement("button",{type:"button",ref:n,className:"absolute top-0 bottom-0 right-2","aria-controls":"path-details",onClick:c=>l(c)},C.default.createElement(V,null)),C.default.createElement("div",{ref:o,className:`absolute top-4 right-10 bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 text-black ${a?"visible":"invisible"}`},e.metadata&&Object.entries(e.metadata).map(([c,m],y)=>C.default.createElement("div",{className:"text-xs",key:y},C.default.createElement("span",{className:"font-bold mr-2"},c,":"),m)),Object.entries(e.popoverData).map(([c,m],y)=>C.default.createElement("div",{className:"text-xs",key:y},C.default.createElement("span",{className:"font-bold mr-2"},c,":"),m)))):null)};var j=require("react-beautiful-dnd"),Pr=({searchText:e,selectedContentType:t})=>{let r="No content found";return t&&(r=`No ${t} content was found`),e&&(r=`${r} for keyword '${e}'.`),d.default.createElement(Je,{type:"info"},r)},Lr=({search:e,results:t,contentTypes:r,selectedItems:n,logoIcon:o,select:a,multiSelect:s,multiSelectId:l,rowComponent:c,selectedItemComponent:m,totalResults:y,resultsLoading:x,requireContentType:b,onAddNew:k,onEditClosed:O,onCancel:wt,noResultsComponent:Un,helpComponent:Fn,onSort:Ve})=>{var Ot,Bt,_t;let Ct=()=>b?Array.isArray(r)&&r.length>0?r[0].id:"":"any",[Mt,St]=(0,d.useState)(""),[B,kt]=(0,d.useState)(Ct),[ie,De]=(0,d.useState)(!1),[le,ce]=(0,d.useState)([]),[zn,Et]=(0,d.useState)(!1),ue=(0,Kt.useThrottle)(Mt,750);(0,d.useEffect)(()=>{e(ue,{count:5,offset:0,contentType:B==="any"?void 0:B})},[ue,B]);let $n=f=>{le.includes(f.id)?ce(w=>w.filter(F=>F!==f.id)):ce(s?w=>[...w,f==null?void 0:f.id]:[f.id])},jn=()=>{kt(Ct()),St(""),ce((n==null?void 0:n.length)?n.map(f=>f.id):[])},qn=()=>{De(f=>!f),ie||jn()},Pt=f=>{a((n==null?void 0:n.filter(w=>w.id!==f.id).map(w=>w.id))||[],"")},Hn=f=>{f.preventDefault(),a(le,B),De(!1)},Kn=f=>{f.preventDefault(),De(!1),wt&&wt()},Wn=f=>{f.preventDefault(),e(ue,{count:5,offset:(t==null?void 0:t.length)||0,contentType:B==="any"?void 0:B}),Et(!0);let w=setTimeout(()=>{Et(!1)},750);return()=>clearTimeout(w)},Lt=(0,d.useRef)((0,Wt.v4)()),Yn=!(n==null?void 0:n.length)||s,Xn=c||ct,Nt=m||lt,Zn=Un||Pr,Tt=o&&typeof o!="string"?o:null,Jn=Tt?d.default.createElement(Tt,{className:"h-9 w-9"}):d.default.createElement("img",{src:o,alt:"CMS logo",className:"h-9 w-9"}),Qn=f=>{var w,F;if(f.destination&&f.source.droppableId===((w=f.destination)==null?void 0:w.droppableId)){let L=[...n||[]],[Ie]=(F=L==null?void 0:L.splice(f.source.index,1))!=null?F:[];return L==null||L.splice(f.destination.index,0,Ie),Ve==null||Ve(L.map(X=>X.id)),L}};return d.default.createElement("div",{className:"w-full"},d.default.createElement("div",{className:"relative my-4"},Yn&&d.default.createElement("div",{className:"space-y-2"},d.default.createElement("div",{className:"py-3 px-2 bg-white rounded-lg border border-gray-300 mb-4","data-test-id":"component-search"},d.default.createElement("button",{className:"flex items-center w-full text-base relative",onClick:qn,type:"button","aria-haspopup":!0,"aria-expanded":ie,"aria-controls":Lt.current},Jn,d.default.createElement("span",{className:"ml-4"},"Select"),d.default.createElement("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},d.default.createElement(Me,{className:`w-5 h-5 text-standard transform transition-transform ${ie?"rotate-180":"rotate-0"}`})))),d.default.createElement("div",{className:`${ie?"block":"hidden"} py-3 px-4 space-y-4 bg-white rounded-lg border border-gray-300`},Fn||null,d.default.createElement("div",{className:"flex space-x-3"},d.default.createElement("select",{className:"uniform-input uniform-input-select w-1/3 bg-gray-100",onChange:f=>kt(f.target.value)},b?null:d.default.createElement("option",{value:"any",className:"bg-white text-primary"},"All content types"),r==null?void 0:r.map(f=>d.default.createElement("option",{value:f.id,key:f.id,className:"bg-white text-primary"},f.name))),d.default.createElement("div",{className:"flex-grow"},d.default.createElement(Qe,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:St,disabledFieldSubmission:!0}))),d.default.createElement("div",{className:"overflow-y-scroll max-h-64 divide-y divide-gray-200 scrollbar",id:Lt.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},(t==null?void 0:t.length)?t.map(f=>d.default.createElement(Xn,{key:f.id,isSelected:le.includes(f.id),result:f,triggerSelection:()=>$n(f)})):x?null:d.default.createElement(Zn,{searchText:ue||Mt,selectedContentType:(Bt=(Ot=r==null?void 0:r.find(f=>f.id===B))==null?void 0:Ot.name)!=null?Bt:B}),!x&&typeof y!="undefined"&&t&&(t==null?void 0:t.length)<y&&d.default.createElement("button",{className:"block p-4 text-center w-full hover:bg-gray-100 focus:bg-gray-100 font-bold text-primary text-sm focus:outline-none",onClick:Wn},zn?d.default.createElement(Ce,null):"Load More"),x&&!(t==null?void 0:t.length)?d.default.createElement("div",{className:"p-4 text-center w-full"},d.default.createElement(Ce,null)):null),d.default.createElement("div",{className:"flex justify-between"},d.default.createElement("div",null,k&&((_t=r==null?void 0:r.length)!=null?_t:0)>0?d.default.createElement(nt,{menuLabel:"Add new menu",menuTrigger:d.default.createElement(J,{buttonType:"secondary"},"Add New")},r==null?void 0:r.map(f=>d.default.createElement(ot,{key:f.id,className:"bg-white text-primary",onClick:()=>k(f)},f.name))):null),d.default.createElement("div",null,d.default.createElement(J,{buttonType:"unimportant",onClick:Kn},"Cancel"),d.default.createElement(J,{className:"ml-5",disabled:!le.length,onClick:Hn,"data-test-id":"entry-accept-button"},"Accept"))))),s?d.default.createElement(j.DragDropContext,{onDragEnd:f=>Qn(f)},d.default.createElement(j.Droppable,{droppableId:l||"canvas-multi-select"},f=>d.default.createElement("div",{...f.droppableProps,ref:f.innerRef,className:"space-y-1"},n==null?void 0:n.map((w,F)=>{if(w==null?void 0:w.id)return d.default.createElement(j.Draggable,{key:w.id,draggableId:w.id,index:F},(L,Ie)=>d.default.createElement("div",{className:"relative group",ref:L.innerRef,...L.draggableProps,...L.dragHandleProps},d.default.createElement("span",{className:`absolute left-0 top-0 bottom-0 my-auto flex items-center ${Ie.isDragging?"":"opacity-0 group-hover:opacity-30"}`},d.default.createElement(ne,{className:"text-brand-secondary-1 absolute left-1.5",width:24,height:24}),d.default.createElement(ne,{className:"text-brand-secondary-1",width:24,height:24})),d.default.createElement(Nt,{key:`selected-item-${w.id}`,logoIcon:o,selectedItem:w,onDeselect:X=>Pt(X),onEditClosed:O?X=>O(X):void 0})))}),f.placeholder))):n==null?void 0:n.map(f=>d.default.createElement(Nt,{key:`selected-item-${f.id}`,logoIcon:o,selectedItem:f,onDeselect:w=>Pt(w),onEditClosed:O?w=>O(w):void 0}))))};i();var E=v(require("react")),Nr=({isActive:e,statusMessage:t})=>E.default.createElement("div",{className:`${e?"flex":"hidden"} absolute bottom-0 left-0 right-0 top-0 items-center justify-center overflow-hidden z-50`,style:{zIndex:9999}},E.default.createElement("div",{className:"absolute bottom-0 left-0 right-0 top-0 bg-white bg-opacity-50"}),E.default.createElement("div",{className:"relative"},E.default.createElement("div",{className:"flex flex-col items-center"},E.default.createElement(Yt,{height:128,width:128}),t?E.default.createElement("div",{className:"mt-4 text-gray-500"},t):null))),Yt=({height:e,width:t})=>E.default.createElement("svg",{"data-testid":"svg",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",width:t!=null?t:40,height:e!=null?e:40,className:"stroke-current"},E.default.createElement("g",{fill:"none",fillRule:"evenodd"},E.default.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},E.default.createElement("circle",{strokeOpacity:".25",cx:"18",cy:"18",r:"18"}),E.default.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18",transform:"rotate(166.645 18 18)"},E.default.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"0.8s",repeatCount:"indefinite"})))));T(P,require("@uniformdev/mesh-sdk"));i();var Xt={".uniform-input-container":{"@apply text-gray-700 relative":{}},".uniform-input-label":{"@apply text-primary mb-1 block font-bold leading-5":{}},".uniform-checkbox-label":{"@apply text-primary block font-bold leading-5":{}},".uniform-input":{"@apply bg-white border border-gray-500 text-gray-700 block w-full leading-5 rounded-md relative":{}},".uniform-input-disabled":{"@apply text-gray-300 cursor-not-allowed":{}},".uniform-input-text":{"@apply appearance-none p-4 block border-gray-500":{}},".uniform-input-text::placeholder":{"@apply text-gray-500":{}},".uniform-input:focus":{"@apply border-primary ring-primary outline-none":{}},".uniform-input-select":{"@apply bg-no-repeat pl-4 pr-10 py-4 block border-gray-500":{}},".uniform-input-checkbox":{"@apply align-middle flex-shrink-0 h-6 w-6 border-gray-500 rounded text-primary":{}},".uniform-input-checkbox:checked":{"@apply border-transparent":{}},".uniform-input-checkbox:checked:focus":{"@apply border-transparent":{}},".uniform-link-primary":{"@apply text-primary":{}},".uniform-link-secondary":{"@apply text-secondary":{}},".uniform-menu":{"@apply border rounded border-gray-500 outline-none":{}},".uniform-menu-item":{"@apply block rounded w-full text-left py-2 px-4 font-bold":{}},".uniform-menu-item:focus":{"@apply outline-none":{}},".uniform-menu-item:hover":{"@apply bg-gray-200":{}},".uniform-input-switch-container":{"@apply relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in":{}},".uniform-input-switch":{"@apply absolute block w-6 h-6 rounded-full bg-white border-2 appearance-none cursor-pointer transition transform translate-x-0":{}},".uniform-input-switch:checked":{"@apply translate-x-4 bg-green-500":{}},".uniform-input-switch-track":{"@apply block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer":{}},".uniform-input-switch-label":{"@apply text-primary font-bold leading-5":{}},".loader":{"@apply inline-flex justify-center":{}},".loader__dot":{"@apply bg-gray-700 block rounded-lg opacity-100 animate-bounce-fade":{},width:"8px",height:"8px",margin:"0 2px",transform:"translateY(0)"},".loader__dot:nth-child(1)":{"animation-delay":"0.15s"},".loader__dot:nth-child(2)":{"animation-delay":"0.3s"},".loader__dot:nth-child(3)":{"animation-delay":"0.6s"},"@supports ((scrollbar-color: #d1d5db transparent) and (scrollbar-width: thin))":{".scrollbar":{"scrollbar-color":"#d1d5db transparent","scrollbar-width":"thin"}},".scrollbar::-webkit-scrollbar":{width:"8px",height:"8px"},".scrollbar::-webkit-scrollbar-track":{"@apply bg-transparent rounded":{}},".scrollbar::-webkit-scrollbar-thumb":{"@apply bg-gray-300 rounded":{}},".scrollbar::-webkit-scrollbar-thumb:hover":{"@apply bg-gray-500":{}},".main-heading":{"@apply text-4xl font-extrabold text-primary":{}}};i();var g=v(In()),Y={"brand-primary-1":"#438FD5","brand-primary-2":"#f4220b","brand-primary-3":"#83c6e1","brand-secondary-1":"#1f2b34","brand-secondary-2":"#ecf1f1","brand-secondary-3":"#2ecdb4","brand-secondary-4":"#005e3b","brand-secondary-5":"#f6f1c3","brand-secondary-6":"#d9534f","brand-secondary-7":"#dbf6f2"},Gn={fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"4rem"},extend:{colors:{current:g.current,transparent:g.transparent,gray:{50:g.gray["50"],100:"#f9f9f9",200:"#f1f1f1",300:"#E0E0E0",400:"#D3DBE1",500:"#BDBDBD",700:"#828282",800:"#2d3748"},white:g.white,primary:Y["brand-secondary-1"],secondary:Y["brand-secondary-6"],tertiary:Y["brand-primary-3"],quaternary:Y["brand-primary-1"],standard:Y["brand-secondary-1"],red:{50:g.red["50"],400:g.red["400"],600:g.red["600"],700:g.red["700"],800:g.red["800"]},blue:{50:g.blue["50"],200:g.blue["200"],400:g.blue["400"],500:g.blue["500"],700:g.blue["700"],800:g.blue["800"]},green:{50:g.emerald["50"],300:g.emerald["300"],400:g.emerald["400"],500:"#3DCCB4",700:g.emerald["700"],800:g.emerald["800"]},yellow:{50:g.amber["50"],400:g.amber["400"],700:g.amber["700"],800:g.amber["800"]},black:g.black,...Y},animation:{"bounce-fade":"bounce-fade 0.75s infinite ease-in-out"},keyframes:{"bounce-fade":{"0%":{},"100%":{opacity:1,transform:"translateY(0)"},"30%":{opacity:.6},"80%":{opacity:.4,transform:"translateY(-10px)"},"90%":{opacity:.2,transform:"translateY(-5px)"}}}}};var so=(0,Rn.default)(({config:e,addComponents:t})=>{let r=e("content");io(r);let n=e("safelist");lo(n),t(Xt)},{theme:Gn});function io(e){e||(e={});let t=An.default.resolve(__dirname,"../*.js");Array.isArray(e.files)?e.files.push(t):e.files=[t]}function lo(e){let t=co();Array.isArray(e)?e.push(...t):e=t}function co(){let e=[];return Object.keys(P).forEach(t=>{let r=P[t];Array.isArray(r.cssSafelistPatterns)&&e.push(...r.cssSafelistPatterns)}),e}module.exports=sr(uo);0&&(module.exports={uniformMeshPlugin});
|
|
6
|
+
`);return a!==-1&&(t=Zr(t,o,n,a)),n+t+o},ht,Nn=(e,...t)=>{let[r]=t;if(!Le(r)||!Le(r.raw))return t.join(" ");let n=t.slice(1),o=[r.raw[0]];for(let a=1;a<r.length;a++)o.push(String(n[a-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[a]));return ht===void 0&&(ht=Mn()),ht(e,o.join(""))};Object.defineProperties(Ne.prototype,W);var Oe=Ne();Oe.supportsColor=gt;Oe.stderr=Ne({level:bt?bt.level:0});Oe.stderr.supportsColor=bt;Tn.exports=Oe});var _n=S(ae=>{"use strict";i();Object.defineProperty(ae,"__esModule",{value:!0});ae.dim=to;ae.default=void 0;var Be=eo(On());function eo(e){return e&&e.__esModule?e:{default:e}}var Bn=new Set;function vt(e,t,r){process.env.JEST_WORKER_ID===void 0&&(r&&Bn.has(r)||(r&&Bn.add(r),console.warn(""),t.forEach(n=>console.warn(e,"-",n))))}function to(e){return Be.default.dim(e)}var no={info(e,t){vt(Be.default.bold.cyan("info"),...Array.isArray(e)?[e]:[t,e])},warn(e,t){vt(Be.default.bold.yellow("warn"),...Array.isArray(e)?[e]:[t,e])},risk(e,t){vt(Be.default.bold.magenta("risk"),...Array.isArray(e)?[e]:[t,e])}};ae.default=no});var Vn=S(_e=>{"use strict";i();Object.defineProperty(_e,"__esModule",{value:!0});_e.default=void 0;var ro=oo(_n());function oo(e){return e&&e.__esModule?e:{default:e}}function se({version:e,from:t,to:r}){ro.default.warn(`${t}-color-renamed`,[`As of Tailwind CSS ${e}, \`${t}\` has been renamed to \`${r}\`.`,"Update your configuration file to silence this warning."])}var ao={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},get lightBlue(){return se({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return se({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return se({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return se({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return se({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}};_e.default=ao});var In=S((Qa,Dn)=>{i();var xt=Vn();Dn.exports=(xt.__esModule?xt:{default:xt}).default});var uo={};Ge(uo,{uniformMeshPlugin:()=>so});i();var Rn=v(At()),An=v(require("path"));var P={};Ge(P,{Button:()=>J,Callout:()=>Je,CmsEntrySearch:()=>Lr,DefaultSearchRow:()=>ct,DefaultSelectedItem:()=>lt,Icons:()=>ke,Input:()=>ve,KeywordSearchInput:()=>Qe,LoadingIcon:()=>Yt,LoadingIndicator:()=>Ce,LoadingOverlay:()=>Nr,Menu:()=>nt,MenuContext:()=>et,MenuItem:()=>ot,UniformMeshLocationContext:()=>Ae,UniformMeshLocationContextProvider:()=>Ue,UniformMeshSdkContext:()=>ze,UniformMeshSdkContextProvider:()=>mr,useInitializeUniformMeshSdk:()=>fr,useMenuContext:()=>tt,useUniformMeshLocation:()=>dr,useUniformMeshLocationContext:()=>Fe,useUniformMeshSdk:()=>pr,useUniformMeshSdkContext:()=>$e});i();i();i();var _=v(require("react")),Ae=(0,_.createContext)(void 0),Ue=({children:e})=>{let[t,r]=(0,_.useState)(),n;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let o=t||window.UniformMeshSDK.getCurrentLocation();n={location:{getValue:o.getValue,getMetadata:o.getMetadata,setValue:async a=>{await o.setValue(a),r(window.UniformMeshSDK.getCurrentLocation())}}}}return _.default.createElement(Ae.Provider,{value:n},e)},Fe=()=>{let e=(0,_.useContext)(Ae);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function dr(){let{location:e}=Fe();return{value:e==null?void 0:e.getValue(),setValue:e==null?void 0:e.setValue,metadata:e==null?void 0:e.getMetadata()}}i();var Ut=require("@uniformdev/mesh-sdk"),Z=require("react"),fr=({autoResizingDisabled:e}={})=>{let[t,r]=(0,Z.useState)(),[n,o]=(0,Z.useState)();return(0,Z.useEffect)(()=>{typeof window=="undefined"||n||(typeof window.UniformMeshSDK=="undefined"?(0,Ut.initializeUniformMeshSDK)({autoResizingDisabled:e}).then(a=>{o(a)}).catch(a=>{r(a)}):o(window.UniformMeshSDK))},[e]),{initializing:!n&&!t,error:t,sdk:n}};i();i();var A=v(require("react"));var ze=(0,A.createContext)(void 0),mr=({children:e})=>{let t;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(t={sdk:window.UniformMeshSDK}),A.default.createElement(ze.Provider,{value:t},A.default.createElement(Ue,null,e))},$e=()=>{let e=(0,A.useContext)(ze);if(!e)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return e};function pr(){let{sdk:e}=$e();return e}i();var He=v(require("react")),Ft=require("reakit"),je={primary:{default:"bg-primary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},secondary:{default:"bg-secondary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},tertiary:{default:"bg-tertiary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},quaternary:{default:"bg-primary text-white hover:bg-opacity-75 border-2 border-gray-500 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},unimportant:{default:"bg-brand-secondary-2 text-primary hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-brand-secondary-2 text-gray-600 cursor-not-allowed"}},qe={base:"inline-flex items-center border-transparent font-medium focus:outline-none focus:ring",size:(e,t)=>({xs:`${t?"px-2.5 py-1.5 ":""}text-xs leading-4 ${e?"rounded":""}`,sm:`${t?"px-3 py-2 ":""}text-sm leading-4 ${e?"rounded-md":""}`,md:`${t?"px-4 py-2 ":""}text-sm leading-5 tracking-wider ${e?"rounded-md":""}`,lg:`${t?"px-4 py-2 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`,xl:`${t?"px-6 py-3 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`}),buttonType:(e,t)=>{if(!(!e||!je[e]))return t?je[e].disabled:je[e].default}},J=He.default.forwardRef(({size:e="md",buttonType:t="primary",children:r,className:n,rounded:o=!1,disablePadding:a=!1,...s},l)=>{let c=[qe.base,qe.size(o,!a)[e],qe.buttonType(t,s.disabled),n].join(" ");return He.default.createElement(Ft.Button,{className:c,ref:l,...s},r)});i();var D=v(require("react"));i();var Ke=v(require("react")),hr=e=>Ke.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...e},Ke.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})),pe=hr;i();var We=v(require("react")),gr=e=>We.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},We.createElement("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})),he=gr;i();var ge=v(require("react")),br=e=>ge.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},ge.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11 10.98a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0v-6zm1-4.929a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}),ge.createElement("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0z"})),V=br;i();var Ye=v(require("react")),yr=e=>Ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},Ye.createElement("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})),be=yr;i();var Xe=v(require("react")),vr=e=>Xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...e},Xe.createElement("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})),Q=vr;i();var Ze=v(require("react")),xr=e=>Ze.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},Ze.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 39.2A19.2 19.2 0 1 0 20 .8a19.2 19.2 0 0 0 0 38.4Zm8.897-22.303a2.4 2.4 0 0 0-3.394-3.394L17.6 21.407l-3.103-3.104a2.4 2.4 0 0 0-3.394 3.394l4.8 4.8a2.4 2.4 0 0 0 3.394 0l9.6-9.6Z"})),ye=xr;var wr={caution:{icon:Q,descriptionColor:"text-yellow-700",iconColor:"text-yellow-400",titleColor:"text-yellow-800",containerColor:"bg-yellow-50"},danger:{icon:he,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},error:{icon:Q,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},info:{icon:pe,descriptionColor:"text-blue-700",iconColor:"text-blue-400",titleColor:"text-blue-800",containerColor:"bg-blue-50"},note:{icon:V,descriptionColor:"text-gray-700",iconColor:"text-gray-400",titleColor:"text-gray-800",containerColor:"bg-gray-50"},success:{icon:ye,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"},tip:{icon:be,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"}},Je=({type:e="info",title:t,children:r,className:n})=>{let o=wr[e];if(!o)return null;let a=o.icon;return D.default.createElement("div",{"data-testid":"sdk-ui-callout",className:`rounded-md p-4 ${o.containerColor} ${n||""}`},D.default.createElement("div",{className:"flex"},D.default.createElement("div",{className:"flex-shrink-0"},D.default.createElement(a,{className:`h-5 w-5 ${o.iconColor}`})),D.default.createElement("div",{className:"ml-3"},t?D.default.createElement("h3",{className:`text-sm font-medium mb-2 ${o.titleColor}`},t):null,r?D.default.createElement("div",{className:`text-sm ${o.descriptionColor}`},r):null)))};i();i();var I=v(require("react")),zt=require("reakit"),ve=({classNameContainer:e,classNameControl:t,classNameLabel:r,label:n,icon:o,id:a,disabled:s,...l})=>{let c={container:`uniform-input-container ${e||""}`,control:`uniform-input uniform-input-text${s?" uniform-input-disabled":""}${o?" pr-10":""} ${t||""}`,label:`uniform-input-label ${r||""}`};return I.default.createElement(I.default.Fragment,null,n?I.default.createElement("label",{htmlFor:a,className:c.label},n):null,I.default.createElement("div",{className:c.container},I.default.createElement(zt.Input,{className:c.control,id:a,disabled:s,...l},m=>I.default.createElement("input",{...m,style:l.style})),o?I.default.createElement("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},o):null))};ve.displayName="Input";var we=v(require("react"));i();var G=v(require("react")),Cr=e=>G.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},G.createElement("g",{clipPath:"url(#magnifying-glass_svg__a)"},G.createElement("path",{d:"M11.539 0C5.484 0 .559 4.741.559 10.57c0 5.827 4.925 10.568 10.98 10.568 6.055 0 10.98-4.74 10.98-10.569C22.52 4.741 17.595 0 11.54 0Zm0 19.187c-4.937 0-8.954-3.866-8.954-8.618 0-4.752 4.017-8.618 8.954-8.618s8.954 3.866 8.954 8.618c0 4.752-4.017 8.618-8.954 8.618Z"}),G.createElement("path",{d:"m25.196 22.334-5.811-5.593a1.041 1.041 0 0 0-1.434 0 .95.95 0 0 0 0 1.38l5.812 5.593c.198.19.457.286.716.286.26 0 .519-.096.717-.286a.95.95 0 0 0 0-1.38Z"})),G.createElement("defs",null,G.createElement("clipPath",{id:"magnifying-glass_svg__a"},G.createElement("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),xe=Cr;function Qe({onSearchTextChanged:e,disabled:t=!1,placeholder:r="Keyword search",inputFieldName:n="keywordSearch",disabledFieldSubmission:o=!1}){return we.default.createElement(ve,{type:"text",name:n,placeholder:r,icon:we.default.createElement("div",{className:"pr-1"},we.default.createElement(xe,{className:"w-5 h-5 text-primary"})),onChange:l=>{e==null||e(l.currentTarget.value)},onKeyPress:l=>{l.key==="Enter"&&o&&l.preventDefault()},className:"uniform-input uniform-input-text pr-12 bg-gray-100",disabled:t,"aria-label":r})}i();var ee=v(require("react")),Ce=()=>ee.default.createElement("span",{className:"loader",role:"presentation"},ee.default.createElement("i",{className:"loader__dot"}),ee.default.createElement("i",{className:"loader__dot"}),ee.default.createElement("i",{className:"loader__dot"}));i();var U=v(require("react")),z=require("reakit/Menu"),et=U.default.createContext({}),tt=()=>U.default.useContext(et),nt=({menuLabel:e,menuTrigger:t,menuItemsContainerCssClasses:r,placement:n="auto",children:o})=>{let a=(0,z.useMenuState)();return U.default.createElement(et.Provider,{value:a},U.default.createElement(z.MenuButton,{...a,ref:t.ref,...t.props},s=>U.default.cloneElement(t,s)),U.default.createElement(z.Menu,{...a,placement:n,"aria-label":e,className:`uniform-menu divide-y divide-gray-500 shadow-xl z-50 ${r}`},o))};i();var $=v(require("react")),rt=require("reakit");var ot=({children:e,className:t,hideMenuOnClick:r=!0,icon:n,...o})=>{let a=tt(),s=`uniform-menu-item bg-white ${(o==null?void 0:o.disabled)?"text-gray-500":"text-primary"} ${t||""}`,l=m=>{let y={...m};if(y.onClick){let x=y.onClick;y.onClick=b=>{a.hide(),x(b)}}return y};if(typeof e=="function")return $.default.createElement(rt.MenuItem,{...a,...o,className:s},m=>{let y=r?l(m):m,x=e(y);return n?$t(x,n):x});let c=r?l(o):o;return $.default.createElement(rt.MenuItem,{...a,...c,className:s},n?$t(e,n):e)};function $t(e,t){return $.default.createElement("div",{className:"flex items-center justify-between"},$.default.createElement("div",null,e),$.default.createElement("div",{className:"ml-4"},t))}i();var d=v(require("react"));var ke={};Ge(ke,{Caution:()=>Q,Checkmark:()=>ye,ChevronDown:()=>Me,Close:()=>Se,Danger:()=>he,ExclamationPoint:()=>pe,Info:()=>V,Lightbulb:()=>be,MagnifyingGlass:()=>xe,MaximizeAlt:()=>jt,MoreVerticalAlt:()=>ne});i();i();var at=v(require("react")),Mr=e=>at.createElement("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e},at.createElement("path",{d:"M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414Z"})),Me=Mr;i();var te=v(require("react")),Sr=e=>te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e},te.createElement("g",{fillRule:"evenodd"},te.createElement("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),te.createElement("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"}))),Se=Sr;i();var st=v(require("react")),kr=e=>st.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},st.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M3 3h6v2H6.462l4.843 4.843-1.415 1.414L5 6.367V9H3V3zm0 18h6v-2H6.376l4.929-4.928-1.415-1.414L5 17.548V15H3v6zm12 0h6v-6h-2v2.524l-4.867-4.866-1.414 1.414L17.647 19H15v2zm6-18h-6v2h2.562l-4.843 4.843 1.414 1.414L19 6.39V9h2V3z"})),jt=kr;i();var it=v(require("react")),Er=e=>it.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},it.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M14 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})),ne=Er;var Kt=require("react-use"),Wt=require("uuid");i();var h=v(require("react"));i();function qt(e,t){let r=window.open(e,"_blank"),n=setInterval(()=>{(r==null?void 0:r.closed)&&(clearInterval(n),t())},500)}var Ht=require("timeago.js"),lt=({selectedItem:e,logoIcon:t,onDeselect:r,onEditClosed:n})=>{var x;let o=(0,h.useRef)(null),a=(0,h.useRef)(null),[s,l]=(0,h.useState)(!1);(0,h.useEffect)(()=>{let b=O=>{o.current&&!o.current.contains(O.target)&&a.current&&!a.current.contains(O.target)&&l(!1)},k=()=>{l(!1)};return window.addEventListener("resize",k,!0),document.addEventListener("scroll",b,!0),document.addEventListener("mousedown",b),()=>{window.removeEventListener("resize",k,!0),document.removeEventListener("scroll",b,!0),document.removeEventListener("mousedown",b)}},[a]);let c=()=>{var b;if(l(!s),a.current&&o.current){let k=(b=o==null?void 0:o.current)==null?void 0:b.getBoundingClientRect();a.current.style.top=`${k.top+30}px`}},m=t&&typeof t!="string"?t:null,y=m?h.default.createElement(m,{className:"h-7 w-7"}):h.default.createElement("img",{src:t,alt:"CMS logo",className:"h-7 w-7"});return h.default.createElement("div",{className:"flex w-full border border-gray-300 rounded-md bg-gray-100",key:e.id},h.default.createElement("div",{className:"p-4 pl-8 flex flex-grow mr-2 gap-2 items-center relative"},h.default.createElement("div",{className:"flex-grow"},h.default.createElement("div",{className:"inline-flex relative items-start"},h.default.createElement("h4",{className:"text-primary font-bold leading-none mb-2",title:`ID: ${e.id}`,"data-test-id":"entry-id"},e.title||e.id||""),e.popoverData&&h.default.createElement(h.default.Fragment,null,h.default.createElement("button",{type:"button",ref:o,className:"ml-2 -my-1","aria-controls":"path-details",onClick:c},h.default.createElement(V,{className:"text-gray-700"})),h.default.createElement("div",{ref:a,className:`fixed bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 ${s?"visible":"invisible"}`},Object.entries(e.popoverData).map(([b,k],O)=>h.default.createElement("div",{className:"text-xs",key:O},h.default.createElement("span",{className:"font-bold mr-2"},b,":"),k))))),e.createdDate&&h.default.createElement("div",{className:"text-xs"},h.default.createElement("span",{className:"font-bold mr-2"},"Created:"),(0,Ht.format)((x=e.createdDate)!=null?x:0)),h.default.createElement("div",{className:"flex gap-4"},e.metadata?Object.entries(e.metadata).filter(([b])=>["type","status"].includes(b.toLocaleLowerCase())).map(([b,k])=>h.default.createElement("span",{className:"text-sm",key:b},k)):null),e.metadata?Object.entries(e.metadata).filter(([b])=>!["type","status"].includes(b.toLocaleLowerCase())).map(([b,k])=>h.default.createElement("div",{className:"text-xs order-1",key:b},h.default.createElement("span",{className:"font-bold mr-2 order-1"},b,":"),k)):null),h.default.createElement("div",{className:"flex md:flex-row flex-col gap-2"},e.editLink?h.default.createElement("a",{href:e.editLink,title:"edit",rel:"noopener",target:"__blank",onClick:b=>{n&&(qt(b.currentTarget.href,()=>n(e)),b.preventDefault())},className:"flex justify-between items-center pl-4 pr-2 bg-white rounded border-2 border-gray-400 hover:bg-gray-100"},h.default.createElement("span",{className:"mr-2 text-sm"},"Edit"),y):null,h.default.createElement("button",{type:"button",onClick:b=>{b.preventDefault(),r(e)},className:"flex justify-between items-center px-4 bg-white rounded border-2 border-gray-400 h-10 hover:bg-gray-100"},h.default.createElement("span",{className:"mr-2 text-sm"},"Unlink"),h.default.createElement(Se,{className:"w-4 h-4 text-red-600"})))))};i();var C=v(require("react"));var ct=({result:e,isSelected:t,triggerSelection:r})=>{let n=(0,C.useRef)(null),o=(0,C.useRef)(null),[a,s]=(0,C.useState)(!1);(0,C.useEffect)(()=>{function c(m){n.current&&!n.current.contains(m.target)&&o.current&&!o.current.contains(m.target)&&s(!1)}return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[o]);let l=c=>{c.stopPropagation(),s(!a)};return C.default.createElement("div",{key:e.id,className:`p-2 cursor-pointer relative ${t?"bg-green-400 text-white":""}`,"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>r()},e.title,e.popoverData&&t?C.default.createElement(C.default.Fragment,null,C.default.createElement("button",{type:"button",ref:n,className:"absolute top-0 bottom-0 right-2","aria-controls":"path-details",onClick:c=>l(c)},C.default.createElement(V,null)),C.default.createElement("div",{ref:o,className:`absolute top-4 right-10 bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 text-black ${a?"visible":"invisible"}`},e.metadata&&Object.entries(e.metadata).map(([c,m],y)=>C.default.createElement("div",{className:"text-xs",key:y},C.default.createElement("span",{className:"font-bold mr-2"},c,":"),m)),Object.entries(e.popoverData).map(([c,m],y)=>C.default.createElement("div",{className:"text-xs",key:y},C.default.createElement("span",{className:"font-bold mr-2"},c,":"),m)))):null)};var j=require("react-beautiful-dnd"),Pr=({searchText:e,selectedContentType:t})=>{let r="No content found";return t&&(r=`No ${t} content was found`),e&&(r=`${r} for keyword '${e}'.`),d.default.createElement(Je,{type:"info"},r)},Lr=({search:e,results:t,contentTypes:r,selectedItems:n,logoIcon:o,select:a,multiSelect:s,multiSelectId:l,rowComponent:c,selectedItemComponent:m,totalResults:y,resultsLoading:x,requireContentType:b,onAddNew:k,onEditClosed:O,onCancel:wt,noResultsComponent:Un,helpComponent:Fn,onSort:Ve})=>{var Ot,Bt,_t;let Ct=()=>b?Array.isArray(r)&&r.length>0?r[0].id:"":"any",[Mt,St]=(0,d.useState)(""),[B,kt]=(0,d.useState)(Ct),[ie,De]=(0,d.useState)(!1),[le,ce]=(0,d.useState)([]),[zn,Et]=(0,d.useState)(!1),ue=(0,Kt.useThrottle)(Mt,750);(0,d.useEffect)(()=>{e(ue,{count:5,offset:0,contentType:B==="any"?void 0:B})},[ue,B]);let $n=f=>{le.includes(f.id)?ce(w=>w.filter(F=>F!==f.id)):ce(s?w=>[...w,f==null?void 0:f.id]:[f.id])},jn=()=>{kt(Ct()),St(""),ce((n==null?void 0:n.length)?n.map(f=>f.id):[])},qn=()=>{De(f=>!f),ie||jn()},Pt=f=>{a((n==null?void 0:n.filter(w=>w.id!==f.id).map(w=>w.id))||[],"")},Hn=f=>{f.preventDefault(),a(le,B),De(!1)},Kn=f=>{f.preventDefault(),De(!1),wt&&wt()},Wn=f=>{f.preventDefault(),e(ue,{count:5,offset:(t==null?void 0:t.length)||0,contentType:B==="any"?void 0:B}),Et(!0);let w=setTimeout(()=>{Et(!1)},750);return()=>clearTimeout(w)},Lt=(0,d.useRef)((0,Wt.v4)()),Yn=!(n==null?void 0:n.length)||s,Xn=c||ct,Nt=m||lt,Zn=Un||Pr,Tt=o&&typeof o!="string"?o:null,Jn=Tt?d.default.createElement(Tt,{className:"h-9 w-9"}):d.default.createElement("img",{src:o,alt:"CMS logo",className:"h-9 w-9"}),Qn=f=>{var w,F;if(f.destination&&f.source.droppableId===((w=f.destination)==null?void 0:w.droppableId)){let L=[...n||[]],[Ie]=(F=L==null?void 0:L.splice(f.source.index,1))!=null?F:[];return L==null||L.splice(f.destination.index,0,Ie),Ve==null||Ve(L.map(X=>X.id)),L}};return d.default.createElement("div",{className:"w-full"},d.default.createElement("div",{className:"relative my-4"},Yn&&d.default.createElement("div",{className:"space-y-2"},d.default.createElement("div",{className:"py-3 px-2 bg-white rounded-lg border border-gray-300 mb-4","data-test-id":"component-search"},d.default.createElement("button",{className:"flex items-center w-full text-base relative",onClick:qn,type:"button","aria-haspopup":!0,"aria-expanded":ie,"aria-controls":Lt.current},Jn,d.default.createElement("span",{className:"ml-4"},"Select"),d.default.createElement("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},d.default.createElement(Me,{className:`w-5 h-5 text-standard transform transition-transform ${ie?"rotate-180":"rotate-0"}`})))),d.default.createElement("div",{className:`${ie?"block":"hidden"} py-3 px-4 space-y-4 bg-white rounded-lg border border-gray-300`},Fn||null,d.default.createElement("div",{className:"flex space-x-3"},d.default.createElement("select",{className:"uniform-input uniform-input-select w-1/3 bg-gray-100",onChange:f=>kt(f.target.value)},b?null:d.default.createElement("option",{value:"any",className:"bg-white text-primary"},"All content types"),r==null?void 0:r.map(f=>d.default.createElement("option",{value:f.id,key:f.id,className:"bg-white text-primary"},f.name))),d.default.createElement("div",{className:"flex-grow"},d.default.createElement(Qe,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:St,disabledFieldSubmission:!0}))),d.default.createElement("div",{className:"overflow-y-scroll max-h-64 divide-y divide-gray-200 scrollbar",id:Lt.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},(t==null?void 0:t.length)?t.map(f=>d.default.createElement(Xn,{key:f.id,isSelected:le.includes(f.id),result:f,triggerSelection:()=>$n(f)})):x?null:d.default.createElement(Zn,{searchText:ue||Mt,selectedContentType:(Bt=(Ot=r==null?void 0:r.find(f=>f.id===B))==null?void 0:Ot.name)!=null?Bt:B}),!x&&typeof y!="undefined"&&t&&(t==null?void 0:t.length)<y&&d.default.createElement("button",{className:"block p-4 text-center w-full hover:bg-gray-100 focus:bg-gray-100 font-bold text-primary text-sm focus:outline-none",onClick:Wn},zn?d.default.createElement(Ce,null):"Load More"),x&&!(t==null?void 0:t.length)?d.default.createElement("div",{className:"p-4 text-center w-full"},d.default.createElement(Ce,null)):null),d.default.createElement("div",{className:"flex justify-between"},d.default.createElement("div",null,k&&((_t=r==null?void 0:r.length)!=null?_t:0)>0?d.default.createElement(nt,{menuLabel:"Add new menu",menuTrigger:d.default.createElement(J,{buttonType:"secondary"},"Add New")},r==null?void 0:r.map(f=>d.default.createElement(ot,{key:f.id,className:"bg-white text-primary",onClick:()=>k(f)},f.name))):null),d.default.createElement("div",null,d.default.createElement(J,{buttonType:"unimportant",onClick:Kn},"Cancel"),d.default.createElement(J,{className:"ml-5",disabled:!le.length,onClick:Hn,"data-test-id":"entry-accept-button"},"Accept"))))),s?d.default.createElement(j.DragDropContext,{onDragEnd:f=>Qn(f)},d.default.createElement(j.Droppable,{droppableId:l||"canvas-multi-select"},f=>d.default.createElement("div",{...f.droppableProps,ref:f.innerRef,className:"space-y-1"},n==null?void 0:n.map((w,F)=>{if(w==null?void 0:w.id)return d.default.createElement(j.Draggable,{key:w.id,draggableId:w.id,index:F},(L,Ie)=>d.default.createElement("div",{className:"relative group",ref:L.innerRef,...L.draggableProps,...L.dragHandleProps},d.default.createElement("span",{className:`absolute left-0 top-0 bottom-0 my-auto flex items-center ${Ie.isDragging?"":"opacity-0 group-hover:opacity-30"}`},d.default.createElement(ne,{className:"text-brand-secondary-1 absolute left-1.5",width:24,height:24}),d.default.createElement(ne,{className:"text-brand-secondary-1",width:24,height:24})),d.default.createElement(Nt,{key:`selected-item-${w.id}`,logoIcon:o,selectedItem:w,onDeselect:X=>Pt(X),onEditClosed:O?X=>O(X):void 0})))}),f.placeholder))):n==null?void 0:n.map(f=>d.default.createElement(Nt,{key:`selected-item-${f.id}`,logoIcon:o,selectedItem:f,onDeselect:w=>Pt(w),onEditClosed:O?w=>O(w):void 0}))))};i();var E=v(require("react")),Nr=({isActive:e,statusMessage:t})=>E.default.createElement("div",{className:`${e?"flex":"hidden"} absolute bottom-0 left-0 right-0 top-0 items-center justify-center overflow-hidden z-50`,style:{zIndex:9999}},E.default.createElement("div",{className:"absolute bottom-0 left-0 right-0 top-0 bg-white bg-opacity-50"}),E.default.createElement("div",{className:"relative"},E.default.createElement("div",{className:"flex flex-col items-center"},E.default.createElement(Yt,{height:128,width:128}),t?E.default.createElement("div",{className:"mt-4 text-gray-500"},t):null))),Yt=({height:e,width:t})=>E.default.createElement("svg",{"data-testid":"svg",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",width:t!=null?t:40,height:e!=null?e:40,className:"stroke-current"},E.default.createElement("g",{fill:"none",fillRule:"evenodd"},E.default.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},E.default.createElement("circle",{strokeOpacity:".25",cx:"18",cy:"18",r:"18"}),E.default.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18",transform:"rotate(166.645 18 18)"},E.default.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"0.8s",repeatCount:"indefinite"})))));T(P,require("@uniformdev/mesh-sdk"));i();var Xt={".uniform-input-container":{"@apply text-gray-700 relative":{}},".uniform-input-label":{"@apply text-primary mb-1 block font-bold leading-5":{}},".uniform-checkbox-label":{"@apply text-primary block font-bold leading-5":{}},".uniform-input":{"@apply bg-white border border-gray-500 text-gray-700 block w-full leading-5 rounded-md relative":{}},".uniform-input-disabled":{"@apply text-gray-300 cursor-not-allowed":{}},".uniform-input-text":{"@apply appearance-none p-4 block border-gray-500":{}},".uniform-input-text::placeholder":{"@apply text-gray-500":{}},".uniform-input:focus":{"@apply border-primary ring-primary outline-none":{}},".uniform-input-select":{"@apply bg-no-repeat pl-4 pr-10 py-4 block border-gray-500":{}},".uniform-input-checkbox":{"@apply align-middle flex-shrink-0 h-6 w-6 border-gray-500 rounded text-primary":{}},".uniform-input-checkbox:checked":{"@apply border-transparent":{}},".uniform-input-checkbox:checked:focus":{"@apply border-transparent":{}},".uniform-link-primary":{"@apply text-primary":{}},".uniform-link-secondary":{"@apply text-secondary":{}},".uniform-menu":{"@apply border rounded border-gray-500 outline-none":{}},".uniform-menu-item":{"@apply block rounded w-full text-left py-2 px-4 font-bold":{}},".uniform-menu-item:focus":{"@apply outline-none":{}},".uniform-menu-item:hover":{"@apply bg-gray-200":{}},".uniform-input-switch-container":{"@apply relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in":{}},".uniform-input-switch":{"@apply absolute block w-6 h-6 rounded-full bg-white border-2 appearance-none cursor-pointer transition transform translate-x-0":{}},".uniform-input-switch:checked":{"@apply translate-x-4 bg-green-500":{}},".uniform-input-switch-track":{"@apply block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer":{}},".uniform-input-switch-label":{"@apply text-primary font-bold leading-5":{}},".loader":{"@apply inline-flex justify-center":{}},".loader__dot":{"@apply bg-gray-700 block rounded-lg opacity-100 animate-bounce-fade":{},width:"8px",height:"8px",margin:"0 2px",transform:"translateY(0)"},".loader__dot:nth-child(1)":{"animation-delay":"0.15s"},".loader__dot:nth-child(2)":{"animation-delay":"0.3s"},".loader__dot:nth-child(3)":{"animation-delay":"0.6s"},"@supports ((scrollbar-color: #d1d5db transparent) and (scrollbar-width: thin))":{".scrollbar":{"scrollbar-color":"#d1d5db transparent","scrollbar-width":"thin"}},".scrollbar::-webkit-scrollbar":{width:"8px",height:"8px"},".scrollbar::-webkit-scrollbar-track":{"@apply bg-transparent rounded":{}},".scrollbar::-webkit-scrollbar-thumb":{"@apply bg-gray-300 rounded":{}},".scrollbar::-webkit-scrollbar-thumb:hover":{"@apply bg-gray-500":{}},".main-heading":{"@apply text-4xl font-extrabold text-primary":{}}};i();var g=v(In()),Y={"brand-primary-1":"#438FD5","brand-primary-2":"#f4220b","brand-primary-3":"#83c6e1","brand-secondary-1":"#1f2b34","brand-secondary-2":"#ecf1f1","brand-secondary-3":"#2ecdb4","brand-secondary-4":"#005e3b","brand-secondary-5":"#f6f1c3","brand-secondary-6":"#d9534f","brand-secondary-7":"#dbf6f2"},Gn={fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"4rem"},extend:{colors:{current:g.current,transparent:g.transparent,gray:{50:g.gray["50"],100:"#f9f9f9",200:"#f1f1f1",300:"#E0E0E0",400:"#D3DBE1",500:"#BDBDBD",700:"#828282",800:"#2d3748"},white:g.white,primary:Y["brand-secondary-1"],secondary:Y["brand-secondary-6"],tertiary:Y["brand-primary-3"],quaternary:Y["brand-primary-1"],standard:Y["brand-secondary-1"],red:{50:g.red["50"],400:g.red["400"],600:g.red["600"],700:g.red["700"],800:g.red["800"]},blue:{50:g.blue["50"],200:g.blue["200"],400:g.blue["400"],500:g.blue["500"],700:g.blue["700"],800:g.blue["800"]},green:{50:g.emerald["50"],300:g.emerald["300"],400:g.emerald["400"],500:"#3DCCB4",700:g.emerald["700"],800:g.emerald["800"]},yellow:{50:g.amber["50"],400:g.amber["400"],700:g.amber["700"],800:g.amber["800"]},black:g.black,...Y},animation:{"bounce-fade":"bounce-fade 0.75s infinite ease-in-out"},keyframes:{"bounce-fade":{"0%":{},"100%":{opacity:1,transform:"translateY(0)"},"30%":{opacity:.6},"80%":{opacity:.4,transform:"translateY(-10px)"},"90%":{opacity:.2,transform:"translateY(-5px)"}}}}};var so=(0,Rn.default)(({config:e,addComponents:t})=>{let r=e("content");io(r);let n=e("safelist");lo(n),t(Xt)},{theme:Gn});function io(e){e||(e={});let t=An.default.resolve(__dirname,"../*.js");Array.isArray(e.files)?e.files.push(t):e.files=[t]}function lo(e){let t=co();Array.isArray(e)?e.push(...t):e=t}function co(){let e=[];return Object.keys(P).forEach(t=>{let r=P[t];Array.isArray(r.cssSafelistPatterns)&&e.push(...r.cssSafelistPatterns)}),e}module.exports=sr(uo);0&&(module.exports={uniformMeshPlugin});
|
package/dist/tailwind/plugin.mjs
CHANGED
|
@@ -3,4 +3,4 @@ var Wn=Object.create;var se=Object.defineProperty;var Yn=Object.getOwnPropertyDe
|
|
|
3
3
|
`)+r,o=n+1,n=e.indexOf(`
|
|
4
4
|
`,o)}while(n!==-1);return a+=e.substr(o),a};fn.exports={stringReplaceAll:mo,stringEncaseCRLFWithFirstIndex:po}});var yn=M((Us,bn)=>{"use strict";i();var ho=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,pn=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,go=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,bo=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,yo=new Map([["n",`
|
|
5
5
|
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function gn(e){let t=e[0]==="u",r=e[1]==="{";return t&&!r&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(parseInt(e.slice(2,-1),16)):yo.get(e)||e}function vo(e,t){let r=[],n=t.trim().split(/\s*,\s*/g),o;for(let a of n){let s=Number(a);if(!Number.isNaN(s))r.push(s);else if(o=a.match(go))r.push(o[2].replace(bo,(l,c,m)=>c?gn(c):m));else throw new Error(`Invalid Chalk template style argument: ${a} (in style '${e}')`)}return r}function xo(e){pn.lastIndex=0;let t=[],r;for(;(r=pn.exec(e))!==null;){let n=r[1];if(r[2]){let o=vo(n,r[2]);t.push([n].concat(o))}else t.push([n])}return t}function hn(e,t){let r={};for(let o of t)for(let a of o.styles)r[a[0]]=o.inverse?null:a.slice(1);let n=e;for(let[o,a]of Object.entries(r))if(!!Array.isArray(a)){if(!(o in n))throw new Error(`Unknown Chalk style: ${o}`);n=a.length>0?n[o](...a):n[o]}return n}bn.exports=(e,t)=>{let r=[],n=[],o=[];if(t.replace(ho,(a,s,l,c,m,y)=>{if(s)o.push(gn(s));else if(c){let v=o.join("");o=[],n.push(r.length===0?v:hn(e,r)(v)),r.push({inverse:l,styles:xo(c)})}else if(m){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(hn(e,r)(o.join(""))),o=[],r.pop()}else o.push(y)}),n.push(o.join("")),r.length>0){let a=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(a)}return n.join("")}});var En=M((js,kn)=>{"use strict";i();var Q=an(),{stdout:ct,stderr:ut}=dn(),{stringReplaceAll:wo,stringEncaseCRLFWithFirstIndex:Co}=mn(),{isArray:Me}=Array,xn=["ansi","ansi","ansi256","ansi16m"],U=Object.create(null),Mo=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=ct?ct.level:0;e.level=t.level===void 0?r:t.level},wn=class{constructor(t){return Cn(t)}},Cn=e=>{let t={};return Mo(t,e),t.template=(...r)=>Sn(t.template,...r),Object.setPrototypeOf(t,Se.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=wn,t.template};function Se(e){return Cn(e)}for(let[e,t]of Object.entries(Q))U[e]={get(){let r=ke(this,dt(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};U.visible={get(){let e=ke(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Mn=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of Mn)U[e]={get(){let{level:t}=this;return function(...r){let n=dt(Q.color[xn[t]][e](...r),Q.color.close,this._styler);return ke(this,n,this._isEmpty)}}};for(let e of Mn){let t="bg"+e[0].toUpperCase()+e.slice(1);U[t]={get(){let{level:r}=this;return function(...n){let o=dt(Q.bgColor[xn[r]][e](...n),Q.bgColor.close,this._styler);return ke(this,o,this._isEmpty)}}}}var So=Object.defineProperties(()=>{},{...U,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),dt=(e,t,r)=>{let n,o;return r===void 0?(n=e,o=t):(n=r.openAll+e,o=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:o,parent:r}},ke=(e,t,r)=>{let n=(...o)=>Me(o[0])&&Me(o[0].raw)?vn(n,Sn(n,...o)):vn(n,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(n,So),n._generator=e,n._styler=t,n._isEmpty=r,n},vn=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let r=e._styler;if(r===void 0)return t;let{openAll:n,closeAll:o}=r;if(t.indexOf("\x1B")!==-1)for(;r!==void 0;)t=wo(t,r.close,r.open),r=r.parent;let a=t.indexOf(`
|
|
6
|
-
`);return a!==-1&&(t=Co(t,o,n,a)),n+t+o},lt,Sn=(e,...t)=>{let[r]=t;if(!Me(r)||!Me(r.raw))return t.join(" ");let n=t.slice(1),o=[r.raw[0]];for(let a=1;a<r.length;a++)o.push(String(n[a-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[a]));return lt===void 0&&(lt=yn()),lt(e,o.join(""))};Object.defineProperties(Se.prototype,U);var Ee=Se();Ee.supportsColor=ct;Ee.stderr=Se({level:ut?ut.level:0});Ee.stderr.supportsColor=ut;kn.exports=Ee});var Nn=M(ee=>{"use strict";i();Object.defineProperty(ee,"__esModule",{value:!0});ee.dim=Eo;ee.default=void 0;var Pe=ko(En());function ko(e){return e&&e.__esModule?e:{default:e}}var Pn=new Set;function ft(e,t,r){process.env.JEST_WORKER_ID===void 0&&(r&&Pn.has(r)||(r&&Pn.add(r),console.warn(""),t.forEach(n=>console.warn(e,"-",n))))}function Eo(e){return Pe.default.dim(e)}var Po={info(e,t){ft(Pe.default.bold.cyan("info"),...Array.isArray(e)?[e]:[t,e])},warn(e,t){ft(Pe.default.bold.yellow("warn"),...Array.isArray(e)?[e]:[t,e])},risk(e,t){ft(Pe.default.bold.magenta("risk"),...Array.isArray(e)?[e]:[t,e])}};ee.default=Po});var Ln=M(Ne=>{"use strict";i();Object.defineProperty(Ne,"__esModule",{value:!0});Ne.default=void 0;var No=Lo(Nn());function Lo(e){return e&&e.__esModule?e:{default:e}}function te({version:e,from:t,to:r}){No.default.warn(`${t}-color-renamed`,[`As of Tailwind CSS ${e}, \`${t}\` has been renamed to \`${r}\`.`,"Update your configuration file to silence this warning."])}var To={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},get lightBlue(){return te({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return te({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return te({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return te({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return te({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}};Ne.default=To});var On=M((Ks,Tn)=>{i();var mt=Ln();Tn.exports=(mt.__esModule?mt:{default:mt}).default});i();var _n=Lt(Vt());import Oo from"path";var k={};Nt(k,{Button:()=>H,Callout:()=>qe,CmsEntrySearch:()=>Jr,DefaultSearchRow:()=>nt,DefaultSelectedItem:()=>tt,Icons:()=>xe,Input:()=>pe,KeywordSearchInput:()=>Ke,LoadingIcon:()=>jt,LoadingIndicator:()=>be,LoadingOverlay:()=>Qr,Menu:()=>Xe,MenuContext:()=>We,MenuItem:()=>Ze,UniformMeshLocationContext:()=>_e,UniformMeshLocationContextProvider:()=>Ve,UniformMeshSdkContext:()=>Ie,UniformMeshSdkContextProvider:()=>xr,useInitializeUniformMeshSdk:()=>br,useMenuContext:()=>Ye,useUniformMeshLocation:()=>pr,useUniformMeshLocationContext:()=>De,useUniformMeshSdk:()=>wr,useUniformMeshSdkContext:()=>Ge});i();i();i();import ur,{createContext as dr,useContext as fr,useState as mr}from"react";var _e=dr(void 0),Ve=({children:e})=>{let[t,r]=mr(),n;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let o=t||window.UniformMeshSDK.getCurrentLocation();n={location:{getValue:o.getValue,getMetadata:o.getMetadata,setValue:async a=>{await o.setValue(a),r(window.UniformMeshSDK.getCurrentLocation())}}}}return ur.createElement(_e.Provider,{value:n},e)},De=()=>{let e=fr(_e);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function pr(){let{location:e}=De();return{value:e==null?void 0:e.getValue(),setValue:e==null?void 0:e.setValue,metadata:e==null?void 0:e.getMetadata()}}i();import{initializeUniformMeshSDK as hr}from"@uniformdev/mesh-sdk";import{useEffect as gr,useState as Dt}from"react";var br=({autoResizingDisabled:e}={})=>{let[t,r]=Dt(),[n,o]=Dt();return gr(()=>{typeof window=="undefined"||n||(typeof window.UniformMeshSDK=="undefined"?hr({autoResizingDisabled:e}).then(a=>{o(a)}).catch(a=>{r(a)}):o(window.UniformMeshSDK))},[e]),{initializing:!n&&!t,error:t,sdk:n}};i();i();import It,{createContext as yr,useContext as vr}from"react";var Ie=yr(void 0),xr=({children:e})=>{let t;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(t={sdk:window.UniformMeshSDK}),It.createElement(Ie.Provider,{value:t},It.createElement(Ve,null,e))},Ge=()=>{let e=vr(Ie);if(!e)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return e};function wr(){let{sdk:e}=Ge();return e}i();import Gt from"react";import{Button as Cr}from"reakit/Button";var Re={primary:{default:"bg-primary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},secondary:{default:"bg-secondary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},tertiary:{default:"bg-tertiary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},quaternary:{default:"bg-primary text-white hover:bg-opacity-75 border-2 border-gray-500 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},unimportant:{default:"bg-brand-secondary-2 text-primary hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-brand-secondary-2 text-gray-600 cursor-not-allowed"}},Ae={base:"inline-flex items-center border-transparent font-medium focus:outline-none focus:ring",size:(e,t)=>({xs:`${t?"px-2.5 py-1.5 ":""}text-xs leading-4 ${e?"rounded":""}`,sm:`${t?"px-3 py-2 ":""}text-sm leading-4 ${e?"rounded-md":""}`,md:`${t?"px-4 py-2 ":""}text-sm leading-5 tracking-wider ${e?"rounded-md":""}`,lg:`${t?"px-4 py-2 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`,xl:`${t?"px-6 py-3 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`}),buttonType:(e,t)=>{if(!(!e||!Re[e]))return t?Re[e].disabled:Re[e].default}},H=Gt.forwardRef(({size:e="md",buttonType:t="primary",children:r,className:n,rounded:o=!1,disablePadding:a=!1,...s},l)=>{let c=[Ae.base,Ae.size(o,!a)[e],Ae.buttonType(t,s.disabled),n].join(" ");return Gt.createElement(Cr,{className:c,ref:l,...s},r)});i();import I from"react";i();import*as Fe from"react";var Mr=e=>Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...e},Fe.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})),ce=Mr;i();import*as ze from"react";var Sr=e=>ze.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},ze.createElement("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})),ue=Sr;i();import*as de from"react";var kr=e=>de.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},de.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11 10.98a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0v-6zm1-4.929a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}),de.createElement("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0z"})),_=kr;i();import*as $e from"react";var Er=e=>$e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},$e.createElement("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})),fe=Er;i();import*as Ue from"react";var Pr=e=>Ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...e},Ue.createElement("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})),K=Pr;i();import*as je from"react";var Nr=e=>je.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},je.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 39.2A19.2 19.2 0 1 0 20 .8a19.2 19.2 0 0 0 0 38.4Zm8.897-22.303a2.4 2.4 0 0 0-3.394-3.394L17.6 21.407l-3.103-3.104a2.4 2.4 0 0 0-3.394 3.394l4.8 4.8a2.4 2.4 0 0 0 3.394 0l9.6-9.6Z"})),me=Nr;var Lr={caution:{icon:K,descriptionColor:"text-yellow-700",iconColor:"text-yellow-400",titleColor:"text-yellow-800",containerColor:"bg-yellow-50"},danger:{icon:ue,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},error:{icon:K,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},info:{icon:ce,descriptionColor:"text-blue-700",iconColor:"text-blue-400",titleColor:"text-blue-800",containerColor:"bg-blue-50"},note:{icon:_,descriptionColor:"text-gray-700",iconColor:"text-gray-400",titleColor:"text-gray-800",containerColor:"bg-gray-50"},success:{icon:me,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"},tip:{icon:fe,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"}},qe=({type:e="info",title:t,children:r,className:n})=>{let o=Lr[e];if(!o)return null;let a=o.icon;return I.createElement("div",{"data-testid":"sdk-ui-callout",className:`rounded-md p-4 ${o.containerColor} ${n||""}`},I.createElement("div",{className:"flex"},I.createElement("div",{className:"flex-shrink-0"},I.createElement(a,{className:`h-5 w-5 ${o.iconColor}`})),I.createElement("div",{className:"ml-3"},t?I.createElement("h3",{className:`text-sm font-medium mb-2 ${o.titleColor}`},t):null,r?I.createElement("div",{className:`text-sm ${o.descriptionColor}`},r):null)))};i();i();import G from"react";import{Input as Tr}from"reakit/Input";var pe=({classNameContainer:e,classNameControl:t,classNameLabel:r,label:n,icon:o,id:a,disabled:s,...l})=>{let c={container:`uniform-input-container ${e||""}`,control:`uniform-input uniform-input-text${s?" uniform-input-disabled":""}${o?" pr-10":""} ${t||""}`,label:`uniform-input-label ${r||""}`};return G.createElement(G.Fragment,null,n?G.createElement("label",{htmlFor:a,className:c.label},n):null,G.createElement("div",{className:c.container},G.createElement(Tr,{className:c.control,id:a,disabled:s,...l},m=>G.createElement("input",{...m,style:l.style})),o?G.createElement("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},o):null))};pe.displayName="Input";import He from"react";i();import*as V from"react";var Or=e=>V.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},V.createElement("g",{clipPath:"url(#magnifying-glass_svg__a)"},V.createElement("path",{d:"M11.539 0C5.484 0 .559 4.741.559 10.57c0 5.827 4.925 10.568 10.98 10.568 6.055 0 10.98-4.74 10.98-10.569C22.52 4.741 17.595 0 11.54 0Zm0 19.187c-4.937 0-8.954-3.866-8.954-8.618 0-4.752 4.017-8.618 8.954-8.618s8.954 3.866 8.954 8.618c0 4.752-4.017 8.618-8.954 8.618Z"}),V.createElement("path",{d:"m25.196 22.334-5.811-5.593a1.041 1.041 0 0 0-1.434 0 .95.95 0 0 0 0 1.38l5.812 5.593c.198.19.457.286.716.286.26 0 .519-.096.717-.286a.95.95 0 0 0 0-1.38Z"})),V.createElement("defs",null,V.createElement("clipPath",{id:"magnifying-glass_svg__a"},V.createElement("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),he=Or;function Ke({onSearchTextChanged:e,disabled:t=!1,placeholder:r="Keyword search",inputFieldName:n="keywordSearch",disabledFieldSubmission:o=!1}){return He.createElement(pe,{type:"text",name:n,placeholder:r,icon:He.createElement("div",{className:"pr-1"},He.createElement(he,{className:"w-5 h-5 text-primary"})),onChange:l=>{e==null||e(l.currentTarget.value)},onKeyPress:l=>{l.key==="Enter"&&o&&l.preventDefault()},className:"uniform-input uniform-input-text pr-12 bg-gray-100",disabled:t,"aria-label":r})}i();import ge from"react";var be=()=>ge.createElement("span",{className:"loader",role:"presentation"},ge.createElement("i",{className:"loader__dot"}),ge.createElement("i",{className:"loader__dot"}),ge.createElement("i",{className:"loader__dot"}));i();import A from"react";import{useMenuState as Br,Menu as _r,MenuButton as Vr}from"reakit/Menu";var We=A.createContext({}),Ye=()=>A.useContext(We),Xe=({menuLabel:e,menuTrigger:t,menuItemsContainerCssClasses:r,placement:n="auto",children:o})=>{let a=Br();return A.createElement(We.Provider,{value:a},A.createElement(Vr,{...a,ref:t.ref,...t.props},s=>A.cloneElement(t,s)),A.createElement(_r,{...a,placement:n,"aria-label":e,className:`uniform-menu divide-y divide-gray-500 shadow-xl z-50 ${r}`},o))};i();import W from"react";import{MenuItem as Rt}from"reakit";var Ze=({children:e,className:t,hideMenuOnClick:r=!0,icon:n,...o})=>{let a=Ye(),s=`uniform-menu-item bg-white ${(o==null?void 0:o.disabled)?"text-gray-500":"text-primary"} ${t||""}`,l=m=>{let y={...m};if(y.onClick){let v=y.onClick;y.onClick=b=>{a.hide(),v(b)}}return y};if(typeof e=="function")return W.createElement(Rt,{...a,...o,className:s},m=>{let y=r?l(m):m,v=e(y);return n?At(v,n):v});let c=r?l(o):o;return W.createElement(Rt,{...a,...c,className:s},n?At(e,n):e)};function At(e,t){return W.createElement("div",{className:"flex items-center justify-between"},W.createElement("div",null,e),W.createElement("div",{className:"ml-4"},t))}i();import h,{useState as Z,useEffect as jr,useRef as qr}from"react";var xe={};Nt(xe,{Caution:()=>K,Checkmark:()=>me,ChevronDown:()=>ye,Close:()=>ve,Danger:()=>ue,ExclamationPoint:()=>ce,Info:()=>_,Lightbulb:()=>fe,MagnifyingGlass:()=>he,MaximizeAlt:()=>Ft,MoreVerticalAlt:()=>X});i();i();import*as Je from"react";var Dr=e=>Je.createElement("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e},Je.createElement("path",{d:"M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414Z"})),ye=Dr;i();import*as Y from"react";var Ir=e=>Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e},Y.createElement("g",{fillRule:"evenodd"},Y.createElement("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),Y.createElement("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"}))),ve=Ir;i();import*as Qe from"react";var Gr=e=>Qe.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},Qe.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M3 3h6v2H6.462l4.843 4.843-1.415 1.414L5 6.367V9H3V3zm0 18h6v-2H6.376l4.929-4.928-1.415-1.414L5 17.548V15H3v6zm12 0h6v-6h-2v2.524l-4.867-4.866-1.414 1.414L17.647 19H15v2zm6-18h-6v2h2.562l-4.843 4.843 1.414 1.414L19 6.39V9h2V3z"})),Ft=Gr;i();import*as et from"react";var Rr=e=>et.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},et.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M14 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})),X=Rr;import{useThrottle as Hr}from"react-use";import{v4 as Kr}from"uuid";i();import x,{useState as Ar,useRef as $t,useEffect as Fr}from"react";i();function zt(e,t){let r=window.open(e,"_blank"),n=setInterval(()=>{(r==null?void 0:r.closed)&&(clearInterval(n),t())},500)}import{format as zr}from"timeago.js";var tt=({selectedItem:e,logoIcon:t,onDeselect:r,onEditClosed:n})=>{var v;let o=$t(null),a=$t(null),[s,l]=Ar(!1);Fr(()=>{let b=T=>{o.current&&!o.current.contains(T.target)&&a.current&&!a.current.contains(T.target)&&l(!1)},S=()=>{l(!1)};return window.addEventListener("resize",S,!0),document.addEventListener("scroll",b,!0),document.addEventListener("mousedown",b),()=>{window.removeEventListener("resize",S,!0),document.removeEventListener("scroll",b,!0),document.removeEventListener("mousedown",b)}},[a]);let c=()=>{var b;if(l(!s),a.current&&o.current){let S=(b=o==null?void 0:o.current)==null?void 0:b.getBoundingClientRect();a.current.style.top=`${S.top+30}px`}},m=t&&typeof t!="string"?t:null,y=m?x.createElement(m,{className:"h-7 w-7"}):x.createElement("img",{src:t,alt:"CMS logo",className:"h-7 w-7"});return x.createElement("div",{className:"flex w-full border border-gray-300 rounded-md bg-gray-100",key:e.id},x.createElement("div",{className:"p-4 pl-8 flex flex-grow mr-2 gap-2 items-center relative"},x.createElement("div",{className:"flex-grow"},x.createElement("div",{className:"inline-flex relative items-start"},x.createElement("h4",{className:"text-primary font-bold leading-none mb-2",title:`ID: ${e.id}`,"data-test-id":"entry-id"},e.title||e.id||""),e.popoverData&&x.createElement(x.Fragment,null,x.createElement("button",{type:"button",ref:o,className:"ml-2 -my-1","aria-controls":"path-details",onClick:c},x.createElement(_,{className:"text-gray-700"})),x.createElement("div",{ref:a,className:`fixed bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 ${s?"visible":"invisible"}`},Object.entries(e.popoverData).map(([b,S],T)=>x.createElement("div",{className:"text-xs",key:T},x.createElement("span",{className:"font-bold mr-2"},b,":"),S))))),e.createdDate&&x.createElement("div",{className:"text-xs"},x.createElement("span",{className:"font-bold mr-2"},"Created:"),zr((v=e.createdDate)!=null?v:0)),x.createElement("div",{className:"flex gap-4"},e.metadata?Object.entries(e.metadata).filter(([b])=>["type","status"].includes(b.toLocaleLowerCase())).map(([b,S])=>x.createElement("span",{className:"text-sm",key:b},S)):null),e.metadata?Object.entries(e.metadata).filter(([b])=>!["type","status"].includes(b.toLocaleLowerCase())).map(([b,S])=>x.createElement("div",{className:"text-xs order-1",key:b},x.createElement("span",{className:"font-bold mr-2 order-1"},b,":"),S)):null),x.createElement("div",{className:"flex md:flex-row flex-col gap-2"},e.editLink?x.createElement("a",{href:e.editLink,title:"edit",rel:"noopener",target:"__blank",onClick:b=>{n&&(zt(b.currentTarget.href,()=>n(e)),b.preventDefault())},className:"flex justify-between items-center pl-4 pr-2 bg-white rounded border-2 border-gray-400 hover:bg-gray-100"},x.createElement("span",{className:"mr-2 text-sm"},"Edit"),y):null,x.createElement("button",{type:"button",onClick:b=>{b.preventDefault(),r(e)},className:"flex justify-between items-center px-4 bg-white rounded border-2 border-gray-400 h-10 hover:bg-gray-100"},x.createElement("span",{className:"mr-2 text-sm"},"Unlink"),x.createElement(ve,{className:"w-4 h-4 text-red-600"})))))};i();import L,{useState as $r,useRef as Ut,useEffect as Ur}from"react";var nt=({result:e,isSelected:t,triggerSelection:r})=>{let n=Ut(null),o=Ut(null),[a,s]=$r(!1);Ur(()=>{function c(m){n.current&&!n.current.contains(m.target)&&o.current&&!o.current.contains(m.target)&&s(!1)}return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[o]);let l=c=>{c.stopPropagation(),s(!a)};return L.createElement("div",{key:e.id,className:`p-2 cursor-pointer relative ${t?"bg-green-400 text-white":""}`,"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>r()},e.title,e.popoverData&&t?L.createElement(L.Fragment,null,L.createElement("button",{type:"button",ref:n,className:"absolute top-0 bottom-0 right-2","aria-controls":"path-details",onClick:c=>l(c)},L.createElement(_,null)),L.createElement("div",{ref:o,className:`absolute top-4 right-10 bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 text-black ${a?"visible":"invisible"}`},e.metadata&&Object.entries(e.metadata).map(([c,m],y)=>L.createElement("div",{className:"text-xs",key:y},L.createElement("span",{className:"font-bold mr-2"},c,":"),m)),Object.entries(e.popoverData).map(([c,m],y)=>L.createElement("div",{className:"text-xs",key:y},L.createElement("span",{className:"font-bold mr-2"},c,":"),m)))):null)};import{Droppable as Wr,DragDropContext as Yr,Draggable as Xr}from"react-beautiful-dnd";var Zr=({searchText:e,selectedContentType:t})=>{let r="No content found";return t&&(r=`No ${t} content was found`),e&&(r=`${r} for keyword '${e}'.`),h.createElement(qe,{type:"info"},r)},Jr=({search:e,results:t,contentTypes:r,selectedItems:n,logoIcon:o,select:a,multiSelect:s,multiSelectId:l,rowComponent:c,selectedItemComponent:m,totalResults:y,resultsLoading:v,requireContentType:b,onAddNew:S,onEditClosed:T,onCancel:pt,noResultsComponent:Vn,helpComponent:Dn,onSort:Le})=>{var St,kt,Et;let ht=()=>b?Array.isArray(r)&&r.length>0?r[0].id:"":"any",[gt,bt]=Z(""),[B,yt]=Z(ht),[ne,Te]=Z(!1),[re,oe]=Z([]),[In,vt]=Z(!1),ae=Hr(gt,750);jr(()=>{e(ae,{count:5,offset:0,contentType:B==="any"?void 0:B})},[ae,B]);let Gn=d=>{re.includes(d.id)?oe(w=>w.filter(R=>R!==d.id)):oe(s?w=>[...w,d==null?void 0:d.id]:[d.id])},Rn=()=>{yt(ht()),bt(""),oe((n==null?void 0:n.length)?n.map(d=>d.id):[])},An=()=>{Te(d=>!d),ne||Rn()},xt=d=>{a((n==null?void 0:n.filter(w=>w.id!==d.id).map(w=>w.id))||[],"")},Fn=d=>{d.preventDefault(),a(re,B),Te(!1)},zn=d=>{d.preventDefault(),Te(!1),pt&&pt()},$n=d=>{d.preventDefault(),e(ae,{count:5,offset:(t==null?void 0:t.length)||0,contentType:B==="any"?void 0:B}),vt(!0);let w=setTimeout(()=>{vt(!1)},750);return()=>clearTimeout(w)},wt=qr(Kr()),Un=!(n==null?void 0:n.length)||s,jn=c||nt,Ct=m||tt,qn=Vn||Zr,Mt=o&&typeof o!="string"?o:null,Hn=Mt?h.createElement(Mt,{className:"h-9 w-9"}):h.createElement("img",{src:o,alt:"CMS logo",className:"h-9 w-9"}),Kn=d=>{var w,R;if(d.destination&&d.source.droppableId===((w=d.destination)==null?void 0:w.droppableId)){let E=[...n||[]],[Oe]=(R=E==null?void 0:E.splice(d.source.index,1))!=null?R:[];return E==null||E.splice(d.destination.index,0,Oe),Le==null||Le(E.map(q=>q.id)),E}};return h.createElement("div",{className:"w-full"},h.createElement("div",{className:"relative my-4"},Un&&h.createElement("div",{className:"space-y-2"},h.createElement("div",{className:"py-3 px-2 bg-white rounded-lg border border-gray-300 mb-4","data-test-id":"component-search"},h.createElement("button",{className:"flex items-center w-full text-base relative",onClick:An,type:"button","aria-haspopup":!0,"aria-expanded":ne,"aria-controls":wt.current},Hn,h.createElement("span",{className:"ml-4"},"Select"),h.createElement("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},h.createElement(ye,{className:`w-5 h-5 text-standard transform transition-transform ${ne?"rotate-180":"rotate-0"}`})))),h.createElement("div",{className:`${ne?"block":"hidden"} py-3 px-4 space-y-4 bg-white rounded-lg border border-gray-300`},Dn||null,h.createElement("div",{className:"flex space-x-3"},h.createElement("select",{className:"uniform-input uniform-input-select w-1/3 bg-gray-100",onChange:d=>yt(d.target.value)},b?null:h.createElement("option",{value:"any",className:"bg-white text-primary"},"All content types"),r==null?void 0:r.map(d=>h.createElement("option",{value:d.id,key:d.id,className:"bg-white text-primary"},d.name))),h.createElement("div",{className:"flex-grow"},h.createElement(Ke,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:bt,disabledFieldSubmission:!0}))),h.createElement("div",{className:"overflow-y-scroll max-h-64 divide-y divide-gray-200 scrollbar",id:wt.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},(t==null?void 0:t.length)?t.map(d=>h.createElement(jn,{key:d.id,isSelected:re.includes(d.id),result:d,triggerSelection:()=>Gn(d)})):v?null:h.createElement(qn,{searchText:ae||gt,selectedContentType:(kt=(St=r==null?void 0:r.find(d=>d.id===B))==null?void 0:St.name)!=null?kt:B}),!v&&typeof y!="undefined"&&t&&(t==null?void 0:t.length)<y&&h.createElement("button",{className:"block p-4 text-center w-full hover:bg-gray-100 focus:bg-gray-100 font-bold text-primary text-sm focus:outline-none",onClick:$n},In?h.createElement(be,null):"Load More"),v&&!(t==null?void 0:t.length)?h.createElement("div",{className:"p-4 text-center w-full"},h.createElement(be,null)):null),h.createElement("div",{className:"flex justify-between"},h.createElement("div",null,S&&((Et=r==null?void 0:r.length)!=null?Et:0)>0?h.createElement(Xe,{menuLabel:"Add new menu",menuTrigger:h.createElement(H,{buttonType:"secondary"},"Add New")},r==null?void 0:r.map(d=>h.createElement(Ze,{key:d.id,className:"bg-white text-primary",onClick:()=>S(d)},d.name))):null),h.createElement("div",null,h.createElement(H,{buttonType:"unimportant",onClick:zn},"Cancel"),h.createElement(H,{className:"ml-5",disabled:!re.length,onClick:Fn,"data-test-id":"entry-accept-button"},"Accept"))))),s?h.createElement(Yr,{onDragEnd:d=>Kn(d)},h.createElement(Wr,{droppableId:l||"canvas-multi-select"},d=>h.createElement("div",{...d.droppableProps,ref:d.innerRef,className:"space-y-1"},n==null?void 0:n.map((w,R)=>{if(w==null?void 0:w.id)return h.createElement(Xr,{key:w.id,draggableId:w.id,index:R},(E,Oe)=>h.createElement("div",{className:"relative group",ref:E.innerRef,...E.draggableProps,...E.dragHandleProps},h.createElement("span",{className:`absolute left-0 top-0 bottom-0 my-auto flex items-center ${Oe.isDragging?"":"opacity-0 group-hover:opacity-30"}`},h.createElement(X,{className:"text-brand-secondary-1 absolute left-1.5",width:24,height:24}),h.createElement(X,{className:"text-brand-secondary-1",width:24,height:24})),h.createElement(Ct,{key:`selected-item-${w.id}`,logoIcon:o,selectedItem:w,onDeselect:q=>xt(q),onEditClosed:T?q=>T(q):void 0})))}),d.placeholder))):n==null?void 0:n.map(d=>h.createElement(Ct,{key:`selected-item-${d.id}`,logoIcon:o,selectedItem:d,onDeselect:w=>xt(w),onEditClosed:T?w=>T(w):void 0}))))};i();import P from"react";var Qr=({isActive:e,statusMessage:t})=>P.createElement("div",{className:`${e?"flex":"hidden"} absolute bottom-0 left-0 right-0 top-0 items-center justify-center overflow-hidden z-50`,style:{zIndex:9999}},P.createElement("div",{className:"absolute bottom-0 left-0 right-0 top-0 bg-white bg-opacity-50"}),P.createElement("div",{className:"relative"},P.createElement("div",{className:"flex flex-col items-center"},P.createElement(jt,{height:128,width:128}),t?P.createElement("div",{className:"mt-4 text-gray-500"},t):null))),jt=({height:e,width:t})=>P.createElement("svg",{"data-testid":"svg",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",width:t!=null?t:40,height:e!=null?e:40,className:"stroke-current"},P.createElement("g",{fill:"none",fillRule:"evenodd"},P.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},P.createElement("circle",{strokeOpacity:".25",cx:"18",cy:"18",r:"18"}),P.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18",transform:"rotate(166.645 18 18)"},P.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"0.8s",repeatCount:"indefinite"})))));O(k,_s);import*as _s from"@uniformdev/mesh-sdk";i();var qt={".uniform-input-container":{"@apply text-gray-700 relative":{}},".uniform-input-label":{"@apply text-primary mb-1 block font-bold leading-5":{}},".uniform-checkbox-label":{"@apply text-primary block font-bold leading-5":{}},".uniform-input":{"@apply bg-white border border-gray-500 text-gray-700 block w-full leading-5 rounded-md relative":{}},".uniform-input-disabled":{"@apply text-gray-300 cursor-not-allowed":{}},".uniform-input-text":{"@apply appearance-none p-4 block border-gray-500":{}},".uniform-input-text::placeholder":{"@apply text-gray-500":{}},".uniform-input:focus":{"@apply border-primary ring-primary outline-none":{}},".uniform-input-select":{"@apply bg-no-repeat pl-4 pr-10 py-4 block border-gray-500":{}},".uniform-input-checkbox":{"@apply align-middle flex-shrink-0 h-6 w-6 border-gray-500 rounded text-primary":{}},".uniform-input-checkbox:checked":{"@apply border-transparent":{}},".uniform-input-checkbox:checked:focus":{"@apply border-transparent":{}},".uniform-link-primary":{"@apply text-primary":{}},".uniform-link-secondary":{"@apply text-secondary":{}},".uniform-menu":{"@apply border rounded border-gray-500 outline-none":{}},".uniform-menu-item":{"@apply block rounded w-full text-left py-2 px-4 font-bold":{}},".uniform-menu-item:focus":{"@apply outline-none":{}},".uniform-menu-item:hover":{"@apply bg-gray-200":{}},".uniform-input-switch-container":{"@apply relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in":{}},".uniform-input-switch":{"@apply absolute block w-6 h-6 rounded-full bg-white border-2 appearance-none cursor-pointer transition transform translate-x-0":{}},".uniform-input-switch:checked":{"@apply translate-x-4 bg-green-500":{}},".uniform-input-switch-track":{"@apply block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer":{}},".uniform-input-switch-label":{"@apply text-primary font-bold leading-5":{}},".loader":{"@apply inline-flex justify-center":{}},".loader__dot":{"@apply bg-gray-700 block rounded-lg opacity-100 animate-bounce-fade":{},width:"8px",height:"8px",margin:"0 2px",transform:"translateY(0)"},".loader__dot:nth-child(1)":{"animation-delay":"0.15s"},".loader__dot:nth-child(2)":{"animation-delay":"0.3s"},".loader__dot:nth-child(3)":{"animation-delay":"0.6s"},"@supports ((scrollbar-color: #d1d5db transparent) and (scrollbar-width: thin))":{".scrollbar":{"scrollbar-color":"#d1d5db transparent","scrollbar-width":"thin"}},".scrollbar::-webkit-scrollbar":{width:"8px",height:"8px"},".scrollbar::-webkit-scrollbar-track":{"@apply bg-transparent rounded":{}},".scrollbar::-webkit-scrollbar-thumb":{"@apply bg-gray-300 rounded":{}},".scrollbar::-webkit-scrollbar-thumb:hover":{"@apply bg-gray-500":{}},".main-heading":{"@apply text-4xl font-extrabold text-primary":{}}};i();var g=Lt(On()),j={"brand-primary-1":"#438FD5","brand-primary-2":"#f4220b","brand-primary-3":"#83c6e1","brand-secondary-1":"#1f2b34","brand-secondary-2":"#ecf1f1","brand-secondary-3":"#2ecdb4","brand-secondary-4":"#005e3b","brand-secondary-5":"#f6f1c3","brand-secondary-6":"#d9534f","brand-secondary-7":"#dbf6f2"},Bn={fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"4rem"},extend:{colors:{current:g.current,transparent:g.transparent,gray:{50:g.gray["50"],100:"#f9f9f9",200:"#f1f1f1",300:"#E0E0E0",400:"#D3DBE1",500:"#BDBDBD",700:"#828282",800:"#2d3748"},white:g.white,primary:j["brand-secondary-1"],secondary:j["brand-secondary-6"],tertiary:j["brand-primary-3"],quaternary:j["brand-primary-1"],standard:j["brand-secondary-1"],red:{50:g.red["50"],400:g.red["400"],600:g.red["600"],700:g.red["700"],800:g.red["800"]},blue:{50:g.blue["50"],200:g.blue["200"],400:g.blue["400"],500:g.blue["500"],700:g.blue["700"],800:g.blue["800"]},green:{50:g.emerald["50"],300:g.emerald["300"],400:g.emerald["400"],500:"#3DCCB4",700:g.emerald["700"],800:g.emerald["800"]},yellow:{50:g.amber["50"],400:g.amber["400"],700:g.amber["700"],800:g.amber["800"]},black:g.black,...j},animation:{"bounce-fade":"bounce-fade 0.75s infinite ease-in-out"},keyframes:{"bounce-fade":{"0%":{},"100%":{opacity:1,transform:"translateY(0)"},"30%":{opacity:.6},"80%":{opacity:.4,transform:"translateY(-10px)"},"90%":{opacity:.2,transform:"translateY(-5px)"}}}}};var Js=(0,_n.default)(({config:e,addComponents:t})=>{let r=e("content");Bo(r);let n=e("safelist");_o(n),t(qt)},{theme:Bn});function Bo(e){e||(e={});let t=Oo.resolve(f,"../*.js");Array.isArray(e.files)?e.files.push(t):e.files=[t]}function _o(e){let t=Vo();Array.isArray(e)?e.push(...t):e=t}function Vo(){let e=[];return Object.keys(k).forEach(t=>{let r=k[t];Array.isArray(r.cssSafelistPatterns)&&e.push(...r.cssSafelistPatterns)}),e}export{Js as uniformMeshPlugin};
|
|
6
|
+
`);return a!==-1&&(t=Co(t,o,n,a)),n+t+o},lt,Sn=(e,...t)=>{let[r]=t;if(!Me(r)||!Me(r.raw))return t.join(" ");let n=t.slice(1),o=[r.raw[0]];for(let a=1;a<r.length;a++)o.push(String(n[a-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[a]));return lt===void 0&&(lt=yn()),lt(e,o.join(""))};Object.defineProperties(Se.prototype,U);var Ee=Se();Ee.supportsColor=ct;Ee.stderr=Se({level:ut?ut.level:0});Ee.stderr.supportsColor=ut;kn.exports=Ee});var Nn=M(ee=>{"use strict";i();Object.defineProperty(ee,"__esModule",{value:!0});ee.dim=Eo;ee.default=void 0;var Pe=ko(En());function ko(e){return e&&e.__esModule?e:{default:e}}var Pn=new Set;function ft(e,t,r){process.env.JEST_WORKER_ID===void 0&&(r&&Pn.has(r)||(r&&Pn.add(r),console.warn(""),t.forEach(n=>console.warn(e,"-",n))))}function Eo(e){return Pe.default.dim(e)}var Po={info(e,t){ft(Pe.default.bold.cyan("info"),...Array.isArray(e)?[e]:[t,e])},warn(e,t){ft(Pe.default.bold.yellow("warn"),...Array.isArray(e)?[e]:[t,e])},risk(e,t){ft(Pe.default.bold.magenta("risk"),...Array.isArray(e)?[e]:[t,e])}};ee.default=Po});var Ln=M(Ne=>{"use strict";i();Object.defineProperty(Ne,"__esModule",{value:!0});Ne.default=void 0;var No=Lo(Nn());function Lo(e){return e&&e.__esModule?e:{default:e}}function te({version:e,from:t,to:r}){No.default.warn(`${t}-color-renamed`,[`As of Tailwind CSS ${e}, \`${t}\` has been renamed to \`${r}\`.`,"Update your configuration file to silence this warning."])}var To={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},get lightBlue(){return te({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return te({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return te({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return te({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return te({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}};Ne.default=To});var On=M((Ks,Tn)=>{i();var mt=Ln();Tn.exports=(mt.__esModule?mt:{default:mt}).default});i();var _n=Lt(Vt());import Oo from"path";var k={};Nt(k,{Button:()=>H,Callout:()=>qe,CmsEntrySearch:()=>Jr,DefaultSearchRow:()=>nt,DefaultSelectedItem:()=>tt,Icons:()=>xe,Input:()=>pe,KeywordSearchInput:()=>Ke,LoadingIcon:()=>jt,LoadingIndicator:()=>be,LoadingOverlay:()=>Qr,Menu:()=>Xe,MenuContext:()=>We,MenuItem:()=>Ze,UniformMeshLocationContext:()=>_e,UniformMeshLocationContextProvider:()=>Ve,UniformMeshSdkContext:()=>Ie,UniformMeshSdkContextProvider:()=>xr,useInitializeUniformMeshSdk:()=>br,useMenuContext:()=>Ye,useUniformMeshLocation:()=>pr,useUniformMeshLocationContext:()=>De,useUniformMeshSdk:()=>wr,useUniformMeshSdkContext:()=>Ge});i();i();i();import ur,{createContext as dr,useContext as fr,useState as mr}from"react";var _e=dr(void 0),Ve=({children:e})=>{let[t,r]=mr(),n;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let o=t||window.UniformMeshSDK.getCurrentLocation();n={location:{getValue:o.getValue,getMetadata:o.getMetadata,setValue:async a=>{await o.setValue(a),r(window.UniformMeshSDK.getCurrentLocation())}}}}return ur.createElement(_e.Provider,{value:n},e)},De=()=>{let e=fr(_e);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function pr(){let{location:e}=De();return{value:e==null?void 0:e.getValue(),setValue:e==null?void 0:e.setValue,metadata:e==null?void 0:e.getMetadata()}}i();import{initializeUniformMeshSDK as hr}from"@uniformdev/mesh-sdk";import{useEffect as gr,useState as Dt}from"react";var br=({autoResizingDisabled:e}={})=>{let[t,r]=Dt(),[n,o]=Dt();return gr(()=>{typeof window=="undefined"||n||(typeof window.UniformMeshSDK=="undefined"?hr({autoResizingDisabled:e}).then(a=>{o(a)}).catch(a=>{r(a)}):o(window.UniformMeshSDK))},[e]),{initializing:!n&&!t,error:t,sdk:n}};i();i();import It,{createContext as yr,useContext as vr}from"react";var Ie=yr(void 0),xr=({children:e})=>{let t;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(t={sdk:window.UniformMeshSDK}),It.createElement(Ie.Provider,{value:t},It.createElement(Ve,null,e))},Ge=()=>{let e=vr(Ie);if(!e)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return e};function wr(){let{sdk:e}=Ge();return e}i();import Gt from"react";import{Button as Cr}from"reakit";var Re={primary:{default:"bg-primary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},secondary:{default:"bg-secondary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},tertiary:{default:"bg-tertiary text-white hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},quaternary:{default:"bg-primary text-white hover:bg-opacity-75 border-2 border-gray-500 active:bg-opacity-75 focus:ring",disabled:"bg-gray-500 text-white"},unimportant:{default:"bg-brand-secondary-2 text-primary hover:bg-opacity-75 border focus:border-gray-700 active:bg-opacity-75 focus:ring",disabled:"bg-brand-secondary-2 text-gray-600 cursor-not-allowed"}},Ae={base:"inline-flex items-center border-transparent font-medium focus:outline-none focus:ring",size:(e,t)=>({xs:`${t?"px-2.5 py-1.5 ":""}text-xs leading-4 ${e?"rounded":""}`,sm:`${t?"px-3 py-2 ":""}text-sm leading-4 ${e?"rounded-md":""}`,md:`${t?"px-4 py-2 ":""}text-sm leading-5 tracking-wider ${e?"rounded-md":""}`,lg:`${t?"px-4 py-2 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`,xl:`${t?"px-6 py-3 ":""}text-base leading-6 tracking-wider ${e?"rounded-md":""}`}),buttonType:(e,t)=>{if(!(!e||!Re[e]))return t?Re[e].disabled:Re[e].default}},H=Gt.forwardRef(({size:e="md",buttonType:t="primary",children:r,className:n,rounded:o=!1,disablePadding:a=!1,...s},l)=>{let c=[Ae.base,Ae.size(o,!a)[e],Ae.buttonType(t,s.disabled),n].join(" ");return Gt.createElement(Cr,{className:c,ref:l,...s},r)});i();import I from"react";i();import*as Fe from"react";var Mr=e=>Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...e},Fe.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})),ce=Mr;i();import*as ze from"react";var Sr=e=>ze.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},ze.createElement("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})),ue=Sr;i();import*as de from"react";var kr=e=>de.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},de.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11 10.98a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0v-6zm1-4.929a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}),de.createElement("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0z"})),_=kr;i();import*as $e from"react";var Er=e=>$e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e},$e.createElement("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})),fe=Er;i();import*as Ue from"react";var Pr=e=>Ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...e},Ue.createElement("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})),K=Pr;i();import*as je from"react";var Nr=e=>je.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},je.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 39.2A19.2 19.2 0 1 0 20 .8a19.2 19.2 0 0 0 0 38.4Zm8.897-22.303a2.4 2.4 0 0 0-3.394-3.394L17.6 21.407l-3.103-3.104a2.4 2.4 0 0 0-3.394 3.394l4.8 4.8a2.4 2.4 0 0 0 3.394 0l9.6-9.6Z"})),me=Nr;var Lr={caution:{icon:K,descriptionColor:"text-yellow-700",iconColor:"text-yellow-400",titleColor:"text-yellow-800",containerColor:"bg-yellow-50"},danger:{icon:ue,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},error:{icon:K,descriptionColor:"text-red-700",iconColor:"text-red-400",titleColor:"text-red-800",containerColor:"bg-red-50"},info:{icon:ce,descriptionColor:"text-blue-700",iconColor:"text-blue-400",titleColor:"text-blue-800",containerColor:"bg-blue-50"},note:{icon:_,descriptionColor:"text-gray-700",iconColor:"text-gray-400",titleColor:"text-gray-800",containerColor:"bg-gray-50"},success:{icon:me,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"},tip:{icon:fe,descriptionColor:"text-green-700",iconColor:"text-green-400",titleColor:"text-green-800",containerColor:"bg-green-50"}},qe=({type:e="info",title:t,children:r,className:n})=>{let o=Lr[e];if(!o)return null;let a=o.icon;return I.createElement("div",{"data-testid":"sdk-ui-callout",className:`rounded-md p-4 ${o.containerColor} ${n||""}`},I.createElement("div",{className:"flex"},I.createElement("div",{className:"flex-shrink-0"},I.createElement(a,{className:`h-5 w-5 ${o.iconColor}`})),I.createElement("div",{className:"ml-3"},t?I.createElement("h3",{className:`text-sm font-medium mb-2 ${o.titleColor}`},t):null,r?I.createElement("div",{className:`text-sm ${o.descriptionColor}`},r):null)))};i();i();import G from"react";import{Input as Tr}from"reakit";var pe=({classNameContainer:e,classNameControl:t,classNameLabel:r,label:n,icon:o,id:a,disabled:s,...l})=>{let c={container:`uniform-input-container ${e||""}`,control:`uniform-input uniform-input-text${s?" uniform-input-disabled":""}${o?" pr-10":""} ${t||""}`,label:`uniform-input-label ${r||""}`};return G.createElement(G.Fragment,null,n?G.createElement("label",{htmlFor:a,className:c.label},n):null,G.createElement("div",{className:c.container},G.createElement(Tr,{className:c.control,id:a,disabled:s,...l},m=>G.createElement("input",{...m,style:l.style})),o?G.createElement("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},o):null))};pe.displayName="Input";import He from"react";i();import*as V from"react";var Or=e=>V.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},V.createElement("g",{clipPath:"url(#magnifying-glass_svg__a)"},V.createElement("path",{d:"M11.539 0C5.484 0 .559 4.741.559 10.57c0 5.827 4.925 10.568 10.98 10.568 6.055 0 10.98-4.74 10.98-10.569C22.52 4.741 17.595 0 11.54 0Zm0 19.187c-4.937 0-8.954-3.866-8.954-8.618 0-4.752 4.017-8.618 8.954-8.618s8.954 3.866 8.954 8.618c0 4.752-4.017 8.618-8.954 8.618Z"}),V.createElement("path",{d:"m25.196 22.334-5.811-5.593a1.041 1.041 0 0 0-1.434 0 .95.95 0 0 0 0 1.38l5.812 5.593c.198.19.457.286.716.286.26 0 .519-.096.717-.286a.95.95 0 0 0 0-1.38Z"})),V.createElement("defs",null,V.createElement("clipPath",{id:"magnifying-glass_svg__a"},V.createElement("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),he=Or;function Ke({onSearchTextChanged:e,disabled:t=!1,placeholder:r="Keyword search",inputFieldName:n="keywordSearch",disabledFieldSubmission:o=!1}){return He.createElement(pe,{type:"text",name:n,placeholder:r,icon:He.createElement("div",{className:"pr-1"},He.createElement(he,{className:"w-5 h-5 text-primary"})),onChange:l=>{e==null||e(l.currentTarget.value)},onKeyPress:l=>{l.key==="Enter"&&o&&l.preventDefault()},className:"uniform-input uniform-input-text pr-12 bg-gray-100",disabled:t,"aria-label":r})}i();import ge from"react";var be=()=>ge.createElement("span",{className:"loader",role:"presentation"},ge.createElement("i",{className:"loader__dot"}),ge.createElement("i",{className:"loader__dot"}),ge.createElement("i",{className:"loader__dot"}));i();import A from"react";import{useMenuState as Br,Menu as _r,MenuButton as Vr}from"reakit/Menu";var We=A.createContext({}),Ye=()=>A.useContext(We),Xe=({menuLabel:e,menuTrigger:t,menuItemsContainerCssClasses:r,placement:n="auto",children:o})=>{let a=Br();return A.createElement(We.Provider,{value:a},A.createElement(Vr,{...a,ref:t.ref,...t.props},s=>A.cloneElement(t,s)),A.createElement(_r,{...a,placement:n,"aria-label":e,className:`uniform-menu divide-y divide-gray-500 shadow-xl z-50 ${r}`},o))};i();import W from"react";import{MenuItem as Rt}from"reakit";var Ze=({children:e,className:t,hideMenuOnClick:r=!0,icon:n,...o})=>{let a=Ye(),s=`uniform-menu-item bg-white ${(o==null?void 0:o.disabled)?"text-gray-500":"text-primary"} ${t||""}`,l=m=>{let y={...m};if(y.onClick){let v=y.onClick;y.onClick=b=>{a.hide(),v(b)}}return y};if(typeof e=="function")return W.createElement(Rt,{...a,...o,className:s},m=>{let y=r?l(m):m,v=e(y);return n?At(v,n):v});let c=r?l(o):o;return W.createElement(Rt,{...a,...c,className:s},n?At(e,n):e)};function At(e,t){return W.createElement("div",{className:"flex items-center justify-between"},W.createElement("div",null,e),W.createElement("div",{className:"ml-4"},t))}i();import h,{useState as Z,useEffect as jr,useRef as qr}from"react";var xe={};Nt(xe,{Caution:()=>K,Checkmark:()=>me,ChevronDown:()=>ye,Close:()=>ve,Danger:()=>ue,ExclamationPoint:()=>ce,Info:()=>_,Lightbulb:()=>fe,MagnifyingGlass:()=>he,MaximizeAlt:()=>Ft,MoreVerticalAlt:()=>X});i();i();import*as Je from"react";var Dr=e=>Je.createElement("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e},Je.createElement("path",{d:"M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414Z"})),ye=Dr;i();import*as Y from"react";var Ir=e=>Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e},Y.createElement("g",{fillRule:"evenodd"},Y.createElement("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),Y.createElement("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"}))),ve=Ir;i();import*as Qe from"react";var Gr=e=>Qe.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},Qe.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M3 3h6v2H6.462l4.843 4.843-1.415 1.414L5 6.367V9H3V3zm0 18h6v-2H6.376l4.929-4.928-1.415-1.414L5 17.548V15H3v6zm12 0h6v-6h-2v2.524l-4.867-4.866-1.414 1.414L17.647 19H15v2zm6-18h-6v2h2.562l-4.843 4.843 1.414 1.414L19 6.39V9h2V3z"})),Ft=Gr;i();import*as et from"react";var Rr=e=>et.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},et.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M14 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})),X=Rr;import{useThrottle as Hr}from"react-use";import{v4 as Kr}from"uuid";i();import x,{useState as Ar,useRef as $t,useEffect as Fr}from"react";i();function zt(e,t){let r=window.open(e,"_blank"),n=setInterval(()=>{(r==null?void 0:r.closed)&&(clearInterval(n),t())},500)}import{format as zr}from"timeago.js";var tt=({selectedItem:e,logoIcon:t,onDeselect:r,onEditClosed:n})=>{var v;let o=$t(null),a=$t(null),[s,l]=Ar(!1);Fr(()=>{let b=T=>{o.current&&!o.current.contains(T.target)&&a.current&&!a.current.contains(T.target)&&l(!1)},S=()=>{l(!1)};return window.addEventListener("resize",S,!0),document.addEventListener("scroll",b,!0),document.addEventListener("mousedown",b),()=>{window.removeEventListener("resize",S,!0),document.removeEventListener("scroll",b,!0),document.removeEventListener("mousedown",b)}},[a]);let c=()=>{var b;if(l(!s),a.current&&o.current){let S=(b=o==null?void 0:o.current)==null?void 0:b.getBoundingClientRect();a.current.style.top=`${S.top+30}px`}},m=t&&typeof t!="string"?t:null,y=m?x.createElement(m,{className:"h-7 w-7"}):x.createElement("img",{src:t,alt:"CMS logo",className:"h-7 w-7"});return x.createElement("div",{className:"flex w-full border border-gray-300 rounded-md bg-gray-100",key:e.id},x.createElement("div",{className:"p-4 pl-8 flex flex-grow mr-2 gap-2 items-center relative"},x.createElement("div",{className:"flex-grow"},x.createElement("div",{className:"inline-flex relative items-start"},x.createElement("h4",{className:"text-primary font-bold leading-none mb-2",title:`ID: ${e.id}`,"data-test-id":"entry-id"},e.title||e.id||""),e.popoverData&&x.createElement(x.Fragment,null,x.createElement("button",{type:"button",ref:o,className:"ml-2 -my-1","aria-controls":"path-details",onClick:c},x.createElement(_,{className:"text-gray-700"})),x.createElement("div",{ref:a,className:`fixed bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 ${s?"visible":"invisible"}`},Object.entries(e.popoverData).map(([b,S],T)=>x.createElement("div",{className:"text-xs",key:T},x.createElement("span",{className:"font-bold mr-2"},b,":"),S))))),e.createdDate&&x.createElement("div",{className:"text-xs"},x.createElement("span",{className:"font-bold mr-2"},"Created:"),zr((v=e.createdDate)!=null?v:0)),x.createElement("div",{className:"flex gap-4"},e.metadata?Object.entries(e.metadata).filter(([b])=>["type","status"].includes(b.toLocaleLowerCase())).map(([b,S])=>x.createElement("span",{className:"text-sm",key:b},S)):null),e.metadata?Object.entries(e.metadata).filter(([b])=>!["type","status"].includes(b.toLocaleLowerCase())).map(([b,S])=>x.createElement("div",{className:"text-xs order-1",key:b},x.createElement("span",{className:"font-bold mr-2 order-1"},b,":"),S)):null),x.createElement("div",{className:"flex md:flex-row flex-col gap-2"},e.editLink?x.createElement("a",{href:e.editLink,title:"edit",rel:"noopener",target:"__blank",onClick:b=>{n&&(zt(b.currentTarget.href,()=>n(e)),b.preventDefault())},className:"flex justify-between items-center pl-4 pr-2 bg-white rounded border-2 border-gray-400 hover:bg-gray-100"},x.createElement("span",{className:"mr-2 text-sm"},"Edit"),y):null,x.createElement("button",{type:"button",onClick:b=>{b.preventDefault(),r(e)},className:"flex justify-between items-center px-4 bg-white rounded border-2 border-gray-400 h-10 hover:bg-gray-100"},x.createElement("span",{className:"mr-2 text-sm"},"Unlink"),x.createElement(ve,{className:"w-4 h-4 text-red-600"})))))};i();import L,{useState as $r,useRef as Ut,useEffect as Ur}from"react";var nt=({result:e,isSelected:t,triggerSelection:r})=>{let n=Ut(null),o=Ut(null),[a,s]=$r(!1);Ur(()=>{function c(m){n.current&&!n.current.contains(m.target)&&o.current&&!o.current.contains(m.target)&&s(!1)}return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[o]);let l=c=>{c.stopPropagation(),s(!a)};return L.createElement("div",{key:e.id,className:`p-2 cursor-pointer relative ${t?"bg-green-400 text-white":""}`,"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>r()},e.title,e.popoverData&&t?L.createElement(L.Fragment,null,L.createElement("button",{type:"button",ref:n,className:"absolute top-0 bottom-0 right-2","aria-controls":"path-details",onClick:c=>l(c)},L.createElement(_,null)),L.createElement("div",{ref:o,className:`absolute top-4 right-10 bg-white p-4 rounded shadow-md border-l-4 border-green-500 w-max z-10 text-black ${a?"visible":"invisible"}`},e.metadata&&Object.entries(e.metadata).map(([c,m],y)=>L.createElement("div",{className:"text-xs",key:y},L.createElement("span",{className:"font-bold mr-2"},c,":"),m)),Object.entries(e.popoverData).map(([c,m],y)=>L.createElement("div",{className:"text-xs",key:y},L.createElement("span",{className:"font-bold mr-2"},c,":"),m)))):null)};import{Droppable as Wr,DragDropContext as Yr,Draggable as Xr}from"react-beautiful-dnd";var Zr=({searchText:e,selectedContentType:t})=>{let r="No content found";return t&&(r=`No ${t} content was found`),e&&(r=`${r} for keyword '${e}'.`),h.createElement(qe,{type:"info"},r)},Jr=({search:e,results:t,contentTypes:r,selectedItems:n,logoIcon:o,select:a,multiSelect:s,multiSelectId:l,rowComponent:c,selectedItemComponent:m,totalResults:y,resultsLoading:v,requireContentType:b,onAddNew:S,onEditClosed:T,onCancel:pt,noResultsComponent:Vn,helpComponent:Dn,onSort:Le})=>{var St,kt,Et;let ht=()=>b?Array.isArray(r)&&r.length>0?r[0].id:"":"any",[gt,bt]=Z(""),[B,yt]=Z(ht),[ne,Te]=Z(!1),[re,oe]=Z([]),[In,vt]=Z(!1),ae=Hr(gt,750);jr(()=>{e(ae,{count:5,offset:0,contentType:B==="any"?void 0:B})},[ae,B]);let Gn=d=>{re.includes(d.id)?oe(w=>w.filter(R=>R!==d.id)):oe(s?w=>[...w,d==null?void 0:d.id]:[d.id])},Rn=()=>{yt(ht()),bt(""),oe((n==null?void 0:n.length)?n.map(d=>d.id):[])},An=()=>{Te(d=>!d),ne||Rn()},xt=d=>{a((n==null?void 0:n.filter(w=>w.id!==d.id).map(w=>w.id))||[],"")},Fn=d=>{d.preventDefault(),a(re,B),Te(!1)},zn=d=>{d.preventDefault(),Te(!1),pt&&pt()},$n=d=>{d.preventDefault(),e(ae,{count:5,offset:(t==null?void 0:t.length)||0,contentType:B==="any"?void 0:B}),vt(!0);let w=setTimeout(()=>{vt(!1)},750);return()=>clearTimeout(w)},wt=qr(Kr()),Un=!(n==null?void 0:n.length)||s,jn=c||nt,Ct=m||tt,qn=Vn||Zr,Mt=o&&typeof o!="string"?o:null,Hn=Mt?h.createElement(Mt,{className:"h-9 w-9"}):h.createElement("img",{src:o,alt:"CMS logo",className:"h-9 w-9"}),Kn=d=>{var w,R;if(d.destination&&d.source.droppableId===((w=d.destination)==null?void 0:w.droppableId)){let E=[...n||[]],[Oe]=(R=E==null?void 0:E.splice(d.source.index,1))!=null?R:[];return E==null||E.splice(d.destination.index,0,Oe),Le==null||Le(E.map(q=>q.id)),E}};return h.createElement("div",{className:"w-full"},h.createElement("div",{className:"relative my-4"},Un&&h.createElement("div",{className:"space-y-2"},h.createElement("div",{className:"py-3 px-2 bg-white rounded-lg border border-gray-300 mb-4","data-test-id":"component-search"},h.createElement("button",{className:"flex items-center w-full text-base relative",onClick:An,type:"button","aria-haspopup":!0,"aria-expanded":ne,"aria-controls":wt.current},Hn,h.createElement("span",{className:"ml-4"},"Select"),h.createElement("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},h.createElement(ye,{className:`w-5 h-5 text-standard transform transition-transform ${ne?"rotate-180":"rotate-0"}`})))),h.createElement("div",{className:`${ne?"block":"hidden"} py-3 px-4 space-y-4 bg-white rounded-lg border border-gray-300`},Dn||null,h.createElement("div",{className:"flex space-x-3"},h.createElement("select",{className:"uniform-input uniform-input-select w-1/3 bg-gray-100",onChange:d=>yt(d.target.value)},b?null:h.createElement("option",{value:"any",className:"bg-white text-primary"},"All content types"),r==null?void 0:r.map(d=>h.createElement("option",{value:d.id,key:d.id,className:"bg-white text-primary"},d.name))),h.createElement("div",{className:"flex-grow"},h.createElement(Ke,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:bt,disabledFieldSubmission:!0}))),h.createElement("div",{className:"overflow-y-scroll max-h-64 divide-y divide-gray-200 scrollbar",id:wt.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},(t==null?void 0:t.length)?t.map(d=>h.createElement(jn,{key:d.id,isSelected:re.includes(d.id),result:d,triggerSelection:()=>Gn(d)})):v?null:h.createElement(qn,{searchText:ae||gt,selectedContentType:(kt=(St=r==null?void 0:r.find(d=>d.id===B))==null?void 0:St.name)!=null?kt:B}),!v&&typeof y!="undefined"&&t&&(t==null?void 0:t.length)<y&&h.createElement("button",{className:"block p-4 text-center w-full hover:bg-gray-100 focus:bg-gray-100 font-bold text-primary text-sm focus:outline-none",onClick:$n},In?h.createElement(be,null):"Load More"),v&&!(t==null?void 0:t.length)?h.createElement("div",{className:"p-4 text-center w-full"},h.createElement(be,null)):null),h.createElement("div",{className:"flex justify-between"},h.createElement("div",null,S&&((Et=r==null?void 0:r.length)!=null?Et:0)>0?h.createElement(Xe,{menuLabel:"Add new menu",menuTrigger:h.createElement(H,{buttonType:"secondary"},"Add New")},r==null?void 0:r.map(d=>h.createElement(Ze,{key:d.id,className:"bg-white text-primary",onClick:()=>S(d)},d.name))):null),h.createElement("div",null,h.createElement(H,{buttonType:"unimportant",onClick:zn},"Cancel"),h.createElement(H,{className:"ml-5",disabled:!re.length,onClick:Fn,"data-test-id":"entry-accept-button"},"Accept"))))),s?h.createElement(Yr,{onDragEnd:d=>Kn(d)},h.createElement(Wr,{droppableId:l||"canvas-multi-select"},d=>h.createElement("div",{...d.droppableProps,ref:d.innerRef,className:"space-y-1"},n==null?void 0:n.map((w,R)=>{if(w==null?void 0:w.id)return h.createElement(Xr,{key:w.id,draggableId:w.id,index:R},(E,Oe)=>h.createElement("div",{className:"relative group",ref:E.innerRef,...E.draggableProps,...E.dragHandleProps},h.createElement("span",{className:`absolute left-0 top-0 bottom-0 my-auto flex items-center ${Oe.isDragging?"":"opacity-0 group-hover:opacity-30"}`},h.createElement(X,{className:"text-brand-secondary-1 absolute left-1.5",width:24,height:24}),h.createElement(X,{className:"text-brand-secondary-1",width:24,height:24})),h.createElement(Ct,{key:`selected-item-${w.id}`,logoIcon:o,selectedItem:w,onDeselect:q=>xt(q),onEditClosed:T?q=>T(q):void 0})))}),d.placeholder))):n==null?void 0:n.map(d=>h.createElement(Ct,{key:`selected-item-${d.id}`,logoIcon:o,selectedItem:d,onDeselect:w=>xt(w),onEditClosed:T?w=>T(w):void 0}))))};i();import P from"react";var Qr=({isActive:e,statusMessage:t})=>P.createElement("div",{className:`${e?"flex":"hidden"} absolute bottom-0 left-0 right-0 top-0 items-center justify-center overflow-hidden z-50`,style:{zIndex:9999}},P.createElement("div",{className:"absolute bottom-0 left-0 right-0 top-0 bg-white bg-opacity-50"}),P.createElement("div",{className:"relative"},P.createElement("div",{className:"flex flex-col items-center"},P.createElement(jt,{height:128,width:128}),t?P.createElement("div",{className:"mt-4 text-gray-500"},t):null))),jt=({height:e,width:t})=>P.createElement("svg",{"data-testid":"svg",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",width:t!=null?t:40,height:e!=null?e:40,className:"stroke-current"},P.createElement("g",{fill:"none",fillRule:"evenodd"},P.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},P.createElement("circle",{strokeOpacity:".25",cx:"18",cy:"18",r:"18"}),P.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18",transform:"rotate(166.645 18 18)"},P.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"0.8s",repeatCount:"indefinite"})))));O(k,_s);import*as _s from"@uniformdev/mesh-sdk";i();var qt={".uniform-input-container":{"@apply text-gray-700 relative":{}},".uniform-input-label":{"@apply text-primary mb-1 block font-bold leading-5":{}},".uniform-checkbox-label":{"@apply text-primary block font-bold leading-5":{}},".uniform-input":{"@apply bg-white border border-gray-500 text-gray-700 block w-full leading-5 rounded-md relative":{}},".uniform-input-disabled":{"@apply text-gray-300 cursor-not-allowed":{}},".uniform-input-text":{"@apply appearance-none p-4 block border-gray-500":{}},".uniform-input-text::placeholder":{"@apply text-gray-500":{}},".uniform-input:focus":{"@apply border-primary ring-primary outline-none":{}},".uniform-input-select":{"@apply bg-no-repeat pl-4 pr-10 py-4 block border-gray-500":{}},".uniform-input-checkbox":{"@apply align-middle flex-shrink-0 h-6 w-6 border-gray-500 rounded text-primary":{}},".uniform-input-checkbox:checked":{"@apply border-transparent":{}},".uniform-input-checkbox:checked:focus":{"@apply border-transparent":{}},".uniform-link-primary":{"@apply text-primary":{}},".uniform-link-secondary":{"@apply text-secondary":{}},".uniform-menu":{"@apply border rounded border-gray-500 outline-none":{}},".uniform-menu-item":{"@apply block rounded w-full text-left py-2 px-4 font-bold":{}},".uniform-menu-item:focus":{"@apply outline-none":{}},".uniform-menu-item:hover":{"@apply bg-gray-200":{}},".uniform-input-switch-container":{"@apply relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in":{}},".uniform-input-switch":{"@apply absolute block w-6 h-6 rounded-full bg-white border-2 appearance-none cursor-pointer transition transform translate-x-0":{}},".uniform-input-switch:checked":{"@apply translate-x-4 bg-green-500":{}},".uniform-input-switch-track":{"@apply block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer":{}},".uniform-input-switch-label":{"@apply text-primary font-bold leading-5":{}},".loader":{"@apply inline-flex justify-center":{}},".loader__dot":{"@apply bg-gray-700 block rounded-lg opacity-100 animate-bounce-fade":{},width:"8px",height:"8px",margin:"0 2px",transform:"translateY(0)"},".loader__dot:nth-child(1)":{"animation-delay":"0.15s"},".loader__dot:nth-child(2)":{"animation-delay":"0.3s"},".loader__dot:nth-child(3)":{"animation-delay":"0.6s"},"@supports ((scrollbar-color: #d1d5db transparent) and (scrollbar-width: thin))":{".scrollbar":{"scrollbar-color":"#d1d5db transparent","scrollbar-width":"thin"}},".scrollbar::-webkit-scrollbar":{width:"8px",height:"8px"},".scrollbar::-webkit-scrollbar-track":{"@apply bg-transparent rounded":{}},".scrollbar::-webkit-scrollbar-thumb":{"@apply bg-gray-300 rounded":{}},".scrollbar::-webkit-scrollbar-thumb:hover":{"@apply bg-gray-500":{}},".main-heading":{"@apply text-4xl font-extrabold text-primary":{}}};i();var g=Lt(On()),j={"brand-primary-1":"#438FD5","brand-primary-2":"#f4220b","brand-primary-3":"#83c6e1","brand-secondary-1":"#1f2b34","brand-secondary-2":"#ecf1f1","brand-secondary-3":"#2ecdb4","brand-secondary-4":"#005e3b","brand-secondary-5":"#f6f1c3","brand-secondary-6":"#d9534f","brand-secondary-7":"#dbf6f2"},Bn={fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"4rem"},extend:{colors:{current:g.current,transparent:g.transparent,gray:{50:g.gray["50"],100:"#f9f9f9",200:"#f1f1f1",300:"#E0E0E0",400:"#D3DBE1",500:"#BDBDBD",700:"#828282",800:"#2d3748"},white:g.white,primary:j["brand-secondary-1"],secondary:j["brand-secondary-6"],tertiary:j["brand-primary-3"],quaternary:j["brand-primary-1"],standard:j["brand-secondary-1"],red:{50:g.red["50"],400:g.red["400"],600:g.red["600"],700:g.red["700"],800:g.red["800"]},blue:{50:g.blue["50"],200:g.blue["200"],400:g.blue["400"],500:g.blue["500"],700:g.blue["700"],800:g.blue["800"]},green:{50:g.emerald["50"],300:g.emerald["300"],400:g.emerald["400"],500:"#3DCCB4",700:g.emerald["700"],800:g.emerald["800"]},yellow:{50:g.amber["50"],400:g.amber["400"],700:g.amber["700"],800:g.amber["800"]},black:g.black,...j},animation:{"bounce-fade":"bounce-fade 0.75s infinite ease-in-out"},keyframes:{"bounce-fade":{"0%":{},"100%":{opacity:1,transform:"translateY(0)"},"30%":{opacity:.6},"80%":{opacity:.4,transform:"translateY(-10px)"},"90%":{opacity:.2,transform:"translateY(-5px)"}}}}};var Js=(0,_n.default)(({config:e,addComponents:t})=>{let r=e("content");Bo(r);let n=e("safelist");_o(n),t(qt)},{theme:Bn});function Bo(e){e||(e={});let t=Oo.resolve(f,"../*.js");Array.isArray(e.files)?e.files.push(t):e.files=[t]}function _o(e){let t=Vo();Array.isArray(e)?e.push(...t):e=t}function Vo(){let e=[];return Object.keys(k).forEach(t=>{let r=k[t];Array.isArray(r.cssSafelistPatterns)&&e.push(...r.cssSafelistPatterns)}),e}export{Js as uniformMeshPlugin};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/mesh-sdk-react",
|
|
3
|
-
"version": "12.2.1-alpha.
|
|
3
|
+
"version": "12.2.1-alpha.184+70191f06",
|
|
4
4
|
"description": "Uniform Mesh Framework SDK for React",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"storybook:publish": "yarn build && yarn build-storybook -o ./out"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@uniformdev/mesh-sdk": "^12.2.1-alpha.
|
|
50
|
+
"@uniformdev/mesh-sdk": "^12.2.1-alpha.184+70191f06",
|
|
51
51
|
"react-beautiful-dnd": "13.1.0",
|
|
52
52
|
"react-use": "17.3.2",
|
|
53
53
|
"reakit": "1.3.11",
|
|
@@ -58,17 +58,17 @@
|
|
|
58
58
|
"react": ">=16.8"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@storybook/addon-controls": "6.4.
|
|
62
|
-
"@storybook/addon-essentials": "6.4.
|
|
61
|
+
"@storybook/addon-controls": "6.4.19",
|
|
62
|
+
"@storybook/addon-essentials": "6.4.19",
|
|
63
63
|
"@storybook/addon-postcss": "2.0.0",
|
|
64
|
-
"@storybook/react": "6.4.
|
|
64
|
+
"@storybook/react": "6.4.19",
|
|
65
65
|
"@svgr/cli": "6.2.1",
|
|
66
66
|
"@tailwindcss/forms": "0.4.0",
|
|
67
|
-
"@types/jest": "27.4.
|
|
68
|
-
"@types/node": "16.11.
|
|
67
|
+
"@types/jest": "27.4.1",
|
|
68
|
+
"@types/node": "16.11.25",
|
|
69
69
|
"@types/react-beautiful-dnd": "13.1.2",
|
|
70
70
|
"autoprefixer": "10.4.2",
|
|
71
|
-
"eslint": "8.
|
|
71
|
+
"eslint": "8.9.0",
|
|
72
72
|
"eslint-plugin-react": "7.28.0",
|
|
73
73
|
"eslint-plugin-react-hooks": "4.3.0",
|
|
74
74
|
"jest": "27.5.1",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"postcss-import": "14.0.2",
|
|
78
78
|
"react": "17.0.2",
|
|
79
79
|
"rimraf": "3.0.2",
|
|
80
|
-
"tailwindcss": "3.0.
|
|
80
|
+
"tailwindcss": "3.0.23",
|
|
81
81
|
"ts-jest": "27.1.3",
|
|
82
82
|
"tsup": "5.11.13"
|
|
83
83
|
},
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"publishConfig": {
|
|
88
88
|
"access": "public"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "70191f06d59e536ded0bf3dc451400d59fa8bcad"
|
|
91
91
|
}
|