@nice2dev/social 1.1.7 โ†’ 1.1.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @nice2dev/social โ€” Changelog
2
2
 
3
+ ## 1.1.9
4
+
5
+ No changes in this release.
6
+
7
+ ## 1.1.8
8
+
9
+ No changes in this release.
10
+
3
11
  ## 1.1.7
4
12
 
5
13
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),O=l.forwardRef(function(x,E){const{comments:m,currentUserId:n,onSubmit:o,onEdit:h,onDelete:N,onReact:r,readOnly:b=!1,maxDepth:T=4,reactions:S=["๐Ÿ‘","โค๏ธ","๐Ÿ˜‚","๐Ÿ˜ฎ","๐Ÿ˜ข"],placeholder:g="Write a commentโ€ฆ",className:k,style:w}=x,[p,s]=l.useState(""),[u,v]=l.useState(null),[t,i]=l.useState(""),[c,a]=l.useState(null),[y,M]=l.useState(""),L=new Map;for(const d of m){const I=d.parentId??"__root__";L.has(I)||L.set(I,[]),L.get(I).push(d)}const R=l.useCallback(()=>{!p.trim()||!o||(o(p.trim()),s(""))},[p,o]),P=l.useCallback(()=>{!t.trim()||!o||!u||(o(t.trim(),u),i(""),v(null))},[t,u,o]),C=l.useCallback(()=>{!c||!y.trim()||!h||(h(c,y.trim()),a(null),M(""))},[c,y,h]),A=(d,I)=>{const F=n&&d.authorId===n,_=L.get(d.id)??[];return e.jsxs("div",{className:"nice-comments__item",style:{marginLeft:I*24},children:[e.jsxs("div",{className:"nice-comments__header",children:[d.authorAvatarUrl&&e.jsx("img",{src:d.authorAvatarUrl,alt:"",className:"nice-comments__avatar"}),e.jsx("strong",{className:"nice-comments__author",children:d.authorName}),e.jsx("time",{className:"nice-comments__time",children:d.createdAt}),d.isEdited&&e.jsx("span",{className:"nice-comments__edited",children:"(edited)"})]}),c===d.id?e.jsxs("div",{className:"nice-comments__edit-form",children:[e.jsx("textarea",{value:y,onChange:j=>M(j.target.value)}),e.jsx("button",{onClick:C,children:"Save"}),e.jsx("button",{onClick:()=>a(null),children:"Cancel"})]}):e.jsx("p",{className:"nice-comments__content",children:d.isDeleted?e.jsx("em",{children:"Comment deleted"}):d.content}),!d.isDeleted&&d.reactions&&e.jsx("div",{className:"nice-comments__reactions",children:Object.entries(d.reactions).map(([j,f])=>e.jsxs("button",{className:"nice-comments__reaction",onClick:()=>r==null?void 0:r(d.id,j),children:[j," ",f]},j))}),!d.isDeleted&&!b&&e.jsxs("div",{className:"nice-comments__actions",children:[r&&S.map(j=>e.jsx("button",{onClick:()=>r(d.id,j),title:j,children:j},j)),I<T&&e.jsx("button",{onClick:()=>{v(d.id),i("")},children:"Reply"}),F&&h&&e.jsx("button",{onClick:()=>{a(d.id),M(d.content)},children:"Edit"}),F&&N&&e.jsx("button",{onClick:()=>N(d.id),children:"Delete"})]}),u===d.id&&e.jsxs("div",{className:"nice-comments__reply-form",children:[e.jsx("textarea",{value:t,onChange:j=>i(j.target.value),placeholder:"Write a replyโ€ฆ"}),e.jsx("button",{onClick:P,disabled:!t.trim(),children:"Send"}),e.jsx("button",{onClick:()=>v(null),children:"Cancel"})]}),_.map(j=>A(j,I+1))]},d.id)},D=L.get("__root__")??[];return e.jsxs("div",{ref:E,className:`nice-comments ${k??""}`,style:w,children:[!b&&e.jsxs("div",{className:"nice-comments__new",children:[e.jsx("textarea",{value:p,onChange:d=>s(d.target.value),placeholder:g}),e.jsx("button",{onClick:R,disabled:!p.trim(),children:"Post"})]}),D.length===0?e.jsx("p",{className:"nice-comments__empty",children:"No comments yet."}):D.map(d=>A(d,0))]})}),z="โ˜†",B="โ˜…",K="โ™ก",H="โ™ฅ",q=l.forwardRef(function(x,E){const{value:m,max:n=5,mode:o="stars",aggregation:h,onChange:N,readOnly:r=!1,size:b="md",showValue:T=!1,label:S,emojiSet:g=["๐Ÿ˜ข","๐Ÿ˜•","๐Ÿ˜","๐Ÿ™‚","๐Ÿ˜"],className:k,style:w}=x,[p,s]=l.useState(null),u=p!==null?p+1:m??0,v=l.useCallback(c=>{r||!N||N(c+1)},[r,N]),t=()=>{const c=[];for(let a=0;a<n;a++){const y=a<u;let M;o==="emoji"?M=g[a]??g[g.length-1]:o==="hearts"?M=y?H:K:o==="thumbs"?M=y?"๐Ÿ‘":"๐Ÿ‘Ž":M=y?B:z,c.push(e.jsx("span",{className:`nice-ratings__symbol ${y?"nice-ratings__symbol--active":""}`,onClick:()=>v(a),onMouseEnter:()=>!r&&s(a),onMouseLeave:()=>!r&&s(null),role:r?void 0:"button",tabIndex:r?void 0:0,onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&v(a)},children:M},a))}return c},i=()=>e.jsxs("div",{className:"nice-ratings__numeric",children:[e.jsx("input",{type:"number",min:0,max:n,step:.5,value:m??0,onChange:c=>N==null?void 0:N(parseFloat(c.target.value)||0),readOnly:r,className:"nice-ratings__numeric-input"}),e.jsxs("span",{className:"nice-ratings__numeric-max",children:["/ ",n]})]});return e.jsxs("div",{ref:E,className:`nice-ratings nice-ratings--${b} nice-ratings--${o} ${r?"nice-ratings--readonly":""} ${k??""}`,style:w,children:[S&&e.jsx("span",{className:"nice-ratings__label",children:S}),e.jsxs("div",{className:"nice-ratings__body",children:[o==="numeric"?i():t(),T&&o!=="numeric"&&e.jsxs("span",{className:"nice-ratings__value",children:[u," / ",n]})]}),h&&e.jsxs("div",{className:"nice-ratings__aggregation",children:[e.jsx("span",{className:"nice-ratings__avg",children:h.average.toFixed(1)}),e.jsxs("span",{className:"nice-ratings__count",children:["(",h.count," ratings)"]}),h.distribution&&e.jsx("div",{className:"nice-ratings__distribution",children:Object.entries(h.distribution).sort(([c],[a])=>+a-+c).map(([c,a])=>e.jsxs("div",{className:"nice-ratings__distribution-row",children:[e.jsx("span",{children:c}),e.jsx("div",{className:"nice-ratings__bar",children:e.jsx("div",{className:"nice-ratings__bar-fill",style:{width:`${h.count?a/h.count*100:0}%`}})}),e.jsx("span",{children:a})]},c))})]})]})}),V=l.forwardRef(function(x,E){const{stats:m,userState:n,onLike:o,onShare:h,onBookmark:N,direction:r="horizontal",size:b="md",showCounts:T=!0,showLabels:S=!1,className:g,style:k}=x,w=l.useCallback(s=>s>=1e6?(s/1e6).toFixed(1)+"M":s>=1e3?(s/1e3).toFixed(1)+"K":s.toString(),[]),p=[{key:"like",icon:"โ™ก",activeIcon:"โ™ฅ",label:"Like",count:m.likes,isActive:(n==null?void 0:n.liked)??!1,onClick:o},{key:"share",icon:"โ†—",activeIcon:"โ†—",label:"Share",count:m.shares,isActive:(n==null?void 0:n.shared)??!1,onClick:h},{key:"bookmark",icon:"โ˜†",activeIcon:"โ˜…",label:"Bookmark",count:m.bookmarks,isActive:(n==null?void 0:n.bookmarked)??!1,onClick:N}];return e.jsx("div",{ref:E,className:`nice-social-panel nice-social-panel--${r} nice-social-panel--${b} ${g??""}`,style:k,children:p.map(s=>e.jsxs("button",{className:`nice-social-panel__btn nice-social-panel__btn--${s.key} ${s.isActive?"nice-social-panel__btn--active":""}`,onClick:s.onClick,title:s.label,children:[e.jsx("span",{className:"nice-social-panel__icon",children:s.isActive?s.activeIcon:s.icon}),S&&e.jsx("span",{className:"nice-social-panel__label",children:s.label}),T&&e.jsx("span",{className:"nice-social-panel__count",children:w(s.count)})]},s.key))})}),Y=l.forwardRef(function(x,E){const{tags:m,onTagClick:n,minFontSize:o=12,maxFontSize:h=36,sortBy:N="weight",maxTags:r,selectedIds:b,className:T,style:S}=x,g=l.useMemo(()=>{let s=[...m];if(N==="weight")s.sort((u,v)=>v.weight-u.weight);else if(N==="alphabetical")s.sort((u,v)=>u.label.localeCompare(v.label));else for(let u=s.length-1;u>0;u--){const v=Math.floor(Math.random()*(u+1));[s[u],s[v]]=[s[v],s[u]]}return r&&s.length>r&&(s=s.slice(0,r)),s},[m,N,r]),{minW:k,maxW:w}=l.useMemo(()=>{if(g.length===0)return{minW:0,maxW:1};const s=g.map(u=>u.weight);return{minW:Math.min(...s),maxW:Math.max(...s)}},[g]),p=s=>{if(w===k)return(o+h)/2;const u=(s-k)/(w-k);return o+u*(h-o)};return e.jsx("div",{ref:E,className:`nice-tag-cloud ${T??""}`,style:S,children:g.length===0?e.jsx("p",{className:"nice-tag-cloud__empty",children:"No tags."}):g.map(s=>{const u=b==null?void 0:b.includes(s.id),v=p(s.weight);return e.jsx("span",{className:`nice-tag-cloud__tag ${u?"nice-tag-cloud__tag--selected":""}`,style:{fontSize:v,color:s.color,cursor:n?"pointer":void 0},onClick:()=>n==null?void 0:n(s),role:n?"button":void 0,tabIndex:n?0:void 0,onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&n&&n(s)},title:`${s.label} (${s.weight})`,children:s.label},s.id)})})}),G={online:"#22c55e",away:"#eab308",busy:"#ef4444",offline:"#9ca3af"},J=l.forwardRef(function(x,E){const{users:m,onUserClick:n,onAction:o,actions:h=[],searchable:N=!1,statusFilter:r,showStatus:b=!0,layout:T="list",groupByRole:S=!1,className:g,style:k}=x,[w,p]=l.useState(""),s=l.useMemo(()=>{let t=m;if(r&&r.length>0&&(t=t.filter(i=>i.status&&r.includes(i.status))),w.trim()){const i=w.toLowerCase();t=t.filter(c=>{var a,y;return c.name.toLowerCase().includes(i)||((a=c.email)==null?void 0:a.toLowerCase().includes(i))||((y=c.role)==null?void 0:y.toLowerCase().includes(i))})}return t},[m,r,w]),u=l.useMemo(()=>{if(!S)return{"":s};const t={};for(const i of s){const c=i.role??"Other";t[c]||(t[c]=[]),t[c].push(i)}return t},[s,S]),v=t=>e.jsxs("div",{className:`nice-user-list__item nice-user-list__item--${T}`,onClick:()=>n==null?void 0:n(t),role:n?"button":void 0,tabIndex:n?0:void 0,onKeyDown:i=>{i.key==="Enter"&&n&&n(t)},children:[e.jsxs("div",{className:"nice-user-list__avatar-wrap",children:[t.avatarUrl?e.jsx("img",{src:t.avatarUrl,alt:t.name,className:"nice-user-list__avatar"}):e.jsx("span",{className:"nice-user-list__avatar-placeholder",children:t.name.charAt(0).toUpperCase()}),b&&t.status&&e.jsx("span",{className:"nice-user-list__status-dot",style:{backgroundColor:G[t.status]},title:t.status})]}),e.jsxs("div",{className:"nice-user-list__info",children:[e.jsx("span",{className:"nice-user-list__name",children:t.name}),t.email&&e.jsx("span",{className:"nice-user-list__email",children:t.email}),t.role&&e.jsx("span",{className:"nice-user-list__role",children:t.role})]}),h.length>0&&e.jsx("div",{className:"nice-user-list__actions",children:h.map(i=>e.jsx("button",{className:"nice-user-list__action-btn",onClick:c=>{c.stopPropagation(),o==null||o(t,i)},children:i},i))})]},t.id);return e.jsxs("div",{ref:E,className:`nice-user-list nice-user-list--${T} ${g??""}`,style:k,children:[N&&e.jsx("input",{type:"text",value:w,onChange:t=>p(t.target.value),placeholder:"Search usersโ€ฆ",className:"nice-user-list__search"}),s.length===0?e.jsx("p",{className:"nice-user-list__empty",children:"No users found."}):Object.entries(u).map(([t,i])=>e.jsxs("div",{className:"nice-user-list__group",children:[S&&t&&e.jsxs("h4",{className:"nice-user-list__group-title",children:[t," (",i.length,")"]}),i.map(v)]},t))]})});function Q($){if(!$)return"";let x=$;return x=x.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""),x=x.replace(/\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,""),x=x.replace(/(href|src|action)\s*=\s*(?:"javascript:[^"]*"|'javascript:[^']*')/gi,'$1=""'),x=x.replace(/(href|src|action)\s*=\s*(?:"vbscript:[^"]*"|'vbscript:[^']*')/gi,'$1=""'),x=x.replace(/<\/?(iframe|object|embed|form)\b[^>]*>/gi,""),x}const X=l.forwardRef(function(x,E){const{pages:m,selectedPageId:n,onSelectPage:o,onSavePage:h,onDeletePage:N,onCreatePage:r,editable:b=!1,searchable:T=!0,renderHtml:S=!1,sidebarWidth:g=260,className:k,style:w}=x,[p,s]=l.useState(""),[u,v]=l.useState(!1),[t,i]=l.useState(""),[c,a]=l.useState(""),[y,M]=l.useState(""),[L,R]=l.useState(!1),P=l.useMemo(()=>{if(m.some(f=>f.children&&f.children.length>0))return m.filter(f=>!f.parentId);const _=new Map;for(const f of m)_.set(f.id,{...f,children:[]});const j=[];for(const f of _.values())f.parentId&&_.has(f.parentId)?_.get(f.parentId).children.push(f):j.push(f);return j},[m]),C=l.useMemo(()=>m.find(_=>_.id===n),[m,n]),A=l.useMemo(()=>{if(!p.trim())return P;const _=p.toLowerCase(),j=new Set(m.filter(f=>f.title.toLowerCase().includes(_)).map(f=>f.id));return m.filter(f=>j.has(f.id))},[P,m,p]),D=l.useCallback(()=>{C&&(i(C.title),a(C.content??""),v(!0))},[C]),d=l.useCallback(()=>{!C||!h||(h(C.id,c,t),v(!1))},[C,c,t,h]),I=l.useCallback(()=>{!y.trim()||!r||(r(n??null,y.trim()),M(""),R(!1))},[y,n,r]),F=(_,j=0)=>{var f;return e.jsxs("div",{children:[e.jsx("div",{className:`nice-wiki__page-item ${_.id===n?"nice-wiki__page-item--active":""}`,style:{paddingLeft:12+j*16},onClick:()=>o==null?void 0:o(_),role:"button",tabIndex:0,onKeyDown:W=>{W.key==="Enter"&&(o==null||o(_))},children:_.title}),(f=_.children)==null?void 0:f.map(W=>F(W,j+1))]},_.id)};return e.jsxs("div",{ref:E,className:`nice-wiki ${k??""}`,style:{display:"flex",...w},children:[e.jsxs("div",{className:"nice-wiki__sidebar",style:{width:g,minWidth:g},children:[e.jsxs("div",{className:"nice-wiki__sidebar-header",children:[e.jsx("strong",{children:"Wiki"}),b&&r&&e.jsx("button",{onClick:()=>R(!L),title:"New page",children:"+"})]}),L&&e.jsxs("div",{className:"nice-wiki__new-page",children:[e.jsx("input",{type:"text",value:y,onChange:_=>M(_.target.value),placeholder:"New page title"}),e.jsx("button",{onClick:I,disabled:!y.trim(),children:"Create"})]}),T&&e.jsx("input",{type:"text",className:"nice-wiki__search",value:p,onChange:_=>s(_.target.value),placeholder:"Search pagesโ€ฆ"}),e.jsx("div",{className:"nice-wiki__tree",children:A.length===0?e.jsx("p",{className:"nice-wiki__empty",children:"No pages."}):A.map(_=>F(_))})]}),e.jsx("div",{className:"nice-wiki__content",children:C?u?e.jsxs("div",{className:"nice-wiki__editor",children:[e.jsx("input",{type:"text",className:"nice-wiki__edit-title",value:t,onChange:_=>i(_.target.value)}),e.jsx("textarea",{className:"nice-wiki__edit-body",value:c,onChange:_=>a(_.target.value),rows:20}),e.jsxs("div",{className:"nice-wiki__edit-actions",children:[e.jsx("button",{onClick:d,children:"Save"}),e.jsx("button",{onClick:()=>v(!1),children:"Cancel"})]})]}):e.jsxs("div",{className:"nice-wiki__viewer",children:[e.jsxs("div",{className:"nice-wiki__viewer-header",children:[e.jsx("h2",{children:C.title}),e.jsxs("div",{className:"nice-wiki__viewer-meta",children:[C.lastEditedBy&&e.jsxs("span",{children:["Edited by ",C.lastEditedBy]}),C.lastEditedAt&&e.jsxs("span",{children:[" on ",C.lastEditedAt]})]}),b&&e.jsxs("div",{className:"nice-wiki__viewer-actions",children:[e.jsx("button",{onClick:D,children:"Edit"}),N&&e.jsx("button",{onClick:()=>N(C.id),children:"Delete"})]})]}),S?e.jsx("div",{className:"nice-wiki__viewer-body",dangerouslySetInnerHTML:{__html:Q(C.content??"")}}):e.jsx("div",{className:"nice-wiki__viewer-body",children:C.content??e.jsx("em",{children:"No content."})})]}):e.jsx("div",{className:"nice-wiki__placeholder",children:"Select a page from the sidebar."})})]})}),U={comment:"๐Ÿ’ฌ",like:"โค๏ธ",share:"โ†—๏ธ",create:"โœจ",update:"โœ๏ธ",delete:"๐Ÿ—‘๏ธ",join:"๐Ÿ‘‹",leave:"๐Ÿšช",upload:"๐Ÿ“Ž",mention:"@",custom:"๐Ÿ“Œ"},Z=l.forwardRef(function(x,E){const{events:m,onEventClick:n,groupByDate:o=!0,typeFilter:h,showFilters:N=!1,maxEvents:r,onLoadMore:b,hasMore:T=!1,className:S,style:g}=x,[k,w]=l.useState(new Set),p=h??(k.size>0?Array.from(k):void 0),s=l.useMemo(()=>{let i=m;if(p&&p.length>0){const c=new Set(p);i=i.filter(a=>c.has(a.type))}return r&&(i=i.slice(0,r)),i},[m,p,r]),u=l.useMemo(()=>{if(!o)return[{label:"",events:s}];const i=new Map;for(const c of s){const a=c.timestamp.slice(0,10);i.has(a)||i.set(a,[]),i.get(a).push(c)}return Array.from(i.entries()).map(([c,a])=>({label:c,events:a}))},[s,o]),v=l.useMemo(()=>{const i=new Set(m.map(c=>c.type));return Array.from(i).sort()},[m]),t=i=>{w(c=>{const a=new Set(c);return a.has(i)?a.delete(i):a.add(i),a})};return e.jsxs("div",{ref:E,className:`nice-activity-feed ${S??""}`,style:g,children:[N&&!h&&e.jsxs("div",{className:"nice-activity-feed__filters",children:[v.map(i=>e.jsxs("button",{className:`nice-activity-feed__filter-chip ${k.has(i)?"nice-activity-feed__filter-chip--active":""}`,onClick:()=>t(i),children:[U[i]," ",i]},i)),k.size>0&&e.jsx("button",{className:"nice-activity-feed__filter-clear",onClick:()=>w(new Set),children:"Clear"})]}),s.length===0?e.jsx("p",{className:"nice-activity-feed__empty",children:"No activity."}):u.map(({label:i,events:c})=>e.jsxs("div",{className:"nice-activity-feed__group",children:[o&&i&&e.jsx("div",{className:"nice-activity-feed__date-label",children:i}),c.map(a=>e.jsxs("div",{className:"nice-activity-feed__event",onClick:()=>n==null?void 0:n(a),role:n?"button":void 0,tabIndex:n?0:void 0,onKeyDown:y=>{y.key==="Enter"&&n&&n(a)},children:[e.jsx("span",{className:"nice-activity-feed__icon",children:U[a.type]}),e.jsxs("div",{className:"nice-activity-feed__body",children:[a.actorAvatarUrl&&e.jsx("img",{src:a.actorAvatarUrl,alt:"",className:"nice-activity-feed__avatar"}),e.jsxs("span",{className:"nice-activity-feed__message",children:[e.jsx("strong",{children:a.actorName})," ",a.message,a.targetLabel&&e.jsxs(e.Fragment,{children:[" ",e.jsx("em",{children:a.targetLabel})]})]}),e.jsx("time",{className:"nice-activity-feed__time",children:a.timestamp})]})]},a.id))]},i||"__all")),T&&b&&e.jsx("button",{className:"nice-activity-feed__load-more",onClick:b,children:"Load more"})]})});exports.NiceActivityFeed=Z;exports.NiceComments=O;exports.NiceRatings=q;exports.NiceSocialPanel=V;exports.NiceTagCloud=Y;exports.NiceUserList=J;exports.NiceWiki=X;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),U=l.forwardRef(function(u,M){const{comments:m,currentUserId:n,onSubmit:o,onEdit:_,onDelete:g,onReact:r,readOnly:b=!1,maxDepth:$=4,reactions:S=["๐Ÿ‘","โค๏ธ","๐Ÿ˜‚","๐Ÿ˜ฎ","๐Ÿ˜ข"],placeholder:N="Write a commentโ€ฆ",className:k,style:w}=u,[x,s]=l.useState(""),[h,v]=l.useState(null),[t,i]=l.useState(""),[c,a]=l.useState(null),[y,E]=l.useState(""),L=new Map;for(const d of m){const A=d.parentId??"__root__";L.has(A)||L.set(A,[]),L.get(A).push(d)}const R=l.useCallback(()=>{!x.trim()||!o||(o(x.trim()),s(""))},[x,o]),P=l.useCallback(()=>{!t.trim()||!o||!h||(o(t.trim(),h),i(""),v(null))},[t,h,o]),C=l.useCallback(()=>{!c||!y.trim()||!_||(_(c,y.trim()),a(null),E(""))},[c,y,_]),I=(d,A)=>{const F=n&&d.authorId===n,p=L.get(d.id)??[];return e.jsxs("div",{className:"nice-comments__item",style:{marginLeft:A*24},children:[e.jsxs("div",{className:"nice-comments__header",children:[d.authorAvatarUrl&&e.jsx("img",{src:d.authorAvatarUrl,alt:"",className:"nice-comments__avatar"}),e.jsx("strong",{className:"nice-comments__author",children:d.authorName}),e.jsx("time",{className:"nice-comments__time",children:d.createdAt}),d.isEdited&&e.jsx("span",{className:"nice-comments__edited",children:"(edited)"})]}),c===d.id?e.jsxs("div",{className:"nice-comments__edit-form",children:[e.jsx("textarea",{value:y,onChange:j=>E(j.target.value)}),e.jsx("button",{onClick:C,children:"Save"}),e.jsx("button",{onClick:()=>a(null),children:"Cancel"})]}):e.jsx("p",{className:"nice-comments__content",children:d.isDeleted?e.jsx("em",{children:"Comment deleted"}):d.content}),!d.isDeleted&&d.reactions&&e.jsx("div",{className:"nice-comments__reactions",children:Object.entries(d.reactions).map(([j,f])=>e.jsxs("button",{className:"nice-comments__reaction",onClick:()=>r==null?void 0:r(d.id,j),children:[j," ",f]},j))}),!d.isDeleted&&!b&&e.jsxs("div",{className:"nice-comments__actions",children:[r&&S.map(j=>e.jsx("button",{onClick:()=>r(d.id,j),title:j,children:j},j)),A<$&&e.jsx("button",{onClick:()=>{v(d.id),i("")},children:"Reply"}),F&&_&&e.jsx("button",{onClick:()=>{a(d.id),E(d.content)},children:"Edit"}),F&&g&&e.jsx("button",{onClick:()=>g(d.id),children:"Delete"})]}),h===d.id&&e.jsxs("div",{className:"nice-comments__reply-form",children:[e.jsx("textarea",{value:t,onChange:j=>i(j.target.value),placeholder:"Write a replyโ€ฆ"}),e.jsx("button",{onClick:P,disabled:!t.trim(),children:"Send"}),e.jsx("button",{onClick:()=>v(null),children:"Cancel"})]}),p.map(j=>I(j,A+1))]},d.id)},D=L.get("__root__")??[];return e.jsxs("div",{ref:M,className:`nice-comments ${k??""}`,style:w,children:[!b&&e.jsxs("div",{className:"nice-comments__new",children:[e.jsx("textarea",{value:x,onChange:d=>s(d.target.value),placeholder:N}),e.jsx("button",{onClick:R,disabled:!x.trim(),children:"Post"})]}),D.length===0?e.jsx("p",{className:"nice-comments__empty",children:"No comments yet."}):D.map(d=>I(d,0))]})}),z={star:"polygon(50% 2%, 62% 36%, 98% 37%, 69% 59%, 79% 94%, 50% 73%, 21% 94%, 31% 59%, 2% 37%, 38% 36%)",heart:"polygon(50% 92%, 12% 54%, 4% 40%, 4% 25%, 10% 13%, 22% 6%, 34% 6%, 44% 12%, 50% 21%, 56% 12%, 66% 6%, 78% 6%, 90% 13%, 96% 25%, 96% 40%, 88% 54%)",share:"polygon(42% 8%, 92% 8%, 92% 58%, 75% 41%, 27% 89%, 11% 73%, 59% 25%)"},O=({shape:T,filled:u=!0})=>e.jsx("span",{"aria-hidden":"true",className:`nice-social-shape nice-social-shape--${T}`,style:{display:"inline-block",width:"1em",height:"1em",verticalAlign:"-0.125em",background:"currentColor",clipPath:z[T],opacity:u?1:.35}}),B=l.forwardRef(function(u,M){const{value:m,max:n=5,mode:o="stars",aggregation:_,onChange:g,readOnly:r=!1,size:b="md",showValue:$=!1,label:S,emojiSet:N=["๐Ÿ˜ข","๐Ÿ˜•","๐Ÿ˜","๐Ÿ™‚","๐Ÿ˜"],className:k,style:w}=u,[x,s]=l.useState(null),h=x!==null?x+1:m??0,v=l.useCallback(c=>{r||!g||g(c+1)},[r,g]),t=()=>{const c=[];for(let a=0;a<n;a++){const y=a<h;let E;o==="emoji"?E=N[a]??N[N.length-1]:o==="hearts"?E=e.jsx(O,{shape:"heart",filled:y}):o==="thumbs"?E=y?"๐Ÿ‘":"๐Ÿ‘Ž":E=e.jsx(O,{shape:"star",filled:y}),c.push(e.jsx("span",{className:`nice-ratings__symbol ${y?"nice-ratings__symbol--active":""}`,onClick:()=>v(a),onMouseEnter:()=>!r&&s(a),onMouseLeave:()=>!r&&s(null),role:r?void 0:"button",tabIndex:r?void 0:0,onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&v(a)},children:E},a))}return c},i=()=>e.jsxs("div",{className:"nice-ratings__numeric",children:[e.jsx("input",{type:"number",min:0,max:n,step:.5,value:m??0,onChange:c=>g==null?void 0:g(parseFloat(c.target.value)||0),readOnly:r,className:"nice-ratings__numeric-input"}),e.jsxs("span",{className:"nice-ratings__numeric-max",children:["/ ",n]})]});return e.jsxs("div",{ref:M,className:`nice-ratings nice-ratings--${b} nice-ratings--${o} ${r?"nice-ratings--readonly":""} ${k??""}`,style:w,children:[S&&e.jsx("span",{className:"nice-ratings__label",children:S}),e.jsxs("div",{className:"nice-ratings__body",children:[o==="numeric"?i():t(),$&&o!=="numeric"&&e.jsxs("span",{className:"nice-ratings__value",children:[h," / ",n]})]}),_&&e.jsxs("div",{className:"nice-ratings__aggregation",children:[e.jsx("span",{className:"nice-ratings__avg",children:_.average.toFixed(1)}),e.jsxs("span",{className:"nice-ratings__count",children:["(",_.count," ratings)"]}),_.distribution&&e.jsx("div",{className:"nice-ratings__distribution",children:Object.entries(_.distribution).sort(([c],[a])=>+a-+c).map(([c,a])=>e.jsxs("div",{className:"nice-ratings__distribution-row",children:[e.jsx("span",{children:c}),e.jsx("div",{className:"nice-ratings__bar",children:e.jsx("div",{className:"nice-ratings__bar-fill",style:{width:`${_.count?a/_.count*100:0}%`}})}),e.jsx("span",{children:a})]},c))})]})]})}),K=l.forwardRef(function(u,M){const{stats:m,userState:n,onLike:o,onShare:_,onBookmark:g,direction:r="horizontal",size:b="md",showCounts:$=!0,showLabels:S=!1,className:N,style:k}=u,w=l.useCallback(s=>s>=1e6?(s/1e6).toFixed(1)+"M":s>=1e3?(s/1e3).toFixed(1)+"K":s.toString(),[]),x=[{key:"like",shape:"heart",label:"Like",count:m.likes,isActive:(n==null?void 0:n.liked)??!1,onClick:o},{key:"share",shape:"share",label:"Share",count:m.shares,isActive:(n==null?void 0:n.shared)??!1,onClick:_},{key:"bookmark",shape:"star",label:"Bookmark",count:m.bookmarks,isActive:(n==null?void 0:n.bookmarked)??!1,onClick:g}];return e.jsx("div",{ref:M,className:`nice-social-panel nice-social-panel--${r} nice-social-panel--${b} ${N??""}`,style:k,children:x.map(s=>e.jsxs("button",{className:`nice-social-panel__btn nice-social-panel__btn--${s.key} ${s.isActive?"nice-social-panel__btn--active":""}`,onClick:s.onClick,title:s.label,"aria-label":s.label,"aria-pressed":s.isActive,children:[e.jsx("span",{className:"nice-social-panel__icon",children:e.jsx(O,{shape:s.shape,filled:s.isActive||s.shape==="share"})}),S&&e.jsx("span",{className:"nice-social-panel__label",children:s.label}),$&&e.jsx("span",{className:"nice-social-panel__count",children:w(s.count)})]},s.key))})}),H=l.forwardRef(function(u,M){const{tags:m,onTagClick:n,minFontSize:o=12,maxFontSize:_=36,sortBy:g="weight",maxTags:r,selectedIds:b,className:$,style:S}=u,N=l.useMemo(()=>{let s=[...m];if(g==="weight")s.sort((h,v)=>v.weight-h.weight);else if(g==="alphabetical")s.sort((h,v)=>h.label.localeCompare(v.label));else for(let h=s.length-1;h>0;h--){const v=Math.floor(Math.random()*(h+1));[s[h],s[v]]=[s[v],s[h]]}return r&&s.length>r&&(s=s.slice(0,r)),s},[m,g,r]),{minW:k,maxW:w}=l.useMemo(()=>{if(N.length===0)return{minW:0,maxW:1};const s=N.map(h=>h.weight);return{minW:Math.min(...s),maxW:Math.max(...s)}},[N]),x=s=>{if(w===k)return(o+_)/2;const h=(s-k)/(w-k);return o+h*(_-o)};return e.jsx("div",{ref:M,className:`nice-tag-cloud ${$??""}`,style:S,children:N.length===0?e.jsx("p",{className:"nice-tag-cloud__empty",children:"No tags."}):N.map(s=>{const h=b==null?void 0:b.includes(s.id),v=x(s.weight);return e.jsx("span",{className:`nice-tag-cloud__tag ${h?"nice-tag-cloud__tag--selected":""}`,style:{fontSize:v,color:s.color,cursor:n?"pointer":void 0},onClick:()=>n==null?void 0:n(s),role:n?"button":void 0,tabIndex:n?0:void 0,onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&n&&n(s)},title:`${s.label} (${s.weight})`,children:s.label},s.id)})})}),q={online:"#22c55e",away:"#eab308",busy:"#ef4444",offline:"#9ca3af"},V=l.forwardRef(function(u,M){const{users:m,onUserClick:n,onAction:o,actions:_=[],searchable:g=!1,statusFilter:r,showStatus:b=!0,layout:$="list",groupByRole:S=!1,className:N,style:k}=u,[w,x]=l.useState(""),s=l.useMemo(()=>{let t=m;if(r&&r.length>0&&(t=t.filter(i=>i.status&&r.includes(i.status))),w.trim()){const i=w.toLowerCase();t=t.filter(c=>{var a,y;return c.name.toLowerCase().includes(i)||((a=c.email)==null?void 0:a.toLowerCase().includes(i))||((y=c.role)==null?void 0:y.toLowerCase().includes(i))})}return t},[m,r,w]),h=l.useMemo(()=>{if(!S)return{"":s};const t={};for(const i of s){const c=i.role??"Other";t[c]||(t[c]=[]),t[c].push(i)}return t},[s,S]),v=t=>e.jsxs("div",{className:`nice-user-list__item nice-user-list__item--${$}`,onClick:()=>n==null?void 0:n(t),role:n?"button":void 0,tabIndex:n?0:void 0,onKeyDown:i=>{i.key==="Enter"&&n&&n(t)},children:[e.jsxs("div",{className:"nice-user-list__avatar-wrap",children:[t.avatarUrl?e.jsx("img",{src:t.avatarUrl,alt:t.name,className:"nice-user-list__avatar"}):e.jsx("span",{className:"nice-user-list__avatar-placeholder",children:t.name.charAt(0).toUpperCase()}),b&&t.status&&e.jsx("span",{className:"nice-user-list__status-dot",style:{backgroundColor:q[t.status]},title:t.status})]}),e.jsxs("div",{className:"nice-user-list__info",children:[e.jsx("span",{className:"nice-user-list__name",children:t.name}),t.email&&e.jsx("span",{className:"nice-user-list__email",children:t.email}),t.role&&e.jsx("span",{className:"nice-user-list__role",children:t.role})]}),_.length>0&&e.jsx("div",{className:"nice-user-list__actions",children:_.map(i=>e.jsx("button",{className:"nice-user-list__action-btn",onClick:c=>{c.stopPropagation(),o==null||o(t,i)},children:i},i))})]},t.id);return e.jsxs("div",{ref:M,className:`nice-user-list nice-user-list--${$} ${N??""}`,style:k,children:[g&&e.jsx("input",{type:"text",value:w,onChange:t=>x(t.target.value),placeholder:"Search usersโ€ฆ",className:"nice-user-list__search"}),s.length===0?e.jsx("p",{className:"nice-user-list__empty",children:"No users found."}):Object.entries(h).map(([t,i])=>e.jsxs("div",{className:"nice-user-list__group",children:[S&&t&&e.jsxs("h4",{className:"nice-user-list__group-title",children:[t," (",i.length,")"]}),i.map(v)]},t))]})});function Y(T){if(!T)return"";let u=T;return u=u.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""),u=u.replace(/\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,""),u=u.replace(/(href|src|action)\s*=\s*(?:"javascript:[^"]*"|'javascript:[^']*')/gi,'$1=""'),u=u.replace(/(href|src|action)\s*=\s*(?:"vbscript:[^"]*"|'vbscript:[^']*')/gi,'$1=""'),u=u.replace(/<\/?(iframe|object|embed|form)\b[^>]*>/gi,""),u}const G=l.forwardRef(function(u,M){const{pages:m,selectedPageId:n,onSelectPage:o,onSavePage:_,onDeletePage:g,onCreatePage:r,editable:b=!1,searchable:$=!0,renderHtml:S=!1,sidebarWidth:N=260,className:k,style:w}=u,[x,s]=l.useState(""),[h,v]=l.useState(!1),[t,i]=l.useState(""),[c,a]=l.useState(""),[y,E]=l.useState(""),[L,R]=l.useState(!1),P=l.useMemo(()=>{if(m.some(f=>f.children&&f.children.length>0))return m.filter(f=>!f.parentId);const p=new Map;for(const f of m)p.set(f.id,{...f,children:[]});const j=[];for(const f of p.values())f.parentId&&p.has(f.parentId)?p.get(f.parentId).children.push(f):j.push(f);return j},[m]),C=l.useMemo(()=>m.find(p=>p.id===n),[m,n]),I=l.useMemo(()=>{if(!x.trim())return P;const p=x.toLowerCase(),j=new Set(m.filter(f=>f.title.toLowerCase().includes(p)).map(f=>f.id));return m.filter(f=>j.has(f.id))},[P,m,x]),D=l.useCallback(()=>{C&&(i(C.title),a(C.content??""),v(!0))},[C]),d=l.useCallback(()=>{!C||!_||(_(C.id,c,t),v(!1))},[C,c,t,_]),A=l.useCallback(()=>{!y.trim()||!r||(r(n??null,y.trim()),E(""),R(!1))},[y,n,r]),F=(p,j=0)=>{var f;return e.jsxs("div",{children:[e.jsx("div",{className:`nice-wiki__page-item ${p.id===n?"nice-wiki__page-item--active":""}`,style:{paddingLeft:12+j*16},onClick:()=>o==null?void 0:o(p),role:"button",tabIndex:0,onKeyDown:W=>{W.key==="Enter"&&(o==null||o(p))},children:p.title}),(f=p.children)==null?void 0:f.map(W=>F(W,j+1))]},p.id)};return e.jsxs("div",{ref:M,className:`nice-wiki ${k??""}`,style:{display:"flex",...w},children:[e.jsxs("div",{className:"nice-wiki__sidebar",style:{width:N,minWidth:N},children:[e.jsxs("div",{className:"nice-wiki__sidebar-header",children:[e.jsx("strong",{children:"Wiki"}),b&&r&&e.jsx("button",{onClick:()=>R(!L),title:"New page",children:"+"})]}),L&&e.jsxs("div",{className:"nice-wiki__new-page",children:[e.jsx("input",{type:"text",value:y,onChange:p=>E(p.target.value),placeholder:"New page title"}),e.jsx("button",{onClick:A,disabled:!y.trim(),children:"Create"})]}),$&&e.jsx("input",{type:"text",className:"nice-wiki__search",value:x,onChange:p=>s(p.target.value),placeholder:"Search pagesโ€ฆ"}),e.jsx("div",{className:"nice-wiki__tree",children:I.length===0?e.jsx("p",{className:"nice-wiki__empty",children:"No pages."}):I.map(p=>F(p))})]}),e.jsx("div",{className:"nice-wiki__content",children:C?h?e.jsxs("div",{className:"nice-wiki__editor",children:[e.jsx("input",{type:"text",className:"nice-wiki__edit-title",value:t,onChange:p=>i(p.target.value)}),e.jsx("textarea",{className:"nice-wiki__edit-body",value:c,onChange:p=>a(p.target.value),rows:20}),e.jsxs("div",{className:"nice-wiki__edit-actions",children:[e.jsx("button",{onClick:d,children:"Save"}),e.jsx("button",{onClick:()=>v(!1),children:"Cancel"})]})]}):e.jsxs("div",{className:"nice-wiki__viewer",children:[e.jsxs("div",{className:"nice-wiki__viewer-header",children:[e.jsx("h2",{children:C.title}),e.jsxs("div",{className:"nice-wiki__viewer-meta",children:[C.lastEditedBy&&e.jsxs("span",{children:["Edited by ",C.lastEditedBy]}),C.lastEditedAt&&e.jsxs("span",{children:[" on ",C.lastEditedAt]})]}),b&&e.jsxs("div",{className:"nice-wiki__viewer-actions",children:[e.jsx("button",{onClick:D,children:"Edit"}),g&&e.jsx("button",{onClick:()=>g(C.id),children:"Delete"})]})]}),S?e.jsx("div",{className:"nice-wiki__viewer-body",dangerouslySetInnerHTML:{__html:Y(C.content??"")}}):e.jsx("div",{className:"nice-wiki__viewer-body",children:C.content??e.jsx("em",{children:"No content."})})]}):e.jsx("div",{className:"nice-wiki__placeholder",children:"Select a page from the sidebar."})})]})}),J={comment:"var(--nice-color-primary, #3b82f6)",like:"var(--nice-color-error, #ef4444)",share:"var(--nice-color-info, #0ea5e9)",create:"var(--nice-color-success, #22c55e)",update:"var(--nice-color-warning, #f59e0b)",delete:"var(--nice-color-error, #ef4444)",join:"var(--nice-color-success, #22c55e)",leave:"var(--nice-text-muted, #6b7280)",upload:"var(--nice-color-accent, #8b5cf6)",mention:"var(--nice-color-primary, #3b82f6)",custom:"var(--nice-text-muted, #6b7280)"},Q=l.forwardRef(function(u,M){const{events:m,onEventClick:n,groupByDate:o=!0,typeFilter:_,showFilters:g=!1,maxEvents:r,onLoadMore:b,hasMore:$=!1,className:S,style:N}=u,[k,w]=l.useState(new Set),x=_??(k.size>0?Array.from(k):void 0),s=l.useMemo(()=>{let i=m;if(x&&x.length>0){const c=new Set(x);i=i.filter(a=>c.has(a.type))}return r&&(i=i.slice(0,r)),i},[m,x,r]),h=l.useMemo(()=>{if(!o)return[{label:"",events:s}];const i=new Map;for(const c of s){const a=c.timestamp.slice(0,10);i.has(a)||i.set(a,[]),i.get(a).push(c)}return Array.from(i.entries()).map(([c,a])=>({label:c,events:a}))},[s,o]),v=l.useMemo(()=>{const i=new Set(m.map(c=>c.type));return Array.from(i).sort()},[m]),t=i=>{w(c=>{const a=new Set(c);return a.has(i)?a.delete(i):a.add(i),a})};return e.jsxs("div",{ref:M,className:`nice-activity-feed ${S??""}`,style:N,children:[g&&!_&&e.jsxs("div",{className:"nice-activity-feed__filters",children:[v.map(i=>e.jsx("button",{className:`nice-activity-feed__filter-chip ${k.has(i)?"nice-activity-feed__filter-chip--active":""}`,onClick:()=>t(i),children:i},i)),k.size>0&&e.jsx("button",{className:"nice-activity-feed__filter-clear",onClick:()=>w(new Set),children:"Clear"})]}),s.length===0?e.jsx("p",{className:"nice-activity-feed__empty",children:"No activity."}):h.map(({label:i,events:c})=>e.jsxs("div",{className:"nice-activity-feed__group",children:[o&&i&&e.jsx("div",{className:"nice-activity-feed__date-label",children:i}),c.map(a=>e.jsxs("div",{className:"nice-activity-feed__event",onClick:()=>n==null?void 0:n(a),role:n?"button":void 0,tabIndex:n?0:void 0,onKeyDown:y=>{y.key==="Enter"&&n&&n(a)},children:[e.jsx("span",{className:`nice-activity-feed__icon nice-activity-feed__icon--${a.type}`,title:a.type,"aria-hidden":"true",style:{display:"inline-block",width:10,height:10,marginTop:4,flexShrink:0,borderRadius:"50%",background:J[a.type]}}),e.jsxs("div",{className:"nice-activity-feed__body",children:[a.actorAvatarUrl&&e.jsx("img",{src:a.actorAvatarUrl,alt:"",className:"nice-activity-feed__avatar"}),e.jsxs("span",{className:"nice-activity-feed__message",children:[e.jsx("strong",{children:a.actorName})," ",a.message,a.targetLabel&&e.jsxs(e.Fragment,{children:[" ",e.jsx("em",{children:a.targetLabel})]})]}),e.jsx("time",{className:"nice-activity-feed__time",children:a.timestamp})]})]},a.id))]},i||"__all")),$&&b&&e.jsx("button",{className:"nice-activity-feed__load-more",onClick:b,children:"Load more"})]})});exports.NiceActivityFeed=Q;exports.NiceComments=U;exports.NiceRatings=B;exports.NiceSocialPanel=K;exports.NiceTagCloud=H;exports.NiceUserList=V;exports.NiceWiki=G;
package/dist/index.mjs CHANGED
@@ -1,46 +1,46 @@
1
- import { jsxs as c, jsx as e, Fragment as H } from "react/jsx-runtime";
2
- import { forwardRef as R, useState as $, useCallback as D, useMemo as F } from "react";
3
- const ee = R(
4
- function(p, I) {
1
+ import { jsxs as l, jsx as e, Fragment as H } from "react/jsx-runtime";
2
+ import { forwardRef as W, useState as L, useCallback as D, useMemo as P } from "react";
3
+ const X = W(
4
+ function(u, T) {
5
5
  const {
6
6
  comments: m,
7
- currentUserId: a,
7
+ currentUserId: s,
8
8
  onSubmit: o,
9
9
  onEdit: _,
10
- onDelete: g,
10
+ onDelete: N,
11
11
  onReact: r,
12
12
  readOnly: w = !1,
13
- maxDepth: T = 4,
14
- reactions: E = ["๐Ÿ‘", "โค๏ธ", "๐Ÿ˜‚", "๐Ÿ˜ฎ", "๐Ÿ˜ข"],
13
+ maxDepth: E = 4,
14
+ reactions: $ = ["๐Ÿ‘", "โค๏ธ", "๐Ÿ˜‚", "๐Ÿ˜ฎ", "๐Ÿ˜ข"],
15
15
  placeholder: b = "Write a commentโ€ฆ",
16
16
  className: C,
17
- style: S
18
- } = p, [v, i] = $(""), [h, N] = $(null), [n, t] = $(""), [l, s] = $(null), [k, L] = $(""), A = /* @__PURE__ */ new Map();
17
+ style: x
18
+ } = u, [v, i] = L(""), [h, g] = L(null), [a, t] = L(""), [c, n] = L(null), [k, I] = L(""), F = /* @__PURE__ */ new Map();
19
19
  for (const d of m) {
20
- const P = d.parentId ?? "__root__";
21
- A.has(P) || A.set(P, []), A.get(P).push(d);
20
+ const M = d.parentId ?? "__root__";
21
+ F.has(M) || F.set(M, []), F.get(M).push(d);
22
22
  }
23
23
  const j = D(() => {
24
24
  !v.trim() || !o || (o(v.trim()), i(""));
25
25
  }, [v, o]), z = D(() => {
26
- !n.trim() || !o || !h || (o(n.trim(), h), t(""), N(null));
27
- }, [n, h, o]), x = D(() => {
28
- !l || !k.trim() || !_ || (_(l, k.trim()), s(null), L(""));
29
- }, [l, k, _]), W = (d, P) => {
30
- const U = a && d.authorId === a, u = A.get(d.id) ?? [];
31
- return /* @__PURE__ */ c("div", { className: "nice-comments__item", style: { marginLeft: P * 24 }, children: [
32
- /* @__PURE__ */ c("div", { className: "nice-comments__header", children: [
26
+ !a.trim() || !o || !h || (o(a.trim(), h), t(""), g(null));
27
+ }, [a, h, o]), S = D(() => {
28
+ !c || !k.trim() || !_ || (_(c, k.trim()), n(null), I(""));
29
+ }, [c, k, _]), O = (d, M) => {
30
+ const R = s && d.authorId === s, p = F.get(d.id) ?? [];
31
+ return /* @__PURE__ */ l("div", { className: "nice-comments__item", style: { marginLeft: M * 24 }, children: [
32
+ /* @__PURE__ */ l("div", { className: "nice-comments__header", children: [
33
33
  d.authorAvatarUrl && /* @__PURE__ */ e("img", { src: d.authorAvatarUrl, alt: "", className: "nice-comments__avatar" }),
34
34
  /* @__PURE__ */ e("strong", { className: "nice-comments__author", children: d.authorName }),
35
35
  /* @__PURE__ */ e("time", { className: "nice-comments__time", children: d.createdAt }),
36
36
  d.isEdited && /* @__PURE__ */ e("span", { className: "nice-comments__edited", children: "(edited)" })
37
37
  ] }),
38
- l === d.id ? /* @__PURE__ */ c("div", { className: "nice-comments__edit-form", children: [
39
- /* @__PURE__ */ e("textarea", { value: k, onChange: (y) => L(y.target.value) }),
40
- /* @__PURE__ */ e("button", { onClick: x, children: "Save" }),
41
- /* @__PURE__ */ e("button", { onClick: () => s(null), children: "Cancel" })
38
+ c === d.id ? /* @__PURE__ */ l("div", { className: "nice-comments__edit-form", children: [
39
+ /* @__PURE__ */ e("textarea", { value: k, onChange: (y) => I(y.target.value) }),
40
+ /* @__PURE__ */ e("button", { onClick: S, children: "Save" }),
41
+ /* @__PURE__ */ e("button", { onClick: () => n(null), children: "Cancel" })
42
42
  ] }) : /* @__PURE__ */ e("p", { className: "nice-comments__content", children: d.isDeleted ? /* @__PURE__ */ e("em", { children: "Comment deleted" }) : d.content }),
43
- !d.isDeleted && d.reactions && /* @__PURE__ */ e("div", { className: "nice-comments__reactions", children: Object.entries(d.reactions).map(([y, f]) => /* @__PURE__ */ c(
43
+ !d.isDeleted && d.reactions && /* @__PURE__ */ e("div", { className: "nice-comments__reactions", children: Object.entries(d.reactions).map(([y, f]) => /* @__PURE__ */ l(
44
44
  "button",
45
45
  {
46
46
  className: "nice-comments__reaction",
@@ -53,45 +53,45 @@ const ee = R(
53
53
  },
54
54
  y
55
55
  )) }),
56
- !d.isDeleted && !w && /* @__PURE__ */ c("div", { className: "nice-comments__actions", children: [
57
- r && E.map((y) => /* @__PURE__ */ e("button", { onClick: () => r(d.id, y), title: y, children: y }, y)),
58
- P < T && /* @__PURE__ */ e(
56
+ !d.isDeleted && !w && /* @__PURE__ */ l("div", { className: "nice-comments__actions", children: [
57
+ r && $.map((y) => /* @__PURE__ */ e("button", { onClick: () => r(d.id, y), title: y, children: y }, y)),
58
+ M < E && /* @__PURE__ */ e(
59
59
  "button",
60
60
  {
61
61
  onClick: () => {
62
- N(d.id), t("");
62
+ g(d.id), t("");
63
63
  },
64
64
  children: "Reply"
65
65
  }
66
66
  ),
67
- U && _ && /* @__PURE__ */ e(
67
+ R && _ && /* @__PURE__ */ e(
68
68
  "button",
69
69
  {
70
70
  onClick: () => {
71
- s(d.id), L(d.content);
71
+ n(d.id), I(d.content);
72
72
  },
73
73
  children: "Edit"
74
74
  }
75
75
  ),
76
- U && g && /* @__PURE__ */ e("button", { onClick: () => g(d.id), children: "Delete" })
76
+ R && N && /* @__PURE__ */ e("button", { onClick: () => N(d.id), children: "Delete" })
77
77
  ] }),
78
- h === d.id && /* @__PURE__ */ c("div", { className: "nice-comments__reply-form", children: [
78
+ h === d.id && /* @__PURE__ */ l("div", { className: "nice-comments__reply-form", children: [
79
79
  /* @__PURE__ */ e(
80
80
  "textarea",
81
81
  {
82
- value: n,
82
+ value: a,
83
83
  onChange: (y) => t(y.target.value),
84
84
  placeholder: "Write a replyโ€ฆ"
85
85
  }
86
86
  ),
87
- /* @__PURE__ */ e("button", { onClick: z, disabled: !n.trim(), children: "Send" }),
88
- /* @__PURE__ */ e("button", { onClick: () => N(null), children: "Cancel" })
87
+ /* @__PURE__ */ e("button", { onClick: z, disabled: !a.trim(), children: "Send" }),
88
+ /* @__PURE__ */ e("button", { onClick: () => g(null), children: "Cancel" })
89
89
  ] }),
90
- u.map((y) => W(y, P + 1))
90
+ p.map((y) => O(y, M + 1))
91
91
  ] }, d.id);
92
- }, O = A.get("__root__") ?? [];
93
- return /* @__PURE__ */ c("div", { ref: I, className: `nice-comments ${C ?? ""}`, style: S, children: [
94
- !w && /* @__PURE__ */ c("div", { className: "nice-comments__new", children: [
92
+ }, U = F.get("__root__") ?? [];
93
+ return /* @__PURE__ */ l("div", { ref: T, className: `nice-comments ${C ?? ""}`, style: x, children: [
94
+ !w && /* @__PURE__ */ l("div", { className: "nice-comments__new", children: [
95
95
  /* @__PURE__ */ e(
96
96
  "textarea",
97
97
  {
@@ -102,173 +102,194 @@ const ee = R(
102
102
  ),
103
103
  /* @__PURE__ */ e("button", { onClick: j, disabled: !v.trim(), children: "Post" })
104
104
  ] }),
105
- O.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-comments__empty", children: "No comments yet." }) : O.map((d) => W(d, 0))
105
+ U.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-comments__empty", children: "No comments yet." }) : U.map((d) => O(d, 0))
106
106
  ] });
107
107
  }
108
- ), V = "โ˜†", Y = "โ˜…", q = "โ™ก", G = "โ™ฅ", ie = R(
109
- function(p, I) {
108
+ ), V = {
109
+ star: "polygon(50% 2%, 62% 36%, 98% 37%, 69% 59%, 79% 94%, 50% 73%, 21% 94%, 31% 59%, 2% 37%, 38% 36%)",
110
+ heart: "polygon(50% 92%, 12% 54%, 4% 40%, 4% 25%, 10% 13%, 22% 6%, 34% 6%, 44% 12%, 50% 21%, 56% 12%, 66% 6%, 78% 6%, 90% 13%, 96% 25%, 96% 40%, 88% 54%)",
111
+ share: "polygon(42% 8%, 92% 8%, 92% 58%, 75% 41%, 27% 89%, 11% 73%, 59% 25%)"
112
+ }, K = ({
113
+ shape: A,
114
+ filled: u = !0
115
+ }) => /* @__PURE__ */ e(
116
+ "span",
117
+ {
118
+ "aria-hidden": "true",
119
+ className: `nice-social-shape nice-social-shape--${A}`,
120
+ style: {
121
+ display: "inline-block",
122
+ width: "1em",
123
+ height: "1em",
124
+ verticalAlign: "-0.125em",
125
+ background: "currentColor",
126
+ clipPath: V[A],
127
+ opacity: u ? 1 : 0.35
128
+ }
129
+ }
130
+ ), Z = W(
131
+ function(u, T) {
110
132
  const {
111
133
  value: m,
112
- max: a = 5,
134
+ max: s = 5,
113
135
  mode: o = "stars",
114
136
  aggregation: _,
115
- onChange: g,
137
+ onChange: N,
116
138
  readOnly: r = !1,
117
139
  size: w = "md",
118
- showValue: T = !1,
119
- label: E,
140
+ showValue: E = !1,
141
+ label: $,
120
142
  emojiSet: b = ["๐Ÿ˜ข", "๐Ÿ˜•", "๐Ÿ˜", "๐Ÿ™‚", "๐Ÿ˜"],
121
143
  className: C,
122
- style: S
123
- } = p, [v, i] = $(null), h = v !== null ? v + 1 : m ?? 0, N = D(
124
- (l) => {
125
- r || !g || g(l + 1);
144
+ style: x
145
+ } = u, [v, i] = L(null), h = v !== null ? v + 1 : m ?? 0, g = D(
146
+ (c) => {
147
+ r || !N || N(c + 1);
126
148
  },
127
- [r, g]
128
- ), n = () => {
129
- const l = [];
130
- for (let s = 0; s < a; s++) {
131
- const k = s < h;
132
- let L;
133
- o === "emoji" ? L = b[s] ?? b[b.length - 1] : o === "hearts" ? L = k ? G : q : o === "thumbs" ? L = k ? "๐Ÿ‘" : "๐Ÿ‘Ž" : L = k ? Y : V, l.push(
149
+ [r, N]
150
+ ), a = () => {
151
+ const c = [];
152
+ for (let n = 0; n < s; n++) {
153
+ const k = n < h;
154
+ let I;
155
+ o === "emoji" ? I = b[n] ?? b[b.length - 1] : o === "hearts" ? I = /* @__PURE__ */ e(K, { shape: "heart", filled: k }) : o === "thumbs" ? I = k ? "๐Ÿ‘" : "๐Ÿ‘Ž" : I = /* @__PURE__ */ e(K, { shape: "star", filled: k }), c.push(
134
156
  /* @__PURE__ */ e(
135
157
  "span",
136
158
  {
137
159
  className: `nice-ratings__symbol ${k ? "nice-ratings__symbol--active" : ""}`,
138
- onClick: () => N(s),
139
- onMouseEnter: () => !r && i(s),
160
+ onClick: () => g(n),
161
+ onMouseEnter: () => !r && i(n),
140
162
  onMouseLeave: () => !r && i(null),
141
163
  role: r ? void 0 : "button",
142
164
  tabIndex: r ? void 0 : 0,
143
- onKeyDown: (A) => {
144
- (A.key === "Enter" || A.key === " ") && N(s);
165
+ onKeyDown: (F) => {
166
+ (F.key === "Enter" || F.key === " ") && g(n);
145
167
  },
146
- children: L
168
+ children: I
147
169
  },
148
- s
170
+ n
149
171
  )
150
172
  );
151
173
  }
152
- return l;
153
- }, t = () => /* @__PURE__ */ c("div", { className: "nice-ratings__numeric", children: [
174
+ return c;
175
+ }, t = () => /* @__PURE__ */ l("div", { className: "nice-ratings__numeric", children: [
154
176
  /* @__PURE__ */ e(
155
177
  "input",
156
178
  {
157
179
  type: "number",
158
180
  min: 0,
159
- max: a,
181
+ max: s,
160
182
  step: 0.5,
161
183
  value: m ?? 0,
162
- onChange: (l) => g == null ? void 0 : g(parseFloat(l.target.value) || 0),
184
+ onChange: (c) => N == null ? void 0 : N(parseFloat(c.target.value) || 0),
163
185
  readOnly: r,
164
186
  className: "nice-ratings__numeric-input"
165
187
  }
166
188
  ),
167
- /* @__PURE__ */ c("span", { className: "nice-ratings__numeric-max", children: [
189
+ /* @__PURE__ */ l("span", { className: "nice-ratings__numeric-max", children: [
168
190
  "/ ",
169
- a
191
+ s
170
192
  ] })
171
193
  ] });
172
- return /* @__PURE__ */ c(
194
+ return /* @__PURE__ */ l(
173
195
  "div",
174
196
  {
175
- ref: I,
197
+ ref: T,
176
198
  className: `nice-ratings nice-ratings--${w} nice-ratings--${o} ${r ? "nice-ratings--readonly" : ""} ${C ?? ""}`,
177
- style: S,
199
+ style: x,
178
200
  children: [
179
- E && /* @__PURE__ */ e("span", { className: "nice-ratings__label", children: E }),
180
- /* @__PURE__ */ c("div", { className: "nice-ratings__body", children: [
181
- o === "numeric" ? t() : n(),
182
- T && o !== "numeric" && /* @__PURE__ */ c("span", { className: "nice-ratings__value", children: [
201
+ $ && /* @__PURE__ */ e("span", { className: "nice-ratings__label", children: $ }),
202
+ /* @__PURE__ */ l("div", { className: "nice-ratings__body", children: [
203
+ o === "numeric" ? t() : a(),
204
+ E && o !== "numeric" && /* @__PURE__ */ l("span", { className: "nice-ratings__value", children: [
183
205
  h,
184
206
  " / ",
185
- a
207
+ s
186
208
  ] })
187
209
  ] }),
188
- _ && /* @__PURE__ */ c("div", { className: "nice-ratings__aggregation", children: [
210
+ _ && /* @__PURE__ */ l("div", { className: "nice-ratings__aggregation", children: [
189
211
  /* @__PURE__ */ e("span", { className: "nice-ratings__avg", children: _.average.toFixed(1) }),
190
- /* @__PURE__ */ c("span", { className: "nice-ratings__count", children: [
212
+ /* @__PURE__ */ l("span", { className: "nice-ratings__count", children: [
191
213
  "(",
192
214
  _.count,
193
215
  " ratings)"
194
216
  ] }),
195
- _.distribution && /* @__PURE__ */ e("div", { className: "nice-ratings__distribution", children: Object.entries(_.distribution).sort(([l], [s]) => +s - +l).map(([l, s]) => /* @__PURE__ */ c("div", { className: "nice-ratings__distribution-row", children: [
196
- /* @__PURE__ */ e("span", { children: l }),
217
+ _.distribution && /* @__PURE__ */ e("div", { className: "nice-ratings__distribution", children: Object.entries(_.distribution).sort(([c], [n]) => +n - +c).map(([c, n]) => /* @__PURE__ */ l("div", { className: "nice-ratings__distribution-row", children: [
218
+ /* @__PURE__ */ e("span", { children: c }),
197
219
  /* @__PURE__ */ e("div", { className: "nice-ratings__bar", children: /* @__PURE__ */ e(
198
220
  "div",
199
221
  {
200
222
  className: "nice-ratings__bar-fill",
201
223
  style: {
202
- width: `${_.count ? s / _.count * 100 : 0}%`
224
+ width: `${_.count ? n / _.count * 100 : 0}%`
203
225
  }
204
226
  }
205
227
  ) }),
206
- /* @__PURE__ */ e("span", { children: s })
207
- ] }, l)) })
228
+ /* @__PURE__ */ e("span", { children: n })
229
+ ] }, c)) })
208
230
  ] })
209
231
  ]
210
232
  }
211
233
  );
212
234
  }
213
- ), te = R(
214
- function(p, I) {
235
+ ), ee = W(
236
+ function(u, T) {
215
237
  const {
216
238
  stats: m,
217
- userState: a,
239
+ userState: s,
218
240
  onLike: o,
219
241
  onShare: _,
220
- onBookmark: g,
242
+ onBookmark: N,
221
243
  direction: r = "horizontal",
222
244
  size: w = "md",
223
- showCounts: T = !0,
224
- showLabels: E = !1,
245
+ showCounts: E = !0,
246
+ showLabels: $ = !1,
225
247
  className: b,
226
248
  style: C
227
- } = p, S = D((i) => i >= 1e6 ? (i / 1e6).toFixed(1) + "M" : i >= 1e3 ? (i / 1e3).toFixed(1) + "K" : i.toString(), []), v = [
249
+ } = u, x = D((i) => i >= 1e6 ? (i / 1e6).toFixed(1) + "M" : i >= 1e3 ? (i / 1e3).toFixed(1) + "K" : i.toString(), []), v = [
228
250
  {
229
251
  key: "like",
230
- icon: "โ™ก",
231
- activeIcon: "โ™ฅ",
252
+ shape: "heart",
232
253
  label: "Like",
233
254
  count: m.likes,
234
- isActive: (a == null ? void 0 : a.liked) ?? !1,
255
+ isActive: (s == null ? void 0 : s.liked) ?? !1,
235
256
  onClick: o
236
257
  },
237
258
  {
238
259
  key: "share",
239
- icon: "โ†—",
240
- activeIcon: "โ†—",
260
+ shape: "share",
241
261
  label: "Share",
242
262
  count: m.shares,
243
- isActive: (a == null ? void 0 : a.shared) ?? !1,
263
+ isActive: (s == null ? void 0 : s.shared) ?? !1,
244
264
  onClick: _
245
265
  },
246
266
  {
247
267
  key: "bookmark",
248
- icon: "โ˜†",
249
- activeIcon: "โ˜…",
268
+ shape: "star",
250
269
  label: "Bookmark",
251
270
  count: m.bookmarks,
252
- isActive: (a == null ? void 0 : a.bookmarked) ?? !1,
253
- onClick: g
271
+ isActive: (s == null ? void 0 : s.bookmarked) ?? !1,
272
+ onClick: N
254
273
  }
255
274
  ];
256
275
  return /* @__PURE__ */ e(
257
276
  "div",
258
277
  {
259
- ref: I,
278
+ ref: T,
260
279
  className: `nice-social-panel nice-social-panel--${r} nice-social-panel--${w} ${b ?? ""}`,
261
280
  style: C,
262
- children: v.map((i) => /* @__PURE__ */ c(
281
+ children: v.map((i) => /* @__PURE__ */ l(
263
282
  "button",
264
283
  {
265
284
  className: `nice-social-panel__btn nice-social-panel__btn--${i.key} ${i.isActive ? "nice-social-panel__btn--active" : ""}`,
266
285
  onClick: i.onClick,
267
286
  title: i.label,
287
+ "aria-label": i.label,
288
+ "aria-pressed": i.isActive,
268
289
  children: [
269
- /* @__PURE__ */ e("span", { className: "nice-social-panel__icon", children: i.isActive ? i.activeIcon : i.icon }),
270
- E && /* @__PURE__ */ e("span", { className: "nice-social-panel__label", children: i.label }),
271
- T && /* @__PURE__ */ e("span", { className: "nice-social-panel__count", children: S(i.count) })
290
+ /* @__PURE__ */ e("span", { className: "nice-social-panel__icon", children: /* @__PURE__ */ e(K, { shape: i.shape, filled: i.isActive || i.shape === "share" }) }),
291
+ $ && /* @__PURE__ */ e("span", { className: "nice-social-panel__label", children: i.label }),
292
+ E && /* @__PURE__ */ e("span", { className: "nice-social-panel__count", children: x(i.count) })
272
293
  ]
273
294
  },
274
295
  i.key
@@ -276,57 +297,57 @@ const ee = R(
276
297
  }
277
298
  );
278
299
  }
279
- ), ne = R(
280
- function(p, I) {
300
+ ), ie = W(
301
+ function(u, T) {
281
302
  const {
282
303
  tags: m,
283
- onTagClick: a,
304
+ onTagClick: s,
284
305
  minFontSize: o = 12,
285
306
  maxFontSize: _ = 36,
286
- sortBy: g = "weight",
307
+ sortBy: N = "weight",
287
308
  maxTags: r,
288
309
  selectedIds: w,
289
- className: T,
290
- style: E
291
- } = p, b = F(() => {
310
+ className: E,
311
+ style: $
312
+ } = u, b = P(() => {
292
313
  let i = [...m];
293
- if (g === "weight")
294
- i.sort((h, N) => N.weight - h.weight);
295
- else if (g === "alphabetical")
296
- i.sort((h, N) => h.label.localeCompare(N.label));
314
+ if (N === "weight")
315
+ i.sort((h, g) => g.weight - h.weight);
316
+ else if (N === "alphabetical")
317
+ i.sort((h, g) => h.label.localeCompare(g.label));
297
318
  else
298
319
  for (let h = i.length - 1; h > 0; h--) {
299
- const N = Math.floor(Math.random() * (h + 1));
300
- [i[h], i[N]] = [i[N], i[h]];
320
+ const g = Math.floor(Math.random() * (h + 1));
321
+ [i[h], i[g]] = [i[g], i[h]];
301
322
  }
302
323
  return r && i.length > r && (i = i.slice(0, r)), i;
303
- }, [m, g, r]), { minW: C, maxW: S } = F(() => {
324
+ }, [m, N, r]), { minW: C, maxW: x } = P(() => {
304
325
  if (b.length === 0)
305
326
  return { minW: 0, maxW: 1 };
306
327
  const i = b.map((h) => h.weight);
307
328
  return { minW: Math.min(...i), maxW: Math.max(...i) };
308
329
  }, [b]), v = (i) => {
309
- if (S === C)
330
+ if (x === C)
310
331
  return (o + _) / 2;
311
- const h = (i - C) / (S - C);
332
+ const h = (i - C) / (x - C);
312
333
  return o + h * (_ - o);
313
334
  };
314
- return /* @__PURE__ */ e("div", { ref: I, className: `nice-tag-cloud ${T ?? ""}`, style: E, children: b.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-tag-cloud__empty", children: "No tags." }) : b.map((i) => {
315
- const h = w == null ? void 0 : w.includes(i.id), N = v(i.weight);
335
+ return /* @__PURE__ */ e("div", { ref: T, className: `nice-tag-cloud ${E ?? ""}`, style: $, children: b.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-tag-cloud__empty", children: "No tags." }) : b.map((i) => {
336
+ const h = w == null ? void 0 : w.includes(i.id), g = v(i.weight);
316
337
  return /* @__PURE__ */ e(
317
338
  "span",
318
339
  {
319
340
  className: `nice-tag-cloud__tag ${h ? "nice-tag-cloud__tag--selected" : ""}`,
320
341
  style: {
321
- fontSize: N,
342
+ fontSize: g,
322
343
  color: i.color,
323
- cursor: a ? "pointer" : void 0
344
+ cursor: s ? "pointer" : void 0
324
345
  },
325
- onClick: () => a == null ? void 0 : a(i),
326
- role: a ? "button" : void 0,
327
- tabIndex: a ? 0 : void 0,
328
- onKeyDown: (n) => {
329
- (n.key === "Enter" || n.key === " ") && a && a(i);
346
+ onClick: () => s == null ? void 0 : s(i),
347
+ role: s ? "button" : void 0,
348
+ tabIndex: s ? 0 : void 0,
349
+ onKeyDown: (a) => {
350
+ (a.key === "Enter" || a.key === " ") && s && s(i);
330
351
  },
331
352
  title: `${i.label} (${i.weight})`,
332
353
  children: i.label
@@ -335,79 +356,79 @@ const ee = R(
335
356
  );
336
357
  }) });
337
358
  }
338
- ), J = {
359
+ ), q = {
339
360
  online: "#22c55e",
340
361
  away: "#eab308",
341
362
  busy: "#ef4444",
342
363
  offline: "#9ca3af"
343
- }, ae = R(
344
- function(p, I) {
364
+ }, te = W(
365
+ function(u, T) {
345
366
  const {
346
367
  users: m,
347
- onUserClick: a,
368
+ onUserClick: s,
348
369
  onAction: o,
349
370
  actions: _ = [],
350
- searchable: g = !1,
371
+ searchable: N = !1,
351
372
  statusFilter: r,
352
373
  showStatus: w = !0,
353
- layout: T = "list",
354
- groupByRole: E = !1,
374
+ layout: E = "list",
375
+ groupByRole: $ = !1,
355
376
  className: b,
356
377
  style: C
357
- } = p, [S, v] = $(""), i = F(() => {
358
- let n = m;
359
- if (r && r.length > 0 && (n = n.filter((t) => t.status && r.includes(t.status))), S.trim()) {
360
- const t = S.toLowerCase();
361
- n = n.filter(
362
- (l) => {
363
- var s, k;
364
- return l.name.toLowerCase().includes(t) || ((s = l.email) == null ? void 0 : s.toLowerCase().includes(t)) || ((k = l.role) == null ? void 0 : k.toLowerCase().includes(t));
378
+ } = u, [x, v] = L(""), i = P(() => {
379
+ let a = m;
380
+ if (r && r.length > 0 && (a = a.filter((t) => t.status && r.includes(t.status))), x.trim()) {
381
+ const t = x.toLowerCase();
382
+ a = a.filter(
383
+ (c) => {
384
+ var n, k;
385
+ return c.name.toLowerCase().includes(t) || ((n = c.email) == null ? void 0 : n.toLowerCase().includes(t)) || ((k = c.role) == null ? void 0 : k.toLowerCase().includes(t));
365
386
  }
366
387
  );
367
388
  }
368
- return n;
369
- }, [m, r, S]), h = F(() => {
370
- if (!E)
389
+ return a;
390
+ }, [m, r, x]), h = P(() => {
391
+ if (!$)
371
392
  return { "": i };
372
- const n = {};
393
+ const a = {};
373
394
  for (const t of i) {
374
- const l = t.role ?? "Other";
375
- n[l] || (n[l] = []), n[l].push(t);
395
+ const c = t.role ?? "Other";
396
+ a[c] || (a[c] = []), a[c].push(t);
376
397
  }
377
- return n;
378
- }, [i, E]), N = (n) => /* @__PURE__ */ c(
398
+ return a;
399
+ }, [i, $]), g = (a) => /* @__PURE__ */ l(
379
400
  "div",
380
401
  {
381
- className: `nice-user-list__item nice-user-list__item--${T}`,
382
- onClick: () => a == null ? void 0 : a(n),
383
- role: a ? "button" : void 0,
384
- tabIndex: a ? 0 : void 0,
402
+ className: `nice-user-list__item nice-user-list__item--${E}`,
403
+ onClick: () => s == null ? void 0 : s(a),
404
+ role: s ? "button" : void 0,
405
+ tabIndex: s ? 0 : void 0,
385
406
  onKeyDown: (t) => {
386
- t.key === "Enter" && a && a(n);
407
+ t.key === "Enter" && s && s(a);
387
408
  },
388
409
  children: [
389
- /* @__PURE__ */ c("div", { className: "nice-user-list__avatar-wrap", children: [
390
- n.avatarUrl ? /* @__PURE__ */ e("img", { src: n.avatarUrl, alt: n.name, className: "nice-user-list__avatar" }) : /* @__PURE__ */ e("span", { className: "nice-user-list__avatar-placeholder", children: n.name.charAt(0).toUpperCase() }),
391
- w && n.status && /* @__PURE__ */ e(
410
+ /* @__PURE__ */ l("div", { className: "nice-user-list__avatar-wrap", children: [
411
+ a.avatarUrl ? /* @__PURE__ */ e("img", { src: a.avatarUrl, alt: a.name, className: "nice-user-list__avatar" }) : /* @__PURE__ */ e("span", { className: "nice-user-list__avatar-placeholder", children: a.name.charAt(0).toUpperCase() }),
412
+ w && a.status && /* @__PURE__ */ e(
392
413
  "span",
393
414
  {
394
415
  className: "nice-user-list__status-dot",
395
- style: { backgroundColor: J[n.status] },
396
- title: n.status
416
+ style: { backgroundColor: q[a.status] },
417
+ title: a.status
397
418
  }
398
419
  )
399
420
  ] }),
400
- /* @__PURE__ */ c("div", { className: "nice-user-list__info", children: [
401
- /* @__PURE__ */ e("span", { className: "nice-user-list__name", children: n.name }),
402
- n.email && /* @__PURE__ */ e("span", { className: "nice-user-list__email", children: n.email }),
403
- n.role && /* @__PURE__ */ e("span", { className: "nice-user-list__role", children: n.role })
421
+ /* @__PURE__ */ l("div", { className: "nice-user-list__info", children: [
422
+ /* @__PURE__ */ e("span", { className: "nice-user-list__name", children: a.name }),
423
+ a.email && /* @__PURE__ */ e("span", { className: "nice-user-list__email", children: a.email }),
424
+ a.role && /* @__PURE__ */ e("span", { className: "nice-user-list__role", children: a.role })
404
425
  ] }),
405
426
  _.length > 0 && /* @__PURE__ */ e("div", { className: "nice-user-list__actions", children: _.map((t) => /* @__PURE__ */ e(
406
427
  "button",
407
428
  {
408
429
  className: "nice-user-list__action-btn",
409
- onClick: (l) => {
410
- l.stopPropagation(), o == null || o(n, t);
430
+ onClick: (c) => {
431
+ c.stopPropagation(), o == null || o(a, t);
411
432
  },
412
433
  children: t
413
434
  },
@@ -415,247 +436,243 @@ const ee = R(
415
436
  )) })
416
437
  ]
417
438
  },
418
- n.id
439
+ a.id
419
440
  );
420
- return /* @__PURE__ */ c(
441
+ return /* @__PURE__ */ l(
421
442
  "div",
422
443
  {
423
- ref: I,
424
- className: `nice-user-list nice-user-list--${T} ${b ?? ""}`,
444
+ ref: T,
445
+ className: `nice-user-list nice-user-list--${E} ${b ?? ""}`,
425
446
  style: C,
426
447
  children: [
427
- g && /* @__PURE__ */ e(
448
+ N && /* @__PURE__ */ e(
428
449
  "input",
429
450
  {
430
451
  type: "text",
431
- value: S,
432
- onChange: (n) => v(n.target.value),
452
+ value: x,
453
+ onChange: (a) => v(a.target.value),
433
454
  placeholder: "Search usersโ€ฆ",
434
455
  className: "nice-user-list__search"
435
456
  }
436
457
  ),
437
- i.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-user-list__empty", children: "No users found." }) : Object.entries(h).map(([n, t]) => /* @__PURE__ */ c("div", { className: "nice-user-list__group", children: [
438
- E && n && /* @__PURE__ */ c("h4", { className: "nice-user-list__group-title", children: [
439
- n,
458
+ i.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-user-list__empty", children: "No users found." }) : Object.entries(h).map(([a, t]) => /* @__PURE__ */ l("div", { className: "nice-user-list__group", children: [
459
+ $ && a && /* @__PURE__ */ l("h4", { className: "nice-user-list__group-title", children: [
460
+ a,
440
461
  " (",
441
462
  t.length,
442
463
  ")"
443
464
  ] }),
444
- t.map(N)
445
- ] }, n))
465
+ t.map(g)
466
+ ] }, a))
446
467
  ]
447
468
  }
448
469
  );
449
470
  }
450
471
  );
451
- function Q(M) {
452
- if (!M)
472
+ function Y(A) {
473
+ if (!A)
453
474
  return "";
454
- let p = M;
455
- return p = p.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, ""), p = p.replace(/\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, ""), p = p.replace(/(href|src|action)\s*=\s*(?:"javascript:[^"]*"|'javascript:[^']*')/gi, '$1=""'), p = p.replace(/(href|src|action)\s*=\s*(?:"vbscript:[^"]*"|'vbscript:[^']*')/gi, '$1=""'), p = p.replace(/<\/?(iframe|object|embed|form)\b[^>]*>/gi, ""), p;
475
+ let u = A;
476
+ return u = u.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, ""), u = u.replace(/\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, ""), u = u.replace(/(href|src|action)\s*=\s*(?:"javascript:[^"]*"|'javascript:[^']*')/gi, '$1=""'), u = u.replace(/(href|src|action)\s*=\s*(?:"vbscript:[^"]*"|'vbscript:[^']*')/gi, '$1=""'), u = u.replace(/<\/?(iframe|object|embed|form)\b[^>]*>/gi, ""), u;
456
477
  }
457
- const se = R(function(p, I) {
478
+ const ae = W(function(u, T) {
458
479
  const {
459
480
  pages: m,
460
- selectedPageId: a,
481
+ selectedPageId: s,
461
482
  onSelectPage: o,
462
483
  onSavePage: _,
463
- onDeletePage: g,
484
+ onDeletePage: N,
464
485
  onCreatePage: r,
465
486
  editable: w = !1,
466
- searchable: T = !0,
467
- renderHtml: E = !1,
487
+ searchable: E = !0,
488
+ renderHtml: $ = !1,
468
489
  sidebarWidth: b = 260,
469
490
  className: C,
470
- style: S
471
- } = p, [v, i] = $(""), [h, N] = $(!1), [n, t] = $(""), [l, s] = $(""), [k, L] = $(""), [A, j] = $(!1), z = F(() => {
491
+ style: x
492
+ } = u, [v, i] = L(""), [h, g] = L(!1), [a, t] = L(""), [c, n] = L(""), [k, I] = L(""), [F, j] = L(!1), z = P(() => {
472
493
  if (m.some((f) => f.children && f.children.length > 0))
473
494
  return m.filter((f) => !f.parentId);
474
- const u = /* @__PURE__ */ new Map();
495
+ const p = /* @__PURE__ */ new Map();
475
496
  for (const f of m)
476
- u.set(f.id, { ...f, children: [] });
497
+ p.set(f.id, { ...f, children: [] });
477
498
  const y = [];
478
- for (const f of u.values())
479
- f.parentId && u.has(f.parentId) ? u.get(f.parentId).children.push(f) : y.push(f);
499
+ for (const f of p.values())
500
+ f.parentId && p.has(f.parentId) ? p.get(f.parentId).children.push(f) : y.push(f);
480
501
  return y;
481
- }, [m]), x = F(
482
- () => m.find((u) => u.id === a),
483
- [m, a]
484
- ), W = F(() => {
502
+ }, [m]), S = P(
503
+ () => m.find((p) => p.id === s),
504
+ [m, s]
505
+ ), O = P(() => {
485
506
  if (!v.trim())
486
507
  return z;
487
- const u = v.toLowerCase(), y = new Set(
488
- m.filter((f) => f.title.toLowerCase().includes(u)).map((f) => f.id)
508
+ const p = v.toLowerCase(), y = new Set(
509
+ m.filter((f) => f.title.toLowerCase().includes(p)).map((f) => f.id)
489
510
  );
490
511
  return m.filter((f) => y.has(f.id));
491
- }, [z, m, v]), O = D(() => {
492
- x && (t(x.title), s(x.content ?? ""), N(!0));
493
- }, [x]), d = D(() => {
494
- !x || !_ || (_(x.id, l, n), N(!1));
495
- }, [x, l, n, _]), P = D(() => {
496
- !k.trim() || !r || (r(a ?? null, k.trim()), L(""), j(!1));
497
- }, [k, a, r]), U = (u, y = 0) => {
512
+ }, [z, m, v]), U = D(() => {
513
+ S && (t(S.title), n(S.content ?? ""), g(!0));
514
+ }, [S]), d = D(() => {
515
+ !S || !_ || (_(S.id, c, a), g(!1));
516
+ }, [S, c, a, _]), M = D(() => {
517
+ !k.trim() || !r || (r(s ?? null, k.trim()), I(""), j(!1));
518
+ }, [k, s, r]), R = (p, y = 0) => {
498
519
  var f;
499
- return /* @__PURE__ */ c("div", { children: [
520
+ return /* @__PURE__ */ l("div", { children: [
500
521
  /* @__PURE__ */ e(
501
522
  "div",
502
523
  {
503
- className: `nice-wiki__page-item ${u.id === a ? "nice-wiki__page-item--active" : ""}`,
524
+ className: `nice-wiki__page-item ${p.id === s ? "nice-wiki__page-item--active" : ""}`,
504
525
  style: { paddingLeft: 12 + y * 16 },
505
- onClick: () => o == null ? void 0 : o(u),
526
+ onClick: () => o == null ? void 0 : o(p),
506
527
  role: "button",
507
528
  tabIndex: 0,
508
529
  onKeyDown: (B) => {
509
- B.key === "Enter" && (o == null || o(u));
530
+ B.key === "Enter" && (o == null || o(p));
510
531
  },
511
- children: u.title
532
+ children: p.title
512
533
  }
513
534
  ),
514
- (f = u.children) == null ? void 0 : f.map((B) => U(B, y + 1))
515
- ] }, u.id);
535
+ (f = p.children) == null ? void 0 : f.map((B) => R(B, y + 1))
536
+ ] }, p.id);
516
537
  };
517
- return /* @__PURE__ */ c("div", { ref: I, className: `nice-wiki ${C ?? ""}`, style: { display: "flex", ...S }, children: [
518
- /* @__PURE__ */ c("div", { className: "nice-wiki__sidebar", style: { width: b, minWidth: b }, children: [
519
- /* @__PURE__ */ c("div", { className: "nice-wiki__sidebar-header", children: [
538
+ return /* @__PURE__ */ l("div", { ref: T, className: `nice-wiki ${C ?? ""}`, style: { display: "flex", ...x }, children: [
539
+ /* @__PURE__ */ l("div", { className: "nice-wiki__sidebar", style: { width: b, minWidth: b }, children: [
540
+ /* @__PURE__ */ l("div", { className: "nice-wiki__sidebar-header", children: [
520
541
  /* @__PURE__ */ e("strong", { children: "Wiki" }),
521
- w && r && /* @__PURE__ */ e("button", { onClick: () => j(!A), title: "New page", children: "+" })
542
+ w && r && /* @__PURE__ */ e("button", { onClick: () => j(!F), title: "New page", children: "+" })
522
543
  ] }),
523
- A && /* @__PURE__ */ c("div", { className: "nice-wiki__new-page", children: [
544
+ F && /* @__PURE__ */ l("div", { className: "nice-wiki__new-page", children: [
524
545
  /* @__PURE__ */ e(
525
546
  "input",
526
547
  {
527
548
  type: "text",
528
549
  value: k,
529
- onChange: (u) => L(u.target.value),
550
+ onChange: (p) => I(p.target.value),
530
551
  placeholder: "New page title"
531
552
  }
532
553
  ),
533
- /* @__PURE__ */ e("button", { onClick: P, disabled: !k.trim(), children: "Create" })
554
+ /* @__PURE__ */ e("button", { onClick: M, disabled: !k.trim(), children: "Create" })
534
555
  ] }),
535
- T && /* @__PURE__ */ e(
556
+ E && /* @__PURE__ */ e(
536
557
  "input",
537
558
  {
538
559
  type: "text",
539
560
  className: "nice-wiki__search",
540
561
  value: v,
541
- onChange: (u) => i(u.target.value),
562
+ onChange: (p) => i(p.target.value),
542
563
  placeholder: "Search pagesโ€ฆ"
543
564
  }
544
565
  ),
545
- /* @__PURE__ */ e("div", { className: "nice-wiki__tree", children: W.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-wiki__empty", children: "No pages." }) : W.map((u) => U(u)) })
566
+ /* @__PURE__ */ e("div", { className: "nice-wiki__tree", children: O.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-wiki__empty", children: "No pages." }) : O.map((p) => R(p)) })
546
567
  ] }),
547
- /* @__PURE__ */ e("div", { className: "nice-wiki__content", children: x ? h ? /* @__PURE__ */ c("div", { className: "nice-wiki__editor", children: [
568
+ /* @__PURE__ */ e("div", { className: "nice-wiki__content", children: S ? h ? /* @__PURE__ */ l("div", { className: "nice-wiki__editor", children: [
548
569
  /* @__PURE__ */ e(
549
570
  "input",
550
571
  {
551
572
  type: "text",
552
573
  className: "nice-wiki__edit-title",
553
- value: n,
554
- onChange: (u) => t(u.target.value)
574
+ value: a,
575
+ onChange: (p) => t(p.target.value)
555
576
  }
556
577
  ),
557
578
  /* @__PURE__ */ e(
558
579
  "textarea",
559
580
  {
560
581
  className: "nice-wiki__edit-body",
561
- value: l,
562
- onChange: (u) => s(u.target.value),
582
+ value: c,
583
+ onChange: (p) => n(p.target.value),
563
584
  rows: 20
564
585
  }
565
586
  ),
566
- /* @__PURE__ */ c("div", { className: "nice-wiki__edit-actions", children: [
587
+ /* @__PURE__ */ l("div", { className: "nice-wiki__edit-actions", children: [
567
588
  /* @__PURE__ */ e("button", { onClick: d, children: "Save" }),
568
- /* @__PURE__ */ e("button", { onClick: () => N(!1), children: "Cancel" })
589
+ /* @__PURE__ */ e("button", { onClick: () => g(!1), children: "Cancel" })
569
590
  ] })
570
- ] }) : /* @__PURE__ */ c("div", { className: "nice-wiki__viewer", children: [
571
- /* @__PURE__ */ c("div", { className: "nice-wiki__viewer-header", children: [
572
- /* @__PURE__ */ e("h2", { children: x.title }),
573
- /* @__PURE__ */ c("div", { className: "nice-wiki__viewer-meta", children: [
574
- x.lastEditedBy && /* @__PURE__ */ c("span", { children: [
591
+ ] }) : /* @__PURE__ */ l("div", { className: "nice-wiki__viewer", children: [
592
+ /* @__PURE__ */ l("div", { className: "nice-wiki__viewer-header", children: [
593
+ /* @__PURE__ */ e("h2", { children: S.title }),
594
+ /* @__PURE__ */ l("div", { className: "nice-wiki__viewer-meta", children: [
595
+ S.lastEditedBy && /* @__PURE__ */ l("span", { children: [
575
596
  "Edited by ",
576
- x.lastEditedBy
597
+ S.lastEditedBy
577
598
  ] }),
578
- x.lastEditedAt && /* @__PURE__ */ c("span", { children: [
599
+ S.lastEditedAt && /* @__PURE__ */ l("span", { children: [
579
600
  " on ",
580
- x.lastEditedAt
601
+ S.lastEditedAt
581
602
  ] })
582
603
  ] }),
583
- w && /* @__PURE__ */ c("div", { className: "nice-wiki__viewer-actions", children: [
584
- /* @__PURE__ */ e("button", { onClick: O, children: "Edit" }),
585
- g && /* @__PURE__ */ e("button", { onClick: () => g(x.id), children: "Delete" })
604
+ w && /* @__PURE__ */ l("div", { className: "nice-wiki__viewer-actions", children: [
605
+ /* @__PURE__ */ e("button", { onClick: U, children: "Edit" }),
606
+ N && /* @__PURE__ */ e("button", { onClick: () => N(S.id), children: "Delete" })
586
607
  ] })
587
608
  ] }),
588
- E ? /* @__PURE__ */ e(
609
+ $ ? /* @__PURE__ */ e(
589
610
  "div",
590
611
  {
591
612
  className: "nice-wiki__viewer-body",
592
- dangerouslySetInnerHTML: { __html: Q(x.content ?? "") }
613
+ dangerouslySetInnerHTML: { __html: Y(S.content ?? "") }
593
614
  }
594
- ) : /* @__PURE__ */ e("div", { className: "nice-wiki__viewer-body", children: x.content ?? /* @__PURE__ */ e("em", { children: "No content." }) })
615
+ ) : /* @__PURE__ */ e("div", { className: "nice-wiki__viewer-body", children: S.content ?? /* @__PURE__ */ e("em", { children: "No content." }) })
595
616
  ] }) : /* @__PURE__ */ e("div", { className: "nice-wiki__placeholder", children: "Select a page from the sidebar." }) })
596
617
  ] });
597
- }), K = {
598
- comment: "๐Ÿ’ฌ",
599
- like: "โค๏ธ",
600
- share: "โ†—๏ธ",
601
- create: "โœจ",
602
- update: "โœ๏ธ",
603
- delete: "๐Ÿ—‘๏ธ",
604
- join: "๐Ÿ‘‹",
605
- leave: "๐Ÿšช",
606
- upload: "๐Ÿ“Ž",
607
- mention: "@",
608
- custom: "๐Ÿ“Œ"
609
- }, ce = R(
610
- function(p, I) {
618
+ }), G = {
619
+ comment: "var(--nice-color-primary, #3b82f6)",
620
+ like: "var(--nice-color-error, #ef4444)",
621
+ share: "var(--nice-color-info, #0ea5e9)",
622
+ create: "var(--nice-color-success, #22c55e)",
623
+ update: "var(--nice-color-warning, #f59e0b)",
624
+ delete: "var(--nice-color-error, #ef4444)",
625
+ join: "var(--nice-color-success, #22c55e)",
626
+ leave: "var(--nice-text-muted, #6b7280)",
627
+ upload: "var(--nice-color-accent, #8b5cf6)",
628
+ mention: "var(--nice-color-primary, #3b82f6)",
629
+ custom: "var(--nice-text-muted, #6b7280)"
630
+ }, ne = W(
631
+ function(u, T) {
611
632
  const {
612
633
  events: m,
613
- onEventClick: a,
634
+ onEventClick: s,
614
635
  groupByDate: o = !0,
615
636
  typeFilter: _,
616
- showFilters: g = !1,
637
+ showFilters: N = !1,
617
638
  maxEvents: r,
618
639
  onLoadMore: w,
619
- hasMore: T = !1,
620
- className: E,
640
+ hasMore: E = !1,
641
+ className: $,
621
642
  style: b
622
- } = p, [C, S] = $(/* @__PURE__ */ new Set()), v = _ ?? (C.size > 0 ? Array.from(C) : void 0), i = F(() => {
643
+ } = u, [C, x] = L(/* @__PURE__ */ new Set()), v = _ ?? (C.size > 0 ? Array.from(C) : void 0), i = P(() => {
623
644
  let t = m;
624
645
  if (v && v.length > 0) {
625
- const l = new Set(v);
626
- t = t.filter((s) => l.has(s.type));
646
+ const c = new Set(v);
647
+ t = t.filter((n) => c.has(n.type));
627
648
  }
628
649
  return r && (t = t.slice(0, r)), t;
629
- }, [m, v, r]), h = F(() => {
650
+ }, [m, v, r]), h = P(() => {
630
651
  if (!o)
631
652
  return [{ label: "", events: i }];
632
653
  const t = /* @__PURE__ */ new Map();
633
- for (const l of i) {
634
- const s = l.timestamp.slice(0, 10);
635
- t.has(s) || t.set(s, []), t.get(s).push(l);
654
+ for (const c of i) {
655
+ const n = c.timestamp.slice(0, 10);
656
+ t.has(n) || t.set(n, []), t.get(n).push(c);
636
657
  }
637
- return Array.from(t.entries()).map(([l, s]) => ({ label: l, events: s }));
638
- }, [i, o]), N = F(() => {
639
- const t = new Set(m.map((l) => l.type));
658
+ return Array.from(t.entries()).map(([c, n]) => ({ label: c, events: n }));
659
+ }, [i, o]), g = P(() => {
660
+ const t = new Set(m.map((c) => c.type));
640
661
  return Array.from(t).sort();
641
- }, [m]), n = (t) => {
642
- S((l) => {
643
- const s = new Set(l);
644
- return s.has(t) ? s.delete(t) : s.add(t), s;
662
+ }, [m]), a = (t) => {
663
+ x((c) => {
664
+ const n = new Set(c);
665
+ return n.has(t) ? n.delete(t) : n.add(t), n;
645
666
  });
646
667
  };
647
- return /* @__PURE__ */ c("div", { ref: I, className: `nice-activity-feed ${E ?? ""}`, style: b, children: [
648
- g && !_ && /* @__PURE__ */ c("div", { className: "nice-activity-feed__filters", children: [
649
- N.map((t) => /* @__PURE__ */ c(
668
+ return /* @__PURE__ */ l("div", { ref: T, className: `nice-activity-feed ${$ ?? ""}`, style: b, children: [
669
+ N && !_ && /* @__PURE__ */ l("div", { className: "nice-activity-feed__filters", children: [
670
+ g.map((t) => /* @__PURE__ */ e(
650
671
  "button",
651
672
  {
652
673
  className: `nice-activity-feed__filter-chip ${C.has(t) ? "nice-activity-feed__filter-chip--active" : ""}`,
653
- onClick: () => n(t),
654
- children: [
655
- K[t],
656
- " ",
657
- t
658
- ]
674
+ onClick: () => a(t),
675
+ children: t
659
676
  },
660
677
  t
661
678
  )),
@@ -663,60 +680,76 @@ const se = R(function(p, I) {
663
680
  "button",
664
681
  {
665
682
  className: "nice-activity-feed__filter-clear",
666
- onClick: () => S(/* @__PURE__ */ new Set()),
683
+ onClick: () => x(/* @__PURE__ */ new Set()),
667
684
  children: "Clear"
668
685
  }
669
686
  )
670
687
  ] }),
671
- i.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-activity-feed__empty", children: "No activity." }) : h.map(({ label: t, events: l }) => /* @__PURE__ */ c("div", { className: "nice-activity-feed__group", children: [
688
+ i.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-activity-feed__empty", children: "No activity." }) : h.map(({ label: t, events: c }) => /* @__PURE__ */ l("div", { className: "nice-activity-feed__group", children: [
672
689
  o && t && /* @__PURE__ */ e("div", { className: "nice-activity-feed__date-label", children: t }),
673
- l.map((s) => /* @__PURE__ */ c(
690
+ c.map((n) => /* @__PURE__ */ l(
674
691
  "div",
675
692
  {
676
693
  className: "nice-activity-feed__event",
677
- onClick: () => a == null ? void 0 : a(s),
678
- role: a ? "button" : void 0,
679
- tabIndex: a ? 0 : void 0,
694
+ onClick: () => s == null ? void 0 : s(n),
695
+ role: s ? "button" : void 0,
696
+ tabIndex: s ? 0 : void 0,
680
697
  onKeyDown: (k) => {
681
- k.key === "Enter" && a && a(s);
698
+ k.key === "Enter" && s && s(n);
682
699
  },
683
700
  children: [
684
- /* @__PURE__ */ e("span", { className: "nice-activity-feed__icon", children: K[s.type] }),
685
- /* @__PURE__ */ c("div", { className: "nice-activity-feed__body", children: [
686
- s.actorAvatarUrl && /* @__PURE__ */ e(
701
+ /* @__PURE__ */ e(
702
+ "span",
703
+ {
704
+ className: `nice-activity-feed__icon nice-activity-feed__icon--${n.type}`,
705
+ title: n.type,
706
+ "aria-hidden": "true",
707
+ style: {
708
+ display: "inline-block",
709
+ width: 10,
710
+ height: 10,
711
+ marginTop: 4,
712
+ flexShrink: 0,
713
+ borderRadius: "50%",
714
+ background: G[n.type]
715
+ }
716
+ }
717
+ ),
718
+ /* @__PURE__ */ l("div", { className: "nice-activity-feed__body", children: [
719
+ n.actorAvatarUrl && /* @__PURE__ */ e(
687
720
  "img",
688
721
  {
689
- src: s.actorAvatarUrl,
722
+ src: n.actorAvatarUrl,
690
723
  alt: "",
691
724
  className: "nice-activity-feed__avatar"
692
725
  }
693
726
  ),
694
- /* @__PURE__ */ c("span", { className: "nice-activity-feed__message", children: [
695
- /* @__PURE__ */ e("strong", { children: s.actorName }),
727
+ /* @__PURE__ */ l("span", { className: "nice-activity-feed__message", children: [
728
+ /* @__PURE__ */ e("strong", { children: n.actorName }),
696
729
  " ",
697
- s.message,
698
- s.targetLabel && /* @__PURE__ */ c(H, { children: [
730
+ n.message,
731
+ n.targetLabel && /* @__PURE__ */ l(H, { children: [
699
732
  " ",
700
- /* @__PURE__ */ e("em", { children: s.targetLabel })
733
+ /* @__PURE__ */ e("em", { children: n.targetLabel })
701
734
  ] })
702
735
  ] }),
703
- /* @__PURE__ */ e("time", { className: "nice-activity-feed__time", children: s.timestamp })
736
+ /* @__PURE__ */ e("time", { className: "nice-activity-feed__time", children: n.timestamp })
704
737
  ] })
705
738
  ]
706
739
  },
707
- s.id
740
+ n.id
708
741
  ))
709
742
  ] }, t || "__all")),
710
- T && w && /* @__PURE__ */ e("button", { className: "nice-activity-feed__load-more", onClick: w, children: "Load more" })
743
+ E && w && /* @__PURE__ */ e("button", { className: "nice-activity-feed__load-more", onClick: w, children: "Load more" })
711
744
  ] });
712
745
  }
713
746
  );
714
747
  export {
715
- ce as NiceActivityFeed,
716
- ee as NiceComments,
717
- ie as NiceRatings,
718
- te as NiceSocialPanel,
719
- ne as NiceTagCloud,
720
- ae as NiceUserList,
721
- se as NiceWiki
748
+ ne as NiceActivityFeed,
749
+ X as NiceComments,
750
+ Z as NiceRatings,
751
+ ee as NiceSocialPanel,
752
+ ie as NiceTagCloud,
753
+ te as NiceUserList,
754
+ ae as NiceWiki
722
755
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice2dev/social",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "Nice2Dev Social รขโ‚ฌโ€ Comments, ratings, activity feed, tag cloud, social panel, user list, wiki for React",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",