@webiny/app-admin 5.31.0-beta.1 → 5.32.0
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/base/Base.js +26 -4
- package/base/Base.js.map +1 -1
- package/components/FileManager/getFileTypePlugin.js +29 -22
- package/components/FileManager/getFileTypePlugin.js.map +1 -1
- package/index.d.ts +2 -0
- package/index.js +28 -0
- package/index.js.map +1 -1
- package/package.json +15 -15
- package/plugins/fileManager/fileDefault.d.ts +1 -2
- package/plugins/fileManager/fileDefault.js +3 -5
- package/plugins/fileManager/fileDefault.js.map +1 -1
- package/plugins/fileManager/fileImage/index.d.ts +1 -2
- package/plugins/fileManager/fileImage/index.js +3 -5
- package/plugins/fileManager/fileImage/index.js.map +1 -1
- package/plugins/fileManager/index.d.ts +2 -2
- package/plugins/fileManager/index.js +14 -8
- package/plugins/fileManager/index.js.map +1 -1
- package/plugins/uiLayoutRenderer/index.d.ts +1 -2
- package/plugins/uiLayoutRenderer/index.js +3 -4
- package/plugins/uiLayoutRenderer/index.js.map +1 -1
- package/types.d.ts +1 -1
- package/types.js.map +1 -1
- package/ui/elements/form/FileManagerElement/styled.d.ts +3 -3
- package/plugins/index.d.ts +0 -9
- package/plugins/index.js +0 -20
- package/plugins/index.js.map +0 -1
package/base/Base.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
6
4
|
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
10
|
exports.Base = void 0;
|
|
11
11
|
|
|
12
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
+
|
|
12
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
15
|
|
|
14
16
|
var _appAdminCore = require("@webiny/app-admin-core");
|
|
@@ -29,11 +31,31 @@ var _roundSettings24px = require("../assets/icons/round-settings-24px.svg");
|
|
|
29
31
|
|
|
30
32
|
var _components = require("../components");
|
|
31
33
|
|
|
32
|
-
var
|
|
34
|
+
var _fileManager = require("../plugins/fileManager");
|
|
35
|
+
|
|
36
|
+
var _globalSearch = require("../plugins/globalSearch");
|
|
37
|
+
|
|
38
|
+
var _uiLayoutRenderer = require("../plugins/uiLayoutRenderer");
|
|
39
|
+
|
|
40
|
+
function registerFileTypePlugins() {
|
|
41
|
+
// This is an ugly hack, which we will replace when we implement file thumbnail rendering via the Composition API.
|
|
42
|
+
var fileTypePlugins = _plugins.plugins.byType(_.FileManagerFileTypePlugin.type); // First we need to unregister already registered plugins.
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
fileTypePlugins.forEach(function (pl) {
|
|
46
|
+
return _plugins.plugins.unregister(pl.name);
|
|
47
|
+
}); // Then, we need to register the default plugins first, then register user's plugins again, to generate new names.
|
|
48
|
+
|
|
49
|
+
_plugins.plugins.register([_fileManager.defaultFileTypePlugin, _fileManager.imageFileTypePlugin].concat((0, _toConsumableArray2.default)(fileTypePlugins.map(function (pl) {
|
|
50
|
+
pl.name = undefined;
|
|
51
|
+
return pl;
|
|
52
|
+
}))));
|
|
53
|
+
}
|
|
33
54
|
|
|
34
55
|
var BaseExtension = function BaseExtension() {
|
|
35
|
-
_plugins.plugins.register(
|
|
56
|
+
_plugins.plugins.register([_globalSearch.globalSearchHotkey, _uiLayoutRenderer.uiLayoutPlugin]);
|
|
36
57
|
|
|
58
|
+
registerFileTypePlugins();
|
|
37
59
|
return /*#__PURE__*/_react.default.createElement(_appAdminCore.Plugins, null, /*#__PURE__*/_react.default.createElement(_.AddMenu, {
|
|
38
60
|
name: "settings",
|
|
39
61
|
label: "Settings",
|
package/base/Base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["registerFileTypePlugins","fileTypePlugins","plugins","byType","FileManagerFileTypePlugin","type","forEach","pl","unregister","name","register","defaultFileTypePlugin","imageFileTypePlugin","map","undefined","BaseExtension","globalSearchHotkey","uiLayoutPlugin","showFileManager","Base","memo"],"sources":["Base.tsx"],"sourcesContent":["import React, { memo } from \"react\";\nimport { Plugins } from \"@webiny/app-admin-core\";\nimport { AddMenu, AddRoute, Dashboard, FileManagerFileTypePlugin, Layout, NotFound } from \"~/index\";\nimport { plugins } from \"@webiny/plugins\";\nimport { ReactComponent as DocsIcon } from \"~/assets/icons/icon-documentation.svg\";\nimport { ReactComponent as SlackIcon } from \"~/assets/icons/slack-logo.svg\";\nimport { ReactComponent as GithubIcon } from \"~/assets/icons/github-brands.svg\";\nimport { ReactComponent as FileIcon } from \"~/assets/icons/insert_drive_file-24px.svg\";\nimport { ReactComponent as SettingsIcon } from \"~/assets/icons/round-settings-24px.svg\";\nimport { FileManager } from \"~/components\";\n\nimport { defaultFileTypePlugin, imageFileTypePlugin } from \"~/plugins/fileManager\";\nimport { globalSearchHotkey } from \"~/plugins/globalSearch\";\nimport { uiLayoutPlugin } from \"~/plugins/uiLayoutRenderer\";\n\nfunction registerFileTypePlugins() {\n // This is an ugly hack, which we will replace when we implement file thumbnail rendering via the Composition API.\n const fileTypePlugins = plugins.byType(FileManagerFileTypePlugin.type);\n\n // First we need to unregister already registered plugins.\n fileTypePlugins.forEach(pl => plugins.unregister(pl.name as string));\n\n // Then, we need to register the default plugins first, then register user's plugins again, to generate new names.\n plugins.register([\n defaultFileTypePlugin,\n imageFileTypePlugin,\n ...fileTypePlugins.map(pl => {\n pl.name = undefined;\n return pl;\n })\n ]);\n}\n\nconst BaseExtension: React.FC = () => {\n plugins.register([globalSearchHotkey, uiLayoutPlugin]);\n\n registerFileTypePlugins();\n\n return (\n <Plugins>\n <AddMenu name={\"settings\"} label={\"Settings\"} icon={<SettingsIcon />} pin={\"last\"} />\n <FileManager>\n {({ showFileManager }) => (\n <AddMenu\n name={\"fileManager\"}\n label={\"File Manager\"}\n icon={<FileIcon />}\n tags={[\"footer\"]}\n onClick={showFileManager}\n testId={\"admin-drawer-footer-menu-file-manager\"}\n />\n )}\n </FileManager>\n <AddMenu\n name={\"documentation\"}\n label={\"Documentation\"}\n icon={<DocsIcon />}\n path={\"https://www.webiny.com/docs\"}\n rel={\"noopener noreferrer\"}\n target={\"_blank\"}\n tags={[\"footer\"]}\n />\n <AddMenu\n name={\"slack\"}\n label={\"Slack\"}\n icon={<SlackIcon />}\n path={\"https://www.webiny.com/slack/\"}\n rel={\"noopener noreferrer\"}\n target={\"_blank\"}\n tags={[\"footer\"]}\n />\n <AddMenu\n name={\"github\"}\n label={\"Github\"}\n icon={<GithubIcon />}\n path={\"https://github.com/webiny/webiny-js\"}\n rel={\"noopener noreferrer\"}\n target={\"_blank\"}\n tags={[\"footer\"]}\n />\n <AddRoute path={\"/\"}>\n <Layout title={\"Welcome!\"}>\n <Dashboard />\n </Layout>\n </AddRoute>\n <AddRoute path={\"*\"}>\n <Layout title={\"Not Accessible\"}>\n <NotFound />\n </Layout>\n </AddRoute>\n </Plugins>\n );\n};\n\nexport const Base = memo(BaseExtension);\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAEA,SAASA,uBAAT,GAAmC;EAC/B;EACA,IAAMC,eAAe,GAAGC,gBAAA,CAAQC,MAAR,CAAeC,2BAAA,CAA0BC,IAAzC,CAAxB,CAF+B,CAI/B;;;EACAJ,eAAe,CAACK,OAAhB,CAAwB,UAAAC,EAAE;IAAA,OAAIL,gBAAA,CAAQM,UAAR,CAAmBD,EAAE,CAACE,IAAtB,CAAJ;EAAA,CAA1B,EAL+B,CAO/B;;EACAP,gBAAA,CAAQ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,QADV;IAEI,KAAK,EAAE,QAFX;IAGI,IAAI,eAAE,6BAAC,4BAAD,OAHV;IAII,IAAI,EAAE,qCAJV;IAKI,GAAG,EAAE,qBALT;IAMI,MAAM,EAAE,QANZ;IAOI,IAAI,EAAE,CAAC,QAAD;EAPV,EAhCJ,eAyCI,6BAAC,UAAD;IAAU,IAAI,EAAE;EAAhB,gBACI,6BAAC,QAAD;IAAQ,KAAK,EAAE;EAAf,gBACI,6BAAC,WAAD,OADJ,CADJ,CAzCJ,eA8CI,6BAAC,UAAD;IAAU,IAAI,EAAE;EAAhB,gBACI,6BAAC,QAAD;IAAQ,KAAK,EAAE;EAAf,gBACI,6BAAC,UAAD,OADJ,CADJ,CA9CJ,CADJ;AAsDH,CA3DD;;AA6DO,IAAMC,IAAI,gBAAG,IAAAC,WAAA,EAAKL,aAAL,CAAb"}
|
|
@@ -22,29 +22,36 @@ function getFileTypePlugin(file) {
|
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
var fileTypePlugins = [].concat((0, _toConsumableArray2.default)(_plugins.plugins.byType("admin-file-manager-file-type")), (0, _toConsumableArray2.default)(_plugins.plugins.byType(_FileManagerFileTypePlugin.FileManagerFileTypePlugin.type)))
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
var fileTypePlugins = [].concat((0, _toConsumableArray2.default)(_plugins.plugins.byType("admin-file-manager-file-type")), (0, _toConsumableArray2.default)(_plugins.plugins.byType(_FileManagerFileTypePlugin.FileManagerFileTypePlugin.type))).filter(function (value, index, self) {
|
|
26
|
+
return self.indexOf(value) === index;
|
|
27
|
+
}); // Group by types, but only one plugin per group. Last in wins. This allows you to add plugins to the system
|
|
28
|
+
// and not worry about the order of plugin registration.
|
|
29
|
+
|
|
30
|
+
var byTypes = fileTypePlugins.reduce(function (acc, plugin) {
|
|
31
|
+
plugin.types.forEach(function (type) {
|
|
32
|
+
return acc[type] = plugin;
|
|
33
|
+
});
|
|
34
|
+
return acc;
|
|
35
|
+
}, {}); // Sort by type and by priority. More occurrences of `*` means lower priority.
|
|
36
|
+
|
|
37
|
+
var regExMatch = /\*/g;
|
|
38
|
+
var types = Object.keys(byTypes).sort(function (a, b) {
|
|
39
|
+
var countA = (a.match(regExMatch) || []).length;
|
|
40
|
+
var countB = (b.match(regExMatch) || []).length;
|
|
41
|
+
|
|
42
|
+
if (countB > countA) {
|
|
43
|
+
return -1;
|
|
44
|
+
} else if (countB < countA) {
|
|
45
|
+
return 1;
|
|
39
46
|
}
|
|
40
47
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
48
|
+
return 0;
|
|
49
|
+
}); // Find first matching type
|
|
50
|
+
|
|
51
|
+
var type = types.find(function (type) {
|
|
52
|
+
return (0, _minimatch.default)(file.type, type);
|
|
53
|
+
});
|
|
54
|
+
(0, _invariant.default)(type, "Missing plugin to handle \"".concat(file.type, "\"!")); // return the plugin
|
|
47
55
|
|
|
48
|
-
|
|
49
|
-
return plugin;
|
|
56
|
+
return byTypes[type];
|
|
50
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getFileTypePlugin","file","fileTypePlugins","plugins","byType","FileManagerFileTypePlugin","type","
|
|
1
|
+
{"version":3,"names":["getFileTypePlugin","file","fileTypePlugins","plugins","byType","FileManagerFileTypePlugin","type","filter","value","index","self","indexOf","byTypes","reduce","acc","plugin","types","forEach","regExMatch","Object","keys","sort","a","b","countA","match","length","countB","find","minimatch","invariant"],"sources":["getFileTypePlugin.ts"],"sourcesContent":["import invariant from \"invariant\";\nimport minimatch from \"minimatch\";\nimport { plugins } from \"@webiny/plugins\";\nimport { AdminFileManagerFileTypePlugin } from \"~/types\";\nimport { FileManagerFileTypePlugin } from \"~/plugins/FileManagerFileTypePlugin\";\nimport { FileItem } from \"./types\";\n\nexport default function getFileTypePlugin(\n file: FileItem\n): AdminFileManagerFileTypePlugin | FileManagerFileTypePlugin | null {\n if (!file) {\n return null;\n }\n\n const fileTypePlugins = [\n ...plugins.byType<AdminFileManagerFileTypePlugin>(\"admin-file-manager-file-type\"),\n ...plugins.byType<FileManagerFileTypePlugin>(FileManagerFileTypePlugin.type)\n ].filter((value, index, self) => self.indexOf(value) === index);\n\n // Group by types, but only one plugin per group. Last in wins. This allows you to add plugins to the system\n // and not worry about the order of plugin registration.\n const byTypes = fileTypePlugins.reduce<\n Record<string, AdminFileManagerFileTypePlugin | FileManagerFileTypePlugin>\n >((acc, plugin) => {\n plugin.types.forEach(type => (acc[type] = plugin));\n return acc;\n }, {});\n\n // Sort by type and by priority. More occurrences of `*` means lower priority.\n const regExMatch = /\\*/g;\n const types = Object.keys(byTypes).sort((a, b) => {\n const countA = (a.match(regExMatch) || []).length;\n const countB = (b.match(regExMatch) || []).length;\n if (countB > countA) {\n return -1;\n } else if (countB < countA) {\n return 1;\n }\n return 0;\n });\n\n // Find first matching type\n const type = types.find(type => minimatch(file.type, type));\n\n invariant(type, `Missing plugin to handle \"${file.type}\"!`);\n\n // return the plugin\n return byTypes[type];\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAGe,SAASA,iBAAT,CACXC,IADW,EAEsD;EACjE,IAAI,CAACA,IAAL,EAAW;IACP,OAAO,IAAP;EACH;;EAED,IAAMC,eAAe,GAAG,2CACjBC,gBAAA,CAAQC,MAAR,CAA+C,8BAA/C,CADiB,oCAEjBD,gBAAA,CAAQC,MAAR,CAA0CC,oDAAA,CAA0BC,IAApE,CAFiB,GAGtBC,MAHsB,CAGf,UAACC,KAAD,EAAQC,KAAR,EAAeC,IAAf;IAAA,OAAwBA,IAAI,CAACC,OAAL,CAAaH,KAAb,MAAwBC,KAAhD;EAAA,CAHe,CAAxB,CALiE,CAUjE;EACA;;EACA,IAAMG,OAAO,GAAGV,eAAe,CAACW,MAAhB,CAEd,UAACC,GAAD,EAAMC,MAAN,EAAiB;IACfA,MAAM,CAACC,KAAP,CAAaC,OAAb,CAAqB,UAAAX,IAAI;MAAA,OAAKQ,GAAG,CAACR,IAAD,CAAH,GAAYS,MAAjB;IAAA,CAAzB;IACA,OAAOD,GAAP;EACH,CALe,EAKb,EALa,CAAhB,CAZiE,CAmBjE;;EACA,IAAMI,UAAU,GAAG,KAAnB;EACA,IAAMF,KAAK,GAAGG,MAAM,CAACC,IAAP,CAAYR,OAAZ,EAAqBS,IAArB,CAA0B,UAACC,CAAD,EAAIC,CAAJ,EAAU;IAC9C,IAAMC,MAAM,GAAG,CAACF,CAAC,CAACG,KAAF,CAAQP,UAAR,KAAuB,EAAxB,EAA4BQ,MAA3C;IACA,IAAMC,MAAM,GAAG,CAACJ,CAAC,CAACE,KAAF,CAAQP,UAAR,KAAuB,EAAxB,EAA4BQ,MAA3C;;IACA,IAAIC,MAAM,GAAGH,MAAb,EAAqB;MACjB,OAAO,CAAC,CAAR;IACH,CAFD,MAEO,IAAIG,MAAM,GAAGH,MAAb,EAAqB;MACxB,OAAO,CAAP;IACH;;IACD,OAAO,CAAP;EACH,CATa,CAAd,CArBiE,CAgCjE;;EACA,IAAMlB,IAAI,GAAGU,KAAK,CAACY,IAAN,CAAW,UAAAtB,IAAI;IAAA,OAAI,IAAAuB,kBAAA,EAAU5B,IAAI,CAACK,IAAf,EAAqBA,IAArB,CAAJ;EAAA,CAAf,CAAb;EAEA,IAAAwB,kBAAA,EAAUxB,IAAV,uCAA6CL,IAAI,CAACK,IAAlD,UAnCiE,CAqCjE;;EACA,OAAOM,OAAO,CAACN,IAAD,CAAd;AACH"}
|
package/index.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export type { AdminProps } from "./base/Admin";
|
|
|
22
22
|
export { useViewComposition } from "./base/providers/ViewCompositionProvider";
|
|
23
23
|
export type { ViewCompositionContext, ViewElement } from "./base/providers/ViewCompositionProvider";
|
|
24
24
|
export * from "./base/plugins/AddGraphQLQuerySelection";
|
|
25
|
+
export * from "./plugins/FileManagerFileTypePlugin";
|
|
26
|
+
export * from "./plugins/PermissionRendererPlugin";
|
|
25
27
|
export { AppInstaller } from "./components/AppInstaller";
|
|
26
28
|
export * from "./hooks/useSnackbar";
|
|
27
29
|
export * from "./hooks/useConfirmationDialog";
|
package/index.js
CHANGED
|
@@ -248,6 +248,34 @@ Object.keys(_AddGraphQLQuerySelection).forEach(function (key) {
|
|
|
248
248
|
});
|
|
249
249
|
});
|
|
250
250
|
|
|
251
|
+
var _FileManagerFileTypePlugin = require("./plugins/FileManagerFileTypePlugin");
|
|
252
|
+
|
|
253
|
+
Object.keys(_FileManagerFileTypePlugin).forEach(function (key) {
|
|
254
|
+
if (key === "default" || key === "__esModule") return;
|
|
255
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
256
|
+
if (key in exports && exports[key] === _FileManagerFileTypePlugin[key]) return;
|
|
257
|
+
Object.defineProperty(exports, key, {
|
|
258
|
+
enumerable: true,
|
|
259
|
+
get: function get() {
|
|
260
|
+
return _FileManagerFileTypePlugin[key];
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
var _PermissionRendererPlugin = require("./plugins/PermissionRendererPlugin");
|
|
266
|
+
|
|
267
|
+
Object.keys(_PermissionRendererPlugin).forEach(function (key) {
|
|
268
|
+
if (key === "default" || key === "__esModule") return;
|
|
269
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
270
|
+
if (key in exports && exports[key] === _PermissionRendererPlugin[key]) return;
|
|
271
|
+
Object.defineProperty(exports, key, {
|
|
272
|
+
enumerable: true,
|
|
273
|
+
get: function get() {
|
|
274
|
+
return _PermissionRendererPlugin[key];
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
|
|
251
279
|
var _AppInstaller = require("./components/AppInstaller");
|
|
252
280
|
|
|
253
281
|
var _useSnackbar = require("./hooks/useSnackbar");
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"@webiny/app-admin-core\";\nexport type { HigherOrderComponent, ProviderProps, ComposeProps } from \"@webiny/app-admin-core\";\n// UI components\nexport * from \"./base/ui/Tags\";\nexport * from \"./base/ui/Menu\";\nexport * from \"./base/ui/Layout\";\nexport * from \"./base/ui/LocaleSelector\";\nexport type { LayoutProps } from \"./base/ui/Layout\";\nexport * from \"./base/ui/Navigation\";\nexport type { MenuItemsProps } from \"./base/ui/Navigation\";\nexport * from \"./base/ui/Brand\";\nexport * from \"./base/ui/Logo\";\nexport * from \"./base/ui/Search\";\nexport type { SearchOptionData, SearchOptionProps } from \"./base/ui/Search\";\nexport * from \"./base/ui/UserMenu\";\nexport type { UserMenuItemProps } from \"./base/ui/UserMenu\";\nexport * from \"./base/ui/LoginScreen\";\nexport * from \"./base/ui/CenteredView\";\nexport * from \"./base/ui/Dashboard\";\nexport * from \"./base/ui/NotFound\";\n\n// Base admin app\nexport { Admin } from \"./base/Admin\";\nexport type { AdminProps } from \"./base/Admin\";\nexport { useViewComposition } from \"./base/providers/ViewCompositionProvider\";\nexport type { ViewCompositionContext, ViewElement } from \"./base/providers/ViewCompositionProvider\";\n\n// Plugins\nexport * from \"./base/plugins/AddGraphQLQuerySelection\";\n\n// Components\nexport { AppInstaller } from \"./components/AppInstaller\";\n\n// Hooks\nexport * from \"./hooks/useSnackbar\";\nexport * from \"./hooks/useConfirmationDialog\";\nexport * from \"./hooks/useDialog\";\nexport { useWcp } from \"@webiny/app-wcp\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AAGA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA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A;;AACA"}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"@webiny/app-admin-core\";\nexport type { HigherOrderComponent, ProviderProps, ComposeProps } from \"@webiny/app-admin-core\";\n// UI components\nexport * from \"./base/ui/Tags\";\nexport * from \"./base/ui/Menu\";\nexport * from \"./base/ui/Layout\";\nexport * from \"./base/ui/LocaleSelector\";\nexport type { LayoutProps } from \"./base/ui/Layout\";\nexport * from \"./base/ui/Navigation\";\nexport type { MenuItemsProps } from \"./base/ui/Navigation\";\nexport * from \"./base/ui/Brand\";\nexport * from \"./base/ui/Logo\";\nexport * from \"./base/ui/Search\";\nexport type { SearchOptionData, SearchOptionProps } from \"./base/ui/Search\";\nexport * from \"./base/ui/UserMenu\";\nexport type { UserMenuItemProps } from \"./base/ui/UserMenu\";\nexport * from \"./base/ui/LoginScreen\";\nexport * from \"./base/ui/CenteredView\";\nexport * from \"./base/ui/Dashboard\";\nexport * from \"./base/ui/NotFound\";\n\n// Base admin app\nexport { Admin } from \"./base/Admin\";\nexport type { AdminProps } from \"./base/Admin\";\nexport { useViewComposition } from \"./base/providers/ViewCompositionProvider\";\nexport type { ViewCompositionContext, ViewElement } from \"./base/providers/ViewCompositionProvider\";\n\n// Plugins\nexport * from \"./base/plugins/AddGraphQLQuerySelection\";\nexport * from \"./plugins/FileManagerFileTypePlugin\";\nexport * from \"./plugins/PermissionRendererPlugin\";\n\n// Components\nexport { AppInstaller } from \"./components/AppInstaller\";\n\n// Hooks\nexport * from \"./hooks/useSnackbar\";\nexport * from \"./hooks/useConfirmationDialog\";\nexport * from \"./hooks/useDialog\";\nexport { useWcp } from \"@webiny/app-wcp\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AAGA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AA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EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-admin",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.32.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"description": "A collection of plugins that together form a complete admin interface, customizable and extensible with Webiny apps and plugins.",
|
|
6
6
|
"repository": {
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"@svgr/webpack": "6.3.1",
|
|
21
21
|
"@types/mime": "2.0.3",
|
|
22
22
|
"@types/react": "17.0.39",
|
|
23
|
-
"@webiny/app": "5.
|
|
24
|
-
"@webiny/app-admin-core": "5.
|
|
25
|
-
"@webiny/app-security": "5.
|
|
26
|
-
"@webiny/app-wcp": "5.
|
|
27
|
-
"@webiny/form": "5.
|
|
28
|
-
"@webiny/plugins": "5.
|
|
29
|
-
"@webiny/react-router": "5.
|
|
30
|
-
"@webiny/telemetry": "5.
|
|
31
|
-
"@webiny/ui": "5.
|
|
32
|
-
"@webiny/ui-composer": "5.
|
|
33
|
-
"@webiny/validation": "5.
|
|
23
|
+
"@webiny/app": "5.32.0",
|
|
24
|
+
"@webiny/app-admin-core": "5.32.0",
|
|
25
|
+
"@webiny/app-security": "5.32.0",
|
|
26
|
+
"@webiny/app-wcp": "5.32.0",
|
|
27
|
+
"@webiny/form": "5.32.0",
|
|
28
|
+
"@webiny/plugins": "5.32.0",
|
|
29
|
+
"@webiny/react-router": "5.32.0",
|
|
30
|
+
"@webiny/telemetry": "5.32.0",
|
|
31
|
+
"@webiny/ui": "5.32.0",
|
|
32
|
+
"@webiny/ui-composer": "5.32.0",
|
|
33
|
+
"@webiny/validation": "5.32.0",
|
|
34
34
|
"apollo-cache": "1.3.5",
|
|
35
35
|
"apollo-client": "2.6.10",
|
|
36
36
|
"apollo-link": "1.2.14",
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
"@types/bytes": "^3.1.1",
|
|
71
71
|
"@types/graphlib": "^2.1.8",
|
|
72
72
|
"@types/store": "^2.0.2",
|
|
73
|
-
"@webiny/cli": "^5.
|
|
74
|
-
"@webiny/project-utils": "^5.
|
|
73
|
+
"@webiny/cli": "^5.32.0",
|
|
74
|
+
"@webiny/project-utils": "^5.32.0",
|
|
75
75
|
"babel-plugin-emotion": "^9.2.8",
|
|
76
76
|
"babel-plugin-lodash": "^3.3.4",
|
|
77
77
|
"rimraf": "^3.0.2",
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
]
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "1227aa53c68afa4ccd518c8a4344195a2b8e354b"
|
|
102
102
|
}
|
|
@@ -5,7 +5,7 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.defaultFileTypePlugin = void 0;
|
|
9
9
|
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
@@ -23,8 +23,7 @@ var style = {
|
|
|
23
23
|
height: 200
|
|
24
24
|
}, "label:centering;")
|
|
25
25
|
};
|
|
26
|
-
|
|
27
|
-
var _default = new _FileManagerFileTypePlugin.FileManagerFileTypePlugin({
|
|
26
|
+
var defaultFileTypePlugin = new _FileManagerFileTypePlugin.FileManagerFileTypePlugin({
|
|
28
27
|
types: ["*/*"],
|
|
29
28
|
render: function render() {
|
|
30
29
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -32,5 +31,4 @@ var _default = new _FileManagerFileTypePlugin.FileManagerFileTypePlugin({
|
|
|
32
31
|
}, /*#__PURE__*/React.createElement(_roundDescription24px.ReactComponent, null));
|
|
33
32
|
}
|
|
34
33
|
});
|
|
35
|
-
|
|
36
|
-
exports.default = _default;
|
|
34
|
+
exports.defaultFileTypePlugin = defaultFileTypePlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["style","centering","css","display","justifyContent","alignItems","height","FileManagerFileTypePlugin","types","render"],"sources":["fileDefault.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { ReactComponent as FileIcon } from \"./icons/round-description-24px.svg\";\nimport { css } from \"emotion\";\nimport { FileManagerFileTypePlugin } from \"~/plugins/FileManagerFileTypePlugin\";\n\nconst style = {\n centering: css({\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n height: 200\n })\n};\n\nexport
|
|
1
|
+
{"version":3,"names":["style","centering","css","display","justifyContent","alignItems","height","defaultFileTypePlugin","FileManagerFileTypePlugin","types","render"],"sources":["fileDefault.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { ReactComponent as FileIcon } from \"./icons/round-description-24px.svg\";\nimport { css } from \"emotion\";\nimport { FileManagerFileTypePlugin } from \"~/plugins/FileManagerFileTypePlugin\";\n\nconst style = {\n centering: css({\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n height: 200\n })\n};\n\nexport const defaultFileTypePlugin = new FileManagerFileTypePlugin({\n types: [\"*/*\"],\n render(): React.ReactNode {\n return (\n <div className={style.centering}>\n <FileIcon />\n </div>\n );\n }\n});\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA,IAAMA,KAAK,GAAG;EACVC,SAAS,eAAE,IAAAC,YAAA,EAAI;IACXC,OAAO,EAAE,MADE;IAEXC,cAAc,EAAE,QAFL;IAGXC,UAAU,EAAE,QAHD;IAIXC,MAAM,EAAE;EAJG,CAAJ;AADD,CAAd;AASO,IAAMC,qBAAqB,GAAG,IAAIC,oDAAJ,CAA8B;EAC/DC,KAAK,EAAE,CAAC,KAAD,CADwD;EAE/DC,MAF+D,oBAErC;IACtB,oBACI;MAAK,SAAS,EAAEV,KAAK,CAACC;IAAtB,gBACI,oBAAC,oCAAD,OADJ,CADJ;EAKH;AAR8D,CAA9B,CAA9B"}
|
|
@@ -7,7 +7,7 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.imageFileTypePlugin = void 0;
|
|
11
11
|
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
|
@@ -28,8 +28,7 @@ var styles = /*#__PURE__*/(0, _emotion.css)({
|
|
|
28
28
|
left: "50%",
|
|
29
29
|
transform: "translateX(-50%) translateY(-50%)"
|
|
30
30
|
}, "label:styles;");
|
|
31
|
-
|
|
32
|
-
var _default = new _FileManagerFileTypePlugin.FileManagerFileTypePlugin({
|
|
31
|
+
var imageFileTypePlugin = new _FileManagerFileTypePlugin.FileManagerFileTypePlugin({
|
|
33
32
|
types: ["image/*"],
|
|
34
33
|
actions: [_EditAction.default],
|
|
35
34
|
render: function render(_ref) {
|
|
@@ -44,5 +43,4 @@ var _default = new _FileManagerFileTypePlugin.FileManagerFileTypePlugin({
|
|
|
44
43
|
});
|
|
45
44
|
}
|
|
46
45
|
});
|
|
47
|
-
|
|
48
|
-
exports.default = _default;
|
|
46
|
+
exports.imageFileTypePlugin = imageFileTypePlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["styles","css","maxHeight","maxWidth","width","position","top","left","transform","FileManagerFileTypePlugin","types","actions","EditAction","render","file","src","name"],"sources":["index.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { css } from \"emotion\";\nimport { Image } from \"@webiny/app/components\";\n\nimport EditAction from \"./EditAction\";\nimport { FileManagerFileTypePlugin } from \"~/plugins/FileManagerFileTypePlugin\";\n\nconst styles = css({\n maxHeight: 200,\n maxWidth: 200,\n width: \"auto\",\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translateX(-50%) translateY(-50%)\"\n});\n\nexport
|
|
1
|
+
{"version":3,"names":["styles","css","maxHeight","maxWidth","width","position","top","left","transform","imageFileTypePlugin","FileManagerFileTypePlugin","types","actions","EditAction","render","file","src","name"],"sources":["index.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { css } from \"emotion\";\nimport { Image } from \"@webiny/app/components\";\n\nimport EditAction from \"./EditAction\";\nimport { FileManagerFileTypePlugin } from \"~/plugins/FileManagerFileTypePlugin\";\n\nconst styles = css({\n maxHeight: 200,\n maxWidth: 200,\n width: \"auto\",\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translateX(-50%) translateY(-50%)\"\n});\n\nexport const imageFileTypePlugin = new FileManagerFileTypePlugin({\n types: [\"image/*\"],\n actions: [EditAction],\n render({ file }) {\n return (\n <Image className={styles} src={file.src} alt={file.name} transform={{ width: 300 }} />\n );\n }\n});\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AAEA,IAAMA,MAAM,gBAAG,IAAAC,YAAA,EAAI;EACfC,SAAS,EAAE,GADI;EAEfC,QAAQ,EAAE,GAFK;EAGfC,KAAK,EAAE,MAHQ;EAIfC,QAAQ,EAAE,UAJK;EAKfC,GAAG,EAAE,KALU;EAMfC,IAAI,EAAE,KANS;EAOfC,SAAS,EAAE;AAPI,CAAJ,kBAAf;AAUO,IAAMC,mBAAmB,GAAG,IAAIC,oDAAJ,CAA8B;EAC7DC,KAAK,EAAE,CAAC,SAAD,CADsD;EAE7DC,OAAO,EAAE,CAACC,mBAAD,CAFoD;EAG7DC,MAH6D,wBAG5C;IAAA,IAARC,IAAQ,QAARA,IAAQ;IACb,oBACI,oBAAC,iBAAD;MAAO,SAAS,EAAEf,MAAlB;MAA0B,GAAG,EAAEe,IAAI,CAACC,GAApC;MAAyC,GAAG,EAAED,IAAI,CAACE,IAAnD;MAAyD,SAAS,EAAE;QAAEb,KAAK,EAAE;MAAT;IAApE,EADJ;EAGH;AAP4D,CAA9B,CAA5B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export { defaultFileTypePlugin } from "./fileDefault";
|
|
2
|
+
export { imageFileTypePlugin } from "./fileImage";
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
Object.defineProperty(exports, "defaultFileTypePlugin", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _fileDefault.defaultFileTypePlugin;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "imageFileTypePlugin", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _fileImage.imageFileTypePlugin;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
11
18
|
|
|
12
|
-
var
|
|
19
|
+
var _fileDefault = require("./fileDefault");
|
|
13
20
|
|
|
14
|
-
var
|
|
15
|
-
exports.default = _default;
|
|
21
|
+
var _fileImage = require("./fileImage");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { defaultFileTypePlugin } from \"./fileDefault\";\nexport { imageFileTypePlugin } from \"./fileImage\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;AACA"}
|
|
@@ -5,7 +5,7 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.uiLayoutPlugin = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
@@ -22,7 +22,7 @@ var ElementID = function ElementID(_ref) {
|
|
|
22
22
|
return children;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var uiLayoutPlugin = new _UILayout.UILayoutPlugin(function (layout) {
|
|
26
26
|
layout.setRenderer(function (_ref2) {
|
|
27
27
|
var layout = _ref2.layout,
|
|
28
28
|
props = _ref2.props,
|
|
@@ -72,5 +72,4 @@ var _default = new _UILayout.UILayoutPlugin(function (layout) {
|
|
|
72
72
|
}));
|
|
73
73
|
});
|
|
74
74
|
});
|
|
75
|
-
|
|
76
|
-
exports.default = _default;
|
|
75
|
+
exports.uiLayoutPlugin = uiLayoutPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getElementKey","element","constructor","name","id","ElementID","children","UILayoutPlugin","layout","setRenderer","props","hasParentGrid","getGrid","getLayout","map","row","index","item","getElement","console","warn","shouldRender","render","GridComponent","GridInner","Grid","width"],"sources":["index.tsx"],"sourcesContent":["import React, { Fragment } from \"react\";\nimport { Cell, Grid, GridInner } from \"@webiny/ui/Grid\";\nimport { UILayoutPlugin } from \"~/ui/UILayout\";\nimport { UIElement } from \"~/ui/UIElement\";\n\nfunction getElementKey(element: UIElement) {\n return `${element.constructor.name}:${element.id}`;\n}\n\nconst ElementID: React.FC = ({ children }) => {\n return children as unknown as React.ReactElement;\n};\n\nexport
|
|
1
|
+
{"version":3,"names":["getElementKey","element","constructor","name","id","ElementID","children","uiLayoutPlugin","UILayoutPlugin","layout","setRenderer","props","hasParentGrid","getGrid","getLayout","map","row","index","item","getElement","console","warn","shouldRender","render","GridComponent","GridInner","Grid","width"],"sources":["index.tsx"],"sourcesContent":["import React, { Fragment } from \"react\";\nimport { Cell, Grid, GridInner } from \"@webiny/ui/Grid\";\nimport { UILayoutPlugin } from \"~/ui/UILayout\";\nimport { UIElement } from \"~/ui/UIElement\";\n\nfunction getElementKey(element: UIElement) {\n return `${element.constructor.name}:${element.id}`;\n}\n\nconst ElementID: React.FC = ({ children }) => {\n return children as unknown as React.ReactElement;\n};\n\nexport const uiLayoutPlugin = new UILayoutPlugin(layout => {\n layout.setRenderer(({ layout, props, hasParentGrid }) => {\n if (!layout.getGrid()) {\n return (\n <Fragment>\n {layout.getLayout().map((row, index) => (\n <Fragment key={index}>\n {row.map(item => {\n const element = layout.getElement(item.element);\n\n if (!element) {\n console.warn(`Element \"${item.element}\" was not found!`);\n return null;\n }\n\n if (!element.shouldRender(props)) {\n return null;\n }\n\n return (\n <ElementID key={getElementKey(element)}>\n {element.render(props)}\n </ElementID>\n );\n })}\n </Fragment>\n ))}\n </Fragment>\n );\n }\n\n const GridComponent = hasParentGrid ? GridInner : Grid;\n\n return (\n <GridComponent>\n {layout.getLayout().map((row, index) => (\n <Fragment key={index}>\n {row.map(item => {\n const element = layout.getElement(item.element);\n if (!element.shouldRender(props)) {\n return null;\n }\n return (\n <Cell key={item.element} span={item.width}>\n <ElementID key={getElementKey(element)}>\n {element.render(props)}\n </ElementID>\n </Cell>\n );\n })}\n </Fragment>\n ))}\n </GridComponent>\n );\n });\n});\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAGA,SAASA,aAAT,CAAuBC,OAAvB,EAA2C;EACvC,iBAAUA,OAAO,CAACC,WAAR,CAAoBC,IAA9B,cAAsCF,OAAO,CAACG,EAA9C;AACH;;AAED,IAAMC,SAAmB,GAAG,SAAtBA,SAAsB,OAAkB;EAAA,IAAfC,QAAe,QAAfA,QAAe;EAC1C,OAAOA,QAAP;AACH,CAFD;;AAIO,IAAMC,cAAc,GAAG,IAAIC,wBAAJ,CAAmB,UAAAC,MAAM,EAAI;EACvDA,MAAM,CAACC,WAAP,CAAmB,iBAAsC;IAAA,IAAnCD,MAAmC,SAAnCA,MAAmC;IAAA,IAA3BE,KAA2B,SAA3BA,KAA2B;IAAA,IAApBC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AyB,IAAI,EAAEiB,IAAI,CAACS;QAApC,gBACI,6BAAC,SAAD;UAAW,GAAG,EAAE3B,aAAa,CAACC,OAAD;QAA7B,GACKA,OAAO,CAACsB,MAAR,CAAeZ,KAAf,CADL,CADJ,CADJ;MAOH,CAZA,CADL,CADoB;IAAA,CAAvB,CADL,CADJ;EAqBH,CArDD;AAsDH,CAvD6B,CAAvB"}
|
package/types.d.ts
CHANGED
|
@@ -60,7 +60,7 @@ export interface AdminFileManagerFileTypePluginRenderParams {
|
|
|
60
60
|
}
|
|
61
61
|
export declare type AdminFileManagerFileTypePlugin = Plugin & {
|
|
62
62
|
type: "admin-file-manager-file-type";
|
|
63
|
-
types
|
|
63
|
+
types: string[];
|
|
64
64
|
render(params: AdminFileManagerFileTypePluginRenderParams): React.ReactNode;
|
|
65
65
|
fileDetails?: {
|
|
66
66
|
actions: Array<React.FC | React.Component>;
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import React, { ReactElement } from \"react\";\nimport { Plugin } from \"@webiny/plugins/types\";\nimport { ApolloClient } from \"apollo-client\";\nimport { ItemProps, MenuProps, SectionProps } from \"~/plugins/MenuPlugin\";\n\ntype RenderParams = {\n content: React.ReactNode;\n};\n\nexport type AdminGlobalSearchPlugin = Plugin & {\n type: \"admin-global-search\";\n label: string;\n route: string;\n search?: {\n operator?: \"and\" | \"or\";\n fields?: Array<string>;\n };\n};\n\nexport type AdminGlobalSearchPreventHotkeyPlugin = Plugin & {\n type: \"admin-global-search-prevent-hotkey\";\n preventOpen(e: React.KeyboardEvent): boolean | void;\n};\n\nexport type AdminDrawerFooterMenuPlugin = Plugin & {\n type: \"admin-drawer-footer-menu\";\n render(params: any): React.ReactElement;\n};\n\n/**\n * LEGACY TYPE. Only for backwards compatibility.\n */\nexport type AdminMenuLogoPlugin = Plugin & {\n name: \"admin-menu-logo\";\n type: \"admin-menu-logo\";\n render(): React.ReactElement;\n};\n\nexport type AdminHeaderUserMenuPlugin = Plugin & {\n type: \"admin-header-user-menu\";\n render(): React.ReactElement;\n};\n\n/**\n * Enables adding custom menu sections and items in the main menu, located on the left side of the screen.\n * @see https://docs.webiny.com/docs/webiny-apps/admin/development/plugins-reference/app#admin-menu\n */\nexport type AdminMenuPlugin = Plugin & {\n type: \"admin-menu\";\n render(props: {\n Menu: React.ComponentType<MenuProps>;\n Section: React.ComponentType<SectionProps>;\n Item: React.ComponentType<ItemProps>;\n }): React.ReactNode;\n order?: number;\n};\n\n/**\n * Enables adding custom header elements to the right side of the top bar.\n * @see https://docs.webiny.com/docs/webiny-apps/admin/development/plugins-reference/app#admin-header-right\n */\nexport type AdminHeaderRightPlugin = Plugin & {\n type: \"admin-header-right\";\n render(params: RenderParams): React.ReactNode;\n};\n\nexport interface AdminFileManagerFileTypePluginRenderParams {\n file: string;\n}\nexport type AdminFileManagerFileTypePlugin = Plugin & {\n type: \"admin-file-manager-file-type\";\n types
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import React, { ReactElement } from \"react\";\nimport { Plugin } from \"@webiny/plugins/types\";\nimport { ApolloClient } from \"apollo-client\";\nimport { ItemProps, MenuProps, SectionProps } from \"~/plugins/MenuPlugin\";\n\ntype RenderParams = {\n content: React.ReactNode;\n};\n\nexport type AdminGlobalSearchPlugin = Plugin & {\n type: \"admin-global-search\";\n label: string;\n route: string;\n search?: {\n operator?: \"and\" | \"or\";\n fields?: Array<string>;\n };\n};\n\nexport type AdminGlobalSearchPreventHotkeyPlugin = Plugin & {\n type: \"admin-global-search-prevent-hotkey\";\n preventOpen(e: React.KeyboardEvent): boolean | void;\n};\n\nexport type AdminDrawerFooterMenuPlugin = Plugin & {\n type: \"admin-drawer-footer-menu\";\n render(params: any): React.ReactElement;\n};\n\n/**\n * LEGACY TYPE. Only for backwards compatibility.\n */\nexport type AdminMenuLogoPlugin = Plugin & {\n name: \"admin-menu-logo\";\n type: \"admin-menu-logo\";\n render(): React.ReactElement;\n};\n\nexport type AdminHeaderUserMenuPlugin = Plugin & {\n type: \"admin-header-user-menu\";\n render(): React.ReactElement;\n};\n\n/**\n * Enables adding custom menu sections and items in the main menu, located on the left side of the screen.\n * @see https://docs.webiny.com/docs/webiny-apps/admin/development/plugins-reference/app#admin-menu\n */\nexport type AdminMenuPlugin = Plugin & {\n type: \"admin-menu\";\n render(props: {\n Menu: React.ComponentType<MenuProps>;\n Section: React.ComponentType<SectionProps>;\n Item: React.ComponentType<ItemProps>;\n }): React.ReactNode;\n order?: number;\n};\n\n/**\n * Enables adding custom header elements to the right side of the top bar.\n * @see https://docs.webiny.com/docs/webiny-apps/admin/development/plugins-reference/app#admin-header-right\n */\nexport type AdminHeaderRightPlugin = Plugin & {\n type: \"admin-header-right\";\n render(params: RenderParams): React.ReactNode;\n};\n\nexport interface AdminFileManagerFileTypePluginRenderParams {\n file: string;\n}\nexport type AdminFileManagerFileTypePlugin = Plugin & {\n type: \"admin-file-manager-file-type\";\n types: string[];\n render(params: AdminFileManagerFileTypePluginRenderParams): React.ReactNode;\n fileDetails?: {\n actions: Array<React.FC | React.Component>;\n };\n};\n\nexport interface AdminInstallationPluginRenderParams {\n onInstalled: () => Promise<void>;\n}\nexport type AdminInstallationPlugin = Plugin & {\n type: \"admin-installation\";\n getInstalledVersion(params: { client: ApolloClient<object> }): Promise<string | null>;\n title: string;\n dependencies?: string[];\n secure: boolean;\n render(params: AdminInstallationPluginRenderParams): React.ReactNode;\n upgrades?: {\n version: string;\n getComponent(): React.ComponentType<{ onInstalled: () => void }>;\n }[];\n};\n\nexport type AdminAppPermissionRendererPlugin = Plugin & {\n type: \"admin-app-permissions-renderer\";\n system?: boolean;\n render(params: any): ReactElement;\n};\n"],"mappings":""}
|
|
@@ -7,14 +7,14 @@ export declare const AddImageWrapperRound: import("@emotion/styled-base").Styled
|
|
|
7
7
|
theme?: object | undefined;
|
|
8
8
|
} & {
|
|
9
9
|
children?: import("react").ReactNode;
|
|
10
|
-
}, "key" | keyof import("react").HTMLAttributes<HTMLDivElement
|
|
10
|
+
}, "key" | "theme" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
11
11
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
12
12
|
}, Pick<Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Pick<Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement>>, keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
13
13
|
theme?: object | undefined;
|
|
14
14
|
} & {
|
|
15
15
|
children?: import("react").ReactNode;
|
|
16
|
-
}, "key" | keyof import("react").HTMLAttributes<HTMLDivElement
|
|
16
|
+
}, "key" | "theme" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
17
17
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
18
|
-
}, keyof import("react").HTMLAttributes<HTMLDivElement
|
|
18
|
+
}, "theme" | keyof import("react").HTMLAttributes<HTMLDivElement>>, object>;
|
|
19
19
|
export declare const RemoveImage: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement>>, object>;
|
|
20
20
|
export declare const FilePreviewWrapper: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement>>, object>;
|
package/plugins/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/// <reference types="web" />
|
|
3
|
-
/// <reference types="react" />
|
|
4
|
-
declare const _default: () => (import("./FileManagerFileTypePlugin").FileManagerFileTypePlugin[] | import("@webiny/ui-composer/UILayout").UILayoutPlugin<import("@webiny/ui-composer/UILayout").UILayout> | {
|
|
5
|
-
type: string;
|
|
6
|
-
name: string;
|
|
7
|
-
preventOpen(e: import("react").ChangeEvent<HTMLInputElement>): boolean;
|
|
8
|
-
})[];
|
|
9
|
-
export default _default;
|
package/plugins/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _fileManager = _interopRequireDefault(require("./fileManager"));
|
|
11
|
-
|
|
12
|
-
var _uiLayoutRenderer = _interopRequireDefault(require("./uiLayoutRenderer"));
|
|
13
|
-
|
|
14
|
-
var _globalSearch = require("./globalSearch");
|
|
15
|
-
|
|
16
|
-
var _default = function _default() {
|
|
17
|
-
return [_fileManager.default, _globalSearch.globalSearchHotkey, _uiLayoutRenderer.default];
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
exports.default = _default;
|
package/plugins/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["fileManager","globalSearchHotkey","uiLayoutRenderer"],"sources":["index.ts"],"sourcesContent":["import fileManager from \"./fileManager\";\nimport uiLayoutRenderer from \"./uiLayoutRenderer\";\nimport { globalSearchHotkey } from \"./globalSearch\";\n\nexport default () => [fileManager, globalSearchHotkey, uiLayoutRenderer];\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;eAEe;EAAA,OAAM,CAACA,oBAAD,EAAcC,gCAAd,EAAkCC,yBAAlC,CAAN;AAAA,C"}
|