@venizia/ardor-admin 0.1.2-6 → 0.1.2-7

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.
@@ -1,4 +1,6 @@
1
+ export * from './use-document-title.js';
1
2
  export * from './use-features.js';
3
+ export * from './use-html-lang.js';
2
4
  export * from './use-notify-error.js';
3
5
  export * from './use-refresh-token.js';
4
6
  export * from './use-request-header-locale.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC"}
@@ -1,4 +1,6 @@
1
+ export * from './use-document-title.js';
1
2
  export * from './use-features.js';
3
+ export * from './use-html-lang.js';
2
4
  export * from './use-notify-error.js';
3
5
  export * from './use-refresh-token.js';
4
6
  export * from './use-request-header-locale.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,14 @@
1
+ type TDocumentTitleSegment = string | false | null | undefined;
2
+ export interface IUseDocumentTitleOptions {
3
+ title: TDocumentTitleSegment | Array<TDocumentTitleSegment>;
4
+ appTitle: string;
5
+ separator?: string;
6
+ enabled?: boolean;
7
+ }
8
+ /**
9
+ * Sets the tab title to the screen title before `appTitle` (`Orders · Back Office`). On unmount it
10
+ * puts back the title it replaced, so one call per screen is enough - no reset on navigation.
11
+ */
12
+ export declare const useDocumentTitle: (opts: IUseDocumentTitleOptions) => void;
13
+ export {};
14
+ //# sourceMappingURL=use-document-title.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-document-title.d.ts","sourceRoot":"","sources":["../../src/hooks/use-document-title.ts"],"names":[],"mappings":"AAEA,KAAK,qBAAqB,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC;AAE/D,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,qBAAqB,GAAG,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,wBAAwB,SAkB9D,CAAC"}
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ /**
3
+ * Sets the tab title to the screen title before `appTitle` (`Orders · Back Office`). On unmount it
4
+ * puts back the title it replaced, so one call per screen is enough - no reset on navigation.
5
+ */
6
+ export const useDocumentTitle = (opts) => {
7
+ const { title, appTitle, separator = ' · ', enabled = true } = opts;
8
+ const segments = Array.isArray(title) ? title : [title];
9
+ const documentTitle = [...segments, appTitle].filter(Boolean).join(separator);
10
+ React.useEffect(() => {
11
+ if (!enabled) {
12
+ return;
13
+ }
14
+ const previousTitle = document.title;
15
+ document.title = documentTitle;
16
+ return () => {
17
+ document.title = previousTitle;
18
+ };
19
+ }, [enabled, documentTitle]);
20
+ };
21
+ //# sourceMappingURL=use-document-title.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-document-title.js","sourceRoot":"","sources":["../../src/hooks/use-document-title.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAA8B,EAAE,EAAE;IACjE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,GAAG,KAAK,EAAE,OAAO,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IAEpE,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,aAAa,GAAG,CAAC,GAAG,QAAQ,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAE9E,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO;QACT,CAAC;QAED,MAAM,aAAa,GAAG,QAAQ,CAAC,KAAK,CAAC;QACrC,QAAQ,CAAC,KAAK,GAAG,aAAa,CAAC;QAE/B,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,KAAK,GAAG,aAAa,CAAC;QACjC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;AAC/B,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Keeps `<html lang>` on the UI locale - screen readers pick their voice from it. */
2
+ export declare const useHtmlLang: () => void;
3
+ //# sourceMappingURL=use-html-lang.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-html-lang.d.ts","sourceRoot":"","sources":["../../src/hooks/use-html-lang.ts"],"names":[],"mappings":"AAIA,sFAAsF;AACtF,eAAO,MAAM,WAAW,YAMvB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { useLocaleState } from 'ra-core';
3
+ /** Keeps `<html lang>` on the UI locale - screen readers pick their voice from it. */
4
+ export const useHtmlLang = () => {
5
+ const [locale] = useLocaleState();
6
+ React.useEffect(() => {
7
+ document.documentElement.lang = locale;
8
+ }, [locale]);
9
+ };
10
+ //# sourceMappingURL=use-html-lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-html-lang.js","sourceRoot":"","sources":["../../src/hooks/use-html-lang.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,sFAAsF;AACtF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE;IAC9B,MAAM,CAAC,MAAM,CAAC,GAAG,cAAc,EAAE,CAAC;IAElC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,QAAQ,CAAC,eAAe,CAAC,IAAI,GAAG,MAAM,CAAC;IACzC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;AACf,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venizia/ardor-admin",
3
- "version": "0.1.2-6",
3
+ "version": "0.1.2-7",
4
4
  "description": "ARDOR react-admin adapter - the REST data provider, auth provider and i18n provider wired through IGNIS inversion, the ArdorApplication root component, the translate and notify hooks, and the English and Vietnamese message bundles.",
5
5
  "keywords": [
6
6
  "admin",
@@ -75,8 +75,8 @@
75
75
  "size": "size-limit"
76
76
  },
77
77
  "dependencies": {
78
- "@venizia/ardor-kernel": "^0.1.2-5",
79
- "@venizia/ardor-react": "^0.1.2-5",
78
+ "@venizia/ardor-kernel": "^0.1.2-6",
79
+ "@venizia/ardor-react": "^0.1.2-6",
80
80
  "lodash": "^4.18.1",
81
81
  "ra-i18n-polyglot": "^5.15.0"
82
82
  },
@@ -104,7 +104,7 @@
104
104
  "@types/react-dom": "^19",
105
105
  "@venizia/dev-configs": "0.2.1-0",
106
106
  "@venizia/ignis-filter": "0.2.1-1",
107
- "@venizia/ignis-inversion": "0.2.1-0",
107
+ "@venizia/ignis-inversion": "0.2.1-1",
108
108
  "eslint": "^9.36.0",
109
109
  "prettier": "^3.8.4",
110
110
  "ra-core": "^5.15.0",