@cratis/event-models 0.112.0 → 0.113.0
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/README.md +65 -0
- package/dist/Collections/suppliesBoardEditing.d.ts +2 -0
- package/dist/index.js +1347 -1347
- package/dist/index.js.map +1 -1
- package/dist/screen-editor/BlueprintPreview/blueprintPreviewCatalog.d.ts +57 -0
- package/dist/screen-editor/BlueprintPreview/initialPackageSelection.d.ts +18 -0
- package/dist/screen-editor/IconLibraries/Lucide/index.d.ts +4 -0
- package/dist/screen-editor/IconLibraries/Lucide/lucideAdapter.d.ts +2 -0
- package/dist/screen-editor/IconLibraries/Lucide/lucideCatalog.d.ts +2 -0
- package/dist/screen-editor/IconLibraries/Lucide/lucideManifest.d.ts +3 -0
- package/dist/screen-editor/IconLibraries/Lucide/lucidePackage.d.ts +2 -0
- package/dist/screen-editor/Icons/IconPickerCatalogState.d.ts +5 -0
- package/dist/screen-editor/Icons/IconPropertyField.d.ts +25 -0
- package/dist/screen-editor/Icons/IconPropertyFieldStrings.d.ts +8 -0
- package/dist/screen-editor/Icons/IconValueProblem.d.ts +7 -0
- package/dist/screen-editor/Icons/UseIconPickerCatalogResult.d.ts +7 -0
- package/dist/screen-editor/Icons/describeIconValueProblem.d.ts +3 -0
- package/dist/screen-editor/Icons/diagnoseIconValue.d.ts +5 -0
- package/dist/screen-editor/Icons/effectiveIconCatalogOf.d.ts +3 -0
- package/dist/screen-editor/Icons/iconCatalogSourcesOf.d.ts +3 -0
- package/dist/screen-editor/Icons/toIconPickerCatalog.d.ts +5 -0
- package/dist/screen-editor/Icons/useIconPickerCatalog.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Actions/ActionModel.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/Actions/ActionPresentation.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Actions/StateChangeSlice.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/Actions/actionBehavior.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Actions/diagnoseAction.d.ts +14 -0
- package/dist/screen-editor/ScreenEditor/Binding/availableSourcesFor.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Binding/bindingScopeTypes.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Binding/previewState.d.ts +17 -0
- package/dist/screen-editor/ScreenEditor/Binding/queryBindingModel.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Binding/settleBinding.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/Binding/toSceneCandidates.d.ts +22 -0
- package/dist/screen-editor/ScreenEditor/Collections/orderedItems.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/Defaults/defaultLayoutIcons.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Defaults/defaultLayoutLabels.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Defaults/defaultPaletteIcons.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Defaults/defaultPaletteSources.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Defaults/defaultScreenEditorStrings.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Document/createExternalComponent.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Document/createPanel.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Document/frameworkElement.d.ts +21 -0
- package/dist/screen-editor/ScreenEditor/Document/readSceneDocument.d.ts +15 -0
- package/dist/screen-editor/ScreenEditor/Document/studioScreen.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/DropRegions/DropRegion.d.ts +12 -0
- package/dist/screen-editor/ScreenEditor/DropRegions/DropRegionKind.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/DropRegions/InsertionAxis.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/DropRegions/computeDropRegions.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Exposure/exposureEdits.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/Host/DefaultPaletteHost.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorBoundary.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorControlProviders.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorController.d.ts +41 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorFileUpload.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorHost.d.ts +36 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorOverlay.d.ts +24 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorPrimeReactProvider.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorWindow.d.ts +28 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorWorkspace.d.ts +21 -0
- package/dist/screen-editor/ScreenEditor/Host/UnreadableScreen.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Host/WindowTitleBar.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Host/createScreenEditorEnvironment.d.ts +16 -0
- package/dist/screen-editor/ScreenEditor/Host/nextElementId.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/Host/openSubject.d.ts +14 -0
- package/dist/screen-editor/ScreenEditor/Host/useScreenEditor.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ActionEditor.d.ts +13 -0
- package/dist/screen-editor/ScreenEditor/Inspector/DiagnosticList.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ExposureSection.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/Inspector/IconProperties.d.ts +14 -0
- package/dist/screen-editor/ScreenEditor/Inspector/InspectorTab.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Inspector/LayoutTypeSection.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/Inspector/OwnershipBadge.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Inspector/PropertiesPanel.d.ts +17 -0
- package/dist/screen-editor/ScreenEditor/Inspector/QueryBindingEditor.d.ts +12 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ScreenEditorStrings.d.ts +106 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ScreenInspector.d.ts +13 -0
- package/dist/screen-editor/ScreenEditor/Inspector/StructureTree.d.ts +13 -0
- package/dist/screen-editor/ScreenEditor/Inspector/StructureTreeRow.d.ts +21 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ViewportControls.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/Inspector/pointerDropZone.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Layouts/LayoutCatalogEntry.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/Layouts/LayoutItem.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Layouts/PanelConstruct.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/Layouts/layoutCatalog.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Layouts/layoutChange.d.ts +13 -0
- package/dist/screen-editor/ScreenEditor/Layouts/toLayoutContainerDescriptors.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/Palette/PaletteEntry.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/Palette/buildPalette.d.ts +22 -0
- package/dist/screen-editor/ScreenEditor/Palette/insertedComponentName.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Properties/allowedIconChoices.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Properties/choiceKeys.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Properties/iconDiagnostics.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/Properties/propertyEdits.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Properties/toPropertyGroups.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonDraftKind.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonDraftOutcome.d.ts +13 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonDraftState.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonProblem.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonProblemKind.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonProperties.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonPropertyField.d.ts +13 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonPropertyFieldStrings.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonReading.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/defaultJsonPropertyFieldStrings.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/describeJsonProblem.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/formatJson.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/isJsonValueType.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/jsonDraft.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/numberLiteralsOf.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/readJson.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/sameJson.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/useJsonDraft.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/PrototypeProjection/LegacyExtras.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/PrototypeProjection/applyLegacyState.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/PrototypeProjection/layoutContainerItems.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/PrototypeProjection/legacyPlacement.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/PrototypeProjection/projectToLegacyElements.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/PrototypeProjection/sceneComponentName.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/PrototypeProjection/withoutNulls.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/Runtime/screenEditorRuntime.d.ts +17 -0
- package/dist/screen-editor/ScreenEditor/Runtime/screenEditorRuntimeForProfile.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Runtime/serverPrototypeTypes.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Runtime/useLoadedIconCatalog.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Runtime/withActionPresentation.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Runtime/withPlacementProperties.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Selection/panelLayoutItem.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Selection/sceneStructureAdapter.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Selection/sceneTree.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Selection/surfaceArrangementOfRoot.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Selection/surfaceLayoutOfRoot.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Selection/toSceneEdits.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Session/EditSession.d.ts +25 -0
- package/dist/screen-editor/ScreenEditor/Session/SessionCell.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Structure/DropZone.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Structure/MoveIntent.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Structure/Ownership.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Structure/OwnershipResolver.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Structure/StructureEdit.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Structure/StructureEditRejection.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/Structure/StructureLocation.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Structure/StructureOperation.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/Structure/StructureRow.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Structure/StructureTreeAdapter.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/Structure/findStructureNode.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Structure/flattenStructure.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Structure/isOperationPermitted.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Structure/resolveMoveIntentEdit.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Structure/resolveTreeDrop.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Structure/validateStructureEdit.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Surface/ScreenSurface.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/Surface/dragPayload.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/Surface/dropRegionRects.d.ts +14 -0
- package/dist/screen-editor/ScreenEditor/Surface/sameMeasurement.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Templates/composeEditorScreen.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Templates/templateProvenance.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Viewport/ViewportPreset.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Viewport/ViewportSize.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Viewport/detectViewportPreset.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Viewport/resolveViewportSizeClass.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Viewport/toWindowSize.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Viewport/viewportPresets.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/index.d.ts +31 -0
- package/dist/screen-editor/UiProfile/PackageInclusion.d.ts +9 -0
- package/dist/screen-editor/UiProfile/PersistedUiProfile.d.ts +19 -0
- package/dist/screen-editor/UiProfile/ResolvedPackageEntry.d.ts +19 -0
- package/dist/screen-editor/UiProfile/ResolvedUiProfile.d.ts +20 -0
- package/dist/screen-editor/UiProfile/UiProfileSettings.d.ts +29 -0
- package/dist/screen-editor/UiProfile/defaultUiProfileSettings.d.ts +13 -0
- package/dist/screen-editor/UiProfile/explicitPackageNames.d.ts +10 -0
- package/dist/screen-editor/UiProfile/formatMessage.d.ts +11 -0
- package/dist/screen-editor/UiProfile/resolveUiProfile.d.ts +18 -0
- package/dist/screen-editor/UiProfile/shellLayoutOf.d.ts +10 -0
- package/dist/screen-editor/UiProfile/toSceneUiProfile.d.ts +12 -0
- package/dist/screen-editor/UiProfileDesigner/filterCompatibleThemes.d.ts +12 -0
- package/dist/screen-editor/UiProfileDesigner/findComponentCollisions.d.ts +15 -0
- package/dist/screen-editor/catalog-CZx3FR-E.js +4 -0
- package/dist/screen-editor/index.js +3327 -0
- package/dist/screen-editor/screen-editor.css +2 -0
- package/package.json +99 -13
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ScenePackage, Theme } from '@cratis/scene.model';
|
|
2
|
+
import { PackageCatalog } from '@cratis/scene.engine';
|
|
3
|
+
import { ComponentRegistry, ScenePackageBundle } from '@cratis/scene.react';
|
|
4
|
+
/**
|
|
5
|
+
* Every Scene package bundle Studio has loaded.
|
|
6
|
+
*
|
|
7
|
+
* This is the one thing Studio has that the blueprint package's own gallery preview does not: all four
|
|
8
|
+
* dependency bundles (and the Lucide icon library) are real npm dependencies here, so a screen naming `dataTable` or `tag` resolves to
|
|
9
|
+
* a component that actually exists. The blueprint deliberately takes no bundler dependency on PrimeReact
|
|
10
|
+
* or Cratis Components - a blueprint declares its dependencies in its manifest, not in its import graph -
|
|
11
|
+
* which is why its own preview falls back to a profile that ranks `core` first and accepts placeholders
|
|
12
|
+
* for everything else. Studio does not need that fallback and must not copy it.
|
|
13
|
+
*
|
|
14
|
+
* There is no backend slice behind this page, no read model and nothing persisted: the catalog is exactly
|
|
15
|
+
* what the running bundle has imported, read at module load.
|
|
16
|
+
*/
|
|
17
|
+
export declare const blueprintPreviewBundles: ScenePackageBundle[];
|
|
18
|
+
/**
|
|
19
|
+
* The package catalog, taken from each bundle's own manifest.
|
|
20
|
+
*
|
|
21
|
+
* Read from the manifests rather than written out, because a hand-copied component list is a second
|
|
22
|
+
* source of truth that drifts the first time a package gains a component - and the only symptom is a
|
|
23
|
+
* dashed red placeholder in the middle of an otherwise fine screen.
|
|
24
|
+
*/
|
|
25
|
+
export declare const blueprintPreviewCatalog: ScenePackage[];
|
|
26
|
+
/**
|
|
27
|
+
* The merged component registry every preview renders against.
|
|
28
|
+
*
|
|
29
|
+
* Registry keys carry their package name, so merging cannot collide and merge order does not matter -
|
|
30
|
+
* which package wins a *bare* name is decided later, by `resolveComponentName` walking the profile's
|
|
31
|
+
* priority order.
|
|
32
|
+
*/
|
|
33
|
+
export declare const blueprintPreviewRegistry: ComponentRegistry;
|
|
34
|
+
/**
|
|
35
|
+
* The component-name catalog `resolveComponentName` resolves against, keyed by package name.
|
|
36
|
+
*/
|
|
37
|
+
export declare const blueprintPreviewComponentCatalog: PackageCatalog;
|
|
38
|
+
/**
|
|
39
|
+
* Every theme any loaded package ships - the blueprint's two and PrimeReact's free PrimeTek presets.
|
|
40
|
+
*
|
|
41
|
+
* Deliberately unfiltered: `filterCompatibleThemes` is what narrows this to the themes a given profile
|
|
42
|
+
* can actually pick, and a picker fed a pre-narrowed list has nothing to narrow.
|
|
43
|
+
*/
|
|
44
|
+
export declare const blueprintPreviewThemes: Theme[];
|
|
45
|
+
/**
|
|
46
|
+
* The blueprints available to preview.
|
|
47
|
+
*
|
|
48
|
+
* Two, and the second is the interesting one: `Cratis.Blueprint.Components` declares no layouts of its own
|
|
49
|
+
* and depends on `Cratis.Blueprint.Default` for the application shell, so selecting it pulls the default
|
|
50
|
+
* blueprint in behind it. That is a blueprint layered on a blueprint, and the dependency resolver treats
|
|
51
|
+
* it like any other - which is the whole point of the packages being declared rather than assumed.
|
|
52
|
+
*/
|
|
53
|
+
export declare const previewableBlueprints: ScenePackageBundle[];
|
|
54
|
+
/**
|
|
55
|
+
* The blueprint previewed when the page opens.
|
|
56
|
+
*/
|
|
57
|
+
export declare const previewedBlueprint: ScenePackageBundle;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ScenePackage } from '@cratis/scene.model';
|
|
2
|
+
/**
|
|
3
|
+
* The selection the picker opens on: every base component library, every styling package, and the first
|
|
4
|
+
* blueprint.
|
|
5
|
+
*
|
|
6
|
+
* It stops there rather than pre-picking the closure. The libraries that *layer* on a base - the ones the
|
|
7
|
+
* blueprint declares a dependency on - are left to `resolvePackageDependencies` to add, so the page opens
|
|
8
|
+
* already showing what dependency resolution did on the user's behalf. A picker that started from the
|
|
9
|
+
* complete, already-closed selection would never demonstrate that, which is half of what this page exists
|
|
10
|
+
* for.
|
|
11
|
+
*
|
|
12
|
+
* The bases and the styling packages *are* pre-picked, because every later stage is gated on them: leaving
|
|
13
|
+
* them out would open the page with the interesting stage closed and nothing to click in it.
|
|
14
|
+
*
|
|
15
|
+
* @param catalog Every known package.
|
|
16
|
+
* @returns The package names to start from.
|
|
17
|
+
*/
|
|
18
|
+
export declare function initialPackageSelection(catalog: ScenePackage[]): string[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IconPickerAllowed, IconPickerLabels, IconPickerPlacement } from '@cratis/components/IconPicker';
|
|
2
|
+
import { EffectiveIconCatalog } from '@cratis/scene.engine';
|
|
3
|
+
import { IconReference } from '@cratis/scene.model';
|
|
4
|
+
import { IconAdapterRegistry } from '@cratis/scene.react';
|
|
5
|
+
import { IconPropertyFieldStrings } from './IconPropertyFieldStrings';
|
|
6
|
+
export interface IconPropertyFieldProps {
|
|
7
|
+
value: IconReference | null | undefined;
|
|
8
|
+
onChange: (value: IconReference) => void;
|
|
9
|
+
catalog: EffectiveIconCatalog;
|
|
10
|
+
adapters?: IconAdapterRegistry;
|
|
11
|
+
allowed?: IconPickerAllowed;
|
|
12
|
+
readOnly?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
validationMessage?: string;
|
|
15
|
+
showMessage?: boolean;
|
|
16
|
+
invalid?: boolean;
|
|
17
|
+
strings: IconPropertyFieldStrings;
|
|
18
|
+
pickerLabels?: IconPickerLabels;
|
|
19
|
+
placement?: IconPickerPlacement;
|
|
20
|
+
id?: string;
|
|
21
|
+
'aria-label'?: string;
|
|
22
|
+
'aria-labelledby'?: string;
|
|
23
|
+
'aria-describedby'?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function IconPropertyField({ value, onChange, catalog, adapters, allowed, readOnly, disabled, validationMessage, showMessage, invalid, strings, pickerLabels, placement, id, ...aria }: IconPropertyFieldProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IconPickerLabels } from '@cratis/components/IconPicker';
|
|
2
|
+
import { IconDiagnosticKind } from '@cratis/scene.engine';
|
|
3
|
+
export interface IconPropertyFieldStrings {
|
|
4
|
+
ariaLabel: string;
|
|
5
|
+
picker: IconPickerLabels;
|
|
6
|
+
diagnostics: Record<IconDiagnosticKind, string>;
|
|
7
|
+
notAllowed: string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IconPickerAllowed, IconPickerCatalog } from '@cratis/components/IconPicker';
|
|
2
|
+
import { EffectiveIconCatalog } from '@cratis/scene.engine';
|
|
3
|
+
import { IconReference } from '@cratis/scene.model';
|
|
4
|
+
import { IconValueProblem } from './IconValueProblem';
|
|
5
|
+
export declare function diagnoseIconValue(catalog: EffectiveIconCatalog, offered: IconPickerCatalog, value: IconReference | null | undefined, allowed?: IconPickerAllowed): IconValueProblem | undefined;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IconPickerCatalog } from '@cratis/components/IconPicker';
|
|
2
|
+
import { EffectiveIconCatalog, EffectiveIconEntry } from '@cratis/scene.engine';
|
|
3
|
+
import { IconAdapterRegistry } from '@cratis/scene.react';
|
|
4
|
+
import { IconPickerCatalogState } from './IconPickerCatalogState';
|
|
5
|
+
export declare function toIconPickerCatalog(catalog: EffectiveIconCatalog, entries: EffectiveIconEntry[], adapters?: IconAdapterRegistry, state?: IconPickerCatalogState): IconPickerCatalog;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { EffectiveIconCatalog } from '@cratis/scene.engine';
|
|
2
|
+
import { IconAdapterRegistry } from '@cratis/scene.react';
|
|
3
|
+
import { UseIconPickerCatalogResult } from './UseIconPickerCatalogResult';
|
|
4
|
+
export declare function useIconPickerCatalog(catalog: EffectiveIconCatalog, adapters?: IconAdapterRegistry): UseIconPickerCatalogResult;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type SceneEdit } from '@cratis/scene.model';
|
|
2
|
+
import type { ActionModel } from './ActionModel';
|
|
3
|
+
export declare const actionComponentName = "action";
|
|
4
|
+
export declare const presentationProperty = "presentation";
|
|
5
|
+
export declare const argumentsProperty = "arguments";
|
|
6
|
+
export declare function readActionModel(properties: Record<string, unknown> | undefined, sliceName?: string): ActionModel | undefined;
|
|
7
|
+
export declare function toActionProperties(model: ActionModel): Record<string, unknown>;
|
|
8
|
+
export declare function actionEdits(componentId: string, model: ActionModel): SceneEdit[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ActionModel } from './ActionModel';
|
|
2
|
+
import type { StateChangeSlice } from './StateChangeSlice';
|
|
3
|
+
export declare enum ActionProblemKind {
|
|
4
|
+
MissingSlice = "missingSlice",
|
|
5
|
+
UnmappedInput = "unmappedInput",
|
|
6
|
+
UnknownInput = "unknownInput",
|
|
7
|
+
UnknownSource = "unknownSource"
|
|
8
|
+
}
|
|
9
|
+
export interface ActionProblem {
|
|
10
|
+
kind: ActionProblemKind;
|
|
11
|
+
input?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function diagnoseAction(model: ActionModel, slices: readonly StateChangeSlice[], availableSources: ReadonlySet<string>): ActionProblem[];
|
|
14
|
+
export declare function suggestInputs(slice: StateChangeSlice, sourceFor: (inputName: string) => string | undefined): Record<string, string>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { QueryBinding, QueryCandidate } from '@cratis/scene.model';
|
|
2
|
+
export declare enum PreviewState {
|
|
3
|
+
NoQuery = "noQuery",
|
|
4
|
+
MissingQuery = "missingQuery",
|
|
5
|
+
Loading = "loading",
|
|
6
|
+
Empty = "empty",
|
|
7
|
+
Error = "error",
|
|
8
|
+
Ready = "ready"
|
|
9
|
+
}
|
|
10
|
+
export interface PreviewInput {
|
|
11
|
+
binding?: QueryBinding;
|
|
12
|
+
candidate?: QueryCandidate;
|
|
13
|
+
isLoading: boolean;
|
|
14
|
+
error?: unknown;
|
|
15
|
+
rowCount?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function previewState({ binding, candidate, isLoading, error, rowCount }: PreviewInput): PreviewState;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { QueryBinding, QueryCandidate, QueryParameter, QueryResultField } from '@cratis/scene.model';
|
|
2
|
+
export declare function bindToCandidate(candidate: QueryCandidate): QueryBinding;
|
|
3
|
+
export declare function isQueryBinding(value: unknown): value is QueryBinding;
|
|
4
|
+
export declare function mapParameter(binding: QueryBinding, parameter: string, sourcePath: string): QueryBinding;
|
|
5
|
+
export declare function mapColumn(binding: QueryBinding, field: string, target?: string): QueryBinding;
|
|
6
|
+
export declare function unmapColumn(binding: QueryBinding, field: string): QueryBinding;
|
|
7
|
+
export declare const sourceOf: (binding: QueryBinding, parameter: QueryParameter) => string;
|
|
8
|
+
export declare const isColumnShown: (binding: QueryBinding, field: QueryResultField) => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PropertyDescriptor, QueryBinding, QueryCandidate, SceneDiagnostic } from '@cratis/scene.model';
|
|
2
|
+
import { type BindingTypeScope } from '@cratis/scene.engine';
|
|
3
|
+
export interface SettledBinding {
|
|
4
|
+
diagnostics: SceneDiagnostic[];
|
|
5
|
+
isStorable: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function settleBinding(descriptor: PropertyDescriptor, candidate: QueryCandidate | undefined, binding: QueryBinding, scope: BindingTypeScope): SettledBinding;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type QueryCandidate as SceneQueryCandidate } from '@cratis/scene.model';
|
|
2
|
+
export interface DiscoveredQueryCandidate {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
origin: {
|
|
6
|
+
kind: string;
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}[];
|
|
10
|
+
parameters: {
|
|
11
|
+
name: string;
|
|
12
|
+
type: string;
|
|
13
|
+
required: boolean;
|
|
14
|
+
}[];
|
|
15
|
+
resultShape: string;
|
|
16
|
+
resultFields: {
|
|
17
|
+
name: string;
|
|
18
|
+
type: string;
|
|
19
|
+
isIdentity?: boolean;
|
|
20
|
+
}[];
|
|
21
|
+
}
|
|
22
|
+
export declare function toSceneCandidates(candidates: readonly DiscoveredQueryCandidate[]): SceneQueryCandidate[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type InspectedProperty, type SceneEdit } from '@cratis/scene.model';
|
|
2
|
+
import type { OrderedItem, OrderedItemCapabilities, OrderedItemProposal } from '@cratis/components/ConfigurationEditor';
|
|
3
|
+
export interface SceneOrderedItem extends OrderedItem {
|
|
4
|
+
values: Record<string, unknown>;
|
|
5
|
+
}
|
|
6
|
+
export declare function toOrderedItems(property: InspectedProperty): {
|
|
7
|
+
items: SceneOrderedItem[];
|
|
8
|
+
fixed: SceneOrderedItem[];
|
|
9
|
+
};
|
|
10
|
+
export declare function toCapabilities(property: InspectedProperty): OrderedItemCapabilities;
|
|
11
|
+
export declare function proposalToEdits(componentId: string, property: InspectedProperty, proposal: OrderedItemProposal<SceneOrderedItem>): SceneEdit[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Panel, type SceneElement } from '@cratis/scene.model';
|
|
2
|
+
import { LayoutItem } from '../Layouts/LayoutItem';
|
|
3
|
+
export declare function createPanel(item: LayoutItem, id: string, name: string, children?: SceneElement[], extent?: {
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
}): Panel;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HorizontalAlignment, Visibility, VerticalAlignment } from '@cratis/scene.model';
|
|
2
|
+
export declare function frameworkElement(id: string, name: string): {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
visibility: Visibility;
|
|
6
|
+
isEnabled: boolean;
|
|
7
|
+
opacity: number;
|
|
8
|
+
size: {};
|
|
9
|
+
zIndex: number;
|
|
10
|
+
minimumSize: {};
|
|
11
|
+
maximumSize: {};
|
|
12
|
+
margin: {
|
|
13
|
+
left: number;
|
|
14
|
+
top: number;
|
|
15
|
+
right: number;
|
|
16
|
+
bottom: number;
|
|
17
|
+
};
|
|
18
|
+
horizontalAlignment: HorizontalAlignment;
|
|
19
|
+
verticalAlignment: VerticalAlignment;
|
|
20
|
+
properties: Record<string, unknown>;
|
|
21
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SceneDocument } from '@cratis/scene.model';
|
|
2
|
+
export declare enum SceneDocumentProblem {
|
|
3
|
+
NotJson = "notJson",
|
|
4
|
+
WrongShape = "wrongShape",
|
|
5
|
+
MissingScreen = "missingScreen",
|
|
6
|
+
MissingTemplate = "missingTemplate"
|
|
7
|
+
}
|
|
8
|
+
export type ReadSceneDocument = {
|
|
9
|
+
readable: true;
|
|
10
|
+
document: SceneDocument;
|
|
11
|
+
} | {
|
|
12
|
+
readable: false;
|
|
13
|
+
problem: SceneDocumentProblem;
|
|
14
|
+
};
|
|
15
|
+
export declare function readSceneDocument(stored: unknown, authoringTemplate?: string): ReadSceneDocument;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type EditingScope, type Layout, type Panel, type SceneDocument, type SceneElement } from '@cratis/scene.model';
|
|
2
|
+
export declare const studioLayout: Layout;
|
|
3
|
+
export declare const contentSlot = "content";
|
|
4
|
+
export declare const screenName = "Screen";
|
|
5
|
+
export declare const templateRootId = "template-root";
|
|
6
|
+
export declare const screenRootId = "screen-root";
|
|
7
|
+
export declare function createScreenDocument(root: SceneElement, template?: string): SceneDocument;
|
|
8
|
+
export declare function createTemplateDocument(name: string, root: SceneElement, fitsSlot?: string): SceneDocument;
|
|
9
|
+
export declare function authoredRoot(document: SceneDocument, template?: string): Panel | undefined;
|
|
10
|
+
export declare function editingScope(template?: string, authoringTemplate?: boolean): EditingScope;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DropRegionKind } from './DropRegionKind';
|
|
2
|
+
import type { InsertionAxis } from './InsertionAxis';
|
|
3
|
+
export interface DropRegion {
|
|
4
|
+
id: string;
|
|
5
|
+
kind: DropRegionKind;
|
|
6
|
+
containerId: string | null;
|
|
7
|
+
index: number;
|
|
8
|
+
axis: InsertionAxis;
|
|
9
|
+
isEmptyContainer: boolean;
|
|
10
|
+
afterId?: string;
|
|
11
|
+
beforeId?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LayoutArrangement } from '@cratis/scene/ScreenEditor';
|
|
2
|
+
import type { StructureTreeAdapter } from '../Structure/StructureTreeAdapter';
|
|
3
|
+
import type { DropRegion } from './DropRegion';
|
|
4
|
+
import { InsertionAxis } from './InsertionAxis';
|
|
5
|
+
export declare function insertionAxisFor(arrangement: LayoutArrangement | undefined): InsertionAxis;
|
|
6
|
+
export declare function computeDropRegions<T>(roots: T[], surfaceArrangement: LayoutArrangement, adapter: StructureTreeAdapter<T>): DropRegion[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CollectionOperation, type ExposePropertyEdit, type SceneDocument, type UnexposePropertyEdit } from '@cratis/scene.model';
|
|
2
|
+
export interface ExposureChoice {
|
|
3
|
+
label?: string;
|
|
4
|
+
operations?: CollectionOperation[];
|
|
5
|
+
editableFields?: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare function exposePropertyEdit(templateName: string, componentId: string, path: string, choice?: ExposureChoice): ExposePropertyEdit;
|
|
8
|
+
export declare function unexposePropertyEdit(templateName: string, componentId: string, path: string): UnexposePropertyEdit;
|
|
9
|
+
export declare const isExposed: (document: SceneDocument, templateName: string, componentId: string, path: string) => boolean;
|
|
10
|
+
export declare const defaultCollectionOperations: CollectionOperation[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface DefaultPaletteHostProps {
|
|
3
|
+
placement: 'floating' | 'inline';
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const DefaultPaletteHost: ({ placement, children }: DefaultPaletteHostProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ScreenEditorStrings } from '../Inspector/ScreenEditorStrings';
|
|
3
|
+
export interface ScreenEditorBoundaryProps {
|
|
4
|
+
strings: ScreenEditorStrings;
|
|
5
|
+
onClose?: () => void;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const ScreenEditorBoundary: ({ strings, onClose, children }: ScreenEditorBoundaryProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ScreenEditorEnvironment } from './ScreenEditorHost';
|
|
3
|
+
export interface ScreenEditorControlProvidersProps {
|
|
4
|
+
environment: ScreenEditorEnvironment;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const ScreenEditorControlProviders: ({ environment, children }: ScreenEditorControlProvidersProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { NodeInspection, SceneDiagnostic, SceneDocument, SceneEdit, SceneElement } from '@cratis/scene.model';
|
|
2
|
+
import type { EditingContext } from '@cratis/scene.engine';
|
|
3
|
+
import type { Ownership } from '../Structure/Ownership';
|
|
4
|
+
import type { StructureEdit } from '../Structure/StructureEdit';
|
|
5
|
+
import type { StructureEditRejection } from '../Structure/StructureEditRejection';
|
|
6
|
+
import type { StructureTreeAdapter } from '../Structure/StructureTreeAdapter';
|
|
7
|
+
import type { EditorComposition } from '../Templates/composeEditorScreen';
|
|
8
|
+
import type { DropRegion } from '../DropRegions/DropRegion';
|
|
9
|
+
import type { LayoutItem } from '../Layouts/LayoutItem';
|
|
10
|
+
export interface ScreenEditorController {
|
|
11
|
+
document: SceneDocument;
|
|
12
|
+
composition: EditorComposition;
|
|
13
|
+
context: EditingContext;
|
|
14
|
+
selectedId?: string;
|
|
15
|
+
selection?: SceneElement;
|
|
16
|
+
inspection?: NodeInspection;
|
|
17
|
+
diagnostics: readonly SceneDiagnostic[];
|
|
18
|
+
adapter: StructureTreeAdapter<SceneElement>;
|
|
19
|
+
ownershipOf: (elementId: string) => Ownership;
|
|
20
|
+
dropRegions: readonly DropRegion[];
|
|
21
|
+
select: (elementId: string | undefined) => void;
|
|
22
|
+
apply: (edit: SceneEdit, label: string) => void;
|
|
23
|
+
tryApply: (edit: SceneEdit, label: string) => {
|
|
24
|
+
applied: boolean;
|
|
25
|
+
diagnostics: SceneDiagnostic[];
|
|
26
|
+
};
|
|
27
|
+
applyAll: (edits: SceneEdit[], label: string) => {
|
|
28
|
+
applied: boolean;
|
|
29
|
+
diagnostics: SceneDiagnostic[];
|
|
30
|
+
};
|
|
31
|
+
move: (edit: StructureEdit) => StructureEditRejection | undefined;
|
|
32
|
+
insertComponent: (componentName: string, parentId: string | undefined, index: number | undefined) => void;
|
|
33
|
+
insertLayout: (item: LayoutItem, parentId: string | undefined, index: number | undefined) => void;
|
|
34
|
+
remove: (elementId: string) => void;
|
|
35
|
+
setProperty: (property: NodeInspection['properties'][number], value: unknown) => void;
|
|
36
|
+
undo: () => void;
|
|
37
|
+
redo: () => void;
|
|
38
|
+
canUndo: boolean;
|
|
39
|
+
canRedo: boolean;
|
|
40
|
+
isDirty: boolean;
|
|
41
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { SceneDocument } from '@cratis/scene.model';
|
|
2
|
+
import type { QueryCandidate } from '@cratis/scene.model';
|
|
3
|
+
import type { ConfigurationDestination } from '@cratis/components/ConfigurationEditor';
|
|
4
|
+
import type { ScreenEditorRuntime } from '../Runtime/screenEditorRuntime';
|
|
5
|
+
import type { QuillLoader } from '@cratis/scene.primereact';
|
|
6
|
+
import type { StateChangeSlice } from '../Actions/StateChangeSlice';
|
|
7
|
+
import type { ScreenEditorFileUpload } from './ScreenEditorFileUpload';
|
|
8
|
+
export interface ScreenEditorSubject {
|
|
9
|
+
documentText?: string;
|
|
10
|
+
document?: SceneDocument;
|
|
11
|
+
windowSize?: {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
};
|
|
15
|
+
authoringTemplate?: string;
|
|
16
|
+
screenTemplate?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ScreenEditorEnvironment {
|
|
19
|
+
runtime: ScreenEditorRuntime;
|
|
20
|
+
queryCandidates: readonly QueryCandidate[];
|
|
21
|
+
stateChangeSlices: readonly StateChangeSlice[];
|
|
22
|
+
destinations: readonly ConfigurationDestination[];
|
|
23
|
+
availableSources: Record<string, string>;
|
|
24
|
+
richText?: QuillLoader;
|
|
25
|
+
fileUpload?: ScreenEditorFileUpload;
|
|
26
|
+
}
|
|
27
|
+
export interface ScreenEditorResult {
|
|
28
|
+
document: SceneDocument;
|
|
29
|
+
legacyElements: unknown[];
|
|
30
|
+
windowSize: {
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
};
|
|
34
|
+
layout: number;
|
|
35
|
+
changed: boolean;
|
|
36
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { ScreenEditorStrings } from '../Inspector/ScreenEditorStrings';
|
|
3
|
+
import { type PaletteIcons, type PaletteSource } from '../Palette/buildPalette';
|
|
4
|
+
import type { LayoutLabels } from '../Layouts/toLayoutContainerDescriptors';
|
|
5
|
+
import type { ScreenEditorEnvironment, ScreenEditorResult, ScreenEditorSubject } from './ScreenEditorHost';
|
|
6
|
+
export interface ScreenEditorOverlayProps {
|
|
7
|
+
subject: ScreenEditorSubject;
|
|
8
|
+
environment: ScreenEditorEnvironment;
|
|
9
|
+
strings: ScreenEditorStrings;
|
|
10
|
+
layoutLabels: LayoutLabels;
|
|
11
|
+
icons: PaletteIcons;
|
|
12
|
+
paletteSources: readonly PaletteSource[];
|
|
13
|
+
sourceRect: DOMRect;
|
|
14
|
+
initialSize?: {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
centerOffsetX?: number;
|
|
19
|
+
renderPaletteHost?: (palette: ReactNode) => ReactNode;
|
|
20
|
+
onClose: (result: ScreenEditorResult) => void;
|
|
21
|
+
onBeforeClose?: (result: ScreenEditorResult) => Promise<string | undefined>;
|
|
22
|
+
onDismiss?: () => void;
|
|
23
|
+
}
|
|
24
|
+
export declare const ScreenEditorOverlay: (props: ScreenEditorOverlayProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PrimeReactProvider } from '@primereact/core/config';
|
|
2
|
+
export type ScreenEditorPrimeReactProviderProps = NonNullable<Parameters<typeof PrimeReactProvider>[0]>;
|
|
3
|
+
export declare const ScreenEditorPrimeReactProvider: (props: ScreenEditorPrimeReactProviderProps) => import("react").JSX.Element;
|