@gringow/gringow-react 0.0.7 → 0.0.8

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/g.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import { flatTemplateString, createCacheId } from '@gringow/gringow/browser';
2
2
  import React from 'react';
3
+ import { GringowStore } from '@gringow/gringow-shadow/store';
3
4
  import { jsx } from 'react/jsx-runtime';
4
5
 
5
6
  // src/g.tsx
@@ -7,12 +8,15 @@ var isServer = typeof window === "undefined";
7
8
  function moduleName(isServer2) {
8
9
  return !isServer2 ? "./browser.mjs" : ".";
9
10
  }
11
+ import(
12
+ /* @vite-ignore */
13
+ moduleName(isServer)
14
+ );
10
15
  function g(strings, ...replacements) {
11
- import(moduleName(isServer));
12
16
  const reactId = React.useId();
13
17
  const flatten = flatTemplateString(strings, replacements);
14
18
  const cacheId = createCacheId(flatten);
15
- return /* @__PURE__ */ jsx("g-gringow", { id: reactId, "data-cache-id": cacheId, "data-flatten": flatten }, reactId);
19
+ return /* @__PURE__ */ jsx("g-gringow", { id: reactId, "data-cache-id": cacheId, "data-flatten": flatten, children: !GringowStore.cache || isServer ? flatten : null }, reactId);
16
20
  }
17
21
 
18
22
  export { g };
package/dist/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { LanguageChangeEvent } from '@gringow/gringow-shadow/event';
2
2
  import { flatTemplateString, createCacheId } from '@gringow/gringow/browser';
3
3
  import React from 'react';
4
+ import { GringowStore } from '@gringow/gringow-shadow/store';
4
5
  import { jsx } from 'react/jsx-runtime';
5
6
 
6
7
  // src/event.ts
@@ -13,12 +14,15 @@ var isServer = typeof window === "undefined";
13
14
  function moduleName(isServer2) {
14
15
  return !isServer2 ? "./browser.mjs" : ".";
15
16
  }
17
+ import(
18
+ /* @vite-ignore */
19
+ moduleName(isServer)
20
+ );
16
21
  function g(strings, ...replacements) {
17
- import(moduleName(isServer));
18
22
  const reactId = React.useId();
19
23
  const flatten = flatTemplateString(strings, replacements);
20
24
  const cacheId = createCacheId(flatten);
21
- return /* @__PURE__ */ jsx("g-gringow", { id: reactId, "data-cache-id": cacheId, "data-flatten": flatten }, reactId);
25
+ return /* @__PURE__ */ jsx("g-gringow", { id: reactId, "data-cache-id": cacheId, "data-flatten": flatten, children: !GringowStore.cache || isServer ? flatten : null }, reactId);
22
26
  }
23
27
 
24
28
  export { changeLanguage, g };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gringow/gringow-react",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "React bindings for Gringow AI-powered translation tool",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -36,7 +36,7 @@
36
36
  "react": "19.1.0",
37
37
  "react-dom": "19.1.0",
38
38
  "@gringow/gringow": "0.1.3",
39
- "@gringow/gringow-shadow": "0.0.2"
39
+ "@gringow/gringow-shadow": "0.0.3"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "rm -rf ./dist/* ./tsconfig.tsbuildinfo && tsup",