fbt-inline-translations 0.3.0 โ†’ 0.3.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.
Files changed (51) hide show
  1. package/README.md +19 -19
  2. package/dist/bundle.js +1 -1
  3. package/dist/bundle.js.LICENSE.txt +1 -1
  4. package/dist/index.html +142 -4
  5. package/lib/App.css +2 -458
  6. package/lib/TranslationDialog.d.ts +8 -22
  7. package/lib/TranslationDialog.js +36 -58
  8. package/lib/components/ActionButtons.d.ts +6 -6
  9. package/lib/components/ActionButtons.js +34 -30
  10. package/lib/components/Candidate.d.ts +7 -7
  11. package/lib/components/Candidate.js +29 -20
  12. package/lib/components/Glossary.d.ts +7 -7
  13. package/lib/components/Glossary.js +5 -5
  14. package/lib/components/Modal.d.ts +13 -0
  15. package/lib/components/Modal.js +75 -0
  16. package/lib/components/PhraseOverview.d.ts +3 -3
  17. package/lib/components/PhraseOverview.js +9 -8
  18. package/lib/components/TranslationCard.d.ts +8 -8
  19. package/lib/components/TranslationCard.js +62 -62
  20. package/lib/components/TranslationComposer.d.ts +3 -3
  21. package/lib/components/TranslationComposer.js +17 -17
  22. package/lib/contexts/PhraseContext.d.ts +9 -9
  23. package/lib/contexts/PhraseContext.js +3 -3
  24. package/lib/contexts/SwiftyperServiceContext.d.ts +4 -4
  25. package/lib/contexts/SwiftyperServiceContext.js +3 -3
  26. package/lib/contexts/TranslationContext.d.ts +17 -17
  27. package/lib/contexts/TranslationContext.js +3 -3
  28. package/lib/index.d.ts +14 -11
  29. package/lib/index.js +50 -22
  30. package/lib/providers/PhraseProvider.d.ts +8 -8
  31. package/lib/providers/PhraseProvider.js +11 -11
  32. package/lib/providers/SwiftyperServiceProvider.d.ts +6 -6
  33. package/lib/providers/SwiftyperServiceProvider.js +20 -20
  34. package/lib/providers/TranslationProvider.d.ts +6 -6
  35. package/lib/providers/TranslationProvider.js +23 -23
  36. package/lib/providers/swiftyper.d.ts +13 -13
  37. package/lib/providers/swiftyper.js +7 -7
  38. package/lib/services/SwiftyperService.d.ts +11 -11
  39. package/lib/services/SwiftyperService.js +33 -33
  40. package/lib/types/Phrase.d.ts +61 -61
  41. package/lib/types/Phrase.js +1 -1
  42. package/lib/types/SwiftyperContextType.d.ts +5 -5
  43. package/lib/types/SwiftyperContextType.js +1 -1
  44. package/lib/types/Theme.d.ts +2 -0
  45. package/lib/types/Theme.js +9 -0
  46. package/lib/types/Translation.d.ts +16 -16
  47. package/lib/types/Translation.js +1 -1
  48. package/package.json +74 -75
  49. package/lib/components/Rodal.d.ts +0 -57
  50. package/lib/components/Rodal.js +0 -111
  51. package/lib/rodal.css +0 -477
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # ๐Ÿ‘ฝ Inline translations for FBT
1
+ # ๐Ÿ‘ฝ Inline Translations for FBT
2
2
 
3
3
  The extension serves to effectively translate your application using inline translations so that you can view strings you are
4
4
  translating in context.
@@ -13,9 +13,9 @@ You can make translations available to your translators, users, or the entire co
13
13
  ![Demo of FBT inline translating](https://raw.githubusercontent.com/swiftyper-sk/fbt-inline-translations/main/images/demo.gif)
14
14
 
15
15
 
16
- ## โ„น๏ธ Usage Notes
16
+ ## โ„น๏ธ Prerequisites
17
17
 
18
- - This library requires one of these FBT frameworks:
18
+ This library requires one of the following FBT frameworks:
19
19
  - [FBT for Laravel (v5.5+)](https://github.com/richardDobron/laravel-fbt)
20
20
  - [FBT for PHP (v7.0+)](https://github.com/richardDobron/fbt)
21
21
  - [FBT for JavaScript](https://github.com/facebook/fbt)
@@ -27,15 +27,15 @@ You can make translations available to your translators, users, or the entire co
27
27
  - ๐Ÿ“š **Glossary**: support for consistent terminology
28
28
  - ๐Ÿ‘ **Voting**: on translation options
29
29
  - ๐Ÿ”„ **Variations**: for dynamic content
30
- - ๐ŸŒ™ **Dark mode**: to match your theme
30
+ - ๐ŸŒ™ **Dark Mode**: to match your theme
31
31
 
32
- ## ๐Ÿ“ฆ Installing
32
+ ## ๐Ÿ“ฆ Installation
33
33
 
34
- โš ๏ธ **React 15 or higher only.**
34
+ โš ๏ธ **React 15 or higher is required.**
35
35
 
36
- Install the plugin via npm or yarn:
36
+ Install the plugin using npm or yarn:
37
37
 
38
- ```shell
38
+ ```bash
39
39
  npm install fbt-inline-translations
40
40
  # or
41
41
  yarn add fbt-inline-translations
@@ -129,25 +129,25 @@ init({
129
129
  Register your FBT project on [Swiftyper Translations](https://translations.swiftyper.sk).
130
130
 
131
131
 
132
- | **Option** | **Type** | **Description** |
133
- |---------------------------|----------|---------------------------------------------------------------------|
134
- | `apiKey` | string | API key for authenticating with the help center. |
135
- | `locale` | string | Locale setting for the translation widget (e.g., `en_US`, `de_DE`). |
136
- | `contributor` | string | Contributor email for authentication. |
137
- | `darkMode` | boolean | Dark mode theme. |
132
+ | **Option** | **Type** | **Description** |
133
+ |---------------|----------|-----------------------------------------------------------|
134
+ | `apiKey` | string | API key for authenticating with the translation service. |
135
+ | `locale` | string | Locale setting for translations (e.g., `en_US`, `de_DE`). |
136
+ | `contributor` | string | Contributor email for authentication. |
137
+ | `darkMode` | boolean | Dark mode theme. |
138
138
 
139
139
  ## โšก๏ธ Quick Start
140
140
 
141
141
  ### Non-React Usage
142
142
 
143
- Add this code to your page:
143
+ Include the following code snippet in your HTML page:
144
144
 
145
145
  ```html
146
146
  <div id="inline-translator"></div>
147
147
 
148
148
  <script src="https://cdn.jsdelivr.net/npm/fbt-inline-translations/dist/bundle.js"></script>
149
149
  <script>
150
- swiftyperInlineTranslations({
150
+ swiftyperInlineTranslations.default({
151
151
  token: 'YOUR_API_KEY_HERE',
152
152
  locale: 'sk_SK', // translation locale
153
153
  contributor: 'contributor@email.com', // contributor must be invited
@@ -160,7 +160,7 @@ Add this code to your page:
160
160
 
161
161
  In your application, wrap your `App` component. We recommend adding it around your root component in the `index.js` file.
162
162
 
163
- ```js
163
+ ```javascript
164
164
  // src/index.js
165
165
 
166
166
  import ReactDOM from 'react-dom';
@@ -181,8 +181,8 @@ ReactDOM.render(
181
181
 
182
182
  ## ๐Ÿงช Testing
183
183
 
184
- ```sh
185
- npm run dev
184
+ ```bash
185
+ npm run start
186
186
  ```
187
187
 
188
188
  ## ๐ŸŒŸ Contributing