@uniformdev/mesh-sdk-react
Advanced tools
Comparing version 14.0.0 to 14.0.1-alpha.94
import * as _uniformdev_mesh_sdk from '@uniformdev/mesh-sdk'; | ||
import { UniformMeshSDK, MeshLocation } from '@uniformdev/mesh-sdk'; | ||
export * from '@uniformdev/mesh-sdk'; | ||
import React from 'react'; | ||
import React, { ReactNode, SVGProps } from 'react'; | ||
import { ButtonProps as ButtonProps$1 } from 'reakit/Button'; | ||
import { MenuHTMLProps, MenuProps as MenuProps$1, MenuStateReturn } from 'reakit/Menu'; | ||
import { MenuItemHTMLProps } from 'reakit'; | ||
import { InputProps as InputProps$1 } from 'reakit/Input'; | ||
import { TDate } from 'timeago.js'; | ||
@@ -35,12 +40,125 @@ /** | ||
interface UniformMeshSdkContextValue { | ||
sdk: UniformMeshSDK; | ||
interface ButtonProps extends ButtonProps$1 { | ||
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; | ||
buttonType?: 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'unimportant'; | ||
disablePadding?: boolean; | ||
rounded?: boolean; | ||
} | ||
declare const UniformMeshSdkContext: React.Context<UniformMeshSdkContextValue | undefined>; | ||
declare const UniformMeshSdkContextProvider: React.FC; | ||
/** | ||
* Provides access to the current (initialized) Uniform Mesh SDK context value. | ||
*/ | ||
declare const useUniformMeshSdkContext: () => UniformMeshSdkContextValue; | ||
declare const Button: React.FC<ButtonProps>; | ||
declare type CalloutType = 'caution' | 'danger' | 'info' | 'note' | 'success' | 'tip' | 'error'; | ||
interface CalloutProps { | ||
type: CalloutType; | ||
title?: ReactNode; | ||
children: ReactNode; | ||
className?: string; | ||
} | ||
declare const Callout: React.FC<CalloutProps>; | ||
interface KeywordSearchInputProps { | ||
onSearchTextChanged: (searchText: string) => void; | ||
disabled?: boolean; | ||
placeholder?: string; | ||
inputFieldName?: string; | ||
disabledFieldSubmission?: boolean; | ||
} | ||
declare function KeywordSearchInput({ onSearchTextChanged, disabled, placeholder, inputFieldName, disabledFieldSubmission, }: KeywordSearchInputProps): React.ReactElement; | ||
declare const LoadingIndicator: () => JSX.Element; | ||
interface MenuProps extends MenuHTMLProps { | ||
menuTrigger: React.ReactElement & React.RefAttributes<any>; | ||
menuLabel: string; | ||
menuItemsContainerCssClasses?: string; | ||
placement?: MenuProps$1['placement']; | ||
} | ||
declare const MenuContext: React.Context<MenuStateReturn>; | ||
declare const useMenuContext: () => MenuStateReturn; | ||
declare const Menu: React.FC<MenuProps>; | ||
declare type MenuItemProps = MenuItemHTMLProps & { | ||
focusable?: boolean; | ||
children: ChildFunction | React.ReactNode; | ||
hideMenuOnClick?: boolean; | ||
icon?: React.ReactElement; | ||
}; | ||
declare type ChildFunction = (menuItemProps: MenuItemHTMLProps) => React.ReactElement | null; | ||
declare const MenuItem: React.FC<MenuItemProps>; | ||
declare type InputProps = InputProps$1 & { | ||
label?: string; | ||
classNameContainer?: string; | ||
classNameControl?: string; | ||
classNameLabel?: string; | ||
icon?: React.ReactElement; | ||
capture?: boolean | 'user' | 'environment'; | ||
}; | ||
declare const Input: React.FC<InputProps>; | ||
interface CmsEntrySearchSelectedItemProps<TResult extends CmsEntrySearchResult = CmsEntrySearchResult> { | ||
selectedItem: TResult; | ||
logoIcon: string | React.ComponentType<{ | ||
className?: string; | ||
}>; | ||
onDeselect: (item: TResult) => void; | ||
onEditClosed?: (item: TResult) => void; | ||
} | ||
declare const DefaultSelectedItem: React.FC<CmsEntrySearchSelectedItemProps>; | ||
interface CmsEntrySearchRowProps<TResult extends CmsEntrySearchResult = CmsEntrySearchResult> { | ||
result: TResult; | ||
isSelected: boolean; | ||
triggerSelection: () => void; | ||
} | ||
declare const DefaultSearchRow: React.FC<CmsEntrySearchRowProps>; | ||
declare type CmsEntrySearchQueryOptions = { | ||
count: number; | ||
offset: number; | ||
contentType?: string; | ||
}; | ||
declare type CmsEntrySearchProps<TResult extends CmsEntrySearchResult = CmsEntrySearchResult> = { | ||
search: (text: string, options: CmsEntrySearchQueryOptions) => void; | ||
results: TResult[] | undefined; | ||
totalResults?: number | undefined; | ||
contentTypes?: CmsEntrySearchContentType[]; | ||
selectedItems: TResult[] | undefined; | ||
logoIcon: string | React.ComponentType<{ | ||
className?: string; | ||
}>; | ||
select: (id: string[], contentType?: string) => void; | ||
requireContentType?: boolean; | ||
multiSelectId?: string; | ||
multiSelect?: boolean; | ||
rowComponent?: React.FC<CmsEntrySearchRowProps<TResult>>; | ||
selectedItemComponent?: React.FC<CmsEntrySearchSelectedItemProps<TResult>>; | ||
onAddNew?: (type: CmsEntrySearchContentType) => void; | ||
onEditClosed?: (item: CmsEntrySearchResult) => void; | ||
onCancel?: () => void; | ||
resultsLoading?: boolean; | ||
noResultsComponent?: React.FC<{ | ||
searchText?: string; | ||
selectedContentType?: string; | ||
}>; | ||
helpComponent?: JSX.Element; | ||
onSort?: (ids: string[]) => void; | ||
}; | ||
interface CmsEntrySearchResult { | ||
id: string; | ||
title: string | JSX.Element; | ||
createdDate?: TDate; | ||
editLink?: string; | ||
metadata?: Record<string, string | JSX.Element>; | ||
popoverData?: Record<string, string | JSX.Element>; | ||
} | ||
interface CmsEntrySearchContentType { | ||
id: string; | ||
name: string; | ||
} | ||
interface NoResultsProps { | ||
searchText: string | undefined; | ||
selectedContentType: string | undefined; | ||
} | ||
declare const CmsEntrySearch: <TResult extends CmsEntrySearchResult>({ search, results, contentTypes, selectedItems, logoIcon, select, multiSelect, multiSelectId, rowComponent, selectedItemComponent, totalResults, resultsLoading, requireContentType, onAddNew, onEditClosed, onCancel, noResultsComponent, helpComponent, onSort, }: CmsEntrySearchProps<TResult>) => JSX.Element; | ||
interface UniformMeshLocationContextValue<TLocationValue = unknown, TLocationMetadata = unknown> { | ||
@@ -56,2 +174,58 @@ location: MeshLocation<TLocationValue, TLocationMetadata>; | ||
export { UniformMeshLocationContext, UniformMeshLocationContextProvider, UniformMeshLocationContextValue, UniformMeshSdkContext, UniformMeshSdkContextProvider, UniformMeshSdkContextValue, UseUniformMeshSdkOptions, useInitializeUniformMeshSdk, useUniformMeshLocation, useUniformMeshLocationContext, useUniformMeshSdk, useUniformMeshSdkContext }; | ||
interface UniformMeshSdkContextValue { | ||
sdk: UniformMeshSDK; | ||
} | ||
declare const UniformMeshSdkContext: React.Context<UniformMeshSdkContextValue | undefined>; | ||
declare const UniformMeshSdkContextProvider: React.FC; | ||
/** | ||
* Provides access to the current (initialized) Uniform Mesh SDK context value. | ||
*/ | ||
declare const useUniformMeshSdkContext: () => UniformMeshSdkContextValue; | ||
interface LoadingOverlayProps { | ||
isActive: boolean; | ||
statusMessage?: string | JSX.Element; | ||
} | ||
declare const LoadingOverlay: React.FC<LoadingOverlayProps>; | ||
interface LoadingIconProps { | ||
width?: number; | ||
height?: number; | ||
} | ||
declare const LoadingIcon: React.FC<LoadingIconProps>; | ||
declare const SvgCaution: (props: SVGProps<SVGSVGElement>) => JSX.Element; | ||
declare const SvgCheckmark: (props: SVGProps<SVGSVGElement>) => JSX.Element; | ||
declare const SvgChevronDown: (props: SVGProps<SVGSVGElement>) => JSX.Element; | ||
declare const SvgClose: (props: SVGProps<SVGSVGElement>) => JSX.Element; | ||
declare const SvgDanger: (props: SVGProps<SVGSVGElement>) => JSX.Element; | ||
declare const SvgExclamationPoint: (props: SVGProps<SVGSVGElement>) => JSX.Element; | ||
declare const SvgInfo: (props: SVGProps<SVGSVGElement>) => JSX.Element; | ||
declare const SvgLightbulb: (props: SVGProps<SVGSVGElement>) => JSX.Element; | ||
declare const SvgMagnifyingGlass: (props: SVGProps<SVGSVGElement>) => JSX.Element; | ||
declare const SvgMoreVerticalAlt: (props: SVGProps<SVGSVGElement>) => JSX.Element; | ||
declare namespace index { | ||
export { | ||
SvgCaution as Caution, | ||
SvgCheckmark as Checkmark, | ||
SvgChevronDown as ChevronDown, | ||
SvgClose as Close, | ||
SvgDanger as Danger, | ||
SvgExclamationPoint as ExclamationPoint, | ||
SvgInfo as Info, | ||
SvgLightbulb as Lightbulb, | ||
SvgMagnifyingGlass as MagnifyingGlass, | ||
SvgMoreVerticalAlt as MoreVerticalAlt, | ||
}; | ||
} | ||
export { Button, ButtonProps, Callout, CalloutProps, CalloutType, ChildFunction, CmsEntrySearch, CmsEntrySearchContentType, CmsEntrySearchProps, CmsEntrySearchQueryOptions, CmsEntrySearchResult, CmsEntrySearchRowProps, CmsEntrySearchSelectedItemProps, DefaultSearchRow, DefaultSelectedItem, index as Icons, Input, InputProps, KeywordSearchInput, KeywordSearchInputProps, LoadingIcon, LoadingIconProps, LoadingIndicator, LoadingOverlay, LoadingOverlayProps, Menu, MenuContext, MenuItem, MenuItemProps, MenuProps, NoResultsProps, UniformMeshLocationContext, UniformMeshLocationContextProvider, UniformMeshLocationContextValue, UniformMeshSdkContext, UniformMeshSdkContextProvider, UniformMeshSdkContextValue, UseUniformMeshSdkOptions, useInitializeUniformMeshSdk, useMenuContext, useUniformMeshLocation, useUniformMeshLocationContext, useUniformMeshSdk, useUniformMeshSdkContext }; |
@@ -1,1 +0,1 @@ | ||
import x,{createContext as U,useContext as p,useState as L}from"react";var f=U(void 0),d=({children:e})=>{let[o,a]=L(),t;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let n=o||window.UniformMeshSDK.getCurrentLocation();t={location:{getValue:n.getValue,getMetadata:n.getMetadata,setValue:async i=>{await n.setValue(i),a(window.UniformMeshSDK.getCurrentLocation())}}}}return x.createElement(f.Provider,{value:t},e)},m=()=>{let e=p(f);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function D(){let{location:e}=m();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 C}from"@uniformdev/mesh-sdk";import{useEffect as k,useState as u}from"react";var y=({autoResizingDisabled:e}={})=>{let[o,a]=u(),[t,n]=u();return k(()=>{typeof window=="undefined"||t||(typeof window.UniformMeshSDK=="undefined"?C({autoResizingDisabled:e}).then(i=>{n(i)}).catch(i=>{a(i)}):n(window.UniformMeshSDK))},[]),{initializing:!t&&!o,error:o,sdk:t}};import c,{createContext as l,useContext as S}from"react";var h=l(void 0),R=({children:e})=>{let o;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(o={sdk:window.UniformMeshSDK}),c.createElement(h.Provider,{value:o},c.createElement(d,null,e))},M=()=>{let e=S(h);if(!e)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return e};function O(){let{sdk:e}=M();return e}export*from"@uniformdev/mesh-sdk";export{f as UniformMeshLocationContext,d as UniformMeshLocationContextProvider,h as UniformMeshSdkContext,R as UniformMeshSdkContextProvider,y as useInitializeUniformMeshSdk,D as useUniformMeshLocation,m as useUniformMeshLocationContext,O as useUniformMeshSdk,M as useUniformMeshSdkContext}; | ||
var lt=Object.defineProperty;var dt=(e,t)=>{for(var o in t)lt(e,o,{get:t[o],enumerable:!0})};import mt,{createContext as ut,useContext as ct,useState as pt}from"react";var Le=ut(void 0),Pe=({children:e})=>{let[t,o]=pt(),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 mt.createElement(Le.Provider,{value:n},e)},ke=()=>{let e=ct(Le);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function Yt(){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 ft}from"@uniformdev/mesh-sdk";import{useEffect as gt,useState as De}from"react";var ro=({autoResizingDisabled:e}={})=>{let[t,o]=De(),[n,r]=De();return gt(()=>{typeof window=="undefined"||n||(typeof window.UniformMeshSDK=="undefined"?ft({autoResizingDisabled:e}).then(s=>{r(s)}).catch(s=>{o(s)}):r(window.UniformMeshSDK))},[e]),{initializing:!n&&!t,error:t,sdk:n}};import Ve,{createContext as vt,useContext as ht}from"react";var Te=vt(void 0),lo=({children:e})=>{let t;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(t={sdk:window.UniformMeshSDK}),Ve.createElement(Te.Provider,{value:t},Ve.createElement(Pe,null,e))},Be=()=>{let e=ht(Te);if(!e)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return e};function co(){let{sdk:e}=Be();return e}import Ue from"react";import{Button as xt}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=Ue.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 Ue.createElement(xt,{className:p,ref:g,...f},o)});import L from"react";import*as oe from"react";var bt=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=bt;import*as ne from"react";var Ct=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=Ct;import*as _ from"react";var yt=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=yt;import*as re from"react";var wt=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=wt;import*as ae from"react";var St=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"})),T=St;import*as ie from"react";var Mt=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"})),Z=Mt;var Nt={caution:{icon:T,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:T,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:Z,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"}},Ge=({type:e="info",title:t,children:o,className:n})=>{let r=Nt[e];if(!r)return null;let s=r.icon;return L.createElement("div",{"data-testid":"sdk-ui-callout",className:`rounded-md p-4 ${r.containerColor} ${n||""}`},L.createElement("div",{className:"flex"},L.createElement("div",{className:"flex-shrink-0"},L.createElement(s,{className:`h-5 w-5 ${r.iconColor}`})),L.createElement("div",{className:"ml-3"},t?L.createElement("h3",{className:`text-sm font-medium mb-2 ${r.titleColor}`},t):null,o?L.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 E from"react";var Lt=e=>E.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},E.createElement("g",{clipPath:"url(#magnifying-glass_svg__a)"},E.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"}),E.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"})),E.createElement("defs",null,E.createElement("clipPath",{id:"magnifying-glass_svg__a"},E.createElement("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),R=Lt;function Ie({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(R,{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 D from"react";import{useMenuState as Pt,Menu as kt,MenuButton as Dt}from"reakit/Menu";var $e=D.createContext({}),ze=()=>D.useContext($e),Fe=({menuLabel:e,menuTrigger:t,menuItemsContainerCssClasses:o,placement:n="auto",children:r})=>{let s=Pt();return D.createElement($e.Provider,{value:s},D.createElement(Dt,{...s,ref:t.ref,...t.props},f=>D.cloneElement(t,f)),D.createElement(kt,{...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 He}from"reakit";var Ke=({children:e,className:t,hideMenuOnClick:o=!0,icon:n,...r})=>{let s=ze(),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=l=>{s.hide(),y(l)}}return h};if(typeof e=="function")return B.createElement(He,{...s,...r,className:f},v=>{let h=o?g(v):v,y=e(h);return n?Oe(y,n):y});let p=o?g(r):r;return B.createElement(He,{...s,...p,className:f},n?Oe(e,n):e)};function Oe(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 I,useEffect as Ft,useRef as Ht}from"react";var ce={};dt(ce,{Caution:()=>T,Checkmark:()=>Z,ChevronDown:()=>W,Close:()=>X,Danger:()=>A,ExclamationPoint:()=>O,Info:()=>N,Lightbulb:()=>j,MagnifyingGlass:()=>R,MoreVerticalAlt:()=>G});import*as me from"react";var Vt=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=Vt;import*as U from"react";var Tt=e=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e},U.createElement("g",{fillRule:"evenodd"},U.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"}),U.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=Tt;import*as ue from"react";var Bt=e=>ue.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},ue.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"})),G=Bt;import{useThrottle as Kt}from"react-use";import{v4 as Ot}from"uuid";import u,{useState as Ut,useRef as _e,useEffect as Gt}from"react";function Ae(e,t){let o=window.open(e,"_blank"),n=setInterval(()=>{(o==null?void 0:o.closed)&&(clearInterval(n),t())},500)}import{format as It}from"timeago.js";var je=({selectedItem:e,logoIcon:t,onDeselect:o,onEditClosed:n})=>{var y;let r=_e(null),s=_e(null),[f,g]=Ut(!1);Gt(()=>{let l=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",l,!0),document.addEventListener("mousedown",l),()=>{window.removeEventListener("resize",x,!0),document.removeEventListener("scroll",l,!0),document.removeEventListener("mousedown",l)}},[s]);let p=()=>{var l;if(g(!f),s.current&&r.current){let x=(l=r==null?void 0:r.current)==null?void 0:l.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(([l,x],S)=>u.createElement("div",{className:"text-xs",key:S},u.createElement("span",{className:"font-bold mr-2"},l,":"),x))))),e.createdDate&&u.createElement("div",{className:"text-xs"},u.createElement("span",{className:"font-bold mr-2"},"Created:"),It((y=e.createdDate)!=null?y:0)),u.createElement("div",{className:"flex gap-4"},e.metadata?Object.entries(e.metadata).filter(([l])=>["type","status"].includes(l.toLocaleLowerCase())).map(([l,x])=>u.createElement("span",{className:"text-sm",key:l},x)):null),e.metadata?Object.entries(e.metadata).filter(([l])=>!["type","status"].includes(l.toLocaleLowerCase())).map(([l,x])=>u.createElement("div",{className:"text-xs order-1",key:l},u.createElement("span",{className:"font-bold mr-2 order-1"},l,":"),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:l=>{n&&(Ae(l.currentTarget.href,()=>n(e)),l.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:l=>{l.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 $t,useRef as Ze,useEffect as zt}from"react";var Re=({result:e,isSelected:t,triggerSelection:o})=>{let n=Ze(null),r=Ze(null),[s,f]=$t(!1);zt(()=>{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 At,DragDropContext as _t,Draggable as jt}from"react-beautiful-dnd";var Zt=({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(Ge,{type:"info"},o)},In=({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:l,onAddNew:x,onEditClosed:S,onCancel:pe,noResultsComponent:Je,helpComponent:We,onSort:q})=>{var Me,Ne,Ee;let fe=5,ge=()=>l?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[ve,he]=I(""),[M,xe]=I(ge),[$,Q]=I(!1),[z,F]=I([]),[Xe,be]=I(!1),H=Kt(ve,750);Ft(()=>{e(H,{count:fe,offset:0,contentType:M==="any"?void 0:M})},[H,M]);let qe=a=>{z.includes(a.id)?F(c=>c.filter(k=>k!==a.id)):F(f?c=>[...c,a==null?void 0:a.id]:[a.id])},Qe=()=>{xe(ge()),he(""),F((n==null?void 0:n.length)?n.map(a=>a.id):[])},Ye=()=>{Q(a=>!a),$||Qe()},Ce=a=>{s((n==null?void 0:n.filter(c=>c.id!==a.id).map(c=>c.id))||[],"")},et=a=>{a.preventDefault(),s(z,M),Q(!1)},tt=a=>{a.preventDefault(),Q(!1),pe&&pe()},ot=a=>{a.preventDefault(),e(H,{count:fe,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=Ht(Ot()),nt=!(n==null?void 0:n.length)||f,rt=p||Re,we=v||je,at=Je||Zt,Se=r&&typeof r!="string"?r:null,it=Se?i.createElement(Se,{className:"h-9 w-9"}):i.createElement("img",{src:r,alt:"CMS logo",className:"h-9 w-9"}),st=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(V=>V.id)),b}};return i.createElement("div",{className:"w-full"},i.createElement("div",{className:"relative my-4"},nt&&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:Ye,type:"button","aria-haspopup":!0,"aria-expanded":$,"aria-controls":ye.current},it,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 ${$?"rotate-180":"rotate-0"}`})))),i.createElement("div",{className:`${$?"block":"hidden"} py-3 px-4 space-y-4 bg-white rounded-lg border border-gray-300`},We||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)},l?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(Ie,{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(rt,{key:a.id,isSelected:z.includes(a.id),result:a,triggerSelection:()=>qe(a)})):y?null:i.createElement(at,{searchText:H||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:ot},Xe?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&&((Ee=o==null?void 0:o.length)!=null?Ee:0)>0?i.createElement(Fe,{menuLabel:"Add new menu",menuTrigger:i.createElement(K,{buttonType:"secondary"},"Add New")},o==null?void 0:o.map(a=>i.createElement(Ke,{key:a.id,className:"bg-white text-primary",onClick:()=>x(a)},a.name))):null),i.createElement("div",null,i.createElement(K,{buttonType:"unimportant",onClick:tt},"Cancel"),i.createElement(K,{className:"ml-5",disabled:!z.length,onClick:et,"data-test-id":"entry-accept-button"},"Accept"))))),f?i.createElement(_t,{onDragEnd:a=>st(a)},i.createElement(At,{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(jt,{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(G,{className:"text-brand-secondary-1 absolute left-1.5",width:24,height:24}),i.createElement(G,{className:"text-brand-secondary-1",width:24,height:24})),i.createElement(we,{key:`selected-item-${c.id}`,logoIcon:r,selectedItem:c,onDeselect:V=>Ce(V),onEditClosed:S?V=>S(V):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 Fn=({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(Rt,{height:128,width:128}),t?C.createElement("div",{className:"mt-4 text-gray-500"},t):null))),Rt=({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,Ge as Callout,In as CmsEntrySearch,Re as DefaultSearchRow,je as DefaultSelectedItem,ce as Icons,se as Input,Ie as KeywordSearchInput,Rt as LoadingIcon,de as LoadingIndicator,Fn as LoadingOverlay,Fe as Menu,$e as MenuContext,Ke as MenuItem,Le as UniformMeshLocationContext,Pe as UniformMeshLocationContextProvider,Te as UniformMeshSdkContext,lo as UniformMeshSdkContextProvider,ro as useInitializeUniformMeshSdk,ze as useMenuContext,Yt as useUniformMeshLocation,ke as useUniformMeshLocationContext,co as useUniformMeshSdk,Be as useUniformMeshSdkContext}; |
@@ -1,1 +0,1 @@ | ||
var k=Object.create;var c=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var L=e=>c(e,"__esModule",{value:!0});var v=(e,o)=>{L(e);for(var i in o)c(e,i,{get:o[i],enumerable:!0})},n=(e,o,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of S(o))!V.call(e,t)&&t!=="default"&&c(e,t,{get:()=>o[t],enumerable:!(i=l(o,t))||i.enumerable});return e},d=e=>n(L(c(e!=null?k(w(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);v(exports,{UniformMeshLocationContext:()=>h,UniformMeshLocationContextProvider:()=>M,UniformMeshSdkContext:()=>U,UniformMeshSdkContextProvider:()=>T,useInitializeUniformMeshSdk:()=>K,useUniformMeshLocation:()=>D,useUniformMeshLocationContext:()=>x,useUniformMeshSdk:()=>g,useUniformMeshSdkContext:()=>p});var r=d(require("react")),h=(0,r.createContext)(void 0),M=({children:e})=>{let[o,i]=(0,r.useState)(),t;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let a=o||window.UniformMeshSDK.getCurrentLocation();t={location:{getValue:a.getValue,getMetadata:a.getMetadata,setValue:async f=>{await a.setValue(f),i(window.UniformMeshSDK.getCurrentLocation())}}}}return r.default.createElement(h.Provider,{value:t},e)},x=()=>{let e=(0,r.useContext)(h);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function D(){let{location:e}=x();return{value:e==null?void 0:e.getValue(),setValue:e==null?void 0:e.setValue,metadata:e==null?void 0:e.getMetadata()}}var C=d(require("@uniformdev/mesh-sdk")),u=d(require("react")),K=({autoResizingDisabled:e}={})=>{let[o,i]=(0,u.useState)(),[t,a]=(0,u.useState)();return(0,u.useEffect)(()=>{typeof window=="undefined"||t||(typeof window.UniformMeshSDK=="undefined"?(0,C.initializeUniformMeshSDK)({autoResizingDisabled:e}).then(f=>{a(f)}).catch(f=>{i(f)}):a(window.UniformMeshSDK))},[]),{initializing:!t&&!o,error:o,sdk:t}};var s=d(require("react"));var U=(0,s.createContext)(void 0),T=({children:e})=>{let o;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(o={sdk:window.UniformMeshSDK}),s.default.createElement(U.Provider,{value:o},s.default.createElement(M,null,e))},p=()=>{let e=(0,s.useContext)(U);if(!e)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return e};function g(){let{sdk:e}=p();return e}n(exports,d(require("@uniformdev/mesh-sdk")));0&&(module.exports={UniformMeshLocationContext,UniformMeshLocationContextProvider,UniformMeshSdkContext,UniformMeshSdkContextProvider,useInitializeUniformMeshSdk,useUniformMeshLocation,useUniformMeshLocationContext,useUniformMeshSdk,useUniformMeshSdkContext}); | ||
var Ct=Object.create;var W=Object.defineProperty;var yt=Object.getOwnPropertyDescriptor;var wt=Object.getOwnPropertyNames;var St=Object.getPrototypeOf,Mt=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 wt(t))!Mt.call(e,n)&&(o||n!=="default")&&W(e,n,{get:()=>t[n],enumerable:!(a=yt(t,n))||a.enumerable});return e},c=(e,t)=>S(We(W(e!=null?Ct(St(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Nt=(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:()=>H,Callout:()=>Me,CmsEntrySearch:()=>Ot,DefaultSearchRow:()=>Ue,DefaultSelectedItem:()=>Be,Icons:()=>se,Input:()=>te,KeywordSearchInput:()=>Ne,LoadingIcon:()=>at,LoadingIndicator:()=>re,LoadingOverlay:()=>At,Menu:()=>Pe,MenuContext:()=>Ee,MenuItem:()=>De,UniformMeshLocationContext:()=>ue,UniformMeshLocationContextProvider:()=>ce,UniformMeshSdkContext:()=>fe,UniformMeshSdkContextProvider:()=>Pt,useInitializeUniformMeshSdk:()=>Lt,useMenuContext:()=>Le,useUniformMeshLocation:()=>Et,useUniformMeshLocationContext:()=>pe,useUniformMeshSdk:()=>kt,useUniformMeshSdkContext:()=>ge});var L=c(require("react")),ue=(0,L.createContext)(void 0),ce=({children:e})=>{let[t,o]=(0,L.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 L.default.createElement(ue.Provider,{value:a},e)},pe=()=>{let e=(0,L.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"),F=require("react"),Lt=({autoResizingDisabled:e}={})=>{let[t,o]=(0,F.useState)(),[a,n]=(0,F.useState)();return(0,F.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 T=c(require("react"));var fe=(0,T.createContext)(void 0),Pt=({children:e})=>{let t;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(t={sdk:window.UniformMeshSDK}),T.default.createElement(fe.Provider,{value:t},T.default.createElement(ce,null,e))},ge=()=>{let e=(0,T.useContext)(fe);if(!e)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return e};function kt(){let{sdk:e}=ge();return e}var ve=c(require("react")),Qe=require("reakit/Button"),he={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"}},xe={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||!he[e]))return t?he[e].disabled:he[e].default}},H=ve.default.forwardRef(({size:e="md",buttonType:t="primary",children:o,className:a,rounded:n=!1,disablePadding:s=!1,...f},g)=>{let p=[xe.base,xe.size(n,!s)[e],xe.buttonType(t,f.disabled),a].join(" ");return ve.default.createElement(Qe.Button,{className:p,ref:g,...f},o)});var k=c(require("react"));var be=c(require("react")),Dt=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=Dt;var Ce=c(require("react")),Vt=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=Vt;var Q=c(require("react")),Tt=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=Tt;var ye=c(require("react")),Bt=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=Bt;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")),Gt=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=Gt;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 D=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 D.default.createElement(D.default.Fragment,null,a?D.default.createElement("label",{htmlFor:s,className:p.label},a):null,D.default.createElement("div",{className:p.container},D.default.createElement(Ye.Input,{className:p.control,id:s,disabled:f,...g},v=>D.default.createElement("input",{...v,style:g.style})),n?D.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 V=c(require("react")),$t=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"})))),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")),G=require("reakit/Menu"),Ee=B.default.createContext({}),Le=()=>B.default.useContext(Ee),Pe=({menuLabel:e,menuTrigger:t,menuItemsContainerCssClasses:o,placement:a="auto",children:n})=>{let s=(0,G.useMenuState)();return B.default.createElement(Ee.Provider,{value:s},B.default.createElement(G.MenuButton,{...s,ref:t.ref,...t.props},f=>B.default.cloneElement(t,f)),B.default.createElement(G.Menu,{...s,placement:a,"aria-label":e,className:`uniform-menu divide-y divide-gray-500 shadow-xl z-50 ${o}`},n))};var I=c(require("react")),ke=require("reakit");var De=({children:e,className:t,hideMenuOnClick:o=!0,icon:a,...n})=>{let s=Le(),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=d=>{s.hide(),w(d)}}return x};if(typeof e=="function")return I.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 I.default.createElement(ke.MenuItem,{...s,...p,className:f},a?et(e,a):e)};function et(e,t){return I.default.createElement("div",{className:"flex items-center justify-between"},I.default.createElement("div",null,e),I.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,MoreVerticalAlt:()=>_});var Ve=c(require("react")),zt=e=>Ve.createElement("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e},Ve.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=zt;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 Te=c(require("react")),Ht=e=>Te.createElement("svg",{width:"1em",height:"1em",fill:"currentColor",...e},Te.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"})),_=Ht;var nt=require("react-use"),rt=require("uuid");var l=c(require("react"));function tt(e,t){let o=window.open(e,"_blank"),a=setInterval(()=>{(o==null?void 0:o.closed)&&(clearInterval(a),t())},500)}var ot=require("timeago.js"),Be=({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 d=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",d,!0),document.addEventListener("mousedown",d),()=>{window.removeEventListener("resize",b,!0),document.removeEventListener("scroll",d,!0),document.removeEventListener("mousedown",d)}},[s]);let p=()=>{var d;if(g(!f),s.current&&n.current){let b=(d=n==null?void 0:n.current)==null?void 0:d.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(([d,b],N)=>l.default.createElement("div",{className:"text-xs",key:N},l.default.createElement("span",{className:"font-bold mr-2"},d,":"),b))))),e.createdDate&&l.default.createElement("div",{className:"text-xs"},l.default.createElement("span",{className:"font-bold mr-2"},"Created:"),(0,ot.format)((w=e.createdDate)!=null?w:0)),l.default.createElement("div",{className:"flex gap-4"},e.metadata?Object.entries(e.metadata).filter(([d])=>["type","status"].includes(d.toLocaleLowerCase())).map(([d,b])=>l.default.createElement("span",{className:"text-sm",key:d},b)):null),e.metadata?Object.entries(e.metadata).filter(([d])=>!["type","status"].includes(d.toLocaleLowerCase())).map(([d,b])=>l.default.createElement("div",{className:"text-xs order-1",key:d},l.default.createElement("span",{className:"font-bold mr-2 order-1"},d,":"),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:d=>{a&&(tt(d.currentTarget.href,()=>a(e)),d.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:d=>{d.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 $=require("react-beautiful-dnd"),Kt=({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)},Ot=({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:d,onAddNew:b,onEditClosed:N,onCancel:Ge,noResultsComponent:it,helpComponent:st,onSort:le})=>{var Ze,Re,Je;let Ie=5,$e=()=>d?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[ze,Fe]=(0,r.useState)(""),[E,He]=(0,r.useState)($e),[j,de]=(0,r.useState)(!1),[Z,R]=(0,r.useState)([]),[lt,Ke]=(0,r.useState)(!1),J=(0,nt.useThrottle)(ze,750);(0,r.useEffect)(()=>{e(J,{count:Ie,offset:0,contentType:E==="any"?void 0:E})},[J,E]);let dt=i=>{Z.includes(i.id)?R(u=>u.filter(U=>U!==i.id)):R(f?u=>[...u,i==null?void 0:i.id]:[i.id])},mt=()=>{He($e()),Fe(""),R((a==null?void 0:a.length)?a.map(i=>i.id):[])},ut=()=>{de(i=>!i),j||mt()},Oe=i=>{s((a==null?void 0:a.filter(u=>u.id!==i.id).map(u=>u.id))||[],"")},ct=i=>{i.preventDefault(),s(Z,E),de(!1)},pt=i=>{i.preventDefault(),de(!1),Ge&&Ge()},ft=i=>{i.preventDefault(),e(J,{count:Ie,offset:(t==null?void 0:t.length)||0,contentType:E==="any"?void 0:E}),Ke(!0);let u=setTimeout(()=>{Ke(!1)},750);return()=>clearTimeout(u)},Ae=(0,r.useRef)((0,rt.v4)()),gt=!(a==null?void 0:a.length)||f,vt=p||Ue,_e=v||Be,ht=it||Kt,je=n&&typeof n!="string"?n:null,xt=je?r.default.createElement(je,{className:"h-9 w-9"}):r.default.createElement("img",{src:n,alt:"CMS logo",className:"h-9 w-9"}),bt=i=>{var u,U;if(i.destination&&i.source.droppableId===((u=i.destination)==null?void 0:u.droppableId)){let y=[...a||[]],[me]=(U=y==null?void 0:y.splice(i.source.index,1))!=null?U:[];return y==null||y.splice(i.destination.index,0,me),le==null||le(y.map(z=>z.id)),y}};return r.default.createElement("div",{className:"w-full"},r.default.createElement("div",{className:"relative my-4"},gt&&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:ut,type:"button","aria-haspopup":!0,"aria-expanded":j,"aria-controls":Ae.current},xt,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`},st||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=>He(i.target.value)},d?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:Fe,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(vt,{key:i.id,isSelected:Z.includes(i.id),result:i,triggerSelection:()=>dt(i)})):w?null:r.default.createElement(ht,{searchText:J||ze,selectedContentType:(Re=(Ze=o==null?void 0:o.find(i=>i.id===E))==null?void 0:Ze.name)!=null?Re:E}),!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:ft},lt?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(H,{buttonType:"secondary"},"Add New")},o==null?void 0:o.map(i=>r.default.createElement(De,{key:i.id,className:"bg-white text-primary",onClick:()=>b(i)},i.name))):null),r.default.createElement("div",null,r.default.createElement(H,{buttonType:"unimportant",onClick:pt},"Cancel"),r.default.createElement(H,{className:"ml-5",disabled:!Z.length,onClick:ct,"data-test-id":"entry-accept-button"},"Accept"))))),f?r.default.createElement($.DragDropContext,{onDragEnd:i=>bt(i)},r.default.createElement($.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,U)=>{if(u==null?void 0:u.id)return r.default.createElement($.Draggable,{key:u.id,draggableId:u.id,index:U},(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:z=>Oe(z),onEditClosed:N?z=>N(z):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")),At=({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(at,{height:128,width:128}),t?C.default.createElement("div",{className:"mt-4 text-gray-500"},t):null))),at=({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=Nt(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}); |
{ | ||
"name": "@uniformdev/mesh-sdk-react", | ||
"version": "14.0.0", | ||
"version": "14.0.1-alpha.94+f04d6359", | ||
"description": "Uniform Mesh Framework SDK for React", | ||
@@ -9,12 +9,31 @@ "license": "SEE LICENSE IN LICENSE.txt", | ||
"exports": { | ||
"import": { | ||
"node": "./dist/index.mjs", | ||
"default": "./dist/index.esm.js" | ||
".": { | ||
"import": { | ||
"node": "./dist/index.mjs", | ||
"default": "./dist/index.esm.js" | ||
}, | ||
"require": "./dist/index.js" | ||
}, | ||
"require": "./dist/index.js" | ||
"./tailwind": { | ||
"import": { | ||
"node": "./dist/tailwind/plugin.mjs" | ||
}, | ||
"require": "./dist/tailwind/plugin.js" | ||
} | ||
}, | ||
"types": "./dist/index.d.ts", | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
"./dist/index.d.ts" | ||
], | ||
"tailwind": [ | ||
"./dist/tailwind/plugin.d.ts" | ||
] | ||
} | ||
}, | ||
"sideEffects": false, | ||
"scripts": { | ||
"build": "tsup", | ||
"build": "run-s build:icons build:esm", | ||
"build:esm": "tsup", | ||
"build:icons": "svgr -d ./src/assets ./src/assets --typescript --icon", | ||
"dev": "tsup --watch", | ||
@@ -26,21 +45,41 @@ "clean": "rimraf dist", | ||
"ci:verify": "run-p lint test", | ||
"ci:build": "tsup --minify --clean" | ||
"ci:build": "run-s build:icons ci:build:build", | ||
"ci:build:build": "tsup --minify --clean", | ||
"storybook": "yarn build && start-storybook -p 9011 -c ./.storybook", | ||
"storybook:publish": "yarn build && yarn build-storybook -o ./out" | ||
}, | ||
"dependencies": { | ||
"@uniformdev/mesh-sdk": "^14.0.0" | ||
"@uniformdev/mesh-sdk": "^14.0.1-alpha.94+f04d6359", | ||
"react-beautiful-dnd": "13.1.0", | ||
"react-use": "17.3.2", | ||
"reakit": "1.3.11", | ||
"timeago.js": "4.0.2", | ||
"uuid": "8.3.2" | ||
}, | ||
"peerDependencies": { | ||
"react": ">= 16" | ||
"react": ">=16.8" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "27.0.3", | ||
"@types/node": "16.11.12", | ||
"eslint": "8.4.1", | ||
"eslint-plugin-react": "7.27.1", | ||
"@storybook/addon-controls": "6.4.14", | ||
"@storybook/addon-essentials": "6.4.14", | ||
"@storybook/addon-postcss": "2.0.0", | ||
"@storybook/react": "6.4.14", | ||
"@svgr/cli": "6.2.0", | ||
"@tailwindcss/forms": "0.4.0", | ||
"@types/jest": "27.4.0", | ||
"@types/node": "16.11.21", | ||
"@types/react-beautiful-dnd": "13.1.2", | ||
"autoprefixer": "10.4.2", | ||
"eslint": "8.7.0", | ||
"eslint-plugin-react": "7.28.0", | ||
"eslint-plugin-react-hooks": "4.3.0", | ||
"jest": "27.4.5", | ||
"jest": "27.4.7", | ||
"npm-run-all": "4.1.5", | ||
"postcss": "8.4.5", | ||
"postcss-import": "14.0.2", | ||
"react": "17.0.2", | ||
"rimraf": "3.0.2", | ||
"ts-jest": "27.1.1", | ||
"tsup": "5.11.1" | ||
"tailwindcss": "3.0.15", | ||
"ts-jest": "27.1.3", | ||
"tsup": "5.11.11" | ||
}, | ||
@@ -50,3 +89,3 @@ "files": [ | ||
], | ||
"gitHead": "5f7b1abf0fe161630b53bde4c5530f8b12a1c775" | ||
"gitHead": "f04d63590168a9c7dbbfbf2b2425c72c07f1ce84" | ||
} |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
207649
8
957
7
22
4
6
2
+ Addedreact-beautiful-dnd@13.1.0
+ Addedreact-use@17.3.2
+ Addedreakit@1.3.11
+ Addedtimeago.js@4.0.2
+ Addeduuid@8.3.2
+ Added@babel/runtime@7.26.9(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@popperjs/core@2.11.8(transitive)
+ Added@types/hoist-non-react-statics@3.3.6(transitive)
+ Added@types/js-cookie@2.2.7(transitive)
+ Added@types/react@19.0.10(transitive)
+ Added@types/react-redux@7.1.34(transitive)
+ Added@xobotyi/scrollbar-width@1.9.5(transitive)
+ Addedbody-scroll-lock@3.1.5(transitive)
+ Addedcopy-to-clipboard@3.3.3(transitive)
+ Addedcss-box-model@1.2.1(transitive)
+ Addedcss-in-js-utils@3.1.0(transitive)
+ Addedcss-tree@1.1.3(transitive)
+ Addedcsstype@3.1.3(transitive)
+ Addederror-stack-parser@2.1.4(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-shallow-equal@1.0.0(transitive)
+ Addedfastest-stable-stringify@2.0.2(transitive)
+ Addedhoist-non-react-statics@3.3.2(transitive)
+ Addedhyphenate-style-name@1.1.0(transitive)
+ Addedinline-style-prefixer@7.0.1(transitive)
+ Addedjs-cookie@2.2.1(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedmdn-data@2.0.14(transitive)
+ Addedmemoize-one@5.2.1(transitive)
+ Addednano-css@5.6.2(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedprop-types@15.8.1(transitive)
+ Addedraf-schd@4.0.3(transitive)
+ Addedreact@17.0.218.3.1(transitive)
+ Addedreact-beautiful-dnd@13.1.0(transitive)
+ Addedreact-dom@17.0.2(transitive)
+ Addedreact-is@16.13.117.0.2(transitive)
+ Addedreact-redux@7.2.9(transitive)
+ Addedreact-universal-interface@0.6.2(transitive)
+ Addedreact-use@17.3.2(transitive)
+ Addedreakit@1.3.11(transitive)
+ Addedreakit-system@0.15.2(transitive)
+ Addedreakit-utils@0.15.2(transitive)
+ Addedreakit-warning@0.6.2(transitive)
+ Addedredux@4.2.1(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
+ Addedresize-observer-polyfill@1.5.1(transitive)
+ Addedrtl-css-js@1.16.1(transitive)
+ Addedscheduler@0.20.2(transitive)
+ Addedscreenfull@5.2.0(transitive)
+ Addedset-harmonic-interval@1.0.1(transitive)
+ Addedsource-map@0.5.60.6.1(transitive)
+ Addedstack-generator@2.0.10(transitive)
+ Addedstackframe@1.3.4(transitive)
+ Addedstacktrace-gps@3.1.2(transitive)
+ Addedstacktrace-js@2.0.2(transitive)
+ Addedstylis@4.3.6(transitive)
+ Addedthrottle-debounce@3.0.1(transitive)
+ Addedtimeago.js@4.0.2(transitive)
+ Addedtiny-invariant@1.3.3(transitive)
+ Addedtoggle-selection@1.0.6(transitive)
+ Addedts-easing@0.2.0(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addeduse-memo-one@1.1.3(transitive)
+ Addeduuid@8.3.2(transitive)