@localess/react 3.0.1-dev.20260408183448 → 3.0.1-dev.20260410065141
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/README.md +189 -7
- package/dist/chunk-AJP75NRT.mjs +56 -0
- package/dist/chunk-ETSLIILF.mjs +149 -0
- package/dist/chunk-V6JSXN66.mjs +76 -0
- package/dist/index.d.mts +4 -89
- package/dist/index.d.ts +4 -89
- package/dist/index.js +73 -89
- package/dist/index.mjs +25 -210
- package/dist/richtext-XH7pH80J.d.mts +82 -0
- package/dist/richtext-XH7pH80J.d.ts +82 -0
- package/dist/rsc.d.mts +5 -0
- package/dist/rsc.d.ts +5 -0
- package/dist/rsc.js +294 -0
- package/dist/rsc.mjs +46 -0
- package/dist/ssr.d.mts +18 -0
- package/dist/ssr.d.ts +18 -0
- package/dist/ssr.js +223 -0
- package/dist/ssr.mjs +38 -0
- package/package.json +13 -3
|
@@ -0,0 +1,82 @@
|
|
|
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 };
|
package/dist/rsc.d.mts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { L as LocalessOptions, f as findLink, g as getComponent, a as getFallbackComponent, b as getLocalessClient, i as isSyncEnabled, l as localessInit, r as registerComponent, c as renderRichTextToReact, d as resolveAsset, u as unregisterComponent } from './richtext-XH7pH80J.mjs';
|
|
2
|
+
export { LocalessServerComponent, LocalessServerComponentProps, LocalessServerDocument, LocalessServerDocumentProps } from './ssr.mjs';
|
|
3
|
+
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';
|
|
4
|
+
export { LocalessComponent, LocalessComponentProps, UseLocalessOptions, useLocaless } from './index.mjs';
|
|
5
|
+
import 'react';
|
package/dist/rsc.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { L as LocalessOptions, f as findLink, g as getComponent, a as getFallbackComponent, b as getLocalessClient, i as isSyncEnabled, l as localessInit, r as registerComponent, c as renderRichTextToReact, d as resolveAsset, u as unregisterComponent } from './richtext-XH7pH80J.js';
|
|
2
|
+
export { LocalessServerComponent, LocalessServerComponentProps, LocalessServerDocument, LocalessServerDocumentProps } from './ssr.js';
|
|
3
|
+
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';
|
|
4
|
+
export { LocalessComponent, LocalessComponentProps, UseLocalessOptions, useLocaless } from './index.js';
|
|
5
|
+
import 'react';
|
package/dist/rsc.js
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/rsc/index.ts
|
|
21
|
+
var rsc_exports = {};
|
|
22
|
+
__export(rsc_exports, {
|
|
23
|
+
LocalessComponent: () => LocalessComponent,
|
|
24
|
+
LocalessServerComponent: () => LocalessServerComponent,
|
|
25
|
+
LocalessServerDocument: () => LocalessServerDocument,
|
|
26
|
+
findLink: () => findLink,
|
|
27
|
+
getComponent: () => getComponent,
|
|
28
|
+
getFallbackComponent: () => getFallbackComponent,
|
|
29
|
+
getLocalessClient: () => getLocalessClient,
|
|
30
|
+
isBrowser: () => import_client2.isBrowser,
|
|
31
|
+
isIframe: () => import_client2.isIframe,
|
|
32
|
+
isServer: () => import_client2.isServer,
|
|
33
|
+
isSyncEnabled: () => isSyncEnabled,
|
|
34
|
+
localessEditable: () => import_client2.localessEditable,
|
|
35
|
+
localessEditableField: () => import_client2.localessEditableField,
|
|
36
|
+
localessInit: () => localessInit,
|
|
37
|
+
registerComponent: () => registerComponent,
|
|
38
|
+
renderRichTextToReact: () => renderRichTextToReact,
|
|
39
|
+
resolveAsset: () => resolveAsset,
|
|
40
|
+
unregisterComponent: () => unregisterComponent,
|
|
41
|
+
useLocaless: () => useLocaless
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(rsc_exports);
|
|
44
|
+
|
|
45
|
+
// src/core/state.ts
|
|
46
|
+
var import_client = require("@localess/client");
|
|
47
|
+
|
|
48
|
+
// src/console.ts
|
|
49
|
+
var FONT_BOLD = "font-weight: bold";
|
|
50
|
+
var FONT_NORMAL = "font-weight: normal";
|
|
51
|
+
|
|
52
|
+
// src/core/state.ts
|
|
53
|
+
var _client = void 0;
|
|
54
|
+
var _components = {};
|
|
55
|
+
var _fallbackComponent = void 0;
|
|
56
|
+
var _enableSync = false;
|
|
57
|
+
var _assetPathPrefix = "";
|
|
58
|
+
function localessInit(options) {
|
|
59
|
+
console.log("localessInit", options);
|
|
60
|
+
const { components, fallbackComponent, enableSync, ...restOptions } = options;
|
|
61
|
+
_client = (0, import_client.localessClient)(restOptions);
|
|
62
|
+
_assetPathPrefix = `${options.origin}/api/v1/spaces/${options.spaceId}/assets/`;
|
|
63
|
+
_components = components || {};
|
|
64
|
+
_fallbackComponent = fallbackComponent;
|
|
65
|
+
if (enableSync) {
|
|
66
|
+
_enableSync = true;
|
|
67
|
+
(0, import_client.loadLocalessSync)(restOptions.origin);
|
|
68
|
+
}
|
|
69
|
+
return _client;
|
|
70
|
+
}
|
|
71
|
+
function getLocalessClient() {
|
|
72
|
+
if (!_client) {
|
|
73
|
+
console.error("[Localess] No client found. Please check if the Localess is initialized.");
|
|
74
|
+
throw new Error("[Localess] No client found.");
|
|
75
|
+
}
|
|
76
|
+
return _client;
|
|
77
|
+
}
|
|
78
|
+
function registerComponent(key, component) {
|
|
79
|
+
_components[key] = component;
|
|
80
|
+
}
|
|
81
|
+
function unregisterComponent(key) {
|
|
82
|
+
delete _components[key];
|
|
83
|
+
}
|
|
84
|
+
function getComponent(key) {
|
|
85
|
+
if (Object.hasOwn(_components, key)) {
|
|
86
|
+
return _components[key];
|
|
87
|
+
}
|
|
88
|
+
console.error(`[Localess] component %c${key}%c can't be found.`, FONT_BOLD, FONT_NORMAL);
|
|
89
|
+
return void 0;
|
|
90
|
+
}
|
|
91
|
+
function getFallbackComponent() {
|
|
92
|
+
return _fallbackComponent;
|
|
93
|
+
}
|
|
94
|
+
function isSyncEnabled() {
|
|
95
|
+
return _enableSync;
|
|
96
|
+
}
|
|
97
|
+
function resolveAsset(asset) {
|
|
98
|
+
return `${_assetPathPrefix}${asset.uri}`;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// src/ssr/localess-component.tsx
|
|
102
|
+
var import_react = require("react");
|
|
103
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
104
|
+
var LocalessServerComponent = (0, import_react.forwardRef)(({ data, links, references, ...restProps }, ref) => {
|
|
105
|
+
if (!data) {
|
|
106
|
+
console.error("LocalessServerComponent property %cdata%c is not provided.", FONT_BOLD, FONT_NORMAL);
|
|
107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
108
|
+
"LocalessServerComponent property ",
|
|
109
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("b", { children: "data" }),
|
|
110
|
+
" is not provided."
|
|
111
|
+
] });
|
|
112
|
+
}
|
|
113
|
+
const Comp = getComponent(data._schema);
|
|
114
|
+
if (Comp) {
|
|
115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, { ref, data, links, references, ...restProps });
|
|
116
|
+
}
|
|
117
|
+
const FallbackComponent = getFallbackComponent();
|
|
118
|
+
if (FallbackComponent) {
|
|
119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FallbackComponent, { ref, data, links, references, ...restProps });
|
|
120
|
+
}
|
|
121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: [
|
|
122
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("b", { children: "LocalessServerComponent" }),
|
|
123
|
+
" could not found component with key ",
|
|
124
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("b", { children: data._schema }),
|
|
125
|
+
". ",
|
|
126
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
|
|
127
|
+
"Please check if your configuration is correct."
|
|
128
|
+
] });
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
// src/ssr/localess-document.tsx
|
|
132
|
+
var import_react2 = require("react");
|
|
133
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
134
|
+
var LocalessServerDocument = (0, import_react2.forwardRef)(({ document }, ref) => {
|
|
135
|
+
if (!document || !document.data) {
|
|
136
|
+
console.error("LocalessServerDocument property %cdocument.data%c is not provided.", FONT_BOLD, FONT_NORMAL);
|
|
137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
|
|
138
|
+
"LocalessServerDocument property ",
|
|
139
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("b", { children: "document.data" }),
|
|
140
|
+
" is not provided."
|
|
141
|
+
] });
|
|
142
|
+
}
|
|
143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LocalessServerComponent, { ref, data: document.data, links: document.links, references: document.references });
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
// src/core/richtext.ts
|
|
147
|
+
var import_react3 = require("@tiptap/static-renderer/pm/react");
|
|
148
|
+
var import_extension_document = require("@tiptap/extension-document");
|
|
149
|
+
var import_extension_text = require("@tiptap/extension-text");
|
|
150
|
+
var import_extension_paragraph = require("@tiptap/extension-paragraph");
|
|
151
|
+
var import_extension_heading = require("@tiptap/extension-heading");
|
|
152
|
+
var import_extension_bold = require("@tiptap/extension-bold");
|
|
153
|
+
var import_extension_italic = require("@tiptap/extension-italic");
|
|
154
|
+
var import_extension_strike = require("@tiptap/extension-strike");
|
|
155
|
+
var import_extension_underline = require("@tiptap/extension-underline");
|
|
156
|
+
var import_extension_history = require("@tiptap/extension-history");
|
|
157
|
+
var import_extension_list_item = require("@tiptap/extension-list-item");
|
|
158
|
+
var import_extension_ordered_list = require("@tiptap/extension-ordered-list");
|
|
159
|
+
var import_extension_bullet_list = require("@tiptap/extension-bullet-list");
|
|
160
|
+
var import_extension_code = require("@tiptap/extension-code");
|
|
161
|
+
var import_extension_code_block_lowlight = require("@tiptap/extension-code-block-lowlight");
|
|
162
|
+
var import_extension_link = require("@tiptap/extension-link");
|
|
163
|
+
function renderRichTextToReact(content) {
|
|
164
|
+
return (0, import_react3.renderToReactElement)({
|
|
165
|
+
content,
|
|
166
|
+
extensions: [
|
|
167
|
+
import_extension_document.Document,
|
|
168
|
+
import_extension_text.Text,
|
|
169
|
+
import_extension_paragraph.Paragraph,
|
|
170
|
+
import_extension_heading.Heading.configure({
|
|
171
|
+
levels: [1, 2, 3, 4, 5, 6]
|
|
172
|
+
}),
|
|
173
|
+
import_extension_bold.Bold,
|
|
174
|
+
import_extension_italic.Italic,
|
|
175
|
+
import_extension_strike.Strike,
|
|
176
|
+
import_extension_underline.Underline,
|
|
177
|
+
import_extension_history.History,
|
|
178
|
+
import_extension_list_item.ListItem,
|
|
179
|
+
import_extension_ordered_list.OrderedList,
|
|
180
|
+
import_extension_bullet_list.BulletList,
|
|
181
|
+
import_extension_code.Code,
|
|
182
|
+
import_extension_code_block_lowlight.CodeBlockLowlight,
|
|
183
|
+
import_extension_link.Link
|
|
184
|
+
]
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// src/core/utils/index.ts
|
|
189
|
+
var import_client2 = require("@localess/client");
|
|
190
|
+
|
|
191
|
+
// src/core/utils/link.util.ts
|
|
192
|
+
function findLink(links, link) {
|
|
193
|
+
switch (link.type) {
|
|
194
|
+
case "content": {
|
|
195
|
+
if (links) {
|
|
196
|
+
const path = links[link.uri];
|
|
197
|
+
if (path) {
|
|
198
|
+
return "/" + path.fullSlug;
|
|
199
|
+
} else {
|
|
200
|
+
return "/not-found";
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return "/not-found";
|
|
204
|
+
}
|
|
205
|
+
case "url":
|
|
206
|
+
return link.uri;
|
|
207
|
+
default:
|
|
208
|
+
return "no-type";
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// src/core/components/localess-component.tsx
|
|
213
|
+
var import_react4 = require("react");
|
|
214
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
215
|
+
var LocalessComponent = (0, import_react4.forwardRef)(
|
|
216
|
+
({ data, links, references, ...restProps }, ref) => {
|
|
217
|
+
if (!data) {
|
|
218
|
+
console.error("LocalessComponent property %cdata%c is not provided.", FONT_BOLD, FONT_NORMAL);
|
|
219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
|
|
220
|
+
"LocalessComponent property ",
|
|
221
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("b", { children: "data" }),
|
|
222
|
+
" is not provided."
|
|
223
|
+
] });
|
|
224
|
+
}
|
|
225
|
+
const Comp = getComponent(data._schema);
|
|
226
|
+
if (Comp) {
|
|
227
|
+
const attr = isSyncEnabled() ? (0, import_client2.localessEditable)(data) : {};
|
|
228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Comp, { ref, data, links, references, ...attr, ...restProps });
|
|
229
|
+
}
|
|
230
|
+
const FallbackComponent = getFallbackComponent();
|
|
231
|
+
if (FallbackComponent) {
|
|
232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FallbackComponent, { ref, data, links, references, ...restProps });
|
|
233
|
+
}
|
|
234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
|
|
235
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("b", { children: "LocalessComponent" }),
|
|
236
|
+
" could not found component with key ",
|
|
237
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("b", { children: data._schema }),
|
|
238
|
+
". ",
|
|
239
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("br", {}),
|
|
240
|
+
"Please check if your configuration is correct."
|
|
241
|
+
] });
|
|
242
|
+
}
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
// src/core/hooks/use-localess.ts
|
|
246
|
+
var import_react5 = require("react");
|
|
247
|
+
var import_client3 = require("@localess/client");
|
|
248
|
+
var useLocaless = (slug, options = {}) => {
|
|
249
|
+
const [document, setDocument] = (0, import_react5.useState)();
|
|
250
|
+
const client = getLocalessClient();
|
|
251
|
+
let normalizedSlug;
|
|
252
|
+
if (Array.isArray(slug)) {
|
|
253
|
+
normalizedSlug = slug.join("/");
|
|
254
|
+
} else {
|
|
255
|
+
normalizedSlug = slug;
|
|
256
|
+
}
|
|
257
|
+
(0, import_react5.useEffect)(() => {
|
|
258
|
+
async function loadDocument() {
|
|
259
|
+
const document2 = await client.getContentBySlug(normalizedSlug, options);
|
|
260
|
+
setDocument(document2);
|
|
261
|
+
if (isSyncEnabled() && (0, import_client3.isBrowser)()) {
|
|
262
|
+
window.localess?.on(["input", "change"], (event) => {
|
|
263
|
+
if (event.type === "change" || event.type === "input") {
|
|
264
|
+
setDocument({ ...document2, data: event.data });
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
loadDocument();
|
|
270
|
+
}, [slug, options, client]);
|
|
271
|
+
return document;
|
|
272
|
+
};
|
|
273
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
274
|
+
0 && (module.exports = {
|
|
275
|
+
LocalessComponent,
|
|
276
|
+
LocalessServerComponent,
|
|
277
|
+
LocalessServerDocument,
|
|
278
|
+
findLink,
|
|
279
|
+
getComponent,
|
|
280
|
+
getFallbackComponent,
|
|
281
|
+
getLocalessClient,
|
|
282
|
+
isBrowser,
|
|
283
|
+
isIframe,
|
|
284
|
+
isServer,
|
|
285
|
+
isSyncEnabled,
|
|
286
|
+
localessEditable,
|
|
287
|
+
localessEditableField,
|
|
288
|
+
localessInit,
|
|
289
|
+
registerComponent,
|
|
290
|
+
renderRichTextToReact,
|
|
291
|
+
resolveAsset,
|
|
292
|
+
unregisterComponent,
|
|
293
|
+
useLocaless
|
|
294
|
+
});
|
package/dist/rsc.mjs
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LocalessComponent,
|
|
3
|
+
useLocaless
|
|
4
|
+
} from "./chunk-V6JSXN66.mjs";
|
|
5
|
+
import {
|
|
6
|
+
LocalessServerComponent,
|
|
7
|
+
LocalessServerDocument
|
|
8
|
+
} from "./chunk-AJP75NRT.mjs";
|
|
9
|
+
import {
|
|
10
|
+
findLink,
|
|
11
|
+
getComponent,
|
|
12
|
+
getFallbackComponent,
|
|
13
|
+
getLocalessClient,
|
|
14
|
+
isBrowser,
|
|
15
|
+
isIframe,
|
|
16
|
+
isServer,
|
|
17
|
+
isSyncEnabled,
|
|
18
|
+
localessEditable,
|
|
19
|
+
localessEditableField,
|
|
20
|
+
localessInit,
|
|
21
|
+
registerComponent,
|
|
22
|
+
renderRichTextToReact,
|
|
23
|
+
resolveAsset,
|
|
24
|
+
unregisterComponent
|
|
25
|
+
} from "./chunk-ETSLIILF.mjs";
|
|
26
|
+
export {
|
|
27
|
+
LocalessComponent,
|
|
28
|
+
LocalessServerComponent,
|
|
29
|
+
LocalessServerDocument,
|
|
30
|
+
findLink,
|
|
31
|
+
getComponent,
|
|
32
|
+
getFallbackComponent,
|
|
33
|
+
getLocalessClient,
|
|
34
|
+
isBrowser,
|
|
35
|
+
isIframe,
|
|
36
|
+
isServer,
|
|
37
|
+
isSyncEnabled,
|
|
38
|
+
localessEditable,
|
|
39
|
+
localessEditableField,
|
|
40
|
+
localessInit,
|
|
41
|
+
registerComponent,
|
|
42
|
+
renderRichTextToReact,
|
|
43
|
+
resolveAsset,
|
|
44
|
+
unregisterComponent,
|
|
45
|
+
useLocaless
|
|
46
|
+
};
|
package/dist/ssr.d.mts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
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-XH7pH80J.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ContentData, Links, References, Content } from '@localess/client';
|
|
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
|
+
|
|
6
|
+
type LocalessServerComponentProps<T extends ContentData = ContentData> = {
|
|
7
|
+
data: T;
|
|
8
|
+
links?: Links;
|
|
9
|
+
references?: References;
|
|
10
|
+
};
|
|
11
|
+
declare const LocalessServerComponent: React.ForwardRefExoticComponent<LocalessServerComponentProps<ContentData> & React.RefAttributes<HTMLElement>>;
|
|
12
|
+
|
|
13
|
+
type LocalessServerDocumentProps<T extends ContentData = ContentData> = {
|
|
14
|
+
document: Content<T>;
|
|
15
|
+
};
|
|
16
|
+
declare const LocalessServerDocument: React.ForwardRefExoticComponent<LocalessServerDocumentProps<ContentData> & React.RefAttributes<HTMLElement>>;
|
|
17
|
+
|
|
18
|
+
export { LocalessServerComponent, type LocalessServerComponentProps, LocalessServerDocument, type LocalessServerDocumentProps };
|
package/dist/ssr.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
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-XH7pH80J.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ContentData, Links, References, Content } from '@localess/client';
|
|
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
|
+
|
|
6
|
+
type LocalessServerComponentProps<T extends ContentData = ContentData> = {
|
|
7
|
+
data: T;
|
|
8
|
+
links?: Links;
|
|
9
|
+
references?: References;
|
|
10
|
+
};
|
|
11
|
+
declare const LocalessServerComponent: React.ForwardRefExoticComponent<LocalessServerComponentProps<ContentData> & React.RefAttributes<HTMLElement>>;
|
|
12
|
+
|
|
13
|
+
type LocalessServerDocumentProps<T extends ContentData = ContentData> = {
|
|
14
|
+
document: Content<T>;
|
|
15
|
+
};
|
|
16
|
+
declare const LocalessServerDocument: React.ForwardRefExoticComponent<LocalessServerDocumentProps<ContentData> & React.RefAttributes<HTMLElement>>;
|
|
17
|
+
|
|
18
|
+
export { LocalessServerComponent, type LocalessServerComponentProps, LocalessServerDocument, type LocalessServerDocumentProps };
|