You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nextcloud-server/dist/comments-init.js

2 lines
7.1 KiB

(()=>{var e,i={39224(e,i,n){"use strict";var t=n(70970),r=n(380),o=n(20005),a=n(53334);class d extends r.m{}const s=Object.freeze({DEFAULT:"default",HIDDEN:"hidden"});r.m,Object.freeze({UploadFromDevice:0,CreateNew:1,Other:2});class c{get#e(){return window.OCA?.Files?._sidebar?.()}get available(){return!!this.#e}get isOpen(){return this.#e?.isOpen??!1}get activeTab(){return this.#e?.activeTab}get node(){return this.#e?.node}open(e,i){this.#e?.open(e,i)}close(){this.#e?.close()}setActiveTab(e){this.#e?.setActiveTab(e)}registerTab(e){!function(e){!function(e){if("object"!=typeof e)throw new Error("Sidebar tab is not an object");if(!e.id||"string"!=typeof e.id||e.id!==CSS.escape(e.id))throw new Error("Sidebar tabs need to have an id conforming to the HTML id attribute specifications");if(!e.tagName||"string"!=typeof e.tagName)throw new Error("Sidebar tabs need to have the tagName name set");if(!e.tagName.match(/^[a-z][a-z0-9-_]+$/))throw new Error('Sidebar tab "tagName" is invalid');if(!e.displayName||"string"!=typeof e.displayName)throw new Error("Sidebar tabs need to have a name set");if("string"!=typeof e.iconSvgInline||!(0,o.A)(e.iconSvgInline))throw new Error("Sidebar tabs need to have an valid SVG icon");if("number"!=typeof e.order)throw new Error("Sidebar tabs need to have a numeric order set");if(e.enabled&&"function"!=typeof e.enabled)throw new Error('Sidebar tab "enabled" is not a function');if(e.onInit&&"function"!=typeof e.onInit)throw new Error('Sidebar tab "onInit" is not a function')}(e),t.s.filesSidebarTabs??=new Map,t.s.filesSidebarTabs.has(e.id)?t.l.warn(`Sidebar tab with id "${e.id}" already registered. Skipping.`):(t.s.filesSidebarTabs.set(e.id,e),t.l.debug(`New sidebar tab with id "${e.id}" registered.`))}(e)}getTabs(e){return this.#e?.getTabs(e)??[]}getActions(e){return this.#e?.getActions(e)??[]}registerAction(e){!function(e){!function(e){if("object"!=typeof e)throw new Error("Sidebar action is not an object");if(!e.id||"string"!=typeof e.id||e.id!==CSS.escape(e.id))throw new Error("Sidebar actions need to have an id conforming to the HTML id attribute specifications");if(!e.displayName||"function"!=typeof e.displayName)throw new Error("Sidebar actions need to have a displayName function");if(!e.iconSvgInline||"function"!=typeof e.iconSvgInline)throw new Error("Sidebar actions need to have a iconSvgInline function");if(!e.enabled||"function"!=typeof e.enabled)throw new Error("Sidebar actions need to have an enabled function");if(!e.onClick||"function"!=typeof e.onClick)throw new Error("Sidebar actions need to have an onClick function")}(e),t.s.filesSidebarActions??=new Map,t.s.filesSidebarActions.has(e.id)?t.l.warn(`Sidebar action with id "${e.id}" already registered. Skipping.`):(t.s.filesSidebarActions.set(e.id,e),t.l.debug(`New sidebar action with id "${e.id}" registered.`))}(e)}}Object.freeze({ReservedName:"reserved name",Character:"character",Extension:"extension"}),Error,Object.freeze({Name:"basename",Modified:"mtime",Size:"size"});const l=(0,n(35947).YK)().setApp("comments").detectUser().build();var f;(function(e){if(!e.id||"string"!=typeof e.id)throw new Error("Invalid id");if(!e.displayName||"function"!=typeof e.displayName)throw new Error("Invalid displayName function");if("title"in e&&"function"!=typeof e.title)throw new Error("Invalid title function");if(!e.iconSvgInline||"function"!=typeof e.iconSvgInline)throw new Error("Invalid iconSvgInline function");if(!e.exec||"function"!=typeof e.exec)throw new Error("Invalid exec function");if("enabled"in e&&"function"!=typeof e.enabled)throw new Error("Invalid enabled function");if("execBatch"in e&&"function"!=typeof e.execBatch)throw new Error("Invalid execBatch function");if("order"in e&&"number"!=typeof e.order)throw new Error("Invalid order");if(void 0!==e.destructive&&"boolean"!=typeof e.destructive)throw new Error("Invalid destructive flag");if("parent"in e&&"string"!=typeof e.parent)throw new Error("Invalid parent");if(e.default&&!Object.values(s).includes(e.default))throw new Error("Invalid default");if("inline"in e&&"function"!=typeof e.inline)throw new Error("Invalid inline function");if("renderInline"in e&&"function"!=typeof e.renderInline)throw new Error("Invalid renderInline function");if("hotkey"in e&&void 0!==e.hotkey){if("object"!=typeof e.hotkey)throw new Error("Invalid hotkey configuration");if("string"!=typeof e.hotkey.key||!e.hotkey.key)throw new Error("Missing or invalid hotkey key");if("string"!=typeof e.hotkey.description||!e.hotkey.description)throw new Error("Missing or invalid hotkey description")}})(f={id:"comments-unread",title({nodes:e}){const i=e[0]?.attributes["comments-unread"];return"number"==typeof i&&i>=0?(0,a.n)("comments","1 new comment","{unread} new comments",i,{unread:i}):(0,a.t)("comments","Comment")},displayName:()=>"",iconSvgInline:()=>'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-comment-processing" viewBox="0 0 24 24"><path d="M9,22A1,1 0 0,1 8,21V18H4A2,2 0 0,1 2,16V4C2,2.89 2.9,2 4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H13.9L10.2,21.71C10,21.9 9.75,22 9.5,22V22H9M17,11V9H15V11H17M13,11V9H11V11H13M9,11V9H7V11H9Z" /></svg>',enabled({nodes:e}){const i=e[0]?.attributes?.["comments-unread"];return"number"==typeof i&&i>0},async exec({nodes:e}){if(1!==e.length||!e[0])return!1;try{return(new c).open(e[0],"comments"),null}catch(e){return l.error("Error while opening sidebar",{error:e}),!1}},inline:()=>!0,order:-140}),t.s.fileActions??=new Map,t.s.fileActions.has(f.id)?t.l.error(`FileAction ${f.id} already registered`,{action:f}):(t.s.fileActions.set(f.id,f),(t.s.registry??=new d,t.s.registry).dispatchTypedEvent("register:action",new CustomEvent("register:action",{detail:f})))},63779(){},77199(){}},n={};function t(e){var r=n[e];if(void 0!==r)return r.exports;var o=n[e]={id:e,loaded:!1,exports:{}};return i[e].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}t.m=i,e=[],t.O=(i,n,r,o)=>{if(!n){var a=1/0;for(l=0;l<e.length;l++){for(var[n,r,o]=e[l],d=!0,s=0;s<n.length;s++)(!1&o||a>=o)&&Object.keys(t.O).every(e=>t.O[e](n[s]))?n.splice(s--,1):(d=!1,o<a&&(a=o));if(d){e.splice(l--,1);var c=r();void 0!==c&&(i=c)}}return i}o=o||0;for(var l=e.length;l>0&&e[l-1][2]>o;l--)e[l]=e[l-1];e[l]=[n,r,o]},t.n=e=>{var i=e&&e.__esModule?()=>e.default:()=>e;return t.d(i,{a:i}),i},t.d=(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},t.e=()=>Promise.resolve(),t.o=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),t.j=3260,(()=>{t.b="undefined"!=typeof document&&document.baseURI||self.location.href;var e={3260:0};t.O.j=i=>0===e[i];var i=(i,n)=>{var r,o,[a,d,s]=n,c=0;if(a.some(i=>0!==e[i])){for(r in d)t.o(d,r)&&(t.m[r]=d[r]);if(s)var l=s(t)}for(i&&i(n);c<a.length;c++)o=a[c],t.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return t.O(l)},n=globalThis.webpackChunknextcloud_ui_legacy=globalThis.webpackChunknextcloud_ui_legacy||[];n.forEach(i.bind(null,0)),n.push=i.bind(null,n.push.bind(n))})(),t.nc=void 0;var r=t.O(void 0,[4208],()=>t(39224));r=t.O(r)})();
//# sourceMappingURL=comments-init.js.map?v=da479ee90ffe31b08a10