Skip to content

Commit 3196365

Browse files
authored
Merge pull request #17 from lumapps/chore/bookmarks-custo
chore(bookmarks): custo docs
2 parents fdc0c60 + b8b5984 commit 3196365

File tree

6 files changed

+78
-0
lines changed

6 files changed

+78
-0
lines changed

docs/javascript/api.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ And `configuration` is an object that allows these properties:
6666
|--------------------------------------|-------------------------------------------------------------------------------------|-------------------------------------------------------------|
6767
| `targets.APP` | Target id for application | [Documentation](./capabilities#application) |
6868
| `targets.BOOKMARKS` | Target id for the bookmarks/app launcher component | [Documentation](./capabilities#bookmarks) |
69+
| `targets.BOOKMARKS_ITEMS` | Target id for the bookmarks displayed inside the app launcher | [Documentation](./capabilities#bookmarks-items) |
6970
| `targets.COMMUNITY` | Target id for the community pages | [Documentation](./capabilities#community) |
7071
| `targets.CONTENT` | Target id for the content page | [Documentation](./capabilities#content) |
7172
| `targets.CONTEXTUAL_ACTIONS` | Target id for the contextual actions menu on the right hand side of a content page. | [Documentation](./capabilities#contextual-actions) |
@@ -212,6 +213,30 @@ window.lumapps.customize(({ components, constants }) => {
212213
| `size` | Size of the avatar. | No | [`Size`](#size) | `Size.m` |
213214
| `className` | CSS class that will be applied directly into the wrapper container. | No | `string` or [css classes](#css-classes) | `undefined` |
214215

216+
#### Bookmark
217+
218+
![Component Bookmark](./assets/component-bookmark.png "Component Bookmark")
219+
220+
```js
221+
window.lumapps.customize(({ components, constants }) => {
222+
const { Bookmark } = components;
223+
224+
const component = Bookmark({
225+
title: 'Test',
226+
link: 'https://google.com',
227+
icon: 'https://link-to-image.com',
228+
});
229+
})
230+
```
231+
232+
`Bookmark` options:
233+
234+
| Option | Description | Is required? | Option type | Default Value |
235+
|-------------|--------------------------------------------|--------------|-----------------------------------------|---------------|
236+
| `title` | Bookmark title to display. | Yes | `string` | `undefined` |
237+
| `link` | Bookmark link to display. | No | `string` | `undefined` |
238+
| `icon` | Bookmark icon to display, should be a URL | Yes | `string` | `undefined` |
239+
215240
#### Button
216241

217242
![Component Button](./assets/component-button.png "Component Button")
2.37 KB
Loading
Loading
Loading

docs/javascript/capabilities.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,26 @@ Target that allows customizing the bookmarks (also known as [App launcher](https
133133

134134
- [Hide app launcher](./use-cases#hide-app-launcher)
135135

136+
### Bookmarks items
137+
138+
Target that allows adding new bookmarks to the [App launcher](https://docs.lumapps.com/docs/explore-l1119324950335211) component
139+
140+
![Target Bookmarks items](./assets/target-bookmarks-items.png "Target Bookmarks items")
141+
142+
#### Compatibility
143+
144+
| | |
145+
|---------------|---------------------------------------------------------------------------------------------------------------------------|
146+
| Target ID | `bookmarks-items` |
147+
| Description | Target that focuses on the bookmarks items (app launcher) icon on the top bar of your site |
148+
| Placements | Compatible with placements: `LEFT`, `RIGHT`. Customizations are added as siblings of the other bookmarks in the launcher |
149+
| Disable | No compatibility, however, bookmarks can be individually [disabled](./use-cases#disabling-bookmarks) |
150+
| Changing text | No compatibility |
151+
152+
#### Use cases
153+
154+
- [Add new bookmarks](./use-cases#add-new-bookmarks)
155+
136156
### Community
137157

138158
Target that allows customizing the surroundings of a [community](https://docs.lumapps.com/docs/explore-l8416655995933057communities) page.

docs/javascript/use-cases.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,39 @@ In the scenario that you would want to hide the App launcher, the following snip
170170
window.lumapps.disable('bookmarks');
171171
```
172172

173+
## Add new bookmarks
174+
175+
In this specific use case, we have the possibility to add new bookmarks into the App Launcher. Bookmarks can be added either as the first elements of the list or the last ones
176+
177+
```js
178+
window.lumapps.customize(({ targets, components, render, placement, constants }) => {
179+
const { Bookmark } = components;
180+
181+
render({
182+
placement: placement.RIGHT,
183+
target: targets.BOOKMARKS_ITEMS,
184+
toRender: Bookmark({
185+
className: 'widget-message',
186+
title: 'Test',
187+
link: 'https://google.com',
188+
icon: 'https://link-to-image.com',
189+
}),
190+
});
191+
});
192+
```
193+
194+
## Disabling bookmarks
195+
196+
Bookmarks can be disabled in order to avoid them to be displayed by adding the following line of JavaScript to your site.
197+
198+
```js
199+
window.lumapps.disable('bookmarked-apps-docs');
200+
```
201+
202+
The ID used is retrieved from the bookmarks HTML, where each bookmark has the `id` attribute.
203+
204+
![Target Bookmarks items ids](./assets/target-bookmarks-items-ids.png "Target Bookmarks items ids")
205+
173206
## Display a message above all pages of a certain type
174207

175208
In this use case, we are displaying a message oon all pages of a certain type. This should be used when an important message wants to be conveyed for all pages of a site in a quick and efficient way.

0 commit comments

Comments
 (0)