@olonjs/core 1.0.110 → 1.0.112
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 +433 -78
- package/dist/olonjs-core.js +14163 -13661
- 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,37 @@ 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
|
+
|
|
174
|
+
export declare function buildWebMcpSaveToolName(): string;
|
|
175
|
+
|
|
122
176
|
export declare function buildWebMcpToolName(): string;
|
|
123
177
|
|
|
124
178
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
@@ -126,11 +180,8 @@ export declare function cn(...inputs: ClassValue[]): string;
|
|
|
126
180
|
export declare interface ConfigContextValue {
|
|
127
181
|
registry: Registry;
|
|
128
182
|
schemas: Schemas;
|
|
129
|
-
/** For asset resolution (e.g. image picker preview). */
|
|
130
183
|
tenantId?: string;
|
|
131
|
-
/** Optional assets config for Image Picker (gallery, upload). */
|
|
132
184
|
assets?: AssetsConfig;
|
|
133
|
-
/** Optional list of section types where Studio overlay should be disabled. */
|
|
134
185
|
overlayDisabledSectionTypes?: string[];
|
|
135
186
|
}
|
|
136
187
|
|
|
@@ -139,10 +190,89 @@ export declare const ConfigProvider: default_2.FC<{
|
|
|
139
190
|
children: default_2.ReactNode;
|
|
140
191
|
}>;
|
|
141
192
|
|
|
193
|
+
export declare namespace contract {
|
|
194
|
+
export {
|
|
195
|
+
shouldRenderSiteGlobalHeader,
|
|
196
|
+
BaseSectionSettings,
|
|
197
|
+
SectionDataRegistry,
|
|
198
|
+
SectionSettingsRegistry,
|
|
199
|
+
BaseSection,
|
|
200
|
+
FallbackSection,
|
|
201
|
+
Section,
|
|
202
|
+
SectionType,
|
|
203
|
+
MenuItem,
|
|
204
|
+
MenuConfig,
|
|
205
|
+
PageMeta,
|
|
206
|
+
PageConfig,
|
|
207
|
+
SiteIdentity,
|
|
208
|
+
SitePageEntry,
|
|
209
|
+
SiteConfig,
|
|
210
|
+
ThemeTokenMap,
|
|
211
|
+
ThemeColors,
|
|
212
|
+
ThemeFontFamily,
|
|
213
|
+
ThemeTypography,
|
|
214
|
+
ThemeBorderRadius,
|
|
215
|
+
ThemeTokens,
|
|
216
|
+
ThemeConfig,
|
|
217
|
+
ProjectState,
|
|
218
|
+
PageRendererProps,
|
|
219
|
+
SelectionPathSegment,
|
|
220
|
+
SelectionPath,
|
|
221
|
+
PersistenceConfig,
|
|
222
|
+
ThemeCssConfig,
|
|
223
|
+
AddSectionConfig,
|
|
224
|
+
LibraryImageEntry,
|
|
225
|
+
AssetsConfig,
|
|
226
|
+
WebMcpConfig,
|
|
227
|
+
JsonPagesConfig,
|
|
228
|
+
resolveHeaderMenuItems,
|
|
229
|
+
resolveSectionMenuItems,
|
|
230
|
+
resolveRuntimeConfig,
|
|
231
|
+
RefDocuments,
|
|
232
|
+
buildPageContractHref,
|
|
233
|
+
buildPageManifestHref,
|
|
234
|
+
buildPageContract,
|
|
235
|
+
buildPageManifest,
|
|
236
|
+
buildSiteManifest,
|
|
237
|
+
buildLlmsTxt,
|
|
238
|
+
WebMcpToolContract,
|
|
239
|
+
WebMcpSectionInstance,
|
|
240
|
+
OlonJsPageContract,
|
|
241
|
+
OlonJsPageManifest,
|
|
242
|
+
OlonJsSiteManifestIndex,
|
|
243
|
+
BuildPageContractInput,
|
|
244
|
+
BuildSiteManifestInput,
|
|
245
|
+
BaseWidgetProps
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export declare function createWebMcpSaveToolInputSchema(): Record<string, unknown>;
|
|
250
|
+
|
|
142
251
|
export declare function createWebMcpToolInputSchema(): Record<string, unknown>;
|
|
143
252
|
|
|
144
253
|
export declare const DefaultNotFound: default_2.FC;
|
|
145
254
|
|
|
255
|
+
/**
|
|
256
|
+
* Engine-level error boundary: prevents black screen on any render error
|
|
257
|
+
* and surfaces a visible error UI.
|
|
258
|
+
*/
|
|
259
|
+
export declare class EngineErrorBoundary extends Component<{
|
|
260
|
+
children: ReactNode;
|
|
261
|
+
}, {
|
|
262
|
+
hasError: boolean;
|
|
263
|
+
error: Error | null;
|
|
264
|
+
}> {
|
|
265
|
+
constructor(props: {
|
|
266
|
+
children: ReactNode;
|
|
267
|
+
});
|
|
268
|
+
static getDerivedStateFromError(error: Error): {
|
|
269
|
+
hasError: boolean;
|
|
270
|
+
error: Error;
|
|
271
|
+
};
|
|
272
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
273
|
+
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;
|
|
274
|
+
}
|
|
275
|
+
|
|
146
276
|
export declare function ensureWebMcpRuntime(): void;
|
|
147
277
|
|
|
148
278
|
/** Structural shape used when no tenant has augmented the registries. */
|
|
@@ -182,46 +312,81 @@ export declare const InputWidgets: {
|
|
|
182
312
|
readonly 'ui:icon-picker': ({ label, value, onChange }: BaseWidgetProps<string>) => JSX.Element;
|
|
183
313
|
};
|
|
184
314
|
|
|
185
|
-
|
|
315
|
+
export declare const isCanonicalAssetUrl: (path: string) => boolean;
|
|
316
|
+
|
|
317
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
318
|
+
|
|
319
|
+
export declare const isTransientAssetUrl: (path: string) => boolean;
|
|
320
|
+
|
|
186
321
|
export declare interface JsonPagesConfig {
|
|
187
|
-
/** Unique identifier for the tenant (used for asset resolution) */
|
|
188
322
|
tenantId: string;
|
|
189
|
-
/** Component map: section type -> React component. */
|
|
190
323
|
registry: Record<string, default_2.ComponentType<unknown>>;
|
|
191
|
-
/** Zod schemas map: section type -> schema. */
|
|
192
324
|
schemas: Record<string, {
|
|
193
325
|
parse: (v: unknown) => unknown;
|
|
194
326
|
shape?: Record<string, unknown>;
|
|
195
327
|
}>;
|
|
196
|
-
/** Page slug -> page config. */
|
|
197
328
|
pages: Record<string, PageConfig>;
|
|
198
329
|
siteConfig: SiteConfig;
|
|
199
330
|
themeConfig: ThemeConfig;
|
|
200
331
|
menuConfig: MenuConfig;
|
|
201
|
-
/** Optional extra JSON documents available to the runtime $ref resolver. */
|
|
202
332
|
refDocuments?: Record<string, unknown>;
|
|
203
|
-
/** Optional persistence callbacks for tenant-specific save flows. */
|
|
204
333
|
persistence?: Partial<PersistenceConfig>;
|
|
205
|
-
/** CSS strings for ThemeLoader. */
|
|
206
334
|
themeCss: ThemeCssConfig;
|
|
207
|
-
/** Optional 404 component. */
|
|
208
335
|
NotFoundComponent?: default_2.ComponentType;
|
|
209
|
-
/** Optional "Add section" library config (labels, addable types, default data). */
|
|
210
336
|
addSection?: AddSectionConfig;
|
|
211
|
-
/** Optional assets config for Image Picker (gallery, upload target). */
|
|
212
337
|
assets?: AssetsConfig;
|
|
213
|
-
/** Optional list of section types where Studio overlay should be disabled. */
|
|
214
338
|
overlayDisabledSectionTypes?: string[];
|
|
215
|
-
/** Optional WebMCP bridge config for Studio-only tool registration. */
|
|
216
339
|
webmcp?: WebMcpConfig;
|
|
217
340
|
}
|
|
218
341
|
|
|
219
342
|
export declare function JsonPagesEngine({ config }: JsonPagesEngineProps): JSX.Element;
|
|
220
343
|
|
|
221
|
-
declare interface JsonPagesEngineProps {
|
|
344
|
+
export declare interface JsonPagesEngineProps {
|
|
222
345
|
config: JsonPagesConfig;
|
|
223
346
|
}
|
|
224
347
|
|
|
348
|
+
export declare namespace kernel {
|
|
349
|
+
export {
|
|
350
|
+
resolveHeaderMenuItems,
|
|
351
|
+
resolveRuntimeConfig,
|
|
352
|
+
resolveSectionMenuItems,
|
|
353
|
+
shouldRenderSiteGlobalHeader,
|
|
354
|
+
BaseSectionSettings,
|
|
355
|
+
SectionDataRegistry,
|
|
356
|
+
SectionSettingsRegistry,
|
|
357
|
+
BaseSection,
|
|
358
|
+
FallbackSection,
|
|
359
|
+
Section,
|
|
360
|
+
SectionType,
|
|
361
|
+
MenuItem,
|
|
362
|
+
MenuConfig,
|
|
363
|
+
PageMeta,
|
|
364
|
+
PageConfig,
|
|
365
|
+
SiteIdentity,
|
|
366
|
+
SitePageEntry,
|
|
367
|
+
SiteConfig,
|
|
368
|
+
ThemeTokenMap,
|
|
369
|
+
ThemeColors,
|
|
370
|
+
ThemeFontFamily,
|
|
371
|
+
ThemeTypography,
|
|
372
|
+
ThemeBorderRadius,
|
|
373
|
+
ThemeTokens,
|
|
374
|
+
ThemeConfig,
|
|
375
|
+
ProjectState,
|
|
376
|
+
PageRendererProps,
|
|
377
|
+
SelectionPathSegment,
|
|
378
|
+
SelectionPath,
|
|
379
|
+
PersistenceConfig,
|
|
380
|
+
ThemeCssConfig,
|
|
381
|
+
AddSectionConfig,
|
|
382
|
+
LibraryImageEntry,
|
|
383
|
+
AssetsConfig,
|
|
384
|
+
WebMcpConfig,
|
|
385
|
+
JsonPagesConfig,
|
|
386
|
+
BaseWidgetProps
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
225
390
|
export declare interface LayerItem {
|
|
226
391
|
id: string;
|
|
227
392
|
type: string;
|
|
@@ -229,7 +394,6 @@ export declare interface LayerItem {
|
|
|
229
394
|
title?: string;
|
|
230
395
|
}
|
|
231
396
|
|
|
232
|
-
/** Image entry for the Image Picker Library tab (from tenant assets or manifest). */
|
|
233
397
|
export declare interface LibraryImageEntry {
|
|
234
398
|
id: string;
|
|
235
399
|
url: string;
|
|
@@ -250,6 +414,63 @@ export declare interface MenuItem {
|
|
|
250
414
|
children?: MenuItem[];
|
|
251
415
|
}
|
|
252
416
|
|
|
417
|
+
export declare function normalizeSlugSegments(value: string): string;
|
|
418
|
+
|
|
419
|
+
declare interface OlonJsPageContract {
|
|
420
|
+
version: '1.0.0';
|
|
421
|
+
kind: 'olonjs-page-contract';
|
|
422
|
+
slug: string;
|
|
423
|
+
title: string;
|
|
424
|
+
description: string;
|
|
425
|
+
manifestHref: string;
|
|
426
|
+
systemPrompt: string;
|
|
427
|
+
sectionTypes: string[];
|
|
428
|
+
sectionInstances: WebMcpSectionInstance[];
|
|
429
|
+
sectionSchemas: Record<string, Record<string, unknown>>;
|
|
430
|
+
tools: WebMcpToolContract[];
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
declare interface OlonJsPageManifest {
|
|
434
|
+
version: '1.0.0';
|
|
435
|
+
kind: 'olonjs-page-mcp-manifest';
|
|
436
|
+
generatedAt: string;
|
|
437
|
+
slug: string;
|
|
438
|
+
title: string;
|
|
439
|
+
description: string;
|
|
440
|
+
contractHref: string;
|
|
441
|
+
transport: {
|
|
442
|
+
kind: 'window-message';
|
|
443
|
+
requestType: string;
|
|
444
|
+
resultType: string;
|
|
445
|
+
target: 'window';
|
|
446
|
+
};
|
|
447
|
+
capabilities: {
|
|
448
|
+
resources: Array<{
|
|
449
|
+
uri: string;
|
|
450
|
+
name: string;
|
|
451
|
+
mimeType: string;
|
|
452
|
+
description: string;
|
|
453
|
+
}>;
|
|
454
|
+
};
|
|
455
|
+
sectionTypes: string[];
|
|
456
|
+
sectionInstances: WebMcpSectionInstance[];
|
|
457
|
+
tools: Array<Pick<WebMcpToolContract, 'name' | 'description'>>;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
declare interface OlonJsSiteManifestIndex {
|
|
461
|
+
version: '1.0.0';
|
|
462
|
+
kind: 'olonjs-mcp-manifest-index';
|
|
463
|
+
generatedAt: string;
|
|
464
|
+
pages: Array<{
|
|
465
|
+
slug: string;
|
|
466
|
+
title: string;
|
|
467
|
+
description: string;
|
|
468
|
+
manifestHref: string;
|
|
469
|
+
contractHref: string;
|
|
470
|
+
sectionTypes: string[];
|
|
471
|
+
}>;
|
|
472
|
+
}
|
|
473
|
+
|
|
253
474
|
/** Used by the section-settings modal to update a section without changing Inspector selection. */
|
|
254
475
|
export declare type OnUpdateSection = (sectionId: string, scope: 'global' | 'local', sectionType: string, newData: Record<string, unknown>) => void;
|
|
255
476
|
|
|
@@ -276,33 +497,52 @@ export declare interface PageRendererProps {
|
|
|
276
497
|
selectedId?: string | null;
|
|
277
498
|
}
|
|
278
499
|
|
|
279
|
-
/**
|
|
500
|
+
/**
|
|
501
|
+
* Enterprise-grade page switcher: popover trigger + list, a11y, single source of styling.
|
|
502
|
+
* Use in Inspector header when multiple pages exist and onPageChange is provided.
|
|
503
|
+
*/
|
|
504
|
+
declare const PageSelector: default_2.FC<PageSelectorProps>;
|
|
505
|
+
|
|
506
|
+
declare interface PageSelectorProps {
|
|
507
|
+
/** Available page slugs. */
|
|
508
|
+
pageSlugs: string[];
|
|
509
|
+
/** Current page slug. */
|
|
510
|
+
currentSlug: string;
|
|
511
|
+
/** Called when user selects another page. */
|
|
512
|
+
onPageChange: (slug: string) => void;
|
|
513
|
+
/** Optional: show section count per page (e.g. "9s"). Omit to hide. */
|
|
514
|
+
sectionCount?: number;
|
|
515
|
+
/** Optional: when set, shows "New page" and calls this on click. Omit to hide (no dead UI). */
|
|
516
|
+
onNewPage?: () => void;
|
|
517
|
+
/** Optional class for the wrapper (e.g. spacing). */
|
|
518
|
+
className?: string;
|
|
519
|
+
/** Optional: override label for current page (default: capitalized slug). */
|
|
520
|
+
currentPageLabel?: string;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
export declare function parseWebMcpMutationArgs(rawArgs: unknown): WebMcpMutationArgs;
|
|
524
|
+
|
|
280
525
|
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
526
|
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
527
|
hotSave?: (state: ProjectState, slug: string) => Promise<void>;
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
/** Controls Hot Save button visibility in sidebar. Default false. */
|
|
528
|
+
coldSave?: (state: ProjectState, slug: string) => Promise<void>;
|
|
529
|
+
showLocalSave?: boolean;
|
|
294
530
|
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
|
-
*/
|
|
531
|
+
showColdSave?: boolean;
|
|
299
532
|
flushUploadedAssets?: (urls: string[]) => Promise<Record<string, string>>;
|
|
300
533
|
}
|
|
301
534
|
|
|
302
535
|
export declare const PreviewEntry: default_2.FC;
|
|
303
536
|
|
|
537
|
+
export declare const PreviewRoute: default_2.FC<PreviewRouteProps>;
|
|
538
|
+
|
|
539
|
+
export declare interface PreviewRouteProps {
|
|
540
|
+
tenantCss: string;
|
|
541
|
+
adminCss: string;
|
|
542
|
+
}
|
|
543
|
+
|
|
304
544
|
/**
|
|
305
|
-
*
|
|
545
|
+
* PROJECT STATE (The Universal Data Bundle)
|
|
306
546
|
* Moved to Kernel to serve as SSOT for Engine and Persistence.
|
|
307
547
|
*/
|
|
308
548
|
export declare interface ProjectState {
|
|
@@ -314,31 +554,72 @@ export declare interface ProjectState {
|
|
|
314
554
|
|
|
315
555
|
declare type Props = PageRendererProps & {
|
|
316
556
|
onReorder?: (sectionId: string, newIndex: number) => void;
|
|
317
|
-
/** When set, scroll this section into view (Studio full-page). */
|
|
318
557
|
scrollToSectionId?: string | null;
|
|
319
|
-
/** Report which section is most visible in viewport (Intersection Observer). */
|
|
320
558
|
onActiveSectionChange?: (sectionId: string | null) => void;
|
|
321
559
|
};
|
|
322
560
|
|
|
561
|
+
declare type RefDocuments = NonNullable<JsonPagesConfig['refDocuments']>;
|
|
562
|
+
|
|
323
563
|
export declare function registerWebMcpTool(tool: WebMcpTool): () => void;
|
|
324
564
|
|
|
325
565
|
declare type Registry = JsonPagesConfig['registry'];
|
|
326
566
|
|
|
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
567
|
export declare const resolveAssetUrl: (path: string, tenantId?: string) => string;
|
|
333
568
|
|
|
334
569
|
export declare function resolveHeaderMenuItems(headerData: unknown, fallbackMain: MenuItem[]): MenuItem[];
|
|
335
570
|
|
|
571
|
+
export declare function resolveMenuMainFromHeaderData(headerData: unknown, fallbackMain: MenuItem[]): MenuItem[];
|
|
572
|
+
|
|
573
|
+
export declare function resolvePageFromRegistry(pageRegistry: Record<string, PageConfig>, requestedSlug: string): PageConfig | undefined;
|
|
574
|
+
|
|
336
575
|
export declare function resolveRuntimeConfig(input: RuntimeResolutionInput): RuntimeResolutionResult;
|
|
337
576
|
|
|
338
577
|
export declare function resolveSectionMenuItems(section: Section, fallbackMain: MenuItem[]): MenuItem[] | undefined;
|
|
339
578
|
|
|
579
|
+
export declare function resolveSlugFromPathname(pathname: string, prefix?: string): string;
|
|
580
|
+
|
|
340
581
|
export declare function resolveWebMcpMutationData(currentData: Record<string, unknown>, args: WebMcpMutationArgs): Record<string, unknown>;
|
|
341
582
|
|
|
583
|
+
export declare namespace runtime {
|
|
584
|
+
export {
|
|
585
|
+
PageRenderer,
|
|
586
|
+
SectionRenderer,
|
|
587
|
+
JsonPagesEngine,
|
|
588
|
+
JsonPagesEngineProps,
|
|
589
|
+
StudioProvider,
|
|
590
|
+
useStudio,
|
|
591
|
+
ConfigProvider,
|
|
592
|
+
useConfig,
|
|
593
|
+
ConfigContextValue,
|
|
594
|
+
ThemeLoader,
|
|
595
|
+
ThemeLoaderProps,
|
|
596
|
+
DefaultNotFound,
|
|
597
|
+
STUDIO_EVENTS,
|
|
598
|
+
EngineErrorBoundary,
|
|
599
|
+
PreviewRoute,
|
|
600
|
+
PreviewRouteProps,
|
|
601
|
+
StudioRoute,
|
|
602
|
+
StudioRouteProps,
|
|
603
|
+
VisitorRoute,
|
|
604
|
+
VisitorRouteProps,
|
|
605
|
+
buildPageContractHref,
|
|
606
|
+
buildPageManifestHref,
|
|
607
|
+
syncHeadLink,
|
|
608
|
+
syncWebMcpJsonLd,
|
|
609
|
+
isRecord,
|
|
610
|
+
normalizeSlugSegments,
|
|
611
|
+
resolveMenuMainFromHeaderData,
|
|
612
|
+
resolvePageFromRegistry,
|
|
613
|
+
resolveSlugFromPathname,
|
|
614
|
+
isCanonicalAssetUrl,
|
|
615
|
+
isTransientAssetUrl,
|
|
616
|
+
resolveAssetUrl,
|
|
617
|
+
useDocumentMeta,
|
|
618
|
+
buildThemeVariableMap,
|
|
619
|
+
themeManager
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
|
|
342
623
|
declare interface RuntimeResolutionInput {
|
|
343
624
|
pages: Record<string, PageConfig>;
|
|
344
625
|
siteConfig: SiteConfig;
|
|
@@ -370,13 +651,9 @@ declare interface SectionRendererProps {
|
|
|
370
651
|
section: Section;
|
|
371
652
|
menu?: MenuItem[];
|
|
372
653
|
selectedId?: string | null;
|
|
373
|
-
/** When true, show reorder (up/down) in overlay for local sections. */
|
|
374
654
|
reorderable?: boolean;
|
|
375
|
-
/** Section index in page (for reorder). Required when reorderable. */
|
|
376
655
|
sectionIndex?: number;
|
|
377
|
-
/** Total number of page sections (for disabling down at last). */
|
|
378
656
|
totalSections?: number;
|
|
379
|
-
/** Called when user triggers move up/down. newIndex is the target index for the engine. */
|
|
380
657
|
onReorder?: (sectionId: string, newIndex: number) => void;
|
|
381
658
|
}
|
|
382
659
|
|
|
@@ -391,10 +668,8 @@ declare interface SelectedSectionInfo {
|
|
|
391
668
|
scope: string;
|
|
392
669
|
}
|
|
393
670
|
|
|
394
|
-
/** v1.3 strict Studio path for field/item focus synchronization. */
|
|
395
671
|
export declare type SelectionPath = SelectionPathSegment[];
|
|
396
672
|
|
|
397
|
-
/** v1.3 strict Studio path segment (root -> leaf). */
|
|
398
673
|
export declare interface SelectionPathSegment {
|
|
399
674
|
fieldKey: string;
|
|
400
675
|
itemId?: string;
|
|
@@ -420,10 +695,15 @@ export declare interface SitePageEntry {
|
|
|
420
695
|
label: string;
|
|
421
696
|
}
|
|
422
697
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
698
|
+
export declare namespace studio {
|
|
699
|
+
export {
|
|
700
|
+
STUDIO_EVENTS,
|
|
701
|
+
StudioProvider,
|
|
702
|
+
useStudio,
|
|
703
|
+
admin
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
|
|
427
707
|
export declare const STUDIO_EVENTS: {
|
|
428
708
|
readonly UPDATE_DRAFTS: "jsonpages:update-drafts";
|
|
429
709
|
readonly SYNC_SELECTION: "jsonpages:sync-selection";
|
|
@@ -449,6 +729,30 @@ export declare const StudioProvider: default_2.FC<{
|
|
|
449
729
|
children: ReactNode;
|
|
450
730
|
}>;
|
|
451
731
|
|
|
732
|
+
export declare const StudioRoute: default_2.FC<StudioRouteProps>;
|
|
733
|
+
|
|
734
|
+
export declare interface StudioRouteProps {
|
|
735
|
+
pageRegistry: Record<string, PageConfig>;
|
|
736
|
+
schemas: JsonPagesConfig['schemas'];
|
|
737
|
+
siteConfig: SiteConfig;
|
|
738
|
+
menuConfig: {
|
|
739
|
+
main: MenuItem[];
|
|
740
|
+
};
|
|
741
|
+
themeConfig: JsonPagesConfig['themeConfig'];
|
|
742
|
+
refDocuments?: JsonPagesConfig['refDocuments'];
|
|
743
|
+
tenantCss: string;
|
|
744
|
+
adminCss: string;
|
|
745
|
+
addSectionConfig: JsonPagesConfig['addSection'];
|
|
746
|
+
addableSectionTypes: string[];
|
|
747
|
+
webMcp?: JsonPagesConfig['webmcp'];
|
|
748
|
+
saveToFile?: (state: ProjectState, slug: string) => Promise<void>;
|
|
749
|
+
hotSave?: (state: ProjectState, slug: string) => Promise<void>;
|
|
750
|
+
coldSave?: (state: ProjectState, slug: string) => Promise<void>;
|
|
751
|
+
showLocalSave?: boolean;
|
|
752
|
+
showHotSave?: boolean;
|
|
753
|
+
showColdSave?: boolean;
|
|
754
|
+
}
|
|
755
|
+
|
|
452
756
|
/**
|
|
453
757
|
* 📺 STUDIO STAGE (Full Preview Mode)
|
|
454
758
|
* Manages the Iframe and the PostMessage protocol.
|
|
@@ -467,6 +771,10 @@ declare interface StudioStageProps {
|
|
|
467
771
|
onScrollRequested?: () => void;
|
|
468
772
|
}
|
|
469
773
|
|
|
774
|
+
export declare function syncHeadLink(rel: string, href: string): void;
|
|
775
|
+
|
|
776
|
+
export declare function syncWebMcpJsonLd(title: string, description: string, url: string): void;
|
|
777
|
+
|
|
470
778
|
export declare interface ThemeBorderRadius {
|
|
471
779
|
sm: string;
|
|
472
780
|
md: string;
|
|
@@ -492,7 +800,6 @@ export declare interface ThemeConfig {
|
|
|
492
800
|
tokens: ThemeTokens;
|
|
493
801
|
}
|
|
494
802
|
|
|
495
|
-
/** Theme CSS: tenant (required), admin (optional). */
|
|
496
803
|
export declare interface ThemeCssConfig {
|
|
497
804
|
tenant: string;
|
|
498
805
|
admin?: string;
|
|
@@ -505,18 +812,11 @@ export declare interface ThemeFontFamily {
|
|
|
505
812
|
[key: string]: string | undefined;
|
|
506
813
|
}
|
|
507
814
|
|
|
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
815
|
export declare const ThemeLoader: default_2.FC<ThemeLoaderProps>;
|
|
513
816
|
|
|
514
|
-
declare interface ThemeLoaderProps {
|
|
515
|
-
/** Which mode is active; determines which CSS is injected. */
|
|
817
|
+
export declare interface ThemeLoaderProps {
|
|
516
818
|
mode: 'tenant' | 'admin';
|
|
517
|
-
/** CSS string for tenant (visitor) mode. */
|
|
518
819
|
tenantCss: string;
|
|
519
|
-
/** CSS string for admin (studio) mode. Engine provides default if not passed. */
|
|
520
820
|
adminCss: string;
|
|
521
821
|
children: default_2.ReactNode;
|
|
522
822
|
}
|
|
@@ -541,13 +841,55 @@ export declare interface ThemeTypography {
|
|
|
541
841
|
|
|
542
842
|
export declare function useConfig(): ConfigContextValue;
|
|
543
843
|
|
|
844
|
+
export declare const useDocumentMeta: (meta: PageMeta) => void;
|
|
845
|
+
|
|
544
846
|
export declare const useStudio: () => StudioContextType;
|
|
545
847
|
|
|
546
|
-
|
|
848
|
+
export declare const VisitorRoute: default_2.FC<VisitorRouteProps>;
|
|
849
|
+
|
|
850
|
+
export declare interface VisitorRouteProps {
|
|
851
|
+
pageRegistry: Record<string, PageConfig>;
|
|
852
|
+
siteConfig: SiteConfig;
|
|
853
|
+
menuConfig: {
|
|
854
|
+
main: MenuItem[];
|
|
855
|
+
};
|
|
856
|
+
themeConfig: JsonPagesConfig['themeConfig'];
|
|
857
|
+
refDocuments?: JsonPagesConfig['refDocuments'];
|
|
858
|
+
tenantCss: string;
|
|
859
|
+
adminCss: string;
|
|
860
|
+
NotFoundComponent: default_2.ComponentType;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
export declare namespace webmcp {
|
|
864
|
+
export {
|
|
865
|
+
applyValueAtSelectionPath,
|
|
866
|
+
buildWebMcpToolName,
|
|
867
|
+
buildWebMcpSaveToolName,
|
|
868
|
+
createWebMcpToolInputSchema,
|
|
869
|
+
createWebMcpSaveToolInputSchema,
|
|
870
|
+
ensureWebMcpRuntime,
|
|
871
|
+
parseWebMcpMutationArgs,
|
|
872
|
+
registerWebMcpTool,
|
|
873
|
+
resolveWebMcpMutationData,
|
|
874
|
+
WebMcpMutationArgs,
|
|
875
|
+
buildLlmsTxt,
|
|
876
|
+
buildPageContract,
|
|
877
|
+
buildPageContractHref,
|
|
878
|
+
buildPageManifest,
|
|
879
|
+
buildPageManifestHref,
|
|
880
|
+
buildSiteManifest,
|
|
881
|
+
BuildPageContractInput,
|
|
882
|
+
BuildSiteManifestInput,
|
|
883
|
+
OlonJsPageContract,
|
|
884
|
+
OlonJsPageManifest,
|
|
885
|
+
OlonJsSiteManifestIndex,
|
|
886
|
+
WebMcpSectionInstance,
|
|
887
|
+
WebMcpToolContract
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
|
|
547
891
|
export declare interface WebMcpConfig {
|
|
548
|
-
/** Enables WebMCP tool registration when Studio is active. */
|
|
549
892
|
enabled?: boolean;
|
|
550
|
-
/** Optional namespace used by testing helpers and debug output. */
|
|
551
893
|
namespace?: string;
|
|
552
894
|
}
|
|
553
895
|
|
|
@@ -562,6 +904,13 @@ export declare interface WebMcpMutationArgs {
|
|
|
562
904
|
value?: unknown;
|
|
563
905
|
}
|
|
564
906
|
|
|
907
|
+
declare interface WebMcpSectionInstance {
|
|
908
|
+
id: string;
|
|
909
|
+
type: string;
|
|
910
|
+
scope: 'global' | 'local';
|
|
911
|
+
label: string;
|
|
912
|
+
}
|
|
913
|
+
|
|
565
914
|
declare type WebMcpTool = {
|
|
566
915
|
name: string;
|
|
567
916
|
description: string;
|
|
@@ -569,6 +918,12 @@ declare type WebMcpTool = {
|
|
|
569
918
|
execute: (args: unknown) => Promise<unknown> | unknown;
|
|
570
919
|
};
|
|
571
920
|
|
|
921
|
+
declare interface WebMcpToolContract {
|
|
922
|
+
name: string;
|
|
923
|
+
description: string;
|
|
924
|
+
inputSchema: Record<string, unknown>;
|
|
925
|
+
}
|
|
926
|
+
|
|
572
927
|
export declare type WidgetType = keyof typeof InputWidgets;
|
|
573
928
|
|
|
574
929
|
export { }
|