@cratis/event-models 0.154.0 → 0.156.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 (38) hide show
  1. package/dist/screen-editor/ScreenEditor/Collections/orderedItemShape.d.ts +2 -0
  2. package/dist/screen-editor/ScreenEditor/Forms/commandFormElements.d.ts +12 -0
  3. package/dist/screen-editor/ScreenEditor/Forms/formEditing.d.ts +8 -0
  4. package/dist/screen-editor/ScreenEditor/Inspector/CommandFormEditor.d.ts +15 -0
  5. package/dist/screen-editor/ScreenEditor/Inspector/FormEditor.d.ts +12 -0
  6. package/dist/screen-editor/ScreenEditor/Inspector/ScreenEditorStrings.d.ts +19 -5
  7. package/dist/screen-editor/ScreenEditor/PropertyEditors/Structured/PrimitiveListEditor.d.ts +11 -0
  8. package/dist/screen-editor/ScreenEditor/PropertyEditors/Structured/StructuredEditorStrings.d.ts +21 -0
  9. package/dist/screen-editor/ScreenEditor/PropertyEditors/Structured/StructuredProperties.d.ts +9 -0
  10. package/dist/screen-editor/ScreenEditor/PropertyEditors/Structured/StructuredValueEditor.d.ts +11 -0
  11. package/dist/screen-editor/ScreenEditor/PropertyEditors/Structured/UndescribedProperties.d.ts +7 -0
  12. package/dist/screen-editor/ScreenEditor/PropertyEditors/Structured/classifyStructures.d.ts +6 -0
  13. package/dist/screen-editor/ScreenEditor/PropertyEditors/Structured/defaultStructuredEditorStrings.d.ts +2 -0
  14. package/dist/screen-editor/ScreenEditor/PropertyEditors/Structured/index.d.ts +7 -0
  15. package/dist/screen-editor/ScreenEditor/PropertyEditors/Structured/structuredValue.d.ts +16 -0
  16. package/dist/screen-editor/ScreenEditor/Runtime/describeSampleValue.d.ts +4 -0
  17. package/dist/screen-editor/ScreenEditor/index.d.ts +1 -6
  18. package/dist/screen-editor/index.js +5303 -5041
  19. package/dist/screen-editor/screen-editor.css +1 -1
  20. package/package.json +12 -12
  21. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonDraftKind.d.ts +0 -6
  22. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonDraftOutcome.d.ts +0 -13
  23. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonDraftState.d.ts +0 -4
  24. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonProblem.d.ts +0 -5
  25. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonProblemKind.d.ts +0 -6
  26. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonProperties.d.ts +0 -9
  27. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonPropertyField.d.ts +0 -13
  28. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonPropertyFieldStrings.d.ts +0 -9
  29. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonReading.d.ts +0 -8
  30. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/defaultJsonPropertyFieldStrings.d.ts +0 -2
  31. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/describeJsonProblem.d.ts +0 -3
  32. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/formatJson.d.ts +0 -1
  33. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/isJsonValueType.d.ts +0 -4
  34. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/jsonDraft.d.ts +0 -11
  35. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/numberLiteralsOf.d.ts +0 -1
  36. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/readJson.d.ts +0 -2
  37. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/sameJson.d.ts +0 -1
  38. package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/useJsonDraft.d.ts +0 -9
@@ -0,0 +1,2 @@
1
+ import { type PropertyDescriptor } from '@cratis/scene.model';
2
+ export declare const isOrderedItemCollection: (descriptor: PropertyDescriptor) => boolean;
@@ -0,0 +1,12 @@
1
+ import { type SceneEdit, type SceneElement } from '@cratis/scene.model';
2
+ import type { StateChangeSlice } from '../Actions/StateChangeSlice';
3
+ export declare const commandFormComponentName = "commandForm";
4
+ export declare const commandProperty = "command";
5
+ export declare const isCommandFormType: (typeId: string) => boolean;
6
+ export interface CommandFormElement {
7
+ elementId: string;
8
+ command: string;
9
+ commandName: string | undefined;
10
+ }
11
+ export declare function commandFormElements(roots: readonly SceneElement[], slices: readonly StateChangeSlice[]): CommandFormElement[];
12
+ export declare function commandEdit(elementId: string, slice: StateChangeSlice | undefined): SceneEdit;
@@ -0,0 +1,8 @@
1
+ import { FormGenerationMode, type Form, type FormField } from '@cratis/scene.model';
2
+ import type { StateChangeSlice } from '../Actions/StateChangeSlice';
3
+ export declare function autoFormFor(slice: StateChangeSlice): Form;
4
+ export declare function manualFormFor(form: Form, slice: StateChangeSlice): Form;
5
+ export declare function modeFor(form: Form, slice: StateChangeSlice | undefined): FormGenerationMode;
6
+ export declare function replaceField(form: Form, index: number, field: FormField): Form;
7
+ export declare function formOfCommand(forms: readonly Form[], slice: StateChangeSlice | undefined): Form | undefined;
8
+ export declare const sliceOfCommand: (slices: readonly StateChangeSlice[], command: unknown) => StateChangeSlice | undefined;
@@ -0,0 +1,15 @@
1
+ import type { Form } from '@cratis/scene.model';
2
+ import type { StateChangeSlice } from '../Actions/StateChangeSlice';
3
+ import type { ScreenEditorStrings } from './ScreenEditorStrings';
4
+ export interface CommandFormEditorProps {
5
+ elementId: string;
6
+ command: string | undefined;
7
+ slices: readonly StateChangeSlice[];
8
+ forms: readonly Form[];
9
+ strings: ScreenEditorStrings;
10
+ disabled: boolean;
11
+ onCommandChange: (slice: StateChangeSlice | undefined) => void;
12
+ onFormChange: (form: Form) => void;
13
+ onFormCreate: (slice: StateChangeSlice) => void;
14
+ }
15
+ export declare const CommandFormEditor: ({ elementId, command, slices, forms, strings, disabled, onCommandChange, onFormChange, onFormCreate }: CommandFormEditorProps) => import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { type Form } from '@cratis/scene.model';
2
+ import type { StateChangeSlice } from '../Actions/StateChangeSlice';
3
+ import type { ScreenEditorStrings } from './ScreenEditorStrings';
4
+ export interface FormEditorProps {
5
+ form: Form;
6
+ slice: StateChangeSlice | undefined;
7
+ idPrefix: string;
8
+ strings: ScreenEditorStrings['properties']['forms'];
9
+ disabled: boolean;
10
+ onChange: (form: Form) => void;
11
+ }
12
+ export declare const FormEditor: ({ form, slice, idPrefix, strings: text, disabled, onChange }: FormEditorProps) => import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import type { IconPickerLabels } from '@cratis/components/IconPicker';
2
2
  import type { IconPropertyFieldStrings } from '../../Icons/IconPropertyFieldStrings';
3
- import type { JsonPropertyFieldStrings } from '../PropertyEditors/Json/JsonPropertyFieldStrings';
3
+ import type { StructuredEditorStrings } from '../PropertyEditors/Structured/StructuredEditorStrings';
4
4
  import type { Ownership } from '../Structure/Ownership';
5
5
  import type { SceneDocumentProblem } from '../Document/readSceneDocument';
6
6
  import type { StructureEditRejection } from '../Structure/StructureEditRejection';
@@ -70,7 +70,11 @@ export interface ScreenEditorStrings {
70
70
  addItem: string;
71
71
  icon: IconPropertyFieldStrings;
72
72
  iconPickerLabels?: IconPickerLabels;
73
- json?: JsonPropertyFieldStrings;
73
+ structured?: StructuredEditorStrings;
74
+ undescribed?: {
75
+ label: string;
76
+ message: (property: string, valueType: string, editorKind: string | undefined) => string;
77
+ };
74
78
  templates: {
75
79
  label: string;
76
80
  choose: string;
@@ -157,10 +161,19 @@ export interface ScreenEditorStrings {
157
161
  newTemplateName: string;
158
162
  removeBlocked: string;
159
163
  };
164
+ commandForm: {
165
+ label: string;
166
+ command: string;
167
+ none: string;
168
+ unknownCommand: string;
169
+ chooseCommandHint: string;
170
+ createForm: (command: string) => string;
171
+ };
160
172
  forms: {
161
173
  label: string;
162
- add: string;
163
- chooseCommand: string;
174
+ ownedByElements: string;
175
+ presented: string;
176
+ notPresented: string;
164
177
  mode: string;
165
178
  auto: string;
166
179
  manual: string;
@@ -197,7 +210,8 @@ export interface ScreenEditorStrings {
197
210
  literalValue: string;
198
211
  literalType: string;
199
212
  literalNull: string;
200
- invalidJson: string;
213
+ literalStructured: string;
214
+ literalNoEditor: string;
201
215
  unsupportedValue: string;
202
216
  replaceUnsupported: string;
203
217
  incompatibleSource: string;
@@ -0,0 +1,11 @@
1
+ import type { PropertyDescriptor } from '@cratis/scene.model';
2
+ import type { StructuredEditorStrings } from './StructuredEditorStrings';
3
+ export interface PrimitiveListEditorProps {
4
+ descriptor: PropertyDescriptor;
5
+ value: unknown;
6
+ id: string;
7
+ strings: StructuredEditorStrings;
8
+ disabled: boolean;
9
+ onChange: (value: unknown) => void;
10
+ }
11
+ export declare const PrimitiveListEditor: ({ descriptor, value, id, strings, disabled, onChange }: PrimitiveListEditorProps) => import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ export interface StructuredEditorStrings {
2
+ unset: string;
3
+ item: string;
4
+ itemTitle: (item: string, position: number) => string;
5
+ add: (item: string) => string;
6
+ remove: (item: string, position: number) => string;
7
+ removeText: string;
8
+ moveUp: (item: string, position: number) => string;
9
+ moveUpText: string;
10
+ moveDown: (item: string, position: number) => string;
11
+ moveDownText: string;
12
+ entry: (position: number) => string;
13
+ moveEntryUp: (position: number) => string;
14
+ moveEntryDown: (position: number) => string;
15
+ removeEntry: (position: number) => string;
16
+ addEntry: string;
17
+ mismatch: (property: string, problem: string) => string;
18
+ convert: string;
19
+ clear: string;
20
+ noEditor: (property: string) => string;
21
+ }
@@ -0,0 +1,9 @@
1
+ import type { InspectedProperty } from '@cratis/scene.model';
2
+ import type { StructuredEditorStrings } from './StructuredEditorStrings';
3
+ export interface StructuredPropertiesProps {
4
+ properties: readonly InspectedProperty[];
5
+ componentId: string;
6
+ setProperty: (property: InspectedProperty, value: unknown) => void;
7
+ strings: StructuredEditorStrings;
8
+ }
9
+ export declare const StructuredProperties: ({ properties, componentId, setProperty, strings }: StructuredPropertiesProps) => import("react").JSX.Element | null;
@@ -0,0 +1,11 @@
1
+ import { type PropertyDescriptor } from '@cratis/scene.model';
2
+ import type { StructuredEditorStrings } from './StructuredEditorStrings';
3
+ export interface StructuredValueEditorProps {
4
+ descriptor: PropertyDescriptor;
5
+ value: unknown;
6
+ idPrefix: string;
7
+ strings: StructuredEditorStrings;
8
+ disabled: boolean;
9
+ onChange: (value: unknown) => void;
10
+ }
11
+ export declare const StructuredValueEditor: ({ descriptor, value, idPrefix, strings, disabled, onChange }: StructuredValueEditorProps) => import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { InspectedProperty } from '@cratis/scene.model';
2
+ export interface UndescribedPropertiesProps {
3
+ properties: readonly InspectedProperty[];
4
+ label: string;
5
+ message: (property: string, valueType: string, editorKind: string | undefined) => string;
6
+ }
7
+ export declare const UndescribedProperties: ({ properties, label, message }: UndescribedPropertiesProps) => import("react").JSX.Element | null;
@@ -0,0 +1,6 @@
1
+ import { type InspectedProperty } from '@cratis/scene.model';
2
+ export interface ClassifiedStructures {
3
+ structured: InspectedProperty[];
4
+ undescribed: InspectedProperty[];
5
+ }
6
+ export declare function classifyStructures(properties: readonly InspectedProperty[], isDrawnElsewhere: (property: InspectedProperty) => boolean): ClassifiedStructures;
@@ -0,0 +1,2 @@
1
+ import type { StructuredEditorStrings } from './StructuredEditorStrings';
2
+ export declare const defaultStructuredEditorStrings: StructuredEditorStrings;
@@ -0,0 +1,7 @@
1
+ export * from './StructuredEditorStrings';
2
+ export * from './classifyStructures';
3
+ export * from './StructuredProperties';
4
+ export * from './StructuredValueEditor';
5
+ export * from './UndescribedProperties';
6
+ export * from './defaultStructuredEditorStrings';
7
+ export * from './structuredValue';
@@ -0,0 +1,16 @@
1
+ import { type PropertyDescriptor } from '@cratis/scene.model';
2
+ export declare const stringListEditorKind = "studio.stringList";
3
+ export declare const numberListEditorKind = "studio.numberList";
4
+ export declare const isPrimitiveList: (descriptor: PropertyDescriptor) => boolean;
5
+ export declare const isObjectWithFields: (descriptor: PropertyDescriptor) => boolean;
6
+ export declare const isCollectionOfRecords: (descriptor: PropertyDescriptor) => boolean;
7
+ export declare const isStructured: (descriptor: PropertyDescriptor) => boolean;
8
+ export declare const isRecord: (value: unknown) => value is Record<string, unknown>;
9
+ export declare function withField(record: unknown, path: string, value: unknown): Record<string, unknown> | undefined;
10
+ export declare const newItem: () => Record<string, unknown>;
11
+ export declare const identified: (item: unknown) => Record<string, unknown>;
12
+ export declare function withItem(items: readonly unknown[], index: number, item: unknown): unknown[];
13
+ export declare function withoutItem(items: readonly unknown[], index: number): unknown[];
14
+ export declare function movedItem(items: readonly unknown[], index: number, offset: number): unknown[];
15
+ export declare function withIdentities(descriptor: PropertyDescriptor, value: unknown): unknown;
16
+ export declare const asList: (value: unknown) => unknown[];
@@ -0,0 +1,4 @@
1
+ import { type PropertyDescriptor } from '@cratis/scene.model';
2
+ export declare const labelOf: (path: string) => string;
3
+ export declare const singularOf: (plural: string) => string;
4
+ export declare function describeSampleValue(path: string, value: unknown, label?: string): PropertyDescriptor;
@@ -19,12 +19,7 @@ export * from './Viewport/windowSizeMemory';
19
19
  export * from './Viewport/windowSizing';
20
20
  export * from './Inspector/ScreenEditorStrings';
21
21
  export * from './Defaults/defaultScreenEditorStrings';
22
- export * from './PropertyEditors/Json/JsonPropertyField';
23
- export * from './PropertyEditors/Json/JsonPropertyFieldStrings';
24
- export * from './PropertyEditors/Json/defaultJsonPropertyFieldStrings';
25
- export * from './PropertyEditors/Json/isJsonValueType';
26
- export * from './PropertyEditors/Json/readJson';
27
- export * from './PropertyEditors/Json/formatJson';
22
+ export * from './PropertyEditors/Structured';
28
23
  export * from './Defaults/defaultLayoutLabels';
29
24
  export * from './Defaults/defaultLayoutIcons';
30
25
  export * from './Defaults/defaultPaletteIcons';