@creopse/react 0.0.21 → 0.0.22

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.
@@ -7034,7 +7034,7 @@ const useHelper = () => {
7034
7034
  userLanguage = props.userData.preferences.locale;
7035
7035
  }
7036
7036
  if (!lang2) {
7037
- lang2 = localStorage.getItem(langKey) || props.appLocale || config?.locale || userLanguage || "en";
7037
+ lang2 = localStorage.getItem(langKey) || (config?.useUserLocaleAsFallback ? userLanguage : false) || props.appLocale || config?.locale || "en";
7038
7038
  }
7039
7039
  try {
7040
7040
  parsedData = JSON.parse(data);
@@ -7043,7 +7043,13 @@ const useHelper = () => {
7043
7043
  }
7044
7044
  return parsedData ? parsedData[lang2.toUpperCase()] || parsedData[lang2] || "" : "";
7045
7045
  },
7046
- [config?.locale, langKey, props.appLocale, props.userData]
7046
+ [
7047
+ config?.locale,
7048
+ config?.useUserLocaleAsFallback,
7049
+ langKey,
7050
+ props.appLocale,
7051
+ props.userData
7052
+ ]
7047
7053
  );
7048
7054
  const tr = React.useCallback(
7049
7055
  (data, lang2) => {
@@ -7033,7 +7033,7 @@ const useHelper = () => {
7033
7033
  userLanguage = props.userData.preferences.locale;
7034
7034
  }
7035
7035
  if (!lang2) {
7036
- lang2 = localStorage.getItem(langKey) || props.appLocale || config?.locale || userLanguage || "en";
7036
+ lang2 = localStorage.getItem(langKey) || (config?.useUserLocaleAsFallback ? userLanguage : false) || props.appLocale || config?.locale || "en";
7037
7037
  }
7038
7038
  try {
7039
7039
  parsedData = JSON.parse(data);
@@ -7042,7 +7042,13 @@ const useHelper = () => {
7042
7042
  }
7043
7043
  return parsedData ? parsedData[lang2.toUpperCase()] || parsedData[lang2] || "" : "";
7044
7044
  },
7045
- [config?.locale, langKey, props.appLocale, props.userData]
7045
+ [
7046
+ config?.locale,
7047
+ config?.useUserLocaleAsFallback,
7048
+ langKey,
7049
+ props.appLocale,
7050
+ props.userData
7051
+ ]
7046
7052
  );
7047
7053
  const tr = useCallback(
7048
7054
  (data, lang2) => {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const content = require("../content-I5YJXH3C.cjs");
3
+ const content = require("../content-BpVMJ1wf.cjs");
4
4
  const React = require("react");
5
5
  const useNewsletter = () => {
6
6
  const { request } = content.useApi();
@@ -1,5 +1,5 @@
1
- import { e as useApi } from "../content-BrpVuVxT.js";
2
- import { f, a, u, b } from "../content-BrpVuVxT.js";
1
+ import { e as useApi } from "../content-CSFJStkb.js";
2
+ import { f, a, u, b } from "../content-CSFJStkb.js";
3
3
  import { useState, useCallback } from "react";
4
4
  const useNewsletter = () => {
5
5
  const { request } = useApi();
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const React = require("react");
4
- const content = require("./content-I5YJXH3C.cjs");
4
+ const content = require("./content-BpVMJ1wf.cjs");
5
5
  const react = require("@inertiajs/react");
6
6
  const reactDom = require("react-dom");
7
7
  function _interopNamespaceDefault(e) {
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import React__default, { useState, useEffect, createContext, useRef, useLayoutEffect, useId, useContext, useInsertionEffect, useMemo, useCallback, Children, isValidElement, Fragment, createElement, forwardRef, Component } from "react";
3
- import { u as useHelper, a as useContent, b as useProps, P as PropsContext, R as ResolveSectionsContext, c as cloneDeep, s as slideToId, E as EditorMessageType, d as RouterContext, C as ConfigContext } from "./content-BrpVuVxT.js";
3
+ import { u as useHelper, a as useContent, b as useProps, P as PropsContext, R as ResolveSectionsContext, c as cloneDeep, s as slideToId, E as EditorMessageType, d as RouterContext, C as ConfigContext } from "./content-CSFJStkb.js";
4
4
  import { router } from "@inertiajs/react";
5
5
  import { createPortal } from "react-dom";
6
6
  var jsxRuntime = { exports: {} };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@creopse/react",
3
3
  "description": "Creopse React Toolkit",
4
- "version": "0.0.21",
4
+ "version": "0.0.22",
5
5
  "private": false,
6
6
  "author": "Noé Gnanih <noegnanih@gmail.com>",
7
7
  "license": "MIT",
@@ -14,6 +14,6 @@ export declare const useConfig: () => {
14
14
  appUrl: string;
15
15
  locale: string;
16
16
  fallbackLocale: string;
17
- encryptionKey: string;
17
+ useUserLocaleAsFallback: boolean;
18
18
  langKey: string;
19
19
  };
@@ -9,7 +9,7 @@ export interface PluginConfig {
9
9
  appUrl: string;
10
10
  locale: string;
11
11
  fallbackLocale: string;
12
- encryptionKey: string;
12
+ useUserLocaleAsFallback: boolean;
13
13
  langKey: string;
14
14
  }
15
15
  export interface PluginOptions {