dictate-button 0.3.0 → 1.0.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 +11 -10
- package/dist/dictate-button.js +709 -0
- package/dist/dictate-button.styles.d.ts +1 -1
- package/dist/inject-exclusive.js +45 -0
- package/dist/inject-inclusive.js +45 -0
- package/package.json +14 -16
- package/dist/404.html +0 -17
- package/dist/dictate-button.cjs.js +0 -36
- package/dist/dictate-button.es.js +0 -686
- package/dist/inject-exclusive.cjs.js +0 -1
- package/dist/inject-exclusive.es.js +0 -37
- package/dist/inject-inclusive.cjs.js +0 -1
- package/dist/inject-inclusive.es.js +0 -37
- package/dist/inject.cjs.js +0 -1
- package/dist/inject.d.ts +0 -1
- package/dist/inject.es.js +0 -1
package/README.md
CHANGED
|
@@ -24,8 +24,8 @@ Choose the auto-inject mode that best suits your needs:
|
|
|
24
24
|
|
|
25
25
|
| Mode | Description | Scripts |
|
|
26
26
|
|---|---|---|
|
|
27
|
-
| Exclusive |
|
|
28
|
-
| Inclusive |
|
|
27
|
+
| Exclusive | Enables for `textarea` and `input[type=text]` with the `data-dictate-button-on` attribute only. | `inject-exclusive.js` |
|
|
28
|
+
| Inclusive | Enables for all `textarea` and `input[type=text]` without the `data-dictate-button-off` attribute. | `inject-inclusive.js` |
|
|
29
29
|
|
|
30
30
|
### From CDN
|
|
31
31
|
|
|
@@ -34,8 +34,8 @@ Choose the auto-inject mode that best suits your needs:
|
|
|
34
34
|
In your HTML `<head>` tag, add the following script tags:
|
|
35
35
|
|
|
36
36
|
```html
|
|
37
|
-
<script type="module" crossorigin src="https://cdn.dictate-button.io/dictate-button.
|
|
38
|
-
<script type="module" crossorigin src="https://cdn.dictate-button.io/inject-exclusive.
|
|
37
|
+
<script type="module" crossorigin src="https://cdn.dictate-button.io/dictate-button.js"></script>
|
|
38
|
+
<script type="module" crossorigin src="https://cdn.dictate-button.io/inject-exclusive.js"></script>
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
Add the `data-dictate-button-on` attribute to any `textarea` or `input[type=text]` elements where you want the dictate button to appear:
|
|
@@ -50,8 +50,8 @@ Add the `data-dictate-button-on` attribute to any `textarea` or `input[type=text
|
|
|
50
50
|
In your HTML `<head>` tag, add the following script tags:
|
|
51
51
|
|
|
52
52
|
```html
|
|
53
|
-
<script type="module" crossorigin src="https://cdn.dictate-button.io/dictate-button.
|
|
54
|
-
<script type="module" crossorigin src="https://cdn.dictate-button.io/inject-inclusive.
|
|
53
|
+
<script type="module" crossorigin src="https://cdn.dictate-button.io/dictate-button.js"></script>
|
|
54
|
+
<script type="module" crossorigin src="https://cdn.dictate-button.io/inject-inclusive.js"></script>
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
All `textarea` and `input[type=text]` elements without the `data-dictate-button-off` attribute will be automatically enhanced with the dictate button by default.
|
|
@@ -68,9 +68,9 @@ To disable that for a specific field, add the `data-dictate-button-off` attribut
|
|
|
68
68
|
Import the component and use it directly in your code:
|
|
69
69
|
|
|
70
70
|
```html
|
|
71
|
-
<script type="module" crossorigin src="https://cdn.dictate-button.io/dictate-button.
|
|
71
|
+
<script type="module" crossorigin src="https://cdn.dictate-button.io/dictate-button.js"></script>
|
|
72
72
|
|
|
73
|
-
<dictate-button size="
|
|
73
|
+
<dictate-button size="30" api-endpoint="https://api.dictate-button.io/transcribe" language="en"></dictate-button>
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
### From NPM
|
|
@@ -86,8 +86,9 @@ import 'dictate-button'
|
|
|
86
86
|
The auto-inject script:
|
|
87
87
|
|
|
88
88
|
```js
|
|
89
|
+
// For selected text fields (with data-dictate-button-on attribute):
|
|
89
90
|
import 'dictate-button/inject-exclusive'
|
|
90
|
-
// or
|
|
91
|
+
// or for all text fields (except those with data-dictate-button-off attribute):
|
|
91
92
|
import 'dictate-button/inject-inclusive'
|
|
92
93
|
```
|
|
93
94
|
|
|
@@ -122,7 +123,7 @@ dictateButton.addEventListener('transcribing:finished', (event) => {
|
|
|
122
123
|
|
|
123
124
|
| Attribute | Type | Default | Description |
|
|
124
125
|
|---------------|---------|-----------------------------------------|----------------------------------------|
|
|
125
|
-
| size | number |
|
|
126
|
+
| size | number | 30 | Size of the button in pixels |
|
|
126
127
|
| apiEndpoint | string | https://api.dictate-button.io/transcribe| API endpoint for transcription service |
|
|
127
128
|
| language | string | (not set) | Optional language code (e.g., 'en', 'fr', 'de') which may speed up the transcription. |
|
|
128
129
|
| theme | string | (inherits from page) | 'light' or 'dark' |
|