@dextinity/site-react 11.0.0-canary-20261108123746 → 11.0.0-canary-20261109080947

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.
@@ -0,0 +1,2 @@
1
+ export { FormattedMessage, useIntl } from 'react-intl';
2
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/intl/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ import{FormattedMessage as r,useIntl as t}from"react-intl";export{r as FormattedMessage,t as useIntl};
@@ -0,0 +1,2 @@
1
+ export { ServerFormattedMessage as FormattedMessage, type ServerFormattedMessageProps as FormattedMessageProps, useServerIntl as useIntl, } from './serverIntl';
2
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/intl/server.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,sBAAsB,IAAI,gBAAgB,EAC1C,KAAK,2BAA2B,IAAI,qBAAqB,EACzD,aAAa,IAAI,OAAO,GAC3B,MAAM,cAAc,CAAC"}
@@ -0,0 +1 @@
1
+ import{ServerFormattedMessage as e,useServerIntl as s}from"./serverIntl.js";export{e as FormattedMessage,s as useIntl};
@@ -0,0 +1,18 @@
1
+ import { IntlConfig, IntlShape, MessageDescriptor } from 'react-intl/server';
2
+ import * as React from "react";
3
+ type ServerIntlMessages = IntlConfig["messages"];
4
+ type FormatMessageValues = NonNullable<Parameters<IntlShape["formatMessage"]>[1]>;
5
+ export interface ServerFormattedMessageProps extends Pick<MessageDescriptor, "id" | "defaultMessage" | "description"> {
6
+ values?: FormatMessageValues;
7
+ }
8
+ /**
9
+ * Sets the intl used by `useServerIntl` and `ServerFormattedMessage` for the current request.
10
+ *
11
+ * Must be called in the layout and in every page rendering translated server components,
12
+ * because Next.js renders layouts and pages concurrently and doesn't render the layout again on client-side navigation.
13
+ */
14
+ export declare function setServerIntl(locale: string, messages: ServerIntlMessages): void;
15
+ export declare function useServerIntl(): IntlShape;
16
+ export declare function ServerFormattedMessage({ id, defaultMessage, description, values }: ServerFormattedMessageProps): React.ReactNode;
17
+ export {};
18
+ //# sourceMappingURL=serverIntl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serverIntl.d.ts","sourceRoot":"","sources":["../../src/intl/serverIntl.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA+B,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEzH,KAAK,kBAAkB,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;AAEjD,KAAK,mBAAmB,GAAG,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAElF,MAAM,WAAW,2BAA4B,SAAQ,IAAI,CAAC,iBAAiB,EAAE,IAAI,GAAG,gBAAgB,GAAG,aAAa,CAAC;IACjH,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAChC;AAaD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAEhF;AAED,wBAAgB,aAAa,IAAI,SAAS,CAQzC;AAED,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,2BAA2B,GAAG,KAAK,CAAC,SAAS,CAMhI"}
@@ -0,0 +1,2 @@
1
+ import{Fragment as e,jsx as r}from"react/jsx-runtime";import*as t from"react";import{createIntl as n,createIntlCache as o}from"react-intl/server";var s,a=o();function i(){return s??=t.cache(()=>({current:null})),s()}function c(e,r){i().current=n({locale:e,defaultLocale:e,messages:r},a)}function l(){const e=i().current;if(!e)throw new Error("Server intl isn't set. Call setServerIntl() in the layout or page before rendering translated server components.");return e}function u({id:t,defaultMessage:n,description:o,values:s}){const a=l(),i={id:t,defaultMessage:n,description:o};/* @__PURE__ */
2
+ return r(e,{children:a.formatMessage(i,s)})}export{u as ServerFormattedMessage,c as setServerIntl,l as useServerIntl};
package/lib/server.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ export { ServerFormattedMessage, type ServerFormattedMessageProps, setServerIntl, useServerIntl } from './intl/serverIntl';
1
2
  export { persistedQueryRoute } from './persistedQueries/persistedQueryRoute';
2
3
  //# sourceMappingURL=server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,KAAK,2BAA2B,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC3H,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC"}
package/lib/server.js CHANGED
@@ -1 +1 @@
1
- import{persistedQueryRoute as e}from"./persistedQueries/persistedQueryRoute.js";export{e as persistedQueryRoute};
1
+ import{ServerFormattedMessage as e,setServerIntl as r,useServerIntl as s}from"./intl/serverIntl.js";import{persistedQueryRoute as t}from"./persistedQueries/persistedQueryRoute.js";export{e as ServerFormattedMessage,t as persistedQueryRoute,r as setServerIntl,s as useServerIntl};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dextinity/site-react",
3
- "version": "11.0.0-canary-20261108123746",
3
+ "version": "11.0.0-canary-20261109080947",
4
4
  "description": "Dextinity Site React package",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,6 +18,11 @@
18
18
  "import": "./lib/index.js"
19
19
  },
20
20
  "./css": "./lib/style.css",
21
+ "./intl": {
22
+ "types": "./lib/intl/server.d.ts",
23
+ "react-server": "./lib/intl/server.js",
24
+ "import": "./lib/intl/client.js"
25
+ },
21
26
  "./server": {
22
27
  "types": "./lib/server.d.ts",
23
28
  "import": "./lib/server.js"
@@ -35,8 +40,8 @@
35
40
  "usehooks-ts": "^3.1.1"
36
41
  },
37
42
  "devDependencies": {
38
- "@dextinity/cli": "11.0.0-canary-20261108123746",
39
- "@dextinity/eslint-config": "11.0.0-canary-20261108123746",
43
+ "@dextinity/cli": "11.0.0-canary-20261109080947",
44
+ "@dextinity/eslint-config": "11.0.0-canary-20261109080947",
40
45
  "@types/draft-js": "^0.11.20",
41
46
  "@types/react": "^19.3.0",
42
47
  "@types/react-dom": "^19.3.0",
@@ -48,6 +53,7 @@
48
53
  "prettier": "^3.9.10",
49
54
  "react": "^19.3.1",
50
55
  "react-dom": "^19.3.1",
56
+ "react-intl": "^12.1.4",
51
57
  "rimraf": "^6.1.3",
52
58
  "rollup": "^4.67.2",
53
59
  "rollup-plugin-preserve-directives": "^0.4.0",
@@ -60,7 +66,8 @@
60
66
  "webpack": "^5.112.2"
61
67
  },
62
68
  "peerDependencies": {
63
- "react": "^18.0.0 || ^19.0.0"
69
+ "react": "^18.0.0 || ^19.0.0",
70
+ "react-intl": "^12.0.0"
64
71
  },
65
72
  "engines": {
66
73
  "node": ">=24.15.0"