Skip to content

Commit eb721e9

Browse files
authored
Merge pull request #7 from dl-tokene/feature/update-kits
Feature/update kits
2 parents ae9afd7 + 4394467 commit eb721e9

41 files changed

Lines changed: 928 additions & 210 deletions

Some content is hidden

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

CHANGELOG.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.0.0-rc.4] - 2023-05-07
8+
### Added
9+
- `toolkit` - increase gas estimates
10+
- `root` - `toasts` package
11+
12+
### Changed
13+
- `toolkit` - build options
14+
- `ui-kit` - build options
15+
16+
### Fixed
17+
- `ui-kit` - components depended on vue-router
18+
19+
### Removed
20+
- `ui-kit` - toasts components
21+
- `toolkit` - notification types
22+
723
## [0.0.0-rc.3] - 2023-05-04
824
### Added
925
- `root` - `styles` package
@@ -14,7 +30,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1430
- `toolkit` - imports
1531
- `root` - typescript version
1632

17-
1833
## [0.0.0-rc.2] - 2023-04-27
1934
### Added
2035
- `toolkit` - parsing config helpers, composables, eth helpers, localization for validators
@@ -34,7 +49,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3449
- Initial release
3550
- `root` - `toolkit` package
3651

37-
[Unreleased]: https://github.com/dl-tokene/webkit/compare/0.0.0-rc.3...HEAD
52+
[Unreleased]: https://github.com/dl-tokene/webkit/compare/0.0.0-rc.4...HEAD
53+
[0.0.0-rc.4]: https://github.com/dl-tokene/webkit/compare/0.0.0-rc.3...0.0.0-rc.4
3854
[0.0.0-rc.3]: https://github.com/dl-tokene/webkit/compare/0.0.0-rc.2...0.0.0-rc.3
3955
[0.0.0-rc.2]: https://github.com/dl-tokene/webkit/compare/0.0.0-rc.1...0.0.0-rc.2
4056
[0.0.0-rc.1]: https://github.com/dl-tokene/webkit/compare/0.0.0-rc.0...0.0.0-rc.1

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Here are the packages in the namespace:
4949
| [@tokene/vue-web3-provider](https://dl-tokene.github.io/webkit/modules/_tokene_vue_web3_provider.html) | The Vue reactive wrapper of [@distributedlab/w3p](https://github.com/distributed-lab/web-kit/tree/main/packages/w3p) | [![npm version](https://img.shields.io/npm/v/@tokene/toolkit.svg)](https://www.npmjs.com/package/@tokene/vue-web3-provider) |
5050
| [@tokene/styles](https://dl-tokene.github.io/webkit/modules/_tokene_styles.html) | The global styles for every TokenE project and common function, mixins and variables | [![npm version](https://img.shields.io/npm/v/@tokene/styles.svg)](https://www.npmjs.com/package/@tokene/styles) |
5151
| [@tokene/ui-kit](https://dl-tokene.github.io/webkit/modules/_tokene_ui_kit.html) | The global ui-kit for every TokenE project | [![npm version](https://img.shields.io/npm/v/@tokene/ui-kit.svg)](https://www.npmjs.com/package/@tokene/ui-kit) |
52+
| [@tokene/toasts](https://dl-tokene.github.io/webkit/modules/_tokene_toasts.html) | Vue based toasts | [![npm version](https://img.shields.io/npm/v/@tokene/toasts.svg)](https://www.npmjs.com/package/@tokene/toasts) |
5253

5354
## Using in the projects made by create-react-app
5455

packages/styles/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tokene/styles",
3-
"version": "0.0.0-rc.3",
3+
"version": "0.0.0-rc.4",
44
"description": "Default styles for every single frontend module of TokenE",
55
"repository": {
66
"type": "git",

packages/toasts/.eslintignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
build/*.js
2+
dist/**/*.d.ts
3+
dist/*.js
4+
config/*.js
5+
**/*.config.js
6+
playground
7+
*.schema.js
8+
index.html
9+
*.md

packages/toasts/.eslintrc.js

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true,
5+
node: true,
6+
},
7+
parser: 'vue-eslint-parser',
8+
overrides: [
9+
{
10+
files: ['src/**/*.{ts,vue}'],
11+
parserOptions: {
12+
parser: '@typescript-eslint/parser',
13+
ecmaVersion: 'latest',
14+
sourceType: 'module',
15+
project: './packages/toasts/tsconfig.json',
16+
},
17+
},
18+
],
19+
settings: {
20+
'vue-i18n': {
21+
localeDir: 'src/localization/**/*.(json|json5)',
22+
},
23+
},
24+
extends: [
25+
'eslint:recommended',
26+
'plugin:vue/vue3-recommended',
27+
'@vue/typescript/recommended',
28+
'@vue/eslint-config-typescript/recommended',
29+
'plugin:vue-i18n/recommended',
30+
'@vue/prettier',
31+
'@vue/eslint-config-prettier',
32+
],
33+
plugins: ['promise'],
34+
globals: {
35+
defineProps: 'readonly',
36+
defineEmits: 'readonly',
37+
defineExpose: 'readonly',
38+
withDefaults: 'readonly',
39+
},
40+
rules: {
41+
'prettier/prettier': [
42+
'warn',
43+
{
44+
vueIndentScriptAndStyle: false,
45+
printWidth: 80,
46+
trailingComma: 'all',
47+
endOfLine: 'auto',
48+
tabWidth: 2,
49+
semi: false,
50+
singleQuote: true,
51+
bracketSpacing: true,
52+
bracketSameLine: false,
53+
arrowParens: 'avoid',
54+
},
55+
],
56+
'vue-i18n/no-v-html': 'off',
57+
'vue-i18n/no-dynamic-keys': 'warn',
58+
'vue-i18n/no-missing-keys': 'warn',
59+
'vue-i18n/no-unused-keys': [
60+
'error',
61+
{
62+
extensions: ['.js', '.ts', '.vue'],
63+
},
64+
],
65+
'vue-i18n/no-raw-text': [
66+
'error',
67+
{
68+
ignoreText: ['—', '|', '×'],
69+
},
70+
],
71+
'arrow-parens': 0,
72+
'no-debugger': 1,
73+
'no-warning-comments': [
74+
1,
75+
{
76+
terms: ['hardcoded'],
77+
location: 'anywhere',
78+
},
79+
],
80+
'no-return-await': 0,
81+
'object-curly-spacing': ['error', 'always'],
82+
'no-var': 'error',
83+
'comma-dangle': [1, 'always-multiline'],
84+
'linebreak-style': ['error', 'unix'],
85+
'generator-star-spacing': 0,
86+
'no-tabs': 2,
87+
'max-len': [
88+
1,
89+
{
90+
code: 80,
91+
comments: 80,
92+
ignoreUrls: true,
93+
ignoreStrings: true,
94+
ignoreTemplateLiterals: true,
95+
ignoreRegExpLiterals: true,
96+
},
97+
],
98+
'no-console': [
99+
1,
100+
{
101+
allow: ['warn', 'error'],
102+
},
103+
],
104+
quotes: [2, 'single', { avoidEscape: false }],
105+
'no-multiple-empty-lines': [2, { max: 1, maxEOF: 0, maxBOF: 0 }],
106+
semi: [2, 'never'],
107+
'vue/multi-word-component-names': 0,
108+
'vue/component-definition-name-casing': ['error', 'kebab-case'],
109+
'vue/valid-v-for': 2,
110+
'vue/attributes-order': 0,
111+
'vue/order-in-components': 1,
112+
'vue/html-closing-bracket-newline': 0,
113+
'vue/attribute-hyphenation': 1,
114+
'vue/component-name-in-template-casing': [2, 'kebab-case'],
115+
'vue/html-end-tags': 2,
116+
'vue/html-quotes': 1,
117+
'vue/multiline-html-element-content-newline': 1,
118+
'vue/mustache-interpolation-spacing': 1,
119+
'vue/no-async-in-computed-properties': 2,
120+
'vue/no-use-v-if-with-v-for': 1,
121+
'vue/no-dupe-keys': 2,
122+
'vue/no-duplicate-attributes': 2,
123+
'vue/no-multi-spaces': 1,
124+
'vue/no-reserved-keys': 2,
125+
'vue/no-shared-component-data': 2,
126+
'vue/no-side-effects-in-computed-properties': 2,
127+
'vue/no-spaces-around-equal-signs-in-attribute': 2,
128+
'vue/no-template-key': 2,
129+
'vue/no-textarea-mustache': 2,
130+
'vue/no-unused-components': 1,
131+
'vue/no-unused-vars': 1,
132+
'vue/no-v-html': 1,
133+
'vue/prop-name-casing': 2,
134+
'vue/require-default-prop': 2,
135+
'vue/require-prop-types': 2,
136+
'vue/require-valid-default-prop': 2,
137+
'vue/this-in-template': 2,
138+
'vue/v-bind-style': 2,
139+
'vue/v-on-style': 2,
140+
'vue/valid-template-root': 2,
141+
'vue/valid-v-bind': 2,
142+
'vue/valid-v-else-if': 2,
143+
'vue/valid-v-else': 2,
144+
'vue/valid-v-model': 2,
145+
'vue/valid-v-on': 2,
146+
'vue/singleline-html-element-content-newline': [
147+
1,
148+
{
149+
ignoreWhenNoAttributes: true,
150+
ignoreWhenEmpty: true,
151+
ignores: ['pre', 'textarea', 'span'],
152+
},
153+
],
154+
'promise/always-return': 'error',
155+
'promise/no-return-wrap': 'error',
156+
'promise/param-names': 'error',
157+
'promise/catch-or-return': 'error',
158+
'promise/no-nesting': 'warn',
159+
'promise/no-callback-in-promise': 'warn',
160+
'promise/prefer-await-to-then': 'warn',
161+
'@typescript-eslint/no-non-null-assertion': 'off',
162+
},
163+
}

packages/toasts/.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
src/**/*.test.ts
2+
jest.config.js
3+
tsconfig.json
4+
tsconfig.build.json
5+
postbuild.js

packages/toasts/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# @tokene/toasts
2+
These packages aim to provide developers with a set of commonly used components for building TokenE web applications.
3+
4+
![version (scoped package)](https://badgen.net/npm/v/@tokene/toasts)
5+
![types](https://badgen.net/npm/types/@tokene/toasts)
6+
![tree-shaking](https://badgen.net/bundlephobia/tree-shaking/@tokene/toasts)
7+
![checks](https://badgen.net/github/checks/dl-tokene/webkit/main)
8+
9+
## Getting Started
10+
11+
### Installing
12+
13+
```
14+
yarn add @tokene/toasts
15+
```
16+
17+
### Setup
18+
19+
```ts
20+
import { ToastPlugin } from '@tokene/toasts'
21+
import '@tokene/toasts/dist/index.css'
22+
23+
app.use(ToastPlugin)
24+
```
25+
26+
### usage
27+
28+
```ts
29+
const { showTxToast, removeToast } = useNotifications()
30+
31+
lastToastId.value = showTxToast('pending', txLink!)
32+
33+
removeToast(lastToastId.value!)
34+
showTxToast('success', txLink!)
35+
```
36+
37+
### Or
38+
39+
```ts
40+
import { ToolkitBus } from '@tokene/toolkit'
41+
import { useNotifications, type NotificationPayload } from '@tokene/toasts'
42+
43+
const { showToast } = useNotifications()
44+
45+
ToolkitBus.on(Bus.eventList.success, payload =>
46+
showToast('success', payload as NotificationPayload),
47+
)
48+
ToolkitBus.on(Bus.eventList.warning, payload =>
49+
showToast('error', payload as NotificationPayload),
50+
)
51+
ToolkitBus.on(Bus.eventList.error, payload =>
52+
showToast('warning', payload as NotificationPayload),
53+
)
54+
ToolkitBus.on(Bus.eventList.info, payload =>
55+
showToast('info', payload as NotificationPayload),
56+
)
57+
ToolkitBus.on(Bus.eventList.default, payload =>
58+
showToast('default', payload as NotificationPayload),
59+
)
60+
```
61+
62+
## License
63+
64+
This project is licensed under the MIT License - see the [LICENSE.md](../../LICENSE) file for details

packages/toasts/jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
...require('../../jest.config.base.js'),
3+
};

0 commit comments

Comments
 (0)