@olonjs/core 1.0.109 → 1.0.111
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 +427 -78
- package/dist/olonjs-core.js +14087 -13627
- package/dist/olonjs-core.umd.cjs +58 -47
- package/package.json +2 -3
- package/src/lib/webmcp-contracts.mjs +0 -388
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { ClassValue } from 'clsx';
|
|
2
|
+
import { Component } from 'react';
|
|
2
3
|
import { default as default_2 } from 'react';
|
|
4
|
+
import { ErrorInfo } from 'react';
|
|
3
5
|
import { JSX } from 'react/jsx-runtime';
|
|
4
6
|
import { ReactNode } from 'react';
|
|
5
7
|
import { z } from 'zod';
|
|
6
8
|
|
|
7
|
-
/**
|
|
8
|
-
* Optional config for the "Add section" library (tenant-agnostic).
|
|
9
|
-
* Section types are derived from registry/schemas; tenant can customize labels and defaults.
|
|
10
|
-
*/
|
|
11
9
|
export declare interface AddSectionConfig {
|
|
12
|
-
/** Section types that can be added to a page (order preserved). If omitted, derived from schemas excluding header/footer. */
|
|
13
10
|
addableSectionTypes?: string[];
|
|
14
|
-
/** Display label per section type. If omitted, type id is humanized (e.g. "feature-grid" → "Feature grid"). */
|
|
15
11
|
sectionTypeLabels?: Record<string, string>;
|
|
16
|
-
/** Default data for a new section of the given type. Required for add-section to produce valid sections. */
|
|
17
12
|
getDefaultSectionData?: (sectionType: string) => Record<string, unknown>;
|
|
18
13
|
}
|
|
19
14
|
|
|
@@ -29,6 +24,21 @@ declare interface AddSectionLibraryProps {
|
|
|
29
24
|
onSelect: (sectionType: string) => void;
|
|
30
25
|
}
|
|
31
26
|
|
|
27
|
+
export declare namespace admin {
|
|
28
|
+
export {
|
|
29
|
+
AddSectionLibrary,
|
|
30
|
+
AdminSidebar,
|
|
31
|
+
LayerItem,
|
|
32
|
+
FormFactory,
|
|
33
|
+
InputWidgets,
|
|
34
|
+
WidgetType,
|
|
35
|
+
PageSelector,
|
|
36
|
+
PreviewEntry,
|
|
37
|
+
buildSelectionPath,
|
|
38
|
+
StudioStage
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
32
42
|
export declare const AdminSidebar: default_2.FC<AdminSidebarProps>;
|
|
33
43
|
|
|
34
44
|
declare interface AdminSidebarProps {
|
|
@@ -60,16 +70,20 @@ declare interface AdminSidebarProps {
|
|
|
60
70
|
onSaveToFile?: () => void;
|
|
61
71
|
/** Hot Save callback (typically cloud save2edge). */
|
|
62
72
|
onHotSave?: () => void;
|
|
73
|
+
/** Cold Save callback (typically save2repo / deploy pipeline). */
|
|
74
|
+
onColdSave?: () => void;
|
|
63
75
|
/** When true, show "Salvato" in the status bar (e.g. for 2s after save-to-file succeeds). */
|
|
64
76
|
saveSuccessFeedback?: boolean;
|
|
65
77
|
/** When true, show "Saved" feedback for hot save (e.g. for 2s after success). */
|
|
66
78
|
hotSaveSuccessFeedback?: boolean;
|
|
67
79
|
/** When true, hot save action is currently running. */
|
|
68
80
|
hotSaveInProgress?: boolean;
|
|
69
|
-
/** Controls visibility of the Save
|
|
70
|
-
|
|
81
|
+
/** Controls visibility of the local Save button. */
|
|
82
|
+
showLocalSave?: boolean;
|
|
71
83
|
/** Controls visibility of Hot Save button. */
|
|
72
84
|
showHotSave?: boolean;
|
|
85
|
+
/** Controls visibility of Save2Repo / Cold Save button. */
|
|
86
|
+
showColdSave?: boolean;
|
|
73
87
|
/** Restore page from file (resets in-memory draft for current slug). Hidden by default; set showResetToFile to display. */
|
|
74
88
|
onResetToFile?: () => void;
|
|
75
89
|
/** When true, shows the "Ripristina da file" button (default false = hidden). */
|
|
@@ -84,13 +98,22 @@ declare interface AdminSidebarProps {
|
|
|
84
98
|
|
|
85
99
|
export declare function applyValueAtSelectionPath(rootData: Record<string, unknown>, selectionPath: SelectionPath, value: unknown): Record<string, unknown>;
|
|
86
100
|
|
|
87
|
-
/** Optional config for the Image Picker (gallery from assets, save to assets). */
|
|
88
101
|
export declare interface AssetsConfig {
|
|
89
|
-
/** Base URL for assets (e.g. "/assets"). Used to resolve library image URLs and display gallery. */
|
|
90
102
|
assetsBaseUrl?: string;
|
|
91
|
-
/** Library images for the picker "Libreria" tab. Tenant can build from public/assets or provide a static list. */
|
|
92
103
|
assetsManifest?: LibraryImageEntry[];
|
|
93
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Uploads an image and returns the final canonical URL that must be persisted in JSON.
|
|
106
|
+
*
|
|
107
|
+
* Valid examples:
|
|
108
|
+
* - /assets/images/foo.png
|
|
109
|
+
* - /assets/tenant-a/foo.png
|
|
110
|
+
* - https://cdn.example.com/foo.png
|
|
111
|
+
*
|
|
112
|
+
* Invalid examples:
|
|
113
|
+
* - public/assets/foo.png
|
|
114
|
+
* - C:\\foo\\bar.png
|
|
115
|
+
* - data:image/png;base64,...
|
|
116
|
+
*/
|
|
94
117
|
onAssetUpload?: (file: File) => Promise<string>;
|
|
95
118
|
}
|
|
96
119
|
|
|
@@ -102,7 +125,7 @@ export declare interface BaseSection<K extends keyof SectionDataRegistry> {
|
|
|
102
125
|
}
|
|
103
126
|
|
|
104
127
|
/**
|
|
105
|
-
*
|
|
128
|
+
* KERNEL: The Base Contract (MTRP)
|
|
106
129
|
* Core is self-contained; structural types live here.
|
|
107
130
|
*/
|
|
108
131
|
export declare interface BaseSectionSettings {
|
|
@@ -119,6 +142,35 @@ export declare interface BaseWidgetProps<T = unknown> {
|
|
|
119
142
|
options?: string[];
|
|
120
143
|
}
|
|
121
144
|
|
|
145
|
+
declare function buildLlmsTxt(input: BuildSiteManifestInput): string;
|
|
146
|
+
|
|
147
|
+
declare function buildPageContract({ slug, pageConfig, schemas, siteConfig, }: BuildPageContractInput): OlonJsPageContract;
|
|
148
|
+
|
|
149
|
+
export declare function buildPageContractHref(slug: string): string;
|
|
150
|
+
|
|
151
|
+
declare interface BuildPageContractInput {
|
|
152
|
+
slug: string;
|
|
153
|
+
pageConfig: PageConfig;
|
|
154
|
+
schemas: JsonPagesConfig['schemas'];
|
|
155
|
+
siteConfig: SiteConfig;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
declare function buildPageManifest(input: BuildPageContractInput): OlonJsPageManifest;
|
|
159
|
+
|
|
160
|
+
export declare function buildPageManifestHref(slug: string): string;
|
|
161
|
+
|
|
162
|
+
declare function buildSelectionPath(root: HTMLElement, sectionEl: HTMLElement): SelectionPath;
|
|
163
|
+
|
|
164
|
+
declare function buildSiteManifest({ pages, schemas, siteConfig, }: BuildSiteManifestInput): OlonJsSiteManifestIndex;
|
|
165
|
+
|
|
166
|
+
declare interface BuildSiteManifestInput {
|
|
167
|
+
pages: Record<string, PageConfig>;
|
|
168
|
+
schemas: JsonPagesConfig['schemas'];
|
|
169
|
+
siteConfig: SiteConfig;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export declare function buildThemeVariableMap(theme: ThemeConfig): Record<string, string>;
|
|
173
|
+
|
|
122
174
|
export declare function buildWebMcpToolName(): string;
|
|
123
175
|
|
|
124
176
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
@@ -126,11 +178,8 @@ export declare function cn(...inputs: ClassValue[]): string;
|
|
|
126
178
|
export declare interface ConfigContextValue {
|
|
127
179
|
registry: Registry;
|
|
128
180
|
schemas: Schemas;
|
|
129
|
-
/** For asset resolution (e.g. image picker preview). */
|
|
130
181
|
tenantId?: string;
|
|
131
|
-
/** Optional assets config for Image Picker (gallery, upload). */
|
|
132
182
|
assets?: AssetsConfig;
|
|
133
|
-
/** Optional list of section types where Studio overlay should be disabled. */
|
|
134
183
|
overlayDisabledSectionTypes?: string[];
|
|
135
184
|
}
|
|
136
185
|
|
|
@@ -139,10 +188,87 @@ export declare const ConfigProvider: default_2.FC<{
|
|
|
139
188
|
children: default_2.ReactNode;
|
|
140
189
|
}>;
|
|
141
190
|
|
|
191
|
+
export declare namespace contract {
|
|
192
|
+
export {
|
|
193
|
+
shouldRenderSiteGlobalHeader,
|
|
194
|
+
BaseSectionSettings,
|
|
195
|
+
SectionDataRegistry,
|
|
196
|
+
SectionSettingsRegistry,
|
|
197
|
+
BaseSection,
|
|
198
|
+
FallbackSection,
|
|
199
|
+
Section,
|
|
200
|
+
SectionType,
|
|
201
|
+
MenuItem,
|
|
202
|
+
MenuConfig,
|
|
203
|
+
PageMeta,
|
|
204
|
+
PageConfig,
|
|
205
|
+
SiteIdentity,
|
|
206
|
+
SitePageEntry,
|
|
207
|
+
SiteConfig,
|
|
208
|
+
ThemeTokenMap,
|
|
209
|
+
ThemeColors,
|
|
210
|
+
ThemeFontFamily,
|
|
211
|
+
ThemeTypography,
|
|
212
|
+
ThemeBorderRadius,
|
|
213
|
+
ThemeTokens,
|
|
214
|
+
ThemeConfig,
|
|
215
|
+
ProjectState,
|
|
216
|
+
PageRendererProps,
|
|
217
|
+
SelectionPathSegment,
|
|
218
|
+
SelectionPath,
|
|
219
|
+
PersistenceConfig,
|
|
220
|
+
ThemeCssConfig,
|
|
221
|
+
AddSectionConfig,
|
|
222
|
+
LibraryImageEntry,
|
|
223
|
+
AssetsConfig,
|
|
224
|
+
WebMcpConfig,
|
|
225
|
+
JsonPagesConfig,
|
|
226
|
+
resolveHeaderMenuItems,
|
|
227
|
+
resolveSectionMenuItems,
|
|
228
|
+
resolveRuntimeConfig,
|
|
229
|
+
RefDocuments,
|
|
230
|
+
buildPageContractHref,
|
|
231
|
+
buildPageManifestHref,
|
|
232
|
+
buildPageContract,
|
|
233
|
+
buildPageManifest,
|
|
234
|
+
buildSiteManifest,
|
|
235
|
+
buildLlmsTxt,
|
|
236
|
+
WebMcpToolContract,
|
|
237
|
+
WebMcpSectionInstance,
|
|
238
|
+
OlonJsPageContract,
|
|
239
|
+
OlonJsPageManifest,
|
|
240
|
+
OlonJsSiteManifestIndex,
|
|
241
|
+
BuildPageContractInput,
|
|
242
|
+
BuildSiteManifestInput,
|
|
243
|
+
BaseWidgetProps
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
142
247
|
export declare function createWebMcpToolInputSchema(): Record<string, unknown>;
|
|
143
248
|
|
|
144
249
|
export declare const DefaultNotFound: default_2.FC;
|
|
145
250
|
|
|
251
|
+
/**
|
|
252
|
+
* Engine-level error boundary: prevents black screen on any render error
|
|
253
|
+
* and surfaces a visible error UI.
|
|
254
|
+
*/
|
|
255
|
+
export declare class EngineErrorBoundary extends Component<{
|
|
256
|
+
children: ReactNode;
|
|
257
|
+
}, {
|
|
258
|
+
hasError: boolean;
|
|
259
|
+
error: Error | null;
|
|
260
|
+
}> {
|
|
261
|
+
constructor(props: {
|
|
262
|
+
children: ReactNode;
|
|
263
|
+
});
|
|
264
|
+
static getDerivedStateFromError(error: Error): {
|
|
265
|
+
hasError: boolean;
|
|
266
|
+
error: Error;
|
|
267
|
+
};
|
|
268
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
269
|
+
render(): string | number | bigint | boolean | Iterable<default_2.ReactNode> | Promise<string | number | bigint | boolean | default_2.ReactPortal | default_2.ReactElement<unknown, string | default_2.JSXElementConstructor<any>> | Iterable<default_2.ReactNode> | null | undefined> | JSX.Element | null | undefined;
|
|
270
|
+
}
|
|
271
|
+
|
|
146
272
|
export declare function ensureWebMcpRuntime(): void;
|
|
147
273
|
|
|
148
274
|
/** Structural shape used when no tenant has augmented the registries. */
|
|
@@ -182,46 +308,81 @@ export declare const InputWidgets: {
|
|
|
182
308
|
readonly 'ui:icon-picker': ({ label, value, onChange }: BaseWidgetProps<string>) => JSX.Element;
|
|
183
309
|
};
|
|
184
310
|
|
|
185
|
-
|
|
311
|
+
export declare const isCanonicalAssetUrl: (path: string) => boolean;
|
|
312
|
+
|
|
313
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
314
|
+
|
|
315
|
+
export declare const isTransientAssetUrl: (path: string) => boolean;
|
|
316
|
+
|
|
186
317
|
export declare interface JsonPagesConfig {
|
|
187
|
-
/** Unique identifier for the tenant (used for asset resolution) */
|
|
188
318
|
tenantId: string;
|
|
189
|
-
/** Component map: section type -> React component. */
|
|
190
319
|
registry: Record<string, default_2.ComponentType<unknown>>;
|
|
191
|
-
/** Zod schemas map: section type -> schema. */
|
|
192
320
|
schemas: Record<string, {
|
|
193
321
|
parse: (v: unknown) => unknown;
|
|
194
322
|
shape?: Record<string, unknown>;
|
|
195
323
|
}>;
|
|
196
|
-
/** Page slug -> page config. */
|
|
197
324
|
pages: Record<string, PageConfig>;
|
|
198
325
|
siteConfig: SiteConfig;
|
|
199
326
|
themeConfig: ThemeConfig;
|
|
200
327
|
menuConfig: MenuConfig;
|
|
201
|
-
/** Optional extra JSON documents available to the runtime $ref resolver. */
|
|
202
328
|
refDocuments?: Record<string, unknown>;
|
|
203
|
-
/** Optional persistence callbacks for tenant-specific save flows. */
|
|
204
329
|
persistence?: Partial<PersistenceConfig>;
|
|
205
|
-
/** CSS strings for ThemeLoader. */
|
|
206
330
|
themeCss: ThemeCssConfig;
|
|
207
|
-
/** Optional 404 component. */
|
|
208
331
|
NotFoundComponent?: default_2.ComponentType;
|
|
209
|
-
/** Optional "Add section" library config (labels, addable types, default data). */
|
|
210
332
|
addSection?: AddSectionConfig;
|
|
211
|
-
/** Optional assets config for Image Picker (gallery, upload target). */
|
|
212
333
|
assets?: AssetsConfig;
|
|
213
|
-
/** Optional list of section types where Studio overlay should be disabled. */
|
|
214
334
|
overlayDisabledSectionTypes?: string[];
|
|
215
|
-
/** Optional WebMCP bridge config for Studio-only tool registration. */
|
|
216
335
|
webmcp?: WebMcpConfig;
|
|
217
336
|
}
|
|
218
337
|
|
|
219
338
|
export declare function JsonPagesEngine({ config }: JsonPagesEngineProps): JSX.Element;
|
|
220
339
|
|
|
221
|
-
declare interface JsonPagesEngineProps {
|
|
340
|
+
export declare interface JsonPagesEngineProps {
|
|
222
341
|
config: JsonPagesConfig;
|
|
223
342
|
}
|
|
224
343
|
|
|
344
|
+
export declare namespace kernel {
|
|
345
|
+
export {
|
|
346
|
+
resolveHeaderMenuItems,
|
|
347
|
+
resolveRuntimeConfig,
|
|
348
|
+
resolveSectionMenuItems,
|
|
349
|
+
shouldRenderSiteGlobalHeader,
|
|
350
|
+
BaseSectionSettings,
|
|
351
|
+
SectionDataRegistry,
|
|
352
|
+
SectionSettingsRegistry,
|
|
353
|
+
BaseSection,
|
|
354
|
+
FallbackSection,
|
|
355
|
+
Section,
|
|
356
|
+
SectionType,
|
|
357
|
+
MenuItem,
|
|
358
|
+
MenuConfig,
|
|
359
|
+
PageMeta,
|
|
360
|
+
PageConfig,
|
|
361
|
+
SiteIdentity,
|
|
362
|
+
SitePageEntry,
|
|
363
|
+
SiteConfig,
|
|
364
|
+
ThemeTokenMap,
|
|
365
|
+
ThemeColors,
|
|
366
|
+
ThemeFontFamily,
|
|
367
|
+
ThemeTypography,
|
|
368
|
+
ThemeBorderRadius,
|
|
369
|
+
ThemeTokens,
|
|
370
|
+
ThemeConfig,
|
|
371
|
+
ProjectState,
|
|
372
|
+
PageRendererProps,
|
|
373
|
+
SelectionPathSegment,
|
|
374
|
+
SelectionPath,
|
|
375
|
+
PersistenceConfig,
|
|
376
|
+
ThemeCssConfig,
|
|
377
|
+
AddSectionConfig,
|
|
378
|
+
LibraryImageEntry,
|
|
379
|
+
AssetsConfig,
|
|
380
|
+
WebMcpConfig,
|
|
381
|
+
JsonPagesConfig,
|
|
382
|
+
BaseWidgetProps
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
225
386
|
export declare interface LayerItem {
|
|
226
387
|
id: string;
|
|
227
388
|
type: string;
|
|
@@ -229,7 +390,6 @@ export declare interface LayerItem {
|
|
|
229
390
|
title?: string;
|
|
230
391
|
}
|
|
231
392
|
|
|
232
|
-
/** Image entry for the Image Picker Library tab (from tenant assets or manifest). */
|
|
233
393
|
export declare interface LibraryImageEntry {
|
|
234
394
|
id: string;
|
|
235
395
|
url: string;
|
|
@@ -250,6 +410,63 @@ export declare interface MenuItem {
|
|
|
250
410
|
children?: MenuItem[];
|
|
251
411
|
}
|
|
252
412
|
|
|
413
|
+
export declare function normalizeSlugSegments(value: string): string;
|
|
414
|
+
|
|
415
|
+
declare interface OlonJsPageContract {
|
|
416
|
+
version: '1.0.0';
|
|
417
|
+
kind: 'olonjs-page-contract';
|
|
418
|
+
slug: string;
|
|
419
|
+
title: string;
|
|
420
|
+
description: string;
|
|
421
|
+
manifestHref: string;
|
|
422
|
+
systemPrompt: string;
|
|
423
|
+
sectionTypes: string[];
|
|
424
|
+
sectionInstances: WebMcpSectionInstance[];
|
|
425
|
+
sectionSchemas: Record<string, Record<string, unknown>>;
|
|
426
|
+
tools: WebMcpToolContract[];
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
declare interface OlonJsPageManifest {
|
|
430
|
+
version: '1.0.0';
|
|
431
|
+
kind: 'olonjs-page-mcp-manifest';
|
|
432
|
+
generatedAt: string;
|
|
433
|
+
slug: string;
|
|
434
|
+
title: string;
|
|
435
|
+
description: string;
|
|
436
|
+
contractHref: string;
|
|
437
|
+
transport: {
|
|
438
|
+
kind: 'window-message';
|
|
439
|
+
requestType: string;
|
|
440
|
+
resultType: string;
|
|
441
|
+
target: 'window';
|
|
442
|
+
};
|
|
443
|
+
capabilities: {
|
|
444
|
+
resources: Array<{
|
|
445
|
+
uri: string;
|
|
446
|
+
name: string;
|
|
447
|
+
mimeType: string;
|
|
448
|
+
description: string;
|
|
449
|
+
}>;
|
|
450
|
+
};
|
|
451
|
+
sectionTypes: string[];
|
|
452
|
+
sectionInstances: WebMcpSectionInstance[];
|
|
453
|
+
tools: Array<Pick<WebMcpToolContract, 'name' | 'description'>>;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
declare interface OlonJsSiteManifestIndex {
|
|
457
|
+
version: '1.0.0';
|
|
458
|
+
kind: 'olonjs-mcp-manifest-index';
|
|
459
|
+
generatedAt: string;
|
|
460
|
+
pages: Array<{
|
|
461
|
+
slug: string;
|
|
462
|
+
title: string;
|
|
463
|
+
description: string;
|
|
464
|
+
manifestHref: string;
|
|
465
|
+
contractHref: string;
|
|
466
|
+
sectionTypes: string[];
|
|
467
|
+
}>;
|
|
468
|
+
}
|
|
469
|
+
|
|
253
470
|
/** Used by the section-settings modal to update a section without changing Inspector selection. */
|
|
254
471
|
export declare type OnUpdateSection = (sectionId: string, scope: 'global' | 'local', sectionType: string, newData: Record<string, unknown>) => void;
|
|
255
472
|
|
|
@@ -276,33 +493,52 @@ export declare interface PageRendererProps {
|
|
|
276
493
|
selectedId?: string | null;
|
|
277
494
|
}
|
|
278
495
|
|
|
279
|
-
/**
|
|
496
|
+
/**
|
|
497
|
+
* Enterprise-grade page switcher: popover trigger + list, a11y, single source of styling.
|
|
498
|
+
* Use in Inspector header when multiple pages exist and onPageChange is provided.
|
|
499
|
+
*/
|
|
500
|
+
declare const PageSelector: default_2.FC<PageSelectorProps>;
|
|
501
|
+
|
|
502
|
+
declare interface PageSelectorProps {
|
|
503
|
+
/** Available page slugs. */
|
|
504
|
+
pageSlugs: string[];
|
|
505
|
+
/** Current page slug. */
|
|
506
|
+
currentSlug: string;
|
|
507
|
+
/** Called when user selects another page. */
|
|
508
|
+
onPageChange: (slug: string) => void;
|
|
509
|
+
/** Optional: show section count per page (e.g. "9s"). Omit to hide. */
|
|
510
|
+
sectionCount?: number;
|
|
511
|
+
/** Optional: when set, shows "New page" and calls this on click. Omit to hide (no dead UI). */
|
|
512
|
+
onNewPage?: () => void;
|
|
513
|
+
/** Optional class for the wrapper (e.g. spacing). */
|
|
514
|
+
className?: string;
|
|
515
|
+
/** Optional: override label for current page (default: capitalized slug). */
|
|
516
|
+
currentPageLabel?: string;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
export declare function parseWebMcpMutationArgs(rawArgs: unknown): WebMcpMutationArgs;
|
|
520
|
+
|
|
280
521
|
export declare interface PersistenceConfig {
|
|
281
|
-
/**
|
|
282
|
-
* Optional. Save current state to repo files (e.g. POST to /api/save-to-file); server writes
|
|
283
|
-
* src/data/config/*.json and src/data/pages/<slug>.json. No git push.
|
|
284
|
-
*/
|
|
285
522
|
saveToFile?: (state: ProjectState, slug: string) => Promise<void>;
|
|
286
|
-
/**
|
|
287
|
-
* Optional. Hot save path (e.g. POST to /api/v1/save2edge).
|
|
288
|
-
* Core only triggers this callback; tenant decides transport and endpoint.
|
|
289
|
-
*/
|
|
290
523
|
hotSave?: (state: ProjectState, slug: string) => Promise<void>;
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
/** Controls Hot Save button visibility in sidebar. Default false. */
|
|
524
|
+
coldSave?: (state: ProjectState, slug: string) => Promise<void>;
|
|
525
|
+
showLocalSave?: boolean;
|
|
294
526
|
showHotSave?: boolean;
|
|
295
|
-
|
|
296
|
-
* Optional. If provided, flushes in-memory /uploaded-assets/ blobs to disk and returns oldUrl -> newUrl map.
|
|
297
|
-
* Omit when uploads write directly to disk (e.g. public/assets/images) and section data already stores final URLs.
|
|
298
|
-
*/
|
|
527
|
+
showColdSave?: boolean;
|
|
299
528
|
flushUploadedAssets?: (urls: string[]) => Promise<Record<string, string>>;
|
|
300
529
|
}
|
|
301
530
|
|
|
302
531
|
export declare const PreviewEntry: default_2.FC;
|
|
303
532
|
|
|
533
|
+
export declare const PreviewRoute: default_2.FC<PreviewRouteProps>;
|
|
534
|
+
|
|
535
|
+
export declare interface PreviewRouteProps {
|
|
536
|
+
tenantCss: string;
|
|
537
|
+
adminCss: string;
|
|
538
|
+
}
|
|
539
|
+
|
|
304
540
|
/**
|
|
305
|
-
*
|
|
541
|
+
* PROJECT STATE (The Universal Data Bundle)
|
|
306
542
|
* Moved to Kernel to serve as SSOT for Engine and Persistence.
|
|
307
543
|
*/
|
|
308
544
|
export declare interface ProjectState {
|
|
@@ -314,31 +550,72 @@ export declare interface ProjectState {
|
|
|
314
550
|
|
|
315
551
|
declare type Props = PageRendererProps & {
|
|
316
552
|
onReorder?: (sectionId: string, newIndex: number) => void;
|
|
317
|
-
/** When set, scroll this section into view (Studio full-page). */
|
|
318
553
|
scrollToSectionId?: string | null;
|
|
319
|
-
/** Report which section is most visible in viewport (Intersection Observer). */
|
|
320
554
|
onActiveSectionChange?: (sectionId: string | null) => void;
|
|
321
555
|
};
|
|
322
556
|
|
|
557
|
+
declare type RefDocuments = NonNullable<JsonPagesConfig['refDocuments']>;
|
|
558
|
+
|
|
323
559
|
export declare function registerWebMcpTool(tool: WebMcpTool): () => void;
|
|
324
560
|
|
|
325
561
|
declare type Registry = JsonPagesConfig['registry'];
|
|
326
562
|
|
|
327
|
-
/**
|
|
328
|
-
* 🛡️ SOVEREIGN ASSET RESOLVER
|
|
329
|
-
* Centralized logic to distinguish between routes and static assets.
|
|
330
|
-
* Moved to Core to allow Standard Blocks to resolve assets consistently.
|
|
331
|
-
*/
|
|
332
563
|
export declare const resolveAssetUrl: (path: string, tenantId?: string) => string;
|
|
333
564
|
|
|
334
565
|
export declare function resolveHeaderMenuItems(headerData: unknown, fallbackMain: MenuItem[]): MenuItem[];
|
|
335
566
|
|
|
567
|
+
export declare function resolveMenuMainFromHeaderData(headerData: unknown, fallbackMain: MenuItem[]): MenuItem[];
|
|
568
|
+
|
|
569
|
+
export declare function resolvePageFromRegistry(pageRegistry: Record<string, PageConfig>, requestedSlug: string): PageConfig | undefined;
|
|
570
|
+
|
|
336
571
|
export declare function resolveRuntimeConfig(input: RuntimeResolutionInput): RuntimeResolutionResult;
|
|
337
572
|
|
|
338
573
|
export declare function resolveSectionMenuItems(section: Section, fallbackMain: MenuItem[]): MenuItem[] | undefined;
|
|
339
574
|
|
|
575
|
+
export declare function resolveSlugFromPathname(pathname: string, prefix?: string): string;
|
|
576
|
+
|
|
340
577
|
export declare function resolveWebMcpMutationData(currentData: Record<string, unknown>, args: WebMcpMutationArgs): Record<string, unknown>;
|
|
341
578
|
|
|
579
|
+
export declare namespace runtime {
|
|
580
|
+
export {
|
|
581
|
+
PageRenderer,
|
|
582
|
+
SectionRenderer,
|
|
583
|
+
JsonPagesEngine,
|
|
584
|
+
JsonPagesEngineProps,
|
|
585
|
+
StudioProvider,
|
|
586
|
+
useStudio,
|
|
587
|
+
ConfigProvider,
|
|
588
|
+
useConfig,
|
|
589
|
+
ConfigContextValue,
|
|
590
|
+
ThemeLoader,
|
|
591
|
+
ThemeLoaderProps,
|
|
592
|
+
DefaultNotFound,
|
|
593
|
+
STUDIO_EVENTS,
|
|
594
|
+
EngineErrorBoundary,
|
|
595
|
+
PreviewRoute,
|
|
596
|
+
PreviewRouteProps,
|
|
597
|
+
StudioRoute,
|
|
598
|
+
StudioRouteProps,
|
|
599
|
+
VisitorRoute,
|
|
600
|
+
VisitorRouteProps,
|
|
601
|
+
buildPageContractHref,
|
|
602
|
+
buildPageManifestHref,
|
|
603
|
+
syncHeadLink,
|
|
604
|
+
syncWebMcpJsonLd,
|
|
605
|
+
isRecord,
|
|
606
|
+
normalizeSlugSegments,
|
|
607
|
+
resolveMenuMainFromHeaderData,
|
|
608
|
+
resolvePageFromRegistry,
|
|
609
|
+
resolveSlugFromPathname,
|
|
610
|
+
isCanonicalAssetUrl,
|
|
611
|
+
isTransientAssetUrl,
|
|
612
|
+
resolveAssetUrl,
|
|
613
|
+
useDocumentMeta,
|
|
614
|
+
buildThemeVariableMap,
|
|
615
|
+
themeManager
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
|
|
342
619
|
declare interface RuntimeResolutionInput {
|
|
343
620
|
pages: Record<string, PageConfig>;
|
|
344
621
|
siteConfig: SiteConfig;
|
|
@@ -370,13 +647,9 @@ declare interface SectionRendererProps {
|
|
|
370
647
|
section: Section;
|
|
371
648
|
menu?: MenuItem[];
|
|
372
649
|
selectedId?: string | null;
|
|
373
|
-
/** When true, show reorder (up/down) in overlay for local sections. */
|
|
374
650
|
reorderable?: boolean;
|
|
375
|
-
/** Section index in page (for reorder). Required when reorderable. */
|
|
376
651
|
sectionIndex?: number;
|
|
377
|
-
/** Total number of page sections (for disabling down at last). */
|
|
378
652
|
totalSections?: number;
|
|
379
|
-
/** Called when user triggers move up/down. newIndex is the target index for the engine. */
|
|
380
653
|
onReorder?: (sectionId: string, newIndex: number) => void;
|
|
381
654
|
}
|
|
382
655
|
|
|
@@ -391,10 +664,8 @@ declare interface SelectedSectionInfo {
|
|
|
391
664
|
scope: string;
|
|
392
665
|
}
|
|
393
666
|
|
|
394
|
-
/** v1.3 strict Studio path for field/item focus synchronization. */
|
|
395
667
|
export declare type SelectionPath = SelectionPathSegment[];
|
|
396
668
|
|
|
397
|
-
/** v1.3 strict Studio path segment (root -> leaf). */
|
|
398
669
|
export declare interface SelectionPathSegment {
|
|
399
670
|
fieldKey: string;
|
|
400
671
|
itemId?: string;
|
|
@@ -420,10 +691,15 @@ export declare interface SitePageEntry {
|
|
|
420
691
|
label: string;
|
|
421
692
|
}
|
|
422
693
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
694
|
+
export declare namespace studio {
|
|
695
|
+
export {
|
|
696
|
+
STUDIO_EVENTS,
|
|
697
|
+
StudioProvider,
|
|
698
|
+
useStudio,
|
|
699
|
+
admin
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
|
|
427
703
|
export declare const STUDIO_EVENTS: {
|
|
428
704
|
readonly UPDATE_DRAFTS: "jsonpages:update-drafts";
|
|
429
705
|
readonly SYNC_SELECTION: "jsonpages:sync-selection";
|
|
@@ -449,6 +725,30 @@ export declare const StudioProvider: default_2.FC<{
|
|
|
449
725
|
children: ReactNode;
|
|
450
726
|
}>;
|
|
451
727
|
|
|
728
|
+
export declare const StudioRoute: default_2.FC<StudioRouteProps>;
|
|
729
|
+
|
|
730
|
+
export declare interface StudioRouteProps {
|
|
731
|
+
pageRegistry: Record<string, PageConfig>;
|
|
732
|
+
schemas: JsonPagesConfig['schemas'];
|
|
733
|
+
siteConfig: SiteConfig;
|
|
734
|
+
menuConfig: {
|
|
735
|
+
main: MenuItem[];
|
|
736
|
+
};
|
|
737
|
+
themeConfig: JsonPagesConfig['themeConfig'];
|
|
738
|
+
refDocuments?: JsonPagesConfig['refDocuments'];
|
|
739
|
+
tenantCss: string;
|
|
740
|
+
adminCss: string;
|
|
741
|
+
addSectionConfig: JsonPagesConfig['addSection'];
|
|
742
|
+
addableSectionTypes: string[];
|
|
743
|
+
webMcp?: JsonPagesConfig['webmcp'];
|
|
744
|
+
saveToFile?: (state: ProjectState, slug: string) => Promise<void>;
|
|
745
|
+
hotSave?: (state: ProjectState, slug: string) => Promise<void>;
|
|
746
|
+
coldSave?: (state: ProjectState, slug: string) => Promise<void>;
|
|
747
|
+
showLocalSave?: boolean;
|
|
748
|
+
showHotSave?: boolean;
|
|
749
|
+
showColdSave?: boolean;
|
|
750
|
+
}
|
|
751
|
+
|
|
452
752
|
/**
|
|
453
753
|
* 📺 STUDIO STAGE (Full Preview Mode)
|
|
454
754
|
* Manages the Iframe and the PostMessage protocol.
|
|
@@ -467,6 +767,10 @@ declare interface StudioStageProps {
|
|
|
467
767
|
onScrollRequested?: () => void;
|
|
468
768
|
}
|
|
469
769
|
|
|
770
|
+
export declare function syncHeadLink(rel: string, href: string): void;
|
|
771
|
+
|
|
772
|
+
export declare function syncWebMcpJsonLd(title: string, description: string, url: string): void;
|
|
773
|
+
|
|
470
774
|
export declare interface ThemeBorderRadius {
|
|
471
775
|
sm: string;
|
|
472
776
|
md: string;
|
|
@@ -492,7 +796,6 @@ export declare interface ThemeConfig {
|
|
|
492
796
|
tokens: ThemeTokens;
|
|
493
797
|
}
|
|
494
798
|
|
|
495
|
-
/** Theme CSS: tenant (required), admin (optional). */
|
|
496
799
|
export declare interface ThemeCssConfig {
|
|
497
800
|
tenant: string;
|
|
498
801
|
admin?: string;
|
|
@@ -505,18 +808,11 @@ export declare interface ThemeFontFamily {
|
|
|
505
808
|
[key: string]: string | undefined;
|
|
506
809
|
}
|
|
507
810
|
|
|
508
|
-
/**
|
|
509
|
-
* Theme Loader: injects the required CSS into the <head> and removes it on unmount.
|
|
510
|
-
* CSS strings are passed as props so the Engine controls injection; Tenant does not manage Admin CSS.
|
|
511
|
-
*/
|
|
512
811
|
export declare const ThemeLoader: default_2.FC<ThemeLoaderProps>;
|
|
513
812
|
|
|
514
|
-
declare interface ThemeLoaderProps {
|
|
515
|
-
/** Which mode is active; determines which CSS is injected. */
|
|
813
|
+
export declare interface ThemeLoaderProps {
|
|
516
814
|
mode: 'tenant' | 'admin';
|
|
517
|
-
/** CSS string for tenant (visitor) mode. */
|
|
518
815
|
tenantCss: string;
|
|
519
|
-
/** CSS string for admin (studio) mode. Engine provides default if not passed. */
|
|
520
816
|
adminCss: string;
|
|
521
817
|
children: default_2.ReactNode;
|
|
522
818
|
}
|
|
@@ -541,13 +837,53 @@ export declare interface ThemeTypography {
|
|
|
541
837
|
|
|
542
838
|
export declare function useConfig(): ConfigContextValue;
|
|
543
839
|
|
|
840
|
+
export declare const useDocumentMeta: (meta: PageMeta) => void;
|
|
841
|
+
|
|
544
842
|
export declare const useStudio: () => StudioContextType;
|
|
545
843
|
|
|
546
|
-
|
|
844
|
+
export declare const VisitorRoute: default_2.FC<VisitorRouteProps>;
|
|
845
|
+
|
|
846
|
+
export declare interface VisitorRouteProps {
|
|
847
|
+
pageRegistry: Record<string, PageConfig>;
|
|
848
|
+
siteConfig: SiteConfig;
|
|
849
|
+
menuConfig: {
|
|
850
|
+
main: MenuItem[];
|
|
851
|
+
};
|
|
852
|
+
themeConfig: JsonPagesConfig['themeConfig'];
|
|
853
|
+
refDocuments?: JsonPagesConfig['refDocuments'];
|
|
854
|
+
tenantCss: string;
|
|
855
|
+
adminCss: string;
|
|
856
|
+
NotFoundComponent: default_2.ComponentType;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
export declare namespace webmcp {
|
|
860
|
+
export {
|
|
861
|
+
applyValueAtSelectionPath,
|
|
862
|
+
buildWebMcpToolName,
|
|
863
|
+
createWebMcpToolInputSchema,
|
|
864
|
+
ensureWebMcpRuntime,
|
|
865
|
+
parseWebMcpMutationArgs,
|
|
866
|
+
registerWebMcpTool,
|
|
867
|
+
resolveWebMcpMutationData,
|
|
868
|
+
WebMcpMutationArgs,
|
|
869
|
+
buildLlmsTxt,
|
|
870
|
+
buildPageContract,
|
|
871
|
+
buildPageContractHref,
|
|
872
|
+
buildPageManifest,
|
|
873
|
+
buildPageManifestHref,
|
|
874
|
+
buildSiteManifest,
|
|
875
|
+
BuildPageContractInput,
|
|
876
|
+
BuildSiteManifestInput,
|
|
877
|
+
OlonJsPageContract,
|
|
878
|
+
OlonJsPageManifest,
|
|
879
|
+
OlonJsSiteManifestIndex,
|
|
880
|
+
WebMcpSectionInstance,
|
|
881
|
+
WebMcpToolContract
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
|
|
547
885
|
export declare interface WebMcpConfig {
|
|
548
|
-
/** Enables WebMCP tool registration when Studio is active. */
|
|
549
886
|
enabled?: boolean;
|
|
550
|
-
/** Optional namespace used by testing helpers and debug output. */
|
|
551
887
|
namespace?: string;
|
|
552
888
|
}
|
|
553
889
|
|
|
@@ -562,6 +898,13 @@ export declare interface WebMcpMutationArgs {
|
|
|
562
898
|
value?: unknown;
|
|
563
899
|
}
|
|
564
900
|
|
|
901
|
+
declare interface WebMcpSectionInstance {
|
|
902
|
+
id: string;
|
|
903
|
+
type: string;
|
|
904
|
+
scope: 'global' | 'local';
|
|
905
|
+
label: string;
|
|
906
|
+
}
|
|
907
|
+
|
|
565
908
|
declare type WebMcpTool = {
|
|
566
909
|
name: string;
|
|
567
910
|
description: string;
|
|
@@ -569,6 +912,12 @@ declare type WebMcpTool = {
|
|
|
569
912
|
execute: (args: unknown) => Promise<unknown> | unknown;
|
|
570
913
|
};
|
|
571
914
|
|
|
915
|
+
declare interface WebMcpToolContract {
|
|
916
|
+
name: string;
|
|
917
|
+
description: string;
|
|
918
|
+
inputSchema: Record<string, unknown>;
|
|
919
|
+
}
|
|
920
|
+
|
|
572
921
|
export declare type WidgetType = keyof typeof InputWidgets;
|
|
573
922
|
|
|
574
923
|
export { }
|