@limetech/lime-crm-building-blocks 1.86.0 → 1.86.2
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 +15 -0
- package/dist/cjs/{index.esm-4d6e52bb.js → index.esm-d6513e37.js} +14 -14
- package/dist/cjs/limebb-browser.cjs.entry.js +1 -1
- package/dist/cjs/limebb-chat-item_2.cjs.entry.js +1 -1
- package/dist/cjs/limebb-chat-list.cjs.entry.js +1 -1
- package/dist/cjs/limebb-component-config.cjs.entry.js +1 -1
- package/dist/cjs/limebb-component-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-currency-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +2 -2
- package/dist/cjs/limebb-feed.cjs.entry.js +1 -1
- package/dist/cjs/limebb-icon-picker.cjs.entry.js +27878 -1
- package/dist/cjs/limebb-info-tile.cjs.entry.js +1 -1
- package/dist/cjs/limebb-kanban-group.cjs.entry.js +1 -1
- package/dist/cjs/limebb-kanban-item.cjs.entry.js +2 -2
- package/dist/cjs/limebb-limeobject-file-viewer.cjs.entry.js +1 -1
- package/dist/cjs/limebb-loader.cjs.entry.js +1 -1
- package/dist/cjs/limebb-locale-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-mention.cjs.entry.js +1 -1
- package/dist/cjs/limebb-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-notification-list.cjs.entry.js +1 -1
- package/dist/cjs/limebb-text-editor.cjs.entry.js +2 -2
- package/dist/collection/components/feed/feed-item/feed-timeline-item.css +1 -0
- package/dist/collection/components/icon-picker/icon-picker.js +8 -13
- package/dist/collection/components/kanban/kanban-item/kanban-item.css +1 -0
- package/dist/components/feed-timeline-item.js +1 -1
- package/dist/components/index.esm.js +14 -14
- package/dist/components/kanban-item.js +1 -1
- package/dist/components/limebb-icon-picker.js +27878 -1
- package/dist/components/limebb-text-editor.js +2 -2
- package/dist/esm/{index.esm-55b8eae3.js → index.esm-5e14dac9.js} +14 -14
- package/dist/esm/limebb-browser.entry.js +1 -1
- package/dist/esm/limebb-chat-item_2.entry.js +1 -1
- package/dist/esm/limebb-chat-list.entry.js +1 -1
- package/dist/esm/limebb-component-config.entry.js +1 -1
- package/dist/esm/limebb-component-picker.entry.js +1 -1
- package/dist/esm/limebb-currency-picker.entry.js +1 -1
- package/dist/esm/limebb-date-picker.entry.js +1 -1
- package/dist/esm/limebb-feed-timeline-item.entry.js +2 -2
- package/dist/esm/limebb-feed.entry.js +1 -1
- package/dist/esm/limebb-icon-picker.entry.js +27878 -1
- package/dist/esm/limebb-info-tile.entry.js +1 -1
- package/dist/esm/limebb-kanban-group.entry.js +1 -1
- package/dist/esm/limebb-kanban-item.entry.js +2 -2
- package/dist/esm/limebb-limeobject-file-viewer.entry.js +1 -1
- package/dist/esm/limebb-loader.entry.js +1 -1
- package/dist/esm/limebb-locale-picker.entry.js +1 -1
- package/dist/esm/limebb-mention.entry.js +1 -1
- package/dist/esm/limebb-notification-item.entry.js +1 -1
- package/dist/esm/limebb-notification-list.entry.js +1 -1
- package/dist/esm/limebb-text-editor.entry.js +2 -2
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-e62af894.entry.js → p-06839012.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-ca191a20.entry.js → p-1eb8fb75.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-7f5bd5c3.entry.js → p-27786967.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-31a55daa.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-e9289669.entry.js → p-37e0254e.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-03e3c363.entry.js → p-38eec842.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-e17afaf3.js → p-3b9766cc.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-8b95be6e.entry.js → p-3d961c1b.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-088caa7b.entry.js → p-3dce616c.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-563a1aa3.entry.js → p-43c76027.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-d9f7403a.entry.js → p-46bf22fa.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-804408d3.entry.js → p-51e87162.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-2c47495d.entry.js → p-67e1ea69.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-2552ee95.entry.js → p-acce6160.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-232181fb.entry.js → p-adcb57c6.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-6fa65df4.entry.js → p-af6e6696.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-94e53437.entry.js → p-bf322752.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-967feb88.entry.js → p-c4e6dcf4.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-4ddf2d68.entry.js → p-ca79dc23.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-cc105197.entry.js → p-ccc748a1.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-ccf8a5e9.entry.js → p-cf06416b.entry.js} +1 -1
- package/dist/types/components/icon-picker/icon-picker.d.ts +7 -12
- package/dist/types/components.d.ts +28 -44
- package/package.json +4 -4
- package/dist/lime-crm-building-blocks/p-0d108e9f.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as t,H as i}from"./p-d736c794.js";import{c as r}from"./p-
|
|
1
|
+
import{r as e,h as t,H as i}from"./p-d736c794.js";import{c as r}from"./p-3b9766cc.js";function a(e){return e.items.forEach((t=>{e.processedItems.push({type:"chat",item:t})})),e}function o(e){const t=[];let i=e.newItemIndicatorInserted;return e.processedItems.forEach((r=>{"chat"===r.type&&e.lastVisitedTimestamp&&!i&&new Date(r.item.timestamp)<=e.lastVisitedTimestamp&&e.hasUnseenNotifications&&(t.push({type:"newItemIndicator"}),i=!0),t.push(r)})),e.processedItems=t,e.newItemIndicatorInserted=i,e}function n(e){const t=[];let i=null,r=null;for(const a of e.processedItems)if("chat"===a.type){const o=new Date(a.item.timestamp),n=e.dateTimeFormatter.format(o,"date");n!==r&&(i&&t.push(i),i={type:"group",groupType:"dateGroup",heading:n,items:[]},r=n),i&&i.items.push(a)}else"newItemIndicator"===a.type&&(i?i.items.push(a):t.push(a));return i&&t.push(i),Object.assign(Object.assign({},e),{processedItems:t})}const s=class{constructor(t){e(this,t),this.items=[],this.order="oldest-on-top",this.processedItems=[]}handleItemsChange(){let e=null;var t,i,r,s;this.lastVisitedTimestamp&&(e="string"==typeof(s=this.lastVisitedTimestamp)?new Date(Date.parse(s)):new Date(s)),this.processedItems=(r={items:t=this.items,processedItems:[],lastVisitedTimestamp:i=e,dateTimeFormatter:this.dateTimeFormatter,newItemIndicatorInserted:!1,lastProcessedDate:null,hasUnseenNotifications:t.some((e=>i&&new Date(e.timestamp)>i))},[a,o,n].reduce(((e,t)=>t(e)),r)).processedItems}componentWillLoad(){this.handleItemsChange()}render(){return t(i,{key:"7b7df58ebe16c77e0157f7f4e8727bc4c8e7babd",class:{"is-empty":!this.items.length&&!this.isTypingIndicatorVisible},"aria-busy":this.isBusy(),role:"log"},this.renderSpinner(),t("div",{key:"6405e99a6022133386c6857851802e830a9256df",class:"typing-indicator-height-animation"},t("div",{key:"c120e891885f4f75e37121a03f8ee5ac119c0684"},this.renderTypingIndicator())),this.renderChatItems())}renderSpinner(){if(this.loading)return t("limel-spinner",null)}renderTypingIndicator(){if(this.isTypingIndicatorVisible)return t("limebb-typing-indicator",null)}renderChatItems(){return this.processedItems.map((e=>{switch(e.type){case"group":return this.renderGroup(e);case"newItemIndicator":return this.renderIndicator();default:return null}}))}renderGroup(e){const i=e.items.map((e=>"chat"===e.type?this.renderChatItem(e.item):"newItemIndicator"===e.type?this.renderIndicator():void 0)),r="date-group-"+crypto.randomUUID(),a=`heading-${r}`,o=t("a",{id:a,class:"date-heading",role:"heading","aria-level":2},e.heading);return"oldest-on-top"===this.order?t("section",{class:"date-group",key:r,"aria-labelledby":a},i,o):t("section",{class:"date-group",key:r,"aria-labelledby":a},o,i)}renderChatItem(e){return t("limebb-chat-item",{platform:this.platform,context:this.context,item:e,helperText:e.helperText,hasError:e.hasError,key:e.id})}renderIndicator(){return t("div",{class:"new-items-indicator",role:"separator"},t("hr",null),t("h3",null,this.translator.get("webclient.new")))}isBusy(){return this.loading||this.isTypingIndicatorVisible?"true":"false"}get dateTimeFormatter(){return this.platform.get(r.DateTimeFormatter)}get translator(){return this.platform.get(r.Translate)}static get watchers(){return{items:["handleItemsChange"]}}};s.style='@charset "UTF-8";:host(limebb-chat-list){--limel-top-edge-fade-height:0.75rem;isolation:isolate;--limel-overflow-mask-vertical:linear-gradient(\n to bottom,\n transparent 0%,\n black calc(0% + var(--limel-top-edge-fade-height, 1rem)),\n black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)),\n transparent 100%\n );-webkit-mask-image:var(--limel-overflow-mask-vertical);mask-image:var(--limel-overflow-mask-vertical);padding-top:var(--limel-top-edge-fade-height, 1rem);padding-bottom:var(--limel-bottom-edge-fade-height, 1rem);box-sizing:border-box;display:flex;gap:0.5rem;height:100%;width:100%;min-width:0;min-height:0;padding:var(--limel-top-edge-fade-height) 0.5rem;overflow:hidden auto}:host(limebb-chat-list.is-empty){padding:0}:host(limebb-chat-list[order=oldest-on-top]){flex-direction:column-reverse}:host(limebb-chat-list[order=newest-on-top]){flex-direction:column}*{box-sizing:border-box}limel-spinner{align-self:center;justify-self:center;margin:auto}.date-group{isolation:isolate;display:flex;flex-direction:inherit;gap:0.5rem}.date-heading{position:sticky;z-index:1;top:0.25rem;display:flex;border-radius:9rem;padding:0.25rem 0.5rem;margin:0 auto;width:fit-content;font-size:0.75rem;line-height:1;color:rgb(var(--contrast-900));backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem);transition:color 0.2s ease, border-color 0.4s ease}.date-heading:hover{color:rgb(var(--contrast-1000));border-color:rgb(var(--contrast-500))}.date-heading:hover:before{opacity:1}.date-heading:before{transition:opacity 0.2s ease;content:"";position:absolute;z-index:-1;inset:0;opacity:0.6;border-radius:inherit;background-color:rgb(var(--contrast-100))}.new-items-indicator{position:relative;isolation:isolate;display:flex;align-items:center;justify-content:flex-end;margin:0.25rem 0}.new-items-indicator hr{border:none;position:absolute;width:100%;height:1px;background-color:rgb(var(--color-red-lighter))}.new-items-indicator h3{z-index:1;padding:0 0.5rem;border-radius:1rem;margin:0 1rem;font-size:small;line-height:0.75rem;text-transform:lowercase;color:rgb(var(--color-red-default));background-color:rgb(var(--contrast-100))}.typing-indicator-height-animation{--limebb-chat-typing-opacity-transition-speed:0.1s;--limebb-chat-typing-opacity-transition-delay:0s;--limebb-chat-typing-grid-template-rows-transition-speed:0.3s;position:sticky;top:0;z-index:1;transition:grid-template-rows var(--limebb-chat-typing-grid-template-rows-transition-speed) ease;display:grid;grid-template-rows:0}.typing-indicator-height-animation div{transition:opacity var(--limebb-chat-typing-opacity-transition-speed) ease var(--limebb-chat-typing-opacity-transition-delay);overflow:hidden;opacity:0}:host(limebb-chat-list[is-typing-indicator-visible]) .typing-indicator-height-animation{--limebb-chat-typing-opacity-transition-speed:0.4s;--limebb-chat-typing-opacity-transition-delay:0.3s;--limebb-chat-typing-grid-template-rows-transition-speed:0.46s;grid-template-rows:1.5rem}:host(limebb-chat-list[is-typing-indicator-visible]) .typing-indicator-height-animation div{opacity:1}.date-group limebb-chat-item{--limebb-promoted-action-bar-grid-template-rows:0fr}:host(limebb-chat-list[order=oldest-on-top]) .date-group:first-of-type limebb-chat-item:first-of-type{--limebb-promoted-action-bar-grid-template-rows:1fr}:host(limebb-chat-list[order=newest-on-top]) .date-group:first-of-type limebb-chat-item:first-of-type{--limebb-promoted-action-bar-grid-template-rows:1fr}';export{s as limebb_chat_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as r}from"./p-d736c794.js";import{c as o}from"./p-
|
|
1
|
+
import{r as t,c as i,h as e,H as r}from"./p-d736c794.js";import{c as o}from"./p-3b9766cc.js";const a=class{constructor(r){t(this,r),this.interact=i(this,"interact",7),this.handleClick=()=>{this.isItemClickable()&&this.handleNotificationListItemClick()},this.handleKeyDown=t=>{this.isItemClickable()&&"Enter"===t.key&&this.handleNotificationListItemClick()},this.renderHeading=()=>{if(!this.item.heading)return;if(!this.item.author)return e("limel-markdown",{value:this.translator.get(this.item.heading)});const t=this.getAuthorLink(),i=this.translator.get(this.item.heading,{author:t});return e("limel-markdown",{class:"heading",value:i})},this.createMenuItem=t=>{var i,e;return"separator"in t?t:{value:t,text:null!==(i=t.label)&&void 0!==i?i:"",secondaryText:t.description,disabled:t.disabled,icon:null!==(e=t.icon)&&void 0!==e?e:""}},this.handleMenuItemSelect=t=>{var i;t.stopPropagation();const e=null===(i=t.detail.value)||void 0===i?void 0:i.command;e&&this.commandbus.handle(e)},this.handleNotificationListItemClick=()=>{this.interact.emit(this.item)}}render(){var t,i;return e(r,{key:"df92efa4c8176e51f312c337c6699433aa2bb50d",id:this.item.id,class:{"is-clickable":this.isItemClickable(),"is-read":!!(null===(t=this.item)||void 0===t?void 0:t.read),"is-selected":!!(null===(i=this.item)||void 0===i?void 0:i.selected)},onClick:this.handleClick,onKeyDown:this.handleKeyDown,tabindex:0},this.renderSource(),this.renderContent())}isItemClickable(){var t;return!!(null===(t=this.item)||void 0===t?void 0:t.clickable)}renderSource(){return e("div",{class:"header"},this.renderIcon(),this.renderCaption(),this.renderTimestamp(),this.renderUnpromotedActionsMenu())}renderIcon(){var t,i,r,o;if(this.item.icon)return e("limel-icon",{class:"icon",badge:!0,name:null!==(i=null===(t=this.item.icon)||void 0===t?void 0:t.name)&&void 0!==i?i:"dot_circle",style:{color:`${null===(r=this.item.icon)||void 0===r?void 0:r.color}`,"background-color":`${null===(o=this.item.icon)||void 0===o?void 0:o.backgroundColor}`}})}renderContent(){return e("div",{class:"content"},e("div",{class:"body"},this.renderHeadline(),this.renderValue()),this.renderAuthorPicture())}renderHeadline(){if(this.item.heading)return e("div",{class:"headline"},this.renderHeading())}getAuthorLink(){if(!this.item.author)return;if("string"==typeof this.item.author.name)return this.item.author.name;const{href:t,text:i}=this.item.author.name;return`[${i}](${t})`}renderAuthorPicture(){var t;if(null===(t=this.item.author)||void 0===t?void 0:t.picture)return e("img",{class:"author-avatar",loading:"lazy",src:this.item.author.picture})}renderCaption(){if(this.item.caption)return e("h2",{class:"caption"},this.item.caption)}renderValue(){if(this.item.value)return e("limel-markdown",{class:"body-text",value:this.item.value})}renderUnpromotedActionsMenu(){var t,i;if(!(null===(t=this.item.unpromotedActions)||void 0===t?void 0:t.length))return;const r=this.item.unpromotedActions.map(this.createMenuItem);return e("limel-menu",{class:"unpromoted-actions-menu",items:r,openDirection:"bottom-end",onSelect:this.handleMenuItemSelect},e("limel-icon-button",{icon:"menu_2",slot:"trigger",label:null===(i=this.translator)||void 0===i?void 0:i.get("webclient.more-actions")}))}renderTimestamp(){const t=this.item.timestamp;if(t)return e("span",{class:"timestamp"},this.dateTimeFormatter.format(t,"timeofday"))}get dateTimeFormatter(){return this.platform.get(o.DateTimeFormatter)}get translator(){var t;return null===(t=this.platform)||void 0===t?void 0:t.get(o.Translate)}get commandbus(){var t;return null===(t=this.platform)||void 0===t?void 0:t.get(o.CommandBus)}};a.style='@charset "UTF-8";*{box-sizing:border-box}:host(limebb-notification-item){isolation:isolate;position:relative;box-sizing:border-box;display:flex;flex-direction:column;gap:0.25rem;margin-left:0.5rem;border-radius:0.75rem;border:1px solid rgb(var(--contrast-500))}:host(limebb-notification-item):before{content:"";display:block;position:absolute;left:-1rem;top:0.85rem;border-radius:50%;height:0.5rem;width:0.5rem;transition:background-color 0.2s ease, scale 0.2s cubic-bezier(0.82, 0.3, 0.14, 1.36);scale:var(--limebb-notification-item-unread-badge-scale, 0.6);background-color:var(--limebb-notification-item-unread-badge-color, transparent)}:host(limebb-notification-item:hover) .timestamp{color:rgb(var(--contrast-1100))}:host(limebb-notification-item:hover) .body-text{opacity:1}.header{display:flex;align-items:center;gap:0.25rem;min-height:2rem;padding:0 0 0 0.25rem;margin-bottom:0.25rem}.header:not(:has(.icon)){padding-left:0.75rem}.header:not(:has(.unpromoted-actions-menu)){padding-right:0.5rem}.caption,.timestamp{font-size:0.75rem}.caption{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0;flex-grow:1;font-weight:600;color:rgb(var(--contrast-900))}.timestamp{flex-shrink:0;margin-left:auto;transition:color 0.4s ease, opacity 0.2s ease;color:rgb(var(--contrast-900))}.headline{display:flex;gap:0.25rem;align-items:center}.content{display:flex;min-width:0;gap:0.5rem;padding:0 0.75rem 0.5rem 0.75rem}.heading{display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2;max-height:2.5rem;font-size:0.875rem;--markdown-hyperlink-color:var(--mdc-theme-primary);--markdown-hyperlink-color--hovered:rgb(var(--color-teal-light))}.body{display:flex;flex-direction:column;gap:0.5rem}.body-text{display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:3;max-height:4.25rem;transition:opacity 0.2s ease;opacity:0.7}.icon{--icon-background-color:var(--limebb-feed-background-color);flex-shrink:0;width:1.5rem;padding:0.125rem}.author-avatar{border-radius:50%;width:2rem;height:2rem;object-fit:cover;margin-top:auto;margin-right:-0.25rem;margin-left:auto;box-shadow:0 0 0 1px rgb(var(--contrast-600))}.author{font-weight:bold;text-decoration:none;white-space:nowrap}a.author{position:relative;cursor:pointer;transition:color 0.2s ease;color:var(--mdc-theme-primary)}a.author:before{transition:opacity 0.2s ease, transform 0.3s ease-out;content:"";position:absolute;inset:auto 0 0 0;width:calc(100% - 0.5rem);margin:auto;height:0.125rem;border-radius:1rem;background-color:currentColor;opacity:0;transform:scale(0.6)}a.author:hover{color:rgb(var(--color-teal-light))}a.author:hover:before{opacity:0.3;transform:scale(1)}limel-chip-set{--button-shadow-normal:none;margin-left:-1rem;margin-bottom:-0.5rem}';export{a as limebb_notification_item}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as t}from"./p-d736c794.js";const n={Route:"route"};function r(t){return t&&["belongsto","hasone","hasmany","hasandbelongstomany"].includes(t.type)}function i(t){return t&&["belongsto","hasone"].includes(t.type)}n.LimeTypeRepository="state.limetypes";var o=function(t,n){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])})(t,n)};function e(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function u(t){var n="function"==typeof Symbol&&Symbol.iterator,r=n&&t[n],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,n){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,o,e=r.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(i=e.next()).done;)u.push(i.value)}catch(t){o={error:t}}finally{try{i&&!i.done&&(r=e.return)&&r.call(e)}finally{if(o)throw o.error}}return u}function s(t,n,r){if(r||2===arguments.length)for(var i,o=0,e=n.length;o<e;o++)(i||!(o in n))&&(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))}function f(t){return"function"==typeof t}function a(t){var n=t((function(t){Error.call(t),t.stack=(new Error).stack}));return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var h=a((function(t){return function(n){t(this),this.message=n?n.length+" errors occurred during unsubscription:\n"+n.map((function(t,n){return n+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=n}}));function l(t,n){if(t){var r=t.indexOf(n);0<=r&&t.splice(r,1)}}var v=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var t,n,r,i,o;if(!this.closed){this.closed=!0;var e=this._parentage;if(e)if(this._parentage=null,Array.isArray(e))try{for(var a=u(e),l=a.next();!l.done;l=a.next())l.value.remove(this)}catch(n){t={error:n}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}else e.remove(this);var v=this.initialTeardown;if(f(v))try{v()}catch(t){o=t instanceof h?t.errors:[t]}var y=this._finalizers;if(y){this._finalizers=null;try{for(var d=u(y),m=d.next();!m.done;m=d.next()){var w=m.value;try{b(w)}catch(t){o=o??[],t instanceof h?o=s(s([],c(o)),c(t.errors)):o.push(t)}}}catch(t){r={error:t}}finally{try{m&&!m.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}}if(o)throw new h(o)}},t.prototype.add=function(n){var r;if(n&&n!==this)if(this.closed)b(n);else{if(n instanceof t){if(n.closed||n._hasParent(this))return;n._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(n)}},t.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},t.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},t.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&l(n,t)},t.prototype.remove=function(n){var r=this._finalizers;r&&l(r,n),n instanceof t&&n._removeParent(this)},t.EMPTY=((n=new t).closed=!0,n),t;var n}(),y=v.EMPTY;function d(t){return t instanceof v||t&&"closed"in t&&f(t.remove)&&f(t.add)&&f(t.unsubscribe)}function b(t){f(t)?t():t.unsubscribe()}var m=function(t,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,s([t,n],c(r)))};function w(){}function p(t){t()}var g=function(t){function n(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,d(n)&&n.add(r)):r.destination=A,r}return e(n,t),n.create=function(t,n,r){return new O(t,n,r)},n.prototype.next=function(t){this.isStopped||this._next(t)},n.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},n.prototype._next=function(t){this.destination.next(t)},n.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},n.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},n}(v),j=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(t){S(t)}},t.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(t){S(t)}else S(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){S(t)}},t}(),O=function(t){function n(n,r,i){var o,e=t.call(this)||this;return o=f(n)||!n?{next:n??void 0,error:r??void 0,complete:i??void 0}:n,e.destination=new j(o),e}return e(n,t),n}(g);function S(t){!function(t){m((function(){throw t}))}(t)}var A={closed:!0,next:w,error:function(t){throw t},complete:w},E="function"==typeof Symbol&&Symbol.observable||"@@observable";function x(t){return t}var P=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(n){var r=new t;return r.source=this,r.operator=n,r},t.prototype.subscribe=function(t,n,r){var i=this,o=function(t){return t&&t instanceof g||function(t){return t&&f(t.next)&&f(t.error)&&f(t.complete)}(t)&&d(t)}(t)?t:new O(t,n,r);return p((function(){var t=i.operator,n=i.source;o.add(t?t.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},t.prototype.forEach=function(t,n){var r=this;return new(n=T(n))((function(n,i){var o=new O({next:function(n){try{t(n)}catch(t){i(t),o.unsubscribe()}},error:i,complete:n});r.subscribe(o)}))},t.prototype._subscribe=function(t){var n;return null===(n=this.source)||void 0===n?void 0:n.subscribe(t)},t.prototype[E]=function(){return this},t.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(t){return 0===t.length?x:1===t.length?t[0]:function(n){return t.reduce((function(t,n){return n(t)}),n)}}(t)(this)},t.prototype.toPromise=function(t){var n=this;return new(t=T(t))((function(t,r){var i;n.subscribe((function(t){return i=t}),(function(t){return r(t)}),(function(){return t(i)}))}))},t.create=function(n){return new t(n)},t}();function T(t){var n;return null!==(n=t??undefined)&&void 0!==n?n:Promise}var M=a((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),k=function(t){function n(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e(n,t),n.prototype.lift=function(t){var n=new R(this,this);return n.operator=t,n},n.prototype._throwIfClosed=function(){if(this.closed)throw new M},n.prototype.next=function(t){var n=this;p((function(){var r,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=u(n.currentObservers),e=o.next();!e.done;e=o.next())e.value.next(t)}catch(t){r={error:t}}finally{try{e&&!e.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}}}))},n.prototype.error=function(t){var n=this;p((function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var r=n.observers;r.length;)r.shift().error(t)}}))},n.prototype.complete=function(){var t=this;p((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}}))},n.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(n.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),n.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},n.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},n.prototype._innerSubscribe=function(t){var n=this,r=this,i=r.observers;return r.hasError||r.isStopped?y:(this.currentObservers=null,i.push(t),new v((function(){n.currentObservers=null,l(i,t)})))},n.prototype._checkFinalizedStatuses=function(t){var n=this,r=n.isStopped;n.hasError?t.error(n.thrownError):r&&t.complete()},n.prototype.asObservable=function(){var t=new P;return t.source=this,t},n.create=function(t,n){return new R(t,n)},n}(P),R=function(t){function n(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e(n,t),n.prototype.next=function(t){var n,r;null===(r=null===(n=this.destination)||void 0===n?void 0:n.next)||void 0===r||r.call(n,t)},n.prototype.error=function(t){var n,r;null===(r=null===(n=this.destination)||void 0===n?void 0:n.error)||void 0===r||r.call(n,t)},n.prototype.complete=function(){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===n||n.call(t)},n.prototype._subscribe=function(t){var n,r;return null!==(r=null===(n=this.source)||void 0===n?void 0:n.subscribe(t))&&void 0!==r?r:y},n}(k),C=function(t){function n(n){var r=t.call(this)||this;return r._value=n,r}return e(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),n.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},n.prototype.getValue=function(){var t=this,n=t._value;if(t.hasError)throw t.thrownError;return this._throwIfClosed(),n},n.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},n}(k);function U(t){return t}function G(t,n){return(r,i)=>{const o=function(t,n,r,i){let o=W.get(t);return o||(o=[],W.set(t,o)),o.push({options:r,name:n,optionFactory:i.optionFactory||U,service:{name:i.name,method:i.method||"subscribe"}}),o}(r,i,t,n);1===o.length&&function(t,n){t.connectedCallback=F(t.connectedCallback,n),t.componentWillLoad=function(t,n){return async function(...r){return!0===D.get(this)?(await L(this),t?t.apply(this,r):void 0):F(t,n).apply(this,r)}}(t.componentWillLoad,n),t.componentDidUnload=H(t.componentDidUnload),t.disconnectedCallback=H(t.disconnectedCallback)}(r,o)}}const W=new WeakMap,_=new WeakMap,D=new WeakMap;function F(n,r){return async function(...i){D.set(this,!0),_.set(this,[]),await L(this);const o=new C(this.context);if(function(n,r,i){const o=t(n),{get:e,set:u}=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(o),r);Object.defineProperty(o,r,{configurable:!0,get:e,set:function(t){u.call(this,t),i.next(t)}})}(this,"context",o),r.forEach((t=>{t.options=t.optionFactory(t.options,this),function(t){return"context"in t}(t.options)&&(t.options.context=o),function(t,n){const r=function(t,n){const r={...n.options};!function(t,n){t.filter&&(t.filter=t.filter.map((t=>t.bind(n)))),t.map&&(t.map=t.map.map((t=>t.bind(n))))}(r,t);const i=n.service.name,o=t.platform;if(!o.has(i))throw new Error(`Service ${i} does not exist`);return o.get(i)[n.service.method](function(t,n){return r=>{t[n]=r}}(t,n.name),r)}(t,n);"function"==typeof r&&_.get(t).push(r)}(this,t)})),n)return n.apply(this,i)}}function H(t){return async function(...n){let r;return t&&(r=t.apply(this,n)),function(t){_.get(t).forEach((t=>t())),_.set(t,[])}(this),r}}function L(t){const n=[];return t.platform||n.push(N(t,"platform")),t.context||n.push(N(t,"context")),n.length?Promise.all(n):Promise.resolve()}function N(n,r){const i=t(n);return new Promise((t=>{Object.defineProperty(i,r,{configurable:!0,set:n=>{delete i[r],i[r]=n,t()}})}))}function q(t={}){return G(t,{name:n.LimeTypeRepository})}function B(t={}){const r={name:n.LimeTypeRepository};return t.map=[I,...t.map||[]],t.context=null,G(t,r)}function I(t){const{limetype:n}=this.context;return t[n]}function K(t={}){const r={name:n.LimeObjectRepository};return t.map=[V,...t.map||[]],t.context=null,G(t,r)}function V(t){const{limetype:n,id:r}=this.context;if(t[n])return t[n].find((t=>t.id===r))}function X(t){return n=>{(function(t,n){t.commandId=n})(n,t.id),function(t,n){Object.defineProperty(t,Symbol.hasInstance,{value:t=>function(t){let n,r=[],i=t;for(;n=Y(i);)r=[...r,n],i=Object.getPrototypeOf(i);return Array.from(new Set(r))}(t).includes(n)})}(n,t.id)}}function Y(t){return"string"==typeof t?t:t&&t.constructor&&t.constructor.commandId?t.constructor.commandId:t&&t.commandId?t.commandId:null}n.LimeObjectRepository="state.limeobjects",n.CommandBus="commandBus";let $=class{};$=((t,n)=>{for(var r,i=n,o=t.length-1;o>=0;o--)(r=t[o])&&(i=r(i)||i);return i})([X({id:"limeobject.bulk-create-dialog"})],$);let z=class{constructor(){this.route=!1}};z=((t,n)=>{for(var r,i=n,o=t.length-1;o>=0;o--)(r=t[o])&&(i=r(i)||i);return i})([X({id:"limeobject.create-dialog"})],z);let J=class{};J=((t,n)=>{for(var r,i=n,o=t.length-1;o>=0;o--)(r=t[o])&&(i=r(i)||i);return i})([X({id:"limeobject.delete-object"})],J);let Q=class{};Q=((t,n)=>{for(var r,i=n,o=t.length-1;o>=0;o--)(r=t[o])&&(i=r(i)||i);return i})([X({id:"limeobject.object-access"})],Q);let Z=class{constructor(){this.route=!1}};Z=((t,n)=>{for(var r,i=n,o=t.length-1;o>=0;o--)(r=t[o])&&(i=r(i)||i);return i})([X({id:"limeobject.save-object"})],Z);const tt={Count:"COUNT",Sum:"SUM",Average:"AVG",Maximum:"MAX",Minimum:"MIN"};n.Query="query";const nt={Get:"GET",Post:"POST",Put:"PUT",Delete:"DELETE",Patch:"PATCH"};n.Http="http",n.EventDispatcher="eventDispatcher",n.Translate="translate",n.Dialog="dialog",n.KeybindingRegistry="keybindingRegistry",n.Navigator="navigator";let rt=class{};function it(t){return G(t,{name:n.ConfigRepository})}function ot(t={}){return G(t,{name:n.FilterRepository})}rt=((t,n)=>{for(var r,i=n,o=t.length-1;o>=0;o--)(r=t[o])&&(i=r(i)||i);return i})([X({id:"navigator.navigate"})],rt),n.Notification="notifications",n.RouteRegistry="routeRegistry",n.TaskRepository="state.tasks",n.ConfigRepository="state.configs",n.Device="state.device",n.FilterRepository="state.filters",n.UserDataRepository="state.user-data",n.Application="state.application",n.UserPreferencesRepository="userPreferences",n.DateTimeFormatter="datetimeformatter",n.ConditionRegistry="conditionRegistry",n.ViewFactoryRegistry="viewFactoryRegistry",n.WebComponentRegistry="webComponentRegistry",n.NotificationRepository="state.notifications",n.PollerFactory="pollerFactory";export{K as G,nt as H,ot as K,B as L,r as M,q as T,tt as W,it as Y,n as c,X as h,i as j}
|
|
1
|
+
import{g as t}from"./p-d736c794.js";const n={Route:"route"};function r(t){return t&&["belongsto","hasone","hasmany","hasandbelongstomany"].includes(t.type)}function i(t){return t&&["belongsto","hasone"].includes(t.type)}n.LimeTypeRepository="state.limetypes";var o=function(t,n){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])})(t,n)};function e(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function u(t){var n="function"==typeof Symbol&&Symbol.iterator,r=n&&t[n],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,n){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,o,e=r.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(i=e.next()).done;)u.push(i.value)}catch(t){o={error:t}}finally{try{i&&!i.done&&(r=e.return)&&r.call(e)}finally{if(o)throw o.error}}return u}function s(t,n,r){if(r||2===arguments.length)for(var i,o=0,e=n.length;o<e;o++)(i||!(o in n))&&(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))}function f(t){return"function"==typeof t}function a(t){var n=t((function(t){Error.call(t),t.stack=(new Error).stack}));return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var h=a((function(t){return function(n){t(this),this.message=n?n.length+" errors occurred during unsubscription:\n"+n.map((function(t,n){return n+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=n}}));function l(t,n){if(t){var r=t.indexOf(n);0<=r&&t.splice(r,1)}}var v=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var t,n,r,i,o;if(!this.closed){this.closed=!0;var e=this._parentage;if(e)if(this._parentage=null,Array.isArray(e))try{for(var a=u(e),l=a.next();!l.done;l=a.next())l.value.remove(this)}catch(n){t={error:n}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}else e.remove(this);var v=this.initialTeardown;if(f(v))try{v()}catch(t){o=t instanceof h?t.errors:[t]}var y=this._finalizers;if(y){this._finalizers=null;try{for(var d=u(y),m=d.next();!m.done;m=d.next()){var w=m.value;try{b(w)}catch(t){o=o??[],t instanceof h?o=s(s([],c(o)),c(t.errors)):o.push(t)}}}catch(t){r={error:t}}finally{try{m&&!m.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}}if(o)throw new h(o)}},t.prototype.add=function(n){var r;if(n&&n!==this)if(this.closed)b(n);else{if(n instanceof t){if(n.closed||n._hasParent(this))return;n._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(n)}},t.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},t.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},t.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&l(n,t)},t.prototype.remove=function(n){var r=this._finalizers;r&&l(r,n),n instanceof t&&n._removeParent(this)},t.EMPTY=((n=new t).closed=!0,n),t;var n}(),y=v.EMPTY;function d(t){return t instanceof v||t&&"closed"in t&&f(t.remove)&&f(t.add)&&f(t.unsubscribe)}function b(t){f(t)?t():t.unsubscribe()}var m=function(t,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,s([t,n],c(r)))};function w(){}function p(t){t()}var g=function(t){function n(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,d(n)&&n.add(r)):r.destination=A,r}return e(n,t),n.create=function(t,n,r){return new O(t,n,r)},n.prototype.next=function(t){this.isStopped||this._next(t)},n.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},n.prototype._next=function(t){this.destination.next(t)},n.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},n.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},n}(v),j=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(t){S(t)}},t.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(t){S(t)}else S(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){S(t)}},t}(),O=function(t){function n(n,r,i){var o,e=t.call(this)||this;return o=f(n)||!n?{next:n??void 0,error:r??void 0,complete:i??void 0}:n,e.destination=new j(o),e}return e(n,t),n}(g);function S(t){!function(t){m((function(){throw t}))}(t)}var A={closed:!0,next:w,error:function(t){throw t},complete:w},E="function"==typeof Symbol&&Symbol.observable||"@@observable";function x(t){return t}var P=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(n){var r=new t;return r.source=this,r.operator=n,r},t.prototype.subscribe=function(t,n,r){var i=this,o=function(t){return t&&t instanceof g||function(t){return t&&f(t.next)&&f(t.error)&&f(t.complete)}(t)&&d(t)}(t)?t:new O(t,n,r);return p((function(){var t=i.operator,n=i.source;o.add(t?t.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},t.prototype.forEach=function(t,n){var r=this;return new(n=T(n))((function(n,i){var o=new O({next:function(n){try{t(n)}catch(t){i(t),o.unsubscribe()}},error:i,complete:n});r.subscribe(o)}))},t.prototype._subscribe=function(t){var n;return null===(n=this.source)||void 0===n?void 0:n.subscribe(t)},t.prototype[E]=function(){return this},t.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(t){return 0===t.length?x:1===t.length?t[0]:function(n){return t.reduce((function(t,n){return n(t)}),n)}}(t)(this)},t.prototype.toPromise=function(t){var n=this;return new(t=T(t))((function(t,r){var i;n.subscribe((function(t){return i=t}),(function(t){return r(t)}),(function(){return t(i)}))}))},t.create=function(n){return new t(n)},t}();function T(t){var n;return null!==(n=t??undefined)&&void 0!==n?n:Promise}var M=a((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),k=function(t){function n(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e(n,t),n.prototype.lift=function(t){var n=new R(this,this);return n.operator=t,n},n.prototype._throwIfClosed=function(){if(this.closed)throw new M},n.prototype.next=function(t){var n=this;p((function(){var r,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=u(n.currentObservers),e=o.next();!e.done;e=o.next())e.value.next(t)}catch(t){r={error:t}}finally{try{e&&!e.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}}}))},n.prototype.error=function(t){var n=this;p((function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var r=n.observers;r.length;)r.shift().error(t)}}))},n.prototype.complete=function(){var t=this;p((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}}))},n.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(n.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),n.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},n.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},n.prototype._innerSubscribe=function(t){var n=this,r=this,i=r.observers;return r.hasError||r.isStopped?y:(this.currentObservers=null,i.push(t),new v((function(){n.currentObservers=null,l(i,t)})))},n.prototype._checkFinalizedStatuses=function(t){var n=this,r=n.isStopped;n.hasError?t.error(n.thrownError):r&&t.complete()},n.prototype.asObservable=function(){var t=new P;return t.source=this,t},n.create=function(t,n){return new R(t,n)},n}(P),R=function(t){function n(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e(n,t),n.prototype.next=function(t){var n,r;null===(r=null===(n=this.destination)||void 0===n?void 0:n.next)||void 0===r||r.call(n,t)},n.prototype.error=function(t){var n,r;null===(r=null===(n=this.destination)||void 0===n?void 0:n.error)||void 0===r||r.call(n,t)},n.prototype.complete=function(){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===n||n.call(t)},n.prototype._subscribe=function(t){var n,r;return null!==(r=null===(n=this.source)||void 0===n?void 0:n.subscribe(t))&&void 0!==r?r:y},n}(k),C=function(t){function n(n){var r=t.call(this)||this;return r._value=n,r}return e(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),n.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},n.prototype.getValue=function(){var t=this,n=t._value;if(t.hasError)throw t.thrownError;return this._throwIfClosed(),n},n.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},n}(k);function U(t){return t}function D(t,n){return(r,i)=>{const o=function(t,n,r,i){let o=G.get(t);return o||(o=[],G.set(t,o)),o.push({options:r,name:n,optionFactory:i.optionFactory||U,service:{name:i.name,method:i.method||"subscribe"}}),o}(r,i,t,n);1===o.length&&function(t,n){t.connectedCallback=F(t.connectedCallback,n),t.componentWillLoad=function(t,n){return async function(...r){return!0===_.get(this)?(await L(this),t?t.apply(this,r):void 0):F(t,n).apply(this,r)}}(t.componentWillLoad,n),t.componentDidUnload=H(t.componentDidUnload),t.disconnectedCallback=H(t.disconnectedCallback)}(r,o)}}const G=new WeakMap,W=new WeakMap,_=new WeakMap;function F(n,r){return async function(...i){_.set(this,!0),W.set(this,[]),await L(this);const o=new C(this.context);if(function(n,r,i){const o=t(n),{get:e,set:u}=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(o),r);Object.defineProperty(o,r,{configurable:!0,get:e,set:function(t){u.call(this,t),i.next(t)}})}(this,"context",o),r.forEach((t=>{t.options=t.optionFactory(t.options,this),function(t){return"context"in t}(t.options)&&(t.options.context=o),function(t,n){const r=function(t,n){const r={...n.options};!function(t,n){t.filter&&(t.filter=t.filter.map((t=>t.bind(n)))),t.map&&(t.map=t.map.map((t=>t.bind(n))))}(r,t);const i=n.service.name,o=t.platform;if(!o.has(i))throw new Error(`Service ${i} does not exist`);return o.get(i)[n.service.method](function(t,n){return r=>{t[n]=r}}(t,n.name),r)}(t,n);"function"==typeof r&&W.get(t).push(r)}(this,t)})),n)return n.apply(this,i)}}function H(t){return async function(...n){let r;return t&&(r=t.apply(this,n)),function(t){W.get(t).forEach((t=>t())),W.set(t,[])}(this),r}}function L(t){const n=[];return t.platform||n.push(N(t,"platform")),t.context||n.push(N(t,"context")),n.length?Promise.all(n):Promise.resolve()}function N(n,r){const i=t(n);return new Promise((t=>{Object.defineProperty(i,r,{configurable:!0,set:n=>{delete i[r],i[r]=n,t()}})}))}function q(t={}){return D(t,{name:n.LimeTypeRepository})}function B(t={}){const r={name:n.LimeTypeRepository};return t.map=[I,...t.map||[]],t.context=null,D(t,r)}function I(t){const{limetype:n}=this.context;return t[n]}function K(t={}){const r={name:n.LimeObjectRepository};return t.map=[V,...t.map||[]],t.context=null,D(t,r)}function V(t){const{limetype:n,id:r}=this.context;if(t[n])return t[n].find((t=>t.id===r))}function X(t){return n=>{(function(t,n){t.commandId=n})(n,t.id),function(t,n){Object.defineProperty(t,Symbol.hasInstance,{value:t=>function(t){let n,r=[],i=t;for(;n=Y(i);)r=[...r,n],i=Object.getPrototypeOf(i);return Array.from(new Set(r))}(t).includes(n)})}(n,t.id)}}function Y(t){return"string"==typeof t?t:t&&t.constructor&&t.constructor.commandId?t.constructor.commandId:t&&t.commandId?t.commandId:null}n.LimeObjectRepository="state.limeobjects",n.CommandBus="commandBus";let $=class{};$=((t,n)=>{for(var r,i=n,o=t.length-1;o>=0;o--)(r=t[o])&&(i=r(i)||i);return i})([X({id:"limeobject.bulk-create-dialog"})],$);let z=class{constructor(){this.route=!1}};z=((t,n)=>{for(var r,i=n,o=t.length-1;o>=0;o--)(r=t[o])&&(i=r(i)||i);return i})([X({id:"limeobject.create-dialog"})],z);let J=class{};J=((t,n)=>{for(var r,i=n,o=t.length-1;o>=0;o--)(r=t[o])&&(i=r(i)||i);return i})([X({id:"limeobject.delete-object"})],J);let Q=class{};Q=((t,n)=>{for(var r,i=n,o=t.length-1;o>=0;o--)(r=t[o])&&(i=r(i)||i);return i})([X({id:"limeobject.object-access"})],Q);let Z=class{constructor(){this.route=!1}};Z=((t,n)=>{for(var r,i=n,o=t.length-1;o>=0;o--)(r=t[o])&&(i=r(i)||i);return i})([X({id:"limeobject.save-object"})],Z);const tt={Count:"COUNT",Sum:"SUM",Average:"AVG",Maximum:"MAX",Minimum:"MIN"};n.Query="query";const nt={Get:"GET",Post:"POST",Put:"PUT",Delete:"DELETE",Patch:"PATCH"};n.Http="http",n.EventDispatcher="eventDispatcher",n.Translate="translate",n.Dialog="dialog",n.KeybindingRegistry="keybindingRegistry",n.Navigator="navigator";let rt=class{};function it(t){return D(t,{name:n.ConfigRepository})}function ot(t={}){return D(t,{name:n.FilterRepository})}rt=((t,n)=>{for(var r,i=n,o=t.length-1;o>=0;o--)(r=t[o])&&(i=r(i)||i);return i})([X({id:"navigator.navigate"})],rt),n.Notification="notifications",n.RouteRegistry="routeRegistry",n.TaskRepository="state.tasks",n.ConfigRepository="state.configs",n.Device="state.device",n.FilterRepository="state.filters",n.UserDataRepository="state.user-data",n.Application="state.application",n.UserPreferencesRepository="userPreferences",n.DateTimeFormatter="datetimeformatter",n.ConditionRegistry="conditionRegistry",n.ViewFactoryRegistry="viewFactoryRegistry",n.WebComponentRegistry="webComponentRegistry",n.NotificationRepository="state.notifications",n.PollerFactory="pollerFactory";export{r as D,K as G,nt as H,ot as K,B as L,i as M,q as T,tt as W,it as Y,n as c,X as h}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,g as r}from"./p-d736c794.js";import{M as s,j as n,c as o,W as a,H as h,T as c}from"./p-e17afaf3.js";import{A as u,a as f,b as l,E as d,T as v}from"./p-463d3174.js";import{d as b,b as p,k as m,c as g,s as y,a as j,e as w,U as O,S,g as k}from"./p-bcc23575.js";import{i as x,e as I}from"./p-c40a3f4b.js";import{d as M,r as T,S as A,a as C,i as E}from"./p-b31772c8.js";import{d as F,i as P,o as $,g as _,h as N,n as D,a as L}from"./p-5322fd19.js";import{i as R}from"./p-6fd28e32.js";var U=/\s/,z=/^\s+/;var G=NaN,W=/^[-+]0x[0-9a-f]+$/i,H=/^0b[01]+$/i,Q=/^0o[0-7]+$/i,q=parseInt;function B(t){if("number"==typeof t)return t;if(x(t))return G;if(M(t)){var i="function"==typeof t.valueOf?t.valueOf():t;t=M(i)?i+"":i}if("string"!=typeof t)return 0===t?t:+t;var e;t=(e=t)?e.slice(0,function(t){for(var i=t.length;i--&&U.test(t.charAt(i)););return i}(e)+1).replace(z,""):e;var r=H.test(t);return r||Q.test(t)?q(t.slice(2),r?2:8):W.test(t)?G:+t}var K=Object.create;const V=function(){function t(){}return function(i){if(!M(i))return{};if(K)return K(i);t.prototype=i;var e=new t;return t.prototype=void 0,e}}();function J(t,i,e){"__proto__"==i&&b?b(t,i,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[i]=e}var X=Object.prototype.hasOwnProperty;function Y(t,i,e){var r=t[i];X.call(t,i)&&I(r,e)&&(void 0!==e||i in t)||J(t,i,e)}function Z(t,i,e,r){var s=!e;e||(e={});for(var n=-1,o=i.length;++n<o;){var a=i[n],h=r?r(e[a],t[a],a,e,t):void 0;void 0===h&&(h=t[a]),s?J(e,a,h):Y(e,a,h)}return e}var tt=Object.prototype.hasOwnProperty;function it(t){return P(t)?p(t,!0):function(t){if(!M(t))return function(t){var i=[];if(null!=t)for(var e in Object(t))i.push(e);return i}(t);var i=F(t),e=[];for(var r in t)("constructor"!=r||!i&&tt.call(t,r))&&e.push(r);return e}(t)}const et=$(Object.getPrototypeOf,Object);var rt="object"==typeof exports&&exports&&!exports.nodeType&&exports,st=rt&&"object"==typeof module&&module&&!module.nodeType&&module,nt=st&&st.exports===rt?T.Buffer:void 0,ot=nt?nt.allocUnsafe:void 0;const at=Object.getOwnPropertySymbols?function(t){for(var i=[];t;)j(i,g(t)),t=et(t);return i}:y;function ht(t){return w(t,it,at)}var ct=Object.prototype.hasOwnProperty;function ut(t){var i=new t.constructor(t.byteLength);return new O(i).set(new O(t)),i}var ft=/\w*$/,lt=A?A.prototype:void 0,dt=lt?lt.valueOf:void 0,vt="[object Boolean]",bt="[object Date]",pt="[object Map]",mt="[object Number]",gt="[object RegExp]",yt="[object Set]",jt="[object String]",wt="[object Symbol]",Ot="[object ArrayBuffer]",St="[object DataView]",kt="[object Float32Array]",xt="[object Float64Array]",It="[object Int8Array]",Mt="[object Int16Array]",Tt="[object Int32Array]",At="[object Uint8Array]",Ct="[object Uint8ClampedArray]",Et="[object Uint16Array]",Ft="[object Uint32Array]";var Pt=D&&D.isMap;const $t=Pt?N(Pt):function(t){return C(t)&&"[object Map]"==_(t)};var _t=D&&D.isSet;const Nt=_t?N(_t):function(t){return C(t)&&"[object Set]"==_(t)};var Dt=1,Lt=2,Rt=4,Ut="[object Arguments]",zt="[object Function]",Gt="[object GeneratorFunction]",Wt="[object Object]",Ht={};function Qt(t,i,e,r,s,n){var o,a=i&Dt,h=i&Lt,c=i&Rt;if(e&&(o=s?e(t,r,s,n):e(t)),void 0!==o)return o;if(!M(t))return t;var u=E(t);if(u){if(o=function(t){var i=t.length,e=new t.constructor(i);return i&&"string"==typeof t[0]&&ct.call(t,"index")&&(e.index=t.index,e.input=t.input),e}(t),!a)return function(t,i){var e=-1,r=t.length;for(i||(i=Array(r));++e<r;)i[e]=t[e];return i}(t,o)}else{var f=_(t),l=f==zt||f==Gt;if(L(t))return function(t,i){if(i)return t.slice();var e=t.length,r=ot?ot(e):new t.constructor(e);return t.copy(r),r}(t,a);if(f==Wt||f==Ut||l&&!s){if(o=h||l?{}:function(t){return"function"!=typeof t.constructor||F(t)?{}:V(et(t))}(t),!a)return h?function(t,i){return Z(t,at(t),i)}(t,function(t,i){return t&&Z(i,it(i),t)}(o,t)):function(t,i){return Z(t,g(t),i)}(t,function(t,i){return t&&Z(i,m(i),t)}(o,t))}else{if(!Ht[f])return s?t:{};o=function(t,i,e){var r,s,n=t.constructor;switch(i){case Ot:return ut(t);case vt:case bt:return new n(+t);case St:return function(t,i){var e=i?ut(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}(t,e);case kt:case xt:case It:case Mt:case Tt:case At:case Ct:case Et:case Ft:return function(t,i){var e=i?ut(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}(t,e);case pt:return new n;case mt:case jt:return new n(t);case gt:return(s=new(r=t).constructor(r.source,ft.exec(r))).lastIndex=r.lastIndex,s;case yt:return new n;case wt:return dt?Object(dt.call(t)):{}}}(t,f,a)}}n||(n=new S);var d=n.get(t);if(d)return d;n.set(t,o),Nt(t)?t.forEach((function(r){o.add(Qt(r,i,e,r,t,n))})):$t(t)&&t.forEach((function(r,s){o.set(s,Qt(r,i,e,s,t,n))}));var v=u?void 0:(c?h?ht:k:h?it:m)(t);return function(t,i){for(var e=-1,r=null==t?0:t.length;++e<r&&!1!==i(t[e],e););}(v||t,(function(r,s){v&&(r=t[s=r]),Y(o,s,Qt(r,i,e,s,t,n))})),o}Ht[Ut]=Ht["[object Array]"]=Ht["[object ArrayBuffer]"]=Ht["[object DataView]"]=Ht["[object Boolean]"]=Ht["[object Date]"]=Ht["[object Float32Array]"]=Ht["[object Float64Array]"]=Ht["[object Int8Array]"]=Ht["[object Int16Array]"]=Ht["[object Int32Array]"]=Ht["[object Map]"]=Ht["[object Number]"]=Ht[Wt]=Ht["[object RegExp]"]=Ht["[object Set]"]=Ht["[object String]"]=Ht["[object Symbol]"]=Ht["[object Uint8Array]"]=Ht["[object Uint8ClampedArray]"]=Ht["[object Uint16Array]"]=Ht["[object Uint32Array]"]=!0,Ht["[object Error]"]=Ht[zt]=Ht["[object WeakMap]"]=!1;const qt=function(){return T.Date.now()};var Bt=Math.max,Kt=Math.min;function Vt(t,i){return t.label===i}function Jt(t,i){return Object.values(t.properties).find((t=>t&&t.relation&&Vt(t.relation.getLimetype(),i)))}function Xt(t,i){const e=Jt(t,i);return!!e&&function(t){return s(t)&&!n(t)}(e)}class Yt{get limeObjectService(){return this.platform.get(o.LimeObjectRepository)}get queryService(){return this.platform.get(o.Query)}get viewFactoryRegistry(){return this.platform.get(o.ViewFactoryRegistry)}get translator(){var t;return null===(t=this.platform)||void 0===t?void 0:t.get(o.Translate)}get triggerCharacter(){return this._triggerCharacter}get triggerHandler(){return this._triggerHandler}constructor(t,i,e){this.platform=t,this.context=i,this.searchableLimetypes=e,this.groupCounts={},this._triggerCharacter="@",this._triggerHandler={searcher:t=>this.searcher(t),inserter:(t,i)=>this.inserter(t,i),emptySearchMessage:"Start typing a name...",noItemsFoundMessage:"No results for your search...",nodeDefinition:{customElement:{tagName:"limebb-mention",attributes:["limetype","objectid","href"]},mapAttributes:t=>({limetype:t.value.getLimetype().name,objectid:t.value.id,href:`object/${this.context.limetype}/${this.context.id}`})}},this.searcher=async t=>{if(!t)return[];const{objects:i}=await this.limeObjectService.search(t,this.searchableLimetypes,10);return this.createSearchListItems(i)},this.inserter=async(t,i)=>{var e;const r=this.triggerHandler.nodeDefinition;r&&t.insert({node:{tagName:r.customElement.tagName,attributes:r.mapAttributes(i)},children:[null===(e=i.value)||void 0===e?void 0:e.descriptive]})}}async initialize(){await this.loadGroupCounts()}async loadGroupCounts(){const t=this.searchableLimetypes.filter((t=>!Vt(t,"user")&&Xt(t,"user"))).map((t=>this.getGroupCounts(t)));(await Promise.all(t)).forEach((t=>{Object.assign(this.groupCounts,t)}))}async getGroupCounts(t){var i;const e=Jt(t,"user"),r=t.name;try{const t=await this.queryService.execute({limetype:r,responseFormat:{object:{_id:null,[e.name]:{count:{aggregate:{op:a.Count}}}}}});if(!(null===(i=t.objects)||void 0===i?void 0:i.length))return{[r]:{}};const s=this.createGroupCount(t.objects,e.name);return{[r]:s}}catch(i){return console.error(`Error fetching group count for limetype: ${t.name}`,i),{[r]:{}}}}createGroupCount(t,i){const e={};return t.forEach((t=>{const{_id:r,[i]:s}=t;e[r]=s.count})),e}createSearchListItems(t=[]){return t.map((t=>this.createSearchListItem(t))).filter(R)}createSearchListItem(t){const i=this.viewFactoryRegistry.getFactory("search"),e=this.limeObjectService.getObject(t._limetype,t._id);if(!e)return null;const r=i(e,this.context),s=this.getGroupCountComponent(e);return Object.assign(Object.assign({},r),s?{primaryComponent:s}:{})}getGroupCountComponent(t){var i;const e=t.getLimetype(),r=null===(i=this.groupCounts[e.name])||void 0===i?void 0:i[t.id],s=Jt(e,"user");if(void 0!==r&&s)return{name:"limebb-mention-group-counter",props:{count:r,limetype:s.relation.getLimetype(),helperLabel:this.translator.get("webclient.notification-center.members-will-be-notified")}}}}class Zt{constructor(t,i){this.file=t,this.http=i,this.uploadCancelled=!1,this.getUrl=t=>`api/v1/file/${t||""}`}async initialize(){this.uploadService=await this.http.createFileUpload(h.Post,this.getUrl(),this.file),this.progressCallback&&(this.uploadService.onProgress=this.progressCallback)}async upload(){return this.uploadService.upload()}getFileName(){return this.file.name}cancel(){this.uploadService.cancel(),this.uploadCancelled=!0}set onProgress(t){this.progressCallback=t,this.uploadService&&(this.uploadService.onProgress=t)}}class ti{constructor(t){this.platform=t}async handleImagePasted(t){const i=null==t?void 0:t.fileInfo;if(!i)return;if(!this.validateImageSize(i))return;t.insertThumbnail();const e=await this.createFileUpload(i),r=null==e?void 0:e.href;return r&&void 0!==(null==e?void 0:e.fileId)?t.insertImage(r):t.insertFailedThumbnail(),e}parseFileIdFromSrc(t){if(t){const i=/\/(\d+)\/contents\/?$/.exec(t);if(i&&i[1])return Number(i[1])}}validateImageSize(t){return!!t.fileContent&&t.fileContent.size<=52428800}async createFileUpload(t){var i;if(!t.fileContent)return;const e=new Zt(t.fileContent,this.http);await e.initialize();const r=Object.assign(Object.assign({},t),{progress:0,file:e,state:"added",fileId:void 0,href:void 0,id:t.id});e.onProgress=t=>{0===r.progress&&(r.state="uploading"),r.progress=t,100===t&&(r.state="finalizing")};const s=await e.upload();return r.fileId=s.id,r.filename=s.filename,r.extension=s.extension,r.contentType=s.contentType,r.size=s.size,r.state="done",r.href=null===(i=s._links)||void 0===i?void 0:i.contents.href,r}get http(){return this.platform.get(o.Http)}}const ii=class{watchOpen(){this.setupHandlers(),this.setPickerMessage()}watchQuery(){this.setPickerMessage()}constructor(e){var r;t(this,e),this.change=i(this,"change",7),this.metadataChange=i(this,"metadataChange",7),this.allowMentioning=!1,this.contentType="markdown",this.language="en",this.disabled=!1,this.readonly=!1,this.invalid=!1,this.required=!1,this.ui="standard",this.allowResize=!0,this.value="",this.triggerMap={},this.customElements=[],this.allowInlineImages=!1,this.items=[],this.highlightedItemIndex=0,this.isPickerOpen=!1,this.isSearching=!1,this.registeredTriggers=[],this.registeredTriggerMap=this.triggerMap,this.registeredCustomElements=this.customElements,this.activeTrigger=void 0,this.handleMouseClick=t=>{this.textEditorPickerElement&&(t.target===this.textEditorPickerElement||this.resetTriggerAndPicker())},this.handleKeyPress=t=>{if(!this.isPickerOpen||!this.activeTrigger)return;if(![f,l,u,d,v].includes(t.key))return;if(t.stopPropagation(),t.preventDefault(),"keyup"===t.type)return;const i={[f]:this.handleEscapeKey,[d]:this.handleEnterOrTabKey,[v]:this.handleEnterOrTabKey,[u]:this.handleArrowKeyPress,[l]:this.handleArrowKeyPress}[t.key];i&&i(t)},this.handleArrowKeyPress=t=>{this.highlightedItemIndex=this.findNonSeparatorIndex(t.key,this.highlightedItemIndex)},this.findNonSeparatorIndex=(t,i,e=0)=>{if(!this.items.length||e>this.items.length)return i;const r=((t,i,e)=>(i+(t===u?1:-1)+e)%e)(t,i,this.items.length);return this.isListSeparator(this.items[r])?this.findNonSeparatorIndex(t,r,e+1):r},this.handleEscapeKey=()=>{var t;null===(t=this.triggerFunction)||void 0===t||t.stopTrigger(),this.resetTriggerAndPicker()},this.handleEnterOrTabKey=t=>{this.handleItemSelection(t)},this.handleMetadataChange=t=>{t.stopPropagation();const i=t.detail,e=this.getEnhancedImages(i.images||[]),r=Object.assign(Object.assign({},i),{images:e});this.metadataChange.emit(r)},this.handleImagePasted=t=>{t.stopPropagation(),this.allowInlineImages&&this.uploadHandler.handleImagePasted(t.detail)},this.handleTriggerStart=t=>{t.stopPropagation(),this.activeTrigger=t.detail.trigger,this.triggerFunction=t.detail.textEditor,this.isPickerOpen=!0},this.handleTriggerStop=t=>{t.stopPropagation(),this.resetTriggerAndPicker()},this.handleTriggerChange=t=>{var i;t.stopImmediatePropagation(),this.editorPickerQuery=t.detail.value;const e=null===(i=this.registeredTriggerMap[t.detail.trigger])||void 0===i?void 0:i.searcher;e&&(this.isSearching=!0,this.debouncedSearchFn(e,this.editorPickerQuery))},this.resetTriggerAndPicker=()=>{this.isPickerOpen=!1,this.activeTrigger=void 0,this.triggerFunction=void 0,this.isSearching=!1,this.highlightedItemIndex=0,this.items=[]},this.handleItemSelection=t=>{var i;let e;if(t instanceof CustomEvent)e=t.detail;else{if(!(t instanceof KeyboardEvent))return;{const t=this.items[this.highlightedItemIndex];if(this.isListSeparator(t))return;e=t}}if(!this.activeTrigger)return;const r=this.registeredTriggerMap[this.activeTrigger];try{r.inserter(this.triggerFunction,e)}catch(t){console.error("Error inserting",t)}this.resetTriggerAndPicker(),null===(i=this.textEditor)||void 0===i||i.focus()},this.handleVisibilityChange=()=>{"hidden"===document.visibilityState&&this.saveDraft()},this.handleBeforeUnload=()=>{this.saveDraft()},this.portalId="crypto"in window&&"function"==typeof(null===(r=window.crypto)||void 0===r?void 0:r.randomUUID)?"a_"+crypto.randomUUID():String.fromCharCode(97+Math.floor(26*Math.random()))+Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2),this.debouncedSearchFn=function(t,i,e){var r,s,n,o,a,h,c=0,u=!1,f=!1,l=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(i){var e=r,n=s;return r=s=void 0,c=i,o=t.apply(n,e)}function v(t){var e=t-h;return void 0===h||e>=i||e<0||f&&t-c>=n}function b(){var t=qt();if(v(t))return p(t);a=setTimeout(b,function(t){var e=i-(t-h);return f?Kt(e,n-(t-c)):e}(t))}function p(t){return a=void 0,l&&r?d(t):(r=s=void 0,o)}function m(){var t=qt(),e=v(t);if(r=arguments,s=this,h=t,e){if(void 0===a)return function(t){return c=t,a=setTimeout(b,i),u?d(t):o}(h);if(f)return clearTimeout(a),a=setTimeout(b,i),d(h)}return void 0===a&&(a=setTimeout(b,i)),o}return i=B(i)||0,M(e)&&(u=!!e.leading,n=(f="maxWait"in e)?Bt(B(e.maxWait)||0,i):n,l="trailing"in e?!!e.trailing:l),m.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=h=s=a=void 0},m.flush=function(){return void 0===a?o:p(qt())},m}((async(t,i)=>{try{const e=await t(i);if(i!==this.editorPickerQuery||!this.activeTrigger)return;this.items=e}catch(t){console.error("Error searching",t)}finally{this.isSearching=!1}}),300)}connectedCallback(){var t,i,e,r;if(this.draftIdentifier){const s=null!==(i=null===(t=this.context)||void 0===t?void 0:t.id)&&void 0!==i?i:"no-limeobject",n=null!==(r=null===(e=this.context)||void 0===e?void 0:e.limetype)&&void 0!==r?r:"no-limetype";this.textEditorInnerId=["text-editor-draft",n,s,this.draftIdentifier].join("-")}this.textEditorInnerId&&(document.addEventListener("visibilitychange",this.handleVisibilityChange),window.addEventListener("beforeunload",this.handleBeforeUnload)),this.uploadHandler=new ti(this.platform)}componentWillLoad(){this.allowMentioning&&this.registerMentions(),this.registerTriggers(),this.loadDraft()}disconnectedCallback(){document.removeEventListener("visibilitychange",this.handleVisibilityChange),window.removeEventListener("beforeunload",this.handleBeforeUnload),document.removeEventListener("mousedown",this.handleMouseClick),this.saveDraft(),this.host&&(this.host.removeEventListener("keyup",this.handleKeyPress,{capture:!0}),this.host.removeEventListener("keydown",this.handleKeyPress,{capture:!0})),this.debouncedSearchFn&&this.debouncedSearchFn.cancel&&this.debouncedSearchFn.cancel()}registerMentions(){const t=new Yt(this.platform,this.context,this.searchableLimetypes),i=t.triggerHandler.nodeDefinition;i&&(this.registeredCustomElements.push(i.customElement),this.registeredTriggerMap[t.triggerCharacter]=t.triggerHandler,t.initialize())}registerTriggers(){this.registeredTriggers=Object.keys(this.registeredTriggerMap)}setPickerMessage(){var t;if(!this.activeTrigger)return;const i=this.registeredTriggerMap[this.activeTrigger];this.pickerMessage=(null===(t=this.editorPickerQuery)||void 0===t?void 0:t.length)>0?i.noItemsFoundMessage:i.emptySearchMessage}setupHandlers(){this.isPickerOpen?(this.host.addEventListener("keyup",this.handleKeyPress,{capture:!0}),this.host.addEventListener("keydown",this.handleKeyPress,{capture:!0}),document.addEventListener("mousedown",this.handleMouseClick)):(this.host.removeEventListener("keyup",this.handleKeyPress,{capture:!0}),this.host.removeEventListener("keydown",this.handleKeyPress,{capture:!0}),document.removeEventListener("mousedown",this.handleMouseClick))}isListSeparator(t){return"separator"in t&&!0===t.separator}render(){return[e("limel-text-editor",{key:"65f1a843efb81de7f5006f49bf4bd912047e73f4",ref:t=>this.textEditor=t,tabindex:this.disabled?-1:0,value:this.value,contentType:this.contentType,customElements:this.registeredCustomElements,"aria-disabled":this.disabled,language:this.language,triggers:this.registeredTriggers,onTriggerStart:this.handleTriggerStart,onTriggerStop:this.handleTriggerStop,onTriggerChange:this.handleTriggerChange,onImagePasted:this.handleImagePasted,onMetadataChange:this.handleMetadataChange,ui:this.ui,allowResize:this.allowResize,required:this.required,disabled:this.disabled,readonly:this.readonly,helperText:this.helperText,placeholder:this.placeholder,label:this.label,invalid:this.invalid}),this.renderPicker()]}renderPicker(){if(this.isPickerOpen)return e("limel-portal",{containerId:this.portalId,visible:this.isPickerOpen,openDirection:"top",inheritParentWidth:!0,anchor:this.textEditor},e("limebb-text-editor-picker",{ref:t=>this.textEditorPickerElement=t,items:(t=this.items,i=this.highlightedItemIndex,t.map(((t,e)=>{const r=Qt(t,5);return Object.assign(Object.assign({},r),{selected:e===i})}))),onItemSelected:this.handleItemSelection,emptyMessage:this.pickerMessage,isSearching:this.isSearching}));var t,i}getEnhancedImages(t){return t.map((t=>{let i;return"success"===t.state&&(i=this.uploadHandler.parseFileIdFromSrc(t.src)),i?Object.assign(Object.assign({},t),{fileId:i}):t}))}loadDraft(){if(!this.userDataService||!this.textEditorInnerId)return;if(this.value)return;const t=this.userDataService.get(this.textEditorInnerId);t&&this.change.emit(t)}saveDraft(){var t,i,e,r;if(!this.textEditorInnerId)return;const s=null===(t=this.value)||void 0===t?void 0:t.trim(),n=null===(i=this.userDataService)||void 0===i?void 0:i.get(this.textEditorInnerId);s&&s!==n?null===(e=this.userDataService)||void 0===e||e.set(this.textEditorInnerId,s):!s&&n&&(null===(r=this.userDataService)||void 0===r||r.set(this.textEditorInnerId,void 0))}get userDataService(){return this.platform.get(o.UserDataRepository)}get host(){return r(this)}static get watchers(){return{isPickerOpen:["watchOpen"],editorPickerQuery:["watchQuery"]}}};!function(t,i,e,r){var s,n=arguments.length,o=n<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,e):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,i,e,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(i,e,o):s(i,e))||o);n>3&&o&&Object.defineProperty(i,e,o)}([c({map:[function(t){return Object.values(t).filter((t=>Vt(t,"user")||Xt(t,"user")))}]})],ii.prototype,"searchableLimetypes",void 0);export{ii as limebb_text_editor}
|
|
1
|
+
import{r as t,c as i,h as e,g as r}from"./p-d736c794.js";import{D as s,M as n,c as o,W as a,H as h,T as c}from"./p-3b9766cc.js";import{A as u,a as f,b as l,E as d,T as v}from"./p-463d3174.js";import{d as b,b as p,k as m,c as g,s as y,a as j,e as w,U as O,S,g as k}from"./p-bcc23575.js";import{i as x,e as I}from"./p-c40a3f4b.js";import{d as M,r as T,S as A,a as C,i as E}from"./p-b31772c8.js";import{d as F,i as P,o as $,g as _,h as D,n as N,a as L}from"./p-5322fd19.js";import{i as R}from"./p-6fd28e32.js";var U=/\s/,z=/^\s+/;var G=NaN,W=/^[-+]0x[0-9a-f]+$/i,H=/^0b[01]+$/i,Q=/^0o[0-7]+$/i,q=parseInt;function B(t){if("number"==typeof t)return t;if(x(t))return G;if(M(t)){var i="function"==typeof t.valueOf?t.valueOf():t;t=M(i)?i+"":i}if("string"!=typeof t)return 0===t?t:+t;var e;t=(e=t)?e.slice(0,function(t){for(var i=t.length;i--&&U.test(t.charAt(i)););return i}(e)+1).replace(z,""):e;var r=H.test(t);return r||Q.test(t)?q(t.slice(2),r?2:8):W.test(t)?G:+t}var K=Object.create;const V=function(){function t(){}return function(i){if(!M(i))return{};if(K)return K(i);t.prototype=i;var e=new t;return t.prototype=void 0,e}}();function J(t,i,e){"__proto__"==i&&b?b(t,i,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[i]=e}var X=Object.prototype.hasOwnProperty;function Y(t,i,e){var r=t[i];X.call(t,i)&&I(r,e)&&(void 0!==e||i in t)||J(t,i,e)}function Z(t,i,e,r){var s=!e;e||(e={});for(var n=-1,o=i.length;++n<o;){var a=i[n],h=r?r(e[a],t[a],a,e,t):void 0;void 0===h&&(h=t[a]),s?J(e,a,h):Y(e,a,h)}return e}var tt=Object.prototype.hasOwnProperty;function it(t){return P(t)?p(t,!0):function(t){if(!M(t))return function(t){var i=[];if(null!=t)for(var e in Object(t))i.push(e);return i}(t);var i=F(t),e=[];for(var r in t)("constructor"!=r||!i&&tt.call(t,r))&&e.push(r);return e}(t)}const et=$(Object.getPrototypeOf,Object);var rt="object"==typeof exports&&exports&&!exports.nodeType&&exports,st=rt&&"object"==typeof module&&module&&!module.nodeType&&module,nt=st&&st.exports===rt?T.Buffer:void 0,ot=nt?nt.allocUnsafe:void 0;const at=Object.getOwnPropertySymbols?function(t){for(var i=[];t;)j(i,g(t)),t=et(t);return i}:y;function ht(t){return w(t,it,at)}var ct=Object.prototype.hasOwnProperty;function ut(t){var i=new t.constructor(t.byteLength);return new O(i).set(new O(t)),i}var ft=/\w*$/,lt=A?A.prototype:void 0,dt=lt?lt.valueOf:void 0,vt="[object Boolean]",bt="[object Date]",pt="[object Map]",mt="[object Number]",gt="[object RegExp]",yt="[object Set]",jt="[object String]",wt="[object Symbol]",Ot="[object ArrayBuffer]",St="[object DataView]",kt="[object Float32Array]",xt="[object Float64Array]",It="[object Int8Array]",Mt="[object Int16Array]",Tt="[object Int32Array]",At="[object Uint8Array]",Ct="[object Uint8ClampedArray]",Et="[object Uint16Array]",Ft="[object Uint32Array]";var Pt=N&&N.isMap;const $t=Pt?D(Pt):function(t){return C(t)&&"[object Map]"==_(t)};var _t=N&&N.isSet;const Dt=_t?D(_t):function(t){return C(t)&&"[object Set]"==_(t)};var Nt=1,Lt=2,Rt=4,Ut="[object Arguments]",zt="[object Function]",Gt="[object GeneratorFunction]",Wt="[object Object]",Ht={};function Qt(t,i,e,r,s,n){var o,a=i&Nt,h=i&Lt,c=i&Rt;if(e&&(o=s?e(t,r,s,n):e(t)),void 0!==o)return o;if(!M(t))return t;var u=E(t);if(u){if(o=function(t){var i=t.length,e=new t.constructor(i);return i&&"string"==typeof t[0]&&ct.call(t,"index")&&(e.index=t.index,e.input=t.input),e}(t),!a)return function(t,i){var e=-1,r=t.length;for(i||(i=Array(r));++e<r;)i[e]=t[e];return i}(t,o)}else{var f=_(t),l=f==zt||f==Gt;if(L(t))return function(t,i){if(i)return t.slice();var e=t.length,r=ot?ot(e):new t.constructor(e);return t.copy(r),r}(t,a);if(f==Wt||f==Ut||l&&!s){if(o=h||l?{}:function(t){return"function"!=typeof t.constructor||F(t)?{}:V(et(t))}(t),!a)return h?function(t,i){return Z(t,at(t),i)}(t,function(t,i){return t&&Z(i,it(i),t)}(o,t)):function(t,i){return Z(t,g(t),i)}(t,function(t,i){return t&&Z(i,m(i),t)}(o,t))}else{if(!Ht[f])return s?t:{};o=function(t,i,e){var r,s,n=t.constructor;switch(i){case Ot:return ut(t);case vt:case bt:return new n(+t);case St:return function(t,i){var e=i?ut(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}(t,e);case kt:case xt:case It:case Mt:case Tt:case At:case Ct:case Et:case Ft:return function(t,i){var e=i?ut(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}(t,e);case pt:return new n;case mt:case jt:return new n(t);case gt:return(s=new(r=t).constructor(r.source,ft.exec(r))).lastIndex=r.lastIndex,s;case yt:return new n;case wt:return dt?Object(dt.call(t)):{}}}(t,f,a)}}n||(n=new S);var d=n.get(t);if(d)return d;n.set(t,o),Dt(t)?t.forEach((function(r){o.add(Qt(r,i,e,r,t,n))})):$t(t)&&t.forEach((function(r,s){o.set(s,Qt(r,i,e,s,t,n))}));var v=u?void 0:(c?h?ht:k:h?it:m)(t);return function(t,i){for(var e=-1,r=null==t?0:t.length;++e<r&&!1!==i(t[e],e););}(v||t,(function(r,s){v&&(r=t[s=r]),Y(o,s,Qt(r,i,e,s,t,n))})),o}Ht[Ut]=Ht["[object Array]"]=Ht["[object ArrayBuffer]"]=Ht["[object DataView]"]=Ht["[object Boolean]"]=Ht["[object Date]"]=Ht["[object Float32Array]"]=Ht["[object Float64Array]"]=Ht["[object Int8Array]"]=Ht["[object Int16Array]"]=Ht["[object Int32Array]"]=Ht["[object Map]"]=Ht["[object Number]"]=Ht[Wt]=Ht["[object RegExp]"]=Ht["[object Set]"]=Ht["[object String]"]=Ht["[object Symbol]"]=Ht["[object Uint8Array]"]=Ht["[object Uint8ClampedArray]"]=Ht["[object Uint16Array]"]=Ht["[object Uint32Array]"]=!0,Ht["[object Error]"]=Ht[zt]=Ht["[object WeakMap]"]=!1;const qt=function(){return T.Date.now()};var Bt=Math.max,Kt=Math.min;function Vt(t,i){return t.label===i}function Jt(t,i){return Object.values(t.properties).find((t=>t&&t.relation&&Vt(t.relation.getLimetype(),i)))}function Xt(t,i){const e=Jt(t,i);return!!e&&function(t){return s(t)&&!n(t)}(e)}class Yt{get limeObjectService(){return this.platform.get(o.LimeObjectRepository)}get queryService(){return this.platform.get(o.Query)}get viewFactoryRegistry(){return this.platform.get(o.ViewFactoryRegistry)}get translator(){var t;return null===(t=this.platform)||void 0===t?void 0:t.get(o.Translate)}get triggerCharacter(){return this._triggerCharacter}get triggerHandler(){return this._triggerHandler}constructor(t,i,e){this.platform=t,this.context=i,this.searchableLimetypes=e,this.groupCounts={},this._triggerCharacter="@",this._triggerHandler={searcher:t=>this.searcher(t),inserter:(t,i)=>this.inserter(t,i),emptySearchMessage:"Start typing a name...",noItemsFoundMessage:"No results for your search...",nodeDefinition:{customElement:{tagName:"limebb-mention",attributes:["limetype","objectid","href"]},mapAttributes:t=>({limetype:t.value.getLimetype().name,objectid:t.value.id,href:`object/${this.context.limetype}/${this.context.id}`})}},this.searcher=async t=>{if(!t)return[];const{objects:i}=await this.limeObjectService.search(t,this.searchableLimetypes,10);return this.createSearchListItems(i)},this.inserter=async(t,i)=>{var e;const r=this.triggerHandler.nodeDefinition;r&&t.insert({node:{tagName:r.customElement.tagName,attributes:r.mapAttributes(i)},children:[null===(e=i.value)||void 0===e?void 0:e.descriptive]})}}async initialize(){await this.loadGroupCounts()}async loadGroupCounts(){const t=this.searchableLimetypes.filter((t=>!Vt(t,"user")&&Xt(t,"user"))).map((t=>this.getGroupCounts(t)));(await Promise.all(t)).forEach((t=>{Object.assign(this.groupCounts,t)}))}async getGroupCounts(t){var i;const e=Jt(t,"user"),r=t.name;try{const t=await this.queryService.execute({limetype:r,responseFormat:{object:{_id:null,[e.name]:{count:{aggregate:{op:a.Count}}}}}});if(!(null===(i=t.objects)||void 0===i?void 0:i.length))return{[r]:{}};const s=this.createGroupCount(t.objects,e.name);return{[r]:s}}catch(i){return console.error(`Error fetching group count for limetype: ${t.name}`,i),{[r]:{}}}}createGroupCount(t,i){const e={};return t.forEach((t=>{const{_id:r,[i]:s}=t;e[r]=s.count})),e}createSearchListItems(t=[]){return t.map((t=>this.createSearchListItem(t))).filter(R)}createSearchListItem(t){const i=this.viewFactoryRegistry.getFactory("search"),e=this.limeObjectService.getObject(t._limetype,t._id);if(!e)return null;const r=i(e,this.context),s=this.getGroupCountComponent(e);return Object.assign(Object.assign({},r),s?{primaryComponent:s}:{})}getGroupCountComponent(t){var i;const e=t.getLimetype(),r=null===(i=this.groupCounts[e.name])||void 0===i?void 0:i[t.id],s=Jt(e,"user");if(void 0!==r&&s)return{name:"limebb-mention-group-counter",props:{count:r,limetype:s.relation.getLimetype(),helperLabel:this.translator.get("webclient.notification-center.members-will-be-notified")}}}}class Zt{constructor(t,i){this.file=t,this.http=i,this.uploadCancelled=!1,this.getUrl=t=>`api/v1/file/${t||""}`}async initialize(){this.uploadService=await this.http.createFileUpload(h.Post,this.getUrl(),this.file),this.progressCallback&&(this.uploadService.onProgress=this.progressCallback)}async upload(){return this.uploadService.upload()}getFileName(){return this.file.name}cancel(){this.uploadService.cancel(),this.uploadCancelled=!0}set onProgress(t){this.progressCallback=t,this.uploadService&&(this.uploadService.onProgress=t)}}class ti{constructor(t){this.platform=t}async handleImagePasted(t){const i=null==t?void 0:t.fileInfo;if(!i)return;if(!this.validateImageSize(i))return;t.insertThumbnail();const e=await this.createFileUpload(i),r=null==e?void 0:e.href;return r&&void 0!==(null==e?void 0:e.fileId)?t.insertImage(r):t.insertFailedThumbnail(),e}parseFileIdFromSrc(t){if(t){const i=/\/(\d+)\/contents\/?$/.exec(t);if(i&&i[1])return Number(i[1])}}validateImageSize(t){return!!t.fileContent&&t.fileContent.size<=52428800}async createFileUpload(t){var i;if(!t.fileContent)return;const e=new Zt(t.fileContent,this.http);await e.initialize();const r=Object.assign(Object.assign({},t),{progress:0,file:e,state:"added",fileId:void 0,href:void 0,id:t.id});e.onProgress=t=>{0===r.progress&&(r.state="uploading"),r.progress=t,100===t&&(r.state="finalizing")};const s=await e.upload();return r.fileId=s.id,r.filename=s.filename,r.extension=s.extension,r.contentType=s.contentType,r.size=s.size,r.state="done",r.href=null===(i=s._links)||void 0===i?void 0:i.contents.href,r}get http(){return this.platform.get(o.Http)}}const ii=class{watchOpen(){this.setupHandlers(),this.setPickerMessage()}watchQuery(){this.setPickerMessage()}constructor(e){var r;t(this,e),this.change=i(this,"change",7),this.metadataChange=i(this,"metadataChange",7),this.allowMentioning=!1,this.contentType="markdown",this.language="en",this.disabled=!1,this.readonly=!1,this.invalid=!1,this.required=!1,this.ui="standard",this.allowResize=!0,this.value="",this.triggerMap={},this.customElements=[],this.allowInlineImages=!1,this.items=[],this.highlightedItemIndex=0,this.isPickerOpen=!1,this.isSearching=!1,this.registeredTriggers=[],this.registeredTriggerMap=this.triggerMap,this.registeredCustomElements=this.customElements,this.activeTrigger=void 0,this.handleMouseClick=t=>{this.textEditorPickerElement&&(t.target===this.textEditorPickerElement||this.resetTriggerAndPicker())},this.handleKeyPress=t=>{if(!this.isPickerOpen||!this.activeTrigger)return;if(![f,l,u,d,v].includes(t.key))return;if(t.stopPropagation(),t.preventDefault(),"keyup"===t.type)return;const i={[f]:this.handleEscapeKey,[d]:this.handleEnterOrTabKey,[v]:this.handleEnterOrTabKey,[u]:this.handleArrowKeyPress,[l]:this.handleArrowKeyPress}[t.key];i&&i(t)},this.handleArrowKeyPress=t=>{this.highlightedItemIndex=this.findNonSeparatorIndex(t.key,this.highlightedItemIndex)},this.findNonSeparatorIndex=(t,i,e=0)=>{if(!this.items.length||e>this.items.length)return i;const r=((t,i,e)=>(i+(t===u?1:-1)+e)%e)(t,i,this.items.length);return this.isListSeparator(this.items[r])?this.findNonSeparatorIndex(t,r,e+1):r},this.handleEscapeKey=()=>{var t;null===(t=this.triggerFunction)||void 0===t||t.stopTrigger(),this.resetTriggerAndPicker()},this.handleEnterOrTabKey=t=>{this.handleItemSelection(t)},this.handleMetadataChange=t=>{t.stopPropagation();const i=t.detail,e=this.getEnhancedImages(i.images||[]),r=Object.assign(Object.assign({},i),{images:e});this.metadataChange.emit(r)},this.handleImagePasted=t=>{t.stopPropagation(),this.allowInlineImages&&this.uploadHandler.handleImagePasted(t.detail)},this.handleTriggerStart=t=>{t.stopPropagation(),this.activeTrigger=t.detail.trigger,this.triggerFunction=t.detail.textEditor,this.isPickerOpen=!0},this.handleTriggerStop=t=>{t.stopPropagation(),this.resetTriggerAndPicker()},this.handleTriggerChange=t=>{var i;t.stopImmediatePropagation(),this.editorPickerQuery=t.detail.value;const e=null===(i=this.registeredTriggerMap[t.detail.trigger])||void 0===i?void 0:i.searcher;e&&(this.isSearching=!0,this.debouncedSearchFn(e,this.editorPickerQuery))},this.resetTriggerAndPicker=()=>{this.isPickerOpen=!1,this.activeTrigger=void 0,this.triggerFunction=void 0,this.isSearching=!1,this.highlightedItemIndex=0,this.items=[]},this.handleItemSelection=t=>{var i;let e;if(t instanceof CustomEvent)e=t.detail;else{if(!(t instanceof KeyboardEvent))return;{const t=this.items[this.highlightedItemIndex];if(this.isListSeparator(t))return;e=t}}if(!this.activeTrigger)return;const r=this.registeredTriggerMap[this.activeTrigger];try{r.inserter(this.triggerFunction,e)}catch(t){console.error("Error inserting",t)}this.resetTriggerAndPicker(),null===(i=this.textEditor)||void 0===i||i.focus()},this.handleVisibilityChange=()=>{"hidden"===document.visibilityState&&this.saveDraft()},this.handleBeforeUnload=()=>{this.saveDraft()},this.portalId="crypto"in window&&"function"==typeof(null===(r=window.crypto)||void 0===r?void 0:r.randomUUID)?"a_"+crypto.randomUUID():String.fromCharCode(97+Math.floor(26*Math.random()))+Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2),this.debouncedSearchFn=function(t,i,e){var r,s,n,o,a,h,c=0,u=!1,f=!1,l=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(i){var e=r,n=s;return r=s=void 0,c=i,o=t.apply(n,e)}function v(t){var e=t-h;return void 0===h||e>=i||e<0||f&&t-c>=n}function b(){var t=qt();if(v(t))return p(t);a=setTimeout(b,function(t){var e=i-(t-h);return f?Kt(e,n-(t-c)):e}(t))}function p(t){return a=void 0,l&&r?d(t):(r=s=void 0,o)}function m(){var t=qt(),e=v(t);if(r=arguments,s=this,h=t,e){if(void 0===a)return function(t){return c=t,a=setTimeout(b,i),u?d(t):o}(h);if(f)return clearTimeout(a),a=setTimeout(b,i),d(h)}return void 0===a&&(a=setTimeout(b,i)),o}return i=B(i)||0,M(e)&&(u=!!e.leading,n=(f="maxWait"in e)?Bt(B(e.maxWait)||0,i):n,l="trailing"in e?!!e.trailing:l),m.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=h=s=a=void 0},m.flush=function(){return void 0===a?o:p(qt())},m}((async(t,i)=>{try{const e=await t(i);if(i!==this.editorPickerQuery||!this.activeTrigger)return;this.items=e}catch(t){console.error("Error searching",t)}finally{this.isSearching=!1}}),300)}connectedCallback(){var t,i,e,r;if(this.draftIdentifier){const s=null!==(i=null===(t=this.context)||void 0===t?void 0:t.id)&&void 0!==i?i:"no-limeobject",n=null!==(r=null===(e=this.context)||void 0===e?void 0:e.limetype)&&void 0!==r?r:"no-limetype";this.textEditorInnerId=["text-editor-draft",n,s,this.draftIdentifier].join("-")}this.textEditorInnerId&&(document.addEventListener("visibilitychange",this.handleVisibilityChange),window.addEventListener("beforeunload",this.handleBeforeUnload)),this.uploadHandler=new ti(this.platform)}componentWillLoad(){this.allowMentioning&&this.registerMentions(),this.registerTriggers(),this.loadDraft()}disconnectedCallback(){document.removeEventListener("visibilitychange",this.handleVisibilityChange),window.removeEventListener("beforeunload",this.handleBeforeUnload),document.removeEventListener("mousedown",this.handleMouseClick),this.saveDraft(),this.host&&(this.host.removeEventListener("keyup",this.handleKeyPress,{capture:!0}),this.host.removeEventListener("keydown",this.handleKeyPress,{capture:!0})),this.debouncedSearchFn&&this.debouncedSearchFn.cancel&&this.debouncedSearchFn.cancel()}registerMentions(){const t=new Yt(this.platform,this.context,this.searchableLimetypes),i=t.triggerHandler.nodeDefinition;i&&(this.registeredCustomElements.push(i.customElement),this.registeredTriggerMap[t.triggerCharacter]=t.triggerHandler,t.initialize())}registerTriggers(){this.registeredTriggers=Object.keys(this.registeredTriggerMap)}setPickerMessage(){var t;if(!this.activeTrigger)return;const i=this.registeredTriggerMap[this.activeTrigger];this.pickerMessage=(null===(t=this.editorPickerQuery)||void 0===t?void 0:t.length)>0?i.noItemsFoundMessage:i.emptySearchMessage}setupHandlers(){this.isPickerOpen?(this.host.addEventListener("keyup",this.handleKeyPress,{capture:!0}),this.host.addEventListener("keydown",this.handleKeyPress,{capture:!0}),document.addEventListener("mousedown",this.handleMouseClick)):(this.host.removeEventListener("keyup",this.handleKeyPress,{capture:!0}),this.host.removeEventListener("keydown",this.handleKeyPress,{capture:!0}),document.removeEventListener("mousedown",this.handleMouseClick))}isListSeparator(t){return"separator"in t&&!0===t.separator}render(){return[e("limel-text-editor",{key:"65f1a843efb81de7f5006f49bf4bd912047e73f4",ref:t=>this.textEditor=t,tabindex:this.disabled?-1:0,value:this.value,contentType:this.contentType,customElements:this.registeredCustomElements,"aria-disabled":this.disabled,language:this.language,triggers:this.registeredTriggers,onTriggerStart:this.handleTriggerStart,onTriggerStop:this.handleTriggerStop,onTriggerChange:this.handleTriggerChange,onImagePasted:this.handleImagePasted,onMetadataChange:this.handleMetadataChange,ui:this.ui,allowResize:this.allowResize,required:this.required,disabled:this.disabled,readonly:this.readonly,helperText:this.helperText,placeholder:this.placeholder,label:this.label,invalid:this.invalid}),this.renderPicker()]}renderPicker(){if(this.isPickerOpen)return e("limel-portal",{containerId:this.portalId,visible:this.isPickerOpen,openDirection:"top",inheritParentWidth:!0,anchor:this.textEditor},e("limebb-text-editor-picker",{ref:t=>this.textEditorPickerElement=t,items:(t=this.items,i=this.highlightedItemIndex,t.map(((t,e)=>{const r=Qt(t,5);return Object.assign(Object.assign({},r),{selected:e===i})}))),onItemSelected:this.handleItemSelection,emptyMessage:this.pickerMessage,isSearching:this.isSearching}));var t,i}getEnhancedImages(t){return t.map((t=>{let i;return"success"===t.state&&(i=this.uploadHandler.parseFileIdFromSrc(t.src)),i?Object.assign(Object.assign({},t),{fileId:i}):t}))}loadDraft(){if(!this.userDataService||!this.textEditorInnerId)return;if(this.value)return;const t=this.userDataService.get(this.textEditorInnerId);t&&this.change.emit(t)}saveDraft(){var t,i,e,r;if(!this.textEditorInnerId)return;const s=null===(t=this.value)||void 0===t?void 0:t.trim(),n=null===(i=this.userDataService)||void 0===i?void 0:i.get(this.textEditorInnerId);s&&s!==n?null===(e=this.userDataService)||void 0===e||e.set(this.textEditorInnerId,s):!s&&n&&(null===(r=this.userDataService)||void 0===r||r.set(this.textEditorInnerId,void 0))}get userDataService(){return this.platform.get(o.UserDataRepository)}get host(){return r(this)}static get watchers(){return{isPickerOpen:["watchOpen"],editorPickerQuery:["watchQuery"]}}};!function(t,i,e,r){var s,n=arguments.length,o=n<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,e):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,i,e,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(i,e,o):s(i,e))||o);n>3&&o&&Object.defineProperty(i,e,o)}([c({map:[function(t){return Object.values(t).filter((t=>Vt(t,"user")||Xt(t,"user")))}]})],ii.prototype,"searchableLimetypes",void 0);export{ii as limebb_text_editor}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,c as n,h as t}from"./p-d736c794.js";import{c as e}from"./p-
|
|
1
|
+
import{r,c as n,h as t}from"./p-d736c794.js";import{c as e}from"./p-3b9766cc.js";import{t as u,c as i,a as f,i as o,g as a,b as c,d as s}from"./p-8044ffbd.js";import{d as v,i as l,a as d,U as b,g as h,S as p,k as j}from"./p-bcc23575.js";import{d as m,i as y,S as g,a as _}from"./p-b31772c8.js";import{i as w,c as A,g as k,a as O,b as x,f as S,h as E}from"./p-5322fd19.js";import{e as D,M,i as R}from"./p-c40a3f4b.js";function U(r){return r}var B,q,C,I=Date.now,L=v?function(r,n){return v(r,"toString",{configurable:!0,enumerable:!1,value:(t=n,function(){return t}),writable:!0});var t}:U;const N=(B=L,q=0,C=0,function(){var r=I(),n=16-(r-C);if(C=r,n>0){if(++q>=800)return arguments[0]}else q=0;return B.apply(void 0,arguments)});var T=Math.max;function V(r,n,t){if(!m(t))return!1;var e=typeof n;return!!("number"==e?w(t)&&l(n,t.length):"string"==e&&n in t)&&D(t[n],r)}var W=g?g.isConcatSpreadable:void 0;function z(r){return y(r)||A(r)||!!(W&&r&&r[W])}function F(r,n,t,e,u){var i=-1,f=r.length;for(t||(t=z),u||(u=[]);++i<f;){var o=r[i];n>0&&t(o)?n>1?F(o,n-1,t,e,u):d(u,o):e||(u[u.length]=o)}return u}var G=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function H(r){return G.test(r)}var J="\\ud800-\\udfff",K="["+J+"]",P="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Q="\\ud83c[\\udffb-\\udfff]",X="[^"+J+"]",Y="(?:\\ud83c[\\udde6-\\uddff]){2}",Z="[\\ud800-\\udbff][\\udc00-\\udfff]",$="(?:"+P+"|"+Q+")?",rr="[\\ufe0e\\ufe0f]?",nr=rr+$+"(?:\\u200d(?:"+[X,Y,Z].join("|")+")"+rr+$+")*",tr="(?:"+[X+P+"?",P,Y,Z,K].join("|")+")",er=RegExp(Q+"(?="+Q+")|"+tr+nr,"g");const ur=function(r){var n,t,e,i,f=H(r=u(r))?function(r){return H(r)?function(r){return r.match(er)||[]}(r):function(r){return r.split("")}(r)}(r):void 0,o=f?f[0]:r.charAt(0),a=f?(n=f,t=1,i=n.length,e=void 0===e?i:e,!t&&e>=i?n:function(r,n,t){var e=-1,u=r.length;n<0&&(n=-n>u?0:u+n),(t=t>u?u:t)<0&&(t+=u),u=n>t?0:t-n>>>0,n>>>=0;for(var i=Array(u);++e<u;)i[e]=r[e+n];return i}(n,t,e)).join(""):r.slice(1);return o.toUpperCase()+a};function ir(r){var n=-1,t=null==r?0:r.length;for(this.__data__=new M;++n<t;)this.add(r[n])}function fr(r,n){for(var t=-1,e=null==r?0:r.length;++t<e;)if(n(r[t],t,r))return!0;return!1}ir.prototype.add=ir.prototype.push=function(r){return this.__data__.set(r,"__lodash_hash_undefined__"),this},ir.prototype.has=function(r){return this.__data__.has(r)};var or=1,ar=2;function cr(r,n,t,e,u,i){var f=t&or,o=r.length,a=n.length;if(o!=a&&!(f&&a>o))return!1;var c=i.get(r),s=i.get(n);if(c&&s)return c==n&&s==r;var v=-1,l=!0,d=t&ar?new ir:void 0;for(i.set(r,n),i.set(n,r);++v<o;){var b=r[v],h=n[v];if(e)var p=f?e(h,b,v,n,r,i):e(b,h,v,r,n,i);if(void 0!==p){if(p)continue;l=!1;break}if(d){if(!fr(n,(function(r,n){if(!d.has(n)&&(b===r||u(b,r,t,e,i)))return d.push(n)}))){l=!1;break}}else if(b!==h&&!u(b,h,t,e,i)){l=!1;break}}return i.delete(r),i.delete(n),l}function sr(r){var n=-1,t=Array(r.size);return r.forEach((function(r,e){t[++n]=[e,r]})),t}function vr(r){var n=-1,t=Array(r.size);return r.forEach((function(r){t[++n]=r})),t}var lr=1,dr=2,br="[object Boolean]",hr="[object Date]",pr="[object Error]",jr="[object Map]",mr="[object Number]",yr="[object RegExp]",gr="[object Set]",_r="[object String]",wr="[object Symbol]",Ar="[object ArrayBuffer]",kr="[object DataView]",Or=g?g.prototype:void 0,xr=Or?Or.valueOf:void 0,Sr=1,Er=Object.prototype.hasOwnProperty,Dr=1,Mr="[object Arguments]",Rr="[object Array]",Ur="[object Object]",Br=Object.prototype.hasOwnProperty;function qr(r,n,t,e,u){return r===n||(null==r||null==n||!_(r)&&!_(n)?r!=r&&n!=n:function(r,n,t,e,u,i){var f=y(r),o=y(n),a=f?Rr:k(r),c=o?Rr:k(n),s=(a=a==Mr?Ur:a)==Ur,v=(c=c==Mr?Ur:c)==Ur,l=a==c;if(l&&O(r)){if(!O(n))return!1;f=!0,s=!1}if(l&&!s)return i||(i=new p),f||x(r)?cr(r,n,t,e,u,i):function(r,n,t,e,u,i,f){switch(t){case kr:if(r.byteLength!=n.byteLength||r.byteOffset!=n.byteOffset)return!1;r=r.buffer,n=n.buffer;case Ar:return!(r.byteLength!=n.byteLength||!i(new b(r),new b(n)));case br:case hr:case mr:return D(+r,+n);case pr:return r.name==n.name&&r.message==n.message;case yr:case _r:return r==n+"";case jr:var o=sr;case gr:if(o||(o=vr),r.size!=n.size&&!(e&lr))return!1;var a=f.get(r);if(a)return a==n;e|=dr,f.set(r,n);var c=cr(o(r),o(n),e,u,i,f);return f.delete(r),c;case wr:if(xr)return xr.call(r)==xr.call(n)}return!1}(r,n,a,t,e,u,i);if(!(t&Dr)){var d=s&&Br.call(r,"__wrapped__"),j=v&&Br.call(n,"__wrapped__");if(d||j){var m=d?r.value():r,g=j?n.value():n;return i||(i=new p),u(m,g,t,e,i)}}return!!l&&(i||(i=new p),function(r,n,t,e,u,i){var f=t&Sr,o=h(r),a=o.length;if(a!=h(n).length&&!f)return!1;for(var c=a;c--;){var s=o[c];if(!(f?s in n:Er.call(n,s)))return!1}var v=i.get(r),l=i.get(n);if(v&&l)return v==n&&l==r;var d=!0;i.set(r,n),i.set(n,r);for(var b=f;++c<a;){var p=r[s=o[c]],j=n[s];if(e)var m=f?e(j,p,s,n,r,i):e(p,j,s,r,n,i);if(!(void 0===m?p===j||u(p,j,t,e,i):m)){d=!1;break}b||(b="constructor"==s)}if(d&&!b){var y=r.constructor,g=n.constructor;y==g||!("constructor"in r)||!("constructor"in n)||"function"==typeof y&&y instanceof y&&"function"==typeof g&&g instanceof g||(d=!1)}return i.delete(r),i.delete(n),d}(r,n,t,e,u,i))}(r,n,t,e,qr,u))}var Cr=1,Ir=2;function Lr(r){return r==r&&!m(r)}function Nr(r,n){return function(t){return null!=t&&t[r]===n&&(void 0!==n||r in Object(t))}}function Tr(r,n){return null!=r&&n in Object(r)}var Vr=1,Wr=2;function zr(r){return"function"==typeof r?r:null==r?U:"object"==typeof r?y(r)?(u=r[1],o(e=r[0])&&Lr(u)?Nr(f(e),u):function(r){var n=a(r,e);return void 0===n&&n===u?function(r,n){return null!=r&&function(r,n,t){for(var e=-1,u=(n=i(n,r)).length,o=!1;++e<u;){var a=f(n[e]);if(!(o=null!=r&&t(r,a)))break;r=r[a]}return o||++e!=u?o:!!(u=null==r?0:r.length)&&S(u)&&l(a,u)&&(y(r)||A(r))}(r,n,Tr)}(r,e):qr(u,n,Vr|Wr)}):(t=function(r){for(var n=j(r),t=n.length;t--;){var e=n[t],u=r[e];n[t]=[e,u,Lr(u)]}return n}(n=r),1==t.length&&t[0][2]?Nr(t[0][0],t[0][1]):function(r){return r===n||function(r,n,t,e){var u=t.length,i=u;if(null==r)return!i;for(r=Object(r);u--;){var f=t[u];if(f[2]?f[1]!==r[f[0]]:!(f[0]in r))return!1}for(;++u<i;){var o=(f=t[u])[0],a=r[o],c=f[1];if(f[2]){if(void 0===a&&!(o in r))return!1}else{var s,v=new p;if(!(void 0===s?qr(c,a,Cr|Ir,e,v):s))return!1}}return!0}(r,0,t)}):function(r){return o(r)?(n=f(r),function(r){return null==r?void 0:r[n]}):function(r){return function(n){return c(n,r)}}(r);var n}(r);var n,t,e,u}const Fr=function(r,n,t){for(var e=-1,u=Object(r),i=t(r),f=i.length;f--;){var o=i[++e];if(!1===n(u[o],o,u))break}return r};const Gr=function(r,n){if(null==r)return r;if(!w(r))return function(r,n){return r&&Fr(r,n,j)}(r,n);for(var t=r.length,e=-1,u=Object(r);++e<t&&!1!==n(u[e],e,u););return r};function Hr(r,n){if(r!==n){var t=void 0!==r,e=null===r,u=r==r,i=R(r),f=void 0!==n,o=null===n,a=n==n,c=R(n);if(!o&&!c&&!i&&r>n||i&&f&&a&&!o&&!c||e&&f&&a||!t&&a||!u)return 1;if(!e&&!i&&!c&&r<n||c&&t&&u&&!e&&!i||o&&t&&u||!f&&u||!a)return-1}return 0}function Jr(r,n,t){n=n.length?s(n,(function(r){return y(r)?function(n){return c(n,1===r.length?r[0]:r)}:r})):[U];var e=-1;n=s(n,E(zr));var u=function(r,n){var t=-1,e=w(r)?Array(r.length):[];return Gr(r,(function(r){e[++t]=n(r)})),e}(r,(function(r){return{criteria:s(n,(function(n){return n(r)})),index:++e,value:r}}));return function(r){var n=r.length;for(r.sort((function(r,n){return function(r,n,t){for(var e=-1,u=r.criteria,i=n.criteria,f=u.length,o=t.length;++e<f;){var a=Hr(u[e],i[e]);if(a)return e>=o?a:a*("desc"==t[e]?-1:1)}return r.index-n.index}(r,n,t)}));n--;)r[n]=r[n].value;return r}(u)}var Kr=function(r){return N(function(r,n,t){return n=T(void 0===n?r.length-1:n,0),function(){for(var e=arguments,u=-1,i=T(e.length-n,0),f=Array(i);++u<i;)f[u]=e[n+u];u=-1;for(var o=Array(n+1);++u<n;)o[u]=e[u];return o[n]=t(f),function(r,n,t){switch(t.length){case 0:return r.call(n);case 1:return r.call(n,t[0]);case 2:return r.call(n,t[0],t[1]);case 3:return r.call(n,t[0],t[1],t[2])}return r.apply(n,t)}(r,this,o)}}(r,void 0,U),r+"")}((function(r,n){if(null==r)return[];var t=n.length;return t>1&&V(r,n[0],n[1])?n=[]:t>2&&V(n[0],n[1],n[2])&&(n=[n[0]]),Jr(r,F(n,1),[])}));const Pr=Kr;function Qr(r,n){if(!r.length||!n.length)return"";r="en_us"===r?"en-US":r,n="en_us"===n?"en-US":n;const t=(new Intl.DisplayNames(n,{type:"language"}).of(r)||"").split(" ");return t[0]=ur(u(t[0]).toLowerCase()),t.join(" ")}const Xr=class{constructor(t){r(this,t),this.change=n(this,"change",7),this.context={limetype:null,id:null},this.handleChange=r=>{r.stopPropagation(),this.change.emit(this.multipleChoice?r.detail.map((r=>r.value)):r.detail.value)}}async componentWillLoad(){try{this.http=this.platform.get(e.Http),this.allLanguages=await async function(r){const n=await r.get("api/v1/admin/settings/languages"),t=[];return(null==n?void 0:n.active)&&t.push(...n.active),(null==n?void 0:n.inactive)&&t.push(...n.inactive),t}(this.http)}catch(r){console.error(r)}}getOptions(){return this.allLanguages.map((r=>({value:r,text:Qr(r,r)})))}render(){const r=this.getOptions();let n;if(Array.isArray(this.value)){const t=this.value;n=r.filter((r=>t.some((n=>r.value===n))))}else{const t=this.value;n=r.find((r=>r.value===t))}return t("limel-select",{key:"085d3f0a20c6deb08ce52c4dadcc543f20cae275",value:n,options:Pr(r,"text"),helperText:this.helperText,label:this.label,required:this.required,disabled:this.disabled,readonly:this.readonly,onChange:this.handleChange,multiple:this.multipleChoice})}};export{Xr as limebb_locale_picker}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as t,H as i}from"./p-d736c794.js";import{c as r}from"./p-
|
|
1
|
+
import{r as e,h as t,H as i}from"./p-d736c794.js";import{c as r}from"./p-3b9766cc.js";const o=class{constructor(t){e(this,t),this.hasError=!1,this.createActionBarItem=e=>{var t,i;if("separator"in e)return e;let r={value:e,text:null!==(t=e.label)&&void 0!==t?t:"",secondaryText:e.description,disabled:e.disabled};return!e.label&&e.icon?r=Object.assign(Object.assign({},r),{icon:e.icon,text:null!==(i=e.description)&&void 0!==i?i:r.text,iconOnly:!0}):e.icon&&(r=Object.assign(Object.assign({},r),{icon:e.icon})),r},this.handleActionBarItemSelect=e=>{var t;e.stopPropagation();const i=null===(t=e.detail.value)||void 0===t?void 0:t.command;i&&this.commandbus.handle(i)},this.createMenuItem=e=>{var t,i;return"separator"in e?e:{value:e,text:null!==(t=e.label)&&void 0!==t?t:"",secondaryText:e.description,disabled:e.disabled,icon:null!==(i=e.icon)&&void 0!==i?i:""}},this.handleMenuItemSelect=e=>{var t;e.stopPropagation();const i=null===(t=e.detail.value)||void 0===t?void 0:t.command;i&&this.commandbus.handle(i)}}render(){const e=`helper-text-${this.item.id}`;return t(i,{key:"194f72f603860f5426708190e5eaecaad7082bab",id:this.item.id,"aria-describedby":this.helperText?e:void 0,"aria-live":this.hasError?"assertive":"off",class:{[`${this.item.ui}`]:!0}},t("div",{key:"f8ebc3774ec707c9a755092b17c634f8dcc9b787",class:"bubble-content"},t("div",{key:"46ba28aec47cc1ecfd6752d9e03ee7471b47bb17",class:"icon-picture"},this.renderIcon(),this.renderAuthorPicture()),this.renderErrorSign(),t("div",{key:"eebe6ac230b4f4ba182229377984eb83a3e83570",class:"item"},this.renderHeader(),this.renderValue(),t("footer",{key:"f349fb88d701726af5793d35adce4d0880a1dbea"},this.renderHelperText(e),this.renderTimestamp()))),this.renderPromotedAction())}renderErrorSign(){if(this.hasError)return t("limel-icon",{class:"error-sign",name:"brake_warning"})}renderHeader(){var e;if(null===(e=this.item.author)||void 0===e?void 0:e.name)return t("header",null,this.renderAuthorName(),t("div",{class:"action-buttons"},this.renderUnpromotedActionsMenu()))}renderIcon(){var e,i,r,o;if(this.item.icon)return t("limel-icon",{class:"icon",badge:!0,name:null!==(i=null===(e=this.item.icon)||void 0===e?void 0:e.name)&&void 0!==i?i:"dot_circle",style:{color:`${null===(r=this.item.icon)||void 0===r?void 0:r.color}`,"background-color":`${null===(o=this.item.icon)||void 0===o?void 0:o.backgroundColor}`}})}renderHelperText(e){if(this.helperText)return t("span",{class:"helper-text",id:e},this.helperText)}renderValue(){if(this.item.value)return t("limel-markdown",{class:"body-text",value:this.item.value})}renderAuthorName(){var e,i;if("string"==typeof(null===(e=this.item.author)||void 0===e?void 0:e.name))return t("span",{class:"author"},this.item.author.name);if("object"==typeof(null===(i=this.item.author)||void 0===i?void 0:i.name)){const{href:e,title:i,text:r}=this.item.author.name;return t("a",{class:"author",href:e,title:i},r)}}renderAuthorPicture(){var e;if(null===(e=this.item.author)||void 0===e?void 0:e.picture)return t("img",{class:"author-avatar",loading:"lazy",src:this.item.author.picture})}renderUnpromotedActionsMenu(){var e,i;if(!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length))return;const r=this.item.unpromotedActions.map(this.createMenuItem);return t("limel-menu",{class:"unpromoted-actions-menu",items:r,openDirection:"bottom-end",onSelect:this.handleMenuItemSelect},t("limel-icon-button",{icon:"menu_2",slot:"trigger",label:null===(i=this.translator)||void 0===i?void 0:i.get("webclient.more-actions")}))}renderPromotedAction(){if(!this.item.promotedActions)return;const e=this.item.promotedActions.map(this.createActionBarItem);return t("div",{class:"action-bar"},t("div",{class:"action-bar-hider"},t("limel-action-bar",{accessibleLabel:"Action bar",actions:e,layout:"fullWidth",onItemSelected:this.handleActionBarItemSelect})))}renderTimestamp(){const e=this.item.timestamp;if(e)return t("span",{class:"timestamp"},this.dateTimeFormatter.format(e,"timeofday"))}get dateTimeFormatter(){return this.platform.get(r.DateTimeFormatter)}get translator(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(r.Translate)}get commandbus(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(r.CommandBus)}};o.style='@charset "UTF-8";*{box-sizing:border-box}:host(limebb-chat-item){display:flex;flex-direction:column;gap:0.25rem;min-width:0;min-height:0;max-width:calc(100% - 2rem)}.bubble-content{display:flex;gap:0.25rem;min-width:0;min-height:0}:host(limebb-chat-item:hover) .helper-text,:host(limebb-chat-item:hover) .timestamp,:host(limebb-chat-item:focus-within) .helper-text,:host(limebb-chat-item:focus-within) .timestamp{opacity:1}:host(limebb-chat-item.mine){margin-left:auto}:host(limebb-chat-item.mine) .item{border-bottom-right-radius:0.125rem;background-color:rgb(var(--color-sky-default), 0.2)}:host(limebb-chat-item.mine) .bubble-content{justify-content:end}:host(limebb-chat-item.mine) .icon-picture{order:2}:host(limebb-chat-item.theirs){margin-right:auto}:host(limebb-chat-item.theirs) .item{border-bottom-left-radius:0.125rem;background-color:rgb(var(--contrast-300), 0.7)}.item{display:flex;flex-direction:column;border-radius:1.25rem;padding:0 0.25rem 0.25rem 0.25rem;backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem)}.icon-picture{display:flex;flex-direction:column;gap:0.5rem;align-items:center;justify-content:flex-end}.icon-picture:has(.author-avatar) limel-icon{width:1.25rem;padding:0.125rem}.icon{--icon-background-color:rgb(var(--contrast-500), 0.5);flex-shrink:0;padding:0.375rem;width:2.25rem;backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem)}header{display:flex;justify-content:space-between;align-items:center;min-height:2rem;padding-left:0.5rem}header:not(:has(.unpromoted-actions-menu)){padding-right:0.5rem}.body-text{padding:0.25rem 0.5rem}footer{display:flex;justify-content:space-between;align-items:end;gap:0.5rem;font-size:x-small}footer:not(:empty){padding:0 0.25rem 0.125rem 0.5rem}footer *{transition:opacity 0.2s ease;opacity:0.4}.timestamp{margin-left:auto}.author-avatar{border-radius:50%;width:2rem;height:2rem;object-fit:cover;box-shadow:0 0 0 1px rgb(var(--contrast-600))}.author{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:500;text-decoration:none}a.author{position:relative;cursor:pointer;transition:color 0.2s ease;color:var(--mdc-theme-primary)}a.author:before{transition:opacity 0.2s ease, transform 0.3s ease-out;content:"";position:absolute;inset:auto 0 0 0;width:calc(100% - 0.5rem);margin:auto;height:0.125rem;border-radius:1rem;background-color:currentColor;opacity:0;transform:scale(0.6)}a.author:hover{color:rgb(var(--color-teal-light))}a.author:hover:before{opacity:0.3;transform:scale(1)}limel-action-bar{--action-bar-item-height:1.75rem;transition:opacity 0.2s ease;justify-content:flex-start;opacity:0.8}.action-bar{display:grid;transition:grid-template-rows var(--limebb-promoted-action-bar-grid-template-rows-transition-speed, 0.2s) cubic-bezier(1, 0.09, 0, 0.89) var(--limebb-promoted-action-bar-grid-template-rows-transition-delay, 0s);grid-template-rows:var(--limebb-promoted-action-bar-grid-template-rows, 1fr)}.action-bar-hider{overflow:hidden}limel-action-bar{transition:padding var(--limebb-promoted-action-bar-grid-template-rows-transition-speed) cubic-bezier(1, 0.09, 0, 0.89) var(--limebb-promoted-action-bar-grid-template-rows-transition-delay);padding-top:0;padding-bottom:0.75rem}:host(limebb-chat-item:hover) .action-bar,:host(limebb-chat-item:focus-within) .action-bar,:host(limebb-chat-item:focus-visible) .action-bar{--limebb-promoted-action-bar-grid-template-rows:1fr;will-change:grid-template-rows}:host(limebb-chat-item:hover) limel-action-bar,:host(limebb-chat-item:focus-within) limel-action-bar,:host(limebb-chat-item:focus-visible) limel-action-bar{will-change:opacity;opacity:1}:host(limebb-chat-item:hover),:host(limebb-chat-item:focus-within){--limebb-promoted-action-bar-grid-template-rows-transition-speed:0.46s;--limebb-promoted-action-bar-grid-template-rows-transition-delay:0.7s}.action-bar{min-width:0;width:calc(100% - calc(2rem + 0.25rem))}:host(limebb-chat-item.theirs) .action-bar{margin-left:calc(2rem + 0.25rem)}:host(limebb-chat-item[has-error]:not([has-error=false])) .bubble-content{cursor:help}:host(limebb-chat-item[has-error]:not([has-error=false])) .item{border:1px solid rgb(var(--color-red-default))}:host(limebb-chat-item[has-error]:not([has-error=false])) .error-sign{color:rgb(var(--color-red-default));flex-shrink:0;width:1.25rem;align-self:center}:host(limebb-chat-item.mine[has-error]:not([has-error=false])) .action-bar{padding-left:1.25rem}:host(limebb-chat-item.mine[has-error]:not([has-error=false])) .helper-text{opacity:1;color:rgb(var(--color-red-default))}';const a=class{constructor(t){e(this,t)}render(){return t("div",{key:"4acffbefa03eb7605db612242ebfcbba15522d42",class:"typing-ellipsis"},t("div",{key:"9911cf59740e060dc74e88d569083c0ecfa0a891",class:"circle"}),t("div",{key:"ebbe4137c147c84322c47c39b847c8f8bc00a7b0",class:"circle"}),t("div",{key:"9118c496ffe0eb308716f8c7fbea518bd607731a",class:"circle"}))}};a.style="*{box-sizing:border-box}.typing-ellipsis{position:relative;display:inline-flex;align-items:center;gap:0.25rem;height:1.5rem;padding:0 0.5rem;border-radius:10rem;border-bottom-left-radius:0.125rem;background-color:rgb(var(--contrast-600), 0.4);backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem)}.circle{position:relative;height:0.5rem;width:0.5rem;background:rgb(var(--contrast-800));border-radius:50%}.circle:first-of-type{animation:ellipsis-typing-indicator 1.2s infinite}.circle:nth-of-type(2){animation:ellipsis-typing-indicator 1.2s infinite 0.2s}.circle:nth-of-type(3){animation:ellipsis-typing-indicator 1.2s infinite 0.4s}@keyframes ellipsis-typing-indicator{0%{top:0}6.25%{top:-1px}12.5%{top:0;background:rgb(var(--contrast-1000))}18.75%{top:1px}25%{top:0}}";export{o as limebb_chat_item,a as limebb_typing_indicator}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e}from"./p-d736c794.js";import{h as c,c as o}from"./p-
|
|
1
|
+
import{r as t,c as e}from"./p-d736c794.js";import{h as c,c as o}from"./p-3b9766cc.js";import{H as s}from"./p-506dfcff.js";let i=class{constructor(t){this.itemId=t}};i=function(t,e,c,o){var s,i=arguments.length,l=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,c):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,c,o);else for(var n=t.length-1;n>=0;n--)(s=t[n])&&(l=(i<3?s(l):i>3?s(e,c,l):s(e,c))||l);return i>3&&l&&Object.defineProperty(e,c,l),l}([c({id:"limebb-feed.highlight-item"})],i);const l=class{constructor(c){t(this,c),this.loaded=e(this,"loaded",7)}connectedCallback(){}async componentWillLoad(){const t=new s;this.platform.register(s.SERVICE_NAME,t),this.commandBus.register(i,t),this.loaded.emit()}componentWillUpdate(){}disconnectedCallback(){}get commandBus(){return this.platform.get(o.CommandBus)}};export{l as limebb_loader}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as i,h as t}from"./p-d736c794.js";import{c as o}from"./p-
|
|
1
|
+
import{r as e,c as i,h as t}from"./p-d736c794.js";import{c as o}from"./p-3b9766cc.js";function r(e){return e.items.forEach((i=>{e.processedItems.push({type:"notification",item:i})})),e}function n(e){const i=[];let t=e.newItemIndicatorInserted;return e.processedItems.forEach((o=>{"notification"===o.type&&e.lastVisitedTimestamp&&!t&&new Date(o.item.timestamp)<=e.lastVisitedTimestamp&&e.hasUnseenNotifications&&(i.push({type:"newItemIndicator"}),t=!0),i.push(o)})),e.processedItems=i,e.newItemIndicatorInserted=t,e}function a(e){const i=[];let t=null,o=null;for(const r of e.processedItems)if("notification"===r.type){const n=new Date(r.item.timestamp),a=e.dateTimeFormatter.format(n,"date");a!==o&&(t&&i.push(t),t={type:"group",groupType:"dateGroup",heading:a,items:[]},o=a),t&&t.items.push(r)}else"newItemIndicator"===r.type&&(t?t.items.push(r):i.push(r));return t&&i.push(t),Object.assign(Object.assign({},e),{processedItems:i})}const s=class{constructor(t){e(this,t),this.itemClick=i(this,"itemClick",7),this.items=[],this.processedItems=[],this.handleItemClick=e=>{this.itemClick.emit(e.detail)}}handleItemsChange(){let e=null;var i,t,o,s;this.lastVisitedTimestamp&&(e="string"==typeof(s=this.lastVisitedTimestamp)?new Date(Date.parse(s)):new Date(s)),this.processedItems=(o={items:i=this.items,processedItems:[],lastVisitedTimestamp:t=e,dateTimeFormatter:this.dateTimeFormatter,newItemIndicatorInserted:!1,lastProcessedDate:null,hasUnseenNotifications:i.some((e=>t&&new Date(e.timestamp)>t))},[r,n,a].reduce(((e,i)=>i(e)),o)).processedItems}componentWillLoad(){this.handleItemsChange()}render(){return[this.renderSpinner(),this.renderNotificationItems()]}renderSpinner(){if(this.loading)return t("limel-spinner",{size:"small"})}renderNotificationItems(){return this.processedItems.map((e=>{switch(e.type){case"group":return this.renderGroup(e);case"newItemIndicator":return this.renderIndicator();default:return null}}))}renderGroup(e){return t("section",{class:"date-group"},t("a",{class:"date-heading"},e.heading),e.items.map((e=>"notification"===e.type?this.renderNotificationItem(e.item):"newItemIndicator"===e.type?this.renderIndicator():void 0)))}renderNotificationItem(e){return t("limebb-notification-item",{platform:this.platform,context:this.context,item:e,key:e.id,onInteract:this.handleItemClick})}renderIndicator(){return t("div",{class:"new-items-indicator"},t("hr",null),t("h3",null,this.translator.get("webclient.new")))}get dateTimeFormatter(){return this.platform.get(o.DateTimeFormatter)}get translator(){return this.platform.get(o.Translate)}static get watchers(){return{items:["handleItemsChange"]}}};s.style='@charset "UTF-8";:host(limebb-notification-list){--limebb-notification-list-background-color:var(\n --notification-list-background-color,\n rgb(var(--contrast-300))\n );display:flex;flex-direction:column;gap:1rem;max-width:45rem;background-color:var(--limebb-notification-list-background-color);padding:0.5rem}limebb-notification-item:focus{outline:none}limebb-notification-item:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}limebb-notification-item:not(.is-read){--limebb-notification-item-unread-badge-color:rgb(\n var(--color-red-default)\n );--limebb-notification-item-unread-badge-scale:1;background-color:rgb(var(--contrast-100)) !important}limebb-notification-item.is-clickable{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--mdc-theme-on-surface);background-color:transparent}limebb-notification-item.is-clickable:hover,limebb-notification-item.is-clickable:focus,limebb-notification-item.is-clickable:focus-visible{will-change:color, background-color, box-shadow, transform}limebb-notification-item.is-clickable:hover{transform:translate3d(0, 0.01rem, 0);color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}limebb-notification-item.is-clickable:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}limebb-notification-item.is-clickable:hover,limebb-notification-item.is-clickable:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}limebb-notification-item.is-clickable:hover{border-color:transparent}limebb-notification-item.is-read{border-color:rgb(var(--contrast-600));background-color:rgb(var(--contrast-500))}limebb-notification-item.is-selected{box-shadow:var(--shadow-focused-state)}limebb-notification-item.is-selected:hover{box-shadow:var(--shadow-focused-state), var(--button-shadow-hovered)}limel-spinner{align-self:center;justify-self:center;margin:auto}.date-group{isolation:isolate;display:flex;flex-direction:column;gap:0.5rem}.date-heading{position:sticky;z-index:1;top:0.25rem;display:flex;border-radius:9rem;padding:0.25rem 0.5rem;margin:0;width:fit-content;font-size:0.75rem;line-height:1;color:rgb(var(--contrast-900));backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem);transition:color 0.2s ease, border-color 0.4s ease}.date-heading:hover{color:rgb(var(--contrast-1000));border-color:rgb(var(--contrast-500))}.date-heading:hover:before{opacity:1}.date-heading:before{transition:opacity 0.2s ease;content:"";position:absolute;z-index:-1;inset:0;opacity:0.6;border-radius:inherit;background-color:var(--limebb-notification-list-background-color)}.new-items-indicator{position:relative;isolation:isolate;display:flex;align-items:center;justify-content:flex-end;margin:0.25rem 0}.new-items-indicator hr{border:none;position:absolute;width:100%;height:1px;background-color:rgb(var(--color-red-lighter))}.new-items-indicator h3{z-index:1;padding:0 0.5rem;border-radius:1rem;margin:0 1rem;font-size:small;line-height:0.75rem;text-transform:lowercase;color:rgb(var(--color-red-default));background-color:var(--limebb-notification-list-background-color)}';export{s as limebb_notification_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e}from"./p-d736c794.js";import{c as s}from"./p-
|
|
1
|
+
import{r as t,c as i,h as e}from"./p-d736c794.js";import{c as s}from"./p-3b9766cc.js";const h=class{constructor(e){t(this,e),this.change=i(this,"change",7),this.disabled=!1,this.readonly=!1,this.invalid=!1,this.required=!1,this.type="datetime",this.shouldEmitValueAsString=!0,this.handleChange=t=>{if(!t.detail)return;t.stopPropagation();const i=(e=t.detail,"datetime"===(s=this.type)||"time"===s?e:new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())));var e,s;this.change.emit(this.shouldEmitValueAsString?i.toISOString():i)},this.formatter=t=>this.dateTimeFormatter.format(t,r[this.type]||this.type)}render(){return this.language||(this.language=this.getAppLanguage()),this.value&&(this.shouldEmitValueAsString="string"==typeof this.value),e("limel-date-picker",{key:"4834d6733ffb8df8e5bcb298d2a94c88cd78a7e4",disabled:this.disabled,readonly:this.readonly,invalid:this.invalid,label:this.label,placeholder:this.placeholder,helperText:this.helperText,required:this.required,value:this.parseDateValue(),type:this.type,language:this.language,formatter:this.formatter,onChange:this.handleChange})}parseDateValue(){const t=this.value;if(t)return this.dateTimeFormatter.parse(t,r[this.type]||this.type)}get dateTimeFormatter(){return this.platform.get(s.DateTimeFormatter)}getAppLanguage(){const t=this.platform.get(s.Translate),i=this.platform.get(s.Application);let e;var h;return e="function"==typeof(null==(h=t)?void 0:h.getLanguage)?t.getLanguage():i.getLanguage(),n(e)?e:"en"}},r={datetime:"time",time:"timeofday"},a=new Set(["da","de","en","fi","fr","nb","no","nl","sv"]),n=t=>a.has(t);export{h as limebb_date_picker}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e}from"./p-d736c794.js";import{G as i,L as r,c as o}from"./p-
|
|
1
|
+
import{r as t,h as e}from"./p-d736c794.js";import{G as i,L as r,c as o}from"./p-3b9766cc.js";import{n as s}from"./p-7c9484b1.js";const n=["edit","view"],l=["ai","aspx","doc","docm","docx","dotm","dotx","emf","html","htm","obj","potm","potx","ppsm","ppsx","ppt","pptm","pptx","psd","rtf","tif","tiff","txt","wmf","xls","xlsx","zip"];var c=function(t,e,i,r){var o,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(n=(s<3?o(n):s>3?o(e,i,n):o(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const h=class{constructor(e){t(this,e),this.fileTypes=["view","contents","download"]}render(){const t=this.getFile();return t?this.isLiveDocsFile(t)?this.renderLiveDocs(t):this.renderFileViewer(t):this.renderNotFound()}renderLiveDocs(t){const i=this.getLiveDocsUrl(t);return i?e("iframe",{src:i,frameBorder:0,marginHeight:0,marginWidth:0}):this.renderNotFound()}renderFileViewer(t){const i=t.filename,r=this.getFileUrl(t);return r?e("limel-file-viewer",{filename:i,url:r,allowDownload:!0,allowFullscreen:!0}):this.renderNotFound()}renderNotFound(){return[e("section",{class:"not-found"},e("limel-icon",{name:"error",size:"large"}),e("h2",null,this.translator.get("not-found")),e("p",null,this.translator.get("no-files-attached",{object:this.getDescriptive(this.limeobject)})))]}getLiveDocsUrl(t){return this.fileTypes.filter(this.isLiveDocsType).map((e=>t.getUrl(e))).find((t=>t))}getFileUrl(t){return this.fileTypes.filter(s(this.isLiveDocsType)).map((e=>t.getUrl(e))).find((t=>t))}getFile(){const t=this.fileProperty;if(t)return this.limeobject.getFile(t.name)}isLiveDocsFile(t){return l.includes(t.extension)&&n.some((e=>t.getUrl(e)))}isLiveDocsType(t){return n.includes(t)}getDescriptive(t){var e;let i="";return(null==t?void 0:t.descriptive)&&(i=t.descriptive),i||(i=null===(e=this.limetype)||void 0===e?void 0:e.localname.singular),i||(i=this.translator.get("object")),i}get fileProperty(){if(this.limeobject){if(this.property){const t=this.limeobject.getLimetype().getProperty(this.property);if("file"===t.type)return t}return Object.values(this.limeobject.getLimetype().properties).find((t=>"file"===t.type))}}get translator(){return this.platform.get(o.Translate)}};c([i()],h.prototype,"limeobject",void 0),c([r()],h.prototype,"limetype",void 0),h.style=".not-found{display:flex;flex-direction:column;height:100%;align-items:center;justify-content:center;line-height:1rem;color:rgb(var(--contrast-1100))}.not-found limel-icon{color:rgb(var(--color-red-default))}iframe{height:100%;width:100%}";export{h as limebb_limeobject_file_viewer}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as r,h as o,H as i}from"./p-d736c794.js";import{c as
|
|
1
|
+
import{r as e,c as r,h as o,H as i}from"./p-d736c794.js";import{c as s}from"./p-3b9766cc.js";const a=class{constructor(i){e(this,i),this.interact=r(this,"interact",7),this.renderRelations=()=>{var e,r,i;if(null===(r=null===(e=this.item)||void 0===e?void 0:e.relations)||void 0===r?void 0:r.length)return o("limel-chip-set",{value:null===(i=this.item)||void 0===i?void 0:i.relations})},this.renderAssigneesAvatar=e=>e.picture?o("img",{loading:"lazy",src:e.picture,alt:e.name.text}):o("limel-icon",{name:e.icon.name,style:{color:`${e.icon.color}`,"background-color":`${e.icon.backgroundColor}`}}),this.createMenuItem=e=>{var r,o;return"separator"in e?e:{value:e,text:null!==(r=e.label)&&void 0!==r?r:"",secondaryText:e.description,disabled:e.disabled,icon:null!==(o=e.icon)&&void 0!==o?o:""}},this.handleMenuItemSelect=e=>{var r;e.stopPropagation();const o=null===(r=e.detail.value)||void 0===r?void 0:r.command;o&&this.commandbus.handle(o)},this.handleKanbanItemClick=()=>{this.interact.emit(this.item)}}render(){var e,r;return o(i,{key:"dd22e6855c6a5a72a02fb1edd17b2baf3f94020d",id:this.item.id.toString(),class:{"has-unpromoted-actions":!!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length),"is-selected":!!(null===(r=this.item)||void 0===r?void 0:r.selected)},style:{"--limebb-kanban-item-color-code":`${this.item.color}`},onClick:this.handleKanbanItemClick},this.renderHeader(),this.renderContent(),this.renderFooter())}renderHeader(){return o("div",{class:"header"},this.renderIcon(),this.renderHeading(),this.renderUnpromotedActionsMenu())}renderIcon(){var e,r,i,s;if(this.item.icon)return o("limel-icon",{class:"icon",badge:!0,name:null!==(r=null===(e=this.item.icon)||void 0===e?void 0:e.name)&&void 0!==r?r:"dot_circle",style:{color:`${null===(i=this.item.icon)||void 0===i?void 0:i.color}`,"background-color":`${null===(s=this.item.icon)||void 0===s?void 0:s.backgroundColor}`}})}renderContent(){return o("div",{class:"content"},this.renderValue(),this.renderRelations())}renderHeading(){if(this.item.heading)return o("limel-markdown",{class:"heading",value:this.item.heading})}renderValue(){if(this.item.value)return o("limel-markdown",{class:"body",value:this.item.value})}renderUnpromotedActionsMenu(){var e,r;if(!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length))return;const i=this.item.unpromotedActions.map(this.createMenuItem);return o("limel-menu",{class:"unpromoted-actions-menu",items:i,openDirection:"bottom-end",onSelect:this.handleMenuItemSelect},o("limel-icon",{class:"actions",name:"menu_2",slot:"trigger",size:"small",id:"item-actions-tooltip"}),o("limel-tooltip",{elementId:"item-actions-tooltip",label:null===(r=this.translator)||void 0===r?void 0:r.get("webclient.more-actions"),openDirection:"top-end"}))}renderFooter(){var e;if(null===(e=this.item.assignees)||void 0===e?void 0:e.length)return o("div",{class:"footer"},this.renderAssignees())}renderAssignees(){var e;if(null===(e=this.item.assignees)||void 0===e?void 0:e.length)return o("div",{class:"assignees"},this.item.assignees.map((e=>{var r;return o("limebb-summary-popover",Object.assign({icon:null===(r=e.icon)||void 0===r?void 0:r.name},e.picture&&{image:{src:e.picture,alt:e.name.text||""}},{heading:e.name.text,value:this.createLinkToAssignee(e)}),o("a",{slot:"trigger",class:"assignee",href:e.name.href,title:e.name.text},this.renderAssigneesAvatar(e),o("span",null,e.name.text)))})))}createLinkToAssignee(e){const r=this.translator.get("webclient.actions.goto-object",{limetype:": <br><b>"+e.name.text+"</b>"});return`<a class="author" href="${e.name.href}" title="${e.name.text}">${r}</a>`}get translator(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(s.Translate)}get commandbus(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(s.CommandBus)}};a.style='@charset "UTF-8";*,*:before,*:after{box-sizing:border-box}:host(limebb-kanban-item){position:relative;box-sizing:border-box;display:flex;flex-direction:column;border-radius:0.5rem}:host(limebb-kanban-item):before{content:"";display:block;position:absolute;top:1rem;bottom:1rem;right:0;transform:translateX(50%);width:0.25rem;border-radius:1rem;background-color:var(--limebb-kanban-item-color-code)}.content{padding-top:0.25rem;min-height:3rem}.header{display:flex;align-items:flex-start;gap:0.5rem;min-height:1.75rem;padding:0.25rem 0.5rem;border-radius:0.5rem 0.5rem 0 0;background-color:rgb(var(--contrast-300))}.header a{position:relative;cursor:pointer;transition:color 0.2s ease;color:var(--mdc-theme-primary);text-decoration:none}.header a:before{transition:opacity 0.2s ease, transform 0.3s ease-out;content:"";position:absolute;inset:auto 0 0 0;width:calc(100% - 0.5rem);margin:auto;height:0.125rem;border-radius:1rem;background-color:currentColor;opacity:0;transform:scale(0.6)}.header a:hover{color:rgb(var(--color-teal-light))}.header a:hover:before{opacity:0.3;transform:scale(1)}.heading{--markdown-hyperlink-color:var(--mdc-theme-primary);--markdown-hyperlink-color--hovered:rgb(var(--color-teal-light))}.unpromoted-actions-menu{margin:-0.5rem -0.5rem -0.25rem auto}.body{display:block;padding:0.5rem;padding-top:0;color:rgb(var(--contrast-1100))}limel-chip-set{--limel-chip-size:1.5rem;display:block;margin-left:-0.5rem;margin-right:0.5rem;padding-bottom:0.5rem}.footer{position:relative;display:flex;align-items:center;gap:0.5rem;padding:0.25rem 0.25rem 0.125rem;margin:0 0.25rem;border-top:1px dashed rgb(var(--contrast-300))}.header limel-icon,.footer limel-icon{flex-shrink:0;width:1.25rem;height:1.25rem}.header .actions{margin:0.5rem 0.25rem 0}.header .actions:hover{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal)}.header .actions:hover:hover,.header .actions:hover:focus,.header .actions:hover:focus-visible{will-change:color, background-color, box-shadow, transform}.header .actions:hover:hover{transform:translate3d(0, -0.04rem, 0);color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.header .actions:hover:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.header .actions:hover:hover,.header .actions:hover:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.footer img{border-radius:50%;object-fit:cover;box-shadow:0 0 0 1px rgb(var(--contrast-800), 0.4);flex-shrink:0;width:1.25rem;height:1.25rem}.assignees{display:flex;align-items:center;gap:0.25rem}.assignees:has(>:nth-child(2)) span{display:none}.assignees:has(>:nth-child(2)) img,.assignees:has(>:nth-child(2)) limel-icon{margin-right:-0.5rem}.assignees:hover img,.assignees:hover limel-icon,.assignees:focus-within img,.assignees:focus-within limel-icon{margin-right:0rem}.assignees:hover .assignee:not(:hover):not(:focus-visible) img,.assignees:hover .assignee:not(:hover):not(:focus-visible) limel-icon,.assignees:focus-within .assignee:not(:hover):not(:focus-visible) img,.assignees:focus-within .assignee:not(:hover):not(:focus-visible) limel-icon{filter:grayscale(1);opacity:0.6}.assignee{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--mdc-theme-on-surface);background-color:transparent;display:flex;align-items:center;text-decoration:none;gap:0.25rem;margin-left:0;border-radius:1rem}.assignee:hover,.assignee:focus,.assignee:focus-visible{will-change:color, background-color, box-shadow, transform}.assignee:hover{transform:translate3d(0, 0.01rem, 0);color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.assignee:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.assignee:hover,.assignee:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.assignee:focus{outline:none}.assignee:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.assignee limel-icon,.assignee img{transition:margin 0.2s ease, opacity 0.2s ease, filter 0.2s ease}.assignee limel-icon{padding:0.125rem;box-shadow:0 0 0 1px rgb(var(--contrast-800), 0.4);background-color:rgb(var(--contrast-100))}.assignee span{font-size:0.75rem;color:rgb(var(--contrast-900));padding-right:0.5rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}';export{a as limebb_kanban_item}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,g as o,h as r}from"./p-d736c794.js";import{c as e}from"./p-
|
|
1
|
+
import{r as t,g as o,h as r}from"./p-d736c794.js";import{c as e}from"./p-3b9766cc.js";function i(t,o){if(o(t))return t;let r=t.parentElement||t.parentNode;var e;return(null==(e=r)?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&(r=r.host),r?i(r,o):void 0}const n=class{constructor(o){t(this,o)}connectedCallback(){const t=i(o(this),this.hasPlatform);t&&this.loadLimeObject(t.platform)}hasPlatform(t){return"platform"in t&&!!t.platform&&"object"==typeof t.platform}async loadLimeObject(t){const o=t.get(e.LimeObjectRepository);if(this.limeobject=o.getObject(this.limetype,this.objectid),!this.limeobject){try{await o.loadObject(this.limetype,this.objectid)}catch(t){console.error("Could not load mentioned object")}this.limeobject=o.getObject(this.limetype,this.objectid)}}render(){return this.limeobject?this.renderLimeObject(this.limeobject):this.renderSlot()}renderLimeObject(t){return r("a",{href:`object/${this.limetype}/${this.objectid}`},t.descriptive,this.renderSlot({hidden:!0}))}renderSlot(t={}){return r("span",Object.assign({},t),r("slot",null))}};n.style=':host(limebb-mention){display:inline}a{transition:background-color 0.2s ease;white-space:normal;overflow-wrap:break-word;word-break:break-word;padding:0 0.125rem;border-radius:0.25rem;text-decoration:none;color:rgb(var(--color-blue-default));background-color:rgb(var(--color-blue-default), 0.06)}a:hover{background-color:rgb(var(--color-blue-default), 0.16)}a:before,span:before{content:"@";opacity:0.7}';export{n as limebb_mention}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as
|
|
1
|
+
import{r as t,c as i,h as s,g as e}from"./p-d736c794.js";import{c as r}from"./p-3b9766cc.js";import{E as o}from"./p-463d3174.js";import{n as a}from"./p-7c9484b1.js";const h=class{constructor(s){t(this,s),this.change=i(this,"change",7),this.layout="grid",this.handleChangeFilter=t=>{t.stopPropagation(),this.filter=t.detail},this.isIncluded=(t,i)=>this.isSeparator(t)?!(0===i&&!t.text):!this.filter||t.text.toLocaleLowerCase().includes(this.filter.toLocaleLowerCase()),this.isEmptyGroup=(t,i,s)=>{if(!this.isSeparator(t))return!1;const e=s[i+1];return!e||this.isSeparator(e)},this.handleChange=t=>{t.preventDefault(),this.handleItemChange(t.detail)},this.handleKeyDown=t=>{var i;if(t.key!==o)return;const s=null===(i=this.host.shadowRoot)||void 0===i?void 0:i.querySelector("limel-list"),e=this.getItems().filter(a(this.isSeparator));s&&e.length>0&&(s.focus(),this.handleItemChange(e[0]))}}render(){return[s("limel-input-field",{key:"c2b0217009767c5ad1362993e0ca6f5543672ec2",tabIndex:0,value:this.filter,type:"search","leading-icon":"search",placeholder:this.translator.get("webclient.global-search-route"),onChange:this.handleChangeFilter,onKeyDown:this.handleKeyDown}),s("limel-list",{key:"5b39efeb64b3ba67c5efdd9c278795364dfbdbaa",items:this.getItems(),type:"selectable",class:{"has-grid-layout":"grid"===this.layout},onChange:this.handleChange})]}isSeparator(t){return!!t&&"object"==typeof t&&"separator"in t}get navigator(){return this.platform.get(r.Navigator)}get translator(){var t;return null===(t=this.platform)||void 0===t?void 0:t.get(r.Translate)}handleItemChange(t){this.change.emit(t),this.filter=void 0,this.navigator.navigate(t.path)}getItems(){return this.items.filter(this.isIncluded).filter(a(this.isEmptyGroup))}static get delegatesFocus(){return!0}get host(){return e(this)}};h.style=":host(limebb-browser){isolation:isolate;display:flex;flex-direction:column;background-color:rgba(var(--contrast-100))}limel-input-field{position:sticky;top:0;z-index:1;padding:0.5rem 0.75rem;background-color:rgba(var(--contrast-100), 0.75);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem)}";export{h as limebb_browser}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as o,h as r}from"./p-d736c794.js";import{L as t,c as a}from"./p-
|
|
1
|
+
import{r as e,c as o,h as r}from"./p-d736c794.js";import{L as t,c as a}from"./p-3b9766cc.js";const i=class{constructor(r){e(this,r),this.loadMore=o(this,"loadMore",7),this.items=[],this.handleLoadMore=e=>{e.stopPropagation(),this.loadMore.emit(this.identifier)}}render(){return[this.renderHelp(),this.renderGroupHeading(),this.renderGroupSummary(),r("div",{key:"ef4360be090c5c15ab2fc02e9169bf8965386153",class:"items"},this.renderKanbanItems(),this.renderSpinner(),this.renderLoadMore())]}renderGroupSummary(){if(this.summary&&this.totalCount)return[r("limel-markdown",{class:"group-summary",value:this.summary})]}renderGroupHeading(){return r("limel-header",{heading:this.heading},this.renderCounterBadge())}renderHelp(){if(this.help)return r("limel-help",{value:this.help})}renderSpinner(){if(this.loading)return r("limel-spinner",{size:"small"})}renderCounterBadge(){if(this.totalCount)return[r("limel-badge",{slot:"actions",id:"badge-tooltip",label:this.totalCount}),this.renderTooltip()]}renderTooltip(){const e=this.translator.get("webclient.kanban.item-in-group",{count:this.totalCount}),o=this.limetype?this.labelWithLimetype():e;return r("limel-tooltip",{elementId:"badge-tooltip",label:o||"",openDirection:"top"})}labelWithLimetype(){return this.translator.get("webclient.kanban.limetype-item-in-group",{limetype:this.totalCount>1?this.limetype.localname.plural:this.limetype.localname.singular,count:this.totalCount})}renderKanbanItems(){return this.items.map((e=>r("limebb-kanban-item",{tabindex:0,platform:this.platform,context:this.context,item:e,key:e.id})))}renderLoadMore(){if(!(this.loading||this.items.length>=this.totalCount))return r("limel-icon-button",{class:"load-more-button",icon:"more",onClick:this.handleLoadMore,elevated:!0,label:this.translator.get("webclient.load-more")})}get translator(){return this.platform.get(a.Translate)}};(function(e,o,r,t){var a,i=arguments.length,n=i<3?o:null===t?t=Object.getOwnPropertyDescriptor(o,r):t;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,o,r,t);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(n=(i<3?a(n):i>3?a(o,r,n):a(o,r))||n);i>3&&n&&Object.defineProperty(o,r,n)})([t()],i.prototype,"limetype",void 0),i.style='@charset "UTF-8";:host(limebb-feed-timeline-item.is-tall) .markdown-container{margin-bottom:0.5rem}:host(limebb-feed-timeline-item.is-tall) .body-text{--body-text-min-height-set-by-code:10rem;min-height:calc(var(--body-text-min-height-set-by-code) + 0.25rem)}:host(limebb-feed-timeline-item.is-tall) .body-text:after{transition:opacity 0.6s ease;content:"";opacity:0.26;pointer-events:none;position:absolute;bottom:-0.125rem;right:-0.125rem;left:-0.125rem;height:2.5rem;background:radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) 0 100%, linear-gradient(to bottom, rgb(var(--limebb-feed-item-background-color), 0) 0%, rgb(var(--limebb-feed-item-background-color), 90%) 100%);background-repeat:no-repeat;background-size:100% 0.5rem, 100% 100%}:host(limebb-feed-timeline-item.is-tall.shows-less) .markdown-container{grid-template-rows:0fr}:host(limebb-feed-timeline-item.is-tall.shows-less) .body-text:after{opacity:1}:host(limebb-feed-timeline-item.is-tall.shows-more) .markdown-container{grid-template-rows:1fr}:host(limebb-feed-timeline-item.is-tall.shows-more) #show-more-button limel-icon{rotate:180deg}.markdown-container{position:relative;display:grid}.markdown-container:not(.opened){transition:grid-template-rows min(var(--body-text-height) * 1.2ms, 500ms) cubic-bezier(1, 0.09, 0, 0.89)}.body-text{display:block;overflow:hidden}#show-more-button{all:unset;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal);z-index:1;position:absolute;right:0;bottom:-0.6rem;left:0;margin:0 auto;display:flex;align-items:center;justify-content:center;border-radius:3rem;width:2rem;height:1rem}#show-more-button:hover,#show-more-button:focus,#show-more-button:focus-visible{will-change:color, background-color, box-shadow, transform}#show-more-button:hover{transform:translate3d(0, -0.04rem, 0);color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}#show-more-button:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}#show-more-button:hover,#show-more-button:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}#show-more-button:focus{outline:none}#show-more-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}#show-more-button limel-icon{transition:rotate 0.2s ease 0.5s;color:var(--mdc-theme-primary);width:0.75rem}*{box-sizing:border-box}:host(limebb-kanban-group){position:relative;background-color:rgb(var(--limebb-kanban-group-primary-background));--header-top-right-left-border-radius:0.5rem;--limebb-kanban-group-secondary-background:var(--contrast-300);--limebb-kanban-group-primary-background:var(--contrast-600);scroll-snap-align:start;box-sizing:border-box;display:flex;flex-direction:column;border-radius:0.5rem}:host(limebb-kanban-group.secondary){border:1px dashed rgb(var(--contrast-700));background-color:rgb(var(--limebb-kanban-group-secondary-background))}:host(limebb-kanban-group.secondary) limebb-kanban-item{border:1px dashed rgb(var(--contrast-700))}:host(limebb-kanban-group.secondary) limel-header{background-color:rgb(var(--limebb-kanban-group-secondary-background))}limel-header{padding-right:0.5rem;background-color:rgb(var(--limebb-kanban-group-primary-background));width:22rem}limel-header:has(+.items:empty){width:10rem}limel-badge{--badge-background-color:rgb(var(--contrast-200))}limel-help{position:absolute;z-index:1;left:-0.25rem;top:-0.25rem}.group-summary{flex-shrink:0;padding:0 0.75rem 0.5rem 0.75rem;opacity:0.6;max-height:7rem;max-width:22rem;overflow-y:auto}.load-more-button,limel-spinner{align-self:center}.load-more-button{--icon-background-color:var(--lime-elevated-surface-background-color)}.items{--limel-overflow-mask-vertical:linear-gradient(\n to bottom,\n transparent 0%,\n black calc(0% + var(--limel-top-edge-fade-height, 1rem)),\n black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)),\n transparent 100%\n );-webkit-mask-image:var(--limel-overflow-mask-vertical);mask-image:var(--limel-overflow-mask-vertical);padding-top:var(--limel-top-edge-fade-height, 1rem);padding-bottom:var(--limel-bottom-edge-fade-height, 1rem);--limel-top-edge-fade-height:0.5rem;--limel-bottom-edge-fade-height:2rem;flex-grow:1;display:flex;flex-direction:column;gap:0.75rem;padding:var(--limel-top-edge-fade-height) 0.5rem var(--limel-bottom-edge-fade-height) 0.5rem;overflow-y:auto;-webkit-overflow-scrolling:touch}.items:not(:empty){width:22rem}limebb-kanban-item{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color)}limebb-kanban-item:hover,limebb-kanban-item:focus,limebb-kanban-item:focus-visible{will-change:color, background-color, box-shadow, transform}limebb-kanban-item:hover{transform:translate3d(0, 0.01rem, 0);color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}limebb-kanban-item:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}limebb-kanban-item:hover,limebb-kanban-item:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}limebb-kanban-item:focus{outline:none}limebb-kanban-item:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}limebb-kanban-item.is-selected{box-shadow:var(--shadow-focused-state)}limebb-kanban-item.is-selected:hover{box-shadow:var(--shadow-focused-state), var(--button-shadow-hovered)}';export{i as limebb_kanban_group}
|