@lukso/core 1.10.1-dev.ff2cb0a → 1.10.2-dev.1347279

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.
@@ -14,22 +14,27 @@ var en_US_default = {
14
14
  sign_up_modal_title: "Create Universal Profile!",
15
15
  sign_up_modal_install_extension: "Install the Browser Extension",
16
16
  sign_up_modal_description: "Choose the device on which you want to create a profile. You can use either to interact with supported apps",
17
+ connect_modal_wallet_connect_toast_close: "Dismiss",
18
+ connect_modal_wallet_connect_toast: "Confirm on your connected device.",
19
+ connect_modal_up_app_browser_get_app: "Get the UP!App",
17
20
  connect_modal_try_again: "Try again",
18
- connect_modal_title: "Let\u2019s log you in",
21
+ connect_modal_title: "Log in with your Universal Profile",
19
22
  connect_modal_qr_code_title: "Scan to log in",
20
23
  connect_modal_qr_code_description: "Scan the below QR code with the Universal Profile mobile app to log in",
21
24
  connect_modal_other_connectors: "Connect Wallet",
22
25
  connect_modal_or_info: "Log in with a different wallet",
23
26
  connect_modal_or: "Or",
24
27
  connect_modal_installed: "INSTALLED",
28
+ connect_modal_go_back: "Go back",
25
29
  connect_modal_failed_to_load: "Failed to load...",
26
30
  connect_modal_eoa_title: "Connect your Wallet",
27
31
  connect_modal_description: "Log in with your Universal Profile",
28
- connect_modal_connectors_up_mobile: "Mobile Application",
32
+ connect_modal_connectors_up_mobile: "Wallet Connect to the UP!App",
33
+ connect_modal_connectors_up_login: "Login with your Universal Profile",
29
34
  connect_modal_connectors_up_browser_extension: "Browser Extension",
35
+ connect_modal_connectors_up_app_browser: "Continue in the UP!App",
30
36
  connect_modal_connectors_passkey_wallet: "Passkey Wallet",
31
- connect_modal_close: "Close modal",
32
- connect_modal_go_back: "Go back"
37
+ connect_modal_close: "Close modal"
33
38
  };
34
39
 
35
40
  // src/mixins/intl.ts
@@ -90,4 +95,4 @@ function withIntlService(Base) {
90
95
 
91
96
 
92
97
  exports.withIntlService = withIntlService;
93
- //# sourceMappingURL=chunk-DNGL2W6A.cjs.map
98
+ //# sourceMappingURL=chunk-G7DECPVT.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/tools-monorepo/tools-monorepo/packages/core/dist/chunk-G7DECPVT.cjs","../src/mixins/intl.ts","../translations/en_US.json"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACDA,mDAAuB;ADGvB;AACA;AEVA,IAAA,cAAA,EAAA;AAAA,EACE,wBAAA,EAA4B,gCAAA;AAAA,EAC5B,mBAAA,EAAuB,2BAAA;AAAA,EACvB,+BAAA,EAAmC,+BAAA;AAAA,EACnC,yBAAA,EAA6B,6GAAA;AAAA,EAC7B,wCAAA,EAA4C,SAAA;AAAA,EAC5C,kCAAA,EAAsC,mCAAA;AAAA,EACtC,oCAAA,EAAwC,gBAAA;AAAA,EACxC,uBAAA,EAA2B,WAAA;AAAA,EAC3B,mBAAA,EAAuB,oCAAA;AAAA,EACvB,2BAAA,EAA+B,gBAAA;AAAA,EAC/B,iCAAA,EAAqC,wEAAA;AAAA,EACrC,8BAAA,EAAkC,gBAAA;AAAA,EAClC,qBAAA,EAAyB,gCAAA;AAAA,EACzB,gBAAA,EAAoB,IAAA;AAAA,EACpB,uBAAA,EAA2B,WAAA;AAAA,EAC3B,qBAAA,EAAyB,SAAA;AAAA,EACzB,4BAAA,EAAgC,mBAAA;AAAA,EAChC,uBAAA,EAA2B,qBAAA;AAAA,EAC3B,yBAAA,EAA6B,oCAAA;AAAA,EAC7B,kCAAA,EAAsC,8BAAA;AAAA,EACtC,iCAAA,EAAqC,mCAAA;AAAA,EACrC,6CAAA,EAAiD,mBAAA;AAAA,EACjD,uCAAA,EAA2C,wBAAA;AAAA,EAC3C,uCAAA,EAA2C,gBAAA;AAAA,EAC3C,mBAAA,EAAuB;AACzB,CAAA;AFYA;AACA;ACoBO,SAAS,eAAA,CACd,IAAA,EACgC;AAAA,EAEhC,MAAM,MAAA,QAAe,KAAa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AA,GAAA,CAAI,CAAC,GAAA,EAAK;AACR,QAAA,OAAA,CAAQ,IAAA,CAAK,8CAA8C,CAAA;AAC3D,QAAA,OAAO,EAAA;AAAA,MACT;AAEA,MAAA,MAAM,KAAA,EAAO,8CAAA,CAAe;AAC5B,MAAA,wCAAO,IAAA,6BAAM,aAAA,mBAAc,GAAA,EAAK,OAAO,GAAA,UAAK,KAAA;AAAA,IAC9C;AAAA,EACF;AAEA,EAAA,OAAO,KAAA;AACT;ADlCA;AACA;AACE;AACF,0CAAC","file":"/home/runner/work/tools-monorepo/tools-monorepo/packages/core/dist/chunk-G7DECPVT.cjs","sourcesContent":[null,"/**\n * Internationalization Mixin\n *\n * Mixin to add internationalization service to a Lit component\n */\n\nimport { effect } from '@preact/signals-core'\nimport type { LitElement } from 'lit'\nimport englishTranslations from '../../translations/en_US.json'\nimport {\n createIntlService,\n defaultConfig,\n getIntlService,\n type IntlService,\n setIntlService,\n} from '../services/intl.js'\n\n/**\n * Interface for components that have intl service capabilities\n */\nexport interface IntlServiceMixin {\n formatMessage(key?: string, options?: Record<string, string>): string\n setupLocalIntl(): IntlService | undefined\n}\n\n/**\n * Type helper for the constructor returned by withIntlService\n */\nexport type IntlServiceMixinConstructor<T extends typeof LitElement> = (new (\n ...args: any[]\n) => InstanceType<T> & IntlServiceMixin) &\n T\n\n/**\n * Mixin to add internationalization service to a Lit component\n *\n * Provides access to the global intl service with reactive locale changes.\n * Automatically subscribes to locale changes and triggers re-renders.\n *\n * The component will use the global intl service if available, or create a local one.\n * This follows the singleton pattern for the global service while allowing flexibility.\n *\n * @typeParam T - The Lit component class being extended\n * @returns Extended class with intl service capabilities\n *\n * @example\n * ```typescript\n * import { LitElement, html } from 'lit';\n * import { customElement } from 'lit/decorators.js';\n * import { withIntlService } from '@lukso/core/mixins';\n *\n * @customElement('my-component')\n * export class MyComponent extends withIntlService(LitElement) {\n * render() {\n * return html\\`<p>\\${this.formatMessage('app.welcome')}</p>\\`;\n * }\n * }\n * ```\n */\nexport function withIntlService<T extends typeof LitElement>(\n Base: T\n): IntlServiceMixinConstructor<T> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n class Mixin extends (Base as any) {\n protected unsubscribeIntl: (() => void) | undefined = undefined\n\n connectedCallback(): void {\n super.connectedCallback()\n\n // Subscribe to intl changes via signal\n let intl: IntlService | null = getIntlService()\n\n // When no intl is provided by host app we initialize our own\n if (!intl) {\n intl = this.setupLocalIntl() ?? null\n }\n\n if (intl) {\n this.unsubscribeIntl = effect(() => {\n // Access the signal to track changes\n intl?.localeChanged.value\n this.requestUpdate()\n })\n }\n\n // Set fallback for missing translations\n intl?.setFallbackTranslations(englishTranslations as any)\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n\n // Unsubscribe from intl changes\n if (typeof this.unsubscribeIntl === 'function') {\n this.unsubscribeIntl()\n }\n }\n\n /**\n * Setup a local intl service with default configuration\n * Subclasses can override this to customize initialization\n */\n protected setupLocalIntl(): IntlService | undefined {\n const intlService = createIntlService(\n Object.assign(defaultConfig, {\n messages: englishTranslations,\n })\n )\n setIntlService(intlService)\n return intlService\n }\n\n /**\n * Format message using the intl service\n */\n formatMessage(key?: string, options?: Record<string, string>): string {\n if (!key) {\n console.warn('No translation key provided to formatMessage')\n return ''\n }\n\n const intl = getIntlService()\n return intl?.formatMessage(key, options) ?? key\n }\n }\n\n return Mixin as unknown as IntlServiceMixinConstructor<T>\n}\n","{\n \"sign_up_modal_use_mobile\": \"Install the Mobile Application\",\n \"sign_up_modal_title\": \"Create Universal Profile!\",\n \"sign_up_modal_install_extension\": \"Install the Browser Extension\",\n \"sign_up_modal_description\": \"Choose the device on which you want to create a profile. You can use either to interact with supported apps\",\n \"connect_modal_wallet_connect_toast_close\": \"Dismiss\",\n \"connect_modal_wallet_connect_toast\": \"Confirm on your connected device.\",\n \"connect_modal_up_app_browser_get_app\": \"Get the UP!App\",\n \"connect_modal_try_again\": \"Try again\",\n \"connect_modal_title\": \"Log in with your Universal Profile\",\n \"connect_modal_qr_code_title\": \"Scan to log in\",\n \"connect_modal_qr_code_description\": \"Scan the below QR code with the Universal Profile mobile app to log in\",\n \"connect_modal_other_connectors\": \"Connect Wallet\",\n \"connect_modal_or_info\": \"Log in with a different wallet\",\n \"connect_modal_or\": \"Or\",\n \"connect_modal_installed\": \"INSTALLED\",\n \"connect_modal_go_back\": \"Go back\",\n \"connect_modal_failed_to_load\": \"Failed to load...\",\n \"connect_modal_eoa_title\": \"Connect your Wallet\",\n \"connect_modal_description\": \"Log in with your Universal Profile\",\n \"connect_modal_connectors_up_mobile\": \"Wallet Connect to the UP!App\",\n \"connect_modal_connectors_up_login\": \"Login with your Universal Profile\",\n \"connect_modal_connectors_up_browser_extension\": \"Browser Extension\",\n \"connect_modal_connectors_up_app_browser\": \"Continue in the UP!App\",\n \"connect_modal_connectors_passkey_wallet\": \"Passkey Wallet\",\n \"connect_modal_close\": \"Close modal\"\n}"]}
@@ -14,22 +14,27 @@ var en_US_default = {
14
14
  sign_up_modal_title: "Create Universal Profile!",
15
15
  sign_up_modal_install_extension: "Install the Browser Extension",
16
16
  sign_up_modal_description: "Choose the device on which you want to create a profile. You can use either to interact with supported apps",
17
+ connect_modal_wallet_connect_toast_close: "Dismiss",
18
+ connect_modal_wallet_connect_toast: "Confirm on your connected device.",
19
+ connect_modal_up_app_browser_get_app: "Get the UP!App",
17
20
  connect_modal_try_again: "Try again",
18
- connect_modal_title: "Let\u2019s log you in",
21
+ connect_modal_title: "Log in with your Universal Profile",
19
22
  connect_modal_qr_code_title: "Scan to log in",
20
23
  connect_modal_qr_code_description: "Scan the below QR code with the Universal Profile mobile app to log in",
21
24
  connect_modal_other_connectors: "Connect Wallet",
22
25
  connect_modal_or_info: "Log in with a different wallet",
23
26
  connect_modal_or: "Or",
24
27
  connect_modal_installed: "INSTALLED",
28
+ connect_modal_go_back: "Go back",
25
29
  connect_modal_failed_to_load: "Failed to load...",
26
30
  connect_modal_eoa_title: "Connect your Wallet",
27
31
  connect_modal_description: "Log in with your Universal Profile",
28
- connect_modal_connectors_up_mobile: "Mobile Application",
32
+ connect_modal_connectors_up_mobile: "Wallet Connect to the UP!App",
33
+ connect_modal_connectors_up_login: "Login with your Universal Profile",
29
34
  connect_modal_connectors_up_browser_extension: "Browser Extension",
35
+ connect_modal_connectors_up_app_browser: "Continue in the UP!App",
30
36
  connect_modal_connectors_passkey_wallet: "Passkey Wallet",
31
- connect_modal_close: "Close modal",
32
- connect_modal_go_back: "Go back"
37
+ connect_modal_close: "Close modal"
33
38
  };
34
39
 
35
40
  // src/mixins/intl.ts
@@ -90,4 +95,4 @@ function withIntlService(Base) {
90
95
  export {
91
96
  withIntlService
92
97
  };
93
- //# sourceMappingURL=chunk-ZOKMXPMC.js.map
98
+ //# sourceMappingURL=chunk-GTOKGI4G.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/mixins/intl.ts","../translations/en_US.json"],"sourcesContent":["/**\n * Internationalization Mixin\n *\n * Mixin to add internationalization service to a Lit component\n */\n\nimport { effect } from '@preact/signals-core'\nimport type { LitElement } from 'lit'\nimport englishTranslations from '../../translations/en_US.json'\nimport {\n createIntlService,\n defaultConfig,\n getIntlService,\n type IntlService,\n setIntlService,\n} from '../services/intl.js'\n\n/**\n * Interface for components that have intl service capabilities\n */\nexport interface IntlServiceMixin {\n formatMessage(key?: string, options?: Record<string, string>): string\n setupLocalIntl(): IntlService | undefined\n}\n\n/**\n * Type helper for the constructor returned by withIntlService\n */\nexport type IntlServiceMixinConstructor<T extends typeof LitElement> = (new (\n ...args: any[]\n) => InstanceType<T> & IntlServiceMixin) &\n T\n\n/**\n * Mixin to add internationalization service to a Lit component\n *\n * Provides access to the global intl service with reactive locale changes.\n * Automatically subscribes to locale changes and triggers re-renders.\n *\n * The component will use the global intl service if available, or create a local one.\n * This follows the singleton pattern for the global service while allowing flexibility.\n *\n * @typeParam T - The Lit component class being extended\n * @returns Extended class with intl service capabilities\n *\n * @example\n * ```typescript\n * import { LitElement, html } from 'lit';\n * import { customElement } from 'lit/decorators.js';\n * import { withIntlService } from '@lukso/core/mixins';\n *\n * @customElement('my-component')\n * export class MyComponent extends withIntlService(LitElement) {\n * render() {\n * return html\\`<p>\\${this.formatMessage('app.welcome')}</p>\\`;\n * }\n * }\n * ```\n */\nexport function withIntlService<T extends typeof LitElement>(\n Base: T\n): IntlServiceMixinConstructor<T> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n class Mixin extends (Base as any) {\n protected unsubscribeIntl: (() => void) | undefined = undefined\n\n connectedCallback(): void {\n super.connectedCallback()\n\n // Subscribe to intl changes via signal\n let intl: IntlService | null = getIntlService()\n\n // When no intl is provided by host app we initialize our own\n if (!intl) {\n intl = this.setupLocalIntl() ?? null\n }\n\n if (intl) {\n this.unsubscribeIntl = effect(() => {\n // Access the signal to track changes\n intl?.localeChanged.value\n this.requestUpdate()\n })\n }\n\n // Set fallback for missing translations\n intl?.setFallbackTranslations(englishTranslations as any)\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n\n // Unsubscribe from intl changes\n if (typeof this.unsubscribeIntl === 'function') {\n this.unsubscribeIntl()\n }\n }\n\n /**\n * Setup a local intl service with default configuration\n * Subclasses can override this to customize initialization\n */\n protected setupLocalIntl(): IntlService | undefined {\n const intlService = createIntlService(\n Object.assign(defaultConfig, {\n messages: englishTranslations,\n })\n )\n setIntlService(intlService)\n return intlService\n }\n\n /**\n * Format message using the intl service\n */\n formatMessage(key?: string, options?: Record<string, string>): string {\n if (!key) {\n console.warn('No translation key provided to formatMessage')\n return ''\n }\n\n const intl = getIntlService()\n return intl?.formatMessage(key, options) ?? key\n }\n }\n\n return Mixin as unknown as IntlServiceMixinConstructor<T>\n}\n","{\n \"sign_up_modal_use_mobile\": \"Install the Mobile Application\",\n \"sign_up_modal_title\": \"Create Universal Profile!\",\n \"sign_up_modal_install_extension\": \"Install the Browser Extension\",\n \"sign_up_modal_description\": \"Choose the device on which you want to create a profile. You can use either to interact with supported apps\",\n \"connect_modal_try_again\": \"Try again\",\n \"connect_modal_title\": \"Let’s log you in\",\n \"connect_modal_qr_code_title\": \"Scan to log in\",\n \"connect_modal_qr_code_description\": \"Scan the below QR code with the Universal Profile mobile app to log in\",\n \"connect_modal_other_connectors\": \"Connect Wallet\",\n \"connect_modal_or_info\": \"Log in with a different wallet\",\n \"connect_modal_or\": \"Or\",\n \"connect_modal_installed\": \"INSTALLED\",\n \"connect_modal_failed_to_load\": \"Failed to load...\",\n \"connect_modal_eoa_title\": \"Connect your Wallet\",\n \"connect_modal_description\": \"Log in with your Universal Profile\",\n \"connect_modal_connectors_up_mobile\": \"Mobile Application\",\n \"connect_modal_connectors_up_browser_extension\": \"Browser Extension\",\n \"connect_modal_connectors_passkey_wallet\": \"Passkey Wallet\",\n \"connect_modal_close\": \"Close modal\",\n \"connect_modal_go_back\": \"Go back\"\n}"],"mappings":";;;;;;;;AAMA,SAAS,cAAc;;;ACNvB;AAAA,EACE,0BAA4B;AAAA,EAC5B,qBAAuB;AAAA,EACvB,iCAAmC;AAAA,EACnC,2BAA6B;AAAA,EAC7B,yBAA2B;AAAA,EAC3B,qBAAuB;AAAA,EACvB,6BAA+B;AAAA,EAC/B,mCAAqC;AAAA,EACrC,gCAAkC;AAAA,EAClC,uBAAyB;AAAA,EACzB,kBAAoB;AAAA,EACpB,yBAA2B;AAAA,EAC3B,8BAAgC;AAAA,EAChC,yBAA2B;AAAA,EAC3B,2BAA6B;AAAA,EAC7B,oCAAsC;AAAA,EACtC,+CAAiD;AAAA,EACjD,yCAA2C;AAAA,EAC3C,qBAAuB;AAAA,EACvB,uBAAyB;AAC3B;;;ADsCO,SAAS,gBACd,MACgC;AAAA,EAEhC,MAAM,cAAe,KAAa;AAAA,IAAlC;AAAA;AACE,WAAU,kBAA4C;AAAA;AAAA,IAEtD,oBAA0B;AACxB,YAAM,kBAAkB;AAGxB,UAAI,OAA2B,eAAe;AAG9C,UAAI,CAAC,MAAM;AACT,eAAO,KAAK,eAAe,KAAK;AAAA,MAClC;AAEA,UAAI,MAAM;AACR,aAAK,kBAAkB,OAAO,MAAM;AAElC,gBAAM,cAAc;AACpB,eAAK,cAAc;AAAA,QACrB,CAAC;AAAA,MACH;AAGA,YAAM,wBAAwB,aAA0B;AAAA,IAC1D;AAAA,IAEA,uBAA6B;AAC3B,YAAM,qBAAqB;AAG3B,UAAI,OAAO,KAAK,oBAAoB,YAAY;AAC9C,aAAK,gBAAgB;AAAA,MACvB;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA,IAMU,iBAA0C;AAClD,YAAM,cAAc;AAAA,QAClB,OAAO,OAAO,eAAe;AAAA,UAC3B,UAAU;AAAA,QACZ,CAAC;AAAA,MACH;AACA,qBAAe,WAAW;AAC1B,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAKA,cAAc,KAAc,SAA0C;AACpE,UAAI,CAAC,KAAK;AACR,gBAAQ,KAAK,8CAA8C;AAC3D,eAAO;AAAA,MACT;AAEA,YAAM,OAAO,eAAe;AAC5B,aAAO,MAAM,cAAc,KAAK,OAAO,KAAK;AAAA,IAC9C;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../src/mixins/intl.ts","../translations/en_US.json"],"sourcesContent":["/**\n * Internationalization Mixin\n *\n * Mixin to add internationalization service to a Lit component\n */\n\nimport { effect } from '@preact/signals-core'\nimport type { LitElement } from 'lit'\nimport englishTranslations from '../../translations/en_US.json'\nimport {\n createIntlService,\n defaultConfig,\n getIntlService,\n type IntlService,\n setIntlService,\n} from '../services/intl.js'\n\n/**\n * Interface for components that have intl service capabilities\n */\nexport interface IntlServiceMixin {\n formatMessage(key?: string, options?: Record<string, string>): string\n setupLocalIntl(): IntlService | undefined\n}\n\n/**\n * Type helper for the constructor returned by withIntlService\n */\nexport type IntlServiceMixinConstructor<T extends typeof LitElement> = (new (\n ...args: any[]\n) => InstanceType<T> & IntlServiceMixin) &\n T\n\n/**\n * Mixin to add internationalization service to a Lit component\n *\n * Provides access to the global intl service with reactive locale changes.\n * Automatically subscribes to locale changes and triggers re-renders.\n *\n * The component will use the global intl service if available, or create a local one.\n * This follows the singleton pattern for the global service while allowing flexibility.\n *\n * @typeParam T - The Lit component class being extended\n * @returns Extended class with intl service capabilities\n *\n * @example\n * ```typescript\n * import { LitElement, html } from 'lit';\n * import { customElement } from 'lit/decorators.js';\n * import { withIntlService } from '@lukso/core/mixins';\n *\n * @customElement('my-component')\n * export class MyComponent extends withIntlService(LitElement) {\n * render() {\n * return html\\`<p>\\${this.formatMessage('app.welcome')}</p>\\`;\n * }\n * }\n * ```\n */\nexport function withIntlService<T extends typeof LitElement>(\n Base: T\n): IntlServiceMixinConstructor<T> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n class Mixin extends (Base as any) {\n protected unsubscribeIntl: (() => void) | undefined = undefined\n\n connectedCallback(): void {\n super.connectedCallback()\n\n // Subscribe to intl changes via signal\n let intl: IntlService | null = getIntlService()\n\n // When no intl is provided by host app we initialize our own\n if (!intl) {\n intl = this.setupLocalIntl() ?? null\n }\n\n if (intl) {\n this.unsubscribeIntl = effect(() => {\n // Access the signal to track changes\n intl?.localeChanged.value\n this.requestUpdate()\n })\n }\n\n // Set fallback for missing translations\n intl?.setFallbackTranslations(englishTranslations as any)\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n\n // Unsubscribe from intl changes\n if (typeof this.unsubscribeIntl === 'function') {\n this.unsubscribeIntl()\n }\n }\n\n /**\n * Setup a local intl service with default configuration\n * Subclasses can override this to customize initialization\n */\n protected setupLocalIntl(): IntlService | undefined {\n const intlService = createIntlService(\n Object.assign(defaultConfig, {\n messages: englishTranslations,\n })\n )\n setIntlService(intlService)\n return intlService\n }\n\n /**\n * Format message using the intl service\n */\n formatMessage(key?: string, options?: Record<string, string>): string {\n if (!key) {\n console.warn('No translation key provided to formatMessage')\n return ''\n }\n\n const intl = getIntlService()\n return intl?.formatMessage(key, options) ?? key\n }\n }\n\n return Mixin as unknown as IntlServiceMixinConstructor<T>\n}\n","{\n \"sign_up_modal_use_mobile\": \"Install the Mobile Application\",\n \"sign_up_modal_title\": \"Create Universal Profile!\",\n \"sign_up_modal_install_extension\": \"Install the Browser Extension\",\n \"sign_up_modal_description\": \"Choose the device on which you want to create a profile. You can use either to interact with supported apps\",\n \"connect_modal_wallet_connect_toast_close\": \"Dismiss\",\n \"connect_modal_wallet_connect_toast\": \"Confirm on your connected device.\",\n \"connect_modal_up_app_browser_get_app\": \"Get the UP!App\",\n \"connect_modal_try_again\": \"Try again\",\n \"connect_modal_title\": \"Log in with your Universal Profile\",\n \"connect_modal_qr_code_title\": \"Scan to log in\",\n \"connect_modal_qr_code_description\": \"Scan the below QR code with the Universal Profile mobile app to log in\",\n \"connect_modal_other_connectors\": \"Connect Wallet\",\n \"connect_modal_or_info\": \"Log in with a different wallet\",\n \"connect_modal_or\": \"Or\",\n \"connect_modal_installed\": \"INSTALLED\",\n \"connect_modal_go_back\": \"Go back\",\n \"connect_modal_failed_to_load\": \"Failed to load...\",\n \"connect_modal_eoa_title\": \"Connect your Wallet\",\n \"connect_modal_description\": \"Log in with your Universal Profile\",\n \"connect_modal_connectors_up_mobile\": \"Wallet Connect to the UP!App\",\n \"connect_modal_connectors_up_login\": \"Login with your Universal Profile\",\n \"connect_modal_connectors_up_browser_extension\": \"Browser Extension\",\n \"connect_modal_connectors_up_app_browser\": \"Continue in the UP!App\",\n \"connect_modal_connectors_passkey_wallet\": \"Passkey Wallet\",\n \"connect_modal_close\": \"Close modal\"\n}"],"mappings":";;;;;;;;AAMA,SAAS,cAAc;;;ACNvB;AAAA,EACE,0BAA4B;AAAA,EAC5B,qBAAuB;AAAA,EACvB,iCAAmC;AAAA,EACnC,2BAA6B;AAAA,EAC7B,0CAA4C;AAAA,EAC5C,oCAAsC;AAAA,EACtC,sCAAwC;AAAA,EACxC,yBAA2B;AAAA,EAC3B,qBAAuB;AAAA,EACvB,6BAA+B;AAAA,EAC/B,mCAAqC;AAAA,EACrC,gCAAkC;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cjs CHANGED
@@ -38,7 +38,7 @@ require('./chunk-DWXFDFMM.cjs');
38
38
  var _chunkUQSIH233cjs = require('./chunk-UQSIH233.cjs');
39
39
 
40
40
 
41
- var _chunkDNGL2W6Acjs = require('./chunk-DNGL2W6A.cjs');
41
+ var _chunkG7DECPVTcjs = require('./chunk-G7DECPVT.cjs');
42
42
 
43
43
 
44
44
 
@@ -92,5 +92,5 @@ _chunkGBY3X5CQcjs.init_config.call(void 0, );
92
92
 
93
93
 
94
94
 
95
- exports.EIP1271_MAGIC_VALUE = _chunkEN5MQDYXcjs.EIP1271_MAGIC_VALUE; exports.EXTENSION_STORE_LINKS = _chunkEN5MQDYXcjs.EXTENSION_STORE_LINKS; exports.GRAPHQL_ENDPOINT_MAINNET = _chunkGBY3X5CQcjs.GRAPHQL_ENDPOINT_MAINNET; exports.GRAPHQL_ENDPOINT_TESTNET = _chunkGBY3X5CQcjs.GRAPHQL_ENDPOINT_TESTNET; exports.SUPPORTED_NETWORK_IDS = _chunkGBY3X5CQcjs.SUPPORTED_NETWORK_IDS; exports.UrlConverter = _chunkEN5MQDYXcjs.UrlConverter; exports.UrlResolver = _chunkEN5MQDYXcjs.UrlResolver; exports.browserInfo = _chunkEN5MQDYXcjs.browserInfo; exports.clearIntlService = _chunk67D63CFFcjs.clearIntlService; exports.createIntlService = _chunk67D63CFFcjs.createIntlService; exports.createMessage = _chunkEN5MQDYXcjs.createMessage; exports.createSignedQR = _chunkEN5MQDYXcjs.createSignedQR; exports.defaultConfig = _chunk67D63CFFcjs.defaultConfig; exports.deviceService = _chunkNJQVWIZLcjs.deviceService; exports.getChainById = _chunkROJME3D4cjs.getChainById; exports.getControllerAddress = _chunkEN5MQDYXcjs.getControllerAddress; exports.getEIP1271Data = _chunkEN5MQDYXcjs.getEIP1271Data; exports.getIntlService = _chunk67D63CFFcjs.getIntlService; exports.getLuksoMainnet = _chunkROJME3D4cjs.getLuksoMainnet; exports.getLuksoTestnet = _chunkROJME3D4cjs.getLuksoTestnet; exports.isCollectible = _chunkEN5MQDYXcjs.isCollectible; exports.isLyx = _chunkEN5MQDYXcjs.isLyx; exports.isSignedQRFormat = _chunkEN5MQDYXcjs.isSignedQRFormat; exports.isToken = _chunkEN5MQDYXcjs.isToken; exports.luksoChainsByID = _chunkROJME3D4cjs.luksoChainsByID; exports.luksoMainnet = _chunkROJME3D4cjs.luksoMainnet; exports.luksoTestnet = _chunkROJME3D4cjs.luksoTestnet; exports.parseSignedQR = _chunkEN5MQDYXcjs.parseSignedQR; exports.safeCustomElement = _chunkEN5MQDYXcjs.safeCustomElement; exports.setIntlService = _chunk67D63CFFcjs.setIntlService; exports.slug = _chunkEN5MQDYXcjs.slug; exports.verifySignedQR = _chunkEN5MQDYXcjs.verifySignedQR; exports.withDeviceService = _chunkUQSIH233cjs.withDeviceService; exports.withIntlService = _chunkDNGL2W6Acjs.withIntlService; exports.withTheme = _chunkDF2DOQMFcjs.withTheme;
95
+ exports.EIP1271_MAGIC_VALUE = _chunkEN5MQDYXcjs.EIP1271_MAGIC_VALUE; exports.EXTENSION_STORE_LINKS = _chunkEN5MQDYXcjs.EXTENSION_STORE_LINKS; exports.GRAPHQL_ENDPOINT_MAINNET = _chunkGBY3X5CQcjs.GRAPHQL_ENDPOINT_MAINNET; exports.GRAPHQL_ENDPOINT_TESTNET = _chunkGBY3X5CQcjs.GRAPHQL_ENDPOINT_TESTNET; exports.SUPPORTED_NETWORK_IDS = _chunkGBY3X5CQcjs.SUPPORTED_NETWORK_IDS; exports.UrlConverter = _chunkEN5MQDYXcjs.UrlConverter; exports.UrlResolver = _chunkEN5MQDYXcjs.UrlResolver; exports.browserInfo = _chunkEN5MQDYXcjs.browserInfo; exports.clearIntlService = _chunk67D63CFFcjs.clearIntlService; exports.createIntlService = _chunk67D63CFFcjs.createIntlService; exports.createMessage = _chunkEN5MQDYXcjs.createMessage; exports.createSignedQR = _chunkEN5MQDYXcjs.createSignedQR; exports.defaultConfig = _chunk67D63CFFcjs.defaultConfig; exports.deviceService = _chunkNJQVWIZLcjs.deviceService; exports.getChainById = _chunkROJME3D4cjs.getChainById; exports.getControllerAddress = _chunkEN5MQDYXcjs.getControllerAddress; exports.getEIP1271Data = _chunkEN5MQDYXcjs.getEIP1271Data; exports.getIntlService = _chunk67D63CFFcjs.getIntlService; exports.getLuksoMainnet = _chunkROJME3D4cjs.getLuksoMainnet; exports.getLuksoTestnet = _chunkROJME3D4cjs.getLuksoTestnet; exports.isCollectible = _chunkEN5MQDYXcjs.isCollectible; exports.isLyx = _chunkEN5MQDYXcjs.isLyx; exports.isSignedQRFormat = _chunkEN5MQDYXcjs.isSignedQRFormat; exports.isToken = _chunkEN5MQDYXcjs.isToken; exports.luksoChainsByID = _chunkROJME3D4cjs.luksoChainsByID; exports.luksoMainnet = _chunkROJME3D4cjs.luksoMainnet; exports.luksoTestnet = _chunkROJME3D4cjs.luksoTestnet; exports.parseSignedQR = _chunkEN5MQDYXcjs.parseSignedQR; exports.safeCustomElement = _chunkEN5MQDYXcjs.safeCustomElement; exports.setIntlService = _chunk67D63CFFcjs.setIntlService; exports.slug = _chunkEN5MQDYXcjs.slug; exports.verifySignedQR = _chunkEN5MQDYXcjs.verifySignedQR; exports.withDeviceService = _chunkUQSIH233cjs.withDeviceService; exports.withIntlService = _chunkG7DECPVTcjs.withIntlService; exports.withTheme = _chunkDF2DOQMFcjs.withTheme;
96
96
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -38,7 +38,7 @@ import {
38
38
  } from "./chunk-UF5VAIDL.js";
39
39
  import {
40
40
  withIntlService
41
- } from "./chunk-ZOKMXPMC.js";
41
+ } from "./chunk-GTOKGI4G.js";
42
42
  import {
43
43
  clearIntlService,
44
44
  createIntlService,
@@ -4,7 +4,7 @@
4
4
  var _chunkUQSIH233cjs = require('../chunk-UQSIH233.cjs');
5
5
 
6
6
 
7
- var _chunkDNGL2W6Acjs = require('../chunk-DNGL2W6A.cjs');
7
+ var _chunkG7DECPVTcjs = require('../chunk-G7DECPVT.cjs');
8
8
  require('../chunk-67D63CFF.cjs');
9
9
 
10
10
 
@@ -15,5 +15,5 @@ require('../chunk-KP76AWY3.cjs');
15
15
 
16
16
 
17
17
 
18
- exports.withDeviceService = _chunkUQSIH233cjs.withDeviceService; exports.withIntlService = _chunkDNGL2W6Acjs.withIntlService; exports.withTheme = _chunkDF2DOQMFcjs.withTheme;
18
+ exports.withDeviceService = _chunkUQSIH233cjs.withDeviceService; exports.withIntlService = _chunkG7DECPVTcjs.withIntlService; exports.withTheme = _chunkDF2DOQMFcjs.withTheme;
19
19
  //# sourceMappingURL=index.cjs.map
@@ -4,7 +4,7 @@ import {
4
4
  } from "../chunk-UF5VAIDL.js";
5
5
  import {
6
6
  withIntlService
7
- } from "../chunk-ZOKMXPMC.js";
7
+ } from "../chunk-GTOKGI4G.js";
8
8
  import "../chunk-3CLVGF6O.js";
9
9
  import {
10
10
  withTheme
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkDNGL2W6Acjs = require('../chunk-DNGL2W6A.cjs');
3
+ var _chunkG7DECPVTcjs = require('../chunk-G7DECPVT.cjs');
4
4
  require('../chunk-67D63CFF.cjs');
5
5
  require('../chunk-KP76AWY3.cjs');
6
6
 
7
7
 
8
- exports.withIntlService = _chunkDNGL2W6Acjs.withIntlService;
8
+ exports.withIntlService = _chunkG7DECPVTcjs.withIntlService;
9
9
  //# sourceMappingURL=intl.cjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  withIntlService
3
- } from "../chunk-ZOKMXPMC.js";
3
+ } from "../chunk-GTOKGI4G.js";
4
4
  import "../chunk-3CLVGF6O.js";
5
5
  import "../chunk-ET7EYHRY.js";
6
6
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lukso/core",
3
- "version": "1.10.1-dev.ff2cb0a",
3
+ "version": "1.10.2-dev.1347279",
4
4
  "description": "Core utilities, services, and mixins for LUKSO web components and applications",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -3,20 +3,25 @@
3
3
  "sign_up_modal_title": "Create Universal Profile!",
4
4
  "sign_up_modal_install_extension": "Install the Browser Extension",
5
5
  "sign_up_modal_description": "Choose the device on which you want to create a profile. You can use either to interact with supported apps",
6
+ "connect_modal_wallet_connect_toast_close": "Dismiss",
7
+ "connect_modal_wallet_connect_toast": "Confirm on your connected device.",
8
+ "connect_modal_up_app_browser_get_app": "Get the UP!App",
6
9
  "connect_modal_try_again": "Try again",
7
- "connect_modal_title": "Let’s log you in",
10
+ "connect_modal_title": "Log in with your Universal Profile",
8
11
  "connect_modal_qr_code_title": "Scan to log in",
9
12
  "connect_modal_qr_code_description": "Scan the below QR code with the Universal Profile mobile app to log in",
10
13
  "connect_modal_other_connectors": "Connect Wallet",
11
14
  "connect_modal_or_info": "Log in with a different wallet",
12
15
  "connect_modal_or": "Or",
13
16
  "connect_modal_installed": "INSTALLED",
17
+ "connect_modal_go_back": "Go back",
14
18
  "connect_modal_failed_to_load": "Failed to load...",
15
19
  "connect_modal_eoa_title": "Connect your Wallet",
16
20
  "connect_modal_description": "Log in with your Universal Profile",
17
- "connect_modal_connectors_up_mobile": "Mobile Application",
21
+ "connect_modal_connectors_up_mobile": "Wallet Connect to the UP!App",
22
+ "connect_modal_connectors_up_login": "Login with your Universal Profile",
18
23
  "connect_modal_connectors_up_browser_extension": "Browser Extension",
24
+ "connect_modal_connectors_up_app_browser": "Continue in the UP!App",
19
25
  "connect_modal_connectors_passkey_wallet": "Passkey Wallet",
20
- "connect_modal_close": "Close modal",
21
- "connect_modal_go_back": "Go back"
26
+ "connect_modal_close": "Close modal"
22
27
  }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/tools-monorepo/tools-monorepo/packages/core/dist/chunk-DNGL2W6A.cjs","../src/mixins/intl.ts","../translations/en_US.json"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,wDAA6B;AA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**\n * Internationalization Mixin\n *\n * Mixin to add internationalization service to a Lit component\n */\n\nimport { effect } from '@preact/signals-core'\nimport type { LitElement } from 'lit'\nimport englishTranslations from '../../translations/en_US.json'\nimport {\n createIntlService,\n defaultConfig,\n getIntlService,\n type IntlService,\n setIntlService,\n} from '../services/intl.js'\n\n/**\n * Interface for components that have intl service capabilities\n */\nexport interface IntlServiceMixin {\n formatMessage(key?: string, options?: Record<string, string>): string\n setupLocalIntl(): IntlService | undefined\n}\n\n/**\n * Type helper for the constructor returned by withIntlService\n */\nexport type IntlServiceMixinConstructor<T extends typeof LitElement> = (new (\n ...args: any[]\n) => InstanceType<T> & IntlServiceMixin) &\n T\n\n/**\n * Mixin to add internationalization service to a Lit component\n *\n * Provides access to the global intl service with reactive locale changes.\n * Automatically subscribes to locale changes and triggers re-renders.\n *\n * The component will use the global intl service if available, or create a local one.\n * This follows the singleton pattern for the global service while allowing flexibility.\n *\n * @typeParam T - The Lit component class being extended\n * @returns Extended class with intl service capabilities\n *\n * @example\n * ```typescript\n * import { LitElement, html } from 'lit';\n * import { customElement } from 'lit/decorators.js';\n * import { withIntlService } from '@lukso/core/mixins';\n *\n * @customElement('my-component')\n * export class MyComponent extends withIntlService(LitElement) {\n * render() {\n * return html\\`<p>\\${this.formatMessage('app.welcome')}</p>\\`;\n * }\n * }\n * ```\n */\nexport function withIntlService<T extends typeof LitElement>(\n Base: T\n): IntlServiceMixinConstructor<T> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n class Mixin extends (Base as any) {\n protected unsubscribeIntl: (() => void) | undefined = undefined\n\n connectedCallback(): void {\n super.connectedCallback()\n\n // Subscribe to intl changes via signal\n let intl: IntlService | null = getIntlService()\n\n // When no intl is provided by host app we initialize our own\n if (!intl) {\n intl = this.setupLocalIntl() ?? null\n }\n\n if (intl) {\n this.unsubscribeIntl = effect(() => {\n // Access the signal to track changes\n intl?.localeChanged.value\n this.requestUpdate()\n })\n }\n\n // Set fallback for missing translations\n intl?.setFallbackTranslations(englishTranslations as any)\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n\n // Unsubscribe from intl changes\n if (typeof this.unsubscribeIntl === 'function') {\n this.unsubscribeIntl()\n }\n }\n\n /**\n * Setup a local intl service with default configuration\n * Subclasses can override this to customize initialization\n */\n protected setupLocalIntl(): IntlService | undefined {\n const intlService = createIntlService(\n Object.assign(defaultConfig, {\n messages: englishTranslations,\n })\n )\n setIntlService(intlService)\n return intlService\n }\n\n /**\n * Format message using the intl service\n */\n formatMessage(key?: string, options?: Record<string, string>): string {\n if (!key) {\n console.warn('No translation key provided to formatMessage')\n return ''\n }\n\n const intl = getIntlService()\n return intl?.formatMessage(key, options) ?? key\n }\n }\n\n return Mixin as unknown as IntlServiceMixinConstructor<T>\n}\n","{\n \"sign_up_modal_use_mobile\": \"Install the Mobile Application\",\n \"sign_up_modal_title\": \"Create Universal Profile!\",\n \"sign_up_modal_install_extension\": \"Install the Browser Extension\",\n \"sign_up_modal_description\": \"Choose the device on which you want to create a profile. You can use either to interact with supported apps\",\n \"connect_modal_try_again\": \"Try again\",\n \"connect_modal_title\": \"Let’s log you in\",\n \"connect_modal_qr_code_title\": \"Scan to log in\",\n \"connect_modal_qr_code_description\": \"Scan the below QR code with the Universal Profile mobile app to log in\",\n \"connect_modal_other_connectors\": \"Connect Wallet\",\n \"connect_modal_or_info\": \"Log in with a different wallet\",\n \"connect_modal_or\": \"Or\",\n \"connect_modal_installed\": \"INSTALLED\",\n \"connect_modal_failed_to_load\": \"Failed to load...\",\n \"connect_modal_eoa_title\": \"Connect your Wallet\",\n \"connect_modal_description\": \"Log in with your Universal Profile\",\n \"connect_modal_connectors_up_mobile\": \"Mobile Application\",\n \"connect_modal_connectors_up_browser_extension\": \"Browser Extension\",\n \"connect_modal_connectors_passkey_wallet\": \"Passkey Wallet\",\n \"connect_modal_close\": \"Close modal\",\n \"connect_modal_go_back\": \"Go back\"\n}"]}