@akanjs/client 0.9.43 → 0.9.44

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/cjs/src/index.js CHANGED
@@ -21,3 +21,4 @@ __reExport(src_exports, require("./cookie"), module.exports);
21
21
  __reExport(src_exports, require("./storage"), module.exports);
22
22
  __reExport(src_exports, require("./device"), module.exports);
23
23
  __reExport(src_exports, require("./createFont"), module.exports);
24
+ __reExport(src_exports, require("./locale"), module.exports);
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var locale_exports = {};
20
+ __export(locale_exports, {
21
+ dictionaryContext: () => dictionaryContext,
22
+ useDictionary: () => useDictionary
23
+ });
24
+ module.exports = __toCommonJS(locale_exports);
25
+ var import_react = require("react");
26
+ const dictionaryContext = (0, import_react.createContext)({});
27
+ const useDictionary = () => {
28
+ return (0, import_react.useContext)(dictionaryContext);
29
+ };
package/cjs/src/router.js CHANGED
@@ -80,13 +80,13 @@ class Router {
80
80
  const router2 = options.router;
81
81
  const pathInfo = this.#getPathInfo(href);
82
82
  this.#postPathChange(pathInfo);
83
- void router2.push(pathInfo.href);
83
+ router2.push(pathInfo.href);
84
84
  },
85
85
  replace: (href) => {
86
86
  const router2 = options.router;
87
87
  const pathInfo = this.#getPathInfo(href);
88
88
  this.#postPathChange(pathInfo);
89
- void router2.replace(pathInfo.href);
89
+ router2.replace(pathInfo.href);
90
90
  },
91
91
  back: () => {
92
92
  const router2 = options.router;
@@ -98,7 +98,7 @@ class Router {
98
98
  const router2 = options.router;
99
99
  const pathInfo = this.#getPathInfo(location.pathname);
100
100
  this.#postPathChange(pathInfo);
101
- router2.reload();
101
+ router2.refresh();
102
102
  }
103
103
  };
104
104
  }
package/esm/src/index.js CHANGED
@@ -5,3 +5,4 @@ export * from "./cookie";
5
5
  export * from "./storage";
6
6
  export * from "./device";
7
7
  export * from "./createFont";
8
+ export * from "./locale";
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { createContext, useContext } from "react";
3
+ const dictionaryContext = createContext({});
4
+ const useDictionary = () => {
5
+ return useContext(dictionaryContext);
6
+ };
7
+ export {
8
+ dictionaryContext,
9
+ useDictionary
10
+ };
package/esm/src/router.js CHANGED
@@ -57,13 +57,13 @@ class Router {
57
57
  const router2 = options.router;
58
58
  const pathInfo = this.#getPathInfo(href);
59
59
  this.#postPathChange(pathInfo);
60
- void router2.push(pathInfo.href);
60
+ router2.push(pathInfo.href);
61
61
  },
62
62
  replace: (href) => {
63
63
  const router2 = options.router;
64
64
  const pathInfo = this.#getPathInfo(href);
65
65
  this.#postPathChange(pathInfo);
66
- void router2.replace(pathInfo.href);
66
+ router2.replace(pathInfo.href);
67
67
  },
68
68
  back: () => {
69
69
  const router2 = options.router;
@@ -75,7 +75,7 @@ class Router {
75
75
  const router2 = options.router;
76
76
  const pathInfo = this.#getPathInfo(location.pathname);
77
77
  this.#postPathChange(pathInfo);
78
- router2.reload();
78
+ router2.refresh();
79
79
  }
80
80
  };
81
81
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/client",
3
- "version": "0.9.43",
3
+ "version": "0.9.44",
4
4
  "sourceType": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/index.d.ts CHANGED
@@ -5,3 +5,4 @@ export * from "./cookie";
5
5
  export * from "./storage";
6
6
  export * from "./device";
7
7
  export * from "./createFont";
8
+ export * from "./locale";
@@ -0,0 +1,10 @@
1
+ export declare const dictionaryContext: import("react").Context<{
2
+ [key: string]: {
3
+ [key: string]: string;
4
+ };
5
+ }>;
6
+ export declare const useDictionary: () => {
7
+ [key: string]: {
8
+ [key: string]: string;
9
+ };
10
+ };