fbt-inline-translations 0.1.0

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 (52) hide show
  1. package/.babelrc +7 -0
  2. package/.eslintrc.js +25 -0
  3. package/.prettierignore +1 -0
  4. package/.prettierrc.json +6 -0
  5. package/README.md +39 -0
  6. package/babel.config.js +20 -0
  7. package/dist/0d8bb5b3ee5f5dac9e44.woff2 +0 -0
  8. package/dist/176f8f5bd5f02b3abfcf.woff2 +0 -0
  9. package/dist/18d00f739ff1e1c52db1.woff +0 -0
  10. package/dist/2267169ee7270a22a963.woff +0 -0
  11. package/dist/37a7069dc30fc663c878.woff2 +0 -0
  12. package/dist/451d4e559d6f57cdf6a1.woff +0 -0
  13. package/dist/49ae34d4cc6b98c00c69.woff +0 -0
  14. package/dist/7d8125ff7f707231fd89.woff2 +0 -0
  15. package/dist/7f839a8652da29745ce4.woff2 +0 -0
  16. package/dist/865f928cbabcc9f8f2b5.woff +0 -0
  17. package/dist/870c8c1486f76054301a.woff2 +0 -0
  18. package/dist/9360531f9bb817f917f0.woff +0 -0
  19. package/dist/a45108d3b34af91f9113.woff +0 -0
  20. package/dist/b1d9d9904bfca8802a63.woff +0 -0
  21. package/dist/bac8362e7a6ea60b6983.woff +0 -0
  22. package/dist/bd5b7a13f2c52b531a2a.woff +0 -0
  23. package/dist/bundle.js +2 -0
  24. package/dist/bundle.js.LICENSE.txt +67 -0
  25. package/dist/c18ee39fb002ad58b6dc.woff2 +0 -0
  26. package/dist/c20d916c1a1b094c1cec.woff +0 -0
  27. package/dist/c2aa4ab115bf9c6057cb.woff2 +0 -0
  28. package/dist/c64e7e354c88e613c77c.woff2 +0 -0
  29. package/dist/cb5ad999740e9d8a8bd1.woff2 +0 -0
  30. package/dist/cea99d3e3e13a3a599a0.woff +0 -0
  31. package/dist/d022bc70dc1bf7b3425d.woff2 +0 -0
  32. package/dist/f5b74d7ffcdf85b9dd60.woff2 +0 -0
  33. package/dist/index.html +26 -0
  34. package/images/demo.gif +0 -0
  35. package/package.json +58 -0
  36. package/postcss.config.js +6 -0
  37. package/src/@types/Phrase.ts +58 -0
  38. package/src/@types/SwiftyperContextType.ts +5 -0
  39. package/src/@types/Translation.ts +16 -0
  40. package/src/App.css +24 -0
  41. package/src/App.tsx +83 -0
  42. package/src/components/Candidate.tsx +32 -0
  43. package/src/components/Composer.tsx +65 -0
  44. package/src/components/PhraseOverview.tsx +19 -0
  45. package/src/components/TranslationCard.tsx +120 -0
  46. package/src/contexts/SwiftyperServiceContext.tsx +37 -0
  47. package/src/index.tsx +35 -0
  48. package/src/providers/swiftyper.tsx +21 -0
  49. package/src/services/SwiftyperService.ts +46 -0
  50. package/tailwind.config.js +9 -0
  51. package/tsconfig.json +20 -0
  52. package/webpack.config.js +43 -0
package/.babelrc ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "presets": [
3
+ "@babel/preset-env",
4
+ ["@babel/preset-react", { "runtime": "automatic" }],
5
+ "@babel/preset-typescript"
6
+ ]
7
+ }
package/.eslintrc.js ADDED
@@ -0,0 +1,25 @@
1
+ module.exports = {
2
+ root: true,
3
+ parser: '@typescript-eslint/parser',
4
+ parserOptions: {
5
+ ecmaVersion: 2020,
6
+ sourceType: "module",
7
+ },
8
+ plugins: [
9
+ '@typescript-eslint',
10
+ 'prettier'
11
+ ],
12
+ extends: [
13
+ 'eslint:recommended',
14
+ 'plugin:@typescript-eslint/eslint-recommended',
15
+ 'plugin:@typescript-eslint/recommended',
16
+ 'plugin:prettier/recommended'
17
+ ],
18
+ "rules": {
19
+ "prettier/prettier": "warn",
20
+ "@typescript-eslint/member-delimiter-style": "off",
21
+ "@typescript-eslint/explicit-function-return-type": "off",
22
+ "@typescript-eslint/no-use-before-define": "off",
23
+ "@typescript-eslint/no-non-null-assertion": "off",
24
+ }
25
+ };
@@ -0,0 +1 @@
1
+ node_modules
@@ -0,0 +1,6 @@
1
+ {
2
+ "trailingComma": "es5",
3
+ "tabWidth": 4,
4
+ "semi": false,
5
+ "singleQuote": true
6
+ }
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # 👽 Inline translations for FBT
2
+
3
+ ![Demo of FBT inline translating](images/demo.gif)
4
+
5
+
6
+ ## ℹ️ Usage notes
7
+
8
+ - this library requires FBT for PHP:
9
+ - [FBT for Laravel (v5.5+)](https://github.com/richardDobron/laravel-fbt)
10
+ - [FBT for PHP (v7.0+)](https://github.com/richardDobron/fbt)
11
+
12
+ ## 📦 Installing
13
+
14
+ ```
15
+ npm install fbt-inline-translations
16
+ ```
17
+
18
+ ## 🔧 Configuration
19
+
20
+ Register your FBT project on [Swiftyper Translations](https://translations.swiftyper.sk)
21
+
22
+
23
+ ### Non-React usage
24
+
25
+ Add this code to page your page:
26
+
27
+ ```html
28
+ <div id="inline-translator"></div>
29
+
30
+ <script src="https://cdn.jsdelivr.net/npm/fbt-inline-translations/dist/bundle.js"></script>
31
+ <script>
32
+ swiftyperInlineTranslations({
33
+ token: 'YOUR_API_KEY_HERE',
34
+ locale: 'sk_SK', // translation locale
35
+ contributor: 'contributor@email.com', // contributor must be invited
36
+ darkMode: false, // dark mode also depends on html class 'dark'
37
+ })
38
+ </script>
39
+ ```
@@ -0,0 +1,20 @@
1
+ module.exports = function (api) {
2
+ api.cache(true)
3
+
4
+ const useESModules = process.env.BABEL_MODULE === 'es'
5
+
6
+ return {
7
+ presets: [
8
+ [
9
+ '@babel/preset-env',
10
+ {
11
+ loose: true,
12
+ modules: useESModules ? false : 'commonjs',
13
+ },
14
+ ],
15
+ ['@babel/preset-react', { runtime: 'automatic' }],
16
+ '@babel/preset-typescript',
17
+ ],
18
+ plugins: ['@babel/plugin-proposal-class-properties'],
19
+ }
20
+ }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file