%PDF- %PDF-
Direktori : /www/varak.net/nextcloud.varak.net/apps_old/apps/text/js/ |
Current File : //www/varak.net/nextcloud.varak.net/apps_old/apps/text/js/files-x6jyGXY2.chunk.mjs.map |
{"version":3,"mappings":";;goBAAA,MAAeA,EAAA,+ICoBTC,EAAyB,qBAEzBC,EAAqB,IAAM,CAChC,MAAMC,EAAoB,CACzB,OAAOC,EAAM,CACZ,MAAMC,EAAWD,EAAK,SAGlBC,EAAS,KAAO,SAAWA,EAAS,KAAO,gBAK/CD,EAAK,aAAa,CACjB,GAAI,OACJ,YAAa,EAAE,OAAQ,eAAe,EACtC,aAAc,EAAE,OAAQ,eAAe,EAAI,IAAME,EAAU,OAAQ,wBAAwB,EAC3F,UAAW,qBACX,SAAU,OACV,YAAa,EAAE,OAAQ,sBAAsB,EAC7C,cAAcC,EAAM,CACnBF,EAAS,WAAWE,CAAI,EAAE,KAAK,SAASC,EAAQC,EAAM,CACrD,MAAMC,EAAgB,IAAI,IAAI,MAAM,cAAcD,CAAI,EAClD,OAAO,IAAI,OAAW,IACzB,IAAI,MAAM,YAAY,cAAc,OAAQC,EAAeL,CAAQ,EACzD,OAAO,IAAI,OAAW,KAChC,IAAI,MAAM,YAAY,cAAcJ,EAAwBS,EAAeL,CAAQ,CAE1F,CAAM,CACD,CACL,CAAI,CACD,CACD,EACD,GAAG,QAAQ,SAAS,wBAAyBF,CAAiB,CAC/D,EAEMQ,EAA6B,IAAM,CACxC,MAAMC,EAAeC,EAAiB,EAChCC,EAAa,SAAS,cAAc,iCAAiC,EAC3E,GAAI,CAACF,GAAgB,CAACE,EAAY,CACjC,MAAMC,EAAa,SAAS,cAAc,KAAK,EAC/CA,EAAW,GAAK,uBAChB,SAAS,KAAK,YAAYA,CAAU,EACpC,MAAMC,EAAkBC,GAAS,IAAI,MAAM,YAAY,SACtDA,EACAhB,EACA,GAAG,kBAAoB,GAAG,gBAC1BiB,EAAU,OAAQ,gBAAgB,EACjCC,GAAa,CACb,MAAMC,EAAO,O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AA,wBAAAqC,CAAA,eAAO,oCAA8B,EAAC,eAAAA,CAAA,yGAE/E,OAAO,sCAAK,eAAC,oBAAC,KAAMC,GAAW,CAC9BJ,EAAG,GAAK,0BAGR,MAAM9B,EAAMkC,EAAO,QACnBlC,EAAI,UAAU,EAAI,OAAO,EACzBA,EAAI,UAAU,EAAI,OAAO,EACzBA,EAAI,UAAU,IAAM,OAAO,IAE3B,MAAMmC,EAAOnC,EAAI,OAAOiC,CAAa,EACrCR,EAAK,IAAIU,EAAK,CACb,UAAW,CACV,KAAApC,EACA,iBAAAgC,EACA,QAAAlB,CACA,EACD,MAAAuB,CACJ,CAAI,EAAE,OAAON,CAAE,CACf,CAAG,CACD,EAED,QAAQF,EAAQC,EAAM,CACrBvB,EAAsB,GAMtB,MAAMyB,EAAmB,CAAC,CAACH,EAAO,WAAW,qBAAqB,EAClEH,EAAG,KAAOG,EAAO,KACjBH,EAAG,iBAAmBM,EACtBN,EAAG,QAAUG,EAAO,WAAW,gBAAgB,CAC/C,CACF,CAAC","names":["TextSvg","FILE_ACTION_IDENTIFIER","registerFileCreate","newFileMenuPlugin","menu","fileList","loadState","name","status","data","fileInfoModel","registerFileActionFallback","sharingToken","getSharingToken","filesTable","ViewerRoot","registerAction","mime","imagePath","filename","file","__vitePreload","n","imports","path","Vue","Editor","h","self","i","openMimetypes","newWorkspaceCreated","addMenuRichWorkspace","descriptionFile","addNewFileMenuEntry","NewMenuEntryCategory","context","Permission","content","contentNames","node","showError","source","response","axios","fileid","File","getCurrentUser","showSuccess","emit","vm","FilesWorkspaceHeader","Header","folder","view","el","hasRichWorkspace","dirname","RichWorkspace","module","View","store"],"ignoreList":[0],"sources":["../node_modules/@mdi/svg/svg/text.svg?raw","../src/helpers/files.js"],"sourcesContent":["export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" id=\\\"mdi-text\\\" viewBox=\\\"0 0 24 24\\\"><path d=\\\"M21,6V8H3V6H21M3,18H12V16H3V18M3,13H21V11H3V13Z\\\" /></svg>\"","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { showSuccess, showError } from '@nextcloud/dialogs'\nimport { emit } from '@nextcloud/event-bus'\nimport { Header, addNewFileMenuEntry, Permission, File, NewMenuEntryCategory } from '@nextcloud/files'\nimport { loadState } from '@nextcloud/initial-state'\nimport { imagePath } from '@nextcloud/router'\nimport { dirname } from 'path'\n\nimport { getSharingToken } from './token.js'\nimport { openMimetypes } from './mime.js'\nimport store from '../store/index.js'\nimport axios from '@nextcloud/axios'\n\nimport TextSvg from '@mdi/svg/svg/text.svg?raw'\n\nconst FILE_ACTION_IDENTIFIER = 'Edit with text app'\n\nconst registerFileCreate = () => {\n\tconst newFileMenuPlugin = {\n\t\tattach(menu) {\n\t\t\tconst fileList = menu.fileList\n\n\t\t\t// only attach to main file list, public view is not supported yet\n\t\t\tif (fileList.id !== 'files' && fileList.id !== 'files.public') {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// register the new menu entry\n\t\t\tmenu.addMenuEntry({\n\t\t\t\tid: 'file',\n\t\t\t\tdisplayName: t('text', 'New text file'),\n\t\t\t\ttemplateName: t('text', 'New text file') + '.' + loadState('text', 'default_file_extension'),\n\t\t\t\ticonClass: 'icon-filetype-text',\n\t\t\t\tfileType: 'file',\n\t\t\t\tactionLabel: t('text', 'Create new text file'),\n\t\t\t\tactionHandler(name) {\n\t\t\t\t\tfileList.createFile(name).then(function(status, data) {\n\t\t\t\t\t\tconst fileInfoModel = new OCA.Files.FileInfoModel(data)\n\t\t\t\t\t\tif (typeof OCA.Viewer !== 'undefined') {\n\t\t\t\t\t\t\tOCA.Files.fileActions.triggerAction('view', fileInfoModel, fileList)\n\t\t\t\t\t\t} else if (typeof OCA.Viewer === 'undefined') {\n\t\t\t\t\t\t\tOCA.Files.fileActions.triggerAction(FILE_ACTION_IDENTIFIER, fileInfoModel, fileList)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t})\n\t\t},\n\t}\n\tOC.Plugins.register('OCA.Files.NewFileMenu', newFileMenuPlugin)\n}\n\nconst registerFileActionFallback = () => {\n\tconst sharingToken = getSharingToken()\n\tconst filesTable = document.querySelector('#preview table.files-filestable')\n\tif (!sharingToken || !filesTable) {\n\t\tconst ViewerRoot = document.createElement('div')\n\t\tViewerRoot.id = 'text-viewer-fallback'\n\t\tdocument.body.appendChild(ViewerRoot)\n\t\tconst registerAction = (mime) => OCA.Files.fileActions.register(\n\t\t\tmime,\n\t\t\tFILE_ACTION_IDENTIFIER,\n\t\t\tOC.PERMISSION_UPDATE | OC.PERMISSION_READ,\n\t\t\timagePath('core', 'actions/rename'),\n\t\t\t(filename) => {\n\t\t\t\tconst file = window.FileList.findFile(filename)\n\t\t\t\tPromise.all([\n\t\t\t\t\timport('vue'),\n\t\t\t\t\timport(/* webpackChunkName: \"files-modal\" */'./../components/PublicFilesEditor.vue'),\n\t\t\t\t]).then((imports) => {\n\t\t\t\t\tconst path = window.FileList.getCurrentDirectory() + '/' + filename\n\t\t\t\t\tconst Vue = imports[0].default\n\t\t\t\t\tVue.prototype.t = window.t\n\t\t\t\t\tVue.prototype.n = window.n\n\t\t\t\t\tVue.prototype.OCA = window.OCA\n\t\t\t\t\tconst Editor = imports[1].default\n\t\t\t\t\tconst vm = new Vue({\n\t\t\t\t\t\trender: function(h) { // eslint-disable-line\n\t\t\t\t\t\t\tconst self = this\n\t\t\t\t\t\t\treturn h(Editor, {\n\t\t\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t\t\tfileId: file ? file.id : null,\n\t\t\t\t\t\t\t\t\tactive: true,\n\t\t\t\t\t\t\t\t\tshareToken: sharingToken,\n\t\t\t\t\t\t\t\t\trelativePath: path,\n\t\t\t\t\t\t\t\t\tmimeType: file.mimetype,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ton: {\n\t\t\t\t\t\t\t\t\tclose: function() { // eslint-disable-line\n\t\t\t\t\t\t\t\t\t\tself.$destroy()\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t\tvm.$mount(ViewerRoot)\n\t\t\t\t})\n\t\t\t},\n\t\t\tt('text', 'Edit'),\n\t\t)\n\n\t\tfor (let i = 0; i < openMimetypes.length; i++) {\n\t\t\tregisterAction(openMimetypes[i])\n\t\t\tOCA.Files.fileActions.setDefault(openMimetypes[i], FILE_ACTION_IDENTIFIER)\n\t\t}\n\t}\n\n}\n\nlet newWorkspaceCreated = false\n\nexport const addMenuRichWorkspace = () => {\n\tconst descriptionFile = t('text', 'Readme') + '.' + loadState('text', 'default_file_extension')\n\taddNewFileMenuEntry({\n\t\tid: 'rich-workspace-init',\n\t\tdisplayName: t('text', 'Add folder description'),\n\t\tcategory: NewMenuEntryCategory.Other,\n\t\tenabled(context) {\n\t\t\tif (Number(context.attributes['rich-workspace-file'])) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn (context.permissions & Permission.CREATE) !== 0\n\t\t},\n\t\ticonSvgInline: TextSvg,\n\t\tasync handler(context, content) {\n\t\t\tconst contentNames = content.map((node) => node.basename)\n\n\t\t\tif (contentNames.includes(descriptionFile)) {\n\t\t\t\tshowError(t('text', '\"{name}\" already exist!', { name: descriptionFile }))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst source = context.encodedSource + '/' + encodeURIComponent(descriptionFile)\n\t\t\tconst response = await axios({\n\t\t\t\tmethod: 'PUT',\n\t\t\t\turl: source,\n\t\t\t\theaders: {\n\t\t\t\t\tOverwrite: 'F',\n\t\t\t\t},\n\t\t\t})\n\t\t\tconst fileid = parseInt(response.headers['oc-fileid'])\n\t\t\tconst file = new File({\n\t\t\t\tsource: context.source + '/' + descriptionFile,\n\t\t\t\tid: fileid,\n\t\t\t\tmtime: new Date(),\n\t\t\t\tmime: 'text/markdown',\n\t\t\t\towner: getCurrentUser()?.uid || null,\n\t\t\t\tpermissions: Permission.ALL,\n\t\t\t\troot: context?.root || '/files/' + getCurrentUser()?.uid,\n\t\t\t})\n\n\t\t\tshowSuccess(t('text', 'Created \"{name}\"', { name: descriptionFile }))\n\n\t\t\tif (contentNames.length === 0) {\n\t\t\t\t// We currently have no way to reliably trigger the filelist header rendering\n\t\t\t\t// When starting off in a new empty folder the header will only be rendered on a new PROPFIND\n\t\t\t\tnewWorkspaceCreated = file\n\t\t\t}\n\t\t\temit('files:node:created', file)\n\t\t},\n\t})\n}\n\nlet vm = null\n\nexport const FilesWorkspaceHeader = new Header({\n\tid: 'workspace',\n\torder: 10,\n\n\tenabled(folder, view) {\n\t\treturn view.id === 'files' || view.id === 'favorites'\n\t},\n\n\tasync render(el, folder, view) {\n\t\tif (vm) {\n\t\t\t// Enforce destroying of the old rendering and rerender as the FilesListHeader calls render on every folder change\n\t\t\tvm.$destroy()\n\t\t\tvm = null\n\t\t}\n\t\tconst hasRichWorkspace = !!folder.attributes['rich-workspace-file'] || !!newWorkspaceCreated\n\t\tconst path = newWorkspaceCreated ? dirname(newWorkspaceCreated.path) : folder.path\n\t\tconst content = newWorkspaceCreated ? '' : folder.attributes['rich-workspace']\n\n\t\tnewWorkspaceCreated = false\n\n\t\tconst { default: RichWorkspace } = await import('./../views/RichWorkspace.vue')\n\n\t\timport('vue').then((module) => {\n\t\t\tel.id = 'files-workspace-wrapper'\n\n\t\t\t// Todo: remove this hack\n\t\t\tconst Vue = module.default\n\t\t\tVue.prototype.t = window.t\n\t\t\tVue.prototype.n = window.n\n\t\t\tVue.prototype.OCA = window.OCA\n\n\t\t\tconst View = Vue.extend(RichWorkspace)\n\t\t\tvm = new View({\n\t\t\t\tpropsData: {\n\t\t\t\t\tpath,\n\t\t\t\t\thasRichWorkspace,\n\t\t\t\t\tcontent,\n\t\t\t\t},\n\t\t\t\tstore,\n\t\t\t}).$mount(el)\n\t\t})\n\t},\n\n\tupdated(folder, view) {\n\t\tnewWorkspaceCreated = false\n\n\t\t// Currently there is not much use in updating the vue instance props since render is called on every folder change\n\t\t// removing the rendered element from the DOM\n\t\t// This is only relevant if switching to a folder that has no content as then the render function is not called\n\n\t\tconst hasRichWorkspace = !!folder.attributes['rich-workspace-file']\n\t\tvm.path = folder.path\n\t\tvm.hasRichWorkspace = hasRichWorkspace\n\t\tvm.content = folder.attributes['rich-workspace']\n\t},\n})\n\nexport {\n\tregisterFileActionFallback,\n\tregisterFileCreate,\n\tFILE_ACTION_IDENTIFIER,\n}\n"],"file":"js/files-x6jyGXY2.chunk.mjs"}