@olonjs/core 1.1.6 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -292,7 +292,7 @@ export declare namespace contract {
292
292
 
293
293
  export declare function createWebMcpSaveToolInputSchema(): Record<string, unknown>;
294
294
 
295
- export declare function createWebMcpToolInputSchema(): Record<string, unknown>;
295
+ export declare function createWebMcpToolInputSchema(catalog?: ReadonlyArray<WebMcpSectionCatalogEntry>): Record<string, unknown>;
296
296
 
297
297
  export declare const CtaSchema: z.ZodObject<{
298
298
  id: z.ZodOptional<z.ZodString>;
@@ -1076,6 +1076,11 @@ export declare interface WebMcpMutationArgs {
1076
1076
  value?: unknown;
1077
1077
  }
1078
1078
 
1079
+ declare type WebMcpSectionCatalogEntry = {
1080
+ id: string;
1081
+ type: string;
1082
+ };
1083
+
1079
1084
  declare interface WebMcpSectionInstance {
1080
1085
  id: string;
1081
1086
  type: string;
@@ -44,7 +44,7 @@ var ce = {};
44
44
  * LICENSE file in the root directory of this source tree.
45
45
  */
46
46
  var Ge;
47
- function Mt() {
47
+ function Lt() {
48
48
  return Ge || (Ge = 1, process.env.NODE_ENV !== "production" && (function() {
49
49
  function e(i) {
50
50
  if (i == null) return null;
@@ -60,7 +60,7 @@ function Mt() {
60
60
  return "StrictMode";
61
61
  case T:
62
62
  return "Suspense";
63
- case L:
63
+ case M:
64
64
  return "SuspenseList";
65
65
  case J:
66
66
  return "Activity";
@@ -239,7 +239,7 @@ React keys must be passed directly to JSX without using spread:
239
239
  function y(i) {
240
240
  return typeof i == "object" && i !== null && i.$$typeof === A;
241
241
  }
242
- var w = Tt, A = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), C = Symbol.for("react.fragment"), F = Symbol.for("react.strict_mode"), W = Symbol.for("react.profiler"), E = Symbol.for("react.consumer"), O = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), L = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), J = Symbol.for("react.activity"), Y = Symbol.for("react.client.reference"), V = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, X = Object.prototype.hasOwnProperty, Z = Array.isArray, D = console.createTask ? console.createTask : function() {
242
+ var w = Tt, A = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), C = Symbol.for("react.fragment"), F = Symbol.for("react.strict_mode"), W = Symbol.for("react.profiler"), E = Symbol.for("react.consumer"), O = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), M = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), J = Symbol.for("react.activity"), Y = Symbol.for("react.client.reference"), V = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, X = Object.prototype.hasOwnProperty, Z = Array.isArray, D = console.createTask ? console.createTask : function() {
243
243
  return null;
244
244
  };
245
245
  w = {
@@ -275,10 +275,10 @@ React keys must be passed directly to JSX without using spread:
275
275
  })()), ce;
276
276
  }
277
277
  var Ve;
278
- function Lt() {
279
- return Ve || (Ve = 1, process.env.NODE_ENV === "production" ? xe.exports = $t() : xe.exports = Mt()), xe.exports;
278
+ function Mt() {
279
+ return Ve || (Ve = 1, process.env.NODE_ENV === "production" ? xe.exports = $t() : xe.exports = Lt()), xe.exports;
280
280
  }
281
- var u = Lt();
281
+ var u = Mt();
282
282
  function fe(e) {
283
283
  return typeof e == "object" && e !== null;
284
284
  }
@@ -481,25 +481,29 @@ async function Ye(e) {
481
481
  throw new Error(`Unsupported URI scheme: ${e}`);
482
482
  }
483
483
  function qt() {
484
+ var r;
484
485
  if (typeof window > "u" || typeof navigator > "u") return;
485
- const e = Ht();
486
- if (!e) return;
487
- const t = navigator;
488
- t.modelContext || (t.modelContext = {}), t.modelContext.registerTool = (r) => {
489
- e.set(r.name, r);
490
- }, t.modelContext.unregisterTool = (r) => {
491
- e.delete(r);
492
- }, t.modelContext.readResource = async (r) => Ye(r), t.modelContextProtocol = {
493
- listTools: () => Array.from(e.values()).map(({ execute: r, ...o }) => o),
494
- executeTool: async (r, o) => {
495
- const n = e.get(r);
496
- if (!n)
497
- throw new Error(`WebMCP tool "${r}" is not registered.`);
498
- const s = o ? JSON.parse(o) : {}, a = await n.execute(s);
499
- return JSON.stringify(a);
486
+ const e = navigator;
487
+ if (typeof ((r = e.modelContext) == null ? void 0 : r.registerTool) == "function") return;
488
+ const t = Ht();
489
+ t && (e.modelContext || (e.modelContext = {}), e.modelContext.registerTool = (o, n) => {
490
+ var s;
491
+ t.set(o.name, o), (s = n == null ? void 0 : n.signal) == null || s.addEventListener("abort", () => {
492
+ t.get(o.name) === o && t.delete(o.name);
493
+ });
494
+ }, e.modelContext.unregisterTool = (o) => {
495
+ t.delete(o);
496
+ }, e.modelContext.readResource = async (o) => Ye(o), e.modelContextProtocol = {
497
+ listTools: () => Array.from(t.values()).map(({ execute: o, ...n }) => n),
498
+ executeTool: async (o, n) => {
499
+ const s = t.get(o);
500
+ if (!s)
501
+ throw new Error(`WebMCP tool "${o}" is not registered.`);
502
+ const a = n ? JSON.parse(n) : {}, c = await s.execute(a);
503
+ return JSON.stringify(c);
500
504
  },
501
- readResource: async (r) => JSON.stringify(await Ye(r))
502
- };
505
+ readResource: async (o) => JSON.stringify(await Ye(o))
506
+ });
503
507
  }
504
508
  function Xt(e) {
505
509
  return `/schemas/${e}.schema.json`;
@@ -722,7 +726,7 @@ function ar({ config: e, routesBuilder: t, adminCss: r = "" }) {
722
726
  tenantCss: C,
723
727
  adminCss: F,
724
728
  NotFoundComponent: w
725
- }, L = ze(() => {
729
+ }, M = ze(() => {
726
730
  const D = _t(t(T));
727
731
  return Ot(D, { basename: k });
728
732
  }, [
@@ -758,7 +762,7 @@ function ar({ config: e, routesBuilder: t, adminCss: r = "" }) {
758
762
  assets: e.assets,
759
763
  overlayDisabledSectionTypes: e.overlayDisabledSectionTypes
760
764
  },
761
- children: /* @__PURE__ */ u.jsx(Pt, { router: L })
765
+ children: /* @__PURE__ */ u.jsx(Pt, { router: M })
762
766
  }
763
767
  ) }) }) : /* @__PURE__ */ u.jsx(
764
768
  "div",
@@ -1117,13 +1121,13 @@ const vr = (e, t) => {
1117
1121
  parseClassName: Nr(e),
1118
1122
  sortModifiers: Ir(e),
1119
1123
  ...jr(e)
1120
- }), Mr = /\s+/, Lr = (e, t) => {
1124
+ }), Lr = /\s+/, Mr = (e, t) => {
1121
1125
  const {
1122
1126
  parseClassName: r,
1123
1127
  getClassGroupId: o,
1124
1128
  getConflictingClassGroupIds: n,
1125
1129
  sortModifiers: s
1126
- } = t, a = [], c = e.trim().split(Mr);
1130
+ } = t, a = [], c = e.trim().split(Lr);
1127
1131
  let l = "";
1128
1132
  for (let m = c.length - 1; m >= 0; m -= 1) {
1129
1133
  const b = c[m], {
@@ -1155,8 +1159,8 @@ const vr = (e, t) => {
1155
1159
  a.push(O);
1156
1160
  const k = n(F, C);
1157
1161
  for (let T = 0; T < k.length; ++T) {
1158
- const L = k[T];
1159
- a.push(E + L);
1162
+ const M = k[T];
1163
+ a.push(E + M);
1160
1164
  }
1161
1165
  l = b + (l.length > 0 ? " " + l : l);
1162
1166
  }
@@ -1182,11 +1186,11 @@ const vr = (e, t) => {
1182
1186
  const m = o(l);
1183
1187
  if (m)
1184
1188
  return m;
1185
- const b = Lr(l, r);
1189
+ const b = Mr(l, r);
1186
1190
  return n(l, b), b;
1187
1191
  };
1188
1192
  return s = a, (...l) => s(Dr(...l));
1189
- }, Wr = [], M = (e) => {
1193
+ }, Wr = [], L = (e) => {
1190
1194
  const t = (r) => r[e] || Wr;
1191
1195
  return t.isThemeGetter = !0, t;
1192
1196
  }, gt = /^\[(?:(\w[\w-]*):)?(.+)\]$/i, yt = /^\((?:(\w[\w-]*):)?(.+)\)$/i, Br = /^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/, Ur = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, Gr = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, Vr = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, Jr = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, Yr = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, K = (e) => Br.test(e), v = (e) => !!e && !Number.isNaN(Number(e)), Q = (e) => !!e && Number.isInteger(Number(e)), Pe = (e) => e.endsWith("%") && v(e.slice(0, -1)), q = (e) => Ur.test(e), xt = () => !0, Hr = (e) => (
@@ -1201,7 +1205,7 @@ const vr = (e, t) => {
1201
1205
  const o = yt.exec(e);
1202
1206
  return o ? o[1] ? t(o[1]) : r : !1;
1203
1207
  }, vt = (e) => e === "position" || e === "percentage", wt = (e) => e === "image" || e === "url", kt = (e) => e === "length" || e === "size" || e === "bg-size", jt = (e) => e === "length", ao = (e) => e === "number", Et = (e) => e === "family-name", St = (e) => e === "number" || e === "weight", Ct = (e) => e === "shadow", io = () => {
1204
- const e = M("color"), t = M("font"), r = M("text"), o = M("font-weight"), n = M("tracking"), s = M("leading"), a = M("breakpoint"), c = M("container"), l = M("spacing"), m = M("radius"), b = M("shadow"), h = M("inset-shadow"), y = M("text-shadow"), w = M("drop-shadow"), A = M("blur"), j = M("perspective"), C = M("aspect"), F = M("ease"), W = M("animate"), E = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], O = () => [
1208
+ const e = L("color"), t = L("font"), r = L("text"), o = L("font-weight"), n = L("tracking"), s = L("leading"), a = L("breakpoint"), c = L("container"), l = L("spacing"), m = L("radius"), b = L("shadow"), h = L("inset-shadow"), y = L("text-shadow"), w = L("drop-shadow"), A = L("blur"), j = L("perspective"), C = L("aspect"), F = L("ease"), W = L("animate"), E = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], O = () => [
1205
1209
  "center",
1206
1210
  "top",
1207
1211
  "bottom",
@@ -1219,7 +1223,7 @@ const vr = (e, t) => {
1219
1223
  "bottom-left",
1220
1224
  // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
1221
1225
  "left-bottom"
1222
- ], k = () => [...O(), p, f], T = () => ["auto", "hidden", "clip", "visible", "scroll"], L = () => ["auto", "contain", "none"], d = () => [p, f, l], S = () => [K, "full", "auto", ...d()], J = () => [Q, "none", "subgrid", p, f], Y = () => ["auto", {
1226
+ ], k = () => [...O(), p, f], T = () => ["auto", "hidden", "clip", "visible", "scroll"], M = () => ["auto", "contain", "none"], d = () => [p, f, l], S = () => [K, "full", "auto", ...d()], J = () => [Q, "none", "subgrid", p, f], Y = () => ["auto", {
1223
1227
  span: ["full", Q, p, f]
1224
1228
  }, Q, p, f], V = () => [Q, "auto", p, f], X = () => ["auto", "min", "max", "fr", p, f], Z = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], D = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], B = () => ["auto", ...d()], G = () => [K, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...d()], se = () => [K, "screen", "full", "dvw", "lvw", "svw", "min", "max", "fit", ...d()], ae = () => [K, "screen", "full", "lh", "dvh", "lvh", "svh", "min", "max", "fit", ...d()], g = () => [e, p, f], i = () => [...O(), Qe, Ke, {
1225
1229
  position: [p, f]
@@ -1394,21 +1398,21 @@ const vr = (e, t) => {
1394
1398
  * @see https://tailwindcss.com/docs/overscroll-behavior
1395
1399
  */
1396
1400
  overscroll: [{
1397
- overscroll: L()
1401
+ overscroll: M()
1398
1402
  }],
1399
1403
  /**
1400
1404
  * Overscroll Behavior X
1401
1405
  * @see https://tailwindcss.com/docs/overscroll-behavior
1402
1406
  */
1403
1407
  "overscroll-x": [{
1404
- "overscroll-x": L()
1408
+ "overscroll-x": M()
1405
1409
  }],
1406
1410
  /**
1407
1411
  * Overscroll Behavior Y
1408
1412
  * @see https://tailwindcss.com/docs/overscroll-behavior
1409
1413
  */
1410
1414
  "overscroll-y": [{
1411
- "overscroll-y": L()
1415
+ "overscroll-y": M()
1412
1416
  }],
1413
1417
  /**
1414
1418
  * Position
@@ -3830,7 +3834,7 @@ const vr = (e, t) => {
3830
3834
  orderSensitiveModifiers: ["*", "**", "after", "backdrop", "before", "details-content", "file", "first-letter", "first-line", "marker", "placeholder", "selection"]
3831
3835
  };
3832
3836
  }, lo = /* @__PURE__ */ Fr(io);
3833
- function Me(...e) {
3837
+ function Le(...e) {
3834
3838
  return lo(xr(e));
3835
3839
  }
3836
3840
  class co extends rt {
@@ -3864,7 +3868,7 @@ const uo = ({ type: e, scope: t, isSelected: r, sectionId: o, sectionIndex: n =
3864
3868
  {
3865
3869
  "data-jp-section-overlay": !0,
3866
3870
  "aria-hidden": !0,
3867
- className: Me(
3871
+ className: Le(
3868
3872
  "absolute inset-0 pointer-events-none transition-all duration-200 z-[50]",
3869
3873
  "border-2 border-transparent group-hover:border-blue-400/50 group-hover:border-dashed",
3870
3874
  r && "border-2 border-blue-600 border-solid bg-blue-500/5"
@@ -3872,7 +3876,7 @@ const uo = ({ type: e, scope: t, isSelected: r, sectionId: o, sectionIndex: n =
3872
3876
  children: /* @__PURE__ */ u.jsxs(
3873
3877
  "div",
3874
3878
  {
3875
- className: Me(
3879
+ className: Le(
3876
3880
  "absolute top-0 right-0 flex flex-nowrap items-center gap-1 pl-1 pr-2 py-1 text-[9px] font-black uppercase tracking-widest transition-opacity pointer-events-auto",
3877
3881
  "bg-blue-600 text-white",
3878
3882
  r || "group-hover:opacity-100 opacity-0"
@@ -3944,7 +3948,7 @@ const uo = ({ type: e, scope: t, isSelected: r, sectionId: o, sectionIndex: n =
3944
3948
  "data-section-type": b ? e.type : void 0,
3945
3949
  "data-section-scope": b ? w : void 0,
3946
3950
  ...b && h ? { "data-jp-selected": !0 } : {},
3947
- className: Me(
3951
+ className: Le(
3948
3952
  "relative w-full",
3949
3953
  b && !A && "group cursor-pointer",
3950
3954
  b && j ? "sticky top-0 z-[60]" : e.type === "header" ? "relative" : "relative z-0",
@@ -4012,14 +4016,14 @@ const uo = ({ type: e, scope: t, isSelected: r, sectionId: o, sectionIndex: n =
4012
4016
  { threshold: [0, 0.5, 1], rootMargin: "-20% 0px -20% 0px" }
4013
4017
  );
4014
4018
  let T = !1;
4015
- const L = requestAnimationFrame(() => {
4019
+ const M = requestAnimationFrame(() => {
4016
4020
  T || O.forEach((d) => {
4017
4021
  const S = m.current[d];
4018
4022
  S && k.observe(S);
4019
4023
  });
4020
4024
  });
4021
4025
  return () => {
4022
- T = !0, cancelAnimationFrame(L), k.disconnect();
4026
+ T = !0, cancelAnimationFrame(M), k.disconnect();
4023
4027
  };
4024
4028
  }, [w, y, e.sections, e["global-header"], h]);
4025
4029
  const j = (E, O) => {
@@ -4035,7 +4039,7 @@ const uo = ({ type: e, scope: t, isSelected: r, sectionId: o, sectionIndex: n =
4035
4039
  }
4036
4040
  }, W = () => {
4037
4041
  const E = typeof n == "function", O = e.sections.map((k, T) => {
4038
- const L = c === T;
4042
+ const M = c === T;
4039
4043
  return E ? /* @__PURE__ */ u.jsxs(
4040
4044
  "div",
4041
4045
  {
@@ -4058,8 +4062,8 @@ const uo = ({ type: e, scope: t, isSelected: r, sectionId: o, sectionIndex: n =
4058
4062
  height: 12,
4059
4063
  zIndex: 55,
4060
4064
  pointerEvents: "auto",
4061
- backgroundColor: L ? "rgba(59, 130, 246, 0.4)" : "transparent",
4062
- borderTop: L ? "2px solid rgb(96, 165, 250)" : "2px solid transparent"
4065
+ backgroundColor: M ? "rgba(59, 130, 246, 0.4)" : "transparent",
4066
+ borderTop: M ? "2px solid rgb(96, 165, 250)" : "2px solid transparent"
4063
4067
  },
4064
4068
  onDragOver: (d) => j(d, T),
4065
4069
  onDragLeave: C,
@@ -4119,9 +4123,9 @@ const uo = ({ type: e, scope: t, isSelected: r, sectionId: o, sectionIndex: n =
4119
4123
  backgroundColor: T ? "rgba(59, 130, 246, 0.4)" : "transparent",
4120
4124
  borderTop: T ? "2px solid rgb(96, 165, 250)" : "2px solid transparent"
4121
4125
  },
4122
- onDragOver: (L) => j(L, k),
4126
+ onDragOver: (M) => j(M, k),
4123
4127
  onDragLeave: C,
4124
- onDrop: (L) => F(L, k)
4128
+ onDrop: (M) => F(M, k)
4125
4129
  },
4126
4130
  "jp-drop-after-last"
4127
4131
  )
@@ -4195,20 +4199,20 @@ function ho(e, t, r) {
4195
4199
  }
4196
4200
  });
4197
4201
  }
4198
- function Le(e) {
4202
+ function Me(e) {
4199
4203
  return e.split("/").map((t) => t.trim()).filter(Boolean).join("/");
4200
4204
  }
4201
4205
  function go(e, t = "") {
4202
- const r = Le(t);
4206
+ const r = Me(t);
4203
4207
  let n = e.replace(/\/+/g, "/");
4204
4208
  if (r) {
4205
4209
  const a = `/${r}`;
4206
4210
  n === a ? n = "/" : n.startsWith(`${a}/`) && (n = n.slice(a.length));
4207
4211
  }
4208
- return Le(n) || "home";
4212
+ return Me(n) || "home";
4209
4213
  }
4210
4214
  function yo(e, t) {
4211
- const r = Le(t) || "home";
4215
+ const r = Me(t) || "home";
4212
4216
  return e[r];
4213
4217
  }
4214
4218
  const tt = ({
@@ -4308,12 +4312,12 @@ const vo = /\.(jpg|jpeg|png|gif|svg|pdf|webp|mp4|webm|ogg)$/i, wo = /^[a-zA-Z][a
4308
4312
  paddingBottom: I.enum(["none", "sm", "md", "lg", "xl", "2xl"]).default("md").describe("ui:select"),
4309
4313
  theme: I.enum(["dark", "light", "accent"]).default("dark").describe("ui:select"),
4310
4314
  container: I.enum(["boxed", "fluid"]).default("boxed").describe("ui:select")
4311
- }), Mo = I.object({
4315
+ }), Lo = I.object({
4312
4316
  id: I.string().optional(),
4313
4317
  label: I.string().describe("ui:text"),
4314
4318
  href: I.string().describe("ui:text"),
4315
4319
  variant: I.enum(["primary", "secondary", "accent"]).default("primary").describe("ui:select")
4316
- }), Lo = I.object({
4320
+ }), Mo = I.object({
4317
4321
  recipientEmail: I.string().optional().describe("ui:text")
4318
4322
  });
4319
4323
  function jo(e) {
@@ -4429,7 +4433,7 @@ export {
4429
4433
  No as BaseSectionData,
4430
4434
  $o as BaseSectionSettingsSchema,
4431
4435
  Qt as ConfigProvider,
4432
- Mo as CtaSchema,
4436
+ Lo as CtaSchema,
4433
4437
  Fo as DEPLOY_STEPS,
4434
4438
  Kt as DefaultNotFound,
4435
4439
  ct as IconRegistryContext,
@@ -4441,9 +4445,9 @@ export {
4441
4445
  Ee as SectionRenderer,
4442
4446
  ir as StudioProvider,
4443
4447
  bo as ThemeLoader,
4444
- Lo as WithFormRecipient,
4448
+ Mo as WithFormRecipient,
4445
4449
  rr as buildThemeVariableMap,
4446
- Me as cn,
4450
+ Le as cn,
4447
4451
  Ie as normalizeBasePath,
4448
4452
  Oo as resolveAssetUrl,
4449
4453
  st as resolveRuntimeConfig,