solid-intlayer 8.12.4 → 8.12.5-canary.0

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 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./useDictionary.cjs");exports.useDictionary=e.useDictionary;
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../client/useDictionary.cjs");let t=require("solid-js");var n=(n,r)=>((0,t.createResource)(()=>n,{initialValue:n,ssrLoadFrom:`initial`}),e.useDictionary(n,r));exports.useDictionary=n;
@@ -0,0 +1,2 @@
1
+ import { useDictionary as e } from "./useDictionary.mjs";
2
+ export { e as useDictionary };
@@ -0,0 +1,9 @@
1
+ import { useDictionary as e } from "../client/useDictionary.mjs";
2
+ import { createResource as t } from "solid-js";
3
+ //#region src/server/useDictionary.ts
4
+ var n = (n, r) => (t(() => n, {
5
+ initialValue: n,
6
+ ssrLoadFrom: "initial"
7
+ }), e(n, r));
8
+ //#endregion
9
+ export { n as useDictionary };
@@ -0,0 +1 @@
1
+ export { useDictionary } from './useDictionary';
@@ -0,0 +1,16 @@
1
+ import { Dictionary } from '@intlayer/types/dictionary';
2
+ import { DeclaredLocales, LocalesValues } from '@intlayer/types/module_augmentation';
3
+ /**
4
+ * Server-rendering counterpart of `useDictionaryDynamic`, emitted by the
5
+ * optimizer in the server bundle so dynamic-mode dictionaries render
6
+ * synchronously from static JSON.
7
+ *
8
+ * The discarded `createResource` is load-bearing: Solid assigns hydration
9
+ * ids from a positional counter shared by resources and element `data-hk`
10
+ * keys, and the client bundle consumes one resource slot per call (see
11
+ * `useLoadDynamic`) — without the matching slot here, every subsequent
12
+ * hydration key shifts and event bindings are silently lost.
13
+ * `ssrLoadFrom: 'initial'` keeps the dictionary out of the SSR serialization
14
+ * payload, so it is not shipped twice in the HTML.
15
+ */
16
+ export declare const useDictionary: <const T extends Dictionary, const L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L) => import('@intlayer/core/interpreter').DeepTransformContent<T["content"], import('../plugins').IInterpreterPluginState, L>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solid-intlayer",
3
- "version": "8.12.4",
3
+ "version": "8.12.5-canary.0",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Solid applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -58,6 +58,12 @@
58
58
  "require": "./dist/cjs/format/index.cjs",
59
59
  "import": "./dist/esm/format/index.mjs"
60
60
  },
61
+ "./server": {
62
+ "types": "./dist/types/server/index.d.ts",
63
+ "solid": "./dist/esm/server/index.mjs",
64
+ "require": "./dist/cjs/server/index.cjs",
65
+ "import": "./dist/esm/server/index.mjs"
66
+ },
61
67
  "./package.json": "./package.json"
62
68
  },
63
69
  "main": "dist/cjs/index.cjs",
@@ -77,6 +83,9 @@
77
83
  "format": [
78
84
  "./dist/types/format/index.d.ts"
79
85
  ],
86
+ "server": [
87
+ "./dist/types/server/index.d.ts"
88
+ ],
80
89
  "package.json": [
81
90
  "./package.json"
82
91
  ]
@@ -104,11 +113,11 @@
104
113
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
105
114
  },
106
115
  "dependencies": {
107
- "@intlayer/api": "8.12.4",
108
- "@intlayer/config": "8.12.4",
109
- "@intlayer/core": "8.12.4",
110
- "@intlayer/editor": "8.12.4",
111
- "@intlayer/types": "8.12.4"
116
+ "@intlayer/api": "8.12.5-canary.0",
117
+ "@intlayer/config": "8.12.5-canary.0",
118
+ "@intlayer/core": "8.12.5-canary.0",
119
+ "@intlayer/editor": "8.12.5-canary.0",
120
+ "@intlayer/types": "8.12.5-canary.0"
112
121
  },
113
122
  "devDependencies": {
114
123
  "@solidjs/testing-library": "0.8.10",