@krosoft/react 0.0.421 → 0.0.423
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/contexts/documentTitle.context.d.ts +2 -0
- package/dist/contexts/documentTitle.context.d.ts.map +1 -0
- package/dist/contexts/documentTitle.context.js +4 -0
- package/dist/contexts/index.d.ts +1 -0
- package/dist/contexts/index.d.ts.map +1 -1
- package/dist/contexts/index.js +2 -1
- package/dist/hooks/ui/useDocumentTitle.d.ts.map +1 -1
- package/dist/hooks/ui/useDocumentTitle.js +12 -11
- package/dist/providers/DocumentTitleProvider.d.ts +8 -0
- package/dist/providers/DocumentTitleProvider.d.ts.map +1 -0
- package/dist/providers/DocumentTitleProvider.js +9 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +3 -1
- package/package.json +5 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentTitle.context.d.ts","sourceRoot":"","sources":["../../src/contexts/documentTitle.context.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,6CAA+C,CAAC"}
|
package/dist/contexts/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { PageContext } from "./page.context";
|
|
|
2
2
|
export type { PageContextType } from "./page.context";
|
|
3
3
|
export { SidebarContext } from "./sidebar.context";
|
|
4
4
|
export type { SidebarContextType } from "./sidebar.context";
|
|
5
|
+
export { DocumentTitleContext } from "./documentTitle.context";
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/contexts/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { PageContext as e } from "./page.context.js";
|
|
2
2
|
import { SidebarContext as t } from "./sidebar.context.js";
|
|
3
|
-
|
|
3
|
+
import { DocumentTitleContext as n } from "./documentTitle.context.js";
|
|
4
|
+
export { n as DocumentTitleContext, e as PageContext, t as SidebarContext };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDocumentTitle.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/useDocumentTitle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDocumentTitle.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/useDocumentTitle.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,GAAI,UAAU,MAAM,EAAE,SAAS,MAAM,EAAE,WAAW,MAAM,KAAG,IAiBvF,CAAC"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { DocumentTitleContext as e } from "../../contexts/documentTitle.context.js";
|
|
2
|
+
import { useKrosoftTranslation as t } from "../../i18n/useKrosoftTranslation.js";
|
|
3
|
+
import { useContext as n, useEffect as r } from "react";
|
|
3
4
|
// src/hooks/ui/useDocumentTitle.ts
|
|
4
|
-
var
|
|
5
|
-
let { t:
|
|
6
|
-
|
|
7
|
-
let e =
|
|
8
|
-
return document.title =
|
|
5
|
+
var i = (i, a, o) => {
|
|
6
|
+
let { t: s } = t(), c = n(e), l = o ?? c;
|
|
7
|
+
r(() => {
|
|
8
|
+
let e = s(i), t = document.title, n = a ? `${e} - ${a}` : e, r = l ? `${n} | ${l}` : n;
|
|
9
|
+
return document.title = r, () => {
|
|
9
10
|
document.title = t;
|
|
10
11
|
};
|
|
11
12
|
}, [
|
|
12
|
-
|
|
13
|
-
r,
|
|
13
|
+
l,
|
|
14
14
|
a,
|
|
15
|
-
|
|
15
|
+
s,
|
|
16
|
+
i
|
|
16
17
|
]);
|
|
17
18
|
};
|
|
18
|
-
export {
|
|
19
|
+
export { i as useDocumentTitle };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface DocumentTitleProviderProps {
|
|
3
|
+
appTitle: string;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/** Fournit le nom de l'application ajouté au titre de l'onglet par `useDocumentTitle` (ex : « Factures | MonApp »). */
|
|
7
|
+
export declare const DocumentTitleProvider: ({ appTitle, children }: DocumentTitleProviderProps) => React.JSX.Element;
|
|
8
|
+
//# sourceMappingURL=DocumentTitleProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentTitleProvider.d.ts","sourceRoot":"","sources":["../../src/providers/DocumentTitleProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,uHAAuH;AACvH,eAAO,MAAM,qBAAqB,GAAI,wBAAwB,0BAA0B,KAAG,KAAK,CAAC,GAAG,CAAC,OAEpG,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DocumentTitleContext as e } from "../contexts/documentTitle.context.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
// src/providers/DocumentTitleProvider.tsx
|
|
5
|
+
var n = ({ appTitle: n, children: r }) => /* @__PURE__ */ t(e.Provider, {
|
|
6
|
+
value: n,
|
|
7
|
+
children: r
|
|
8
|
+
});
|
|
9
|
+
export { n as DocumentTitleProvider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/providers/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krosoft/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.423",
|
|
4
4
|
"description": "Krosoft shared React package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -110,9 +110,9 @@
|
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|
|
112
112
|
"@krosoft/core": "^0.0.76",
|
|
113
|
-
"@krosoft/tooling-eslint": "^0.0.
|
|
114
|
-
"@krosoft/tooling-eslint-react": "^0.0.
|
|
115
|
-
"@krosoft/tooling-prettier": "^0.0.
|
|
113
|
+
"@krosoft/tooling-eslint": "^0.0.38",
|
|
114
|
+
"@krosoft/tooling-eslint-react": "^0.0.33",
|
|
115
|
+
"@krosoft/tooling-prettier": "^0.0.22",
|
|
116
116
|
"@krosoft/tooling-tsconfig-react": "^0.0.10",
|
|
117
117
|
"@storybook/addon-docs": "^10.6.7",
|
|
118
118
|
"@storybook/addon-themes": "^10.6.7",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"i18next": "^27.1.1",
|
|
129
129
|
"jsdom": "^30.1.3",
|
|
130
130
|
"next-themes": "^0.4.6",
|
|
131
|
-
"prettier": "^3.10.
|
|
131
|
+
"prettier": "^3.10.1",
|
|
132
132
|
"react": "^19.3.1",
|
|
133
133
|
"react-dom": "^19.3.1",
|
|
134
134
|
"react-i18next": "^18.0.1",
|