strapi-plugin-navigation 2.0.13 → 2.1.0-beta.1
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 +98 -26
- 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 +169 -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/useNavigationConfig.d.ts +10 -0
- package/admin/src/hooks/useNavigationConfig.js +52 -56
- 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 +280 -300
- 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 +20 -0
- package/admin/src/pages/View/components/I18nCopyNavigationItems/index.js +60 -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 +74 -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 +51 -0
- package/admin/src/pages/View/components/NavigationItemForm/index.js +322 -454
- package/admin/src/pages/View/components/NavigationItemForm/utils/form.d.ts +45 -0
- package/admin/src/pages/View/components/NavigationItemForm/utils/form.js +81 -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 +27 -0
- package/admin/src/pages/View/components/NavigationItemPopup/index.js +59 -108
- package/admin/src/pages/View/index.d.ts +4 -0
- package/admin/src/pages/View/index.js +229 -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 +44 -0
- package/admin/src/pages/View/utils/parsers.js +231 -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 +126 -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 +5 -0
- package/admin/src/utils/index.js +21 -15
- package/package.json +19 -17
- 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 +77 -0
- package/server/controllers/client.d.ts +4 -0
- package/server/controllers/client.js +34 -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 +23 -0
- package/server/graphql/queries/render-navigation.js +29 -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 +9 -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 +12 -0
- package/server/i18n/serviceEnhancers.js +117 -0
- package/server/i18n/types.d.ts +54 -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 +37 -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 +72 -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 +183 -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 +138 -0
- package/server/utils/functions.js +224 -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 +35 -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 +68 -0
- package/types/services.js +3 -0
- package/types/utils.d.ts +58 -0
- package/types/utils.js +26 -0
- package/utils/InvalidParamNavigationError.d.ts +4 -0
- package/utils/InvalidParamNavigationError.js +11 -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
package/README.md
CHANGED
|
@@ -44,12 +44,13 @@ Strapi Navigation Plugin provides a website navigation / menu builder feature fo
|
|
|
44
44
|
- [Settings page](#in-v203-and-newer)
|
|
45
45
|
- [Plugin file](#in-v202-and-older--default-configuration-state-for-v203-and-newer)
|
|
46
46
|
5. [🔧 GraphQL Configuration](#-gql-configuration)
|
|
47
|
-
6. [
|
|
47
|
+
6. [🌍 i18n Internationalization](#-i18n-internationalization)
|
|
48
|
+
7. [🕸️ Public API specification](#%EF%B8%8F-public-api-specification)
|
|
48
49
|
- [REST API](#rest-api)
|
|
49
50
|
- [GraphQL API](#graphql-api)
|
|
50
51
|
8. [💬 FAQ](#-faq)
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
10. [🤝 Contributing](#-contributing)
|
|
53
|
+
11. [👨💻 Community support](#-community-support)
|
|
53
54
|
|
|
54
55
|
## ✨ Features
|
|
55
56
|
|
|
@@ -59,6 +60,7 @@ Strapi Navigation Plugin provides a website navigation / menu builder feature fo
|
|
|
59
60
|
- **Different types of navigation items:** Create navigation with items linked to internal types, to external links or wrapper elements to keep structure clean
|
|
60
61
|
- **Multiple navigations:** Create as many Navigation containers as you want, setup them and use in the consumer application
|
|
61
62
|
- **Light / Dark mode compatible:** By design we're supporting Strapi ☀️ Light / 🌙 Dark modes
|
|
63
|
+
- **Webhooks integration:** Changes to navigation will trigger 'entry.update' or 'entry.create' webhook events.
|
|
62
64
|
- **Customizable:** Possibility to customize the options like: available Content Types, Maximum level for "attach to menu", Additional fields (audience)
|
|
63
65
|
- **[Audit log](https://github.com/VirtusLab/strapi-molecules/tree/master/packages/strapi-plugin-audit-log):** integration with Strapi Molecules Audit Log plugin that provides changes track record
|
|
64
66
|
|
|
@@ -165,6 +167,7 @@ Config for this plugin is stored as a part of the `config/plugins.js` or `config
|
|
|
165
167
|
- `contentTypes` - UIDs of related content types
|
|
166
168
|
- `contentTypesNameFields` - Definition of content type title fields like `'api::<collection name>.<content type name>': ['field_name_1', 'field_name_2']`, if not set titles are pulled from fields like `['title', 'subject', 'name']`. **TIP** - Proper content type uid you can find in the URL of Content Manager where you're managing relevant entities like: `admin/content-manager/collectionType/< THE UID HERE >?page=1&pageSize=10&sort=Title:ASC&plugins[i18n][locale]=en`
|
|
167
169
|
- `gql` - If you're using GraphQL that's the right place to put all necessary settings. More **[ here ](#gql-configuration)**
|
|
170
|
+
- `i18nEnabled` - should you want to manage multi-locale content via navigation set this value `Enabled`. More **[ here ](#i18n-internationalization)**
|
|
168
171
|
|
|
169
172
|
## 🔧 GQL Configuration
|
|
170
173
|
Using navigation with GraphQL requires both plugins to be installed and working. You can find installation guide for GraphQL plugin **[here](https://docs.strapi.io/developer-docs/latest/plugins/graphql.html#graphql)**. To properly configure GQL to work with navigation you should provide `gql` prop. This should contain union types that will be used to define GQL response format for your data while fetching:
|
|
@@ -195,6 +198,38 @@ gql: {
|
|
|
195
198
|
```
|
|
196
199
|
where `Page` and `UploadFile` are your type names for the **Content Types** you're referring by navigation items relations.
|
|
197
200
|
|
|
201
|
+
## 🌍 i18n Internationalization
|
|
202
|
+
|
|
203
|
+
### Settings
|
|
204
|
+
|
|
205
|
+
This feature is **opt-in**.
|
|
206
|
+
|
|
207
|
+
In order to use this functionality setting **default locale** is required. (See: Settings -> Internationalization)
|
|
208
|
+
|
|
209
|
+
Once feature is enabled a restart is required. On server startup missing navigations for other locales will be created. From then you can manage navigation's localizations just like before.
|
|
210
|
+
|
|
211
|
+
If you want go back to _pre-i18n_ way you can disable it in settings. Already created navigations will not be removed unless you make a choice for plugin to do so(this will require a restart).
|
|
212
|
+
|
|
213
|
+
If your newly created navigation localization is empty you can copy contents of one version's to the empty one. If related item is localized and locale version exists localization will be used as a related item. Otherwise plugin will fallback to an original item.
|
|
214
|
+
|
|
215
|
+
### Rendering
|
|
216
|
+
|
|
217
|
+
Shape of the rendered navigation will not change. Querying stays almost the same. To query for specific locale version just add `locale` query param. For example:
|
|
218
|
+
|
|
219
|
+
```https://yourdomain.cool/api/navigation/render/1?locale=fr```
|
|
220
|
+
|
|
221
|
+
or
|
|
222
|
+
|
|
223
|
+
```https://yourdomain.cool/api/navigation/render/main-navigation?locale=fr```
|
|
224
|
+
|
|
225
|
+
If `locale` is not specified whatever version used to be at id `1` will be returned.
|
|
226
|
+
|
|
227
|
+
Of course if you know that `fr` version is present at id `2` you can just query for that.
|
|
228
|
+
|
|
229
|
+
### GraphQL
|
|
230
|
+
|
|
231
|
+
If feature is enabled GQL render navigation query is expanded to handle `locale` param(it will work the same as regular requests). Checkout schema provided by GraphQL plugin.
|
|
232
|
+
|
|
198
233
|
## 👤 RBAC
|
|
199
234
|
Plugin provides granular permissions based on Strapi RBAC functionality.
|
|
200
235
|
|
|
@@ -296,7 +331,7 @@ Plugin supports both **REST API** and **GraphQL API** exposed by Strapi.
|
|
|
296
331
|
|
|
297
332
|
`GET <host>/api/navigation/render/<navigationIdOrSlug>?type=<type>`
|
|
298
333
|
|
|
299
|
-
Return a rendered navigation structure depends on passed type (`
|
|
334
|
+
Return a rendered navigation structure depends on passed type (`TREE`, `RFR` or nothing to render as `FLAT`).
|
|
300
335
|
|
|
301
336
|
> The ID of navigation by default is `1`, if you've got defined multiple navigations you must work with their IDs or Slugs to fetch.
|
|
302
337
|
|
|
@@ -329,7 +364,7 @@ Return a rendered navigation structure depends on passed type (`tree`, `rfr` or
|
|
|
329
364
|
]
|
|
330
365
|
```
|
|
331
366
|
|
|
332
|
-
**Example URL**: `https://localhost:1337/api/navigation/render/1?type=
|
|
367
|
+
**Example URL**: `https://localhost:1337/api/navigation/render/1?type=TREE`
|
|
333
368
|
|
|
334
369
|
**Example response body**
|
|
335
370
|
|
|
@@ -365,7 +400,7 @@ Return a rendered navigation structure depends on passed type (`tree`, `rfr` or
|
|
|
365
400
|
]
|
|
366
401
|
```
|
|
367
402
|
|
|
368
|
-
**Example URL**: `https://localhost:1337/api/navigation/render/1?type=
|
|
403
|
+
**Example URL**: `https://localhost:1337/api/navigation/render/1?type=RFR`
|
|
369
404
|
|
|
370
405
|
**Example response body**
|
|
371
406
|
|
|
@@ -450,7 +485,7 @@ Return a rendered navigation structure depends on passed type (`tree`, `rfr` or
|
|
|
450
485
|
|
|
451
486
|
### GraphQL API
|
|
452
487
|
|
|
453
|
-
Same as [**REST API**](#rest-api) returns a rendered navigation structure depends on passed type (`
|
|
488
|
+
Same as [**REST API**](#rest-api) returns a rendered navigation structure depends on passed type (`TREE`, `RFR` or nothing to render as `FLAT`).
|
|
454
489
|
|
|
455
490
|
**Example request**
|
|
456
491
|
|
|
@@ -465,14 +500,17 @@ query {
|
|
|
465
500
|
title
|
|
466
501
|
path
|
|
467
502
|
related {
|
|
468
|
-
|
|
503
|
+
id
|
|
504
|
+
attributes {
|
|
505
|
+
__typename
|
|
469
506
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
507
|
+
... on Page {
|
|
508
|
+
Title
|
|
509
|
+
}
|
|
473
510
|
|
|
474
|
-
|
|
475
|
-
|
|
511
|
+
... on WithFlowType {
|
|
512
|
+
Name
|
|
513
|
+
}
|
|
476
514
|
}
|
|
477
515
|
}
|
|
478
516
|
items {
|
|
@@ -480,14 +518,17 @@ query {
|
|
|
480
518
|
title
|
|
481
519
|
path
|
|
482
520
|
related {
|
|
483
|
-
|
|
521
|
+
id
|
|
522
|
+
attributes {
|
|
523
|
+
__typename
|
|
484
524
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
525
|
+
... on Page {
|
|
526
|
+
Title
|
|
527
|
+
}
|
|
488
528
|
|
|
489
|
-
|
|
490
|
-
|
|
529
|
+
... on WithFlowType {
|
|
530
|
+
Name
|
|
531
|
+
}
|
|
491
532
|
}
|
|
492
533
|
}
|
|
493
534
|
}
|
|
@@ -506,8 +547,11 @@ query {
|
|
|
506
547
|
"title": "Test page",
|
|
507
548
|
"path": "/test-path",
|
|
508
549
|
"related": {
|
|
509
|
-
"
|
|
510
|
-
"
|
|
550
|
+
"id": 3,
|
|
551
|
+
"attributes": {
|
|
552
|
+
"__typename": "WithFlowType",
|
|
553
|
+
"Name": "Test"
|
|
554
|
+
}
|
|
511
555
|
},
|
|
512
556
|
"items": [
|
|
513
557
|
{
|
|
@@ -515,8 +559,11 @@ query {
|
|
|
515
559
|
"title": "Nested",
|
|
516
560
|
"path": "/test-path/nested-one",
|
|
517
561
|
"related": {
|
|
518
|
-
"
|
|
519
|
-
"
|
|
562
|
+
"id": 1,
|
|
563
|
+
"attributes": {
|
|
564
|
+
"__typename": "Page",
|
|
565
|
+
"Title": "Eg. Page title"
|
|
566
|
+
}
|
|
520
567
|
}
|
|
521
568
|
}
|
|
522
569
|
]
|
|
@@ -526,8 +573,11 @@ query {
|
|
|
526
573
|
"title": "Another page",
|
|
527
574
|
"path": "/another",
|
|
528
575
|
"related": {
|
|
529
|
-
"
|
|
530
|
-
"
|
|
576
|
+
"id": 2,
|
|
577
|
+
"attributes": {
|
|
578
|
+
"__typename": "Page",
|
|
579
|
+
"Title": "dfdfdf"
|
|
580
|
+
}
|
|
531
581
|
},
|
|
532
582
|
"items": []
|
|
533
583
|
}
|
|
@@ -554,7 +604,7 @@ Live example of plugin usage can be found in the [VirtusLab Strapi Examples](htt
|
|
|
554
604
|
|
|
555
605
|
**Q:** I would like to use GraphQL schemas but I'm not getting renderNavigation query or even proper types as Navigation, NavigationItem etc. What should I do?
|
|
556
606
|
|
|
557
|
-
**A:** There is a one trick you might try. Strapi by default is ordering plugins by the way which takes `strapi-plugin-graphql` to initialize earlier than other plugins so types might not be injected. If you don't have it yet, please create `config/plugins.js` file and put there at
|
|
607
|
+
**A:** **A:** There is a one trick you might try. Strapi by default is ordering plugins by the way which takes `strapi-plugin-graphql` to initialize earlier than other plugins so types might not be injected. If you don't have it yet, please create `config/plugins.js` file and put there following lines (put `graphql` at the end):
|
|
558
608
|
|
|
559
609
|
```js
|
|
560
610
|
module.exports = {
|
|
@@ -578,6 +628,28 @@ If you already got it, make sure that `navigation` plugin is inserted before `gr
|
|
|
578
628
|
|
|
579
629
|
Feel free to fork and make a Pull Request to this plugin project. All the input is warmly welcome!
|
|
580
630
|
|
|
631
|
+
- Clone repository
|
|
632
|
+
|
|
633
|
+
```
|
|
634
|
+
git clone git@github.com:VirtusLab-Open-Source/strapi-plugin-navigation.git
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
- Create a soft link in your strapi project to plugin build folder
|
|
638
|
+
|
|
639
|
+
```sh
|
|
640
|
+
ln -s <...>/strapi-plugin-navigation/build <...>/strapi-project/src/plugins/navigation
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
- Run build command
|
|
644
|
+
|
|
645
|
+
```ts
|
|
646
|
+
// Watch for file changes
|
|
647
|
+
yarn develop
|
|
648
|
+
|
|
649
|
+
// or run build without nodemon
|
|
650
|
+
yarn build:dev
|
|
651
|
+
```
|
|
652
|
+
|
|
581
653
|
## 👨💻 Community support
|
|
582
654
|
|
|
583
655
|
For general help using Strapi, please refer to [the official Strapi documentation](https://strapi.io/documentation/). For additional help, you can use one of these channels to ask a question:
|
|
@@ -1,8 +1,14 @@
|
|
|
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
|
+
exports.PermanentAlert = void 0;
|
|
7
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
+
const Alert_1 = require("@strapi/design-system/Alert");
|
|
9
|
+
exports.PermanentAlert = (0, styled_components_1.default)(Alert_1.Alert) `
|
|
5
10
|
button {
|
|
6
11
|
display: none;
|
|
7
12
|
}
|
|
8
13
|
`;
|
|
14
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
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 styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
+
const Flex_1 = require("@strapi/design-system/Flex");
|
|
9
|
+
const Typography_1 = require("@strapi/design-system/Typography");
|
|
10
|
+
const Icon_1 = require("@strapi/design-system/Icon");
|
|
11
|
+
const icons_1 = require("@strapi/icons");
|
|
12
|
+
const Wrapper = styled_components_1.default.div `
|
|
9
13
|
border-radius: 50%;
|
|
10
14
|
background: #DCDCE4;
|
|
11
15
|
width: 25px;
|
|
@@ -15,17 +19,12 @@ const Wrapper = styled.div`
|
|
|
15
19
|
align-items: center;
|
|
16
20
|
margin-right: 8px;
|
|
17
21
|
`;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<Typography variant="pi">{itemsCount} nested items</Typography>
|
|
28
|
-
</Flex >
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
export default CollapseButton;
|
|
22
|
+
const CollapseButton = ({ toggle, collapsed, itemsCount }) => (react_1.default.createElement(Flex_1.Flex, { justifyContent: 'space-between', alignItems: 'center', onClick: toggle, cursor: "pointer", style: { marginRight: '16px' } },
|
|
23
|
+
react_1.default.createElement(Wrapper, null, collapsed ?
|
|
24
|
+
react_1.default.createElement(Icon_1.Icon, { as: icons_1.CarretDown, width: '7px', height: '4px' }) :
|
|
25
|
+
react_1.default.createElement(Icon_1.Icon, { as: icons_1.CarretUp, width: '7px', height: '4px' })),
|
|
26
|
+
react_1.default.createElement(Typography_1.Typography, { variant: "pi" },
|
|
27
|
+
itemsCount,
|
|
28
|
+
" nested items")));
|
|
29
|
+
exports.default = CollapseButton;
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export default ConfirmationDialog;
|
|
2
|
+
declare function ConfirmationDialog({ isVisible, isActionAsync, children, onConfirm, onCancel, header, labelCancel, labelConfirm, iconConfirm, mainIcon }: {
|
|
3
|
+
isVisible?: boolean | undefined;
|
|
4
|
+
isActionAsync?: boolean | undefined;
|
|
5
|
+
children: any;
|
|
6
|
+
onConfirm: any;
|
|
7
|
+
onCancel: any;
|
|
8
|
+
header: any;
|
|
9
|
+
labelCancel: any;
|
|
10
|
+
labelConfirm: any;
|
|
11
|
+
iconConfirm: any;
|
|
12
|
+
mainIcon?: JSX.Element | undefined;
|
|
13
|
+
}): JSX.Element;
|
|
14
|
+
declare namespace ConfirmationDialog {
|
|
15
|
+
namespace propTypes {
|
|
16
|
+
const isVisible: PropTypes.Requireable<boolean>;
|
|
17
|
+
const isActionAsync: PropTypes.Requireable<boolean>;
|
|
18
|
+
const children: PropTypes.Requireable<any>;
|
|
19
|
+
const header: PropTypes.Requireable<string>;
|
|
20
|
+
const labelCancel: PropTypes.Requireable<string>;
|
|
21
|
+
const labelConfirm: PropTypes.Requireable<string>;
|
|
22
|
+
const iconConfirm: PropTypes.Requireable<object>;
|
|
23
|
+
const onConfirm: PropTypes.Validator<(...args: any[]) => any>;
|
|
24
|
+
const onCancel: PropTypes.Validator<(...args: any[]) => any>;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
import PropTypes from "prop-types";
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,56 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
onCancel,
|
|
23
|
-
header,
|
|
24
|
-
labelCancel,
|
|
25
|
-
labelConfirm,
|
|
26
|
-
iconConfirm
|
|
27
|
-
}) => (
|
|
28
|
-
<Dialog onClose={onCancel} title={header || getMessage('components.confirmation.dialog.header', 'Confirmation')} isOpen={isVisible}>
|
|
29
|
-
<DialogBody icon={<ExclamationMarkCircle />}>
|
|
30
|
-
<Stack spacing={2}>
|
|
31
|
-
<Flex justifyContent="center">
|
|
32
|
-
<Typography id="dialog-confirm-description">{children || getMessage('components.confirmation.dialog.description')}</Typography>
|
|
33
|
-
</Flex>
|
|
34
|
-
</Stack>
|
|
35
|
-
</DialogBody>
|
|
36
|
-
<DialogFooter startAction={<Button onClick={onCancel} variant="tertiary" disabled={isActionAsync}>
|
|
37
|
-
{labelCancel || getMessage('components.confirmation.dialog.button.cancel', 'Cancel')}
|
|
38
|
-
</Button>} endAction={<Button onClick={onConfirm} variant="danger-light" startIcon={iconConfirm || <Check />} disabled={isActionAsync}>
|
|
39
|
-
{labelConfirm || getMessage('components.confirmation.dialog.button.confirm', 'Confirm')}
|
|
40
|
-
</Button>} />
|
|
41
|
-
</Dialog>
|
|
42
|
-
);
|
|
43
|
-
|
|
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 Button_1 = require("@strapi/design-system/Button");
|
|
9
|
+
const Dialog_1 = require("@strapi/design-system/Dialog");
|
|
10
|
+
const Flex_1 = require("@strapi/design-system/Flex");
|
|
11
|
+
const Stack_1 = require("@strapi/design-system/Stack");
|
|
12
|
+
const Typography_1 = require("@strapi/design-system/Typography");
|
|
13
|
+
const icons_1 = require("@strapi/icons");
|
|
14
|
+
const utils_1 = require("../../utils");
|
|
15
|
+
const DEFAULT_ICON = react_1.default.createElement(icons_1.ExclamationMarkCircle, null);
|
|
16
|
+
const ConfirmationDialog = ({ isVisible = false, isActionAsync = false, children, onConfirm, onCancel, header, labelCancel, labelConfirm, iconConfirm, mainIcon = DEFAULT_ICON }) => (react_1.default.createElement(Dialog_1.Dialog, { onClose: onCancel, title: header || (0, utils_1.getMessage)('components.confirmation.dialog.header', 'Confirmation'), isOpen: isVisible },
|
|
17
|
+
react_1.default.createElement(Dialog_1.DialogBody, { icon: mainIcon },
|
|
18
|
+
react_1.default.createElement(Stack_1.Stack, { spacing: 2 },
|
|
19
|
+
react_1.default.createElement(Flex_1.Flex, { justifyContent: "center" },
|
|
20
|
+
react_1.default.createElement(Typography_1.Typography, { id: "dialog-confirm-description" }, children || (0, utils_1.getMessage)('components.confirmation.dialog.description'))))),
|
|
21
|
+
react_1.default.createElement(Dialog_1.DialogFooter, { startAction: react_1.default.createElement(Button_1.Button, { onClick: onCancel, variant: "tertiary", disabled: isActionAsync }, labelCancel || (0, utils_1.getMessage)('components.confirmation.dialog.button.cancel', 'Cancel')), endAction: react_1.default.createElement(Button_1.Button, { onClick: onConfirm, variant: "danger-light", startIcon: iconConfirm || react_1.default.createElement(icons_1.Check, null), disabled: isActionAsync }, labelConfirm || (0, utils_1.getMessage)('components.confirmation.dialog.button.confirm', 'Confirm')) })));
|
|
44
22
|
ConfirmationDialog.propTypes = {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
23
|
+
isVisible: prop_types_1.default.bool,
|
|
24
|
+
isActionAsync: prop_types_1.default.bool,
|
|
25
|
+
children: prop_types_1.default.any,
|
|
26
|
+
header: prop_types_1.default.string,
|
|
27
|
+
labelCancel: prop_types_1.default.string,
|
|
28
|
+
labelConfirm: prop_types_1.default.string,
|
|
29
|
+
iconConfirm: prop_types_1.default.object,
|
|
30
|
+
onConfirm: prop_types_1.default.func.isRequired,
|
|
31
|
+
onCancel: prop_types_1.default.func.isRequired,
|
|
54
32
|
};
|
|
55
|
-
|
|
56
|
-
|
|
33
|
+
exports.default = ConfirmationDialog;
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 EmptyView = styled_components_1.default.div `
|
|
6
8
|
display: flex;
|
|
7
9
|
flex-grow: 1;
|
|
8
10
|
flex-direction: column;
|
|
@@ -22,5 +24,5 @@ const EmptyView = styled.div`
|
|
|
22
24
|
margin: 1rem;
|
|
23
25
|
}
|
|
24
26
|
`;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
exports.default = EmptyView;
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,10 +1,14 @@
|
|
|
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 Badge_1 = require("@strapi/design-system/Badge");
|
|
8
|
+
const ItemCardBadge = (0, styled_components_1.default)(Badge_1.Badge) `
|
|
5
9
|
border: 1px solid ${({ theme, borderColor }) => theme.colors[borderColor]};
|
|
6
10
|
|
|
7
|
-
${
|
|
11
|
+
${({ small, theme }) => small && `
|
|
8
12
|
padding: ${theme.spaces[1]} ${theme.spaces[2]};
|
|
9
13
|
margin: 0px ${theme.spaces[3]};
|
|
10
14
|
vertical-align: middle;
|
|
@@ -18,5 +22,5 @@ const ItemCardBadge = styled(Badge)`
|
|
|
18
22
|
}
|
|
19
23
|
`}
|
|
20
24
|
`;
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
exports.default = ItemCardBadge;
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,11 @@
|
|
|
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 Card_1 = require("@strapi/design-system/Card");
|
|
8
|
+
const CardItemTitle = (0, styled_components_1.default)(Card_1.CardTitle) `
|
|
5
9
|
width: 100%;
|
|
6
10
|
|
|
7
11
|
display: flex;
|
|
@@ -13,5 +17,5 @@ const CardItemTitle = styled(CardTitle)`
|
|
|
13
17
|
margin: 0px ${({ theme }) => theme.spaces[1]};
|
|
14
18
|
}
|
|
15
19
|
`;
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
exports.default = CardItemTitle;
|
|
21
|
+
//# sourceMappingURL=Wrapper.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default ItemCardHeader;
|
|
2
|
+
declare function ItemCardHeader({ title, path, icon, removed, onItemRemove, onItemEdit, onItemRestore, dragRef }: {
|
|
3
|
+
title: any;
|
|
4
|
+
path: any;
|
|
5
|
+
icon: any;
|
|
6
|
+
removed: any;
|
|
7
|
+
onItemRemove: any;
|
|
8
|
+
onItemEdit: any;
|
|
9
|
+
onItemRestore: any;
|
|
10
|
+
dragRef: any;
|
|
11
|
+
}): JSX.Element;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
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 styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
+
const Flex_1 = require("@strapi/design-system/Flex");
|
|
9
|
+
const IconButton_1 = require("@strapi/design-system/IconButton");
|
|
10
|
+
const Typography_1 = require("@strapi/design-system/Typography");
|
|
11
|
+
const Icon_1 = require("@strapi/design-system/Icon");
|
|
12
|
+
const icons_1 = require("@strapi/icons/");
|
|
13
|
+
const Wrapper_1 = __importDefault(require("./Wrapper"));
|
|
14
|
+
const ItemCardBadge_1 = __importDefault(require("../ItemCardBadge"));
|
|
15
|
+
const utils_1 = require("../../../utils");
|
|
16
|
+
const IconWrapper = styled_components_1.default.div `
|
|
15
17
|
display: flex;
|
|
16
18
|
align-items: center;
|
|
17
19
|
justify-content: center;
|
|
@@ -30,42 +32,21 @@ svg {
|
|
|
30
32
|
fill: ${({ theme }) => theme.colors.neutral500};
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
`;
|
|
35
36
|
const ItemCardHeader = ({ title, path, icon, removed, onItemRemove, onItemEdit, onItemRestore, dragRef }) => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
(<ItemCardBadge
|
|
53
|
-
borderColor={`danger200`}
|
|
54
|
-
backgroundColor={`danger100`}
|
|
55
|
-
textColor={`danger600`}
|
|
56
|
-
>
|
|
57
|
-
{getMessage("components.navigationItem.badge.removed")}
|
|
58
|
-
</ItemCardBadge>)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
<IconButton disabled={removed} onClick={onItemEdit} label="Edit" icon={<Pencil />} />
|
|
62
|
-
{removed ?
|
|
63
|
-
<IconButton onClick={onItemRestore} label="Restore" icon={<Refresh />} /> :
|
|
64
|
-
<IconButton onClick={onItemRemove} label="Remove" icon={<Trash />} />
|
|
65
|
-
}
|
|
66
|
-
</Flex>
|
|
67
|
-
</Wrapper>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export default ItemCardHeader;
|
|
37
|
+
return (react_1.default.createElement(Wrapper_1.default, null,
|
|
38
|
+
react_1.default.createElement(Flex_1.Flex, { alignItems: "center" },
|
|
39
|
+
react_1.default.createElement(IconButton_1.IconButton, { ref: dragRef, label: "Drag", icon: react_1.default.createElement(icons_1.Drag, null) }),
|
|
40
|
+
react_1.default.createElement(Typography_1.Typography, { variant: "omega", fontWeight: "bold" }, title),
|
|
41
|
+
react_1.default.createElement(Typography_1.Typography, { variant: "omega", fontWeight: "bold", textColor: 'neutral500' }, path),
|
|
42
|
+
react_1.default.createElement(Icon_1.Icon, { as: icon })),
|
|
43
|
+
react_1.default.createElement(Flex_1.Flex, { alignItems: "center", style: { zIndex: 2 } },
|
|
44
|
+
removed &&
|
|
45
|
+
(react_1.default.createElement(ItemCardBadge_1.default, { borderColor: `danger200`, backgroundColor: `danger100`, textColor: `danger600` }, (0, utils_1.getMessage)("components.navigationItem.badge.removed"))),
|
|
46
|
+
react_1.default.createElement(IconButton_1.IconButton, { disabled: removed, onClick: onItemEdit, label: "Edit", icon: react_1.default.createElement(icons_1.Pencil, null) }),
|
|
47
|
+
removed ?
|
|
48
|
+
react_1.default.createElement(IconButton_1.IconButton, { onClick: onItemRestore, label: "Restore", icon: react_1.default.createElement(icons_1.Refresh, null) }) :
|
|
49
|
+
react_1.default.createElement(IconButton_1.IconButton, { onClick: onItemRemove, label: "Remove", icon: react_1.default.createElement(icons_1.Trash, null) }))));
|
|
50
|
+
};
|
|
51
|
+
exports.default = ItemCardHeader;
|
|
52
|
+
//# sourceMappingURL=index.js.map
|