@levo-so/site-runtime 0.3.9 → 0.3.11

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.
@@ -0,0 +1,20 @@
1
+ import { n as e } from "./ThemeProvider-DutrjSTF.js";
2
+ import { t } from "./theme.cssm-DUzmx76l.js";
3
+ import { t as n } from "./rteTheme.cssm-W4gTOijw.js";
4
+ import { c as r } from "react/compiler-runtime";
5
+ import i from "clsx";
6
+ import { jsx as a } from "react/jsx-runtime";
7
+ //#region ../../libraries/editor-core/dist/theme/RteThemeProvider.js
8
+ var o = (o) => {
9
+ let s = r(7), { children: c, theme: l } = o, u = l?.className, d;
10
+ s[0] === u ? d = s[1] : (d = i(t, n, u), s[0] = u, s[1] = d);
11
+ let f = l?.style, p = l?.portalToThemeRoot, m;
12
+ return s[2] !== c || s[3] !== d || s[4] !== f || s[5] !== p ? (m = /* @__PURE__ */ a(e, {
13
+ className: d,
14
+ style: f,
15
+ portalToThemeRoot: p,
16
+ children: c
17
+ }), s[2] = c, s[3] = d, s[4] = f, s[5] = p, s[6] = m) : m = s[6], m;
18
+ };
19
+ //#endregion
20
+ export { o as t };
@@ -1,31 +1,23 @@
1
- import { t as e } from "./createThemeExtension-4AUn51iJ.js";
2
- import { Extension as t, findParentNodeClosestToPos as n } from "@tiptap/core";
3
- import { NodeSelection as r } from "@tiptap/pm/state";
4
- import { CellSelection as i, cellAround as a } from "@tiptap/pm/tables";
5
- //#region ../../libraries/editor-core/dist/styles/content.cssm.js
6
- var o = "_12oclrg0", s = e({
7
- baseSpacing: "var(--_1q6hy0o0)",
8
- highlight: "var(--_1q6hy0o1)",
9
- highlightForeground: "var(--_1q6hy0o2)"
10
- });
11
- //#endregion
1
+ import { Extension as e, findParentNodeClosestToPos as t } from "@tiptap/core";
2
+ import { NodeSelection as n } from "@tiptap/pm/state";
3
+ import { CellSelection as r, cellAround as i } from "@tiptap/pm/tables";
12
4
  //#region ../../libraries/editor-core/dist/utils/getSelectedNodeOfType.js
13
- function c(e, t) {
14
- let o = [], s = new Set(t);
15
- if (e instanceof i) return e.forEachCell((e, t) => {
5
+ function a(e, a) {
6
+ let o = [], s = new Set(a);
7
+ if (e instanceof r) return e.forEachCell((e, t) => {
16
8
  s.has(e.type.name) && o.push({
17
9
  node: e,
18
10
  pos: t
19
11
  });
20
12
  }), o;
21
- if (e instanceof r) {
13
+ if (e instanceof n) {
22
14
  let { node: t, from: n } = e;
23
15
  return t && s.has(t.type.name) && o.push({
24
16
  node: t,
25
17
  pos: n
26
18
  }), o;
27
19
  }
28
- let { $anchor: c } = e, l = a(c);
20
+ let { $anchor: c } = e, l = i(c);
29
21
  if (l) {
30
22
  let t = e.$anchor.doc.nodeAt(l.pos);
31
23
  if (t && s.has(t.type.name)) return o.push({
@@ -33,7 +25,7 @@ function c(e, t) {
33
25
  pos: l.pos
34
26
  }), o;
35
27
  }
36
- let u = n(c, (e) => s.has(e.type.name));
28
+ let u = t(c, (e) => s.has(e.type.name));
37
29
  return u && o.push({
38
30
  node: u.node,
39
31
  pos: u.pos
@@ -41,7 +33,7 @@ function c(e, t) {
41
33
  }
42
34
  //#endregion
43
35
  //#region ../../libraries/editor-core/dist/utils/updateNodesAttr.js
44
- function l(e, t, n, r) {
36
+ function o(e, t, n, r) {
45
37
  if (!t.length) return !1;
46
38
  let i = !1;
47
39
  for (let { pos: a } of t) {
@@ -56,12 +48,12 @@ function l(e, t, n, r) {
56
48
  }
57
49
  //#endregion
58
50
  //#region ../../libraries/editor-core/dist/extensions/nodeStyling/nodeAlignment.js
59
- function u(e, t, n) {
51
+ function s(e, t, n) {
60
52
  if (e.length === 0) return null;
61
53
  for (let r of e) if ((r.node.attrs?.[t] ?? null) !== n) return n;
62
54
  return null;
63
55
  }
64
- var d = t.create({
56
+ var c = e.create({
65
57
  name: "textAlign",
66
58
  addOptions() {
67
59
  return {
@@ -122,28 +114,28 @@ var d = t.create({
122
114
  },
123
115
  addCommands() {
124
116
  let e = (e, t) => (n) => ({ state: r, tr: i }) => {
125
- let a = c(r.selection, this.options.types);
126
- return a.length === 0 ? !1 : l(i, a, e, t(a, n));
117
+ let s = a(r.selection, this.options.types);
118
+ return s.length === 0 ? !1 : o(i, s, e, t(s, n));
127
119
  };
128
120
  return {
129
121
  setNodeTextAlign: e("textAlign", (e, t) => !t || !this.options.textAlignValues.includes(t) ? null : t),
130
122
  unsetNodeTextAlign: e("textAlign", () => null),
131
- toggleNodeTextAlign: e("textAlign", (e, t) => !t || !this.options.textAlignValues.includes(t) ? null : u(e, "textAlign", t)),
123
+ toggleNodeTextAlign: e("textAlign", (e, t) => !t || !this.options.textAlignValues.includes(t) ? null : s(e, "textAlign", t)),
132
124
  setNodeVAlign: e("nodeVerticalAlign", (e, t) => !t || !this.options.verticalAlignValues.includes(t) ? null : t),
133
125
  unsetNodeVAlign: e("nodeVerticalAlign", () => null),
134
- toggleNodeVAlign: e("nodeVerticalAlign", (e, t) => !t || !this.options.verticalAlignValues.includes(t) ? null : u(e, "nodeVerticalAlign", t)),
126
+ toggleNodeVAlign: e("nodeVerticalAlign", (e, t) => !t || !this.options.verticalAlignValues.includes(t) ? null : s(e, "nodeVerticalAlign", t)),
135
127
  setNodeAlignment: (e, t) => ({ state: n, tr: r }) => {
136
- let i = c(n.selection, this.options.types);
128
+ let i = a(n.selection, this.options.types);
137
129
  if (i.length === 0) return !1;
138
- let a = !1;
139
- for (let { node: n, pos: o } of i) {
130
+ let o = !1;
131
+ for (let { node: n, pos: a } of i) {
140
132
  let i = { ...n.attrs };
141
- e && this.options.textAlignValues.includes(e) && (i.textAlign = e, a = !0), t && this.options.verticalAlignValues.includes(t) && (i.nodeVerticalAlign = t, a = !0), a && r.setNodeMarkup(o, void 0, i);
133
+ e && this.options.textAlignValues.includes(e) && (i.textAlign = e, o = !0), t && this.options.verticalAlignValues.includes(t) && (i.nodeVerticalAlign = t, o = !0), o && r.setNodeMarkup(a, void 0, i);
142
134
  }
143
- return a;
135
+ return o;
144
136
  },
145
137
  unsetNodeAlignment: () => ({ state: e, tr: t }) => {
146
- let n = c(e.selection, this.options.types);
138
+ let n = a(e.selection, this.options.types);
147
139
  if (n.length === 0) return !1;
148
140
  let r = !1;
149
141
  for (let { node: e, pos: i } of n) {
@@ -161,6 +153,6 @@ var d = t.create({
161
153
  }
162
154
  };
163
155
  }
164
- });
156
+ }), l = "_12oclrg0";
165
157
  //#endregion
166
- export { s as n, o as r, d as t };
158
+ export { a as i, c as n, o as r, l as t };
@@ -1988,7 +1988,7 @@ var Tr = "_156u72w0", Er = "_156u72w1", Dr = (e) => Array.isArray(e) && e.every(
1988
1988
  leftIcon: n,
1989
1989
  ...e
1990
1990
  }), t[1] = e, t[2] = r), r;
1991
- }, Ar = re(() => import("./DateTimeWidget-LfaosVVW.js")), jr = re(() => import("./PhoneWidget-D-CcDuie.js")), Mr = re(() => import("./RichTextWidget-BFWVevY7.js")), Nr = {
1991
+ }, Ar = re(() => import("./DateTimeWidget-U3lD0q1q.js")), jr = re(() => import("./PhoneWidget-DQQa4bL6.js")), Mr = re(() => import("./RichTextWidget-DfakML79.js")), Nr = {
1992
1992
  TextWidget: $((e) => /* @__PURE__ */ q(Yn, { ...e })),
1993
1993
  NumberWidget: $((e) => /* @__PURE__ */ q(Yn, {
1994
1994
  type: "number",
@@ -3660,4 +3660,4 @@ var Ma = ({ hiddenFields: e, fetchedSchema: t, isLoading: n, enableVerification:
3660
3660
  }) : null;
3661
3661
  }, Na = /* @__PURE__ */ e({ CollectionFormBuilder: () => Aa });
3662
3662
  //#endregion
3663
- export { Ma as n, Zr as r, Na as t };
3663
+ export { Zr as i, Ma as n, Aa as r, Na as t };
@@ -14,7 +14,7 @@ var v = /* @__PURE__ */ e({
14
14
  }), y = async (e, t) => {
15
15
  let n = {};
16
16
  return t?.site_id && (n.site_id = t.site_id), t?.locale && (n.locale = t.locale), t?.country && (n.country = t.country), (await e.url("/v1/studio/popup/list-active").query(n).get().json())?.content?.data ?? [];
17
- }, b = p(() => import("./PopupRenderer-D66Gx63H-C6RnOnl2.js").then((e) => e.t).then((e) => ({ default: e.PopupRenderer }))), x = (e) => {
17
+ }, b = p(() => import("./PopupRenderer-D66Gx63H-BnOmWsyj.js").then((e) => e.t).then((e) => ({ default: e.PopupRenderer }))), x = (e) => {
18
18
  let n = u(9), { siteId: r, pageId: i } = e, { fetch: a, logger: s } = t(), [c, l] = g(null), p = h(!1), v, x;
19
19
  if (n[0] !== a || n[1] !== s || n[2] !== r ? (v = () => {
20
20
  if (p.current) return;
package/index.d.ts CHANGED
@@ -830,10 +830,10 @@ export declare interface ILevoProfileFormProps {
830
830
  className?: string;
831
831
  }
832
832
 
833
- /** A single-record binding — one collection record / blog post / event by `slug` (a detail page). */
833
+ /** A single-record binding — one record of `module` by `slug` (a detail page). */
834
834
  export declare interface ILevoRecordConfig {
835
- module: "collection" | "blog" | "event";
836
- /** Collection key / blog key / event series id. Round-tripped; the event single endpoint is flat (slug only). */
835
+ module: ILevoSourceModule;
836
+ /** What the module's `identifier` names — see {@link ILevoSourceModule}. Round-tripped; the event single endpoint is flat (slug only). */
837
837
  identifier: string;
838
838
  /**
839
839
  * Reserved for field projection. The slug endpoints return the whole record today, so
@@ -868,11 +868,10 @@ export declare interface ILevoSiteConfig {
868
868
  appMode?: string;
869
869
  }
870
870
 
871
- /** A list binding — collection records, blog posts, or events matching `query`. */
871
+ /** A list binding — the records of one module matching `query`. */
872
872
  export declare interface ILevoSourceConfig {
873
- /** "collection" | "blog" | "event". Community has no core client module yet. */
874
- module: "collection" | "blog" | "event";
875
- /** Collection key / blog key / event series id. */
873
+ module: ILevoSourceModule;
874
+ /** What the module's `identifier` names — see {@link ILevoSourceModule}. */
876
875
  identifier: string;
877
876
  /** where / sort / limit / page / search. `limit: -1` = all. */
878
877
  query?: LevoQuery.FindQuery;
@@ -894,6 +893,23 @@ export declare type ILevoSourceDef = (ILevoSourceConfig & {
894
893
  mode: "form";
895
894
  });
896
895
 
896
+ /**
897
+ * Every content module a page can bind to, and what `identifier` names for each:
898
+ *
899
+ * collection the collection key → records of that collection
900
+ * blog the blog key → posts of that blog
901
+ * event the event series id → events in that series
902
+ * community the forum key → posts in that forum
903
+ * blog_category the parent BLOG's key → categories of that blog
904
+ * blog_tag the parent BLOG's key → tags of that blog
905
+ * blog_author the parent BLOG's key → authors writing on that blog
906
+ *
907
+ * The three blog children name their PARENT, not themselves: a category page lists the
908
+ * categories of ONE blog, and the platform reads a v3 binding exactly that way when it
909
+ * enumerates a dynamic page's URLs (`services/builder/src/services/sitemap_sources.ts`).
910
+ */
911
+ export declare type ILevoSourceModule = "blog" | "blog_author" | "blog_category" | "blog_tag" | "collection" | "community" | "event";
912
+
897
913
  export declare interface ILevoSourceResult<T = Record<string, unknown>> {
898
914
  /** null until loaded, on error, and on an unwired site. */
899
915
  data: T[] | null;
@@ -1950,8 +1966,11 @@ export declare const useLevoRecord: <T = Record<string, unknown>>(config: ILevoR
1950
1966
  export declare const useLevoSite: () => ILevoClient | null;
1951
1967
 
1952
1968
  /**
1953
- * Render a LIST of platform content. The config is a static literal (the editor rewrites
1954
- * it). Reads the router QueryClient: if the route loader prefetched this binding, the first
1969
+ * Render a LIST of platform content. The config is normally a static `dataSources` entry
1970
+ * (the editor rewrites it); a page whose filter depends on another binding's loaded record
1971
+ * spreads that entry and overrides `query` at the call — see the builder prompt.
1972
+ *
1973
+ * Reads the router QueryClient: if the route loader prefetched this binding, the first
1955
1974
  * render has data (SSR ships it); otherwise it fetches client-side. Always render a loading
1956
1975
  * and an empty state — `data` is null before the first load and on unwired sites.
1957
1976
  */