@cratis/event-models 0.222.6 → 0.223.1

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 (34) hide show
  1. package/dist/Model/StickyNote.d.ts +2 -0
  2. package/dist/Model/StickyNoteColour.d.ts +8 -0
  3. package/dist/Model/index.d.ts +1 -0
  4. package/dist/StickyNotes/StickyNoteChanges.d.ts +2 -1
  5. package/dist/StickyNotes/StickyNoteColourPalette.d.ts +7 -0
  6. package/dist/StickyNotes/StickyNotes.d.ts +1 -1
  7. package/dist/StickyNotes/index.d.ts +2 -0
  8. package/dist/StickyNotes/stickyNoteColours.d.ts +10 -0
  9. package/dist/event-model-document.schema.json +4 -0
  10. package/dist/event-models.css +1 -1
  11. package/dist/index.js +2363 -2285
  12. package/dist/index.js.map +1 -1
  13. package/dist/screen-editor/{BindingExpressionPropertyEditor-ClMKmJ_3.js → BindingExpressionPropertyEditor-w3_NmhK7.js} +2 -2
  14. package/dist/screen-editor/{CollectionEditor-C7eX8Hw7.js → CollectionEditor-DoTQJiqE.js} +3 -3
  15. package/dist/screen-editor/{IconEditor-C0ibqn-e.js → IconEditor-qXyGbGEX.js} +5 -5
  16. package/dist/screen-editor/{QueryBindingPropertyEditor-BQa1v9AT.js → QueryBindingPropertyEditor-Cu4PTcOz.js} +4 -4
  17. package/dist/screen-editor/ScreenEditor/DropRegions/computeDropRegions.d.ts +1 -1
  18. package/dist/screen-editor/ScreenEditor/Host/ScreenEditorOverlayFrame.d.ts +23 -0
  19. package/dist/screen-editor/ScreenEditor/Host/fitOverlay.d.ts +14 -0
  20. package/dist/screen-editor/ScreenEditor/Layouts/LayoutArrangement.d.ts +8 -0
  21. package/dist/screen-editor/ScreenEditor/Layouts/LayoutCatalogEntry.d.ts +1 -1
  22. package/dist/screen-editor/ScreenEditor/Layouts/LayoutContainerDescriptor.d.ts +10 -0
  23. package/dist/screen-editor/ScreenEditor/Layouts/toLayoutContainerDescriptors.d.ts +1 -1
  24. package/dist/screen-editor/ScreenEditor/Selection/surfaceArrangementOfRoot.d.ts +1 -1
  25. package/dist/screen-editor/ScreenEditor/Structure/StructureTreeAdapter.d.ts +1 -1
  26. package/dist/screen-editor/ScreenEditor/index.d.ts +2 -0
  27. package/dist/screen-editor/{StructuredPropertyEditor-B3lVjrHZ.js → StructuredPropertyEditor-Bd-8GBgK.js} +1 -1
  28. package/dist/screen-editor/{TemplatePropertyEditor-CDKWG7m1.js → TemplatePropertyEditor-JGA5uEfP.js} +2 -2
  29. package/dist/screen-editor/index.js +2256 -2136
  30. package/dist/screen-editor/screen-editor.css +1 -1
  31. package/dist/screen-editor/{toTemplateSources-B9ALGe3x.js → toTemplateSources-Chd2UNJQ.js} +5 -5
  32. package/package.json +4 -4
  33. package/dist/screen-editor/{StructuredValueEditor-CcwyOga0.js → StructuredValueEditor-DUSATTWd.js} +1 -1
  34. package/dist/screen-editor/{allowedIconChoices-DBgeRdGI.js → allowedIconChoices-KSkQ6blx.js} +1 -1
@@ -1,9 +1,9 @@
1
1
  import { a as V, i as _, l as J, n as I, o as R, r as O, s as Q, t as j } from "./defaultStructuredEditorStrings-Ch1I0Lci.js";
2
2
  import { c as w } from "./structuredValue-vqCZttsk.js";
3
- import { t as D } from "./StructuredValueEditor-CcwyOga0.js";
3
+ import { t as D } from "./StructuredValueEditor-DUSATTWd.js";
4
4
  import { useEffect as K, useRef as E, useState as F } from "react";
5
- import { BindingSourceKind as d, PropertyValueType as C } from "@cratis/scene.model";
6
5
  import { Fragment as x, jsx as t, jsxs as i } from "react/jsx-runtime";
6
+ import { BindingSourceKind as d, PropertyValueType as C } from "@cratis/scene.model";
7
7
  var u = /* @__PURE__ */ (function(e) {
8
8
  return e.String = "string", e.Number = "number", e.Boolean = "boolean", e.Null = "null", e.Json = "json", e;
9
9
  })(u || {}), $ = ({ property: e, sources: l, strings: s, disabled: c, onChange: p }) => {
@@ -1,8 +1,8 @@
1
1
  import { a as u, i as D, r as T, t as A } from "./iconDiagnostics-Ds4CnqD0.js";
2
- import { n as P, t as $ } from "./allowedIconChoices-DBgeRdGI.js";
3
- import { StructuredPropertyEditor as U } from "./StructuredPropertyEditor-B3lVjrHZ.js";
4
- import { CollectionOperation as C, DestinationKind as v, PropertyValueType as L, SceneEditKind as O } from "@cratis/scene.model";
2
+ import { n as P, t as $ } from "./allowedIconChoices-KSkQ6blx.js";
3
+ import { StructuredPropertyEditor as U } from "./StructuredPropertyEditor-Bd-8GBgK.js";
5
4
  import { jsx as n, jsxs as c } from "react/jsx-runtime";
5
+ import { CollectionOperation as C, DestinationKind as v, PropertyValueType as L, SceneEditKind as O } from "@cratis/scene.model";
6
6
  import { OrderedItemEditor as F } from "@cratis/components/ConfigurationEditor";
7
7
  var K = /* @__PURE__ */ new Set([
8
8
  "label",
@@ -1,11 +1,11 @@
1
- import { n as t, t as d } from "./allowedIconChoices-DBgeRdGI.js";
2
- import { isIconReference as p } from "@cratis/scene.model";
3
- import { jsx as g } from "react/jsx-runtime";
1
+ import { n as t, t as d } from "./allowedIconChoices-KSkQ6blx.js";
2
+ import { jsx as p } from "react/jsx-runtime";
3
+ import { isIconReference as g } from "@cratis/scene.model";
4
4
  var I = ({ value: a, onChange: s, descriptor: i, context: o, disabled: l, problem: n, id: e }) => {
5
5
  const { icons: r } = o.lookups;
6
- return /* @__PURE__ */ g(t, {
6
+ return /* @__PURE__ */ p(t, {
7
7
  id: e,
8
- value: p(a) ? a : void 0,
8
+ value: g(a) ? a : void 0,
9
9
  onChange: (c) => s(c),
10
10
  catalog: r.catalog,
11
11
  adapters: r.adapters,
@@ -1,7 +1,7 @@
1
1
  import { t as N } from "./QueryBindingEditor-MTd0R7iQ.js";
2
2
  import { useState as C } from "react";
3
- import { validateBinding as E } from "@cratis/scene.engine";
4
- import { Fragment as I, jsx as o, jsxs as d } from "react/jsx-runtime";
3
+ import { Fragment as E, jsx as o, jsxs as d } from "react/jsx-runtime";
4
+ import { validateBinding as I } from "@cratis/scene.engine";
5
5
  function j(e) {
6
6
  return {
7
7
  queryId: e.id,
@@ -46,7 +46,7 @@ function R({ binding: e, candidate: r, isLoading: i, error: s, rowCount: c }) {
46
46
  return e ? r ? s != null ? u.Error : i ? u.Loading : c === 0 ? u.Empty : u.Ready : u.MissingQuery : u.NoQuery;
47
47
  }
48
48
  function v(e, r, i, s) {
49
- const c = E(e, r, i, s);
49
+ const c = I(e, r, i, s);
50
50
  return {
51
51
  diagnostics: c,
52
52
  isStorable: c.every((y) => y.severity !== "error")
@@ -100,7 +100,7 @@ var k = (e) => e.origin.map((r) => r.name).join(" / "), D = ({ property: e, cand
100
100
  role: "alert",
101
101
  children: l.missing
102
102
  }),
103
- t && m && /* @__PURE__ */ d(I, { children: [m.parameters.length > 0 && /* @__PURE__ */ d("div", {
103
+ t && m && /* @__PURE__ */ d(E, { children: [m.parameters.length > 0 && /* @__PURE__ */ d("div", {
104
104
  className: "studio-editor-query__group",
105
105
  children: [/* @__PURE__ */ o("strong", { children: l.parameters }), m.parameters.map((n) => /* @__PURE__ */ d("label", { children: [/* @__PURE__ */ d("span", { children: [l.sourceFor(n.name), n.required ? " *" : ""] }), /* @__PURE__ */ d("select", {
106
106
  value: M(t, n),
@@ -1,4 +1,4 @@
1
- import { LayoutArrangement } from '@cratis/scene/ScreenEditor';
1
+ import { LayoutArrangement } from '../Layouts/LayoutArrangement';
2
2
  import type { StructureTreeAdapter } from '../Structure/StructureTreeAdapter';
3
3
  import type { DropRegion } from './DropRegion';
4
4
  import { InsertionAxis } from './InsertionAxis';
@@ -0,0 +1,23 @@
1
+ import React, { type ReactNode } from 'react';
2
+ export declare const inspectorWidth = 360;
3
+ export interface OverlaySize {
4
+ width: number;
5
+ height: number;
6
+ }
7
+ export interface ScreenEditorOverlayFrameState {
8
+ size: OverlaySize;
9
+ setSize: (size: OverlaySize) => void;
10
+ isInspectorOpen: boolean;
11
+ toggleInspector: () => void;
12
+ close: () => void;
13
+ }
14
+ export interface ScreenEditorOverlayFrameProps {
15
+ sourceRect: DOMRect;
16
+ initialSize?: OverlaySize;
17
+ centerOffsetX?: number;
18
+ children: (state: ScreenEditorOverlayFrameState) => ReactNode;
19
+ renderInspector?: (state: ScreenEditorOverlayFrameState) => ReactNode;
20
+ canClose?: (size: OverlaySize) => Promise<boolean>;
21
+ onClosed: (size: OverlaySize) => void;
22
+ }
23
+ export declare const ScreenEditorOverlayFrame: ({ sourceRect, initialSize, centerOffsetX, children, renderInspector, canClose, onClosed }: ScreenEditorOverlayFrameProps) => React.JSX.Element;
@@ -0,0 +1,14 @@
1
+ export interface OverlayViewport {
2
+ width: number;
3
+ height: number;
4
+ }
5
+ export interface FittedOverlay {
6
+ width: number;
7
+ height: number;
8
+ offsetX: number;
9
+ }
10
+ export declare const overlayMargin = 8;
11
+ export declare function fitOverlay(size: {
12
+ width: number;
13
+ height: number;
14
+ }, viewport: OverlayViewport, requestedOffsetX: number): FittedOverlay;
@@ -0,0 +1,8 @@
1
+ export declare enum LayoutArrangement {
2
+ Row = "row",
3
+ Column = "column",
4
+ Grid = "grid",
5
+ Wrap = "wrap",
6
+ Freeform = "freeform",
7
+ Grouping = "grouping"
8
+ }
@@ -1,5 +1,5 @@
1
1
  import type { FlowContainerKind } from '@cratis/scene.model';
2
- import type { LayoutArrangement } from '@cratis/scene/ScreenEditor';
2
+ import type { LayoutArrangement } from './LayoutArrangement';
3
3
  import type { LayoutItem } from './LayoutItem';
4
4
  import type { PanelConstruct } from './PanelConstruct';
5
5
  export interface LayoutCatalogEntry {
@@ -0,0 +1,10 @@
1
+ import type { ComponentType } from 'react';
2
+ import type { LayoutArrangement } from './LayoutArrangement';
3
+ export interface LayoutContainerDescriptor {
4
+ type: string;
5
+ name: string;
6
+ arrangement: LayoutArrangement;
7
+ icon?: ComponentType<{
8
+ className?: string;
9
+ }>;
10
+ }
@@ -1,5 +1,5 @@
1
1
  import type { ComponentType } from 'react';
2
- import type { LayoutContainerDescriptor } from '@cratis/scene/ScreenEditor';
2
+ import type { LayoutContainerDescriptor } from './LayoutContainerDescriptor';
3
3
  import type { LayoutCatalogEntry } from './LayoutCatalogEntry';
4
4
  import type { LayoutItem } from './LayoutItem';
5
5
  export type LayoutLabels = Record<LayoutItem, string>;
@@ -1,3 +1,3 @@
1
1
  import type { Panel } from '@cratis/scene.model';
2
- import { LayoutArrangement } from '@cratis/scene/ScreenEditor';
2
+ import { LayoutArrangement } from '../Layouts/LayoutArrangement';
3
3
  export declare function surfaceArrangementOfRoot(root: Panel | undefined): LayoutArrangement;
@@ -1,4 +1,4 @@
1
- import type { LayoutArrangement } from '@cratis/scene/ScreenEditor';
1
+ import type { LayoutArrangement } from '../Layouts/LayoutArrangement';
2
2
  import type { Ownership } from './Ownership';
3
3
  export interface StructureTreeAdapter<T> {
4
4
  idOf(node: T): string;
@@ -25,6 +25,8 @@ export * from './Defaults/defaultLayoutIcons';
25
25
  export * from './Defaults/defaultPaletteIcons';
26
26
  export * from './Defaults/defaultPaletteSources';
27
27
  export * from './Layouts/LayoutItem';
28
+ export * from './Layouts/LayoutArrangement';
29
+ export * from './Layouts/LayoutContainerDescriptor';
28
30
  export * from './Layouts/toLayoutContainerDescriptors';
29
31
  export * from './Palette/buildPalette';
30
32
  export * from './Actions/StateChangeSlice';
@@ -1,4 +1,4 @@
1
- import { t as s } from "./StructuredValueEditor-CcwyOga0.js";
1
+ import { t as s } from "./StructuredValueEditor-DUSATTWd.js";
2
2
  import { jsx as u } from "react/jsx-runtime";
3
3
  var p = ({ value: r, onChange: t, descriptor: e, context: i, disabled: d, id: o }) => /* @__PURE__ */ u(s, {
4
4
  descriptor: e,
@@ -1,7 +1,7 @@
1
- import { i as b, n as v, r as k, t as g } from "./toTemplateSources-B9ALGe3x.js";
1
+ import { i as b, n as v, r as k, t as g } from "./toTemplateSources-Chd2UNJQ.js";
2
2
  import { useMemo as y } from "react";
3
- import { applicableTemplates as S } from "@cratis/scene.engine";
4
3
  import { jsx as m } from "react/jsx-runtime";
4
+ import { applicableTemplates as S } from "@cratis/scene.engine";
5
5
  var j = ({ value: o, onChange: i, context: p, disabled: c, id: d }) => {
6
6
  const n = p.session?.environment, s = p.session?.screenStrings.properties.templates.picker, t = n?.runtime.bundles, a = n?.runtime.profile, l = n?.templateScope, u = y(() => S({ blueprints: g(t ?? []) }, v({
7
7
  bundles: t ?? [],