1 | {"version":3,"sources":["index.js"],"names":["require","Plugin","Provider","ProviderViews","h","module","exports","uppy","opts","id","initPlugin","title","icon","provider","companionUrl","companionHeaders","serverHeaders","pluginId","onFirstRender","bind","render","install","view","target","mount","uninstall","tearDown","unmount","getFolder","state","VERSION"],"mappings":";;;;;;eAAmBA,OAAO,CAAC,YAAD,C;IAAlBC,M,YAAAA,M;;gBACaD,OAAO,CAAC,wBAAD,C;IAApBE,Q,aAAAA,Q;;gBACkBF,OAAO,CAAC,sBAAD,C;IAAzBG,a,aAAAA,a;;gBACMH,OAAO,CAAC,QAAD,C;IAAbI,C,aAAAA,C;;AAERC,MAAM,CAACC,OAAP;AAAA;;AAGE,oBAAaC,IAAb,EAAmBC,IAAnB,EAAyB;AAAA;;AACvB,+BAAMD,IAAN,EAAYC,IAAZ;AACA,UAAKC,EAAL,GAAU,MAAKD,IAAL,CAAUC,EAAV,IAAgB,UAA1B;AACAP,IAAAA,QAAQ,CAACQ,UAAT,gCAA0BF,IAA1B;AACA,UAAKG,KAAL,GAAa,MAAKH,IAAL,CAAUG,KAAV,IAAmB,UAAhC;;AACA,UAAKC,IAAL,GAAY;AAAA,aACV;AAAK,uBAAY,MAAjB;AAAwB,QAAA,SAAS,EAAC,OAAlC;AAA0C,QAAA,KAAK,EAAC,IAAhD;AAAqD,QAAA,MAAM,EAAC,IAA5D;AAAiE,QAAA,OAAO,EAAC;AAAzE,SACE;AAAG,QAAA,IAAI,EAAC,MAAR;AAAe,qBAAU;AAAzB,SACE;AAAM,QAAA,KAAK,EAAC,IAAZ;AAAiB,QAAA,MAAM,EAAC,IAAxB;AAA6B,QAAA,EAAE,EAAC,IAAhC;AAAqC,QAAA,IAAI,EAAC;AAA1C,QADF,EAEE;AAAG,QAAA,IAAI,EAAC,MAAR;AAAe,qBAAU;AAAzB,SACE;AAAM,QAAA,CAAC,EAAC;AAAR,QADF,EAEE;AAAM,QAAA,CAAC,EAAC;AAAR,QAFF,CAFF,CADF,CADU;AAAA,KAAZ;;AAYA,UAAKC,QAAL,GAAgB,IAAIX,QAAJ,CAAaK,IAAb,EAAmB;AACjCO,MAAAA,YAAY,EAAE,MAAKN,IAAL,CAAUM,YADS;AAEjCC,MAAAA,gBAAgB,EAAE,MAAKP,IAAL,CAAUO,gBAAV,IAA8B,MAAKP,IAAL,CAAUQ,aAFzB;AAGjCH,MAAAA,QAAQ,EAAE,UAHuB;AAIjCI,MAAAA,QAAQ,EAAE,MAAKR;AAJkB,KAAnB,CAAhB;AAOA,UAAKS,aAAL,GAAqB,MAAKA,aAAL,CAAmBC,IAAnB,+BAArB;AACA,UAAKC,MAAL,GAAc,MAAKA,MAAL,CAAYD,IAAZ,+BAAd;AAzBuB;AA0BxB;;AA7BH;;AAAA,SA+BEE,OA/BF,GA+BE,mBAAW;AACT,SAAKC,IAAL,GAAY,IAAInB,aAAJ,CAAkB,IAAlB,EAAwB;AAClCU,MAAAA,QAAQ,EAAE,KAAKA;AADmB,KAAxB,CAAZ;AAIA,QAAMU,MAAM,GAAG,KAAKf,IAAL,CAAUe,MAAzB;;AACA,QAAIA,MAAJ,EAAY;AACV,WAAKC,KAAL,CAAWD,MAAX,EAAmB,IAAnB;AACD;AACF,GAxCH;;AAAA,SA0CEE,SA1CF,GA0CE,qBAAa;AACX,SAAKH,IAAL,CAAUI,QAAV;AACA,SAAKC,OAAL;AACD,GA7CH;;AAAA,SA+CET,aA/CF,GA+CE,yBAAiB;AACf,WAAO,KAAKI,IAAL,CAAUM,SAAV,EAAP;AACD,GAjDH;;AAAA,SAmDER,MAnDF,GAmDE,gBAAQS,KAAR,EAAe;AACb,WAAO,KAAKP,IAAL,CAAUF,MAAV,CAAiBS,KAAjB,CAAP;AACD,GArDH;;AAAA;AAAA,EAAwC5B,MAAxC,UACS6B,OADT","sourcesContent":["const { Plugin } = require('@uppy/core')\nconst { Provider } = require('@uppy/companion-client')\nconst { ProviderViews } = require('@uppy/provider-views')\nconst { h } = require('preact')\n\nmodule.exports = class OneDrive extends Plugin {\n static VERSION = require('../package.json').version\n\n constructor (uppy, opts) {\n super(uppy, opts)\n this.id = this.opts.id || 'OneDrive'\n Provider.initPlugin(this, opts)\n this.title = this.opts.title || 'OneDrive'\n this.icon = () => (\n <svg aria-hidden=\"true\" focusable=\"false\" width=\"32\" height=\"32\" viewBox=\"0 0 32 32\">\n <g fill=\"none\" fill-rule=\"evenodd\">\n <rect width=\"32\" height=\"32\" rx=\"16\" fill=\"#0262C0\" />\n <g fill=\"#FFF\" fill-rule=\"nonzero\">\n <path d=\"M24.157 22s1.492-.205 1.79-1.655a2.624 2.624 0 0 0 .03-.878c-.22-1.64-1.988-2.01-1.988-2.01s.307-1.765-1.312-2.69c-1.62-.925-3.1 0-3.1 0S18.711 13 16.366 13c-3.016 0-3.519 3.448-3.519 3.448S10 16.618 10 19.14c0 2.523 2.597 2.86 2.597 2.86h11.56z\" />\n <path d=\"M9.421 19.246c0-2.197 1.606-3.159 2.871-3.472.44-1.477 1.654-3.439 4.135-3.439H16.445c1.721 0 2.79.823 3.368 1.476a3.99 3.99 0 0 1 1.147-.171h.01l.03.002C21.017 13.5 20.691 10 16.757 10c-2.69 0-3.639 2.345-3.639 2.345s-1.95-1.482-3.955.567c-1.028 1.052-.79 2.669-.79 2.669S6 15.824 6 18.412C6 20.757 8.452 21 8.452 21h1.372a3.77 3.77 0 0 1-.403-1.754z\" />\n </g>\n </g>\n </svg>\n )\n\n this.provider = new Provider(uppy, {\n companionUrl: this.opts.companionUrl,\n companionHeaders: this.opts.companionHeaders || this.opts.serverHeaders,\n provider: 'onedrive',\n pluginId: this.id\n })\n\n this.onFirstRender = this.onFirstRender.bind(this)\n this.render = this.render.bind(this)\n }\n\n install () {\n this.view = new ProviderViews(this, {\n provider: this.provider\n })\n\n const target = this.opts.target\n if (target) {\n this.mount(target, this)\n }\n }\n\n uninstall () {\n this.view.tearDown()\n this.unmount()\n }\n\n onFirstRender () {\n return this.view.getFolder()\n }\n\n render (state) {\n return this.view.render(state)\n }\n}\n"]} |