Skip to content

Commit af747ec

Browse files
farfromrefugactions-user
authored andcommitted
chore: update readme
1 parent 7ec2b04 commit af747ec

File tree

2 files changed

+287
-49
lines changed

2 files changed

+287
-49
lines changed

README.md

Lines changed: 230 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,101 @@
1-
# NativeScript BottomSheet
2-
3-
NativeScript plugin that allows you to easily add persistent bottomsheet to your projects.
4-
5-
[![npm](https://img.shields.io/npm/v/@nativescript-community/ui-persistent-bottomsheet.svg)](https://www.npmjs.com/package/@nativescript-community/ui-persistent-bottomsheet)
6-
[![npm downloads](https://img.shields.io/npm/dm/@nativescript-community/ui-persistent-bottomsheet.svg)](https://www.npmjs.com/package/@nativescript-community/ui-persistent-bottomsheet)
7-
[![npm downloads](https://img.shields.io/npm/dt/@nativescript-community/ui-persistent-bottomsheet.svg)](https://www.npmjs.com/package/@nativescript-community/ui-persistent-bottomsheet)
8-
9-
---
10-
1+
<!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️--><!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️-->
2+
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
8+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11+
DO NOT EDIT THIS READEME DIRECTLY! Edit "bluesprint.md" instead.
12+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
13+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
17+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
18+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
19+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
20+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
21+
<h1 align="center">@nativescript-community/ui-persistent-bottomsheet</h1>
22+
<p align="center">
23+
<a href="https://npmcharts.com/compare/@nativescript-community/ui-persistent-bottomsheet?minimal=true"><img alt="Downloads per month" src="https://img.shields.io/npm/dm/@nativescript-community/ui-persistent-bottomsheet.svg" height="20"/></a>
24+
<a href="https://www.npmjs.com/package/@nativescript-community/ui-persistent-bottomsheet"><img alt="NPM Version" src="https://img.shields.io/npm/v/@nativescript-community/ui-persistent-bottomsheet.svg" height="20"/></a>
25+
</p>
26+
27+
<p align="center">
28+
<b>NativeScript plugin that allows you to easily add a persistent bottomsheet to your projects.</b></br>
29+
<sub><sub>
30+
</p>
31+
32+
<br />
33+
34+
35+
| <img src="https://raw.githubusercontent.com/nativescript-community/ui-persistent-bottomsheet/master/images/demo-ios.gif" height="500" /> | <img src="https://raw.githubusercontent.com/nativescript-community/ui-persistent-bottomsheet/master/images/demo-android.gif" height="500" /> |
36+
| --- | ----------- |
37+
| iOS Demo | Android Demo |
38+
39+
40+
[](#table-of-contents)
41+
42+
43+
[](#table-of-contents)
44+
1145
## Table of Contents
1246

13-
1. [Installation](#installation)
14-
2. [Configuration](#configuration)
15-
3. [API](#api)
16-
4. [Usage in Angular](#usage-in-angular)
17-
5. [Usage in Vue](#usage-in-vue)
18-
6. [Usage in Svelte](#usage-in-svelte)
19-
7. [Usage in React](#usage-in-react)
20-
8. [Demos](#demos)
21-
47+
* [Installation](#installation)
48+
* [Configuration](#configuration)
49+
* [API](#api)
50+
* [Properties](#properties)
51+
* [Methods](#methods)
52+
* [Usage in Angular](#usage-in-angular)
53+
* [Usage in Vue](#usage-in-vue)
54+
* [Usage in Svelte](#usage-in-svelte)
55+
* [Usage in React](#usage-in-react)
56+
* [Demos](#demos)
57+
* [Demos and Development](#demos-and-development)
58+
* [Repo Setup](#repo-setup)
59+
* [Build](#build)
60+
* [Demos](#demos-1)
61+
* [Contributing](#contributing)
62+
* [Update repo ](#update-repo-)
63+
* [Update readme ](#update-readme-)
64+
* [Update doc ](#update-doc-)
65+
* [Publish](#publish)
66+
* [Questions](#questions)
67+
68+
69+
[](#installation)
70+
71+
72+
[](#installation)
73+
2274
## Installation
75+
Run the following command from the root of your project:
2376

24-
```
25-
ns plugin add @nativescript-community/ui-persistent-bottomsheet
26-
```
77+
`ns plugin add @nativescript-community/ui-persistent-bottomsheet`
2778

79+
80+
[](#configuration)
81+
82+
83+
[](#configuration)
84+
2885
## Configuration
29-
3086
For gestures to work, make sure to add the following code block inside the main application file (e.g. app.ts):
3187

3288
```typescript
3389
import { install } from '@nativescript-community/ui-persistent-bottomsheet';
3490
install();
3591
```
3692

93+
94+
[](#api)
95+
96+
97+
[](#api)
98+
3799
## API
38100

39101
### Properties
@@ -46,14 +108,21 @@ install();
46108
| steps | `[70]` | `number[]` | the different available steps |
47109
| backdropColor | `new Color('rgba(0, 0, 0, 0.7)')` | `Color` | The color of the backdrop behind the drawer |
48110

111+
112+
49113
### Methods
50114

51115
| Name | Return | Description |
52116
| ------------ | ------ | ----------------------------------------------- |
53117
| install() | `void` | Install gestures |
54118

119+
120+
[](#usage-in-angular)
121+
122+
123+
[](#usage-in-angular)
124+
55125
## Usage in Angular
56-
57126
Import the module into your project.
58127

59128
```typescript
@@ -85,9 +154,14 @@ Then in your component add the following:
85154

86155
</BottomSheet>
87156
```
88-
89157
For a more complete example, look in the `demo-ng` directory.
90158

159+
160+
[](#usage-in-vue)
161+
162+
163+
[](#usage-in-vue)
164+
91165
## Usage in Vue
92166

93167
Register the plugin in your `app.js`.
@@ -97,6 +171,18 @@ import BottomSheetPlugin from '~/components/drawer/vue';
97171
Vue.use(BottomSheetPlugin);
98172
```
99173

174+
Add this at the top of your webpack config file:
175+
```javascript
176+
const NsVueTemplateCompiler = require('nativescript-vue-template-compiler');
177+
178+
NsVueTemplateCompiler.registerElement('BottomSheet', () => require('@nativescript-community/ui-persistent-bottomsheet').BottomSheet, {
179+
model: {
180+
prop: 'stepIndex',
181+
event: 'stepIndexChange'
182+
}
183+
});
184+
```
185+
100186
Then in your component add the following:
101187

102188
```xml
@@ -110,9 +196,14 @@ Then in your component add the following:
110196

111197
</BottomSheet>
112198
```
113-
114199
For a more complete example, look in the `demo-vue` directory.
115200

201+
202+
[](#usage-in-svelte)
203+
204+
205+
[](#usage-in-svelte)
206+
116207
## Usage in Svelte
117208

118209
Register the plugin in your `app.ts`.
@@ -135,9 +226,14 @@ Then in your component, add the following:
135226

136227
</bottomsheet>
137228
```
138-
139229
For a more complete example, look in the `demo-svelte` directory.
140230

231+
232+
[](#usage-in-react)
233+
234+
235+
[](#usage-in-react)
236+
141237
## Usage in React
142238

143239
Register the plugin in your `app.ts`.
@@ -148,7 +244,6 @@ BottomSheetElement.register();
148244
```
149245

150246
Then in your component, add the following:
151-
152247
```ts
153248
import { BottomSheet } from "@nativescript-community/ui-persistent-bottomsheet/react"
154249
```
@@ -164,19 +259,117 @@ import { BottomSheet } from "@nativescript-community/ui-persistent-bottomsheet/r
164259

165260
</BottomSheet>
166261
```
167-
168262
For a more complete example, look in the `demo-react` directory.
169263

170-
## Demos
171264

265+
266+
[](#demos)
267+
268+
269+
[](#demos)
270+
271+
## Demos
172272
This repository includes Angular, Vue.js, and Svelte demos. In order to run these execute the following in your shell:
173-
174273
```shell
175-
git clone https://github.com/nativescript-community/ui-persistent-bottomsheet
176-
cd ui-persistent-bottomsheet
177-
npm i
178-
npm run setup
274+
$ git clone https://github.com/@nativescript-community/ui-persistent-bottomsheet
275+
$ cd ui-drawer
276+
$ npm run i
277+
$ npm run setup
278+
$ npm run build && npm run build.angular
279+
$ cd demo-ng # or demo-vue or demo-svelte or demo-react
280+
$ ns run ios|android
281+
```
282+
283+
284+
[](#demos-and-development)
285+
286+
287+
[](#demos-and-development)
288+
289+
## Demos and Development
290+
291+
292+
### Repo Setup
293+
294+
The repo uses submodules. If you did not clone with ` --recursive` then you need to call
295+
```
296+
git submodule update --init
297+
```
298+
299+
The package manager used to install and link dependencies must be `pnpm` or `yarn`. `npm` wont work.
300+
301+
To develop and test:
302+
if you use `yarn` then run `yarn`
303+
if you use `pnpm` then run `pnpm i`
304+
305+
**Interactive Menu:**
306+
307+
To start the interactive menu, run `npm start` (or `yarn start` or `pnpm start`). This will list all of the commonly used scripts.
308+
309+
### Build
310+
311+
```bash
179312
npm run build.all
180-
cd demo-ng # or demo-vue or demo-svelte or demo-react
181-
ns run ios|android # or run `npx nativescript run ios|android` when you do not have nativescript installed globally
182313
```
314+
315+
### Demos
316+
317+
```bash
318+
npm run demo.[ng|react|svelte|vue].[ios|android]
319+
320+
npm run demo.svelte.ios # Example
321+
```
322+
323+
324+
[](#contributing)
325+
326+
327+
[](#contributing)
328+
329+
## Contributing
330+
331+
### Update repo
332+
333+
You can update the repo files quite easily
334+
335+
First update the submodules
336+
337+
```bash
338+
npm run update
339+
```
340+
341+
Then commit the changes
342+
Then update common files
343+
344+
```bash
345+
npm run sync
346+
```
347+
Then you can run `yarn|pnpm`, commit changed files if any
348+
349+
### Update readme
350+
```bash
351+
npm run readme
352+
```
353+
354+
### Update doc
355+
```bash
356+
npm run doc
357+
```
358+
359+
### Publish
360+
361+
The publishing is completely handled by `lerna` (you can add `-- --bump major` to force a major release)
362+
Simply run
363+
```shell
364+
npm run publish
365+
```
366+
367+
368+
[](#questions)
369+
370+
371+
[](#questions)
372+
373+
## Questions
374+
375+
If you have any questions/issues/comments please feel free to create an issue or start a conversation in the [NativeScript Community Discord](https://nativescript.org/discord).

0 commit comments

Comments
 (0)