@webority/ui-react 0.108.0 → 0.109.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  "kind": "WeborityWeb",
3
3
  "library": {
4
4
  "name": "@webority/ui-react",
5
- "version": "0.108.0"
5
+ "version": "0.109.0"
6
6
  },
7
7
  "rendererProtocolVersion": 12,
8
8
  "platform": "Web",
@@ -4882,6 +4882,32 @@
4882
4882
  "required": true,
4883
4883
  "description": "When it was written: an ISO instant with its zone, epoch ms or a Date. Shown in IST."
4884
4884
  },
4885
+ {
4886
+ "name": "attachments",
4887
+ "type": "array",
4888
+ "itemFields": [
4889
+ {
4890
+ "name": "href",
4891
+ "type": "string",
4892
+ "required": true,
4893
+ "description": "The download URL."
4894
+ },
4895
+ {
4896
+ "name": "name",
4897
+ "type": "string",
4898
+ "required": true,
4899
+ "description": "The file name shown."
4900
+ },
4901
+ {
4902
+ "name": "sizeBytes",
4903
+ "type": "number",
4904
+ "required": false,
4905
+ "description": "The size, shown beside the name when given."
4906
+ }
4907
+ ],
4908
+ "required": false,
4909
+ "description": "Files attached to the comment, listed as download links under the body."
4910
+ },
4885
4911
  {
4886
4912
  "name": "author",
4887
4913
  "type": "object",
@@ -4932,6 +4958,18 @@
4932
4958
  "required": true,
4933
4959
  "description": "The comment's public id."
4934
4960
  },
4961
+ {
4962
+ "name": "internal",
4963
+ "type": "boolean",
4964
+ "required": false,
4965
+ "description": "A staff-only note: tinted, with an \"Internal note\" badge."
4966
+ },
4967
+ {
4968
+ "name": "mine",
4969
+ "type": "boolean",
4970
+ "required": false,
4971
+ "description": "This person wrote it; the conversation variant puts it on the right."
4972
+ },
4935
4973
  {
4936
4974
  "name": "reactions",
4937
4975
  "type": "array",
@@ -4968,6 +5006,32 @@
4968
5006
  "required": true,
4969
5007
  "description": "When it was written: an ISO instant with its zone, epoch ms or a Date. Shown in IST."
4970
5008
  },
5009
+ {
5010
+ "name": "attachments",
5011
+ "type": "array",
5012
+ "itemFields": [
5013
+ {
5014
+ "name": "href",
5015
+ "type": "string",
5016
+ "required": true,
5017
+ "description": "The download URL."
5018
+ },
5019
+ {
5020
+ "name": "name",
5021
+ "type": "string",
5022
+ "required": true,
5023
+ "description": "The file name shown."
5024
+ },
5025
+ {
5026
+ "name": "sizeBytes",
5027
+ "type": "number",
5028
+ "required": false,
5029
+ "description": "The size, shown beside the name when given."
5030
+ }
5031
+ ],
5032
+ "required": false,
5033
+ "description": "Files attached to the comment, listed as download links under the body."
5034
+ },
4971
5035
  {
4972
5036
  "name": "author",
4973
5037
  "type": "object",
@@ -5018,6 +5082,18 @@
5018
5082
  "required": true,
5019
5083
  "description": "The comment's public id."
5020
5084
  },
5085
+ {
5086
+ "name": "internal",
5087
+ "type": "boolean",
5088
+ "required": false,
5089
+ "description": "A staff-only note: tinted, with an \"Internal note\" badge."
5090
+ },
5091
+ {
5092
+ "name": "mine",
5093
+ "type": "boolean",
5094
+ "required": false,
5095
+ "description": "This person wrote it; the conversation variant puts it on the right."
5096
+ },
5021
5097
  {
5022
5098
  "name": "reactions",
5023
5099
  "type": "array",
@@ -5058,7 +5134,7 @@
5058
5134
  }
5059
5135
  ],
5060
5136
  "required": false,
5061
- "description": "Replies, oldest first. Replies to a reply are not nested."
5137
+ "description": "Replies, oldest first, with the same fields. Replies to a reply are not nested."
5062
5138
  },
5063
5139
  {
5064
5140
  "name": "value",
@@ -5158,6 +5234,17 @@
5158
5234
  "required": false,
5159
5235
  "description": "Show the thread without the box, actions or reacting.",
5160
5236
  "default": false
5237
+ },
5238
+ {
5239
+ "name": "variant",
5240
+ "type": "enum",
5241
+ "enum": [
5242
+ "conversation",
5243
+ "list"
5244
+ ],
5245
+ "required": false,
5246
+ "description": "list: every comment down one column. conversation: chat bubbles, this person's own on the right.",
5247
+ "default": "list"
5161
5248
  }
5162
5249
  ],
5163
5250
  "itemsTakeAction": [],
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "webority-web",
3
- "version": "0.108.0",
3
+ "version": "0.109.0",
4
4
  "platform": "Web",
5
5
  "kitModuleVersion": 2,
6
6
  "rendererProtocolVersion": 12,
7
7
  "library": {
8
8
  "name": "@webority/ui-react",
9
- "version": "0.108.0"
9
+ "version": "0.109.0"
10
10
  },
11
11
  "files": {
12
12
  "manifest.json": {
13
- "sha256": "b8a77258d5132ab617b39c06a17332b47d7581d81f75433312661e17ec36706c",
14
- "bytes": 853123
13
+ "sha256": "5fdbb3e2f87c038f994869bda21bb1fe1fe9a0ba78a6f76b09a73566ce81b2db",
14
+ "bytes": 856329
15
15
  },
16
16
  "kit.js": {
17
- "sha256": "e54806dbd40ddc65b1428ff94da6dea02a7249b62773ffd9dc036d3c9f614a83",
18
- "bytes": 10893959
17
+ "sha256": "9ee94955b48616fb7c3182e2c913595a2b29177d6afd40123c7316dbab9178ea",
18
+ "bytes": 10897341
19
19
  },
20
20
  "kit.css": {
21
21
  "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import{initialsOf as i}from"../lib/initials.js";import a from"./AppAvatar.js";import{parseMentionValue as o}from"@webority/ui-elements/elements/mention-input";import{formatDate as s,formatNumber as c,toInstant as l}from"@webority/ui-elements/helpers";import{Fragment as u,useEffect as d,useId as f,useRef as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{COMMENT_REACTIONS as g,COMMENT_TEXT as _}from"@webority/ui-elements/elements/comment-thread";var v=[`stacked`,`inline`];function y(r){let{marker:i,props:o}=e(`AppCommentThread`,r),{comments:s=[],onPost:c,onReply:l,onEdit:u,onDelete:y,onReact:x,people:S,loadPeople:C,reactionChoices:w,allowReplies:T=!0,allowReactions:E=!0,composerPlaceholder:D,composer:O=`stacked`,author:k,postLabel:A=_.post,composerRows:j,readOnly:M=!1,label:N=_.listName,id:P,className:F=``,...I}=o;n(`AppCommentThread`,I),t(`AppCommentThread`,`composer`,O,v);let L=f(),R=P||`comment-thread-${L.replace(/[^a-zA-Z0-9_-]/g,``)}`,z=p(null),B=typeof C==`function`,V=w?.length?w:g,H=O===`inline`,U=j??(H?1:3),W=p(null);return W.current={onPost:c,onReply:l,onEdit:u,onDelete:y,onReact:x,loadPeople:C},d(()=>{let e=z.current;if(e)return e.submit=async({intent:e,commentId:t,parentId:n,body:r,emoji:i})=>{let a=W.current;e===`post`?await a.onPost?.(r):e===`reply`?await a.onReply?.(n,r):e===`edit`?await a.onEdit?.(t,r):e===`delete`?await a.onDelete?.(t):e===`react`&&await a.onReact?.(t,i)},()=>{e.submit=void 0}},[]),d(()=>{let e=z.current;!e||B||(e.people=S||[])},[S,B]),d(()=>{let e=z.current;if(!e||!B)return;let t=new WeakMap,n=async e=>{let n=e.target,r=(t.get(n)??0)+1;t.set(n,r),n.loading=!0;try{let i=await W.current.loadPeople(e.detail.query);t.get(n)===r&&(n.people=i||[])}catch{t.get(n)===r&&(n.people=[])}finally{t.get(n)===r&&(n.loading=!1)}};return e.addEventListener(`search`,n),()=>e.removeEventListener(`search`,n)},[B]),h(`wui-comment-thread`,{ref:z,id:R,class:F?`wui-comment-thread ${F}`:`wui-comment-thread`,controlled:``,"read-only":M?``:void 0,remote:B?``:void 0,"reaction-choices":w?.length?w.join(` `):void 0,"no-replies":T?void 0:``,"no-reactions":E?void 0:``,"composer-placeholder":D,...i,...I,children:[m(`div`,{className:`wui-comment-items`,"data-wui-items":``,children:s.length?m(`ol`,{className:`wui-comment-list`,"aria-label":N,children:s.map(e=>m(b,{comment:e,topLevel:!0,readOnly:M,allowReplies:T,allowReactions:E},e.id))}):m(`p`,{className:`wui-comment-empty`,children:_.empty})}),!M&&E&&m(`div`,{className:`wui-reaction-picker`,role:`group`,"aria-label":_.pickerName,"data-wui-picker":``,hidden:!0,children:V.map(e=>m(`button`,{type:`button`,className:`wui-reaction-choice`,"data-wui-emoji":e,children:e},e))}),!M&&h(`div`,{className:H?`wui-comment-composer wui-comment-composer-inline`:`wui-comment-composer`,"data-wui-composer":``,children:[H&&k?m(a,{name:k,size:`sm`,tone:`auto`,className:`wui-comment-composer-avatar`}):null,m(`wui-mention-input`,{id:`${R}-new`,class:`wui-mention-input`,label:_.composerLabel,placeholder:D??_.composerPlaceholder,rows:String(U),remote:B?``:void 0}),m(`div`,{className:`wui-comment-form-actions`,children:m(`button`,{type:`button`,className:H?`btn btn-outline-primary btn-sm`:`btn btn-primary btn-sm`,"data-wui-action":`post`,children:A})}),m(`div`,{className:`wui-comment-error`,"data-wui-error":``,hidden:!0})]}),m(`span`,{className:`visually-hidden`,"data-wui-live":``,"aria-live":`polite`,"aria-atomic":`true`})]})}function b({comment:e,topLevel:t=!1,readOnly:n,allowReplies:a,allowReactions:d}){let{id:f,author:p,at:g,value:v,edited:y,deleted:x,canEdit:S,canDelete:C,reactions:w=[],replies:T=[]}=e,E=p?.name||``,D=l(g),O=!n&&!x&&S,k=!n&&!x&&C,A=t&&a;return h(`li`,{className:`wui-comment`,"data-wui-comment":f,"data-value":v??``,"data-wui-deleted":x?``:void 0,children:[h(`div`,{className:`wui-comment-row`,children:[h(`span`,{className:`avatar avatar-sm wui-comment-avatar`,"aria-hidden":`true`,children:[m(`span`,{className:`avatar-face`,children:i(E)||`?`}),p?.src&&m(`img`,{className:`avatar-img`,src:p.src,alt:``,onError:e=>{e.currentTarget.hidden=!0}})]}),h(`div`,{className:`wui-comment-main`,children:[h(`div`,{className:`wui-comment-head`,children:[m(`span`,{className:`wui-comment-author`,children:E}),m(`time`,{className:`wui-comment-time`,dateTime:Number.isFinite(D)?new Date(D).toISOString():void 0,children:s(g,{pattern:`datetime`})}),y&&!x&&m(`span`,{className:`wui-comment-edited`,children:_.edited})]}),x?m(`div`,{className:`wui-comment-text wui-comment-text-deleted`,children:_.deleted}):m(`div`,{className:`wui-comment-text`,"data-wui-text":``,children:o(v).map((e,t)=>`text`in e?m(u,{children:e.text},t):h(`span`,{className:`wui-mention`,"data-mention-id":e.id,children:[`@`,e.label]},t))}),O&&m(`div`,{className:`wui-comment-editor`,"data-wui-editor":``,hidden:!0}),d&&!x&&(w.length>0||!n)&&h(`div`,{className:`wui-comment-reactions`,role:`group`,"aria-label":_.reactions,children:[w.map(e=>n?h(`span`,{className:e.mine?`wui-reaction wui-reaction-mine`:`wui-reaction`,children:[m(`span`,{className:`wui-reaction-emoji`,children:e.emoji}),m(`span`,{className:`wui-reaction-count`,children:c(e.count,{decimals:0})})]},e.emoji):h(`button`,{type:`button`,className:e.mine?`wui-reaction wui-reaction-mine`:`wui-reaction`,"data-wui-emoji":e.emoji,"aria-pressed":e.mine?`true`:`false`,children:[m(`span`,{className:`wui-reaction-emoji`,children:e.emoji}),m(`span`,{className:`wui-reaction-count`,children:c(e.count,{decimals:0})})]},e.emoji)),!n&&m(`button`,{type:`button`,className:`wui-reaction-add`,"data-wui-action":`react-menu`,"aria-label":_.addReaction,"aria-haspopup":`true`,"aria-expanded":`false`,children:m(r,{name:`emoji-smile`,size:16})})]}),!n&&!x&&(A||O||k)&&h(`div`,{className:`wui-comment-actions`,"data-wui-actions":``,children:[A&&m(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`reply`,children:_.reply}),O&&m(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`edit`,children:_.edit}),k&&m(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`delete`,children:_.delete})]}),k&&h(`div`,{className:`wui-comment-confirm`,"data-wui-confirm":``,hidden:!0,children:[m(`span`,{className:`wui-comment-confirm-text`,children:_.confirmDelete}),m(`button`,{type:`button`,className:`btn btn-danger btn-sm`,"data-wui-action":`confirm-delete`,children:_.delete}),m(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,"data-wui-action":`cancel-delete`,children:_.cancel})]}),!n&&m(`div`,{className:`wui-comment-error`,"data-wui-error":``,hidden:!0})]})]}),t&&T.length>0&&m(`ol`,{className:`wui-comment-list wui-comment-replies`,"aria-label":_.repliesName(E),children:T.map(e=>m(b,{comment:e,readOnly:n,allowReactions:d},e.id))}),A&&!n&&!x&&m(`div`,{className:`wui-comment-reply`,"data-wui-reply":``,hidden:!0})]})}export{y as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import{initialsOf as i}from"../lib/initials.js";import a from"./AppAvatar.js";import{parseMentionValue as o}from"@webority/ui-elements/elements/mention-input";import{formatDate as s,formatFileSize as c,formatNumber as l,toInstant as u}from"@webority/ui-elements/helpers";import{Fragment as d,useEffect as f,useId as p,useRef as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{COMMENT_REACTIONS as _,COMMENT_TEXT as v}from"@webority/ui-elements/elements/comment-thread";var y=[`stacked`,`inline`],b=[`list`,`conversation`];function x(r){let{marker:i,props:o}=e(`AppCommentThread`,r),{comments:s=[],onPost:c,onReply:l,onEdit:u,onDelete:d,onReact:x,people:C,loadPeople:w,reactionChoices:T,allowReplies:E=!0,allowReactions:D=!0,composerPlaceholder:O,variant:k=`list`,composer:A=`stacked`,author:j,postLabel:M=v.post,composerRows:N,readOnly:P=!1,label:F=v.listName,id:I,className:L=``,...R}=o;n(`AppCommentThread`,R),t(`AppCommentThread`,`variant`,k,b),t(`AppCommentThread`,`composer`,A,y);let z=p(),B=I||`comment-thread-${z.replace(/[^a-zA-Z0-9_-]/g,``)}`,V=m(null),H=typeof w==`function`,U=T?.length?T:_,W=A===`inline`,G=N??(W?1:3),K=m(null);return K.current={onPost:c,onReply:l,onEdit:u,onDelete:d,onReact:x,loadPeople:w},f(()=>{let e=V.current;if(e)return e.submit=async({intent:e,commentId:t,parentId:n,body:r,emoji:i})=>{let a=K.current;e===`post`?await a.onPost?.(r):e===`reply`?await a.onReply?.(n,r):e===`edit`?await a.onEdit?.(t,r):e===`delete`?await a.onDelete?.(t):e===`react`&&await a.onReact?.(t,i)},()=>{e.submit=void 0}},[]),f(()=>{let e=V.current;!e||H||(e.people=C||[])},[C,H]),f(()=>{let e=V.current;if(!e||!H)return;let t=new WeakMap,n=async e=>{let n=e.target,r=(t.get(n)??0)+1;t.set(n,r),n.loading=!0;try{let i=await K.current.loadPeople(e.detail.query);t.get(n)===r&&(n.people=i||[])}catch{t.get(n)===r&&(n.people=[])}finally{t.get(n)===r&&(n.loading=!1)}};return e.addEventListener(`search`,n),()=>e.removeEventListener(`search`,n)},[H]),g(`wui-comment-thread`,{ref:V,id:B,class:[`wui-comment-thread`,k===`conversation`&&`wui-comment-thread--conversation`,L].filter(Boolean).join(` `),controlled:``,"read-only":P?``:void 0,remote:H?``:void 0,"reaction-choices":T?.length?T.join(` `):void 0,"no-replies":E?void 0:``,"no-reactions":D?void 0:``,"composer-placeholder":O,...i,...R,children:[h(`div`,{className:`wui-comment-items`,"data-wui-items":``,children:s.length?h(`ol`,{className:`wui-comment-list`,"aria-label":F,children:s.map(e=>h(S,{comment:e,topLevel:!0,readOnly:P,allowReplies:E,allowReactions:D},e.id))}):h(`p`,{className:`wui-comment-empty`,children:v.empty})}),!P&&D&&h(`div`,{className:`wui-reaction-picker`,role:`group`,"aria-label":v.pickerName,"data-wui-picker":``,hidden:!0,children:U.map(e=>h(`button`,{type:`button`,className:`wui-reaction-choice`,"data-wui-emoji":e,children:e},e))}),!P&&g(`div`,{className:W?`wui-comment-composer wui-comment-composer-inline`:`wui-comment-composer`,"data-wui-composer":``,children:[W&&j?h(a,{name:j,size:`sm`,tone:`auto`,className:`wui-comment-composer-avatar`}):null,h(`wui-mention-input`,{id:`${B}-new`,class:`wui-mention-input`,label:v.composerLabel,placeholder:O??v.composerPlaceholder,rows:String(G),remote:H?``:void 0}),h(`div`,{className:`wui-comment-form-actions`,children:h(`button`,{type:`button`,className:W?`btn btn-outline-primary btn-sm`:`btn btn-primary btn-sm`,"data-wui-action":`post`,children:M})}),h(`div`,{className:`wui-comment-error`,"data-wui-error":``,hidden:!0})]}),h(`span`,{className:`visually-hidden`,"data-wui-live":``,"aria-live":`polite`,"aria-atomic":`true`})]})}function S({comment:e,topLevel:t=!1,readOnly:n,allowReplies:a,allowReactions:f}){let{id:p,author:m,at:_,value:y,edited:b,mine:x,internal:C,attachments:w=[],deleted:T,canEdit:E,canDelete:D,reactions:O=[],replies:k=[]}=e,A=m?.name||``,j=u(_),M=!n&&!T&&E,N=!n&&!T&&D,P=t&&a;return g(`li`,{className:[`wui-comment`,C&&`wui-comment--internal`,x&&`wui-comment--mine`].filter(Boolean).join(` `),"data-wui-comment":p,"data-value":y??``,"data-wui-deleted":T?``:void 0,children:[g(`div`,{className:`wui-comment-row`,children:[g(`span`,{className:`avatar avatar-sm wui-comment-avatar`,"aria-hidden":`true`,children:[h(`span`,{className:`avatar-face`,children:i(A)||`?`}),m?.src&&h(`img`,{className:`avatar-img`,src:m.src,alt:``,onError:e=>{e.currentTarget.hidden=!0}})]}),g(`div`,{className:`wui-comment-main`,children:[g(`div`,{className:`wui-comment-head`,children:[h(`span`,{className:`wui-comment-author`,children:A}),h(`time`,{className:`wui-comment-time`,dateTime:Number.isFinite(j)?new Date(j).toISOString():void 0,children:s(_,{pattern:`datetime`})}),b&&!T&&h(`span`,{className:`wui-comment-edited`,children:v.edited}),C&&h(`span`,{className:`badge wui-comment-internal-badge`,children:`Internal note`})]}),T?h(`div`,{className:`wui-comment-text wui-comment-text-deleted`,children:v.deleted}):h(`div`,{className:`wui-comment-text`,"data-wui-text":``,children:o(y).map((e,t)=>`text`in e?h(d,{children:e.text},t):g(`span`,{className:`wui-mention`,"data-mention-id":e.id,children:[`@`,e.label]},t))}),!T&&w.length>0&&h(`ul`,{className:`wui-comment-attachments`,"aria-label":`Attachments`,children:w.map(e=>g(`li`,{children:[g(`a`,{className:`wui-comment-attachment`,href:e.href,download:!0,children:[h(r,{name:`paperclip`,size:14}),e.name]}),typeof e.sizeBytes==`number`&&h(`span`,{className:`wui-comment-attachment-size`,children:c(e.sizeBytes)})]},e.href))}),M&&h(`div`,{className:`wui-comment-editor`,"data-wui-editor":``,hidden:!0}),f&&!T&&(O.length>0||!n)&&g(`div`,{className:`wui-comment-reactions`,role:`group`,"aria-label":v.reactions,children:[O.map(e=>n?g(`span`,{className:e.mine?`wui-reaction wui-reaction-mine`:`wui-reaction`,children:[h(`span`,{className:`wui-reaction-emoji`,children:e.emoji}),h(`span`,{className:`wui-reaction-count`,children:l(e.count,{decimals:0})})]},e.emoji):g(`button`,{type:`button`,className:e.mine?`wui-reaction wui-reaction-mine`:`wui-reaction`,"data-wui-emoji":e.emoji,"aria-pressed":e.mine?`true`:`false`,children:[h(`span`,{className:`wui-reaction-emoji`,children:e.emoji}),h(`span`,{className:`wui-reaction-count`,children:l(e.count,{decimals:0})})]},e.emoji)),!n&&h(`button`,{type:`button`,className:`wui-reaction-add`,"data-wui-action":`react-menu`,"aria-label":v.addReaction,"aria-haspopup":`true`,"aria-expanded":`false`,children:h(r,{name:`emoji-smile`,size:16})})]}),!n&&!T&&(P||M||N)&&g(`div`,{className:`wui-comment-actions`,"data-wui-actions":``,children:[P&&h(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`reply`,children:v.reply}),M&&h(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`edit`,children:v.edit}),N&&h(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`delete`,children:v.delete})]}),N&&g(`div`,{className:`wui-comment-confirm`,"data-wui-confirm":``,hidden:!0,children:[h(`span`,{className:`wui-comment-confirm-text`,children:v.confirmDelete}),h(`button`,{type:`button`,className:`btn btn-danger btn-sm`,"data-wui-action":`confirm-delete`,children:v.delete}),h(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,"data-wui-action":`cancel-delete`,children:v.cancel})]}),!n&&h(`div`,{className:`wui-comment-error`,"data-wui-error":``,hidden:!0})]})]}),t&&k.length>0&&h(`ol`,{className:`wui-comment-list wui-comment-replies`,"aria-label":v.repliesName(A),children:k.map(e=>h(S,{comment:e,readOnly:n,allowReactions:f},e.id))}),P&&!n&&!T&&h(`div`,{className:`wui-comment-reply`,"data-wui-reply":``,hidden:!0})]})}export{x as default};
@@ -2,7 +2,7 @@
2
2
  "format": "webority-guidance/1",
3
3
  "package": {
4
4
  "name": "@webority/ui-react",
5
- "version": "0.108.0"
5
+ "version": "0.109.0"
6
6
  },
7
7
  "components": [
8
8
  {
@@ -22,6 +22,22 @@ export type CommentThreadItem = {
22
22
  * Shows "Edited" beside the time.
23
23
  */
24
24
  edited?: boolean;
25
+ /**
26
+ * The viewer's own comment.
27
+ */
28
+ mine?: boolean;
29
+ /**
30
+ * An internal note, marked with a badge.
31
+ */
32
+ internal?: boolean;
33
+ /**
34
+ * Files shown under the body.
35
+ */
36
+ attachments?: {
37
+ name: string;
38
+ href: string;
39
+ sizeBytes?: number;
40
+ }[];
25
41
  /**
26
42
  * Shows "This comment was deleted." in place of the body; replies stay.
27
43
  */
@@ -64,6 +80,9 @@ export type CommentThreadItem = {
64
80
  * @property {string | number | Date} at When it was written: an ISO instant with its zone, epoch ms or a Date. Shown in IST.
65
81
  * @property {string} [value] The stored body, with mentions as `@[Label](id)`.
66
82
  * @property {boolean} [edited] Shows "Edited" beside the time.
83
+ * @property {boolean} [mine] The viewer's own comment.
84
+ * @property {boolean} [internal] An internal note, marked with a badge.
85
+ * @property {{ name: string, href: string, sizeBytes?: number }[]} [attachments] Files shown under the body.
67
86
  * @property {boolean} [deleted] Shows "This comment was deleted." in place of the body; replies stay.
68
87
  * @property {boolean} [canEdit] This person may edit it.
69
88
  * @property {boolean} [canDelete] This person may delete it.
@@ -85,6 +104,7 @@ export type CommentThreadItem = {
85
104
  * @param {boolean} [props.allowReplies] False leaves out the Reply action and the reply box; existing replies still show.
86
105
  * @param {boolean} [props.allowReactions] False leaves out the reaction panel and the reaction chips.
87
106
  * @param {string} [props.composerPlaceholder] The composer box's placeholder; without it the standard one.
107
+ * @param {"list"|"conversation"} [props.variant] `conversation` adds the conversation class to the root; `list` is the default.
88
108
  * @param {"stacked"|"inline"} [props.composer] The box under the list, or one row with the author's avatar, the box and the post button.
89
109
  * @param {string} [props.author] The name for the inline composer's avatar; ignored when stacked.
90
110
  * @param {string} [props.postLabel] The post button's text; without it "Comment".
@@ -132,6 +152,11 @@ export default function AppCommentThread(props: {
132
152
  allowReactions?: boolean;
133
153
  /** The composer box's placeholder. Without it the standard placeholder asks for a comment and names @ mentions. */
134
154
  composerPlaceholder?: string;
155
+ /**
156
+ * list: every comment down one column. conversation: chat bubbles, this person's own on the right.
157
+ * @default "list"
158
+ */
159
+ variant?: "list" | "conversation";
135
160
  /**
136
161
  * stacked: the box under the list. inline: one row with the author's avatar, the box and the post button.
137
162
  * @default "stacked"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/ui-react",
3
- "version": "0.108.0",
3
+ "version": "0.109.0",
4
4
  "description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "sideEffects": false,
31
31
  "dependencies": {
32
- "@webority/theme": "0.108.0",
33
- "@webority/ui-elements": "0.108.0"
32
+ "@webority/ui-elements": "0.109.0",
33
+ "@webority/theme": "0.109.0"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@webority/analytics": "^0.28.0",
@@ -56,8 +56,8 @@
56
56
  "typescript": "^7.0.2",
57
57
  "vite": "^8.0.12",
58
58
  "vitest": "5.0.1",
59
- "@webority/canvas-kit": "0.108.0",
60
- "@webority/tokens": "0.108.0"
59
+ "@webority/canvas-kit": "0.109.0",
60
+ "@webority/tokens": "0.109.0"
61
61
  },
62
62
  "scripts": {
63
63
  "build": "vite build && tsc -p tsconfig.json && node ../../scripts/inject-meta-docs.mjs && node ../canvas-kit/dist/cli.js build --config canvas-kit.json --out dist/canvas-kit && node ../canvas-kit/dist/cli.js guidance --config canvas-kit.json --out dist/guidance.json && node ../../scripts/sync-rcl-assets.mjs analytics",