@localess/react 3.2.4-dev.20260611210209 → 3.3.0-dev.20260708093226
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/SKILL.md +16 -12
- package/dist/core/components/localess-document.d.ts +3 -2
- package/dist/core/components/localess-document.js +1 -1
- package/dist/core/components/localess-document.mjs +20 -19
- package/dist/core/hooks/use-localess.js +1 -1
- package/dist/core/hooks/use-localess.mjs +13 -14
- package/dist/core/state.d.ts +30 -2
- package/dist/core/state.js +1 -1
- package/dist/core/state.mjs +33 -28
- package/dist/index.js +1 -1
- package/dist/index.mjs +8 -8
- package/dist/rsc/index.d.ts +1 -1
- package/dist/rsc/index.js +1 -1
- package/dist/rsc/index.mjs +9 -9
- package/package.json +2 -2
package/SKILL.md
CHANGED
|
@@ -246,18 +246,20 @@ If you manage content state yourself without `useLocaless` or `LocalessDocument`
|
|
|
246
246
|
'use client';
|
|
247
247
|
|
|
248
248
|
import { useEffect, useState } from "react";
|
|
249
|
-
import { LocalessComponent, localessEditable, isSyncEnabled,
|
|
249
|
+
import { LocalessComponent, localessEditable, isSyncEnabled, localessSyncReady } from "@localess/react";
|
|
250
250
|
import type { Content, Page } from "./.localess/localess";
|
|
251
251
|
|
|
252
252
|
export function PageClient({ initialContent }: { initialContent: Content<Page> }) {
|
|
253
253
|
const [pageData, setPageData] = useState(initialContent.data);
|
|
254
254
|
|
|
255
255
|
useEffect(() => {
|
|
256
|
-
if (isSyncEnabled()
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
256
|
+
if (isSyncEnabled()) {
|
|
257
|
+
localessSyncReady().then(() => {
|
|
258
|
+
window.localess?.on(['input', 'change'], (event) => {
|
|
259
|
+
if (event.type === 'input' || event.type === 'change') {
|
|
260
|
+
setPageData(event.data);
|
|
261
|
+
}
|
|
262
|
+
});
|
|
261
263
|
});
|
|
262
264
|
}
|
|
263
265
|
// No cleanup needed: window.localess has no .off() method
|
|
@@ -363,7 +365,7 @@ export default async function HomePage({ params }: { params: Promise<{ locale?:
|
|
|
363
365
|
'use client';
|
|
364
366
|
|
|
365
367
|
import { useEffect, useState } from "react";
|
|
366
|
-
import { LocalessComponent, localessEditable, isSyncEnabled,
|
|
368
|
+
import { LocalessComponent, localessEditable, isSyncEnabled, localessSyncReady } from "@localess/react";
|
|
367
369
|
import type { Content, Page } from "./.localess/localess";
|
|
368
370
|
|
|
369
371
|
export function PageClient({ initialContent }: { initialContent: Content<Page> }) {
|
|
@@ -371,11 +373,13 @@ export function PageClient({ initialContent }: { initialContent: Content<Page> }
|
|
|
371
373
|
const [pageData, setPageData] = useState(initialContent.data);
|
|
372
374
|
|
|
373
375
|
useEffect(() => {
|
|
374
|
-
if (isSyncEnabled()
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
376
|
+
if (isSyncEnabled()) {
|
|
377
|
+
localessSyncReady().then(() => {
|
|
378
|
+
window.localess?.on(['input', 'change'], (event) => {
|
|
379
|
+
if (event.type === 'input' || event.type === 'change') {
|
|
380
|
+
setPageData(event.data);
|
|
381
|
+
}
|
|
382
|
+
});
|
|
379
383
|
});
|
|
380
384
|
}
|
|
381
385
|
// No cleanup needed: window.localess has no .off() method
|
|
@@ -21,8 +21,9 @@ export type LocalessDocumentProps<T extends ContentData = ContentData> = {
|
|
|
21
21
|
* as props. The page renders immediately with server data; once the client hydrates, live editing
|
|
22
22
|
* activates on top — no loading state needed.
|
|
23
23
|
*
|
|
24
|
-
* Sync only activates when `enableSync: true` was passed
|
|
25
|
-
* is running
|
|
24
|
+
* Sync only activates when {@link isSyncEnabled} returns `true` — `enableSync: true` was passed
|
|
25
|
+
* to `localessInit`, the code is running in the browser, and the page is inside the Visual Editor
|
|
26
|
+
* iframe.
|
|
26
27
|
*
|
|
27
28
|
* **Requires `'use client'`** — must be used inside a Client Component boundary in Next.js
|
|
28
29
|
* App Router. Available from `@localess/react` (SPA) and `@localess/react/rsc` (RSC).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("../../console.js"),t=require("../state.js"),n=require("./localess-component.js");let r=require("react"),i=require("react/jsx-runtime")
|
|
1
|
+
const e=require("../../console.js"),t=require("../state.js"),n=require("./localess-component.js");let r=require("react"),i=require("react/jsx-runtime");var a=(0,r.forwardRef)(({document:a},o)=>{let[s,c]=(0,r.useState)(a.data);return(0,r.useEffect)(()=>{t.isSyncEnabled()&&t.localessSyncReady().then(()=>{window.localess?.on([`input`,`change`],e=>{(e.type===`change`||e.type===`input`)&&c(e.data)})})},[]),s?(0,i.jsx)(n.LocalessComponent,{ref:o,data:s,assets:a.assets,links:a.links,references:a.references}):(console.error(`LocalessDocument property %cdocument.data%c is not provided.`,e.FONT_BOLD,e.FONT_NORMAL),(0,i.jsxs)(`div`,{children:[`LocalessDocument property `,(0,i.jsx)(`b`,{children:`document.data`}),` is not provided.`]}))});exports.LocalessDocument=a;
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { FONT_BOLD as e, FONT_NORMAL as t } from "../../console.mjs";
|
|
2
|
-
import { isSyncEnabled as n } from "../state.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { isSyncEnabled as n, localessSyncReady as r } from "../state.mjs";
|
|
3
|
+
import { LocalessComponent as i } from "./localess-component.mjs";
|
|
4
|
+
import { forwardRef as a, useEffect as o, useState as s } from "react";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
6
|
//#region src/core/components/localess-document.tsx
|
|
8
|
-
var
|
|
9
|
-
let [
|
|
10
|
-
return
|
|
11
|
-
n() && r()
|
|
12
|
-
(
|
|
7
|
+
var u = a(({ document: a }, u) => {
|
|
8
|
+
let [d, f] = s(a.data);
|
|
9
|
+
return o(() => {
|
|
10
|
+
n() && r().then(() => {
|
|
11
|
+
window.localess?.on(["input", "change"], (e) => {
|
|
12
|
+
(e.type === "change" || e.type === "input") && f(e.data);
|
|
13
|
+
});
|
|
13
14
|
});
|
|
14
|
-
}, []),
|
|
15
|
-
ref:
|
|
16
|
-
data:
|
|
17
|
-
assets:
|
|
18
|
-
links:
|
|
19
|
-
references:
|
|
20
|
-
}) : (console.error("LocalessDocument property %cdocument.data%c is not provided.", e, t), /* @__PURE__ */
|
|
15
|
+
}, []), d ? /* @__PURE__ */ c(i, {
|
|
16
|
+
ref: u,
|
|
17
|
+
data: d,
|
|
18
|
+
assets: a.assets,
|
|
19
|
+
links: a.links,
|
|
20
|
+
references: a.references
|
|
21
|
+
}) : (console.error("LocalessDocument property %cdocument.data%c is not provided.", e, t), /* @__PURE__ */ l("div", { children: [
|
|
21
22
|
"LocalessDocument property ",
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */ c("b", { children: "document.data" }),
|
|
23
24
|
" is not provided."
|
|
24
25
|
] }));
|
|
25
26
|
});
|
|
26
27
|
//#endregion
|
|
27
|
-
export {
|
|
28
|
+
export { u as LocalessDocument };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("../state.js");let t=require("react")
|
|
1
|
+
const e=require("../state.js");let t=require("react");var n=(n,r={})=>{let[i,a]=(0,t.useState)(),o=e.getLocalessClient(),s;return s=Array.isArray(n)?n.join(`/`):n,(0,t.useEffect)(()=>{async function t(){let t=await o.getContentBySlug(s,r);a(t),e.isSyncEnabled()&&(await e.localessSyncReady(),window.localess?.on([`input`,`change`],e=>{(e.type===`change`||e.type===`input`)&&a({...t,data:e.data})}))}t()},[n,r,o]),i};exports.useLocaless=n;
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import { getLocalessClient as e, isSyncEnabled as t } from "../state.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { useEffect as i, useState as a } from "react";
|
|
1
|
+
import { getLocalessClient as e, isSyncEnabled as t, localessSyncReady as n } from "../state.mjs";
|
|
2
|
+
import { useEffect as r, useState as i } from "react";
|
|
4
3
|
//#region src/core/hooks/use-localess.ts
|
|
5
|
-
var
|
|
6
|
-
let [
|
|
7
|
-
return
|
|
4
|
+
var a = (a, o = {}) => {
|
|
5
|
+
let [s, c] = i(), l = e(), u;
|
|
6
|
+
return u = Array.isArray(a) ? a.join("/") : a, r(() => {
|
|
8
7
|
async function e() {
|
|
9
|
-
let e = await
|
|
10
|
-
|
|
11
|
-
(t.type === "change" || t.type === "input") &&
|
|
8
|
+
let e = await l.getContentBySlug(u, o);
|
|
9
|
+
c(e), t() && (await n(), window.localess?.on(["input", "change"], (t) => {
|
|
10
|
+
(t.type === "change" || t.type === "input") && c({
|
|
12
11
|
...e,
|
|
13
12
|
data: t.data
|
|
14
13
|
});
|
|
15
|
-
});
|
|
14
|
+
}));
|
|
16
15
|
}
|
|
17
16
|
e();
|
|
18
17
|
}, [
|
|
18
|
+
a,
|
|
19
19
|
o,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
]), c;
|
|
20
|
+
l
|
|
21
|
+
]), s;
|
|
23
22
|
};
|
|
24
23
|
//#endregion
|
|
25
|
-
export {
|
|
24
|
+
export { a as useLocaless };
|
package/dist/core/state.d.ts
CHANGED
|
@@ -101,14 +101,42 @@ export declare function setFallbackComponent(fallbackComponent: React.ElementTyp
|
|
|
101
101
|
*/
|
|
102
102
|
export declare function getFallbackComponent(): React.ElementType | undefined;
|
|
103
103
|
/**
|
|
104
|
-
* Returns `true` when Visual Editor sync
|
|
104
|
+
* Returns `true` when Visual Editor sync is enabled and actually usable in the current context:
|
|
105
|
+
* `enableSync: true` was passed to `localessInit`, code is running in the browser, and the page
|
|
106
|
+
* is loaded inside the Visual Editor iframe.
|
|
107
|
+
*
|
|
108
|
+
* Self-sufficient: callers don't need to separately check {@link isBrowser} or {@link isIframe}.
|
|
105
109
|
*
|
|
106
110
|
* Used internally by {@link LocalessComponent}, {@link LocalessDocument}, and {@link useLocaless}
|
|
107
111
|
* to decide whether to inject editable attributes and subscribe to sync events.
|
|
108
112
|
*
|
|
109
|
-
* @returns `true` if sync is enabled, `false` otherwise.
|
|
113
|
+
* @returns `true` if sync is enabled and usable, `false` otherwise.
|
|
110
114
|
*/
|
|
111
115
|
export declare function isSyncEnabled(): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Resolves once the Visual Editor sync script has loaded and `window.localess` is available.
|
|
118
|
+
*
|
|
119
|
+
* Resolves immediately if sync was not enabled via `localessInit`, or if the script has already
|
|
120
|
+
* loaded. Never rejects — a failed script load is logged via {@link loadLocalessSync} and resolves
|
|
121
|
+
* anyway, since the rest of the app functions without live editing.
|
|
122
|
+
*
|
|
123
|
+
* Use this before subscribing to `window.localess.on(...)` to avoid a race where the listener is
|
|
124
|
+
* attached before the sync script has run.
|
|
125
|
+
*
|
|
126
|
+
* @returns A promise that resolves when sync is ready (or immediately, if not applicable).
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```tsx
|
|
130
|
+
* useEffect(() => {
|
|
131
|
+
* if (isSyncEnabled()) {
|
|
132
|
+
* localessSyncReady().then(() => {
|
|
133
|
+
* window.localess?.on(['input', 'change'], event => { ... });
|
|
134
|
+
* });
|
|
135
|
+
* }
|
|
136
|
+
* }, []);
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
export declare function localessSyncReady(): Promise<void>;
|
|
112
140
|
export declare function getOrigin(): string;
|
|
113
141
|
/**
|
|
114
142
|
* Resolves a {@link ContentAsset} to its full URL string.
|
package/dist/core/state.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("../console.js");let t=require("@localess/client");var n=void 0,r=void 0,i={},a=void 0,o=!1,s=``;function
|
|
1
|
+
const e=require("../console.js");let t=require("@localess/client");var n=void 0,r=void 0,i={},a=void 0,o=!1,s=void 0,c=``;function l(e){let{components:l,fallbackComponent:u,enableSync:d,...f}=e;return r=(0,t.localessClient)(f),n=f.origin,c=`${e.origin}/api/v1/spaces/${e.spaceId}/assets/`,i=l||{},a=u,d&&(o=!0,s=(0,t.loadLocalessSync)(f.origin).catch(e=>{console.error(`[Localess] Failed to load sync script.`,e)})),r}function u(){if(!r)throw console.error(`[Localess] No client found. Please check if the Localess is initialized. Use localessInit function.`),Error(`[Localess] No client found.`);return r}function d(e,t){i[e]=t}function f(e){delete i[e]}function p(e){i=e}function m(t){if(Object.hasOwn(i,t))return i[t];console.error(`[Localess] component %c${t}%c can't be found.`,e.FONT_BOLD,e.FONT_NORMAL)}function h(e){a=e}function g(){return a}function _(){return o&&(0,t.isBrowser)()&&(0,t.isIframe)()}function v(){return s??Promise.resolve()}function y(){if(!n)throw console.error(`[Localess] No origin found. Please check if the Localess is initialized. Use localessInit function.`),Error(`[Localess] No origin found.`);return n}function b(e,n){let r=`${c}${e.uri}`,i=(0,t.buildAssetQueryString)(n);return i?`${r}?${i}`:r}exports.getComponent=m,exports.getFallbackComponent=g,exports.getLocalessClient=u,exports.getOrigin=y,exports.isSyncEnabled=_,exports.localessInit=l,exports.localessSyncReady=v,exports.registerComponent=d,exports.resolveAsset=b,exports.setComponents=p,exports.setFallbackComponent=h,exports.unregisterComponent=f;
|
package/dist/core/state.mjs
CHANGED
|
@@ -1,44 +1,49 @@
|
|
|
1
1
|
import { FONT_BOLD as e, FONT_NORMAL as t } from "../console.mjs";
|
|
2
|
-
import { buildAssetQueryString as n,
|
|
2
|
+
import { buildAssetQueryString as n, isBrowser as r, isIframe as i, loadLocalessSync as a, localessClient as o } from "@localess/client";
|
|
3
3
|
//#region src/core/state.ts
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
let { components: t, fallbackComponent: n, enableSync:
|
|
7
|
-
return
|
|
4
|
+
var s = void 0, c = void 0, l = {}, u = void 0, d = !1, f = void 0, p = "";
|
|
5
|
+
function m(e) {
|
|
6
|
+
let { components: t, fallbackComponent: n, enableSync: r, ...i } = e;
|
|
7
|
+
return c = o(i), s = i.origin, p = `${e.origin}/api/v1/spaces/${e.spaceId}/assets/`, l = t || {}, u = n, r && (d = !0, f = a(i.origin).catch((e) => {
|
|
8
|
+
console.error("[Localess] Failed to load sync script.", e);
|
|
9
|
+
})), c;
|
|
8
10
|
}
|
|
9
|
-
function
|
|
10
|
-
if (!
|
|
11
|
-
return
|
|
11
|
+
function h() {
|
|
12
|
+
if (!c) throw console.error("[Localess] No client found. Please check if the Localess is initialized. Use localessInit function."), Error("[Localess] No client found.");
|
|
13
|
+
return c;
|
|
12
14
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
+
function g(e, t) {
|
|
16
|
+
l[e] = t;
|
|
15
17
|
}
|
|
16
|
-
function
|
|
17
|
-
delete
|
|
18
|
+
function _(e) {
|
|
19
|
+
delete l[e];
|
|
18
20
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
+
function v(e) {
|
|
22
|
+
l = e;
|
|
21
23
|
}
|
|
22
|
-
function
|
|
23
|
-
if (Object.hasOwn(
|
|
24
|
+
function y(n) {
|
|
25
|
+
if (Object.hasOwn(l, n)) return l[n];
|
|
24
26
|
console.error(`[Localess] component %c${n}%c can't be found.`, e, t);
|
|
25
27
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
+
function b(e) {
|
|
29
|
+
u = e;
|
|
28
30
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
31
|
+
function x() {
|
|
32
|
+
return u;
|
|
33
|
+
}
|
|
34
|
+
function S() {
|
|
35
|
+
return d && r() && i();
|
|
31
36
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
37
|
+
function C() {
|
|
38
|
+
return f ?? Promise.resolve();
|
|
34
39
|
}
|
|
35
|
-
function
|
|
36
|
-
if (!
|
|
37
|
-
return
|
|
40
|
+
function w() {
|
|
41
|
+
if (!s) throw console.error("[Localess] No origin found. Please check if the Localess is initialized. Use localessInit function."), Error("[Localess] No origin found.");
|
|
42
|
+
return s;
|
|
38
43
|
}
|
|
39
|
-
function
|
|
40
|
-
let r = `${
|
|
44
|
+
function T(e, t) {
|
|
45
|
+
let r = `${p}${e.uri}`, i = n(t);
|
|
41
46
|
return i ? `${r}?${i}` : r;
|
|
42
47
|
}
|
|
43
48
|
//#endregion
|
|
44
|
-
export {
|
|
49
|
+
export { y as getComponent, x as getFallbackComponent, h as getLocalessClient, w as getOrigin, S as isSyncEnabled, m as localessInit, C as localessSyncReady, g as registerComponent, T as resolveAsset, v as setComponents, b as setFallbackComponent, _ as unregisterComponent };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./core/state.js"),t=require("./core/utils/link.util.js"),n=require("./core/components/localess-component.js"),r=require("./core/components/localess-document.js"),i=require("./core/hooks/use-localess.js"),a=require("./core/richtext.js");let o=require("@localess/client");exports.LocalessComponent=n.LocalessComponent,exports.LocalessDocument=r.LocalessDocument,exports.findLink=t.findLink,exports.getComponent=e.getComponent,exports.getFallbackComponent=e.getFallbackComponent,exports.getLocalessClient=e.getLocalessClient,exports.getOrigin=e.getOrigin,Object.defineProperty(exports,"isBrowser",{enumerable:!0,get:function(){return o.isBrowser}}),Object.defineProperty(exports,"isIframe",{enumerable:!0,get:function(){return o.isIframe}}),Object.defineProperty(exports,"isServer",{enumerable:!0,get:function(){return o.isServer}}),exports.isSyncEnabled=e.isSyncEnabled,Object.defineProperty(exports,"localessEditable",{enumerable:!0,get:function(){return o.localessEditable}}),Object.defineProperty(exports,"localessEditableField",{enumerable:!0,get:function(){return o.localessEditableField}}),exports.localessInit=e.localessInit,exports.registerComponent=e.registerComponent,exports.renderRichTextToReact=a.renderRichTextToReact,exports.resolveAsset=e.resolveAsset,exports.setComponents=e.setComponents,exports.setFallbackComponent=e.setFallbackComponent,exports.unregisterComponent=e.unregisterComponent,exports.useLocaless=i.useLocaless;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./core/state.js"),t=require("./core/utils/link.util.js"),n=require("./core/components/localess-component.js"),r=require("./core/components/localess-document.js"),i=require("./core/hooks/use-localess.js"),a=require("./core/richtext.js");let o=require("@localess/client");exports.LocalessComponent=n.LocalessComponent,exports.LocalessDocument=r.LocalessDocument,exports.findLink=t.findLink,exports.getComponent=e.getComponent,exports.getFallbackComponent=e.getFallbackComponent,exports.getLocalessClient=e.getLocalessClient,exports.getOrigin=e.getOrigin,Object.defineProperty(exports,"isBrowser",{enumerable:!0,get:function(){return o.isBrowser}}),Object.defineProperty(exports,"isIframe",{enumerable:!0,get:function(){return o.isIframe}}),Object.defineProperty(exports,"isServer",{enumerable:!0,get:function(){return o.isServer}}),exports.isSyncEnabled=e.isSyncEnabled,Object.defineProperty(exports,"localessEditable",{enumerable:!0,get:function(){return o.localessEditable}}),Object.defineProperty(exports,"localessEditableField",{enumerable:!0,get:function(){return o.localessEditableField}}),exports.localessInit=e.localessInit,exports.localessSyncReady=e.localessSyncReady,exports.registerComponent=e.registerComponent,exports.renderRichTextToReact=a.renderRichTextToReact,exports.resolveAsset=e.resolveAsset,exports.setComponents=e.setComponents,exports.setFallbackComponent=e.setFallbackComponent,exports.unregisterComponent=e.unregisterComponent,exports.useLocaless=i.useLocaless;
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getComponent as e, getFallbackComponent as t, getLocalessClient as n, getOrigin as r, isSyncEnabled as i, localessInit as a,
|
|
2
|
-
import { findLink as
|
|
3
|
-
import { isBrowser as
|
|
4
|
-
import { LocalessComponent as
|
|
5
|
-
import { LocalessDocument as
|
|
6
|
-
import { useLocaless as
|
|
7
|
-
import { renderRichTextToReact as
|
|
8
|
-
export {
|
|
1
|
+
import { getComponent as e, getFallbackComponent as t, getLocalessClient as n, getOrigin as r, isSyncEnabled as i, localessInit as a, localessSyncReady as o, registerComponent as s, resolveAsset as c, setComponents as l, setFallbackComponent as u, unregisterComponent as d } from "./core/state.mjs";
|
|
2
|
+
import { findLink as f } from "./core/utils/link.util.mjs";
|
|
3
|
+
import { isBrowser as p, isIframe as m, isServer as h, localessEditable as g, localessEditableField as _ } from "./core/utils/index.mjs";
|
|
4
|
+
import { LocalessComponent as v } from "./core/components/localess-component.mjs";
|
|
5
|
+
import { LocalessDocument as y } from "./core/components/localess-document.mjs";
|
|
6
|
+
import { useLocaless as b } from "./core/hooks/use-localess.mjs";
|
|
7
|
+
import { renderRichTextToReact as x } from "./core/richtext.mjs";
|
|
8
|
+
export { v as LocalessComponent, y as LocalessDocument, f as findLink, e as getComponent, t as getFallbackComponent, n as getLocalessClient, r as getOrigin, p as isBrowser, m as isIframe, h as isServer, i as isSyncEnabled, g as localessEditable, _ as localessEditableField, a as localessInit, o as localessSyncReady, s as registerComponent, x as renderRichTextToReact, c as resolveAsset, l as setComponents, u as setFallbackComponent, d as unregisterComponent, b as useLocaless };
|
package/dist/rsc/index.d.ts
CHANGED
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
* NOT compatible with Next.js `output: 'export'` — use `@localess/react/ssr` for static exports.
|
|
26
26
|
*/
|
|
27
27
|
export * from '../core/components/localess-component';
|
|
28
|
-
export { isSyncEnabled } from '../core/state';
|
|
28
|
+
export { isSyncEnabled, localessSyncReady } from '../core/state';
|
|
29
29
|
export * from '../ssr';
|
|
30
30
|
export * from './localess-document';
|
package/dist/rsc/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../core/state.js"),t=require("../core/utils/link.util.js"),n=require("../core/components/localess-component.js"),r=require("../core/richtext.js"),i=require("../ssr/localess-component.js"),a=require("../ssr/localess-document.js"),o=require("./localess-document.js");let s=require("@localess/client");exports.LocalessComponent=n.LocalessComponent,exports.LocalessDocument=o.LocalessDocument,exports.LocalessServerComponent=i.LocalessServerComponent,exports.LocalessServerDocument=a.LocalessServerDocument,exports.findLink=t.findLink,exports.getComponent=e.getComponent,exports.getFallbackComponent=e.getFallbackComponent,exports.getLocalessClient=e.getLocalessClient,Object.defineProperty(exports,"isBrowser",{enumerable:!0,get:function(){return s.isBrowser}}),Object.defineProperty(exports,"isIframe",{enumerable:!0,get:function(){return s.isIframe}}),Object.defineProperty(exports,"isServer",{enumerable:!0,get:function(){return s.isServer}}),exports.isSyncEnabled=e.isSyncEnabled,Object.defineProperty(exports,"localessEditable",{enumerable:!0,get:function(){return s.localessEditable}}),Object.defineProperty(exports,"localessEditableField",{enumerable:!0,get:function(){return s.localessEditableField}}),exports.localessInit=e.localessInit,exports.registerComponent=e.registerComponent,exports.renderRichTextToReact=r.renderRichTextToReact,exports.resolveAsset=e.resolveAsset,exports.unregisterComponent=e.unregisterComponent;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../core/state.js"),t=require("../core/utils/link.util.js"),n=require("../core/components/localess-component.js"),r=require("../core/richtext.js"),i=require("../ssr/localess-component.js"),a=require("../ssr/localess-document.js"),o=require("./localess-document.js");let s=require("@localess/client");exports.LocalessComponent=n.LocalessComponent,exports.LocalessDocument=o.LocalessDocument,exports.LocalessServerComponent=i.LocalessServerComponent,exports.LocalessServerDocument=a.LocalessServerDocument,exports.findLink=t.findLink,exports.getComponent=e.getComponent,exports.getFallbackComponent=e.getFallbackComponent,exports.getLocalessClient=e.getLocalessClient,Object.defineProperty(exports,"isBrowser",{enumerable:!0,get:function(){return s.isBrowser}}),Object.defineProperty(exports,"isIframe",{enumerable:!0,get:function(){return s.isIframe}}),Object.defineProperty(exports,"isServer",{enumerable:!0,get:function(){return s.isServer}}),exports.isSyncEnabled=e.isSyncEnabled,Object.defineProperty(exports,"localessEditable",{enumerable:!0,get:function(){return s.localessEditable}}),Object.defineProperty(exports,"localessEditableField",{enumerable:!0,get:function(){return s.localessEditableField}}),exports.localessInit=e.localessInit,exports.localessSyncReady=e.localessSyncReady,exports.registerComponent=e.registerComponent,exports.renderRichTextToReact=r.renderRichTextToReact,exports.resolveAsset=e.resolveAsset,exports.unregisterComponent=e.unregisterComponent;
|
package/dist/rsc/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { getComponent as e, getFallbackComponent as t, getLocalessClient as n, isSyncEnabled as r, localessInit as i,
|
|
2
|
-
import { findLink as
|
|
3
|
-
import { isBrowser as
|
|
4
|
-
import { LocalessComponent as
|
|
5
|
-
import { renderRichTextToReact as
|
|
6
|
-
import { LocalessServerComponent as
|
|
7
|
-
import { LocalessServerDocument as
|
|
8
|
-
import { LocalessDocument as
|
|
9
|
-
export {
|
|
1
|
+
import { getComponent as e, getFallbackComponent as t, getLocalessClient as n, isSyncEnabled as r, localessInit as i, localessSyncReady as a, registerComponent as o, resolveAsset as s, unregisterComponent as c } from "../core/state.mjs";
|
|
2
|
+
import { findLink as l } from "../core/utils/link.util.mjs";
|
|
3
|
+
import { isBrowser as u, isIframe as d, isServer as f, localessEditable as p, localessEditableField as m } from "../core/utils/index.mjs";
|
|
4
|
+
import { LocalessComponent as h } from "../core/components/localess-component.mjs";
|
|
5
|
+
import { renderRichTextToReact as g } from "../core/richtext.mjs";
|
|
6
|
+
import { LocalessServerComponent as _ } from "../ssr/localess-component.mjs";
|
|
7
|
+
import { LocalessServerDocument as v } from "../ssr/localess-document.mjs";
|
|
8
|
+
import { LocalessDocument as y } from "./localess-document.mjs";
|
|
9
|
+
export { h as LocalessComponent, y as LocalessDocument, _ as LocalessServerComponent, v as LocalessServerDocument, l as findLink, e as getComponent, t as getFallbackComponent, n as getLocalessClient, u as isBrowser, d as isIframe, f as isServer, r as isSyncEnabled, p as localessEditable, m as localessEditableField, i as localessInit, a as localessSyncReady, o as registerComponent, g as renderRichTextToReact, s as resolveAsset, c as unregisterComponent };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@localess/react",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0-dev.20260708093226",
|
|
4
4
|
"description": "ReactJS JavaScript/TypeScript SDK for Localess's API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"localess",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"react-dom": "^17 || ^18 || ^19"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@localess/client": "3.
|
|
64
|
+
"@localess/client": "3.3.0-dev.20260708093226",
|
|
65
65
|
"@tiptap/extension-bold": "^3.22.5",
|
|
66
66
|
"@tiptap/extension-bullet-list": "^3.22.5",
|
|
67
67
|
"@tiptap/extension-code": "^3.22.5",
|