@cratis/event-models 0.112.0 → 0.114.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.
Files changed (207) hide show
  1. package/README.md +67 -0
  2. package/dist/Collections/suppliesBoardEditing.d.ts +2 -0
  3. package/dist/index.js +1347 -1347
  4. package/dist/index.js.map +1 -1
  5. package/dist/screen-editor/BlueprintPreview/blueprintPreviewCatalog.d.ts +57 -0
  6. package/dist/screen-editor/BlueprintPreview/initialPackageSelection.d.ts +18 -0
  7. package/dist/screen-editor/IconLibraries/Lucide/index.d.ts +4 -0
  8. package/dist/screen-editor/IconLibraries/Lucide/lucideAdapter.d.ts +2 -0
  9. package/dist/screen-editor/IconLibraries/Lucide/lucideCatalog.d.ts +2 -0
  10. package/dist/screen-editor/IconLibraries/Lucide/lucideManifest.d.ts +3 -0
  11. package/dist/screen-editor/IconLibraries/Lucide/lucidePackage.d.ts +2 -0
  12. package/dist/screen-editor/Icons/IconPickerCatalogState.d.ts +5 -0
  13. package/dist/screen-editor/Icons/IconPropertyField.d.ts +25 -0
  14. package/dist/screen-editor/Icons/IconPropertyFieldStrings.d.ts +8 -0
  15. package/dist/screen-editor/Icons/IconValueProblem.d.ts +7 -0
  16. package/dist/screen-editor/Icons/UseIconPickerCatalogResult.d.ts +7 -0
  17. package/dist/screen-editor/Icons/describeIconValueProblem.d.ts +3 -0
  18. package/dist/screen-editor/Icons/diagnoseIconValue.d.ts +5 -0
  19. package/dist/screen-editor/Icons/effectiveIconCatalogOf.d.ts +3 -0
  20. package/dist/screen-editor/Icons/iconCatalogSourcesOf.d.ts +3 -0
  21. package/dist/screen-editor/Icons/toIconPickerCatalog.d.ts +5 -0
  22. package/dist/screen-editor/Icons/useIconPickerCatalog.d.ts +4 -0
  23. package/dist/screen-editor/ScreenEditor/Actions/ActionModel.d.ts +7 -0
  24. package/dist/screen-editor/ScreenEditor/Actions/ActionPresentation.d.ts +5 -0
  25. package/dist/screen-editor/ScreenEditor/Actions/StateChangeSlice.d.ts +10 -0
  26. package/dist/screen-editor/ScreenEditor/Actions/actionBehavior.d.ts +8 -0
  27. package/dist/screen-editor/ScreenEditor/Actions/diagnoseAction.d.ts +14 -0
  28. package/dist/screen-editor/ScreenEditor/Binding/availableSourcesFor.d.ts +2 -0
  29. package/dist/screen-editor/ScreenEditor/Binding/bindingScopeTypes.d.ts +2 -0
  30. package/dist/screen-editor/ScreenEditor/Binding/previewState.d.ts +17 -0
  31. package/dist/screen-editor/ScreenEditor/Binding/queryBindingModel.d.ts +8 -0
  32. package/dist/screen-editor/ScreenEditor/Binding/settleBinding.d.ts +7 -0
  33. package/dist/screen-editor/ScreenEditor/Binding/toSceneCandidates.d.ts +22 -0
  34. package/dist/screen-editor/ScreenEditor/Collections/orderedItems.d.ts +11 -0
  35. package/dist/screen-editor/ScreenEditor/Defaults/defaultComponentIcons.d.ts +3 -0
  36. package/dist/screen-editor/ScreenEditor/Defaults/defaultLayoutIcons.d.ts +2 -0
  37. package/dist/screen-editor/ScreenEditor/Defaults/defaultLayoutLabels.d.ts +2 -0
  38. package/dist/screen-editor/ScreenEditor/Defaults/defaultPackageIcons.d.ts +6 -0
  39. package/dist/screen-editor/ScreenEditor/Defaults/defaultPaletteIcons.d.ts +2 -0
  40. package/dist/screen-editor/ScreenEditor/Defaults/defaultPaletteSources.d.ts +2 -0
  41. package/dist/screen-editor/ScreenEditor/Defaults/defaultScreenEditorStrings.d.ts +2 -0
  42. package/dist/screen-editor/ScreenEditor/Document/canvasMoveEdits.d.ts +4 -0
  43. package/dist/screen-editor/ScreenEditor/Document/createExternalComponent.d.ts +2 -0
  44. package/dist/screen-editor/ScreenEditor/Document/createPanel.d.ts +6 -0
  45. package/dist/screen-editor/ScreenEditor/Document/frameworkElement.d.ts +21 -0
  46. package/dist/screen-editor/ScreenEditor/Document/placeOnCanvas.d.ts +10 -0
  47. package/dist/screen-editor/ScreenEditor/Document/readSceneDocument.d.ts +15 -0
  48. package/dist/screen-editor/ScreenEditor/Document/studioScreen.d.ts +10 -0
  49. package/dist/screen-editor/ScreenEditor/DropRegions/DropRegion.d.ts +12 -0
  50. package/dist/screen-editor/ScreenEditor/DropRegions/DropRegionKind.d.ts +4 -0
  51. package/dist/screen-editor/ScreenEditor/DropRegions/InsertionAxis.d.ts +5 -0
  52. package/dist/screen-editor/ScreenEditor/DropRegions/computeDropRegions.d.ts +6 -0
  53. package/dist/screen-editor/ScreenEditor/Exposure/exposureEdits.d.ts +10 -0
  54. package/dist/screen-editor/ScreenEditor/Host/DefaultPaletteHost.d.ts +6 -0
  55. package/dist/screen-editor/ScreenEditor/Host/ScreenEditorBoundary.d.ts +8 -0
  56. package/dist/screen-editor/ScreenEditor/Host/ScreenEditorControlProviders.d.ts +7 -0
  57. package/dist/screen-editor/ScreenEditor/Host/ScreenEditorController.d.ts +44 -0
  58. package/dist/screen-editor/ScreenEditor/Host/ScreenEditorFileUpload.d.ts +5 -0
  59. package/dist/screen-editor/ScreenEditor/Host/ScreenEditorHost.d.ts +36 -0
  60. package/dist/screen-editor/ScreenEditor/Host/ScreenEditorOverlay.d.ts +24 -0
  61. package/dist/screen-editor/ScreenEditor/Host/ScreenEditorPrimeReactProvider.d.ts +3 -0
  62. package/dist/screen-editor/ScreenEditor/Host/ScreenEditorWindow.d.ts +28 -0
  63. package/dist/screen-editor/ScreenEditor/Host/ScreenEditorWorkspace.d.ts +21 -0
  64. package/dist/screen-editor/ScreenEditor/Host/UnreadableScreen.d.ts +8 -0
  65. package/dist/screen-editor/ScreenEditor/Host/WindowTitleBar.d.ts +5 -0
  66. package/dist/screen-editor/ScreenEditor/Host/createScreenEditorEnvironment.d.ts +16 -0
  67. package/dist/screen-editor/ScreenEditor/Host/mergeComponentDefaults.d.ts +3 -0
  68. package/dist/screen-editor/ScreenEditor/Host/nextElementId.d.ts +1 -0
  69. package/dist/screen-editor/ScreenEditor/Host/openSubject.d.ts +14 -0
  70. package/dist/screen-editor/ScreenEditor/Host/screenEditorPrimeReactDefaults.d.ts +2 -0
  71. package/dist/screen-editor/ScreenEditor/Host/useScreenEditor.d.ts +4 -0
  72. package/dist/screen-editor/ScreenEditor/Inspector/ActionEditor.d.ts +13 -0
  73. package/dist/screen-editor/ScreenEditor/Inspector/DiagnosticList.d.ts +6 -0
  74. package/dist/screen-editor/ScreenEditor/Inspector/ExposureSection.d.ts +11 -0
  75. package/dist/screen-editor/ScreenEditor/Inspector/IconProperties.d.ts +14 -0
  76. package/dist/screen-editor/ScreenEditor/Inspector/InspectorTab.d.ts +4 -0
  77. package/dist/screen-editor/ScreenEditor/Inspector/LayoutTypeSection.d.ts +10 -0
  78. package/dist/screen-editor/ScreenEditor/Inspector/OwnershipBadge.d.ts +6 -0
  79. package/dist/screen-editor/ScreenEditor/Inspector/PropertiesPanel.d.ts +17 -0
  80. package/dist/screen-editor/ScreenEditor/Inspector/QueryBindingEditor.d.ts +12 -0
  81. package/dist/screen-editor/ScreenEditor/Inspector/ScreenEditorStrings.d.ts +109 -0
  82. package/dist/screen-editor/ScreenEditor/Inspector/ScreenInspector.d.ts +13 -0
  83. package/dist/screen-editor/ScreenEditor/Inspector/StructureTree.d.ts +14 -0
  84. package/dist/screen-editor/ScreenEditor/Inspector/StructureTreeRow.d.ts +21 -0
  85. package/dist/screen-editor/ScreenEditor/Inspector/ViewportControls.d.ts +9 -0
  86. package/dist/screen-editor/ScreenEditor/Inspector/pointerDropZone.d.ts +2 -0
  87. package/dist/screen-editor/ScreenEditor/Layouts/LayoutCatalogEntry.d.ts +11 -0
  88. package/dist/screen-editor/ScreenEditor/Layouts/LayoutItem.d.ts +8 -0
  89. package/dist/screen-editor/ScreenEditor/Layouts/PanelConstruct.d.ts +7 -0
  90. package/dist/screen-editor/ScreenEditor/Layouts/layoutCatalog.d.ts +2 -0
  91. package/dist/screen-editor/ScreenEditor/Layouts/layoutChange.d.ts +13 -0
  92. package/dist/screen-editor/ScreenEditor/Layouts/toLayoutContainerDescriptors.d.ts +9 -0
  93. package/dist/screen-editor/ScreenEditor/Palette/PaletteEntry.d.ts +10 -0
  94. package/dist/screen-editor/ScreenEditor/Palette/PaletteFolders.d.ts +7 -0
  95. package/dist/screen-editor/ScreenEditor/Palette/buildPalette.d.ts +23 -0
  96. package/dist/screen-editor/ScreenEditor/Palette/insertedComponentName.d.ts +2 -0
  97. package/dist/screen-editor/ScreenEditor/Properties/allowedIconChoices.d.ts +3 -0
  98. package/dist/screen-editor/ScreenEditor/Properties/choiceKeys.d.ts +6 -0
  99. package/dist/screen-editor/ScreenEditor/Properties/iconDiagnostics.d.ts +7 -0
  100. package/dist/screen-editor/ScreenEditor/Properties/propertyEdits.d.ts +3 -0
  101. package/dist/screen-editor/ScreenEditor/Properties/toPropertyGroups.d.ts +9 -0
  102. package/dist/screen-editor/ScreenEditor/Properties/visibleProperties.d.ts +2 -0
  103. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonDraftKind.d.ts +6 -0
  104. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonDraftOutcome.d.ts +13 -0
  105. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonDraftState.d.ts +4 -0
  106. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonProblem.d.ts +5 -0
  107. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonProblemKind.d.ts +6 -0
  108. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonProperties.d.ts +9 -0
  109. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonPropertyField.d.ts +13 -0
  110. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonPropertyFieldStrings.d.ts +9 -0
  111. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonReading.d.ts +8 -0
  112. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/defaultJsonPropertyFieldStrings.d.ts +2 -0
  113. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/describeJsonProblem.d.ts +3 -0
  114. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/formatJson.d.ts +1 -0
  115. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/isJsonValueType.d.ts +4 -0
  116. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/jsonDraft.d.ts +11 -0
  117. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/numberLiteralsOf.d.ts +1 -0
  118. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/readJson.d.ts +2 -0
  119. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/sameJson.d.ts +1 -0
  120. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/useJsonDraft.d.ts +9 -0
  121. package/dist/screen-editor/ScreenEditor/PrototypeProjection/LegacyExtras.d.ts +11 -0
  122. package/dist/screen-editor/ScreenEditor/PrototypeProjection/applyLegacyState.d.ts +3 -0
  123. package/dist/screen-editor/ScreenEditor/PrototypeProjection/layoutContainerItems.d.ts +4 -0
  124. package/dist/screen-editor/ScreenEditor/PrototypeProjection/legacyPlacement.d.ts +5 -0
  125. package/dist/screen-editor/ScreenEditor/PrototypeProjection/projectToLegacyElements.d.ts +3 -0
  126. package/dist/screen-editor/ScreenEditor/PrototypeProjection/sceneComponentName.d.ts +3 -0
  127. package/dist/screen-editor/ScreenEditor/PrototypeProjection/withoutNulls.d.ts +1 -0
  128. package/dist/screen-editor/ScreenEditor/Runtime/profileColorScheme.d.ts +2 -0
  129. package/dist/screen-editor/ScreenEditor/Runtime/profileTheme.d.ts +3 -0
  130. package/dist/screen-editor/ScreenEditor/Runtime/screenEditorRuntime.d.ts +17 -0
  131. package/dist/screen-editor/ScreenEditor/Runtime/screenEditorRuntimeForProfile.d.ts +4 -0
  132. package/dist/screen-editor/ScreenEditor/Runtime/serverPrototypeTypes.d.ts +3 -0
  133. package/dist/screen-editor/ScreenEditor/Runtime/useLoadedIconCatalog.d.ts +2 -0
  134. package/dist/screen-editor/ScreenEditor/Runtime/withActionPresentation.d.ts +2 -0
  135. package/dist/screen-editor/ScreenEditor/Runtime/withPlacementProperties.d.ts +3 -0
  136. package/dist/screen-editor/ScreenEditor/Runtime/withSampleContentProperties.d.ts +3 -0
  137. package/dist/screen-editor/ScreenEditor/Selection/panelLayoutItem.d.ts +3 -0
  138. package/dist/screen-editor/ScreenEditor/Selection/sceneStructureAdapter.d.ts +4 -0
  139. package/dist/screen-editor/ScreenEditor/Selection/sceneTree.d.ts +6 -0
  140. package/dist/screen-editor/ScreenEditor/Selection/surfaceArrangementOfRoot.d.ts +3 -0
  141. package/dist/screen-editor/ScreenEditor/Selection/surfaceLayoutOfRoot.d.ts +3 -0
  142. package/dist/screen-editor/ScreenEditor/Selection/toSceneEdits.d.ts +5 -0
  143. package/dist/screen-editor/ScreenEditor/Session/EditSession.d.ts +25 -0
  144. package/dist/screen-editor/ScreenEditor/Session/SessionCell.d.ts +8 -0
  145. package/dist/screen-editor/ScreenEditor/Structure/DropZone.d.ts +5 -0
  146. package/dist/screen-editor/ScreenEditor/Structure/MoveIntent.d.ts +6 -0
  147. package/dist/screen-editor/ScreenEditor/Structure/Ownership.d.ts +5 -0
  148. package/dist/screen-editor/ScreenEditor/Structure/OwnershipResolver.d.ts +2 -0
  149. package/dist/screen-editor/ScreenEditor/Structure/StructureEdit.d.ts +5 -0
  150. package/dist/screen-editor/ScreenEditor/Structure/StructureEditRejection.d.ts +9 -0
  151. package/dist/screen-editor/ScreenEditor/Structure/StructureLocation.d.ts +6 -0
  152. package/dist/screen-editor/ScreenEditor/Structure/StructureOperation.d.ts +9 -0
  153. package/dist/screen-editor/ScreenEditor/Structure/StructureRow.d.ts +8 -0
  154. package/dist/screen-editor/ScreenEditor/Structure/StructureTreeAdapter.d.ts +11 -0
  155. package/dist/screen-editor/ScreenEditor/Structure/findStructureNode.d.ts +4 -0
  156. package/dist/screen-editor/ScreenEditor/Structure/flattenStructure.d.ts +3 -0
  157. package/dist/screen-editor/ScreenEditor/Structure/isDeleteKey.d.ts +15 -0
  158. package/dist/screen-editor/ScreenEditor/Structure/isOperationPermitted.d.ts +3 -0
  159. package/dist/screen-editor/ScreenEditor/Structure/removal.d.ts +3 -0
  160. package/dist/screen-editor/ScreenEditor/Structure/resolveMoveIntentEdit.d.ts +4 -0
  161. package/dist/screen-editor/ScreenEditor/Structure/resolveTreeDrop.d.ts +4 -0
  162. package/dist/screen-editor/ScreenEditor/Structure/surfaceMoveEdit.d.ts +3 -0
  163. package/dist/screen-editor/ScreenEditor/Structure/validateStructureEdit.d.ts +4 -0
  164. package/dist/screen-editor/ScreenEditor/Surface/DesignTime/DesignTimeComponent.d.ts +4 -0
  165. package/dist/screen-editor/ScreenEditor/Surface/DesignTime/DesignTimePlaceholder.d.ts +7 -0
  166. package/dist/screen-editor/ScreenEditor/Surface/DesignTime/DesignTimePlaceholderTone.d.ts +5 -0
  167. package/dist/screen-editor/ScreenEditor/Surface/DesignTime/OverlayPreview.d.ts +12 -0
  168. package/dist/screen-editor/ScreenEditor/Surface/DesignTime/SurfaceStrings.d.ts +12 -0
  169. package/dist/screen-editor/ScreenEditor/Surface/DesignTime/designTimeRegistry.d.ts +3 -0
  170. package/dist/screen-editor/ScreenEditor/Surface/DesignTime/designTimeSamples.d.ts +7 -0
  171. package/dist/screen-editor/ScreenEditor/Surface/DesignTime/overlayKinds.d.ts +8 -0
  172. package/dist/screen-editor/ScreenEditor/Surface/DesignTime/useRendersVisibleContent.d.ts +3 -0
  173. package/dist/screen-editor/ScreenEditor/Surface/DropIndicator.d.ts +6 -0
  174. package/dist/screen-editor/ScreenEditor/Surface/ScreenSurface.d.ts +14 -0
  175. package/dist/screen-editor/ScreenEditor/Surface/dragPayload.d.ts +12 -0
  176. package/dist/screen-editor/ScreenEditor/Surface/dropRegionRects.d.ts +13 -0
  177. package/dist/screen-editor/ScreenEditor/Surface/elementRect.d.ts +2 -0
  178. package/dist/screen-editor/ScreenEditor/Surface/resolveDropTarget.d.ts +6 -0
  179. package/dist/screen-editor/ScreenEditor/Surface/sameMeasurement.d.ts +5 -0
  180. package/dist/screen-editor/ScreenEditor/Surface/useSurfaceDrop.d.ts +22 -0
  181. package/dist/screen-editor/ScreenEditor/Surface/useSurfaceMeasurement.d.ts +9 -0
  182. package/dist/screen-editor/ScreenEditor/Templates/composeEditorScreen.d.ts +8 -0
  183. package/dist/screen-editor/ScreenEditor/Templates/templateProvenance.d.ts +6 -0
  184. package/dist/screen-editor/ScreenEditor/Viewport/ViewportPreset.d.ts +4 -0
  185. package/dist/screen-editor/ScreenEditor/Viewport/ViewportSize.d.ts +4 -0
  186. package/dist/screen-editor/ScreenEditor/Viewport/detectViewportPreset.d.ts +3 -0
  187. package/dist/screen-editor/ScreenEditor/Viewport/resolveViewportSizeClass.d.ts +3 -0
  188. package/dist/screen-editor/ScreenEditor/Viewport/toWindowSize.d.ts +3 -0
  189. package/dist/screen-editor/ScreenEditor/Viewport/viewportPresets.d.ts +4 -0
  190. package/dist/screen-editor/ScreenEditor/index.d.ts +32 -0
  191. package/dist/screen-editor/UiProfile/PackageInclusion.d.ts +9 -0
  192. package/dist/screen-editor/UiProfile/PersistedUiProfile.d.ts +19 -0
  193. package/dist/screen-editor/UiProfile/ResolvedPackageEntry.d.ts +19 -0
  194. package/dist/screen-editor/UiProfile/ResolvedUiProfile.d.ts +20 -0
  195. package/dist/screen-editor/UiProfile/UiProfileSettings.d.ts +29 -0
  196. package/dist/screen-editor/UiProfile/defaultUiProfileSettings.d.ts +13 -0
  197. package/dist/screen-editor/UiProfile/explicitPackageNames.d.ts +10 -0
  198. package/dist/screen-editor/UiProfile/formatMessage.d.ts +11 -0
  199. package/dist/screen-editor/UiProfile/resolveUiProfile.d.ts +18 -0
  200. package/dist/screen-editor/UiProfile/shellLayoutOf.d.ts +10 -0
  201. package/dist/screen-editor/UiProfile/toSceneUiProfile.d.ts +12 -0
  202. package/dist/screen-editor/UiProfileDesigner/filterCompatibleThemes.d.ts +12 -0
  203. package/dist/screen-editor/UiProfileDesigner/findComponentCollisions.d.ts +15 -0
  204. package/dist/screen-editor/catalog-CZx3FR-E.js +4 -0
  205. package/dist/screen-editor/index.js +4705 -0
  206. package/dist/screen-editor/screen-editor.css +2 -0
  207. package/package.json +105 -13
@@ -0,0 +1,9 @@
1
+ import type { InspectedProperty } from '@cratis/scene.model';
2
+ import type { JsonPropertyFieldStrings } from './JsonPropertyFieldStrings';
3
+ export interface JsonPropertiesProps {
4
+ properties: readonly InspectedProperty[];
5
+ componentId: string;
6
+ setProperty: (property: InspectedProperty, value: unknown) => void;
7
+ strings?: JsonPropertyFieldStrings;
8
+ }
9
+ export declare const JsonProperties: ({ properties, componentId, setProperty, strings }: JsonPropertiesProps) => import("react").JSX.Element | null;
@@ -0,0 +1,13 @@
1
+ import type { JsonPropertyFieldStrings } from './JsonPropertyFieldStrings';
2
+ export interface JsonPropertyFieldProps {
3
+ label: string;
4
+ description?: string;
5
+ value: unknown;
6
+ onApply: (value: unknown) => void;
7
+ readOnly?: boolean;
8
+ reason?: string;
9
+ required?: boolean;
10
+ strings: JsonPropertyFieldStrings;
11
+ rows?: number;
12
+ }
13
+ export declare const JsonPropertyField: ({ label, description, value, onApply, readOnly, reason, required, strings, rows }: JsonPropertyFieldProps) => import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ export interface JsonPropertyFieldStrings {
2
+ placeholder: string;
3
+ problems: {
4
+ required: string;
5
+ syntax: (detail: string) => string;
6
+ unsafeInteger: (literal: string) => string;
7
+ outOfRange: (literal: string) => string;
8
+ };
9
+ }
@@ -0,0 +1,8 @@
1
+ import type { JsonProblem } from './JsonProblem';
2
+ export type JsonReading = {
3
+ value: unknown;
4
+ problem?: undefined;
5
+ } | {
6
+ problem: JsonProblem;
7
+ value?: undefined;
8
+ };
@@ -0,0 +1,2 @@
1
+ import type { JsonPropertyFieldStrings } from './JsonPropertyFieldStrings';
2
+ export declare const defaultJsonPropertyFieldStrings: JsonPropertyFieldStrings;
@@ -0,0 +1,3 @@
1
+ import type { JsonProblem } from './JsonProblem';
2
+ import type { JsonPropertyFieldStrings } from './JsonPropertyFieldStrings';
3
+ export declare function describeJsonProblem(problem: JsonProblem, strings: JsonPropertyFieldStrings): string;
@@ -0,0 +1 @@
1
+ export declare const formatJson: (value: unknown) => string;
@@ -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,2 @@
1
+ import type { JsonReading } from './JsonReading';
2
+ export declare function readJson(text: string): JsonReading;
@@ -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,11 @@
1
+ export interface LegacyExtras {
2
+ top: Record<string, unknown>;
3
+ topKeys: string[];
4
+ canvas: Record<string, unknown>;
5
+ position: {
6
+ x: number;
7
+ y: number;
8
+ };
9
+ slots: Record<string, unknown>;
10
+ emptyName: boolean;
11
+ }
@@ -0,0 +1,3 @@
1
+ export declare function applyLegacyState(element: object, top: Record<string, unknown>, zIndex: number): void;
2
+ export declare function appliedState(top: Record<string, unknown>): Record<string, unknown>;
3
+ export declare const stateFields: string[];
@@ -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,5 @@
1
+ export declare const canvasLeft = "Canvas.Left";
2
+ export declare const canvasTop = "Canvas.Top";
3
+ export declare const legacyTypeKey = "legacyType";
4
+ export declare const legacyOriginalKey = "legacy";
5
+ export declare const legacyExtrasKey = "legacyExtras";
@@ -0,0 +1,3 @@
1
+ import type { Panel } from '@cratis/scene.model';
2
+ export type NativeLegacyType = (componentName: string) => string | undefined;
3
+ export declare function projectToLegacyElements(root: Panel | undefined, nativeType?: NativeLegacyType): unknown[];
@@ -0,0 +1,3 @@
1
+ export declare function sceneComponentName(legacyType: string): string;
2
+ export declare function legacyClassName(componentName: string): string;
3
+ export declare function legacyLibrary(legacyType: string): string;
@@ -0,0 +1 @@
1
+ export declare function withoutNulls<T>(value: T): T;
@@ -0,0 +1,2 @@
1
+ import type { Theme } from '@cratis/scene.model';
2
+ export declare function profileColorSchemeClasses(theme: Pick<Theme, 'isDark'> | undefined): string;
@@ -0,0 +1,3 @@
1
+ import type { Theme } from '@cratis/scene.model';
2
+ import type { ScreenEditorRuntime } from './screenEditorRuntime';
3
+ export declare function profileTheme(runtime: Pick<ScreenEditorRuntime, 'bundles' | 'profile'>): Theme | undefined;
@@ -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,3 @@
1
+ export declare const unreadablePrototypeTypes: readonly string[];
2
+ export declare const registeredPrototypeTypes: readonly string[];
3
+ export declare const serverPrototypeTypes: ReadonlySet<string>;
@@ -0,0 +1,2 @@
1
+ import type { EffectiveIconCatalog } from '@cratis/scene.engine';
2
+ export declare function useLoadedIconCatalog(catalog: EffectiveIconCatalog): number;
@@ -0,0 +1,2 @@
1
+ import { type ComponentDescriptor } from '@cratis/scene.model';
2
+ export declare function withActionPresentation(descriptor: ComponentDescriptor): ComponentDescriptor;
@@ -0,0 +1,3 @@
1
+ import { type ComponentDescriptor } from '@cratis/scene.model';
2
+ export declare const placementGroup = "Placement";
3
+ export declare function withPlacementProperties(descriptor: ComponentDescriptor): ComponentDescriptor;
@@ -0,0 +1,3 @@
1
+ import { type ComponentDescriptor } from '@cratis/scene.model';
2
+ export declare const contentGroup = "Content";
3
+ export declare function withSampleContentProperties(descriptor: ComponentDescriptor): ComponentDescriptor;
@@ -0,0 +1,3 @@
1
+ import { type Panel } from '@cratis/scene.model';
2
+ import { LayoutItem } from '../Layouts/LayoutItem';
3
+ export declare function panelLayoutItem(panel: Panel): LayoutItem | undefined;
@@ -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,6 @@
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;
5
+ export declare function parentOf(roots: readonly SceneElement[], id: string): SceneElement | undefined;
6
+ export declare function isCanvasHolding(roots: readonly SceneElement[], id: string): boolean;
@@ -0,0 +1,3 @@
1
+ import type { Panel } from '@cratis/scene.model';
2
+ import { LayoutArrangement } from '@cratis/scene/ScreenEditor';
3
+ export declare function surfaceArrangementOfRoot(root: Panel | undefined): LayoutArrangement;
@@ -0,0 +1,3 @@
1
+ import { PrototypeLayout } from '@cratis/scene';
2
+ import { type Panel } from '@cratis/scene.model';
3
+ export declare function surfaceLayoutOfRoot(root: Panel | undefined): PrototypeLayout;
@@ -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,5 @@
1
+ export declare enum DropZone {
2
+ Before = "before",
3
+ Inside = "inside",
4
+ After = "after"
5
+ }
@@ -0,0 +1,6 @@
1
+ export declare enum MoveIntent {
2
+ MoveUp = "moveUp",
3
+ MoveDown = "moveDown",
4
+ Outdent = "outdent",
5
+ Indent = "indent"
6
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum Ownership {
2
+ Local = "local",
3
+ Inherited = "inherited",
4
+ ConfigurableInherited = "configurableInherited"
5
+ }
@@ -0,0 +1,2 @@
1
+ import type { Ownership } from './Ownership';
2
+ export type OwnershipResolver = (elementId: string) => Ownership;
@@ -0,0 +1,5 @@
1
+ export interface StructureEdit {
2
+ nodeId: string;
3
+ targetParentId: string | null;
4
+ index: number;
5
+ }
@@ -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,6 @@
1
+ export interface StructureLocation<T> {
2
+ node: T;
3
+ parent: T | null;
4
+ index: number;
5
+ siblings: T[];
6
+ }
@@ -0,0 +1,9 @@
1
+ export declare enum StructureOperation {
2
+ Select = "select",
3
+ Configure = "configure",
4
+ Move = "move",
5
+ Resize = "resize",
6
+ Restyle = "restyle",
7
+ Insert = "insert",
8
+ Delete = "delete"
9
+ }
@@ -0,0 +1,8 @@
1
+ export interface StructureRow<T> {
2
+ node: T;
3
+ id: string;
4
+ depth: number;
5
+ parentId: string | null;
6
+ hasChildren: boolean;
7
+ isExpanded: boolean;
8
+ }
@@ -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,15 @@
1
+ export declare const isTypingTarget: (target: EventTarget | null) => boolean;
2
+ export interface DeleteKeyEvent {
3
+ key: string;
4
+ ctrlKey: boolean;
5
+ metaKey: boolean;
6
+ altKey: boolean;
7
+ shiftKey: boolean;
8
+ defaultPrevented: boolean;
9
+ repeat?: boolean;
10
+ target: EventTarget | null;
11
+ nativeEvent?: {
12
+ isComposing?: boolean;
13
+ };
14
+ }
15
+ export declare const isDeleteKey: (event: DeleteKeyEvent) => boolean;
@@ -0,0 +1,3 @@
1
+ import { Ownership } from './Ownership';
2
+ import { StructureOperation } from './StructureOperation';
3
+ export declare function isOperationPermitted(ownership: Ownership, operation: StructureOperation): boolean;
@@ -0,0 +1,3 @@
1
+ import type { StructureTreeAdapter } from './StructureTreeAdapter';
2
+ export declare function isRemovable<T>(roots: T[], id: string, adapter: StructureTreeAdapter<T>): boolean;
3
+ export declare function selectionAfterRemoval<T>(roots: T[], id: string, adapter: StructureTreeAdapter<T>): string | undefined;
@@ -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,3 @@
1
+ import type { StructureEdit } from './StructureEdit';
2
+ import type { StructureTreeAdapter } from './StructureTreeAdapter';
3
+ export declare function surfaceMoveEdit<T>(roots: T[], adapter: StructureTreeAdapter<T>, movedId: string, containerId: string, markerIndex: number): 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,4 @@
1
+ import { type ComponentType } from 'react';
2
+ import type { RegisteredComponentProps } from '@cratis/scene.react';
3
+ import type { SurfaceStrings } from './SurfaceStrings';
4
+ export declare function designTimeComponent(registryKey: string, Component: ComponentType<RegisteredComponentProps>, strings: SurfaceStrings, message?: ComponentType<RegisteredComponentProps>): ComponentType<RegisteredComponentProps>;
@@ -0,0 +1,7 @@
1
+ import { DesignTimePlaceholderTone } from './DesignTimePlaceholderTone';
2
+ export interface DesignTimePlaceholderProps {
3
+ elementId: string;
4
+ tone: DesignTimePlaceholderTone;
5
+ text: string;
6
+ }
7
+ export declare const DesignTimePlaceholder: ({ elementId, tone, text }: DesignTimePlaceholderProps) => import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare enum DesignTimePlaceholderTone {
2
+ Empty = "empty",
3
+ Failed = "failed",
4
+ Declaration = "declaration"
5
+ }
@@ -0,0 +1,12 @@
1
+ import { type ComponentType, type ReactNode } from 'react';
2
+ import type { ExternalComponent } from '@cratis/scene.model';
3
+ import type { RegisteredComponentProps } from '@cratis/scene.react';
4
+ import { OverlayKind } from './overlayKinds';
5
+ export interface OverlayPreviewProps {
6
+ kind: OverlayKind;
7
+ tag: string;
8
+ element: ExternalComponent;
9
+ slots: Record<string, ReactNode[]>;
10
+ message?: ComponentType<RegisteredComponentProps>;
11
+ }
12
+ export declare function OverlayPreview({ kind, tag, element, slots, message }: OverlayPreviewProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ export interface SurfaceStrings {
2
+ emptyContainer: string;
3
+ moveHandle: (name: string) => string;
4
+ dropTarget: (where: 'into' | 'between') => string;
5
+ dropDenied: string;
6
+ nothingToShow: (name: string) => string;
7
+ declaration: (name: string) => string;
8
+ sampleContent: (properties: string[]) => string;
9
+ overlay: (name: string) => string;
10
+ unavailable: (name: string) => string;
11
+ failedToDraw: (name: string, reason: string) => string;
12
+ }
@@ -0,0 +1,3 @@
1
+ import type { ComponentRegistry } from '@cratis/scene.react';
2
+ import type { SurfaceStrings } from './SurfaceStrings';
3
+ export declare function designTimeRegistry(registry: ComponentRegistry, strings: SurfaceStrings): ComponentRegistry;
@@ -0,0 +1,7 @@
1
+ export type SampleProperties = Readonly<Record<string, unknown>>;
2
+ export declare const designTimeSamples: Readonly<Record<string, SampleProperties>>;
3
+ export declare const declarationComponents: ReadonlySet<string>;
4
+ export declare const bareNameOf: (componentName: string) => string;
5
+ export declare const sampleOf: (registryKey: string, componentName: string) => SampleProperties | undefined;
6
+ export declare function withSampleProperties(registryKey: string, componentName: string, properties: Readonly<Record<string, unknown>> | undefined): Record<string, unknown>;
7
+ export declare function sampleKeysInUse(registryKey: string, componentName: string, properties: Readonly<Record<string, unknown>> | undefined): string[];
@@ -0,0 +1,8 @@
1
+ export declare enum OverlayKind {
2
+ Window = "window",
3
+ Toast = "toast",
4
+ Tooltip = "tooltip",
5
+ Mask = "mask",
6
+ Busy = "busy"
7
+ }
8
+ export declare const overlayKinds: Readonly<Record<string, OverlayKind>>;
@@ -0,0 +1,3 @@
1
+ import { type RefObject } from 'react';
2
+ export declare const holdsVisibleContent: (probe: Element) => boolean;
3
+ export declare function useRendersVisibleContent(probe: RefObject<HTMLElement | null>, dependency: unknown): boolean;
@@ -0,0 +1,6 @@
1
+ import type { DragFeedback } from './useSurfaceDrop';
2
+ export interface DropIndicatorProps {
3
+ feedback: DragFeedback;
4
+ deniedText: string;
5
+ }
6
+ export declare const DropIndicator: ({ feedback, deniedText }: DropIndicatorProps) => import("react").JSX.Element;
@@ -0,0 +1,14 @@
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
+ import type { SurfaceStrings } from './DesignTime/SurfaceStrings';
6
+ export interface ScreenSurfaceProps {
7
+ controller: ScreenEditorController;
8
+ environment: ScreenEditorEnvironment;
9
+ resolveBinding: BindingResolver;
10
+ configuration?: EffectiveConfiguration;
11
+ strings: SurfaceStrings;
12
+ viewportHeight?: number;
13
+ }
14
+ export declare const ScreenSurface: ({ controller, environment, resolveBinding, configuration, strings, viewportHeight }: ScreenSurfaceProps) => import("react").JSX.Element;
@@ -0,0 +1,12 @@
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 function setDragPreview(event: Pick<DragEvent, 'dataTransfer'>, label: string, icon?: Element | null): void;
6
+ export declare const setPaletteDrag: (event: DragEvent, payload: PalettePayload, label?: string) => void;
7
+ export declare const setElementDrag: (event: DragEvent, elementId: string, label: string) => void;
8
+ export declare const readElementDrag: (event: Pick<DragEvent, 'dataTransfer'>) => string | undefined;
9
+ export declare const isElementDrag: (event: Pick<DragEvent, 'dataTransfer'>) => boolean;
10
+ export declare const isSurfaceDrag: (event: Pick<DragEvent, 'dataTransfer'>) => boolean;
11
+ export declare function readPaletteDrag(event: Pick<DragEvent, 'dataTransfer'>): PalettePayload | undefined;
12
+ export declare const isPaletteDrag: (event: Pick<DragEvent, 'dataTransfer'>) => boolean;
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,2 @@
1
+ import type { Rect } from './dropRegionRects';
2
+ export declare function elementRect(surface: Element, elementId: string, origin: DOMRect): Rect | undefined;
@@ -0,0 +1,6 @@
1
+ import type { PlacedRegion, Rect } from './dropRegionRects';
2
+ export interface ResolvedDrop {
3
+ target: PlacedRegion;
4
+ container: Rect;
5
+ }
6
+ export declare function resolveDropTarget(regions: readonly PlacedRegion[], x: number, y: number, edge?: number): ResolvedDrop | 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,22 @@
1
+ import { type DragEvent, type RefObject } from 'react';
2
+ import type { ScreenEditorController } from '../Host/ScreenEditorController';
3
+ import type { PlacedRegion } from './dropRegionRects';
4
+ import { type ResolvedDrop } from './resolveDropTarget';
5
+ export interface DragFeedback {
6
+ drop?: ResolvedDrop;
7
+ denied: boolean;
8
+ }
9
+ type Controller = Pick<ScreenEditorController, 'insertComponent' | 'insertLayout' | 'ownershipOf' | 'move' | 'validateMove' | 'composition' | 'adapter'>;
10
+ export declare function useSurfaceDrop(surface: RefObject<HTMLDivElement | null>, measureNow: () => PlacedRegion[], controller: Controller): {
11
+ feedback: DragFeedback | undefined;
12
+ draggedId: string | undefined;
13
+ startMoving: (elementId: string) => void;
14
+ endMoving: () => void;
15
+ handlers: {
16
+ onDragEnter: (event: DragEvent) => void;
17
+ onDragOver: (event: DragEvent) => void;
18
+ onDragLeave: (event: DragEvent) => void;
19
+ onDrop: (event: DragEvent) => void;
20
+ };
21
+ };
22
+ export {};