@fluid-topics/ft-i18n 1.3.19 → 1.3.21

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.
@@ -7,7 +7,7 @@
7
7
  <span class="ft-i18n">
8
8
  ${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
9
9
  </span>
10
- `}update(t){var r;super.update(t),["context","key","defaultMessage"].some(n=>t.has(n))&&this.context&&this.key&&this.addI18nContext(this.context,{[this.key]:(r=this.defaultMessage)!==null&&r!==void 0?r:""})}};$.elementDefinitions={};$.styles=Yt;Le([(0,ft.redux)()],$.prototype,"editorMode",void 0);Le([(0,dt.property)()],$.prototype,"context",void 0);Le([(0,dt.property)()],$.prototype,"key",void 0);Le([(0,ft.jsonProperty)([])],$.prototype,"args",void 0);Le([(0,dt.property)()],$.prototype,"defaultMessage",void 0);var Nn=class e{static build(t){return new e(t)}static buildCustom(t){return new e(t,!0)}static fromGwt(t){return new e(t)}get service(){return this.custom?He:ge}constructor(t,r=!1){this.name=t,this.custom=r,this.properties=new Proxy({},{get:(n,i)=>{let s=i;return a=>({context:this.name,key:s,custom:this.custom,args:typeof a=="function"?void 0:a,argsProvider:typeof a=="function"?a:void 0})}}),this.messages=new Proxy({},{get:(n,i)=>(...s)=>this.service.resolveMessage(this.name,i,...s)}),this.rawMessages=new Proxy({},{get:(n,i)=>this.service.resolveRawMessage(this.name,i)})}};var xu=(e,t)=>(r,n)=>{var i,s;r.constructor.createProperty(n,t??{attribute:!1,type:String});let a={...e,key:(i=e.key)!==null&&i!==void 0?i:n};r[ke]=(s=r[ke])!==null&&s!==void 0?s:new Map,r[ke].set(n,a)};(0,Un.customElement)("ft-i18n")($);})();
10
+ `}update(t){var r;super.update(t),["context","key","defaultMessage"].some(n=>t.has(n))&&this.context&&this.key&&this.addI18nContext(this.context,{[this.key]:(r=this.defaultMessage)!==null&&r!==void 0?r:""})}};$.elementDefinitions={};$.styles=Yt;Le([(0,ft.redux)()],$.prototype,"editorMode",void 0);Le([(0,dt.property)()],$.prototype,"context",void 0);Le([(0,dt.property)()],$.prototype,"key",void 0);Le([(0,ft.jsonProperty)([])],$.prototype,"args",void 0);Le([(0,dt.property)()],$.prototype,"defaultMessage",void 0);var Nn=class e{static build(t){return new e(t)}static buildCustom(t){return new e(t,!0)}static fromGwt(t){return new e(t)}get service(){return this.custom?He:ge}constructor(t,r=!1){this.name=t,this.custom=r,this.properties=new Proxy({},{get:(n,i)=>{let s=i;return a=>({context:this.name,key:s,custom:this.custom,args:typeof a=="function"?void 0:a,argsProvider:typeof a=="function"?a:void 0})}}),this.messages=new Proxy({},{get:(n,i)=>(...s)=>this.service.resolveMessage(this.name,i,...s)}),this.rawMessages=new Proxy({},{get:(n,i)=>this.service.resolveRawMessage(this.name,i)}),this.keys=new Proxy({},{get:(n,i)=>()=>i})}};var xu=(e,t)=>(r,n)=>{var i,s;r.constructor.createProperty(n,t??{attribute:!1,type:String});let a={...e,key:(i=e.key)!==null&&i!==void 0?i:n};r[ke]=(s=r[ke])!==null&&s!==void 0?s:new Map,r[ke].set(n,a)};(0,Un.customElement)("ft-i18n")($);})();
11
11
  /*! Bundled license information:
12
12
 
13
13
  @lit/reactive-element/css-tag.js:
@@ -77,7 +77,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:t.extend("--ft-conte
77
77
  <span class="ft-i18n">
78
78
  ${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
79
79
  </span>
80
- `}update(e){var o;super.update(e),["context","key","defaultMessage"].some(n=>e.has(n))&&this.context&&this.key&&this.addI18nContext(this.context,{[this.key]:(o=this.defaultMessage)!==null&&o!==void 0?o:""})}};ce.elementDefinitions={};ce.styles=Gs;ar([Rr()],ce.prototype,"editorMode",void 0);ar([P()],ce.prototype,"context",void 0);ar([P()],ce.prototype,"key",void 0);ar([fe([])],ce.prototype,"args",void 0);ar([P()],ce.prototype,"defaultMessage",void 0);var rc=class r{static build(e){return new r(e)}static buildCustom(e){return new r(e,!0)}static fromGwt(e){return new r(e)}get service(){return this.custom?$r:Ct}constructor(e,o=!1){this.name=e,this.custom=o,this.properties=new Proxy({},{get:(n,a)=>{let i=a;return s=>({context:this.name,key:i,custom:this.custom,args:typeof s=="function"?void 0:s,argsProvider:typeof s=="function"?s:void 0})}}),this.messages=new Proxy({},{get:(n,a)=>(...i)=>this.service.resolveMessage(this.name,a,...i)}),this.rawMessages=new Proxy({},{get:(n,a)=>this.service.resolveRawMessage(this.name,a)})}};var Rv=(r,e)=>(o,n)=>{var a,i;o.constructor.createProperty(n,e??{attribute:!1,type:String});let s={...r,key:(a=r.key)!==null&&a!==void 0?a:n};o[nr]=(i=o[nr])!==null&&i!==void 0?i:new Map,o[nr].set(n,s)};Mt("ft-i18n")(ce);})();
80
+ `}update(e){var o;super.update(e),["context","key","defaultMessage"].some(n=>e.has(n))&&this.context&&this.key&&this.addI18nContext(this.context,{[this.key]:(o=this.defaultMessage)!==null&&o!==void 0?o:""})}};ce.elementDefinitions={};ce.styles=Gs;ar([Rr()],ce.prototype,"editorMode",void 0);ar([P()],ce.prototype,"context",void 0);ar([P()],ce.prototype,"key",void 0);ar([fe([])],ce.prototype,"args",void 0);ar([P()],ce.prototype,"defaultMessage",void 0);var rc=class r{static build(e){return new r(e)}static buildCustom(e){return new r(e,!0)}static fromGwt(e){return new r(e)}get service(){return this.custom?$r:Ct}constructor(e,o=!1){this.name=e,this.custom=o,this.properties=new Proxy({},{get:(n,a)=>{let i=a;return s=>({context:this.name,key:i,custom:this.custom,args:typeof s=="function"?void 0:s,argsProvider:typeof s=="function"?s:void 0})}}),this.messages=new Proxy({},{get:(n,a)=>(...i)=>this.service.resolveMessage(this.name,a,...i)}),this.rawMessages=new Proxy({},{get:(n,a)=>this.service.resolveRawMessage(this.name,a)}),this.keys=new Proxy({},{get:(n,a)=>()=>a})}};var Rv=(r,e)=>(o,n)=>{var a,i;o.constructor.createProperty(n,e??{attribute:!1,type:String});let s={...r,key:(a=r.key)!==null&&a!==void 0?a:n};o[nr]=(i=o[nr])!==null&&i!==void 0?i:new Map,o[nr].set(n,s)};Mt("ft-i18n")(ce);})();
81
81
  /*! Bundled license information:
82
82
 
83
83
  @webcomponents/scoped-custom-element-registry/src/scoped-custom-element-registry.js:
@@ -23,6 +23,9 @@ export type RawI18nMessages<T extends I18nMessages> = {
23
23
  type I18nPropertyProviders<T extends I18nMessages> = {
24
24
  [key in keyof T]: Parameters<T[key]> extends [] ? () => I18nPropertyInit : ((argsOrArgsProvider: ((litElement: any) => Parameters<T[key]>) | Parameters<T[key]>) => I18nPropertyInit);
25
25
  };
26
+ export type I18nKeyProviders<T extends I18nMessages> = {
27
+ [key in keyof T]: () => keyof T;
28
+ };
26
29
  export declare class I18nMessageContext<T extends I18nMessages> {
27
30
  name: string;
28
31
  custom: boolean;
@@ -32,6 +35,7 @@ export declare class I18nMessageContext<T extends I18nMessages> {
32
35
  readonly properties: I18nPropertyProviders<T>;
33
36
  readonly messages: T;
34
37
  readonly rawMessages: RawI18nMessages<T>;
38
+ readonly keys: I18nKeyProviders<T>;
35
39
  get service(): import("@fluid-topics/ft-app-context").FtI18nServiceInternalClass;
36
40
  private constructor();
37
41
  }
@@ -34,5 +34,8 @@ export class I18nMessageContext {
34
34
  this.rawMessages = new Proxy({}, {
35
35
  get: (target, messageKey) => this.service.resolveRawMessage(this.name, messageKey)
36
36
  });
37
+ this.keys = new Proxy({}, {
38
+ get: (target, messageKey) => () => messageKey
39
+ });
37
40
  }
38
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-i18n",
3
- "version": "1.3.19",
3
+ "version": "1.3.21",
4
4
  "description": "Integrated component that displays internationalized label from a Fluid Topics portal.",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,9 +19,9 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-app-context": "1.3.19",
23
- "@fluid-topics/ft-wc-utils": "1.3.19",
22
+ "@fluid-topics/ft-app-context": "1.3.21",
23
+ "@fluid-topics/ft-wc-utils": "1.3.21",
24
24
  "lit": "3.1.0"
25
25
  },
26
- "gitHead": "d3142bbeffbc47e550279b0d5d4e23ce72aaf514"
26
+ "gitHead": "fd30595cd89395cbcac48ca8146aecef2e9b8673"
27
27
  }