Skip to content

Commit 358d211

Browse files
committed
Publish 0.2.0 & Rebuild docs & Minor fixes
1 parent dd4f06b commit 358d211

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1274
-308
lines changed

README.md

+40-56
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,61 @@
11
<img src="./assets/intro.gif" alt="">
22

3-
Discover `vue-smart-suggest`, a compact (<3KB) vue library offering dynamic, context-sensitive suggestions for your text areas.
3+
Vue Smart Suggest is a lightweight vue library offering dynamic, context-sensitive suggestions for your text areas. It can be fully customized with custom components and weights less than `3kb` minified and gzipped.
44

5-
## Features
5+
Check out the [documentation website](https://7ph.github.io/vue-smart-suggest/#/) to try it out 😊
66

7-
- Lightweight
8-
- Easy to integrate
9-
- Context-sensitive suggestions based on user input
10-
- Customizable triggers (e.g., "@", ":")
7+
<p align="right">
8+
Like this project? Give a star 🌟
9+
</p>
1110

12-
## Installation
11+
## Getting started
1312

14-
```bash
15-
npm install --save vue-smart-suggest
16-
```
13+
1. Install using a package manager
1714

18-
## Usage
15+
```bash
16+
npm i --save vue-smart-suggest
17+
# or
18+
yarn add vue-smart-suggest
19+
```
1920

20-
Here's a quick example on how to use `vue-smart-suggest` in your project:
21+
2. Import `SmartSuggest` and define suggestion trigger(s)
2122

22-
```vue
23-
<script setup lang="ts">
24-
import { SmartSuggest, Trigger } from 'vue-smart-suggest';
23+
```ts
24+
import { SmartSuggest, Trigger } from 'vue-smart-suggest';
2525
26-
const userTrigger: Trigger = {
27-
char: '@',
28-
items: [
29-
{ value: 'joe', searchText: 'joe' },
30-
{ value: 'jane', searchText: 'jane' },
31-
],
32-
};
33-
</script>
26+
const userMentionTrigger: Trigger = {
27+
char: '@',
28+
items: [{ value: 'Joe' }, { value: 'Jane' }],
29+
};
30+
```
3431
35-
<template>
36-
<SmartSuggest :trigger="userTrigger">
37-
<textarea />
38-
</SmartSuggest>
39-
</template>
40-
```
41-
42-
For detailed usage and options, please refer to [Documentation Link].
43-
44-
## Contributing
32+
\*minimal example, check Trigger type definition to see all options
4533
46-
We welcome contributions to `vue-smart-suggest`! If you're interested in helping improve this project, here's how you can contribute:
34+
3. Enhance a text area with `<SmartSuggest />`
4735
48-
### Reporting Issues
49-
50-
- Ensure the issue has not already been reported.
51-
- Use the GitHub Issues tab to report the issue. Provide detailed steps to reproduce, what you expected to happen, and what actually happened.
36+
```html
37+
<SmartSuggest :triggers="[userMentionTrigger]">
38+
<textarea />
39+
</SmartSuggest>
40+
```
5241
53-
### Submitting Pull Requests
42+
4. That's it, your textarea will show up suggestions as you type `@`!
43+
5. Check-out the [customization guide](https://7ph.github.io/vue-smart-suggest/#/customize) or the [API](https://7ph.github.io/vue-smart-suggest/api-docs/) to get the most of this library
5444
55-
1. Fork the repository on GitHub.
56-
2. Clone your fork to your local machine.
57-
3. Create a new branch for your feature or fix.
58-
4. Make your changes, ensuring you adhere to the existing code style.
59-
5. Write or adapt tests as needed.
60-
6. Commit your changes with a clear and descriptive message.
61-
7. Push your branch to your GitHub fork.
62-
8. Submit a pull request to the main repository.
63-
9. Ensure your pull request description clearly describes the problem and solution. Include the relevant issue number if applicable.
45+
## Dependencies
6446
65-
### Coding Guidelines
47+
- This library requires `vue 3.x`.
48+
- This library has a single dependency, `textarea-caret` which helps finding the position of the cursor inside a text area.
6649
67-
- Write code in TypeScript.
68-
- Follow existing coding style for consistency.
69-
- Ensure your code passes all existing tests and write new tests as needed.
50+
## Useful links
7051
71-
### Community
52+
Documentation
7253
73-
Join our [Community Forum or Slack/Discord Channel] to discuss development, features, and ideas.
54+
- Try out a simple [demo](https://7ph.github.io/vue-smart-suggest/) on the documentation website.
55+
- For styling tips, check the [customization guide](https://7ph.github.io/vue-smart-suggest/#/customize).
56+
- Check out the [api documentation](https://7ph.github.io/vue-smart-suggest/api-docs/) for reference.
57+
- Admire the [>98% coverage report](https://7ph.github.io/vue-smart-suggest/coverage/)
7458
75-
## License
59+
## Contributing
7660
77-
`vue-smart-suggest` is open-sourced software licensed under the [MIT license](LICENSE.md).
61+
Having trouble? Found a bug? Want to contribute? Any kind of contribution is welcome. If you have any questions, please open an issue or create a pull request.

assets/intro.gif

103 KB
Loading

assets/tsconfig.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"compilerOptions": {
3+
"outDir": "lib",
4+
"target": "ESNext",
5+
"declaration": true,
6+
"useDefineForClassFields": true,
7+
"module": "ESNext",
8+
"moduleResolution": "Node",
9+
"strict": true,
10+
"jsx": "preserve",
11+
"sourceMap": true,
12+
"resolveJsonModule": true,
13+
"isolatedModules": true,
14+
"esModuleInterop": true,
15+
"lib": ["ESNext", "DOM"],
16+
"skipLibCheck": true
17+
},
18+
}

docs/api-docs/assets/highlight.css

+24-17
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,26 @@
77
--dark-hl-2: #CE9178;
88
--light-hl-3: #0000FF;
99
--dark-hl-3: #569CD6;
10-
--light-hl-4: #800000;
11-
--dark-hl-4: #808080;
12-
--light-hl-5: #800000;
13-
--dark-hl-5: #569CD6;
14-
--light-hl-6: #E50000;
10+
--light-hl-4: #008000;
11+
--dark-hl-4: #6A9955;
12+
--light-hl-5: #AF00DB;
13+
--dark-hl-5: #C586C0;
14+
--light-hl-6: #001080;
1515
--dark-hl-6: #9CDCFE;
16-
--light-hl-7: #0000FF;
17-
--dark-hl-7: #CE9178;
18-
--light-hl-8: #AF00DB;
19-
--dark-hl-8: #C586C0;
20-
--light-hl-9: #001080;
21-
--dark-hl-9: #9CDCFE;
22-
--light-hl-10: #0070C1;
23-
--dark-hl-10: #4FC1FF;
24-
--light-hl-11: #267F99;
25-
--dark-hl-11: #4EC9B0;
26-
--light-hl-12: #CD3131;
27-
--dark-hl-12: #F44747;
16+
--light-hl-7: #0070C1;
17+
--dark-hl-7: #4FC1FF;
18+
--light-hl-8: #267F99;
19+
--dark-hl-8: #4EC9B0;
20+
--light-hl-9: #800000;
21+
--dark-hl-9: #808080;
22+
--light-hl-10: #CD3131;
23+
--dark-hl-10: #F44747;
24+
--light-hl-11: #E50000;
25+
--dark-hl-11: #9CDCFE;
26+
--light-hl-12: #0000FF;
27+
--dark-hl-12: #CE9178;
28+
--light-hl-13: #800000;
29+
--dark-hl-13: #569CD6;
2830
--light-code-background: #FFFFFF;
2931
--dark-code-background: #1E1E1E;
3032
}
@@ -43,6 +45,7 @@
4345
--hl-10: var(--light-hl-10);
4446
--hl-11: var(--light-hl-11);
4547
--hl-12: var(--light-hl-12);
48+
--hl-13: var(--light-hl-13);
4649
--code-background: var(--light-code-background);
4750
} }
4851

@@ -60,6 +63,7 @@
6063
--hl-10: var(--dark-hl-10);
6164
--hl-11: var(--dark-hl-11);
6265
--hl-12: var(--dark-hl-12);
66+
--hl-13: var(--dark-hl-13);
6367
--code-background: var(--dark-code-background);
6468
} }
6569

@@ -77,6 +81,7 @@
7781
--hl-10: var(--light-hl-10);
7882
--hl-11: var(--light-hl-11);
7983
--hl-12: var(--light-hl-12);
84+
--hl-13: var(--light-hl-13);
8085
--code-background: var(--light-code-background);
8186
}
8287

@@ -94,6 +99,7 @@
9499
--hl-10: var(--dark-hl-10);
95100
--hl-11: var(--dark-hl-11);
96101
--hl-12: var(--dark-hl-12);
102+
--hl-13: var(--dark-hl-13);
97103
--code-background: var(--dark-code-background);
98104
}
99105

@@ -110,4 +116,5 @@
110116
.hl-10 { color: var(--hl-10); }
111117
.hl-11 { color: var(--hl-11); }
112118
.hl-12 { color: var(--hl-12); }
119+
.hl-13 { color: var(--hl-13); }
113120
pre, code { background: var(--code-background); }

docs/api-docs/assets/navigation.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api-docs/assets/search.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api-docs/classes/SmartSuggestItem.html

+20
Large diffs are not rendered by default.

docs/api-docs/functions/useSmartSuggest.html

+1-6
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)