%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/text-public.mjs.map |
{"version":3,"mappings":";;i/BAWA,MAAMA,EAAgB,SAASC,EAAU,CACxC,MAAMC,EAAK,IAAM,WAAWD,EAAU,CAAC,GACnC,SAAS,YAAc,SAAS,aAAe,WAAa,SAAS,aAAe,WACvFC,EAAI,EAEJ,SAAS,iBAAiB,mBAAoBD,CAAQ,CAExD,ECEME,EAAiC,CACtC,OAAOC,EAAM,CACZ,MAAMC,EAAWD,EAAK,SAChBE,EAAkB,EAAE,OAAQ,QAAQ,EAAI,IAAMC,EAAU,OAAQ,wBAAwB,EAE1FF,EAAS,KAAO,SAAWA,EAAS,KAAO,gBAK/CD,EAAK,aAAa,CACjB,GAAI,sBACJ,YAAa,EAAE,OAAQ,wBAAwB,EAC/C,aAAcE,EACd,UAAW,8BACX,SAAU,OACV,SAAU,GACV,eAAgB,CACf,OAAO,OAAO,SACZ,WAAWA,EAAiB,CAAE,SAAU,GAAO,QAAS,GAAO,EAC/D,KAAK,IAAME,EAAK,0BAA2B,CAAE,UAAW,EAAI,CAAE,CAAC,CACjE,EACD,YAAa,CACZ,MAAO,CAACH,EAAS,SAASC,CAAe,CACzC,CACJ,CAAG,CACD,CACF,EAEMG,EAAuB,CAC5B,GAAI,KAEJ,OAAOJ,EAAU,CACZA,EAAS,KAAO,SAAWA,EAAS,KAAO,iBAG/C,KAAK,GAAK,SAAS,cAAc,KAAK,EACtCA,EAAS,eAAe,CACvB,GAAI,YACJ,GAAI,KAAK,GACT,OAAQ,KAAK,OAAO,KAAK,IAAI,EAC7B,SAAU,EACb,CAAG,EACD,EAED,OAAOA,EAAU,CACZA,EAAS,KAAO,SAAWA,EAAS,KAAO,iBAI/C,GAAG,QAAQ,SAAS,wBAAyBF,CAA8B,QAC3E,OAAO,sCAAK,eAAC,oBAAC,KAAMO,GAAW,CAC9B,MAAMC,EAAMD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CACN,CAAK,EACD,MAAAN,CACJ,CAAI,EACC,OAAOO,CAAG,CAEf,CAAG,EACA,MAAOQ,GAAUC,EAAO,MAAM,0BAA2B,CAAE,MAAAD,CAAK,CAAE,CAAC,CACtE,EAEA9B,EAAc,IAAM,OACnB,MAAMmB,EAAe,SAAS,eAAe,cAAc,EAAI,SAAS,eAAe,cAAc,EAAE,MAAQ,KAE/G,GAAI,CAACA,EACJ,OAMD,GAHmB,SAAS,cAAc,iCAAiC,EAG3D,CACf,GAAG,QAAQ,SAAS,qBAAsBV,CAAoB,EAC9DuB,EAA4B,EAC5BC,EAAoB,EACpB,MACA,CAGD,MAAMb,GAAWc,EAAA,SAAS,eAAe,UAAU,IAAlC,YAAAA,EAAqC,MACtD,GAAId,GAAYe,EAAc,QAAQf,CAAQ,IAAM,GAAI,CACvD,MAAME,EAAM,SAAS,eAAe,SAAS,EACvCD,EAASd,EAAU,OAAQ,SAAS,EAC1CW,EAAW,CAAE,SAAAE,EAAU,aAAAD,EAAc,OAAAE,EAAQ,IAAAC,CAAG,CAAE,CAClD,CACF,CAAC,EAED,IAAI,KAAO,CACV,qBAAsBf,EAAU,OAAQ,qBAAqB,CAC9D","names":["documentReady","callback","fn","newRichWorkspaceFileMenuPlugin","menu","fileList","descriptionFile","loadState","emit","filesWorkspacePlugin","module","Vue","View","RichWorkspace","vm","store","subscribe","data","loadEditor","sharingToken","mimetype","fileId","$el","container","n","__vitePreload","vue","editor","Editor","h","error","logger","registerFileActionFallback","registerFileCreate","_a","openMimetypes"],"ignoreList":[],"sources":["../src/helpers/index.js","../src/public.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n/**\n * Callback that should be executed after the document is ready\n *\n * @param callback\n */\n\nconst documentReady = function(callback) {\n\tconst fn = () => setTimeout(callback, 0)\n\tif (document.attachEvent ? document.readyState === 'complete' : document.readyState !== 'loading') {\n\t\tfn()\n\t} else {\n\t\tdocument.addEventListener('DOMContentLoaded', callback)\n\t}\n}\n\nexport {\n\tdocumentReady,\n}\n","/**\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { loadState } from '@nextcloud/initial-state'\n// eslint-disable-next-line import/no-unresolved, n/no-missing-import\nimport 'vite/modulepreload-polyfill'\n\nimport {\n\tregisterFileActionFallback,\n\tregisterFileCreate,\n} from './helpers/files.js'\nimport { logger } from './helpers/logger.js'\nimport { openMimetypes } from './helpers/mime.js'\nimport { documentReady } from './helpers/index.js'\nimport store from './store/index.js'\nimport { emit, subscribe } from '@nextcloud/event-bus'\nimport RichWorkspace from './views/RichWorkspace.vue'\n\nconst newRichWorkspaceFileMenuPlugin = {\n\tattach(menu) {\n\t\tconst fileList = menu.fileList\n\t\tconst descriptionFile = t('text', 'Readme') + '.' + loadState('text', 'default_file_extension')\n\t\t// only attach to main file list, public view is not supported yet\n\t\tif (fileList.id !== 'files' && fileList.id !== 'files.public') {\n\t\t\treturn\n\t\t}\n\n\t\t// register the new menu entry\n\t\tmenu.addMenuEntry({\n\t\t\tid: 'rich-workspace-init',\n\t\t\tdisplayName: t('text', 'Add folder description'),\n\t\t\ttemplateName: descriptionFile,\n\t\t\ticonClass: 'icon-add-folder-description',\n\t\t\tfileType: 'file',\n\t\t\tuseInput: false,\n\t\t\tactionHandler() {\n\t\t\t\treturn window.FileList\n\t\t\t\t\t.createFile(descriptionFile, { scrollTo: false, animate: false })\n\t\t\t\t\t.then(() => emit('Text::showRichWorkspace', { autofocus: true }))\n\t\t\t},\n\t\t\tshouldShow() {\n\t\t\t\treturn !fileList.findFile(descriptionFile)\n\t\t\t},\n\t\t})\n\t},\n}\n\nconst filesWorkspacePlugin = {\n\tel: null,\n\n\tattach(fileList) {\n\t\tif (fileList.id !== 'files' && fileList.id !== 'files.public') {\n\t\t\treturn\n\t\t}\n\t\tthis.el = document.createElement('div')\n\t\tfileList.registerHeader({\n\t\t\tid: 'workspace',\n\t\t\tel: this.el,\n\t\t\trender: this.render.bind(this),\n\t\t\tpriority: 10,\n\t\t})\n\t},\n\n\trender(fileList) {\n\t\tif (fileList.id !== 'files' && fileList.id !== 'files.public') {\n\t\t\treturn\n\t\t}\n\n\t\tOC.Plugins.register('OCA.Files.NewFileMenu', newRichWorkspaceFileMenuPlugin)\n\t\timport('vue').then((module) => {\n\t\t\tconst Vue = module.default\n\t\t\tthis.el.id = 'files-workspace-wrapper'\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\t\t\tconst View = Vue.extend(RichWorkspace)\n\t\t\tconst vm = new View({\n\t\t\t\tpropsData: {\n\t\t\t\t\tpath: fileList.getCurrentDirectory(),\n\t\t\t\t\thasRichWorkspace: true,\n\t\t\t\t},\n\t\t\t\tstore,\n\t\t\t}).$mount(this.el)\n\t\t\tsubscribe('files:navigation:changed', () => {\n\t\t\t\t// Expose if the default file list is active to the component\n\t\t\t\t// to only render the workspace if the file list is actually visible\n\t\t\t\tvm.active = OCA.Files.App.getCurrentFileList() === fileList\n\t\t\t})\n\t\t\tfileList.$el.on('urlChanged', data => {\n\t\t\t\tvm.path = data.dir.toString()\n\t\t\t})\n\t\t\tfileList.$el.on('changeDirectory', data => {\n\t\t\t\tvm.path = data.dir.toString()\n\t\t\t})\n\t\t})\n\t},\n}\n\nconst loadEditor = ({ sharingToken, mimetype, fileId, $el }) => {\n\tconst container = document.createElement('div')\n\tcontainer.id = 'texteditor'\n\n\tdocument.getElementById('app-content').appendChild(container)\n\n\tPromise.all([\n\t\timport(/* webpackChunkName: \"vendor\" */'vue'),\n\t\timport(/* webpackChunkName: \"editor\" */'./components/Editor.vue'),\n\t])\n\t\t.then(([vue, editor]) => ({\n\t\t\tVue: vue.default,\n\t\t\tEditor: editor.default,\n\t\t}))\n\t\t.then(({ Vue, Editor }) => {\n\t\t\tVue.prototype.t = window.t\n\t\t\tVue.prototype.OCA = window.OCA\n\n\t\t\tnew Vue({\n\t\t\t\trender: h => h(Editor, {\n\t\t\t\t\tprops: {\n\t\t\t\t\t\tactive: true,\n\t\t\t\t\t\tshareToken: sharingToken,\n\t\t\t\t\t\tmime: mimetype,\n\t\t\t\t\t\tfileId,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tstore,\n\t\t\t})\n\t\t\t\t.$mount($el)\n\n\t\t})\n\t\t.catch((error) => logger.error('Failed to attach editor', { error }))\n}\n\ndocumentReady(() => {\n\tconst sharingToken = document.getElementById('sharingToken') ? document.getElementById('sharingToken').value : null\n\n\tif (!sharingToken) {\n\t\treturn\n\t}\n\n\tconst filesTable = document.querySelector('#preview table.files-filestable')\n\n\t// list of files - dir sharing\n\tif (filesTable) {\n\t\tOC.Plugins.register('OCA.Files.FileList', filesWorkspacePlugin)\n\t\tregisterFileActionFallback()\n\t\tregisterFileCreate()\n\t\treturn\n\t}\n\n\t// single file share\n\tconst mimetype = document.getElementById('mimetype')?.value\n\tif (mimetype && openMimetypes.indexOf(mimetype) !== -1) {\n\t\tconst $el = document.getElementById('preview')\n\t\tconst fileId = loadState('text', 'file_id')\n\t\tloadEditor({ mimetype, sharingToken, fileId, $el })\n\t}\n})\n\nOCA.Text = {\n\tRichWorkspaceEnabled: loadState('text', 'workspace_available'),\n}\n"],"file":"js/text-public.mjs"}