@localess/react 3.0.1-dev.20260410070330 → 3.0.1-dev.20260411012947
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/{chunk-AJP75NRT.mjs → chunk-DD2NUMQJ.mjs} +1 -1
- package/dist/{chunk-V6JSXN66.mjs → chunk-UW7OWE53.mjs} +1 -32
- package/dist/index.d.mts +97 -9
- package/dist/index.d.ts +97 -9
- package/dist/index.js +32 -5
- package/dist/index.mjs +59 -3
- package/dist/localess-component-DikkO35Z.d.mts +58 -0
- package/dist/localess-component-DikkO35Z.d.ts +58 -0
- package/dist/richtext-D6tBmv-7.d.mts +218 -0
- package/dist/richtext-D6tBmv-7.d.ts +218 -0
- package/dist/rsc.d.mts +54 -8
- package/dist/rsc.d.ts +54 -8
- package/dist/rsc.js +13 -48
- package/dist/rsc.mjs +18 -22
- package/dist/ssr.d.mts +82 -4
- package/dist/ssr.d.ts +82 -4
- package/dist/ssr.js +1 -1
- package/dist/ssr.mjs +1 -1
- package/package.json +2 -2
- package/dist/richtext-XH7pH80J.d.mts +0 -82
- package/dist/richtext-XH7pH80J.d.ts +0 -82
package/dist/rsc.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
LocalessComponent
|
|
3
|
-
|
|
4
|
-
} from "./chunk-V6JSXN66.mjs";
|
|
2
|
+
LocalessComponent
|
|
3
|
+
} from "./chunk-UW7OWE53.mjs";
|
|
5
4
|
import {
|
|
6
5
|
LocalessServerComponent,
|
|
7
6
|
LocalessServerDocument
|
|
8
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DD2NUMQJ.mjs";
|
|
9
8
|
import {
|
|
9
|
+
FONT_BOLD,
|
|
10
|
+
FONT_NORMAL,
|
|
10
11
|
findLink,
|
|
11
12
|
getComponent,
|
|
12
13
|
getFallbackComponent,
|
|
@@ -25,22 +26,18 @@ import {
|
|
|
25
26
|
} from "./chunk-ETSLIILF.mjs";
|
|
26
27
|
|
|
27
28
|
// src/rsc/localess-document.tsx
|
|
28
|
-
import { forwardRef
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
return /* @__PURE__ */ jsx(LocalessComponent, { ref, data: contentData, links, references, ...restProps });
|
|
29
|
+
import { forwardRef } from "react";
|
|
30
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
31
|
+
var LocalessDocument = forwardRef(({ document }, ref) => {
|
|
32
|
+
if (!document.data) {
|
|
33
|
+
console.error("LocalessDocument property %cdocument.data%c is not provided.", FONT_BOLD, FONT_NORMAL);
|
|
34
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
35
|
+
"LocalessDocument property ",
|
|
36
|
+
/* @__PURE__ */ jsx("b", { children: "document.data" }),
|
|
37
|
+
" is not provided."
|
|
38
|
+
] });
|
|
39
|
+
}
|
|
40
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(LocalessComponent, { ref, data: document.data, links: document.links, references: document.references }) });
|
|
44
41
|
});
|
|
45
42
|
export {
|
|
46
43
|
LocalessComponent,
|
|
@@ -61,6 +58,5 @@ export {
|
|
|
61
58
|
registerComponent,
|
|
62
59
|
renderRichTextToReact,
|
|
63
60
|
resolveAsset,
|
|
64
|
-
unregisterComponent
|
|
65
|
-
useLocaless
|
|
61
|
+
unregisterComponent
|
|
66
62
|
};
|
package/dist/ssr.d.mts
CHANGED
|
@@ -1,18 +1,96 @@
|
|
|
1
|
-
export { L as LocalessOptions, f as findLink, g as getComponent, a as getFallbackComponent, b as getLocalessClient, l as localessInit, r as registerComponent, c as renderRichTextToReact, d as resolveAsset, u as unregisterComponent } from './richtext-
|
|
2
|
-
import * as
|
|
1
|
+
export { L as LocalessOptions, f as findLink, g as getComponent, a as getFallbackComponent, b as getLocalessClient, l as localessInit, r as registerComponent, c as renderRichTextToReact, d as resolveAsset, u as unregisterComponent } from './richtext-D6tBmv-7.mjs';
|
|
2
|
+
import * as react from 'react';
|
|
3
3
|
import { ContentData, Links, References, Content } from '@localess/client';
|
|
4
4
|
export { Content, ContentAsset, ContentData, ContentDataField, ContentDataSchema, ContentLink, ContentMetadata, ContentReference, ContentRichText, EventCallback, EventToApp, EventToAppType, Links, LocalessClient, LocalessSync, References, Translations, isBrowser, isIframe, isServer, localessEditable, localessEditableField } from '@localess/client';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Props for {@link LocalessServerComponent}.
|
|
8
|
+
*
|
|
9
|
+
* @template T - The content data shape. Defaults to the base {@link ContentData} type.
|
|
10
|
+
*/
|
|
6
11
|
type LocalessServerComponentProps<T extends ContentData = ContentData> = {
|
|
12
|
+
/**
|
|
13
|
+
* The content data object to render. Must have a `_schema` field that matches a key
|
|
14
|
+
* in the component registry configured via `localessInit`.
|
|
15
|
+
*/
|
|
7
16
|
data: T;
|
|
17
|
+
/**
|
|
18
|
+
* Optional map of content links keyed by link ID.
|
|
19
|
+
* Pass through to child components so they can resolve {@link ContentLink} values with `findLink`.
|
|
20
|
+
*/
|
|
8
21
|
links?: Links;
|
|
22
|
+
/**
|
|
23
|
+
* Optional map of resolved content references keyed by reference ID.
|
|
24
|
+
* Pass through to child components that consume referenced content.
|
|
25
|
+
*/
|
|
9
26
|
references?: References;
|
|
10
27
|
};
|
|
11
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Server-safe dynamic schema-to-component renderer for SSR and static-export environments.
|
|
30
|
+
*
|
|
31
|
+
* Equivalent to {@link LocalessComponent} but intentionally omits Visual Editor sync
|
|
32
|
+
* attribute injection (`localessEditable`), making it safe for:
|
|
33
|
+
* - Next.js static exports (`output: 'export'`)
|
|
34
|
+
* - Server-side rendering where live editing is not needed
|
|
35
|
+
*
|
|
36
|
+
* Looks up `data._schema` in the component registry, renders the matched component,
|
|
37
|
+
* falls back to the `fallbackComponent` if registered, or renders an inline error.
|
|
38
|
+
*
|
|
39
|
+
* **No `'use client'` directive** — safe to render in React Server Components.
|
|
40
|
+
* If you need live Visual Editor editing use {@link LocalessComponent} from
|
|
41
|
+
* `@localess/react` or `@localess/react/rsc` instead.
|
|
42
|
+
*
|
|
43
|
+
* @template T - The content data shape. Defaults to {@link ContentData}.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* import { LocalessServerComponent } from '@localess/react/ssr';
|
|
48
|
+
*
|
|
49
|
+
* <LocalessServerComponent data={content.data} links={content.links} references={content.references} />
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
declare const LocalessServerComponent: react.ForwardRefExoticComponent<LocalessServerComponentProps<ContentData> & react.RefAttributes<HTMLElement>>;
|
|
12
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Props for {@link LocalessServerDocument}.
|
|
56
|
+
*
|
|
57
|
+
* @template T - The content data shape. Defaults to the base {@link ContentData} type.
|
|
58
|
+
*/
|
|
13
59
|
type LocalessServerDocumentProps<T extends ContentData = ContentData> = {
|
|
60
|
+
/**
|
|
61
|
+
* The full content response object as returned by `getContentBySlug` or `getContentById`.
|
|
62
|
+
* Must contain a `data` field with a valid `_schema` key.
|
|
63
|
+
*/
|
|
14
64
|
document: Content<T>;
|
|
15
65
|
};
|
|
16
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Server-safe document renderer for SSR and static-export environments.
|
|
68
|
+
*
|
|
69
|
+
* Accepts the full {@link Content} wrapper (as returned by `getContentBySlug` /
|
|
70
|
+
* `getContentById`) and delegates to {@link LocalessServerComponent}, automatically
|
|
71
|
+
* passing `data`, `links`, and `references` through.
|
|
72
|
+
*
|
|
73
|
+
* This is a convenience wrapper — use it when you want to render a fetched
|
|
74
|
+
* `Content<T>` object without manually destructuring it.
|
|
75
|
+
*
|
|
76
|
+
* **No live editing** — does not subscribe to Visual Editor sync events.
|
|
77
|
+
* For live Visual Editor editing use {@link LocalessDocument} from `@localess/react/rsc`.
|
|
78
|
+
*
|
|
79
|
+
* **No `'use client'` directive** — safe to render in React Server Components
|
|
80
|
+
* and Next.js static export pages.
|
|
81
|
+
*
|
|
82
|
+
* @template T - The content data shape. Defaults to {@link ContentData}.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```tsx
|
|
86
|
+
* import { LocalessServerDocument } from '@localess/react/ssr';
|
|
87
|
+
*
|
|
88
|
+
* // Server Component or getServerSideProps
|
|
89
|
+
* const content = await getLocalessClient().getContentBySlug<MyPage>('home', { locale: 'en' });
|
|
90
|
+
*
|
|
91
|
+
* return <LocalessServerDocument document={content} />;
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
declare const LocalessServerDocument: react.ForwardRefExoticComponent<LocalessServerDocumentProps<ContentData> & react.RefAttributes<HTMLElement>>;
|
|
17
95
|
|
|
18
96
|
export { LocalessServerComponent, type LocalessServerComponentProps, LocalessServerDocument, type LocalessServerDocumentProps };
|
package/dist/ssr.d.ts
CHANGED
|
@@ -1,18 +1,96 @@
|
|
|
1
|
-
export { L as LocalessOptions, f as findLink, g as getComponent, a as getFallbackComponent, b as getLocalessClient, l as localessInit, r as registerComponent, c as renderRichTextToReact, d as resolveAsset, u as unregisterComponent } from './richtext-
|
|
2
|
-
import * as
|
|
1
|
+
export { L as LocalessOptions, f as findLink, g as getComponent, a as getFallbackComponent, b as getLocalessClient, l as localessInit, r as registerComponent, c as renderRichTextToReact, d as resolveAsset, u as unregisterComponent } from './richtext-D6tBmv-7.js';
|
|
2
|
+
import * as react from 'react';
|
|
3
3
|
import { ContentData, Links, References, Content } from '@localess/client';
|
|
4
4
|
export { Content, ContentAsset, ContentData, ContentDataField, ContentDataSchema, ContentLink, ContentMetadata, ContentReference, ContentRichText, EventCallback, EventToApp, EventToAppType, Links, LocalessClient, LocalessSync, References, Translations, isBrowser, isIframe, isServer, localessEditable, localessEditableField } from '@localess/client';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Props for {@link LocalessServerComponent}.
|
|
8
|
+
*
|
|
9
|
+
* @template T - The content data shape. Defaults to the base {@link ContentData} type.
|
|
10
|
+
*/
|
|
6
11
|
type LocalessServerComponentProps<T extends ContentData = ContentData> = {
|
|
12
|
+
/**
|
|
13
|
+
* The content data object to render. Must have a `_schema` field that matches a key
|
|
14
|
+
* in the component registry configured via `localessInit`.
|
|
15
|
+
*/
|
|
7
16
|
data: T;
|
|
17
|
+
/**
|
|
18
|
+
* Optional map of content links keyed by link ID.
|
|
19
|
+
* Pass through to child components so they can resolve {@link ContentLink} values with `findLink`.
|
|
20
|
+
*/
|
|
8
21
|
links?: Links;
|
|
22
|
+
/**
|
|
23
|
+
* Optional map of resolved content references keyed by reference ID.
|
|
24
|
+
* Pass through to child components that consume referenced content.
|
|
25
|
+
*/
|
|
9
26
|
references?: References;
|
|
10
27
|
};
|
|
11
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Server-safe dynamic schema-to-component renderer for SSR and static-export environments.
|
|
30
|
+
*
|
|
31
|
+
* Equivalent to {@link LocalessComponent} but intentionally omits Visual Editor sync
|
|
32
|
+
* attribute injection (`localessEditable`), making it safe for:
|
|
33
|
+
* - Next.js static exports (`output: 'export'`)
|
|
34
|
+
* - Server-side rendering where live editing is not needed
|
|
35
|
+
*
|
|
36
|
+
* Looks up `data._schema` in the component registry, renders the matched component,
|
|
37
|
+
* falls back to the `fallbackComponent` if registered, or renders an inline error.
|
|
38
|
+
*
|
|
39
|
+
* **No `'use client'` directive** — safe to render in React Server Components.
|
|
40
|
+
* If you need live Visual Editor editing use {@link LocalessComponent} from
|
|
41
|
+
* `@localess/react` or `@localess/react/rsc` instead.
|
|
42
|
+
*
|
|
43
|
+
* @template T - The content data shape. Defaults to {@link ContentData}.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* import { LocalessServerComponent } from '@localess/react/ssr';
|
|
48
|
+
*
|
|
49
|
+
* <LocalessServerComponent data={content.data} links={content.links} references={content.references} />
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
declare const LocalessServerComponent: react.ForwardRefExoticComponent<LocalessServerComponentProps<ContentData> & react.RefAttributes<HTMLElement>>;
|
|
12
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Props for {@link LocalessServerDocument}.
|
|
56
|
+
*
|
|
57
|
+
* @template T - The content data shape. Defaults to the base {@link ContentData} type.
|
|
58
|
+
*/
|
|
13
59
|
type LocalessServerDocumentProps<T extends ContentData = ContentData> = {
|
|
60
|
+
/**
|
|
61
|
+
* The full content response object as returned by `getContentBySlug` or `getContentById`.
|
|
62
|
+
* Must contain a `data` field with a valid `_schema` key.
|
|
63
|
+
*/
|
|
14
64
|
document: Content<T>;
|
|
15
65
|
};
|
|
16
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Server-safe document renderer for SSR and static-export environments.
|
|
68
|
+
*
|
|
69
|
+
* Accepts the full {@link Content} wrapper (as returned by `getContentBySlug` /
|
|
70
|
+
* `getContentById`) and delegates to {@link LocalessServerComponent}, automatically
|
|
71
|
+
* passing `data`, `links`, and `references` through.
|
|
72
|
+
*
|
|
73
|
+
* This is a convenience wrapper — use it when you want to render a fetched
|
|
74
|
+
* `Content<T>` object without manually destructuring it.
|
|
75
|
+
*
|
|
76
|
+
* **No live editing** — does not subscribe to Visual Editor sync events.
|
|
77
|
+
* For live Visual Editor editing use {@link LocalessDocument} from `@localess/react/rsc`.
|
|
78
|
+
*
|
|
79
|
+
* **No `'use client'` directive** — safe to render in React Server Components
|
|
80
|
+
* and Next.js static export pages.
|
|
81
|
+
*
|
|
82
|
+
* @template T - The content data shape. Defaults to {@link ContentData}.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```tsx
|
|
86
|
+
* import { LocalessServerDocument } from '@localess/react/ssr';
|
|
87
|
+
*
|
|
88
|
+
* // Server Component or getServerSideProps
|
|
89
|
+
* const content = await getLocalessClient().getContentBySlug<MyPage>('home', { locale: 'en' });
|
|
90
|
+
*
|
|
91
|
+
* return <LocalessServerDocument document={content} />;
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
declare const LocalessServerDocument: react.ForwardRefExoticComponent<LocalessServerDocumentProps<ContentData> & react.RefAttributes<HTMLElement>>;
|
|
17
95
|
|
|
18
96
|
export { LocalessServerComponent, type LocalessServerComponentProps, LocalessServerDocument, type LocalessServerDocumentProps };
|
package/dist/ssr.js
CHANGED
|
@@ -126,7 +126,7 @@ var LocalessServerComponent = (0, import_react.forwardRef)(({ data, links, refer
|
|
|
126
126
|
var import_react2 = require("react");
|
|
127
127
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
128
128
|
var LocalessServerDocument = (0, import_react2.forwardRef)(({ document }, ref) => {
|
|
129
|
-
if (!document
|
|
129
|
+
if (!document.data) {
|
|
130
130
|
console.error("LocalessServerDocument property %cdocument.data%c is not provided.", FONT_BOLD, FONT_NORMAL);
|
|
131
131
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
|
|
132
132
|
"LocalessServerDocument property ",
|
package/dist/ssr.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@localess/react",
|
|
3
|
-
"version": "3.0.1-dev.
|
|
3
|
+
"version": "3.0.1-dev.20260411012947",
|
|
4
4
|
"description": "ReactJS JavaScript/TypeScript SDK for Localess's API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"localess",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"react-dom": "^17 || ^18 || ^19"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@localess/client": "3.0.1-dev.
|
|
59
|
+
"@localess/client": "3.0.1-dev.20260411012947",
|
|
60
60
|
"@tiptap/static-renderer": "^3.20.1",
|
|
61
61
|
"@tiptap/html": "^3.20.1",
|
|
62
62
|
"@tiptap/extension-bold": "^3.20.1",
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import { LocalessClientOptions, LocalessClient, ContentAsset, Links, ContentLink, ContentRichText } from '@localess/client';
|
|
3
|
-
|
|
4
|
-
type LocalessOptions = LocalessClientOptions & {
|
|
5
|
-
/**
|
|
6
|
-
* Components mapping for Localess Component integration
|
|
7
|
-
*/
|
|
8
|
-
components?: Record<string, React__default.ElementType>;
|
|
9
|
-
/**
|
|
10
|
-
* Component used if expected key didn't return anything
|
|
11
|
-
*/
|
|
12
|
-
fallbackComponent?: React__default.ElementType;
|
|
13
|
-
/**
|
|
14
|
-
* Load Sync Script, for Visual Editor integration
|
|
15
|
-
*/
|
|
16
|
-
enableSync?: boolean;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Initialize Localess Client
|
|
21
|
-
* @param options
|
|
22
|
-
* @returns LocalessClient
|
|
23
|
-
*/
|
|
24
|
-
declare function localessInit(options: LocalessOptions): LocalessClient;
|
|
25
|
-
/**
|
|
26
|
-
* Get Localess Client
|
|
27
|
-
* @returns LocalessClient
|
|
28
|
-
*/
|
|
29
|
-
declare function getLocalessClient(): LocalessClient;
|
|
30
|
-
/**
|
|
31
|
-
* Register Component
|
|
32
|
-
* @param key - component key
|
|
33
|
-
* @param component - React Component
|
|
34
|
-
*/
|
|
35
|
-
declare function registerComponent(key: string, component: React__default.ElementType): void;
|
|
36
|
-
/**
|
|
37
|
-
* Unregister Component
|
|
38
|
-
* @param key - component key
|
|
39
|
-
*/
|
|
40
|
-
declare function unregisterComponent(key: string): void;
|
|
41
|
-
/**
|
|
42
|
-
* Set Components
|
|
43
|
-
* @param components - Record of components
|
|
44
|
-
*/
|
|
45
|
-
declare function setComponents(components: Record<string, React__default.ElementType>): void;
|
|
46
|
-
/**
|
|
47
|
-
* Get Component
|
|
48
|
-
* @param key - component key
|
|
49
|
-
* @returns React Component
|
|
50
|
-
*/
|
|
51
|
-
declare function getComponent(key: string): React__default.ElementType | undefined;
|
|
52
|
-
/**
|
|
53
|
-
* Set Fallback Component
|
|
54
|
-
* @param fallbackComponent
|
|
55
|
-
*/
|
|
56
|
-
declare function setFallbackComponent(fallbackComponent: React__default.ElementType): void;
|
|
57
|
-
/**
|
|
58
|
-
* Get Fallback Component
|
|
59
|
-
* @returns React Component
|
|
60
|
-
*/
|
|
61
|
-
declare function getFallbackComponent(): React__default.ElementType | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* Check if Sync is enabled
|
|
64
|
-
*/
|
|
65
|
-
declare function isSyncEnabled(): boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Resolve Asset URL
|
|
68
|
-
* @param asset - ContentAsset
|
|
69
|
-
* @returns Asset URL
|
|
70
|
-
*/
|
|
71
|
-
declare function resolveAsset(asset: ContentAsset): string;
|
|
72
|
-
|
|
73
|
-
declare function findLink(links: Links | undefined, link: ContentLink): string;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Render Localess Rich Text content to React elements
|
|
77
|
-
* @param content - The Rich Text content to render
|
|
78
|
-
* @returns React.ReactNode - The rendered React elements
|
|
79
|
-
*/
|
|
80
|
-
declare function renderRichTextToReact(content: ContentRichText): React__default.ReactNode;
|
|
81
|
-
|
|
82
|
-
export { type LocalessOptions as L, getFallbackComponent as a, getLocalessClient as b, renderRichTextToReact as c, resolveAsset as d, setFallbackComponent as e, findLink as f, getComponent as g, isSyncEnabled as i, localessInit as l, registerComponent as r, setComponents as s, unregisterComponent as u };
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import { LocalessClientOptions, LocalessClient, ContentAsset, Links, ContentLink, ContentRichText } from '@localess/client';
|
|
3
|
-
|
|
4
|
-
type LocalessOptions = LocalessClientOptions & {
|
|
5
|
-
/**
|
|
6
|
-
* Components mapping for Localess Component integration
|
|
7
|
-
*/
|
|
8
|
-
components?: Record<string, React__default.ElementType>;
|
|
9
|
-
/**
|
|
10
|
-
* Component used if expected key didn't return anything
|
|
11
|
-
*/
|
|
12
|
-
fallbackComponent?: React__default.ElementType;
|
|
13
|
-
/**
|
|
14
|
-
* Load Sync Script, for Visual Editor integration
|
|
15
|
-
*/
|
|
16
|
-
enableSync?: boolean;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Initialize Localess Client
|
|
21
|
-
* @param options
|
|
22
|
-
* @returns LocalessClient
|
|
23
|
-
*/
|
|
24
|
-
declare function localessInit(options: LocalessOptions): LocalessClient;
|
|
25
|
-
/**
|
|
26
|
-
* Get Localess Client
|
|
27
|
-
* @returns LocalessClient
|
|
28
|
-
*/
|
|
29
|
-
declare function getLocalessClient(): LocalessClient;
|
|
30
|
-
/**
|
|
31
|
-
* Register Component
|
|
32
|
-
* @param key - component key
|
|
33
|
-
* @param component - React Component
|
|
34
|
-
*/
|
|
35
|
-
declare function registerComponent(key: string, component: React__default.ElementType): void;
|
|
36
|
-
/**
|
|
37
|
-
* Unregister Component
|
|
38
|
-
* @param key - component key
|
|
39
|
-
*/
|
|
40
|
-
declare function unregisterComponent(key: string): void;
|
|
41
|
-
/**
|
|
42
|
-
* Set Components
|
|
43
|
-
* @param components - Record of components
|
|
44
|
-
*/
|
|
45
|
-
declare function setComponents(components: Record<string, React__default.ElementType>): void;
|
|
46
|
-
/**
|
|
47
|
-
* Get Component
|
|
48
|
-
* @param key - component key
|
|
49
|
-
* @returns React Component
|
|
50
|
-
*/
|
|
51
|
-
declare function getComponent(key: string): React__default.ElementType | undefined;
|
|
52
|
-
/**
|
|
53
|
-
* Set Fallback Component
|
|
54
|
-
* @param fallbackComponent
|
|
55
|
-
*/
|
|
56
|
-
declare function setFallbackComponent(fallbackComponent: React__default.ElementType): void;
|
|
57
|
-
/**
|
|
58
|
-
* Get Fallback Component
|
|
59
|
-
* @returns React Component
|
|
60
|
-
*/
|
|
61
|
-
declare function getFallbackComponent(): React__default.ElementType | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* Check if Sync is enabled
|
|
64
|
-
*/
|
|
65
|
-
declare function isSyncEnabled(): boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Resolve Asset URL
|
|
68
|
-
* @param asset - ContentAsset
|
|
69
|
-
* @returns Asset URL
|
|
70
|
-
*/
|
|
71
|
-
declare function resolveAsset(asset: ContentAsset): string;
|
|
72
|
-
|
|
73
|
-
declare function findLink(links: Links | undefined, link: ContentLink): string;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Render Localess Rich Text content to React elements
|
|
77
|
-
* @param content - The Rich Text content to render
|
|
78
|
-
* @returns React.ReactNode - The rendered React elements
|
|
79
|
-
*/
|
|
80
|
-
declare function renderRichTextToReact(content: ContentRichText): React__default.ReactNode;
|
|
81
|
-
|
|
82
|
-
export { type LocalessOptions as L, getFallbackComponent as a, getLocalessClient as b, renderRichTextToReact as c, resolveAsset as d, setFallbackComponent as e, findLink as f, getComponent as g, isSyncEnabled as i, localessInit as l, registerComponent as r, setComponents as s, unregisterComponent as u };
|