@cratis/event-models 0.201.0 → 0.201.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.
@@ -1,5 +1,5 @@
1
1
  import { l as m, o as _, v as N, y } from "./structuredValue-vqCZttsk.js";
2
- import { FieldEditor as C } from "./FieldEditor-Biz82jlR.js";
2
+ import { FieldEditor as C } from "./FieldEditor-e6VpsD__.js";
3
3
  import { jsx as a, jsxs as u } from "react/jsx-runtime";
4
4
  var p = [
5
5
  "start",
@@ -1,4 +1,4 @@
1
- import { t as y } from "./SearchableSelect-Cj_cgVO0.js";
1
+ import { t as y } from "./SearchableSelect-BGZmobXo.js";
2
2
  import { Fragment as h, jsx as d, jsxs as v } from "react/jsx-runtime";
3
3
  function g(n) {
4
4
  const e = n.toLowerCase().replace(/[?[\]]/g, "");
@@ -1,5 +1,5 @@
1
1
  import { l as c, t as g, v as w, y as m } from "./structuredValue-vqCZttsk.js";
2
- import { FieldEditor as y } from "./FieldEditor-Biz82jlR.js";
2
+ import { FieldEditor as y } from "./FieldEditor-e6VpsD__.js";
3
3
  import { jsx as r, jsxs as u } from "react/jsx-runtime";
4
4
  var $ = ({ value: p, onChange: b, descriptor: h, context: l, disabled: a, problem: v, id: d }) => {
5
5
  const s = l.strings.editors.list, o = g(p).filter((i) => typeof i == "string"), e = (i) => b(i.length === 0 ? void 0 : i), f = {
@@ -1,5 +1,5 @@
1
1
  import { o as g } from "./structuredValue-vqCZttsk.js";
2
- import { t as v } from "./SearchableSelect-Cj_cgVO0.js";
2
+ import { t as v } from "./SearchableSelect-BGZmobXo.js";
3
3
  import { Fragment as f, jsx as l, jsxs as y } from "react/jsx-runtime";
4
4
  var T = (o) => typeof o == "string" && o !== "" ? o : g(o) && typeof o.screen == "string" && o.screen !== "" ? o.screen : void 0, C = ({ value: o, onChange: b, descriptor: t, context: n, disabled: h, id: c }) => {
5
5
  const r = n.strings.editors, d = n.lookups.destinations, s = T(o), a = d.find((e) => e.id === s), i = s !== void 0 && a === void 0, m = t.valueType === "destination", p = d.map((e) => ({
@@ -1,4 +1,4 @@
1
- import { t as h } from "./SearchableSelect-Cj_cgVO0.js";
1
+ import { t as h } from "./SearchableSelect-BGZmobXo.js";
2
2
  import { Fragment as v, jsx as p, jsxs as g } from "react/jsx-runtime";
3
3
  var L = ({ value: s, onChange: d, descriptor: i, context: l, disabled: u, problem: b, id: n }) => {
4
4
  const o = l.strings.editors.select, c = i.editorOptions?.reference, m = c ? l.lookups.references(c.target) : [], r = typeof s == "string" && s !== "" ? s : void 0, t = m.map((e) => ({
@@ -1,4 +1,4 @@
1
- import { ReferenceEditor as t } from "./ReferenceEditor-DYLimujk.js";
1
+ import { ReferenceEditor as t } from "./ReferenceEditor-CTguqJZC.js";
2
2
  import { jsx as o } from "react/jsx-runtime";
3
3
  var i = (e) => (r) => /* @__PURE__ */ o(t, {
4
4
  ...r,
@@ -1,17 +1,18 @@
1
1
  import { Fragment as R, useId as T, useMemo as U, useRef as V, useState as g } from "react";
2
- import { jsx as l, jsxs as o } from "react/jsx-runtime";
2
+ import { jsx as l, jsxs as i } from "react/jsx-runtime";
3
3
  function $(u, a) {
4
4
  const r = a.trim().toLowerCase();
5
- return u.filter((i) => r === "" || i.label.toLowerCase().includes(r) || (i.group ?? "").toLowerCase().includes(r));
5
+ return u.filter((c) => r === "" || c.label.toLowerCase().includes(r) || (c.group ?? "").toLowerCase().includes(r));
6
6
  }
7
- var H = ({ id: u, options: a, value: r, onChange: i, disabled: b, invalid: j, placeholder: O, searchLabel: v, emptyLabel: E, clearLabel: F, clearable: I, renderClosed: y, inline: c, ...w }) => {
8
- const [K, N] = g(!1), d = c === !0 || K, [h, k] = g(""), [x, m] = g(0), D = T(), C = V(null), _ = a.find((e) => e.value === r), n = U(() => $(a, h), [a, h]), s = n.filter((e) => e.disabled !== !0), p = () => {
9
- c !== !0 && N(!1), k("");
7
+ var H = ({ id: u, options: a, value: r, onChange: c, disabled: b, invalid: j, placeholder: O, searchLabel: v, emptyLabel: E, clearLabel: F, clearable: I, renderClosed: y, inline: o, ...w }) => {
8
+ const [K, N] = g(!1), d = o === !0 || K, [h, k] = g(""), [x, m] = g(0), D = T(), C = V(null), _ = a.find((e) => e.value === r), n = U(() => $(a, h), [a, h]), s = n.filter((e) => e.disabled !== !0), f = () => {
9
+ o !== !0 && N(!1), k("");
10
10
  }, M = (e) => {
11
- e.disabled || (i(e.value), p());
11
+ e.disabled || (c(e.value), f());
12
12
  }, L = (e) => {
13
13
  if (e.key === "Escape") {
14
- e.stopPropagation(), p();
14
+ if (o === !0) return;
15
+ e.stopPropagation(), f();
15
16
  return;
16
17
  }
17
18
  if (e.key === "ArrowDown" || e.key === "ArrowUp") {
@@ -22,16 +23,16 @@ var H = ({ id: u, options: a, value: r, onChange: i, disabled: b, invalid: j, pl
22
23
  const t = s[Math.min(x, s.length - 1)];
23
24
  t && M(t);
24
25
  }
25
- }, f = n.some((e) => e.section !== void 0), S = (e) => f ? e.section ?? "" : e.group ?? "", q = [...new Set(n.map(S))].sort((e, t) => f ? 0 : e === "" ? -1 : t === "" ? 1 : 0), B = s[Math.min(x, Math.max(s.length - 1, 0))]?.value;
26
- return /* @__PURE__ */ o("div", {
26
+ }, p = n.some((e) => e.section !== void 0), S = (e) => p ? e.section ?? "" : e.group ?? "", q = [...new Set(n.map(S))].sort((e, t) => p ? 0 : e === "" ? -1 : t === "" ? 1 : 0), B = s[Math.min(x, Math.max(s.length - 1, 0))]?.value;
27
+ return /* @__PURE__ */ i("div", {
27
28
  ref: C,
28
29
  className: "studio-editor-select",
29
30
  onKeyDown: d ? L : void 0,
30
31
  onBlur: (e) => {
31
- C.current?.contains(e.relatedTarget) || p();
32
+ C.current?.contains(e.relatedTarget) || f();
32
33
  },
33
34
  children: [
34
- c !== !0 && /* @__PURE__ */ l("button", {
35
+ o !== !0 && /* @__PURE__ */ l("button", {
35
36
  type: "button",
36
37
  id: u,
37
38
  role: "combobox",
@@ -54,12 +55,12 @@ var H = ({ id: u, options: a, value: r, onChange: i, disabled: b, invalid: j, pl
54
55
  type: "button",
55
56
  className: "studio-editor-select__clear",
56
57
  "aria-label": F,
57
- onClick: () => i(void 0),
58
+ onClick: () => c(void 0),
58
59
  children: "×"
59
60
  }),
60
- d && /* @__PURE__ */ o("div", {
61
- className: `studio-editor-select__panel${c === !0 ? " studio-editor-select__panel--inline" : ""}`,
62
- children: [(c !== !0 || a.length > 10) && /* @__PURE__ */ l("input", {
61
+ d && /* @__PURE__ */ i("div", {
62
+ className: `studio-editor-select__panel${o === !0 ? " studio-editor-select__panel--inline" : ""}`,
63
+ children: [(o !== !0 || a.length > 10) && /* @__PURE__ */ l("input", {
63
64
  type: "search",
64
65
  autoFocus: !0,
65
66
  className: "studio-editor-select__search",
@@ -69,7 +70,7 @@ var H = ({ id: u, options: a, value: r, onChange: i, disabled: b, invalid: j, pl
69
70
  onChange: (e) => {
70
71
  k(e.target.value), m(0);
71
72
  }
72
- }), /* @__PURE__ */ o("ul", {
73
+ }), /* @__PURE__ */ i("ul", {
73
74
  id: D,
74
75
  role: "listbox",
75
76
  "aria-labelledby": w["aria-labelledby"],
@@ -77,18 +78,18 @@ var H = ({ id: u, options: a, value: r, onChange: i, disabled: b, invalid: j, pl
77
78
  children: [n.length === 0 && /* @__PURE__ */ l("li", {
78
79
  className: "studio-editor-select__empty",
79
80
  children: E
80
- }), q.map((e) => /* @__PURE__ */ o("li", {
81
+ }), q.map((e) => /* @__PURE__ */ i("li", {
81
82
  role: "presentation",
82
83
  children: [e !== "" && /* @__PURE__ */ l("div", {
83
84
  className: "studio-editor-select__group",
84
85
  children: e
85
86
  }), /* @__PURE__ */ l("ul", {
86
87
  role: "presentation",
87
- children: n.filter((t) => S(t) === e).map((t, A, P) => /* @__PURE__ */ o(R, { children: [f && t.group && (A === 0 || P[A - 1].group !== t.group) && /* @__PURE__ */ l("li", {
88
+ children: n.filter((t) => S(t) === e).map((t, A, P) => /* @__PURE__ */ i(R, { children: [p && t.group && (A === 0 || P[A - 1].group !== t.group) && /* @__PURE__ */ l("li", {
88
89
  role: "presentation",
89
90
  className: "studio-editor-select__subgroup",
90
91
  children: t.group
91
- }), /* @__PURE__ */ o("li", {
92
+ }), /* @__PURE__ */ i("li", {
92
93
  role: "option",
93
94
  "aria-selected": t.value === r,
94
95
  "aria-disabled": t.disabled || void 0,
@@ -1,5 +1,5 @@
1
1
  import { n as h, t as n } from "./choiceKeys-DQcUX97p.js";
2
- import { t as u } from "./SearchableSelect-Cj_cgVO0.js";
2
+ import { t as u } from "./SearchableSelect-BGZmobXo.js";
3
3
  import { jsx as m } from "react/jsx-runtime";
4
4
  var L = ({ value: o, onChange: i, descriptor: e, context: r, disabled: d, problem: b, id: s }) => {
5
5
  const l = r.strings.editors.select, t = o ?? void 0, c = h(e.choices ?? [], t);
@@ -1,4 +1,4 @@
1
- import { t as m } from "./SearchableSelect-Cj_cgVO0.js";
1
+ import { t as m } from "./SearchableSelect-BGZmobXo.js";
2
2
  import { jsx as b } from "react/jsx-runtime";
3
3
  function h(a, i, t) {
4
4
  const l = a.slices.length > 0 ? a.slices : a.stateChangeSlices.map((e) => ({
@@ -1,4 +1,4 @@
1
- import { SliceEditor as r } from "./SliceEditor-C9bAGN4f.js";
1
+ import { SliceEditor as r } from "./SliceEditor-BdiU5-Tg.js";
2
2
  import { jsx as i } from "react/jsx-runtime";
3
3
  var d = (t) => /* @__PURE__ */ i(r, {
4
4
  ...t,