react-intl-phraseapp
Advanced tools
Comparing version 3.2.0 to 4.0.0
export { initializePhraseAppEditor } from './functions'; | ||
export { injectIntl, ReactIntlPhraseProps } from './injectIntl'; | ||
export { injectIntl } from './injectIntl'; | ||
export { FormattedMessage } from './FormattedMessage'; | ||
export { useIntl } from './useIntl'; | ||
export { WrappedComponentProps } from './WrappedComponentProps'; |
@@ -1,7 +0,5 @@ | ||
import * as React from 'react'; | ||
import { injectIntl as injectIntlReact, IntlFormatters } from 'react-intl'; | ||
export declare type ReactIntlPhraseProps = { | ||
translate: (_: string) => string; | ||
formatMessage: IntlFormatters['formatMessage']; | ||
import { injectIntl as injectIntlReact, WrappedComponentProps, WithIntlProps } from 'react-intl'; | ||
import React from 'react'; | ||
export declare function injectIntl<IntlPropName extends string = 'intl', P extends WrappedComponentProps<IntlPropName> = WrappedComponentProps<any>>(WrappedComponent: React.ComponentType<P>, options?: Parameters<typeof injectIntlReact>[1]): React.ComponentType<WithIntlProps<P>> & { | ||
WrappedComponent: typeof WrappedComponent; | ||
}; | ||
export declare function injectIntl(WrappedComponent: React.ComponentType<ReactIntlPhraseProps>, options?: Parameters<typeof injectIntlReact>[1]): ReturnType<typeof injectIntlReact> & React.FC<ReactIntlPhraseProps>; |
{ | ||
"name": "react-intl-phraseapp", | ||
"version": "3.2.0", | ||
"version": "4.0.0", | ||
"description": "The In-Context-Editor for react using react-intl", | ||
"main": "dist/react-intl-phraseapp.js", | ||
"main": "dist/index.js", | ||
"typings": "./dist/index.d.ts", | ||
@@ -26,22 +26,22 @@ "homepage": "https://phrase.com", | ||
"@types/jest": "^25.1.2", | ||
"@types/node": "^13.7.1", | ||
"@types/react": "^16.9.19", | ||
"@types/react-dom": "^16.9.5", | ||
"@types/react-test-renderer": "^16.9.2", | ||
"jest": "^25.1.0", | ||
"merge": ">=1.2.1", | ||
"react": "^16.12.0", | ||
"@types/node": "^20.5.7", | ||
"@types/react": "^18.2.21", | ||
"@types/react-dom": "^18.2.7", | ||
"@types/react-test-renderer": "^18.0.0", | ||
"jest": "^29.6.4", | ||
"jest-environment-jsdom": "^29.6.4", | ||
"react": "^18.2.0", | ||
"react-addons-test-utils": "^15.6.2", | ||
"react-dom": "^16.12.0", | ||
"react-intl": "^5.0.0", | ||
"react-test-renderer": "^16.12.0", | ||
"ts-jest": "^25.2.0", | ||
"ts-loader": "^6.2.1", | ||
"typescript": "^3.7.5", | ||
"webpack": "^4.41.6", | ||
"webpack-cli": "^3.3.11" | ||
"react-dom": "^18.2.0", | ||
"react-intl": "^6.4.4", | ||
"react-test-renderer": "^18.2.0", | ||
"ts-jest": "^29.1.1", | ||
"ts-loader": "^9.4.4", | ||
"typescript": "^5.2.2", | ||
"webpack": "^5.88.2", | ||
"webpack-cli": "^5.1.4" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=16.3.0", | ||
"react-intl": "^5" | ||
"react": ">=18.0.0", | ||
"react-intl": ">=6" | ||
}, | ||
@@ -55,3 +55,3 @@ "files": [ | ||
}, | ||
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", | ||
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$", | ||
"moduleFileExtensions": [ | ||
@@ -61,4 +61,9 @@ "ts", | ||
"js" | ||
] | ||
} | ||
], | ||
"testPathIgnorePatterns": [ | ||
"<rootDir>/examples/" | ||
], | ||
"testEnvironment": "jsdom" | ||
}, | ||
"packageManager": "yarn@3.6.3" | ||
} |
@@ -18,3 +18,3 @@ # react-intl-phraseapp | ||
You can find a demo project on [GitHub](https://github.com/phrase/react-intl-phraseapp-demo). | ||
You can find a demo project in the `examples/demo` folder, just run `yarn && yarn start` | ||
@@ -29,2 +29,8 @@ ### Installation | ||
#### via Yarn | ||
```bash | ||
yarn add react-intl-phraseapp | ||
``` | ||
#### Build from source | ||
@@ -35,3 +41,3 @@ | ||
```bash | ||
npm run dist | ||
yarn dist | ||
``` | ||
@@ -43,3 +49,3 @@ | ||
# install deps | ||
npm install | ||
yarn install | ||
``` | ||
@@ -56,2 +62,3 @@ | ||
projectId: '<YOUR_PROJECT_ID>', | ||
accountId: '<YOUR_ACCOUNT_ID>', | ||
phraseEnabled: true, | ||
@@ -67,2 +74,3 @@ prefix: "[[__", | ||
You can find the Project-ID in the Project overview in the PhraseApp Translation Center. | ||
You can find the Account-ID in the Organization page in the PhraseApp Translation Center. | ||
@@ -84,8 +92,5 @@ If this does not work for you, you can also integrate the [JavaScript snippet manually](https://help.phrase.com/help/integrate-in-context-editor-into-any-web-framework). | ||
In addition to `phraseEnabled` and `projectId` in the config, also add the US specific URLs to enable working through the US endpoint. | ||
In addition to the settings in your config, set the US datacenter to enable it working with the US endpoints. | ||
```js | ||
baseUrl: "https://us.app.phrase.com", | ||
apiBaseUrl: 'https://api.us.app.phrase.com/api/v2', | ||
oauthEndpointUrl: "https://api.us.app.phrase.com/api/v2/authorizations", | ||
profileUrl: "https://us.app.phrase.com/settings/profile", | ||
datacenter: 'us', | ||
``` | ||
@@ -95,6 +100,9 @@ | ||
Find all imports of `FormattedMessage`, and change the source from `react-intl` to `react-intl-phraseapp`. | ||
Find all available imports for `react-intl` by changing the source from `react-intl` to `react-intl-phraseapp`, such as `FormattedMessage`, `useIntl`, `WrappedComponentProps`, and `injectIntl`. | ||
`import {FormattedMessage} from 'react-intl-phraseapp'` | ||
`import { FormattedMessage } from 'react-intl-phraseapp'` | ||
`import { useIntl, WrappedComponentProps } from 'react-intl-phraseapp'` | ||
`import { injectIntl, WrappedComponentProps } from 'react-intl-phraseapp'` | ||
### Browser support | ||
@@ -116,8 +124,14 @@ | ||
## :exclamation: Issues, Questions, Support | ||
## :white_check_mark: Commits & Pull Requests | ||
Please use [GitHub issues](https://github.com/phrase/react-intl-phraseapp/issues) to share the problem, and we will do our best to answer any questions or to support you in finding a solution. | ||
We welcome anyone who wants to contribute to our codebase, so if you notice something, feel free to open a Pull Request! However, we ask that you please use the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification for your commit messages and titles when opening a Pull Request. | ||
Example: `chore: Update README` | ||
## :question: Issues, Questions, Support | ||
Please use [GitHub issues](https://github.com/phrase/react-intl-phraseapp/issues) to share your problem, and we will do our best to answer any questions or to support you in finding a solution. | ||
## :memo: Changelog | ||
Detailed changes for each release are documented in the [changelog](https://github.com/phrase/react-intl-phraseapp/releases). | ||
Detailed changes for each release are documented in the [changelog](https://github.com/phrase/react-intl-phraseapp/releases). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
10
21
129
10384