locon 0.0.1 → 0.0.3

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.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,18 @@
1
- declare function Locon({ children }: {
1
+ interface Props {
2
2
  children: string;
3
- }): string;
3
+ }
4
+ declare function L({ children }: Props): string;
4
5
 
5
- export { Locon };
6
+ declare function l(assetKey: string): string;
7
+
8
+ declare const _default: {
9
+ init: (options?: {}) => {
10
+ defaultLocale: string;
11
+ locales: {
12
+ en: {};
13
+ };
14
+ autodetect: boolean;
15
+ };
16
+ };
17
+
18
+ export { L, _default as default, l };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,18 @@
1
- declare function Locon({ children }: {
1
+ interface Props {
2
2
  children: string;
3
- }): string;
3
+ }
4
+ declare function L({ children }: Props): string;
4
5
 
5
- export { Locon };
6
+ declare function l(assetKey: string): string;
7
+
8
+ declare const _default: {
9
+ init: (options?: {}) => {
10
+ defaultLocale: string;
11
+ locales: {
12
+ en: {};
13
+ };
14
+ autodetect: boolean;
15
+ };
16
+ };
17
+
18
+ export { L, _default as default, l };
package/dist/index.js CHANGED
@@ -1,8 +1,42 @@
1
1
  'use strict';
2
2
 
3
- // src/index.ts
4
- function Locon({ children }) {
5
- return `${children}-locon`;
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ // src/functions/l.ts
6
+ function l(assetKey) {
7
+ return assetKey;
8
+ }
9
+ var l_default = l;
10
+
11
+ // src/components/L.ts
12
+ function L({ children }) {
13
+ return l_default(children);
6
14
  }
15
+ var L_default = L;
16
+
17
+ // src/helpers/environment.ts
18
+ var isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
19
+
20
+ // src/settings/index.ts
21
+ var defaultSettings = {
22
+ defaultLocale: "en",
23
+ locales: { en: {} },
24
+ autodetect: true
25
+ };
26
+ var globalSettings = defaultSettings;
27
+ var init = (options = {}) => {
28
+ globalSettings = { ...defaultSettings, ...options };
29
+ if (isBrowser) {
30
+ window.__LOCON_SETTINGS__ = globalSettings;
31
+ } else {
32
+ global.__LOCON_SETTINGS__ = globalSettings;
33
+ }
34
+ return globalSettings;
35
+ };
36
+
37
+ // src/index.ts
38
+ var src_default = { init };
7
39
 
8
- exports.Locon = Locon;
40
+ exports.L = L_default;
41
+ exports.default = src_default;
42
+ exports.l = l_default;
package/dist/index.mjs CHANGED
@@ -1,6 +1,36 @@
1
- // src/index.ts
2
- function Locon({ children }) {
3
- return `${children}-locon`;
1
+ // src/functions/l.ts
2
+ function l(assetKey) {
3
+ return assetKey;
4
+ }
5
+ var l_default = l;
6
+
7
+ // src/components/L.ts
8
+ function L({ children }) {
9
+ return l_default(children);
4
10
  }
11
+ var L_default = L;
12
+
13
+ // src/helpers/environment.ts
14
+ var isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
15
+
16
+ // src/settings/index.ts
17
+ var defaultSettings = {
18
+ defaultLocale: "en",
19
+ locales: { en: {} },
20
+ autodetect: true
21
+ };
22
+ var globalSettings = defaultSettings;
23
+ var init = (options = {}) => {
24
+ globalSettings = { ...defaultSettings, ...options };
25
+ if (isBrowser) {
26
+ window.__LOCON_SETTINGS__ = globalSettings;
27
+ } else {
28
+ global.__LOCON_SETTINGS__ = globalSettings;
29
+ }
30
+ return globalSettings;
31
+ };
32
+
33
+ // src/index.ts
34
+ var src_default = { init };
5
35
 
6
- export { Locon };
36
+ export { L_default as L, src_default as default, l_default as l };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "locon",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "locon is a simple and lightweight library for React and React Native that provides a simple way to manage translations in your app.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -10,7 +10,8 @@
10
10
  ],
11
11
  "scripts": {
12
12
  "build": "tsup",
13
- "test": "jest"
13
+ "test": "jest",
14
+ "publish": "npm publish"
14
15
  },
15
16
  "keywords": [
16
17
  "i18n",