@cratis/event-models 0.111.1 → 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,4 @@
|
|
|
1
|
+
import { PropertyValueType, type InspectedProperty } from '@cratis/scene.model';
|
|
2
|
+
export declare const jsonValueType = PropertyValueType.Json;
|
|
3
|
+
export declare const isJsonValueType: (valueType: string) => boolean;
|
|
4
|
+
export declare const isJsonProperty: (property: InspectedProperty) => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JsonDraftOutcome } from './JsonDraftOutcome';
|
|
2
|
+
import type { JsonDraftState } from './JsonDraftState';
|
|
3
|
+
export declare const startJsonDraft: (value: unknown) => JsonDraftState;
|
|
4
|
+
export declare const editJsonDraft: (state: JsonDraftState, text: string) => JsonDraftState;
|
|
5
|
+
export declare const syncJsonDraft: (state: JsonDraftState, value: unknown) => JsonDraftState;
|
|
6
|
+
export declare const revertJsonDraft: (state: JsonDraftState) => JsonDraftState;
|
|
7
|
+
export declare function resolveJsonDraft(state: JsonDraftState, required: boolean): JsonDraftOutcome;
|
|
8
|
+
export declare function commitJsonDraft(state: JsonDraftState, required: boolean): {
|
|
9
|
+
state: JsonDraftState;
|
|
10
|
+
outcome: JsonDraftOutcome;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function numberLiteralsOf(text: string): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sameJson(left: unknown, right: unknown): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { JsonDraftOutcome } from './JsonDraftOutcome';
|
|
2
|
+
export interface JsonDraft {
|
|
3
|
+
text: string;
|
|
4
|
+
outcome: JsonDraftOutcome;
|
|
5
|
+
edit: (text: string) => void;
|
|
6
|
+
commit: () => void;
|
|
7
|
+
revert: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function useJsonDraft(value: unknown, required: boolean, onApply: (value: unknown) => void): JsonDraft;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { LayoutItem } from '../Layouts/LayoutItem';
|
|
2
|
+
export declare const legacyLayoutLibrary = "StudioLayout";
|
|
3
|
+
export declare function layoutItemOfLegacyType(legacyType: string): LayoutItem | undefined;
|
|
4
|
+
export declare function legacyTypeOfLayoutItem(item: LayoutItem): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function withoutNulls<T>(value: T): T;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type DescriptorCatalog, type EffectiveIconCatalog, type PackageCatalog } from '@cratis/scene.engine';
|
|
2
|
+
import type { ComponentDescriptor, UiProfile } from '@cratis/scene.model';
|
|
3
|
+
import { type ComponentRegistry, type IconAdapterRegistry, type ScenePackageBundle } from '@cratis/scene.react';
|
|
4
|
+
export interface ScreenEditorRuntime {
|
|
5
|
+
id: number;
|
|
6
|
+
bundles: ScenePackageBundle[];
|
|
7
|
+
registry: ComponentRegistry;
|
|
8
|
+
packages: PackageCatalog;
|
|
9
|
+
descriptors: ComponentDescriptor[];
|
|
10
|
+
catalog: DescriptorCatalog;
|
|
11
|
+
profile: UiProfile;
|
|
12
|
+
icons: EffectiveIconCatalog;
|
|
13
|
+
iconAdapters: IconAdapterRegistry;
|
|
14
|
+
isKnownComponent: (bareName: string) => boolean;
|
|
15
|
+
legacyTypeOf: (componentName: string) => string | undefined;
|
|
16
|
+
}
|
|
17
|
+
export declare function createScreenEditorRuntime(bundles: ScenePackageBundle[], profile: UiProfile): ScreenEditorRuntime;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ScenePackageBundle } from '@cratis/scene.react';
|
|
2
|
+
import type { PersistedUiProfile } from '../../UiProfile/PersistedUiProfile';
|
|
3
|
+
import { type ScreenEditorRuntime } from './screenEditorRuntime';
|
|
4
|
+
export declare function screenEditorRuntimeForProfile(applied?: PersistedUiProfile, bundles?: ScenePackageBundle[]): ScreenEditorRuntime;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SceneElement } from '@cratis/scene.model';
|
|
2
|
+
import type { OwnershipResolver } from '../Structure/OwnershipResolver';
|
|
3
|
+
import type { StructureTreeAdapter } from '../Structure/StructureTreeAdapter';
|
|
4
|
+
export declare function createSceneStructureAdapter(ownershipOf: OwnershipResolver): StructureTreeAdapter<SceneElement>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SceneElement } from '@cratis/scene.model';
|
|
2
|
+
export declare function childrenOfElement(element: SceneElement): SceneElement[];
|
|
3
|
+
export declare function everyElementId(roots: readonly SceneElement[]): string[];
|
|
4
|
+
export declare function findSceneElement(roots: readonly SceneElement[], id: string): SceneElement | undefined;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type InsertNodeEdit, type MoveNodeEdit, type RemoveNodeEdit, type SceneElement } from '@cratis/scene.model';
|
|
2
|
+
import type { StructureEdit } from '../Structure/StructureEdit';
|
|
3
|
+
export declare function toMoveNodeEdit(edit: StructureEdit): MoveNodeEdit | undefined;
|
|
4
|
+
export declare function toInsertNodeEdit(parentId: string, index: number, element: SceneElement): InsertNodeEdit;
|
|
5
|
+
export declare function toRemoveNodeEdit(elementId: string): RemoveNodeEdit;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SceneDiagnostic, SceneDocument, SceneEdit } from '@cratis/scene.model';
|
|
2
|
+
import { type EditingContext } from '@cratis/scene.engine';
|
|
3
|
+
interface Step {
|
|
4
|
+
before: SceneDocument;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ScreenEditSession {
|
|
8
|
+
document: SceneDocument;
|
|
9
|
+
undoable: readonly Step[];
|
|
10
|
+
redoable: readonly Step[];
|
|
11
|
+
diagnostics: SceneDiagnostic[];
|
|
12
|
+
isDirty: boolean;
|
|
13
|
+
savedDocument: SceneDocument;
|
|
14
|
+
}
|
|
15
|
+
export declare const maximumHistory = 100;
|
|
16
|
+
export declare function openSession(document: SceneDocument): ScreenEditSession;
|
|
17
|
+
export declare function applyToSession(session: ScreenEditSession, edit: SceneEdit, context: EditingContext, label: string): ScreenEditSession;
|
|
18
|
+
export declare function applyAllToSession(session: ScreenEditSession, edits: SceneEdit[], context: EditingContext, label: string): ScreenEditSession;
|
|
19
|
+
export declare const canUndo: (session: ScreenEditSession) => boolean;
|
|
20
|
+
export declare const canRedo: (session: ScreenEditSession) => boolean;
|
|
21
|
+
export declare function undo(session: ScreenEditSession): ScreenEditSession;
|
|
22
|
+
export declare function redo(session: ScreenEditSession): ScreenEditSession;
|
|
23
|
+
export declare function resetSession(document: SceneDocument): ScreenEditSession;
|
|
24
|
+
export declare function markSaved(session: ScreenEditSession): ScreenEditSession;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ScreenEditSession } from './EditSession';
|
|
2
|
+
export declare class SessionCell {
|
|
3
|
+
private latest;
|
|
4
|
+
private readonly publish;
|
|
5
|
+
constructor(latest: ScreenEditSession, publish: (session: ScreenEditSession) => void);
|
|
6
|
+
get current(): ScreenEditSession;
|
|
7
|
+
commit(change: (current: ScreenEditSession) => ScreenEditSession): ScreenEditSession;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare enum StructureEditRejection {
|
|
2
|
+
NodeNotFound = "nodeNotFound",
|
|
3
|
+
TargetNotFound = "targetNotFound",
|
|
4
|
+
TargetNotContainer = "targetNotContainer",
|
|
5
|
+
WouldCreateCycle = "wouldCreateCycle",
|
|
6
|
+
NodeLocked = "nodeLocked",
|
|
7
|
+
TargetLocked = "targetLocked",
|
|
8
|
+
NoChange = "noChange"
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LayoutArrangement } from '@cratis/scene/ScreenEditor';
|
|
2
|
+
import type { Ownership } from './Ownership';
|
|
3
|
+
export interface StructureTreeAdapter<T> {
|
|
4
|
+
idOf(node: T): string;
|
|
5
|
+
nameOf(node: T): string;
|
|
6
|
+
childrenOf(node: T): T[];
|
|
7
|
+
withChildren(node: T, children: T[]): T;
|
|
8
|
+
acceptsChildren(node: T): boolean;
|
|
9
|
+
ownershipOf(node: T): Ownership;
|
|
10
|
+
arrangementOf(node: T): LayoutArrangement | undefined;
|
|
11
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { StructureLocation } from './StructureLocation';
|
|
2
|
+
import type { StructureTreeAdapter } from './StructureTreeAdapter';
|
|
3
|
+
export declare function findStructureNode<T>(roots: T[], id: string, adapter: StructureTreeAdapter<T>, parent?: T | null): StructureLocation<T> | undefined;
|
|
4
|
+
export declare function isWithinStructureNode<T>(node: T, id: string, adapter: StructureTreeAdapter<T>): boolean;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { StructureRow } from './StructureRow';
|
|
2
|
+
import type { StructureTreeAdapter } from './StructureTreeAdapter';
|
|
3
|
+
export declare function flattenStructure<T>(roots: T[], expandedIds: ReadonlySet<string>, adapter: StructureTreeAdapter<T>, depth?: number, parentId?: string | null): StructureRow<T>[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MoveIntent } from './MoveIntent';
|
|
2
|
+
import type { StructureEdit } from './StructureEdit';
|
|
3
|
+
import type { StructureTreeAdapter } from './StructureTreeAdapter';
|
|
4
|
+
export declare function resolveMoveIntentEdit<T>(roots: T[], nodeId: string, intent: MoveIntent, adapter: StructureTreeAdapter<T>): StructureEdit | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DropZone } from './DropZone';
|
|
2
|
+
import type { StructureEdit } from './StructureEdit';
|
|
3
|
+
import type { StructureTreeAdapter } from './StructureTreeAdapter';
|
|
4
|
+
export declare function resolveTreeDrop<T>(roots: T[], movedId: string, targetId: string, zone: DropZone, adapter: StructureTreeAdapter<T>): StructureEdit | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { StructureEdit } from './StructureEdit';
|
|
2
|
+
import { StructureEditRejection } from './StructureEditRejection';
|
|
3
|
+
import type { StructureTreeAdapter } from './StructureTreeAdapter';
|
|
4
|
+
export declare function validateStructureEdit<T>(roots: T[], edit: StructureEdit, adapter: StructureTreeAdapter<T>): StructureEditRejection | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BindingResolver } from '@cratis/scene.engine';
|
|
2
|
+
import type { EffectiveConfiguration } from '@cratis/scene.model';
|
|
3
|
+
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
4
|
+
import type { ScreenEditorEnvironment } from '../Host/ScreenEditorHost';
|
|
5
|
+
export interface ScreenSurfaceProps {
|
|
6
|
+
controller: ScreenEditorController;
|
|
7
|
+
environment: ScreenEditorEnvironment;
|
|
8
|
+
resolveBinding: BindingResolver;
|
|
9
|
+
configuration?: EffectiveConfiguration;
|
|
10
|
+
}
|
|
11
|
+
export declare const ScreenSurface: ({ controller, environment, resolveBinding, configuration }: ScreenSurfaceProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DragEvent } from 'react';
|
|
2
|
+
import { type PalettePayload } from '../Palette/PaletteEntry';
|
|
3
|
+
export declare const paletteMediaType = "application/x-studio-palette-item";
|
|
4
|
+
export declare const elementMediaType = "application/x-studio-element";
|
|
5
|
+
export declare const setPaletteDrag: (event: DragEvent, payload: PalettePayload) => void;
|
|
6
|
+
export declare function readPaletteDrag(event: Pick<DragEvent, 'dataTransfer'>): PalettePayload | undefined;
|
|
7
|
+
export declare const isPaletteDrag: (event: Pick<DragEvent, 'dataTransfer'>) => boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DropRegion } from '../DropRegions/DropRegion';
|
|
2
|
+
export interface Rect {
|
|
3
|
+
left: number;
|
|
4
|
+
top: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
export type RectOf = (elementId: string) => Rect | undefined;
|
|
9
|
+
export interface PlacedRegion {
|
|
10
|
+
region: DropRegion;
|
|
11
|
+
rect: Rect;
|
|
12
|
+
}
|
|
13
|
+
export declare function placeRegion(region: DropRegion, surface: Rect, rectOf: RectOf): Rect | undefined;
|
|
14
|
+
export declare function regionAt(regions: readonly PlacedRegion[], x: number, y: number, slop?: number): PlacedRegion | undefined;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PlacedRegion, Rect } from './dropRegionRects';
|
|
2
|
+
declare const sameRect: (left: Rect | undefined, right: Rect | undefined) => boolean;
|
|
3
|
+
export declare const sameRegions: (left: readonly PlacedRegion[], right: readonly PlacedRegion[]) => boolean;
|
|
4
|
+
export declare const sameSelection: typeof sameRect;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Panel, type SceneDocument, type SceneElement } from '@cratis/scene.model';
|
|
2
|
+
export declare const compositionId = "composition";
|
|
3
|
+
export interface EditorComposition {
|
|
4
|
+
element: Panel;
|
|
5
|
+
roots: SceneElement[];
|
|
6
|
+
templates: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare function composeEditorScreen(document: SceneDocument, authoredTemplate?: string): EditorComposition;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ProvenanceKind, type SceneDocument, type SceneElement } from '@cratis/scene.model';
|
|
2
|
+
import { type EditingContext } from '@cratis/scene.engine';
|
|
3
|
+
import { Ownership } from '../Structure/Ownership';
|
|
4
|
+
import type { OwnershipResolver } from '../Structure/OwnershipResolver';
|
|
5
|
+
export declare function ownershipOfProvenance(kind: `${ProvenanceKind}`): Ownership;
|
|
6
|
+
export declare function resolveOwnership(document: SceneDocument, roots: SceneElement[], context: EditingContext): OwnershipResolver;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export * from './Host/ScreenEditorOverlay';
|
|
2
|
+
export * from './Host/ScreenEditorPrimeReactProvider';
|
|
3
|
+
export * from './Host/ScreenEditorWorkspace';
|
|
4
|
+
export * from './Host/ScreenEditorWindow';
|
|
5
|
+
export * from './Host/ScreenEditorController';
|
|
6
|
+
export * from './Host/ScreenEditorHost';
|
|
7
|
+
export * from './Host/ScreenEditorFileUpload';
|
|
8
|
+
export * from './Host/createScreenEditorEnvironment';
|
|
9
|
+
export * from './Runtime/screenEditorRuntime';
|
|
10
|
+
export * from './Runtime/screenEditorRuntimeForProfile';
|
|
11
|
+
export * from './Inspector/ScreenEditorStrings';
|
|
12
|
+
export * from './Defaults/defaultScreenEditorStrings';
|
|
13
|
+
export * from './PropertyEditors/Json/JsonPropertyField';
|
|
14
|
+
export * from './PropertyEditors/Json/JsonPropertyFieldStrings';
|
|
15
|
+
export * from './PropertyEditors/Json/defaultJsonPropertyFieldStrings';
|
|
16
|
+
export * from './PropertyEditors/Json/isJsonValueType';
|
|
17
|
+
export * from './PropertyEditors/Json/readJson';
|
|
18
|
+
export * from './PropertyEditors/Json/formatJson';
|
|
19
|
+
export * from './Defaults/defaultLayoutLabels';
|
|
20
|
+
export * from './Defaults/defaultLayoutIcons';
|
|
21
|
+
export * from './Defaults/defaultPaletteIcons';
|
|
22
|
+
export * from './Defaults/defaultPaletteSources';
|
|
23
|
+
export * from './Layouts/LayoutItem';
|
|
24
|
+
export * from './Layouts/toLayoutContainerDescriptors';
|
|
25
|
+
export * from './Palette/buildPalette';
|
|
26
|
+
export * from './Actions/StateChangeSlice';
|
|
27
|
+
export * from './Binding/toSceneCandidates';
|
|
28
|
+
export * from './Document/readSceneDocument';
|
|
29
|
+
export * from './Structure/Ownership';
|
|
30
|
+
export * from './Structure/StructureEditRejection';
|
|
31
|
+
export type { PersistedUiProfile } from '../UiProfile/PersistedUiProfile';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Why a package is part of the resolved profile. */
|
|
2
|
+
export declare enum PackageInclusion {
|
|
3
|
+
/** Always present: Scene's `core`, the final fallback every name resolves against. */
|
|
4
|
+
Fallback = "fallback",
|
|
5
|
+
/** Chosen by the user - as a library, the shell or a template pack. */
|
|
6
|
+
Explicit = "explicit",
|
|
7
|
+
/** Not chosen; present only because another package in the profile requires it. */
|
|
8
|
+
Automatic = "automatic"
|
|
9
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A UI profile as it is stored: plain strings, so the host's generated proxy class satisfies it
|
|
3
|
+
* structurally without this package knowing about the host.
|
|
4
|
+
*
|
|
5
|
+
* It carries the resolved package order and the shell's layout as well as the choices, so a consumer that
|
|
6
|
+
* has no package catalog - Play, for one - can still build a Scene `UiProfile` from it.
|
|
7
|
+
*/
|
|
8
|
+
export interface PersistedUiProfile {
|
|
9
|
+
packages: string[];
|
|
10
|
+
shell: string;
|
|
11
|
+
templatePacks: string[];
|
|
12
|
+
resolvedPackages: string[];
|
|
13
|
+
layout: string;
|
|
14
|
+
theme: string;
|
|
15
|
+
colorScheme: string;
|
|
16
|
+
navigationMode: string;
|
|
17
|
+
accent: string;
|
|
18
|
+
defaultScreenTemplate: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PackageKind } from '@cratis/scene.model';
|
|
2
|
+
import { PackageInclusion } from './PackageInclusion';
|
|
3
|
+
/** One package of the resolved profile, with the reason it is there. */
|
|
4
|
+
export interface ResolvedPackageEntry {
|
|
5
|
+
/** The package name. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** The name to show: the manifest's display name, else the package name. */
|
|
8
|
+
displayName: string;
|
|
9
|
+
/** The manifest's one-line description, when it has one. */
|
|
10
|
+
description?: string;
|
|
11
|
+
/** The package's version. */
|
|
12
|
+
version: string;
|
|
13
|
+
/** What the package contributes. */
|
|
14
|
+
kind: PackageKind;
|
|
15
|
+
/** Why the package is present. */
|
|
16
|
+
inclusion: PackageInclusion;
|
|
17
|
+
/** The other resolved packages that declare a dependency on this one, in resolved order. */
|
|
18
|
+
requiredBy: string[];
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Theme, UiProfile } from '@cratis/scene.model';
|
|
2
|
+
import { ComponentResolution, PackageSelection } from '@cratis/scene.engine';
|
|
3
|
+
import { ResolvedPackageEntry } from './ResolvedPackageEntry';
|
|
4
|
+
/** What a {@link UiProfileSettings} amounts to once Scene's resolver has expanded and ordered it. */
|
|
5
|
+
export interface ResolvedUiProfile {
|
|
6
|
+
/** The resolver's own outcome: the ordered packages, what it added, and everything wrong. */
|
|
7
|
+
selection: PackageSelection;
|
|
8
|
+
/** The Scene profile preview, screen editor and Play render through. */
|
|
9
|
+
profile: UiProfile;
|
|
10
|
+
/** The resolved packages in override-priority order, each with its reason. */
|
|
11
|
+
entries: ResolvedPackageEntry[];
|
|
12
|
+
/** Every bare component name more than one active package declares, and which one wins it. */
|
|
13
|
+
collisions: ComponentResolution[];
|
|
14
|
+
/** The themes compatible with every package of the profile. */
|
|
15
|
+
compatibleThemes: Theme[];
|
|
16
|
+
/** The layout of the chosen shell, or empty when there is no usable shell. */
|
|
17
|
+
layout: string;
|
|
18
|
+
/** Whether the resolver found nothing missing, conflicting or cyclic. */
|
|
19
|
+
isValid: boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ColorScheme, LayoutMode } from '@cratis/scene.blueprint.default';
|
|
2
|
+
/**
|
|
3
|
+
* The choices that make up an application's UI profile - what a draft edits and what applying persists.
|
|
4
|
+
*
|
|
5
|
+
* Only the choices are stored. Which packages those choices pull in, in what order and why is always
|
|
6
|
+
* recomputed by Scene's resolver (`resolveUiProfile`), so a stored profile can never disagree with the
|
|
7
|
+
* packages it names about what they require.
|
|
8
|
+
*/
|
|
9
|
+
export interface UiProfileSettings {
|
|
10
|
+
/**
|
|
11
|
+
* The packages chosen explicitly - component libraries, styling, and any other group such as icons -
|
|
12
|
+
* in ascending override priority. `core` is never listed: it is always the final fallback.
|
|
13
|
+
*/
|
|
14
|
+
packages: string[];
|
|
15
|
+
/** The blueprint supplying the application shell, or empty when none is chosen. */
|
|
16
|
+
shell: string;
|
|
17
|
+
/** Further blueprints whose reusable templates are available without changing the shell. */
|
|
18
|
+
templatePacks: string[];
|
|
19
|
+
/** The name of the theme, or empty to take the first one compatible with the profile. */
|
|
20
|
+
theme: string;
|
|
21
|
+
/** Whether the shell renders light or dark. */
|
|
22
|
+
colorScheme: ColorScheme;
|
|
23
|
+
/** How the shell lays out its navigation. */
|
|
24
|
+
navigationMode: LayoutMode;
|
|
25
|
+
/** An accent color as `#rrggbb`, or empty to keep the theme's own. */
|
|
26
|
+
accent: string;
|
|
27
|
+
/** The screen template new screens start from, or empty for none. Chosen per level by Cratis/StudioIssues#396. */
|
|
28
|
+
defaultScreenTemplate: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ScenePackageBundle } from '@cratis/scene.react';
|
|
2
|
+
import { UiProfileSettings } from './UiProfileSettings';
|
|
3
|
+
/**
|
|
4
|
+
* The profile an application has before anyone applies one: the base component library, the styling
|
|
5
|
+
* packages and the first blueprint the catalog offers as the shell.
|
|
6
|
+
*
|
|
7
|
+
* Preview, the screen editor and Play all fall back to this when nothing has been applied, so an
|
|
8
|
+
* application without a stored profile still renders the same everywhere.
|
|
9
|
+
*
|
|
10
|
+
* @param bundles Every known package bundle.
|
|
11
|
+
* @returns The default settings.
|
|
12
|
+
*/
|
|
13
|
+
export declare function defaultUiProfileSettings(bundles: ScenePackageBundle[]): UiProfileSettings;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UiProfileSettings } from './UiProfileSettings';
|
|
2
|
+
/**
|
|
3
|
+
* Every package the settings name, in the order they are handed to the resolver: `core` first, then the
|
|
4
|
+
* libraries in priority order, then the shell, then the template packs. The resolver is a stable sort, so
|
|
5
|
+
* this order is what decides override priority among packages nothing forces apart.
|
|
6
|
+
*
|
|
7
|
+
* @param settings The settings to read.
|
|
8
|
+
* @returns The distinct explicit package names.
|
|
9
|
+
*/
|
|
10
|
+
export declare function explicitPackageNames(settings: UiProfileSettings): string[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fills the `{name}` placeholders of a message.
|
|
3
|
+
*
|
|
4
|
+
* A placeholder with no value is left visible rather than removed, so a missing argument shows up as
|
|
5
|
+
* `{subject}` on screen instead of as a sentence with a silent hole in it.
|
|
6
|
+
*
|
|
7
|
+
* @param template The message, possibly containing `{name}` placeholders.
|
|
8
|
+
* @param values The values to substitute, by placeholder name.
|
|
9
|
+
* @returns The message with every known placeholder replaced.
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatMessage(template: string, values: Record<string, string | undefined>): string;
|