@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 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, isBrowser } from "@localess/react";
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() && isBrowser() && window.localess) {
257
- window.localess.on(['input', 'change'], (event) => {
258
- if (event.type === 'input' || event.type === 'change') {
259
- setPageData(event.data);
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, isBrowser } from "@localess/react";
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() && isBrowser() && window.localess) {
375
- window.localess.on(['input', 'change'], (event) => {
376
- if (event.type === 'input' || event.type === 'change') {
377
- setPageData(event.data);
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 to `localessInit` **and** the page
25
- * is running inside the Visual Editor iframe (`isIframe()` is true).
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"),a=require("@localess/client");var o=(0,r.forwardRef)(({document:o},s)=>{let[c,l]=(0,r.useState)(o.data);return(0,r.useEffect)(()=>{t.isSyncEnabled()&&(0,a.isBrowser)()&&(0,a.isIframe)()&&window.localess?.on([`input`,`change`],e=>{(e.type===`change`||e.type===`input`)&&l(e.data)})},[]),c?(0,i.jsx)(n.LocalessComponent,{ref:s,data:c,assets:o.assets,links:o.links,references:o.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=o;
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 { isBrowser as r, isIframe as i } from "../utils/index.mjs";
4
- import { LocalessComponent as a } from "./localess-component.mjs";
5
- import { forwardRef as o, useEffect as s, useState as c } from "react";
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 d = o(({ document: o }, d) => {
9
- let [f, p] = c(o.data);
10
- return s(() => {
11
- n() && r() && i() && window.localess?.on(["input", "change"], (e) => {
12
- (e.type === "change" || e.type === "input") && p(e.data);
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
- }, []), f ? /* @__PURE__ */ l(a, {
15
- ref: d,
16
- data: f,
17
- assets: o.assets,
18
- links: o.links,
19
- references: o.references
20
- }) : (console.error("LocalessDocument property %cdocument.data%c is not provided.", e, t), /* @__PURE__ */ u("div", { children: [
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__ */ l("b", { children: "document.data" }),
23
+ /* @__PURE__ */ c("b", { children: "document.data" }),
23
24
  " is not provided."
24
25
  ] }));
25
26
  });
26
27
  //#endregion
27
- export { d as LocalessDocument };
28
+ export { u as LocalessDocument };
@@ -1 +1 @@
1
- const e=require("../state.js");let t=require("react"),n=require("@localess/client");var r=(r,i={})=>{let[a,o]=(0,t.useState)(),s=e.getLocalessClient(),c;return c=Array.isArray(r)?r.join(`/`):r,(0,t.useEffect)(()=>{async function t(){let t=await s.getContentBySlug(c,i);o(t),e.isSyncEnabled()&&(0,n.isBrowser)()&&(0,n.isIframe)()&&window.localess?.on([`input`,`change`],e=>{(e.type===`change`||e.type===`input`)&&o({...t,data:e.data})})}t()},[r,i,s]),a};exports.useLocaless=r;
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 { isBrowser as n, isIframe as r } from "../utils/index.mjs";
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 o = (o, s = {}) => {
6
- let [c, l] = a(), u = e(), d;
7
- return d = Array.isArray(o) ? o.join("/") : o, i(() => {
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 u.getContentBySlug(d, s);
10
- l(e), t() && n() && r() && window.localess?.on(["input", "change"], (t) => {
11
- (t.type === "change" || t.type === "input") && l({
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
- s,
21
- u
22
- ]), c;
20
+ l
21
+ ]), s;
23
22
  };
24
23
  //#endregion
25
- export { o as useLocaless };
24
+ export { a as useLocaless };
@@ -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 was enabled via `enableSync: true` in `localessInit`.
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.
@@ -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 c(e){let{components:c,fallbackComponent:l,enableSync:u,...d}=e;return r=(0,t.localessClient)(d),n=d.origin,s=`${e.origin}/api/v1/spaces/${e.spaceId}/assets/`,i=c||{},a=l,u&&(o=!0,(0,t.loadLocalessSync)(d.origin)),r}function l(){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 u(e,t){i[e]=t}function d(e){delete i[e]}function f(e){i=e}function p(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 m(e){a=e}function h(){return a}function g(){return o}function _(){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 v(e,n){let r=`${s}${e.uri}`,i=(0,t.buildAssetQueryString)(n);return i?`${r}?${i}`:r}exports.getComponent=p,exports.getFallbackComponent=h,exports.getLocalessClient=l,exports.getOrigin=_,exports.isSyncEnabled=g,exports.localessInit=c,exports.registerComponent=u,exports.resolveAsset=v,exports.setComponents=f,exports.setFallbackComponent=m,exports.unregisterComponent=d;
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;
@@ -1,44 +1,49 @@
1
1
  import { FONT_BOLD as e, FONT_NORMAL as t } from "../console.mjs";
2
- import { buildAssetQueryString as n, loadLocalessSync as r, localessClient as i } from "@localess/client";
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 a = void 0, o = void 0, s = {}, c = void 0, l = !1, u = "";
5
- function d(e) {
6
- let { components: t, fallbackComponent: n, enableSync: d, ...f } = e;
7
- return o = i(f), a = f.origin, u = `${e.origin}/api/v1/spaces/${e.spaceId}/assets/`, s = t || {}, c = n, d && (l = !0, r(f.origin)), o;
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 f() {
10
- if (!o) throw console.error("[Localess] No client found. Please check if the Localess is initialized. Use localessInit function."), Error("[Localess] No client found.");
11
- return o;
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 p(e, t) {
14
- s[e] = t;
15
+ function g(e, t) {
16
+ l[e] = t;
15
17
  }
16
- function m(e) {
17
- delete s[e];
18
+ function _(e) {
19
+ delete l[e];
18
20
  }
19
- function h(e) {
20
- s = e;
21
+ function v(e) {
22
+ l = e;
21
23
  }
22
- function g(n) {
23
- if (Object.hasOwn(s, n)) return s[n];
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 _(e) {
27
- c = e;
28
+ function b(e) {
29
+ u = e;
28
30
  }
29
- function v() {
30
- return c;
31
+ function x() {
32
+ return u;
33
+ }
34
+ function S() {
35
+ return d && r() && i();
31
36
  }
32
- function y() {
33
- return l;
37
+ function C() {
38
+ return f ?? Promise.resolve();
34
39
  }
35
- function b() {
36
- if (!a) throw console.error("[Localess] No origin found. Please check if the Localess is initialized. Use localessInit function."), Error("[Localess] No origin found.");
37
- return a;
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 x(e, t) {
40
- let r = `${u}${e.uri}`, i = n(t);
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 { g as getComponent, v as getFallbackComponent, f as getLocalessClient, b as getOrigin, y as isSyncEnabled, d as localessInit, p as registerComponent, x as resolveAsset, h as setComponents, _ as setFallbackComponent, m as unregisterComponent };
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, registerComponent as o, resolveAsset as s, setComponents as c, setFallbackComponent as l, unregisterComponent as u } from "./core/state.mjs";
2
- import { findLink as d } from "./core/utils/link.util.mjs";
3
- import { isBrowser as f, isIframe as p, isServer as m, localessEditable as h, localessEditableField as g } from "./core/utils/index.mjs";
4
- import { LocalessComponent as _ } from "./core/components/localess-component.mjs";
5
- import { LocalessDocument as v } from "./core/components/localess-document.mjs";
6
- import { useLocaless as y } from "./core/hooks/use-localess.mjs";
7
- import { renderRichTextToReact as b } from "./core/richtext.mjs";
8
- export { _ as LocalessComponent, v as LocalessDocument, d as findLink, e as getComponent, t as getFallbackComponent, n as getLocalessClient, r as getOrigin, f as isBrowser, p as isIframe, m as isServer, i as isSyncEnabled, h as localessEditable, g as localessEditableField, a as localessInit, o as registerComponent, b as renderRichTextToReact, s as resolveAsset, c as setComponents, l as setFallbackComponent, u as unregisterComponent, y as useLocaless };
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 };
@@ -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;
@@ -1,9 +1,9 @@
1
- import { getComponent as e, getFallbackComponent as t, getLocalessClient as n, isSyncEnabled as r, localessInit as i, registerComponent as a, resolveAsset as o, unregisterComponent as s } from "../core/state.mjs";
2
- import { findLink as c } from "../core/utils/link.util.mjs";
3
- import { isBrowser as l, isIframe as u, isServer as d, localessEditable as f, localessEditableField as p } from "../core/utils/index.mjs";
4
- import { LocalessComponent as m } from "../core/components/localess-component.mjs";
5
- import { renderRichTextToReact as h } from "../core/richtext.mjs";
6
- import { LocalessServerComponent as g } from "../ssr/localess-component.mjs";
7
- import { LocalessServerDocument as _ } from "../ssr/localess-document.mjs";
8
- import { LocalessDocument as v } from "./localess-document.mjs";
9
- export { m as LocalessComponent, v as LocalessDocument, g as LocalessServerComponent, _ as LocalessServerDocument, c as findLink, e as getComponent, t as getFallbackComponent, n as getLocalessClient, l as isBrowser, u as isIframe, d as isServer, r as isSyncEnabled, f as localessEditable, p as localessEditableField, i as localessInit, a as registerComponent, h as renderRichTextToReact, o as resolveAsset, s as unregisterComponent };
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.2.4-dev.20260611210209",
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.2.4-dev.20260611210209",
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",