react-intl-phraseapp
Advanced tools
Comparing version 3.0.2 to 3.1.0
export { initializePhraseAppEditor } from './functions'; | ||
export { injectIntl, ReactIntlPhraseProps } from './injectIntl'; | ||
export { FormattedMessage } from './FormattedMessage'; | ||
export { useIntl } from './useIntl'; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-intl")):"function"==typeof define&&define.amd?define(["react","react-intl"],t):"object"==typeof exports?exports["react-intl-phraseapp"]=t(require("react"),require("react-intl")):e["react-intl-phraseapp"]=t(e.React,e.ReactIntl)}(window,(function(e,t){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.escapeId=t.isPhraseEnabled=t.initializePhraseAppEditor=void 0;let n=!1;t.initializePhraseAppEditor=function(e){if(!n&&(n=!0,window.PHRASEAPP_ENABLED=e.phraseEnabled,window.PHRASEAPP_CONFIG=function(e){return e.prefix=e.prefix?e.prefix:"{{__",e.suffix=e.suffix?e.suffix:"__}}",e}(e),e.phraseEnabled)){const e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=["https://","app.phrase.com/assets/in-context-editor/2.0/app.js?",(new Date).getTime()].join("");var t=document.getElementsByTagName("script")[0];void 0!==t?t.parentNode.insertBefore(e,t):document.body.appendChild(e)}},t.isPhraseEnabled=function(){return window.PHRASEAPP_ENABLED},t.escapeId=function(e){let t=window.PHRASEAPP_CONFIG;return t.prefix+"phrase_"+e+t.suffix}},function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t,r){e.exports=r(4)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);Object.defineProperty(t,"initializePhraseAppEditor",{enumerable:!0,get:function(){return n.initializePhraseAppEditor}});var i=r(5);Object.defineProperty(t,"injectIntl",{enumerable:!0,get:function(){return i.injectIntl}});var o=r(6);Object.defineProperty(t,"FormattedMessage",{enumerable:!0,get:function(){return o.FormattedMessage}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.injectIntl=void 0;const n=r(1),i=r(2),o=r(0);t.injectIntl=function(e,t){class r extends n.Component{constructor(...e){super(...e),this.render=this.render.bind(this),this.translate=this.translate.bind(this),this.formatMessage=this.formatMessage.bind(this)}translate(e){if(o.isPhraseEnabled()){const t=e.replace("<","[[[[[[html_open]]]]]]").replace(">","[[[[[[html_close]]]]]]");return o.escapeId(t)}return this.props.intl.formatMessage({id:e})}formatMessage(e){const{id:t}=e;if(t)return this.translate(t);console.error("formatMessage requires an id")}render(){return n.createElement(e,Object.assign({translate:this.translate,formatMessage:this.formatMessage},this.props))}}return i.injectIntl(r,t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FormattedMessage=void 0;const n=r(1),i=r(2),o=r(0);t.FormattedMessage=e=>{var t;return o.isPhraseEnabled()?n.createElement("span",null,o.escapeId(null!==(t=e.id)&&void 0!==t?t:"")):n.createElement(i.FormattedMessage,Object.assign({},e))}}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-intl"),require("react")):"function"==typeof define&&define.amd?define(["react-intl","react"],t):"object"==typeof exports?exports["react-intl-phraseapp"]=t(require("react-intl"),require("react")):e["react-intl-phraseapp"]=t(e.ReactIntl,e.React)}(window,(function(e,t){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.escapeId=t.isPhraseEnabled=t.initializePhraseAppEditor=void 0;let n=!1;t.initializePhraseAppEditor=function(e){if(!n&&(n=!0,window.PHRASEAPP_ENABLED=e.phraseEnabled,window.PHRASEAPP_CONFIG=function(e){return e.prefix=e.prefix?e.prefix:"{{__",e.suffix=e.suffix?e.suffix:"__}}",e}(e),e.phraseEnabled)){const e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=["https://","app.phrase.com/assets/in-context-editor/2.0/app.js?",(new Date).getTime()].join("");var t=document.getElementsByTagName("script")[0];void 0!==t?t.parentNode.insertBefore(e,t):document.body.appendChild(e)}},t.isPhraseEnabled=function(){return window.PHRASEAPP_ENABLED},t.escapeId=function(e){let t=window.PHRASEAPP_CONFIG;return t.prefix+"phrase_"+e+t.suffix}},function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t,r){e.exports=r(4)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);Object.defineProperty(t,"initializePhraseAppEditor",{enumerable:!0,get:function(){return n.initializePhraseAppEditor}});var i=r(5);Object.defineProperty(t,"injectIntl",{enumerable:!0,get:function(){return i.injectIntl}});var s=r(6);Object.defineProperty(t,"FormattedMessage",{enumerable:!0,get:function(){return s.FormattedMessage}});var o=r(7);Object.defineProperty(t,"useIntl",{enumerable:!0,get:function(){return o.useIntl}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.injectIntl=void 0;const n=r(2),i=r(1),s=r(0);t.injectIntl=function(e,t){class r extends n.Component{constructor(...e){super(...e),this.render=this.render.bind(this),this.translate=this.translate.bind(this),this.formatMessage=this.formatMessage.bind(this)}translate(e){if(s.isPhraseEnabled()){const t=e.replace("<","[[[[[[html_open]]]]]]").replace(">","[[[[[[html_close]]]]]]");return s.escapeId(t)}return this.props.intl.formatMessage({id:e})}formatMessage(e){const{id:t}=e;if(t)return this.translate(t);console.error("formatMessage requires an id")}render(){return n.createElement(e,Object.assign({translate:this.translate,formatMessage:this.formatMessage},this.props))}}return i.injectIntl(r,t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FormattedMessage=void 0;const n=r(2),i=r(1),s=r(0);t.FormattedMessage=e=>{var t;return s.isPhraseEnabled()?n.createElement("span",null,s.escapeId(null!==(t=e.id)&&void 0!==t?t:"")):n.createElement(i.FormattedMessage,Object.assign({},e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useIntl=void 0;const n=r(1),i=r(0);t.useIntl=function(){if(i.isPhraseEnabled()){const e=n.useIntl();return Object.assign(Object.assign({},e),{formatMessage:function(...e){var t;return i.escapeId((null===(t=e[0])||void 0===t?void 0:t.id)||"")}})}return n.useIntl()}}])})); |
{ | ||
"name": "react-intl-phraseapp", | ||
"version": "3.0.2", | ||
"version": "3.1.0", | ||
"description": "The In-Context-Editor for react using react-intl", | ||
@@ -5,0 +5,0 @@ "main": "dist/react-intl-phraseapp.js", |
@@ -74,2 +74,12 @@ # react-intl-phraseapp | ||
### Using the US Datacenter with ICE | ||
In addition to `phraseEnabled` and `projectId` in the config, also add the US specific URLs to enable working through the US endpoint. | ||
``` | ||
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", | ||
``` | ||
### Import from react-intl-phraseapp rather than from react-intl | ||
@@ -76,0 +86,0 @@ |
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
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
21
109
10727