strapi-plugin-navigation 2.0.13 → 2.1.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/README.md +105 -27
- package/admin/src/components/Alert/styles.d.ts +2 -0
- package/admin/src/components/Alert/styles.js +10 -4
- package/admin/src/components/CollapseButton/index.d.ts +7 -0
- package/admin/src/components/CollapseButton/index.js +21 -22
- package/admin/src/components/ConfirmationDialog/index.d.ts +28 -0
- package/admin/src/components/ConfirmationDialog/index.js +32 -54
- package/admin/src/components/EmptyView/index.d.ts +3 -0
- package/admin/src/components/EmptyView/index.js +9 -7
- package/admin/src/components/Item/ItemCardBadge/index.d.ts +3 -0
- package/admin/src/components/Item/ItemCardBadge/index.js +11 -7
- package/admin/src/components/Item/ItemCardHeader/Wrapper.d.ts +3 -0
- package/admin/src/components/Item/ItemCardHeader/Wrapper.js +10 -6
- package/admin/src/components/Item/ItemCardHeader/index.d.ts +12 -0
- package/admin/src/components/Item/ItemCardHeader/index.js +33 -52
- package/admin/src/components/Item/ItemCardRemovedOverlay/index.d.ts +2 -0
- package/admin/src/components/Item/ItemCardRemovedOverlay/index.js +10 -4
- package/admin/src/components/Item/Wrapper.d.ts +3 -0
- package/admin/src/components/Item/Wrapper.js +10 -6
- package/admin/src/components/Item/index.d.ts +31 -0
- package/admin/src/components/Item/index.js +163 -242
- package/admin/src/components/NavigationItemList/Wrapper.d.ts +3 -0
- package/admin/src/components/NavigationItemList/Wrapper.js +9 -5
- package/admin/src/components/NavigationItemList/index.d.ts +35 -0
- package/admin/src/components/NavigationItemList/index.js +28 -66
- package/admin/src/components/RestartAlert/index.d.ts +3 -0
- package/admin/src/components/RestartAlert/index.js +10 -5
- package/admin/src/components/Search/index.d.ts +6 -0
- package/admin/src/components/Search/index.js +57 -46
- package/admin/src/components/icons/navigation.d.ts +6 -0
- package/admin/src/components/icons/navigation.js +11 -13
- package/admin/src/contexts/DataManagerContext.d.ts +3 -0
- package/admin/src/contexts/DataManagerContext.js +6 -5
- package/admin/src/hooks/useAllContentTypes.d.ts +6 -0
- package/admin/src/hooks/useAllContentTypes.js +10 -11
- package/admin/src/hooks/useDataManager.d.ts +3 -0
- package/admin/src/hooks/useDataManager.js +10 -6
- package/admin/src/hooks/useI18nCopyNavigationItemsModal.d.ts +9 -0
- package/admin/src/hooks/useI18nCopyNavigationItemsModal.js +51 -0
- package/admin/src/hooks/useNavigationConfig.d.ts +10 -0
- package/admin/src/hooks/useNavigationConfig.js +52 -56
- package/admin/src/hooks/useNavigationManager.d.ts +7 -0
- package/admin/src/hooks/useNavigationManager.js +41 -0
- package/admin/src/index.d.ts +14 -0
- package/admin/src/index.js +92 -76
- package/admin/src/pages/App/index.d.ts +3 -0
- package/admin/src/pages/App/index.js +43 -31
- package/admin/src/pages/DataManagerProvider/actions.d.ts +19 -0
- package/admin/src/pages/DataManagerProvider/actions.js +22 -26
- package/admin/src/pages/DataManagerProvider/index.d.ts +12 -0
- package/admin/src/pages/DataManagerProvider/index.js +316 -298
- package/admin/src/pages/DataManagerProvider/init.d.ts +3 -0
- package/admin/src/pages/DataManagerProvider/init.js +5 -3
- package/admin/src/pages/DataManagerProvider/reducer.d.ts +19 -0
- package/admin/src/pages/DataManagerProvider/reducer.js +119 -121
- package/admin/src/pages/SettingsPage/components/DisableI18nModal/index.d.ts +24 -0
- package/admin/src/pages/SettingsPage/components/DisableI18nModal/index.js +88 -0
- package/admin/src/pages/SettingsPage/index.d.ts +3 -0
- package/admin/src/pages/SettingsPage/index.js +242 -335
- package/admin/src/pages/SettingsPage/utils/functions.d.ts +5 -0
- package/admin/src/pages/SettingsPage/utils/functions.js +3 -8
- package/admin/src/pages/View/components/I18nCopyNavigationItems/index.d.ts +14 -0
- package/admin/src/pages/View/components/I18nCopyNavigationItems/index.js +15 -0
- package/admin/src/pages/View/components/NavigationContentHeader/index.d.ts +6 -0
- package/admin/src/pages/View/components/NavigationContentHeader/index.js +13 -17
- package/admin/src/pages/View/components/NavigationHeader/index.d.ts +12 -0
- package/admin/src/pages/View/components/NavigationHeader/index.js +79 -65
- package/admin/src/pages/View/components/NavigationHeader/styles.d.ts +2 -0
- package/admin/src/pages/View/components/NavigationHeader/styles.js +10 -5
- package/admin/src/pages/View/components/NavigationItemForm/index.d.ts +57 -0
- package/admin/src/pages/View/components/NavigationItemForm/index.js +416 -453
- package/admin/src/pages/View/components/NavigationItemForm/utils/form.d.ts +45 -0
- package/admin/src/pages/View/components/NavigationItemForm/utils/form.js +84 -52
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.d.ts +23 -0
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.js +24 -34
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupHeader.d.ts +4 -0
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupHeader.js +16 -16
- package/admin/src/pages/View/components/NavigationItemPopup/index.d.ts +30 -0
- package/admin/src/pages/View/components/NavigationItemPopup/index.js +85 -108
- package/admin/src/pages/View/components/NavigationManager/Create/index.d.ts +9 -0
- package/admin/src/pages/View/components/NavigationManager/Create/index.js +57 -0
- package/admin/src/pages/View/components/NavigationManager/Delete/index.d.ts +8 -0
- package/admin/src/pages/View/components/NavigationManager/Delete/index.js +28 -0
- package/admin/src/pages/View/components/NavigationManager/Edit/index.d.ts +8 -0
- package/admin/src/pages/View/components/NavigationManager/Edit/index.js +54 -0
- package/admin/src/pages/View/components/NavigationManager/Error/index.d.ts +8 -0
- package/admin/src/pages/View/components/NavigationManager/Error/index.js +53 -0
- package/admin/src/pages/View/components/NavigationManager/Form/index.d.ts +19 -0
- package/admin/src/pages/View/components/NavigationManager/Form/index.js +98 -0
- package/admin/src/pages/View/components/NavigationManager/List/index.d.ts +8 -0
- package/admin/src/pages/View/components/NavigationManager/List/index.js +138 -0
- package/admin/src/pages/View/components/NavigationManager/index.d.ts +10 -0
- package/admin/src/pages/View/components/NavigationManager/index.js +189 -0
- package/admin/src/pages/View/components/NavigationManager/types.d.ts +53 -0
- package/admin/src/pages/View/components/NavigationManager/types.js +3 -0
- package/admin/src/pages/View/index.d.ts +4 -0
- package/admin/src/pages/View/index.js +231 -304
- package/admin/src/pages/View/utils/enums.d.ts +9 -0
- package/admin/src/pages/View/utils/enums.js +11 -8
- package/admin/src/pages/View/utils/form.d.ts +2 -0
- package/admin/src/pages/View/utils/form.js +15 -12
- package/admin/src/pages/View/utils/index.d.ts +2 -0
- package/admin/src/pages/View/utils/index.js +11 -3
- package/admin/src/pages/View/utils/parsers.d.ts +49 -0
- package/admin/src/pages/View/utils/parsers.js +239 -278
- package/admin/src/permissions.d.ts +12 -0
- package/admin/src/permissions.js +11 -7
- package/admin/src/pluginId.d.ts +3 -0
- package/admin/src/pluginId.js +2 -2
- package/admin/src/translations/en.json +157 -104
- package/admin/src/translations/fr.json +44 -44
- package/admin/src/translations/index.d.ts +12 -0
- package/admin/src/translations/index.js +17 -11
- package/admin/src/utils/api.d.ts +8 -0
- package/admin/src/utils/api.js +54 -50
- package/admin/src/utils/getTrad.d.ts +3 -0
- package/admin/src/utils/getTrad.js +9 -5
- package/admin/src/utils/index.d.ts +18 -0
- package/admin/src/utils/index.js +36 -15
- package/package.json +20 -19
- package/permissions.d.ts +9 -0
- package/permissions.js +5 -4
- package/server/bootstrap/index.d.ts +4 -0
- package/server/bootstrap/index.js +41 -0
- package/server/config/index.d.ts +5 -0
- package/server/config/index.js +33 -9
- package/server/config/setupStrategy.d.ts +3 -0
- package/server/config/setupStrategy.js +38 -0
- package/server/content-types/audience/index.d.ts +27 -0
- package/server/content-types/audience/index.js +9 -8
- package/server/content-types/audience/schema.d.ts +25 -0
- package/server/content-types/audience/schema.js +26 -0
- package/server/content-types/index.d.ts +255 -0
- package/server/content-types/index.js +15 -12
- package/server/content-types/navigation/index.d.ts +64 -0
- package/server/content-types/navigation/index.js +11 -8
- package/server/content-types/navigation/lifecycle.d.ts +9 -0
- package/server/content-types/navigation/lifecycle.js +8 -12
- package/server/content-types/navigation/schema.d.ts +55 -0
- package/server/content-types/navigation/schema.js +56 -0
- package/server/content-types/navigation-item/index.d.ts +112 -0
- package/server/content-types/navigation-item/index.js +11 -8
- package/server/content-types/navigation-item/lifecycle.d.ts +16 -0
- package/server/content-types/navigation-item/lifecycle.js +28 -32
- package/server/content-types/navigation-item/schema.d.ts +97 -0
- package/server/content-types/navigation-item/schema.js +102 -0
- package/server/content-types/navigations-items-related/index.d.ts +56 -0
- package/server/content-types/navigations-items-related/index.js +11 -8
- package/server/content-types/navigations-items-related/lifecycle.d.ts +8 -0
- package/server/content-types/navigations-items-related/lifecycle.js +20 -17
- package/server/content-types/navigations-items-related/schema.d.ts +49 -0
- package/server/content-types/navigations-items-related/schema.js +50 -0
- package/server/controllers/admin.d.ts +4 -0
- package/server/controllers/admin.js +130 -0
- package/server/controllers/client.d.ts +4 -0
- package/server/controllers/client.js +57 -0
- package/server/controllers/index.d.ts +4 -0
- package/server/controllers/index.js +12 -6
- package/server/destroy.d.ts +3 -0
- package/server/destroy.js +5 -0
- package/server/graphql/config.d.ts +4 -0
- package/server/graphql/config.js +28 -0
- package/server/graphql/index.d.ts +2 -0
- package/server/graphql/index.js +18 -22
- package/server/graphql/queries/index.d.ts +3 -0
- package/server/graphql/queries/index.js +15 -15
- package/server/graphql/queries/render-navigation-child.d.ts +15 -0
- package/server/graphql/queries/render-navigation-child.js +24 -15
- package/server/graphql/queries/render-navigation.d.ts +21 -0
- package/server/graphql/queries/render-navigation.js +31 -15
- package/server/graphql/resolvers-config.d.ts +10 -0
- package/server/graphql/resolvers-config.js +5 -3
- package/server/graphql/setupStrategy.d.ts +3 -0
- package/server/graphql/setupStrategy.js +15 -0
- package/server/graphql/types/content-types-name-fields.d.ts +6 -0
- package/server/graphql/types/content-types-name-fields.js +13 -9
- package/server/graphql/types/content-types.d.ts +5 -0
- package/server/graphql/types/content-types.js +17 -15
- package/server/graphql/types/create-navigation-item.d.ts +5 -0
- package/server/graphql/types/create-navigation-item.js +18 -16
- package/server/graphql/types/create-navigation-related.d.ts +5 -0
- package/server/graphql/types/create-navigation-related.js +9 -7
- package/server/graphql/types/create-navigation.d.ts +5 -0
- package/server/graphql/types/create-navigation.js +8 -6
- package/server/graphql/types/index.d.ts +3 -0
- package/server/graphql/types/index.js +15 -13
- package/server/graphql/types/navigation-config.d.ts +5 -0
- package/server/graphql/types/navigation-config.js +10 -8
- package/server/graphql/types/navigation-details.d.ts +5 -0
- package/server/graphql/types/navigation-details.js +11 -9
- package/server/graphql/types/navigation-item-related-data.d.ts +5 -0
- package/server/graphql/types/navigation-item-related-data.js +9 -0
- package/server/graphql/types/navigation-item-related.d.ts +7 -0
- package/server/graphql/types/navigation-item-related.js +25 -0
- package/server/graphql/types/navigation-item.d.ts +5 -0
- package/server/graphql/types/navigation-item.js +28 -29
- package/server/graphql/types/navigation-render-type.d.ts +5 -0
- package/server/graphql/types/navigation-render-type.js +7 -4
- package/server/graphql/types/navigation.d.ts +5 -0
- package/server/graphql/types/navigation.js +10 -8
- package/server/i18n/constant.d.ts +2 -0
- package/server/i18n/constant.js +5 -0
- package/server/i18n/errors.d.ts +7 -0
- package/server/i18n/errors.js +14 -0
- package/server/i18n/graphQLEnhancers.d.ts +10 -0
- package/server/i18n/graphQLEnhancers.js +10 -0
- package/server/i18n/index.d.ts +8 -0
- package/server/i18n/index.js +23 -0
- package/server/i18n/navigationSetupStrategy.d.ts +3 -0
- package/server/i18n/navigationSetupStrategy.js +119 -0
- package/server/i18n/serviceEnhancers.d.ts +13 -0
- package/server/i18n/serviceEnhancers.js +156 -0
- package/server/i18n/types.d.ts +60 -0
- package/server/i18n/types.js +3 -0
- package/server/i18n/utils.d.ts +12 -0
- package/server/i18n/utils.js +29 -0
- package/server/index.d.ts +273 -0
- package/server/index.js +26 -0
- package/server/navigation/index.d.ts +2 -0
- package/server/navigation/index.js +18 -0
- package/server/navigation/setupStrategy.d.ts +3 -0
- package/server/navigation/setupStrategy.js +39 -0
- package/server/register/index.d.ts +3 -0
- package/server/register/index.js +4 -0
- package/server/routes/admin.d.ts +4 -0
- package/server/routes/admin.js +82 -61
- package/server/routes/client.d.ts +4 -0
- package/server/routes/client.js +25 -21
- package/server/routes/index.d.ts +6 -0
- package/server/routes/index.js +13 -4
- package/server/services/admin.d.ts +5 -0
- package/server/services/admin.js +238 -0
- package/server/services/client.d.ts +5 -0
- package/server/services/client.js +249 -0
- package/server/services/common.d.ts +5 -0
- package/server/services/common.js +313 -0
- package/server/services/index.d.ts +7 -0
- package/server/services/index.js +14 -6
- package/server/utils/constant.d.ts +27 -0
- package/server/utils/constant.js +24 -0
- package/server/utils/functions.d.ts +139 -0
- package/server/utils/functions.js +226 -0
- package/server/utils/index.d.ts +3 -0
- package/server/utils/index.js +19 -0
- package/strapi-admin.d.ts +3 -0
- package/strapi-admin.js +8 -1
- package/strapi-server.d.ts +273 -0
- package/strapi-server.js +6 -17
- package/tsconfig.tsbuildinfo +1 -0
- package/types/bootstrap.d.ts +13 -0
- package/types/bootstrap.js +3 -0
- package/types/config.d.ts +21 -0
- package/types/config.js +3 -0
- package/types/contentTypes.d.ts +85 -0
- package/types/contentTypes.js +3 -0
- package/types/controllers.d.ts +48 -0
- package/types/controllers.js +5 -0
- package/types/graphQL.d.ts +3 -0
- package/types/graphQL.js +3 -0
- package/types/i18n.d.ts +9 -0
- package/types/i18n.js +3 -0
- package/types/index.d.ts +9 -0
- package/types/index.js +25 -0
- package/types/services.d.ts +74 -0
- package/types/services.js +3 -0
- package/types/utils.d.ts +62 -0
- package/types/utils.js +27 -0
- package/utils/InvalidParamNavigationError.d.ts +4 -0
- package/utils/InvalidParamNavigationError.js +8 -0
- package/utils/NavigationError.d.ts +5 -0
- package/utils/NavigationError.js +7 -7
- package/__mocks__/pages.settings.json +0 -25
- package/__mocks__/strapi.js +0 -207
- package/jest.config.js +0 -14
- package/server/bootstrap.js +0 -52
- package/server/config.js +0 -9
- package/server/content-types/audience/lifecycle.js +0 -8
- package/server/content-types/audience/schema.json +0 -23
- package/server/content-types/navigation/schema.json +0 -45
- package/server/content-types/navigation-item/schema.json +0 -99
- package/server/content-types/navigations-items-related/schema.json +0 -47
- package/server/controllers/navigation.js +0 -105
- package/server/graphql/types/navigation-related.js +0 -25
- package/server/services/__tests__/functions.test.js +0 -48
- package/server/services/__tests__/navigation.test.js +0 -91
- package/server/services/navigation.js +0 -791
- package/server/services/utils/constant.js +0 -21
- package/server/services/utils/functions.js +0 -226
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export default List;
|
|
2
|
+
declare function List({ allowedLevels, error, isParentAttachedToMenu, items, level, levelPath, onItemEdit, onItemLevelAdd, onItemRemove, onItemRestore, onItemReOrder, onItemToggleCollapse, displayFlat, contentTypes, contentTypesNameFields, }: {
|
|
3
|
+
allowedLevels: any;
|
|
4
|
+
error: any;
|
|
5
|
+
isParentAttachedToMenu?: boolean | undefined;
|
|
6
|
+
items: any;
|
|
7
|
+
level?: number | undefined;
|
|
8
|
+
levelPath?: string | undefined;
|
|
9
|
+
onItemEdit: any;
|
|
10
|
+
onItemLevelAdd: any;
|
|
11
|
+
onItemRemove: any;
|
|
12
|
+
onItemRestore: any;
|
|
13
|
+
onItemReOrder: any;
|
|
14
|
+
onItemToggleCollapse: any;
|
|
15
|
+
displayFlat: any;
|
|
16
|
+
contentTypes: any;
|
|
17
|
+
contentTypesNameFields: any;
|
|
18
|
+
}): JSX.Element;
|
|
19
|
+
declare namespace List {
|
|
20
|
+
namespace propTypes {
|
|
21
|
+
const allowedLevels: PropTypes.Requireable<number>;
|
|
22
|
+
const isParentAttachedToMenu: PropTypes.Requireable<boolean>;
|
|
23
|
+
const items: PropTypes.Requireable<any[]>;
|
|
24
|
+
const level: PropTypes.Requireable<number>;
|
|
25
|
+
const onItemLevelAdd: PropTypes.Validator<(...args: any[]) => any>;
|
|
26
|
+
const onItemRemove: PropTypes.Validator<(...args: any[]) => any>;
|
|
27
|
+
const onItemRestore: PropTypes.Validator<(...args: any[]) => any>;
|
|
28
|
+
const onItemReOrder: PropTypes.Validator<(...args: any[]) => any>;
|
|
29
|
+
const onItemToggleCollapse: PropTypes.Validator<(...args: any[]) => any>;
|
|
30
|
+
const contentTypes: PropTypes.Validator<any[]>;
|
|
31
|
+
const contentTypesNameFields: PropTypes.Validator<object>;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
import PropTypes from "prop-types";
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,70 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
levelPath = '',
|
|
14
|
-
onItemEdit,
|
|
15
|
-
onItemLevelAdd,
|
|
16
|
-
onItemRemove,
|
|
17
|
-
onItemRestore,
|
|
18
|
-
onItemReOrder,
|
|
19
|
-
onItemToggleCollapse,
|
|
20
|
-
displayFlat,
|
|
21
|
-
contentTypes,
|
|
22
|
-
contentTypesNameFields,
|
|
23
|
-
}) => (
|
|
24
|
-
<Wrapper level={level}>
|
|
25
|
-
{items.map((item, n) => {
|
|
26
|
-
const { relatedRef, ...itemProps } = item
|
|
27
|
-
return (
|
|
28
|
-
<Item
|
|
29
|
-
key={`list-item-${item.viewId || n}`}
|
|
30
|
-
item={itemProps}
|
|
31
|
-
isLast={n === items.length - 1}
|
|
32
|
-
relatedRef={relatedRef}
|
|
33
|
-
level={level}
|
|
34
|
-
levelPath={levelPath}
|
|
35
|
-
isParentAttachedToMenu={isParentAttachedToMenu}
|
|
36
|
-
allowedLevels={allowedLevels}
|
|
37
|
-
onItemRestore={onItemRestore}
|
|
38
|
-
onItemLevelAdd={onItemLevelAdd}
|
|
39
|
-
onItemRemove={onItemRemove}
|
|
40
|
-
onItemEdit={onItemEdit}
|
|
41
|
-
onItemReOrder={onItemReOrder}
|
|
42
|
-
onItemToggleCollapse={onItemToggleCollapse}
|
|
43
|
-
error={error}
|
|
44
|
-
displayChildren={displayFlat}
|
|
45
|
-
config={{
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const prop_types_1 = __importDefault(require("prop-types"));
|
|
8
|
+
const Item_1 = __importDefault(require("../Item"));
|
|
9
|
+
const Wrapper_1 = __importDefault(require("./Wrapper"));
|
|
10
|
+
const List = ({ allowedLevels, error, isParentAttachedToMenu = false, items, level = 0, levelPath = '', onItemEdit, onItemLevelAdd, onItemRemove, onItemRestore, onItemReOrder, onItemToggleCollapse, displayFlat, contentTypes, contentTypesNameFields, }) => (react_1.default.createElement(Wrapper_1.default, { level: level }, items.map((item, n) => {
|
|
11
|
+
const { relatedRef, ...itemProps } = item;
|
|
12
|
+
return (react_1.default.createElement(Item_1.default, { key: `list-item-${item.viewId || n}`, item: itemProps, isLast: n === items.length - 1, relatedRef: relatedRef, level: level, levelPath: levelPath, isParentAttachedToMenu: isParentAttachedToMenu, allowedLevels: allowedLevels, onItemRestore: onItemRestore, onItemLevelAdd: onItemLevelAdd, onItemRemove: onItemRemove, onItemEdit: onItemEdit, onItemReOrder: onItemReOrder, onItemToggleCollapse: onItemToggleCollapse, error: error, displayChildren: displayFlat, config: {
|
|
46
13
|
contentTypes,
|
|
47
14
|
contentTypesNameFields
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
);
|
|
51
|
-
})}
|
|
52
|
-
</Wrapper>
|
|
53
|
-
);
|
|
54
|
-
|
|
15
|
+
} }));
|
|
16
|
+
})));
|
|
55
17
|
List.propTypes = {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
18
|
+
allowedLevels: prop_types_1.default.number,
|
|
19
|
+
isParentAttachedToMenu: prop_types_1.default.bool,
|
|
20
|
+
items: prop_types_1.default.array,
|
|
21
|
+
level: prop_types_1.default.number,
|
|
22
|
+
onItemLevelAdd: prop_types_1.default.func.isRequired,
|
|
23
|
+
onItemRemove: prop_types_1.default.func.isRequired,
|
|
24
|
+
onItemRestore: prop_types_1.default.func.isRequired,
|
|
25
|
+
onItemRestore: prop_types_1.default.func.isRequired,
|
|
26
|
+
onItemReOrder: prop_types_1.default.func.isRequired,
|
|
27
|
+
onItemToggleCollapse: prop_types_1.default.func.isRequired,
|
|
28
|
+
contentTypes: prop_types_1.default.array.isRequired,
|
|
29
|
+
contentTypesNameFields: prop_types_1.default.object.isRequired
|
|
68
30
|
};
|
|
69
|
-
|
|
70
|
-
|
|
31
|
+
exports.default = List;
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
7
|
+
const Alert_1 = require("@strapi/design-system/Alert");
|
|
8
|
+
exports.default = (0, styled_components_1.default)(Alert_1.Alert) `
|
|
5
9
|
[role="status"] {
|
|
6
10
|
flex-direction: column;
|
|
7
11
|
}
|
|
8
|
-
|
|
12
|
+
`;
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,47 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const react_intl_1 = require("react-intl");
|
|
31
|
+
const IconButton_1 = require("@strapi/design-system/IconButton");
|
|
32
|
+
const Searchbar_1 = require("@strapi/design-system/Searchbar");
|
|
33
|
+
const Search_1 = __importDefault(require("@strapi/icons/Search"));
|
|
34
|
+
const translations_1 = require("../../translations");
|
|
8
35
|
const Search = ({ value, setValue }) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
id: getTradId('pages.main.search.placeholder'),
|
|
33
|
-
defaultMessage: 'Type to start searching...',
|
|
34
|
-
})}
|
|
35
|
-
>
|
|
36
|
-
Search for navigation items
|
|
37
|
-
</Searchbar>
|
|
38
|
-
</div>
|
|
39
|
-
);
|
|
40
|
-
} else {
|
|
41
|
-
return (
|
|
42
|
-
<IconButton icon={<SearchIcon />} onClick={() => setIsOpen(!isOpen)} />
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export default Search;
|
|
36
|
+
const [isOpen, setIsOpen] = (0, react_1.useState)(!!value);
|
|
37
|
+
const wrapperRef = (0, react_1.useRef)(null);
|
|
38
|
+
const { formatMessage } = (0, react_intl_1.useIntl)();
|
|
39
|
+
(0, react_1.useEffect)(() => {
|
|
40
|
+
if (isOpen) {
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
wrapperRef.current.querySelector('input').focus();
|
|
43
|
+
}, 0);
|
|
44
|
+
}
|
|
45
|
+
}, [isOpen]);
|
|
46
|
+
if (isOpen) {
|
|
47
|
+
return (react_1.default.createElement("div", { ref: wrapperRef },
|
|
48
|
+
react_1.default.createElement(Searchbar_1.Searchbar, { name: "searchbar", onClear: () => { setValue(''); setIsOpen(false); }, value: value, size: "S", onChange: (e) => setValue(e.target.value), clearLabel: "Clearing the search", placeholder: formatMessage({
|
|
49
|
+
id: (0, translations_1.getTradId)('pages.main.search.placeholder'),
|
|
50
|
+
defaultMessage: 'Type to start searching...',
|
|
51
|
+
}) }, "Search for navigation items")));
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
return (react_1.default.createElement(IconButton_1.IconButton, { icon: react_1.default.createElement(Search_1.default, null), onClick: () => setIsOpen(!isOpen) }));
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
exports.default = Search;
|
|
58
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
4
7
|
const initSize = 92;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
H14c-3.6,0-6.5,2.9-6.5,6.5s2.9,6.5,6.5,6.5h64C81.6,81.5,84.5,78.6,84.5,75z"/>
|
|
11
|
-
</g>
|
|
12
|
-
</svg>;
|
|
13
|
-
|
|
14
|
-
export default NavigationIcon;
|
|
8
|
+
const NavigationIcon = ({ width = 24, height = 24 }) => react_1.default.createElement("svg", { viewBox: `0 0 ${width} ${height}`, xmlns: "http://www.w3.org/2000/svg" },
|
|
9
|
+
react_1.default.createElement("g", { style: { transform: `scale(${width / initSize})` } },
|
|
10
|
+
react_1.default.createElement("path", { d: "M78,23.5H14c-3.6,0-6.5-2.9-6.5-6.5s2.9-6.5,6.5-6.5h64c3.6,0,6.5,2.9,6.5,6.5S81.6,23.5,78,23.5z M84.5,46\n c0-3.6-2.9-6.5-6.5-6.5H14c-3.6,0-6.5,2.9-6.5,6.5s2.9,6.5,6.5,6.5h64C81.6,52.5,84.5,49.6,84.5,46z M84.5,75c0-3.6-2.9-6.5-6.5-6.5\n H14c-3.6,0-6.5,2.9-6.5,6.5s2.9,6.5,6.5,6.5h64C81.6,81.5,84.5,78.6,84.5,75z" })));
|
|
11
|
+
exports.default = NavigationIcon;
|
|
12
|
+
//# sourceMappingURL=navigation.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const DataManagerContext = (0, react_1.createContext)();
|
|
5
|
+
exports.default = DataManagerContext;
|
|
6
|
+
//# sourceMappingURL=DataManagerContext.js.map
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_query_1 = require("react-query");
|
|
4
|
+
const helper_plugin_1 = require("@strapi/helper-plugin");
|
|
5
|
+
const api_1 = require("../utils/api");
|
|
5
6
|
const useAllContentTypes = () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
);
|
|
10
|
-
return { data, isLoading, };
|
|
7
|
+
const toggleNotification = (0, helper_plugin_1.useNotification)();
|
|
8
|
+
const { isLoading, data } = (0, react_query_1.useQuery)('contentTypes', () => (0, api_1.fetchAllContentTypes)(toggleNotification));
|
|
9
|
+
return { data, isLoading, };
|
|
11
10
|
};
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
exports.default = useAllContentTypes;
|
|
12
|
+
//# sourceMappingURL=useAllContentTypes.js.map
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const DataManagerContext_1 = __importDefault(require("../contexts/DataManagerContext"));
|
|
8
|
+
const useDataManager = () => (0, react_1.useContext)(DataManagerContext_1.default);
|
|
9
|
+
exports.default = useDataManager;
|
|
10
|
+
//# sourceMappingURL=useDataManager.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ConfirmEffect } from "../pages/View/components/I18nCopyNavigationItems";
|
|
3
|
+
export declare const useI18nCopyNavigationItemsModal: (onConfirm: ConfirmEffect) => {
|
|
4
|
+
setI18nCopyModalOpened: React.Dispatch<React.SetStateAction<boolean>>;
|
|
5
|
+
setI18nCopySourceLocale: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
6
|
+
i18nCopyItemsModal: JSX.Element | null;
|
|
7
|
+
i18nCopySourceLocale: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=useI18nCopyNavigationItemsModal.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useI18nCopyNavigationItemsModal = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const I18nCopyNavigationItems_1 = require("../pages/View/components/I18nCopyNavigationItems");
|
|
29
|
+
const useI18nCopyNavigationItemsModal = (onConfirm) => {
|
|
30
|
+
const [isOpened, setIsOpened] = (0, react_1.useState)(false);
|
|
31
|
+
const [sourceLocale, setSourceLocale] = (0, react_1.useState)(undefined);
|
|
32
|
+
const onCancel = (0, react_1.useCallback)(() => {
|
|
33
|
+
setIsOpened(false);
|
|
34
|
+
}, [setIsOpened]);
|
|
35
|
+
const onConfirmWithModalClose = (0, react_1.useCallback)(() => {
|
|
36
|
+
if (!sourceLocale) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
onConfirm(sourceLocale);
|
|
40
|
+
setIsOpened(false);
|
|
41
|
+
}, [onConfirm, sourceLocale]);
|
|
42
|
+
const modal = (0, react_1.useMemo)(() => isOpened ? (react_1.default.createElement(I18nCopyNavigationItems_1.I18nCopyNavigationItemsModal, { onConfirm: onConfirmWithModalClose, onCancel: onCancel })) : null, [isOpened, onConfirmWithModalClose, onCancel]);
|
|
43
|
+
return (0, react_1.useMemo)(() => ({
|
|
44
|
+
setI18nCopyModalOpened: setIsOpened,
|
|
45
|
+
setI18nCopySourceLocale: setSourceLocale,
|
|
46
|
+
i18nCopyItemsModal: modal,
|
|
47
|
+
i18nCopySourceLocale: sourceLocale,
|
|
48
|
+
}), [setSourceLocale, setIsOpened, modal, sourceLocale]);
|
|
49
|
+
};
|
|
50
|
+
exports.useI18nCopyNavigationItemsModal = useI18nCopyNavigationItemsModal;
|
|
51
|
+
//# sourceMappingURL=useI18nCopyNavigationItemsModal.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default useNavigationConfig;
|
|
2
|
+
declare function useNavigationConfig(): {
|
|
3
|
+
data: any;
|
|
4
|
+
isLoading: any;
|
|
5
|
+
err: any;
|
|
6
|
+
submitMutation: (...args: any[]) => Promise<void>;
|
|
7
|
+
restoreMutation: (...args: any[]) => Promise<void>;
|
|
8
|
+
restartMutation: (...args: any[]) => Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useNavigationConfig.d.ts.map
|
|
@@ -1,58 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_query_1 = require("react-query");
|
|
4
|
+
const helper_plugin_1 = require("@strapi/helper-plugin");
|
|
5
|
+
const api_1 = require("../utils/api");
|
|
6
|
+
const translations_1 = require("../translations");
|
|
6
7
|
const useNavigationConfig = () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
handleError('restart');
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return { data, isLoading, err, submitMutation, restoreMutation, restartMutation };
|
|
8
|
+
const queryClient = (0, react_query_1.useQueryClient)();
|
|
9
|
+
const toggleNotification = (0, helper_plugin_1.useNotification)();
|
|
10
|
+
const { isLoading, data, err } = (0, react_query_1.useQuery)('navigationConfig', () => (0, api_1.fetchNavigationConfig)(toggleNotification));
|
|
11
|
+
const handleError = (type) => {
|
|
12
|
+
toggleNotification({
|
|
13
|
+
type: 'warning',
|
|
14
|
+
message: (0, translations_1.getTrad)(`pages.settings.notification.${type}.error`),
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
const handleSuccess = async (type) => {
|
|
18
|
+
await queryClient.invalidateQueries('navigationConfig');
|
|
19
|
+
toggleNotification({
|
|
20
|
+
type: 'success',
|
|
21
|
+
message: (0, translations_1.getTrad)(`pages.settings.notification.${type}.success`),
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
const submitMutation = async (...args) => {
|
|
25
|
+
try {
|
|
26
|
+
await (0, api_1.updateNavigationConfig)(...args);
|
|
27
|
+
await handleSuccess('submit');
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
30
|
+
handleError('submit');
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const restoreMutation = async (...args) => {
|
|
34
|
+
try {
|
|
35
|
+
await (0, api_1.restoreNavigationConfig)(...args);
|
|
36
|
+
await handleSuccess('restore');
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
handleError('restore');
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const restartMutation = async (...args) => {
|
|
43
|
+
try {
|
|
44
|
+
await (0, api_1.restartStrapi)(...args);
|
|
45
|
+
await handleSuccess('restart');
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
handleError('restart');
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
return { data, isLoading, err, submitMutation, restoreMutation, restartMutation };
|
|
56
52
|
};
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
exports.default = useNavigationConfig;
|
|
54
|
+
//# sourceMappingURL=useNavigationConfig.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const useNavigationManager: () => {
|
|
3
|
+
navigationManagerModal: JSX.Element | null;
|
|
4
|
+
openNavigationManagerModal: () => void;
|
|
5
|
+
closeNavigationManagerModal: () => void;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=useNavigationManager.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useNavigationManager = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const NavigationManager_1 = require("../pages/View/components/NavigationManager");
|
|
29
|
+
const useNavigationManager = () => {
|
|
30
|
+
const [isOpened, setIsOpened] = (0, react_1.useState)(false);
|
|
31
|
+
const open = (0, react_1.useCallback)(() => setIsOpened(true), [setIsOpened]);
|
|
32
|
+
const close = (0, react_1.useCallback)(() => setIsOpened(false), [setIsOpened]);
|
|
33
|
+
const modal = (0, react_1.useMemo)(() => isOpened ? (react_1.default.createElement(NavigationManager_1.NavigationManager, { initialState: { view: "INITIAL" }, isOpened: true, onClose: close })) : null, [isOpened, close]);
|
|
34
|
+
return (0, react_1.useMemo)(() => ({
|
|
35
|
+
navigationManagerModal: modal,
|
|
36
|
+
openNavigationManagerModal: open,
|
|
37
|
+
closeNavigationManagerModal: close,
|
|
38
|
+
}), [modal, open, close]);
|
|
39
|
+
};
|
|
40
|
+
exports.useNavigationManager = useNavigationManager;
|
|
41
|
+
//# sourceMappingURL=useNavigationManager.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
function register(app: any): void;
|
|
3
|
+
function register(app: any): void;
|
|
4
|
+
function bootstrap(): void;
|
|
5
|
+
function bootstrap(): void;
|
|
6
|
+
function registerTrads({ locales }: {
|
|
7
|
+
locales: any;
|
|
8
|
+
}): Promise<any[]>;
|
|
9
|
+
function registerTrads({ locales }: {
|
|
10
|
+
locales: any;
|
|
11
|
+
}): Promise<any[]>;
|
|
12
|
+
}
|
|
13
|
+
export default _default;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|