@nextcloud/files 3.0.0-beta.2 → 3.0.0-beta.21

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/dist/index.js DELETED
@@ -1,233 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var l10n = require('@nextcloud/l10n');
6
- var auth = require('@nextcloud/auth');
7
- var logger$1 = require('@nextcloud/logger');
8
-
9
- /**
10
- * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
11
- *
12
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
13
- * @author John Molakvoæ <skjnldsv@protonmail.com>
14
- *
15
- * @license AGPL-3.0-or-later
16
- *
17
- * This program is free software: you can redistribute it and/or modify
18
- * it under the terms of the GNU Affero General Public License as
19
- * published by the Free Software Foundation, either version 3 of the
20
- * License, or (at your option) any later version.
21
- *
22
- * This program is distributed in the hope that it will be useful,
23
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
- * GNU Affero General Public License for more details.
26
- *
27
- * You should have received a copy of the GNU Affero General Public License
28
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
29
- *
30
- */
31
- var humanList = ['B', 'KB', 'MB', 'GB', 'TB'];
32
- /**
33
- * Format a file size in a human-like format. e.g. 42GB
34
- *
35
- * @param size in bytes
36
- * @param skipSmallSizes avoid rendering tiny sizes and return '< 1 KB' instead
37
- */
38
- function formatFileSize(size, skipSmallSizes) {
39
- if (skipSmallSizes === void 0) { skipSmallSizes = false; }
40
- if (typeof size === 'string') {
41
- size = Number(size);
42
- }
43
- // Calculate Log with base 1024: size = 1024 ** order
44
- var order = size > 0 ? Math.floor(Math.log(size) / Math.log(1024)) : 0;
45
- // Stay in range of the byte sizes that are defined
46
- order = Math.min(humanList.length - 1, order);
47
- var readableFormat = humanList[order];
48
- var relativeSize = (size / Math.pow(1024, order)).toFixed(1);
49
- if (skipSmallSizes === true && order === 0) {
50
- if (relativeSize !== '0.0') {
51
- return '< 1 KB';
52
- }
53
- else {
54
- return '0 KB';
55
- }
56
- }
57
- if (order < 2) {
58
- relativeSize = parseFloat(relativeSize).toFixed(0);
59
- }
60
- else {
61
- relativeSize = parseFloat(relativeSize).toLocaleString(l10n.getCanonicalLocale());
62
- }
63
- return relativeSize + ' ' + readableFormat;
64
- }
65
-
66
- /**
67
- * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
68
- *
69
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
70
- *
71
- * @license AGPL-3.0-or-later
72
- *
73
- * This program is free software: you can redistribute it and/or modify
74
- * it under the terms of the GNU Affero General Public License as
75
- * published by the Free Software Foundation, either version 3 of the
76
- * License, or (at your option) any later version.
77
- *
78
- * This program is distributed in the hope that it will be useful,
79
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
80
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
81
- * GNU Affero General Public License for more details.
82
- *
83
- * You should have received a copy of the GNU Affero General Public License
84
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
85
- *
86
- */
87
- var getLogger = function (user) {
88
- if (user === null) {
89
- return logger$1.getLoggerBuilder()
90
- .setApp('files')
91
- .build();
92
- }
93
- return logger$1.getLoggerBuilder()
94
- .setApp('files')
95
- .setUid(user.uid)
96
- .build();
97
- };
98
- var logger = getLogger(auth.getCurrentUser());
99
-
100
- /**
101
- * @copyright Copyright (c) 2021 John Molakvoæ <skjnldsv@protonmail.com>
102
- *
103
- * @author John Molakvoæ <skjnldsv@protonmail.com>
104
- *
105
- * @license AGPL-3.0-or-later
106
- *
107
- * This program is free software: you can redistribute it and/or modify
108
- * it under the terms of the GNU Affero General Public License as
109
- * published by the Free Software Foundation, either version 3 of the
110
- * License, or (at your option) any later version.
111
- *
112
- * This program is distributed in the hope that it will be useful,
113
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
114
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
115
- * GNU Affero General Public License for more details.
116
- *
117
- * You should have received a copy of the GNU Affero General Public License
118
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
119
- *
120
- */
121
- var NewFileMenu = /** @class */ (function () {
122
- function NewFileMenu() {
123
- this._entries = [];
124
- }
125
- NewFileMenu.prototype.registerEntry = function (entry) {
126
- this.validateEntry(entry);
127
- this._entries.push(entry);
128
- };
129
- NewFileMenu.prototype.unregisterEntry = function (entry) {
130
- var entryIndex = typeof entry === 'string'
131
- ? this.getEntryIndex(entry)
132
- : this.getEntryIndex(entry.id);
133
- if (entryIndex === -1) {
134
- logger.warn('Entry not found, nothing removed', { entry: entry, entries: this.getEntries() });
135
- return;
136
- }
137
- this._entries.splice(entryIndex, 1);
138
- };
139
- /**
140
- * Get the list of registered entries
141
- *
142
- * @param {FileInfo} context the creation context. Usually the current folder FileInfo
143
- */
144
- NewFileMenu.prototype.getEntries = function (context) {
145
- if (context) {
146
- return this._entries
147
- .filter(function (entry) { return typeof entry.if === 'function' ? entry.if(context) : true; });
148
- }
149
- return this._entries;
150
- };
151
- NewFileMenu.prototype.getEntryIndex = function (id) {
152
- return this._entries.findIndex(function (entry) { return entry.id === id; });
153
- };
154
- NewFileMenu.prototype.validateEntry = function (entry) {
155
- if (!entry.id || !entry.displayName || !entry.templateName || !(entry.iconSvgInline || entry.iconClass) || !entry.handler) {
156
- throw new Error('Invalid entry');
157
- }
158
- if (typeof entry.id !== 'string'
159
- || typeof entry.displayName !== 'string'
160
- || typeof entry.templateName !== 'string'
161
- || (entry.iconClass && typeof entry.iconClass !== 'string')
162
- || (entry.iconSvgInline && typeof entry.iconSvgInline !== 'string')) {
163
- throw new Error('Invalid entry property');
164
- }
165
- if (entry.if !== undefined && typeof entry.if !== 'function') {
166
- throw new Error('Invalid entry, if must be a valid function');
167
- }
168
- if (typeof entry.handler !== 'function') {
169
- throw new Error('Invalid entry handler');
170
- }
171
- if (this.getEntryIndex(entry.id) !== -1) {
172
- throw new Error('Duplicate entry');
173
- }
174
- };
175
- return NewFileMenu;
176
- }());
177
- var getNewFileMenu = function () {
178
- if (typeof window._nc_newfilemenu === 'undefined') {
179
- window._nc_newfilemenu = new NewFileMenu();
180
- logger.debug('NewFileMenu initialized');
181
- }
182
- return window._nc_newfilemenu;
183
- };
184
-
185
- /**
186
- * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
187
- *
188
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
189
- * @author John Molakvoæ <skjnldsv@protonmail.com>
190
- *
191
- * @license AGPL-3.0-or-later
192
- *
193
- * This program is free software: you can redistribute it and/or modify
194
- * it under the terms of the GNU Affero General Public License as
195
- * published by the Free Software Foundation, either version 3 of the
196
- * License, or (at your option) any later version.
197
- *
198
- * This program is distributed in the hope that it will be useful,
199
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
200
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
201
- * GNU Affero General Public License for more details.
202
- *
203
- * You should have received a copy of the GNU Affero General Public License
204
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
205
- *
206
- */
207
- /**
208
- * Add a new menu entry to the upload manager menu
209
- */
210
- var addNewFileMenuEntry = function (entry) {
211
- var newFileMenu = getNewFileMenu();
212
- return newFileMenu.registerEntry(entry);
213
- };
214
- /**
215
- * Remove a previously registered entry from the upload menu
216
- */
217
- var removeNewFileMenuEntry = function (entry) {
218
- var newFileMenu = getNewFileMenu();
219
- return newFileMenu.unregisterEntry(entry);
220
- };
221
- /**
222
- * Get the list of registered entries from the upload menu
223
- */
224
- var getNewFileMenuEntries = function () {
225
- var newFileMenu = getNewFileMenu();
226
- return newFileMenu.getEntries();
227
- };
228
-
229
- exports.addNewFileMenuEntry = addNewFileMenuEntry;
230
- exports.formatFileSize = formatFileSize;
231
- exports.getNewFileMenuEntries = getNewFileMenuEntries;
232
- exports.removeNewFileMenuEntry = removeNewFileMenuEntry;
233
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../lib/humanfilesize.ts","../lib/utils/logger.ts","../lib/newFileMenu.ts","../lib/index.ts"],"sourcesContent":["/**\n * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>\n *\n * @author Christoph Wurst <christoph@winzerhof-wurst.at>\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { getCanonicalLocale } from '@nextcloud/l10n'\n\nconst humanList = ['B', 'KB', 'MB', 'GB', 'TB'];\n\n/**\n * Format a file size in a human-like format. e.g. 42GB\n *\n * @param size in bytes\n * @param skipSmallSizes avoid rendering tiny sizes and return '< 1 KB' instead\n */\nexport function formatFileSize(size: number|string, skipSmallSizes: boolean = false): string {\n\n\tif (typeof size === 'string') {\n\t\tsize = Number(size)\n\t}\n\n\t// Calculate Log with base 1024: size = 1024 ** order\n\tlet order = size > 0 ? Math.floor(Math.log(size) / Math.log(1024)) : 0;\n\t// Stay in range of the byte sizes that are defined\n\torder = Math.min(humanList.length - 1, order);\n\tconst readableFormat = humanList[order];\n\tlet relativeSize = (size / Math.pow(1024, order)).toFixed(1);\n\n\tif (skipSmallSizes === true && order === 0) {\n\t\tif (relativeSize !== '0.0') {\n\t\t\treturn '< 1 KB';\n\t\t} else {\n\t\t\treturn '0 KB';\n\t\t}\n\t}\n\n\tif (order < 2) {\n\t\trelativeSize = parseFloat(relativeSize).toFixed(0);\n\t} else {\n\t\trelativeSize = parseFloat(relativeSize).toLocaleString(getCanonicalLocale());\n\t}\n\n\treturn relativeSize + ' ' + readableFormat;\n}\n","/**\n * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>\n *\n * @author Christoph Wurst <christoph@winzerhof-wurst.at>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { getLoggerBuilder } from '@nextcloud/logger'\n\nconst getLogger = user => {\n\tif (user === null) {\n\t\treturn getLoggerBuilder()\n\t\t\t.setApp('files')\n\t\t\t.build()\n\t}\n\treturn getLoggerBuilder()\n\t\t.setApp('files')\n\t\t.setUid(user.uid)\n\t\t.build()\n}\n\nexport default getLogger(getCurrentUser())\n","/**\n * @copyright Copyright (c) 2021 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport logger from \"./utils/logger\"\n\nexport interface Entry {\n\t/** Unique ID */\n\tid: string\n\t/** Translatable string displayed in the menu */\n\tdisplayName: string\n\t// Default new file name\n\ttemplateName: string\n\t// Condition wether this entry is shown or not\n\tif?: (context: Object) => Boolean\n\t/**\n\t * Either iconSvgInline or iconClass must be defined\n\t * Svg as inline string. <svg><path fill=\"...\" /></svg>\n\t */\n\ticonSvgInline?: string\n\t/** Existing icon css class */\n\ticonClass?: string\n\t/** Function to be run after creation */\n\thandler?: Function\n}\n\nexport class NewFileMenu {\n\tprivate _entries: Array<Entry> = []\n\t\n\tpublic registerEntry(entry: Entry) {\n\t\tthis.validateEntry(entry)\n\t\tthis._entries.push(entry)\n\t}\n\n\tpublic unregisterEntry(entry: Entry | string) {\n\t\tconst entryIndex = typeof entry === 'string'\n\t\t\t? this.getEntryIndex(entry)\n\t\t\t: this.getEntryIndex(entry.id)\n\t\t\n\t\tif (entryIndex === -1) {\n\t\t\tlogger.warn('Entry not found, nothing removed', { entry , entries: this.getEntries() })\n\t\t\treturn\n\t\t}\n\n\t\tthis._entries.splice(entryIndex, 1)\n\t}\n\t\n\t/**\n\t * Get the list of registered entries\n\t * \n\t * @param {FileInfo} context the creation context. Usually the current folder FileInfo\n\t */\n\tpublic getEntries(context?: Object): Array<Entry> {\n\t\tif (context) {\n\t\t\treturn this._entries\n\t\t\t\t.filter(entry => typeof entry.if === 'function' ? entry.if(context) : true)\n\t\t}\n\t\treturn this._entries\n\t}\n\n\tprivate getEntryIndex(id: string): number {\n\t\treturn this._entries.findIndex(entry => entry.id === id)\n\t}\n\n\tprivate validateEntry(entry: Entry) {\n\t\tif (!entry.id || !entry.displayName || !entry.templateName || !(entry.iconSvgInline || entry.iconClass) ||!entry.handler) {\n\t\t\tthrow new Error('Invalid entry')\n\t\t}\n\n\t\tif (typeof entry.id !== 'string'\n\t\t\t|| typeof entry.displayName !== 'string'\n\t\t\t|| typeof entry.templateName !== 'string'\n\t\t\t|| (entry.iconClass && typeof entry.iconClass !== 'string')\n\t\t\t|| (entry.iconSvgInline && typeof entry.iconSvgInline !== 'string')) {\n\t\t\tthrow new Error('Invalid entry property')\n\t\t}\n\n\t\tif (entry.if !== undefined && typeof entry.if !== 'function') {\n\t\t\tthrow new Error('Invalid entry, if must be a valid function')\n\t\t}\n\n\t\tif (typeof entry.handler !== 'function') {\n\t\t\tthrow new Error('Invalid entry handler')\n\t\t}\n\n\t\tif (this.getEntryIndex(entry.id) !== -1) {\n\t\t\tthrow new Error('Duplicate entry')\n\t\t}\n\t}\n}\n\nexport const getNewFileMenu = function(): NewFileMenu {\n\tif (typeof window._nc_newfilemenu === 'undefined') {\n\t\twindow._nc_newfilemenu = new NewFileMenu()\n\t\tlogger.debug('NewFileMenu initialized')\n\t}\n\treturn window._nc_newfilemenu\n}","/**\n * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>\n *\n * @author Christoph Wurst <christoph@winzerhof-wurst.at>\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nexport { formatFileSize } from './humanfilesize'\nexport { type Entry } from './newFileMenu'\nimport { type Entry, getNewFileMenu, NewFileMenu } from './newFileMenu'\n\ndeclare global {\n\tinterface Window {\n\t\tOC: any;\n\t\t_nc_newfilemenu: NewFileMenu;\n\t}\n}\n\n/**\n * Add a new menu entry to the upload manager menu\n */\nexport const addNewFileMenuEntry = function(entry: Entry) {\n\tconst newFileMenu = getNewFileMenu()\n\treturn newFileMenu.registerEntry(entry)\n}\n\n/**\n * Remove a previously registered entry from the upload menu\n */\nexport const removeNewFileMenuEntry = function(entry: Entry | string) {\n\tconst newFileMenu = getNewFileMenu()\n\treturn newFileMenu.unregisterEntry(entry)\n}\n\n/**\n * Get the list of registered entries from the upload menu\n */\nexport const getNewFileMenuEntries = function() {\n\tconst newFileMenu = getNewFileMenu()\n\treturn newFileMenu.getEntries()\n}\n"],"names":["getCanonicalLocale","getLoggerBuilder","getCurrentUser"],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;AAqBG;AAIH,IAAM,SAAS,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAEhD;;;;;AAKG;AACa,SAAA,cAAc,CAAC,IAAmB,EAAE,cAA+B,EAAA;AAA/B,IAAA,IAAA,cAAA,KAAA,KAAA,CAAA,EAAA,EAAA,cAA+B,GAAA,KAAA,CAAA,EAAA;AAElF,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC7B,QAAA,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;AACnB,KAAA;;AAGD,IAAA,IAAI,KAAK,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;;AAEvE,IAAA,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;AAC9C,IAAA,IAAM,cAAc,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;AACxC,IAAA,IAAI,YAAY,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AAE7D,IAAA,IAAI,cAAc,KAAK,IAAI,IAAI,KAAK,KAAK,CAAC,EAAE;QAC3C,IAAI,YAAY,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