@cratis/event-models 0.192.0 → 0.194.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.
@@ -1,6 +1,11 @@
1
1
  import { ScenePackage, Theme } from '@cratis/scene.model';
2
2
  import { PackageCatalog } from '@cratis/scene.engine';
3
3
  import { ComponentRegistry, ScenePackageBundle } from '@cratis/scene.react';
4
+ /**
5
+ * The domain blueprints Studio ships: ready-made applications (screens, templates, sample data) that a UI profile can add for their templates.
6
+ * They are listed by the blueprint gallery (StudioIssues#667), which reads the same manifests - there is no second list of what exists.
7
+ */
8
+ export declare const domainBlueprints: ScenePackageBundle[];
4
9
  /**
5
10
  * Every Scene package bundle Studio has loaded.
6
11
  *
@@ -1,4 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
+ import type { SceneDocument } from '@cratis/scene.model';
2
3
  import type { ScreenEditorStrings } from '../Inspector/ScreenEditorStrings';
3
4
  import type { PaletteIcons, PaletteSource } from '../Palette/buildPalette';
4
5
  import type { LayoutLabels } from '../Layouts/toLayoutContainerDescriptors';
@@ -23,5 +24,6 @@ export interface ScreenEditorOverlayProps {
23
24
  onClose: (result: ScreenEditorResult) => void;
24
25
  onBeforeClose?: (result: ScreenEditorResult) => Promise<string | undefined>;
25
26
  onDismiss?: () => void;
27
+ onPreview?: (document: SceneDocument) => void;
26
28
  }
27
29
  export declare const ScreenEditorOverlay: (props: ScreenEditorOverlayProps) => import("react").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import type { SceneDocument } from '@cratis/scene.model';
1
2
  import type { ScreenEditorStrings } from '../Inspector/ScreenEditorStrings';
2
3
  import type { ScreenEditorController } from './ScreenEditorController';
3
4
  import type { ScreenEditorEnvironment } from './ScreenEditorHost';
@@ -26,5 +27,6 @@ export interface ScreenEditorWindowProps {
26
27
  saveFailure?: string;
27
28
  onSave?: () => void;
28
29
  isSaving?: boolean;
30
+ onPreview?: (document: SceneDocument) => void;
29
31
  }
30
- export declare const ScreenEditorWindow: ({ controller, environment, strings, window: state, deviceFrame, saveFailure, onSave, isSaving }: ScreenEditorWindowProps) => import("react").JSX.Element;
32
+ export declare const ScreenEditorWindow: ({ controller, environment, strings, window: state, deviceFrame, saveFailure, onSave, isSaving, onPreview }: ScreenEditorWindowProps) => import("react").JSX.Element;
@@ -54,6 +54,7 @@ export interface ScreenEditorStrings {
54
54
  saveRefused: string;
55
55
  save: string;
56
56
  unsavedChanges: string;
57
+ previewScreen: string;
57
58
  allChangesSaved: string;
58
59
  properties: {
59
60
  screenLabel: string;
@@ -8,4 +8,7 @@ export interface StructureTreeAdapter<T> {
8
8
  acceptsChildren(node: T): boolean;
9
9
  ownershipOf(node: T): Ownership;
10
10
  arrangementOf(node: T): LayoutArrangement | undefined;
11
+ detailOf?(node: T): string | undefined;
12
+ problemsOf?(node: T): number;
13
+ isMovable?(node: T): boolean;
11
14
  }
@@ -0,0 +1,34 @@
1
+ import { n as h, t as n } from "./choiceKeys-DQcUX97p.js";
2
+ import { t as u } from "./SearchableSelect-Cj_cgVO0.js";
3
+ import { jsx as m } from "react/jsx-runtime";
4
+ var L = ({ value: o, onChange: i, descriptor: e, context: r, disabled: d, problem: b, id: s }) => {
5
+ const l = r.strings.editors.select, t = o ?? void 0, c = h(e.choices ?? [], t);
6
+ return /* @__PURE__ */ m(u, {
7
+ id: s,
8
+ options: c.map((a) => ({
9
+ value: a.key,
10
+ label: a.label,
11
+ ...p(e.choices, a.key)
12
+ })),
13
+ value: t === void 0 ? void 0 : n(t),
14
+ disabled: d,
15
+ invalid: b !== void 0,
16
+ placeholder: l.placeholder,
17
+ searchLabel: l.search,
18
+ emptyLabel: l.empty,
19
+ clearLabel: l.clear,
20
+ clearable: e.constraints?.required !== !0,
21
+ "aria-labelledby": `${s}-label`,
22
+ onChange: (a) => i(a === void 0 ? void 0 : c.find((v) => v.key === a)?.value)
23
+ });
24
+ };
25
+ function p(o, i) {
26
+ const e = o?.find((r) => n(r.value) === i);
27
+ return e?.disabledReason === void 0 ? {} : {
28
+ disabled: !0,
29
+ reason: e.disabledReason
30
+ };
31
+ }
32
+ export {
33
+ L as SelectEditor
34
+ };
@@ -7,6 +7,8 @@ export interface TemplatePickerHandlers {
7
7
  onCopyToMine?: (template: ApplicableTemplate) => void;
8
8
  /** The user asked to look at a template before choosing it. Absent when the host cannot show one. */
9
9
  onPreview?: (template: ApplicableTemplate) => void;
10
+ /** The user asked to browse the blueprint gallery, where a blueprint is added to the UI profile. Absent when the host has no gallery. */
11
+ onBrowseGallery?: () => void;
10
12
  /** The user asked for a new template made from what is there now. Absent when that is not offered. */
11
13
  onNewFromCurrent?: () => void;
12
14
  /** The user gave up the choice, so the level inherits again (or has no template). Absent when there is nothing to give up. */
@@ -18,6 +18,8 @@ export interface TemplatePickerLabels {
18
18
  preview: string;
19
19
  /** Shown when nothing applies at the target, or nothing matches the filter. */
20
20
  nothingApplies: string;
21
+ /** The row at the end of the blueprints panel that opens the blueprint gallery. */
22
+ browseGallery: string;
21
23
  /** What the control shows when no template is chosen. */
22
24
  noTemplate: string;
23
25
  /** The accessible name of the menu. */
@@ -1,4 +1,4 @@
1
- import { i as b, n as v, r as k, t as g } from "./toTemplateSources-DHyjt_ff.js";
1
+ import { i as b, n as v, r as k, t as g } from "./toTemplateSources-CgAMAN8N.js";
2
2
  import { useMemo as y } from "react";
3
3
  import { applicableTemplates as S } from "@cratis/scene.engine";
4
4
  import { jsx as m } from "react/jsx-runtime";