react-intlayer
Advanced tools
Comparing version
@@ -16,7 +16,7 @@ import { type LocalesValues } from '@intlayer/config/client'; | ||
export declare const useIntlayerContext: () => IntlayerValue; | ||
export type IntlayerProviderProps = PropsWithChildren & { | ||
export type IntlayerProviderProps = PropsWithChildren<{ | ||
locale?: LocalesValues; | ||
setLocale?: (locale: LocalesValues) => void; | ||
disableEditor?: boolean; | ||
}; | ||
}>; | ||
/** | ||
@@ -23,0 +23,0 @@ * Provider that store the current locale on the client side |
import type { LocalesValues } from '@intlayer/config/client'; | ||
import { DeepTransformContent, type Dictionary } from '@intlayer/core'; | ||
import { type Dictionary } from '@intlayer/core'; | ||
/** | ||
@@ -8,3 +8,3 @@ * On the server side, Hook that transform a dictionary and return the content | ||
*/ | ||
export declare const useDictionary: <T extends Dictionary>(dictionary: T, locale?: LocalesValues) => DeepTransformContent<T["content"]>; | ||
export declare const useDictionary: <T extends Dictionary>(dictionary: T, locale?: LocalesValues) => import("@intlayer/core").DeepTransformContent<T["content"], import("../plugins").IInterpreterPluginState>; | ||
//# sourceMappingURL=useDictionary.d.ts.map |
import type { Locales } from '@intlayer/config/client'; | ||
import type { DictionaryKeys } from '@intlayer/core'; | ||
import { IntlayerDictionaryTypesConnector } from 'intlayer'; | ||
import type { IntlayerDictionaryTypesConnector } from 'intlayer'; | ||
import type { DeepTransformContent } from '../plugins'; | ||
@@ -5,0 +5,0 @@ /** |
@@ -11,5 +11,5 @@ import type { LocalesValues } from '@intlayer/config/client'; | ||
*/ | ||
export declare const useIntlayerAsync: <T extends DictionaryKeys>(key: T, locale?: LocalesValues, isRenderEditor?: boolean) => import("@intlayer/core").DeepTransformContent<import("intlayer").IntlayerDictionaryTypesConnector[T]["content"], import("@intlayer/core").IInterpreterPluginState> & { | ||
export declare const useIntlayerAsync: <T extends DictionaryKeys>(key: T, locale?: LocalesValues) => import("@intlayer/core").DeepTransformContent<import("intlayer").IntlayerDictionaryTypesConnector[T]["content"], import("@intlayer/core").IInterpreterPluginState> & { | ||
isLoading: boolean; | ||
}; | ||
//# sourceMappingURL=useIntlayerAsync.d.ts.map |
import { type NodeProps } from '@intlayer/core'; | ||
import { type FC, HTMLAttributes } from 'react'; | ||
import { type HTMLAttributes, type FC } from 'react'; | ||
export type ContentSelectorWrapperProps = NodeProps & Omit<HTMLAttributes<HTMLDivElement>, 'content'>; | ||
export declare const ContentSelectorWrapper: FC<ContentSelectorWrapperProps>; | ||
//# sourceMappingURL=ContentSelectorWrapper.d.ts.map |
@@ -0,6 +1,6 @@ | ||
import { type NodeProps } from '@intlayer/core'; | ||
import { type IntlayerNode } from '../IntlayerNode'; | ||
import { type ContentSelectorWrapperProps } from './ContentSelectorWrapper'; | ||
import { type NodeProps } from '@intlayer/core'; | ||
import { IntlayerNode } from '../IntlayerNode'; | ||
export type RenderIntlayerEditorProps = Omit<ContentSelectorWrapperProps, 'children' | 'content'> & NodeProps; | ||
export declare const renderIntlayerEditor: (props: RenderIntlayerEditorProps) => IntlayerNode; | ||
//# sourceMappingURL=renderContentEditor.d.ts.map |
@@ -0,5 +1,5 @@ | ||
import type { Locales, LocalesValues } from '@intlayer/config/client'; | ||
import { type Dictionary, type Plugins } from '@intlayer/core'; | ||
import { type DeepTransformContent } from './plugins'; | ||
import type { Locales, LocalesValues } from '@intlayer/config/client'; | ||
export declare const getDictionary: <T extends Dictionary, L extends LocalesValues = Locales>(dictionary: T, locale?: L, additionalPlugins?: Plugins[]) => DeepTransformContent<T["content"]>; | ||
//# sourceMappingURL=getDictionary.d.ts.map |
import { type DictionaryKeys, type Plugins } from '@intlayer/core'; | ||
import type { IntlayerDictionaryTypesConnector, LocalesValues } from 'intlayer'; | ||
import { type DeepTransformContent } from './plugins'; | ||
import type { IntlayerDictionaryTypesConnector, LocalesValues } from 'intlayer'; | ||
export declare const getIntlayer: <T extends DictionaryKeys, L extends LocalesValues>(key: T, locale?: L, additionalPlugins?: Plugins[]) => DeepTransformContent<IntlayerDictionaryTypesConnector[T]["content"]>; | ||
//# sourceMappingURL=getIntlayer.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { IInterpreterPluginReact } from './plugins'; | ||
import type { IInterpreterPluginReact } from './plugins'; | ||
declare module '@intlayer/core' { | ||
@@ -3,0 +3,0 @@ interface IInterpreterPlugin<T, S> extends IInterpreterPluginReact<T> { |
@@ -1,2 +0,2 @@ | ||
import { FC } from 'react'; | ||
import type { FC } from 'react'; | ||
export declare const MarkdownRenderer: FC<{ | ||
@@ -3,0 +3,0 @@ markdown: string; |
import { type ReactElement } from 'react'; | ||
export declare const renderReactElement: (element: ReactElement) => ReactElement<any, string | import("react").JSXElementConstructor<any>>; | ||
export declare const renderReactElement: (element: ReactElement<any>) => ReactElement<any, string | import("react").JSXElementConstructor<any>>; | ||
//# sourceMappingURL=renderReactElement.d.ts.map |
@@ -6,10 +6,11 @@ import { type LocalesValues } from '@intlayer/config/client'; | ||
*/ | ||
export declare const IntlayerServerContext: { | ||
Provider: ({ children, value, }: { | ||
children: React.ReactNode; | ||
value: LocalesValues; | ||
}) => React.ReactNode; | ||
Consumer: ({ children, }: { | ||
children: (context: LocalesValues) => React.ReactNode; | ||
}) => React.ReactNode; | ||
export declare const IntlayerServerContext: FC<PropsWithChildren<{ | ||
value?: LocalesValues; | ||
}>> & { | ||
Provider: FC<PropsWithChildren<{ | ||
value?: LocalesValues; | ||
}>>; | ||
Consumer: FC<PropsWithChildren<{ | ||
children: (context: LocalesValues) => import("react").ReactNode; | ||
}>>; | ||
_storage: () => { | ||
@@ -16,0 +17,0 @@ value: LocalesValues; |
@@ -0,1 +1,13 @@ | ||
/** | ||
* Creates a new datastore for a given server context. | ||
* Attempts to closely mimic the `createContext` API. | ||
* | ||
* @example | ||
* const IntlayerServer = createServerContext<string | null>(null); | ||
* | ||
* <IntlayerServer value={locale}> | ||
* {children} | ||
* </IntlayerServer> | ||
*/ | ||
import { type FC, type PropsWithChildren, type ReactNode } from 'react'; | ||
export declare const createServerContext: <T>(defaultValue?: T) => ServerContext<T>; | ||
@@ -10,10 +22,11 @@ /** | ||
export declare const getServerContext: <T>({ _storage, _defaultValue, }: ServerContext<T>) => T; | ||
type ServerContext<T> = { | ||
Provider: ({ children, value, }: { | ||
children: React.ReactNode; | ||
value: T; | ||
}) => React.ReactNode; | ||
Consumer: ({ children, }: { | ||
children: (context: T | undefined) => React.ReactNode; | ||
}) => React.ReactNode; | ||
type ServerContext<T> = FC<PropsWithChildren<{ | ||
value?: T; | ||
}>> & { | ||
Provider: FC<PropsWithChildren<{ | ||
value?: T; | ||
}>>; | ||
Consumer: FC<PropsWithChildren<{ | ||
children: (context: T | undefined) => ReactNode; | ||
}>>; | ||
_storage: () => { | ||
@@ -20,0 +33,0 @@ value: T | undefined; |
{ | ||
"name": "react-intlayer", | ||
"version": "5.0.6", | ||
"version": "5.1.0", | ||
"private": false, | ||
@@ -71,7 +71,7 @@ "description": "Easily internationalize i18n your React applications with type-safe multilingual content management.", | ||
"js-cookie": "^3.0.5", | ||
"@intlayer/api": "5.0.6", | ||
"@intlayer/config": "5.0.6", | ||
"@intlayer/core": "5.0.6", | ||
"@intlayer/dictionaries-entry": "5.0.6", | ||
"@intlayer/editor-react": "5.0.6" | ||
"@intlayer/api": "5.1.0", | ||
"@intlayer/config": "5.1.0", | ||
"@intlayer/dictionaries-entry": "5.1.0", | ||
"@intlayer/editor-react": "5.1.0", | ||
"@intlayer/core": "5.1.0" | ||
}, | ||
@@ -82,7 +82,7 @@ "devDependencies": { | ||
"@types/node": "^22.10.6", | ||
"@types/react": "^18.3.1", | ||
"@typescript-eslint/parser": "^8.20.0", | ||
"@types/react": "^19.0.0", | ||
"@typescript-eslint/parser": "^8.24.0", | ||
"concurrently": "^9.1.2", | ||
"eslint": "^9.18.0", | ||
"prettier": "^3.4.2", | ||
"eslint": "^9.20.0", | ||
"prettier": "^3.5.0", | ||
"rimraf": "^6.0.1", | ||
@@ -92,7 +92,7 @@ "tsc-alias": "^1.8.10", | ||
"typescript": "^5.7.3", | ||
"@intlayer/backend": "5.1.0", | ||
"@utils/eslint-config": "1.0.4", | ||
"@utils/ts-config": "1.0.4", | ||
"@utils/tsup-config": "1.0.4", | ||
"@utils/ts-config-types": "1.0.4", | ||
"@intlayer/backend": "5.0.6" | ||
"@utils/ts-config-types": "1.0.4" | ||
}, | ||
@@ -102,8 +102,8 @@ "peerDependencies": { | ||
"react-dom": ">=16.0.0", | ||
"@intlayer/api": "5.0.6", | ||
"@intlayer/config": "5.0.6", | ||
"@intlayer/core": "5.0.6", | ||
"@intlayer/dictionaries-entry": "5.0.6", | ||
"@intlayer/editor-react": "5.0.6", | ||
"intlayer": "5.0.6" | ||
"@intlayer/api": "5.1.0", | ||
"@intlayer/config": "5.1.0", | ||
"@intlayer/core": "5.1.0", | ||
"@intlayer/dictionaries-entry": "5.1.0", | ||
"intlayer": "5.1.0", | ||
"@intlayer/editor-react": "5.1.0" | ||
}, | ||
@@ -110,0 +110,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
3293
0.52%291172
-0.08%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated
Updated