@uipath/apollo-react 7.26.0 → 7.28.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 (124) hide show
  1. package/dist/decision-table/BandColumn.d.ts +2 -2
  2. package/dist/decision-table/BandColumn.d.ts.map +1 -1
  3. package/dist/decision-table/ColumnEditorOverlay.cjs +3 -3
  4. package/dist/decision-table/ColumnEditorOverlay.d.ts +6 -5
  5. package/dist/decision-table/ColumnEditorOverlay.d.ts.map +1 -1
  6. package/dist/decision-table/ColumnEditorOverlay.js +3 -3
  7. package/dist/decision-table/ColumnPopover.cjs +52 -31
  8. package/dist/decision-table/ColumnPopover.d.ts +36 -23
  9. package/dist/decision-table/ColumnPopover.d.ts.map +1 -1
  10. package/dist/decision-table/ColumnPopover.js +52 -31
  11. package/dist/decision-table/DecisionText.cjs +33 -11
  12. package/dist/decision-table/DecisionText.d.ts +23 -24
  13. package/dist/decision-table/DecisionText.d.ts.map +1 -1
  14. package/dist/decision-table/DecisionText.js +33 -11
  15. package/dist/decision-table/DecisionTextHeader.cjs +10 -8
  16. package/dist/decision-table/DecisionTextHeader.d.ts +13 -5
  17. package/dist/decision-table/DecisionTextHeader.d.ts.map +1 -1
  18. package/dist/decision-table/DecisionTextHeader.js +10 -8
  19. package/dist/decision-table/ValueFields.cjs +9 -5
  20. package/dist/decision-table/ValueFields.d.ts +0 -2
  21. package/dist/decision-table/ValueFields.d.ts.map +1 -1
  22. package/dist/decision-table/ValueFields.js +9 -5
  23. package/dist/decision-table/ValuePopover.cjs +18 -28
  24. package/dist/decision-table/ValuePopover.d.ts +5 -4
  25. package/dist/decision-table/ValuePopover.d.ts.map +1 -1
  26. package/dist/decision-table/ValuePopover.js +18 -28
  27. package/dist/decision-table/__fixtures__/diffSentences.fixtures.d.ts +9 -8
  28. package/dist/decision-table/__fixtures__/diffSentences.fixtures.d.ts.map +1 -1
  29. package/dist/decision-table/__fixtures__/editableSentences.fixtures.d.ts +5 -4
  30. package/dist/decision-table/__fixtures__/editableSentences.fixtures.d.ts.map +1 -1
  31. package/dist/decision-table/__fixtures__/sentences.fixtures.d.ts +25 -7
  32. package/dist/decision-table/__fixtures__/sentences.fixtures.d.ts.map +1 -1
  33. package/dist/decision-table/__fixtures__/storyTableHost.d.ts +16 -14
  34. package/dist/decision-table/__fixtures__/storyTableHost.d.ts.map +1 -1
  35. package/dist/decision-table/__fixtures__/textMode.d.ts +13 -5
  36. package/dist/decision-table/__fixtures__/textMode.d.ts.map +1 -1
  37. package/dist/decision-table/bandColumns.cjs +22 -35
  38. package/dist/decision-table/bandColumns.d.ts +2 -4
  39. package/dist/decision-table/bandColumns.d.ts.map +1 -1
  40. package/dist/decision-table/bandColumns.js +21 -31
  41. package/dist/decision-table/decisionTextDiff.d.ts +13 -12
  42. package/dist/decision-table/decisionTextDiff.d.ts.map +1 -1
  43. package/dist/decision-table/decisionTextTypes.d.ts +10 -7
  44. package/dist/decision-table/decisionTextTypes.d.ts.map +1 -1
  45. package/dist/decision-table/hostValues.cjs +90 -0
  46. package/dist/decision-table/hostValues.d.ts +13 -0
  47. package/dist/decision-table/hostValues.d.ts.map +1 -0
  48. package/dist/decision-table/hostValues.js +50 -0
  49. package/dist/decision-table/index.cjs +4 -4
  50. package/dist/decision-table/index.d.ts +9 -7
  51. package/dist/decision-table/index.d.ts.map +1 -1
  52. package/dist/decision-table/index.js +1 -1
  53. package/dist/decision-table/locales/de.cjs +1 -1
  54. package/dist/decision-table/locales/de.d.ts.map +1 -1
  55. package/dist/decision-table/locales/de.js +1 -1
  56. package/dist/decision-table/locales/en.cjs +1 -1
  57. package/dist/decision-table/locales/en.d.ts.map +1 -1
  58. package/dist/decision-table/locales/en.js +1 -1
  59. package/dist/decision-table/locales/es-MX.cjs +1 -1
  60. package/dist/decision-table/locales/es-MX.d.ts.map +1 -1
  61. package/dist/decision-table/locales/es-MX.js +1 -1
  62. package/dist/decision-table/locales/es.cjs +1 -1
  63. package/dist/decision-table/locales/es.d.ts.map +1 -1
  64. package/dist/decision-table/locales/es.js +1 -1
  65. package/dist/decision-table/locales/fr.cjs +1 -1
  66. package/dist/decision-table/locales/fr.d.ts.map +1 -1
  67. package/dist/decision-table/locales/fr.js +1 -1
  68. package/dist/decision-table/locales/ja.cjs +1 -1
  69. package/dist/decision-table/locales/ja.d.ts.map +1 -1
  70. package/dist/decision-table/locales/ja.js +1 -1
  71. package/dist/decision-table/locales/ko.cjs +1 -1
  72. package/dist/decision-table/locales/ko.d.ts.map +1 -1
  73. package/dist/decision-table/locales/ko.js +1 -1
  74. package/dist/decision-table/locales/pt-BR.cjs +1 -1
  75. package/dist/decision-table/locales/pt-BR.d.ts.map +1 -1
  76. package/dist/decision-table/locales/pt-BR.js +1 -1
  77. package/dist/decision-table/locales/pt.cjs +1 -1
  78. package/dist/decision-table/locales/pt.d.ts.map +1 -1
  79. package/dist/decision-table/locales/pt.js +1 -1
  80. package/dist/decision-table/locales/ro.cjs +1 -1
  81. package/dist/decision-table/locales/ro.d.ts.map +1 -1
  82. package/dist/decision-table/locales/ro.js +1 -1
  83. package/dist/decision-table/locales/ru.cjs +1 -1
  84. package/dist/decision-table/locales/ru.d.ts.map +1 -1
  85. package/dist/decision-table/locales/ru.js +1 -1
  86. package/dist/decision-table/locales/tr.cjs +1 -1
  87. package/dist/decision-table/locales/tr.d.ts.map +1 -1
  88. package/dist/decision-table/locales/tr.js +1 -1
  89. package/dist/decision-table/locales/zh-CN.cjs +1 -1
  90. package/dist/decision-table/locales/zh-CN.d.ts.map +1 -1
  91. package/dist/decision-table/locales/zh-CN.js +1 -1
  92. package/dist/decision-table/locales/zh-TW.cjs +1 -1
  93. package/dist/decision-table/locales/zh-TW.d.ts.map +1 -1
  94. package/dist/decision-table/locales/zh-TW.js +1 -1
  95. package/dist/decision-table/sentenceTypes.d.ts +12 -8
  96. package/dist/decision-table/sentenceTypes.d.ts.map +1 -1
  97. package/dist/decision-table/useColumnEditing.cjs +7 -5
  98. package/dist/decision-table/useColumnEditing.d.ts +6 -6
  99. package/dist/decision-table/useColumnEditing.d.ts.map +1 -1
  100. package/dist/decision-table/useColumnEditing.js +7 -5
  101. package/dist/decision-table/useDecisionTextStrings.cjs +1 -5
  102. package/dist/decision-table/useDecisionTextStrings.d.ts.map +1 -1
  103. package/dist/decision-table/useDecisionTextStrings.js +1 -5
  104. package/dist/decision-table/useEditState.cjs +17 -1
  105. package/dist/decision-table/useEditState.d.ts +4 -2
  106. package/dist/decision-table/useEditState.d.ts.map +1 -1
  107. package/dist/decision-table/useEditState.js +17 -1
  108. package/dist/decision-table/useHostValueEdit.cjs +91 -0
  109. package/dist/decision-table/useHostValueEdit.d.ts +5 -0
  110. package/dist/decision-table/useHostValueEdit.d.ts.map +1 -0
  111. package/dist/decision-table/useHostValueEdit.js +57 -0
  112. package/dist/decision-table/usePendingCondition.cjs +6 -5
  113. package/dist/decision-table/usePendingCondition.d.ts.map +1 -1
  114. package/dist/decision-table/usePendingCondition.js +7 -6
  115. package/dist/decision-table/useShapeDraft.cjs +93 -65
  116. package/dist/decision-table/useShapeDraft.d.ts +17 -14
  117. package/dist/decision-table/useShapeDraft.d.ts.map +1 -1
  118. package/dist/decision-table/useShapeDraft.js +93 -62
  119. package/dist/decision-table/useValueEditing.cjs +3 -7
  120. package/dist/decision-table/useValueEditing.d.ts.map +1 -1
  121. package/dist/decision-table/useValueEditing.js +3 -7
  122. package/dist/decision-table/valueTypes.d.ts +57 -19
  123. package/dist/decision-table/valueTypes.d.ts.map +1 -1
  124. package/package.json +3 -3
@@ -2,9 +2,9 @@ import type React from 'react';
2
2
  import type { DiffChange, DiffLabels } from './decisionTextDiff';
3
3
  import { type MarkBadgeProps } from './MarkBadge';
4
4
  import type { Mark } from './marks';
5
- import type { SentenceBandColumn } from './sentenceTypes';
5
+ import type { BandColumnView } from './sentenceTypes';
6
6
  export interface BandColumnProps {
7
- column: SentenceBandColumn;
7
+ column: BandColumnView;
8
8
  mark: Mark | undefined;
9
9
  badgeId: string;
10
10
  change: DiffChange | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"BandColumn.d.ts","sourceRoot":"","sources":["../../src/decision-table/BandColumn.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAa,KAAK,cAAc,EAAW,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AASpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAW1D,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,kBAAkB,CAAC;IAC3B,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAEhB,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC;IAC/B,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAEpE,IAAI,EACA;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,GACjB;QAAE,IAAI,EAAE,QAAQ,CAAC;QAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;CAC3F;AAGD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAqDhD,CAAC"}
1
+ {"version":3,"file":"BandColumn.d.ts","sourceRoot":"","sources":["../../src/decision-table/BandColumn.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAa,KAAK,cAAc,EAAW,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AASpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAWtD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAEhB,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC;IAC/B,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAEpE,IAAI,EACA;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,GACjB;QAAE,IAAI,EAAE,QAAQ,CAAC;QAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;CAC3F;AAGD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAqDhD,CAAC"}
@@ -30,8 +30,8 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
30
  const external_ColumnPopover_cjs_namespaceObject = require("./ColumnPopover.cjs");
31
31
  const external_EditorOverlay_cjs_namespaceObject = require("./EditorOverlay.cjs");
32
32
  const external_sentenceStyles_cjs_namespaceObject = require("./sentenceStyles.cjs");
33
- const ColumnEditorOverlay = ({ editor, edit, labels, container, id, dataTestId })=>{
34
- const field = edit.field(editor.column.id);
33
+ const ColumnEditorOverlay = ({ editor, types, labels, container, id, dataTestId })=>{
34
+ const { field } = editor;
35
35
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_EditorOverlay_cjs_namespaceObject.EditorOverlay, {
36
36
  anchor: editor.anchor,
37
37
  container: container,
@@ -44,7 +44,7 @@ const ColumnEditorOverlay = ({ editor, edit, labels, container, id, dataTestId }
44
44
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ColumnPopover_cjs_namespaceObject.ColumnPopover, {
45
45
  column: editor.column,
46
46
  field: field,
47
- types: edit.types,
47
+ types: types,
48
48
  onApply: editor.onApply,
49
49
  onCancel: editor.onCancel,
50
50
  onMoreProperties: editor.onMoreProperties,
@@ -1,14 +1,15 @@
1
1
  import type React from 'react';
2
- import { type ColumnEdit, type ColumnPopoverLabels } from './ColumnPopover';
2
+ import { type ColumnPopoverLabels } from './ColumnPopover';
3
+ import type { ColumnTypeOption } from './columnTypes';
3
4
  import type { OpenColumnEditor } from './useColumnEditing';
4
5
  import type { RuleWindow } from './useRuleWindow';
5
- export interface ColumnEditorOverlayProps {
6
- editor: OpenColumnEditor;
7
- edit: ColumnEdit;
6
+ export interface ColumnEditorOverlayProps<Type> {
7
+ editor: OpenColumnEditor<Type>;
8
+ types: readonly ColumnTypeOption<Type>[];
8
9
  labels: ColumnPopoverLabels;
9
10
  container: RuleWindow['container'];
10
11
  id: string;
11
12
  dataTestId: string;
12
13
  }
13
- export declare const ColumnEditorOverlay: React.FC<ColumnEditorOverlayProps>;
14
+ export declare const ColumnEditorOverlay: <Type>({ editor, types, labels, container, id, dataTestId, }: ColumnEditorOverlayProps<Type>) => React.JSX.Element;
14
15
  //# sourceMappingURL=ColumnEditorOverlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColumnEditorOverlay.d.ts","sourceRoot":"","sources":["../../src/decision-table/ColumnEditorOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,mBAAmB,EAEzB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,gBAAgB,CAAC;IACzB,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,SAAS,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;CACpB;AAGD,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAgClE,CAAC"}
1
+ {"version":3,"file":"ColumnEditorOverlay.d.ts","sourceRoot":"","sources":["../../src/decision-table/ColumnEditorOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAiB,KAAK,mBAAmB,EAAe,MAAM,iBAAiB,CAAC;AACvF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,WAAW,wBAAwB,CAAC,IAAI;IAC5C,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC/B,KAAK,EAAE,SAAS,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACzC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,SAAS,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;CACpB;AAGD,eAAO,MAAM,mBAAmB,GAAI,IAAI,EAAG,uDAOxC,wBAAwB,CAAC,IAAI,CAAC,KAAG,KAAK,CAAC,GAAG,CAAC,OAyB7C,CAAC"}
@@ -2,8 +2,8 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { ColumnPopover, columnTitle } from "./ColumnPopover.js";
3
3
  import { EditorOverlay } from "./EditorOverlay.js";
4
4
  import { COLUMN_EDITOR_CLASS } from "./sentenceStyles.js";
5
- const ColumnEditorOverlay = ({ editor, edit, labels, container, id, dataTestId })=>{
6
- const field = edit.field(editor.column.id);
5
+ const ColumnEditorOverlay = ({ editor, types, labels, container, id, dataTestId })=>{
6
+ const { field } = editor;
7
7
  return /*#__PURE__*/ jsx(EditorOverlay, {
8
8
  anchor: editor.anchor,
9
9
  container: container,
@@ -16,7 +16,7 @@ const ColumnEditorOverlay = ({ editor, edit, labels, container, id, dataTestId }
16
16
  children: /*#__PURE__*/ jsx(ColumnPopover, {
17
17
  column: editor.column,
18
18
  field: field,
19
- types: edit.types,
19
+ types: types,
20
20
  onApply: editor.onApply,
21
21
  onCancel: editor.onCancel,
22
22
  onMoreProperties: editor.onMoreProperties,
@@ -30,44 +30,62 @@ __webpack_require__.d(__webpack_exports__, {
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
31
  const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
32
32
  const external_react_namespaceObject = require("react");
33
- const external_bandColumns_cjs_namespaceObject = require("./bandColumns.cjs");
33
+ const useSafeLingui_cjs_namespaceObject = require("../i18n/useSafeLingui.cjs");
34
+ const external_columnTypes_cjs_namespaceObject = require("./columnTypes.cjs");
34
35
  const external_gridEvents_cjs_namespaceObject = require("./gridEvents.cjs");
35
36
  const external_PopoverFooter_cjs_namespaceObject = require("./PopoverFooter.cjs");
36
37
  const external_PopoverHeader_cjs_namespaceObject = require("./PopoverHeader.cjs");
37
38
  const external_PopoverSelect_cjs_namespaceObject = require("./PopoverSelect.cjs");
38
39
  const external_sentenceStyles_cjs_namespaceObject = require("./sentenceStyles.cjs");
39
40
  const columnTitle = (kind, name, labels)=>'input' === kind ? labels.inputColumn(name) : labels.outputColumn(name);
41
+ const bindingOf = (field)=>'input' === field.kind ? field.expression : field.name;
42
+ const changed = (draft, held)=>draft.trim() === held.trim() ? void 0 : draft.trim();
40
43
  const changeOf = (field, draft)=>{
41
- const change = {};
42
- if (draft.label.trim() !== field.label.trim()) change.label = draft.label.trim();
43
- if (draft.binding.trim() !== field.binding.trim()) change.binding = draft.binding.trim();
44
- if (draft.typeRef !== field.typeRef) change.typeRef = draft.typeRef;
45
- if (void 0 !== field.allowedValues && draft.allowedValues.trim() !== field.allowedValues.trim()) change.allowedValues = draft.allowedValues.trim();
46
- return change;
44
+ const label = changed(draft.label, field.label);
45
+ const allowedValues = changed(draft.allowedValues, field.allowedValues);
46
+ const common = {
47
+ ...void 0 === label ? {} : {
48
+ label
49
+ },
50
+ ...draft.type === field.type ? {} : {
51
+ type: draft.type
52
+ },
53
+ ...void 0 === allowedValues ? {} : {
54
+ allowedValues
55
+ }
56
+ };
57
+ const binding = changed(draft.binding, bindingOf(field));
58
+ if ('input' === field.kind) return {
59
+ kind: 'input',
60
+ ...common,
61
+ ...void 0 === binding ? {} : {
62
+ expression: binding
63
+ }
64
+ };
65
+ return {
66
+ kind: 'output',
67
+ ...common,
68
+ ...void 0 === binding ? {} : {
69
+ name: binding
70
+ }
71
+ };
47
72
  };
48
73
  const ColumnPopover = ({ column, field, types, onApply, onCancel, onMoreProperties, labels, dataTestId })=>{
49
74
  const id = (0, external_react_namespaceObject.useId)();
75
+ const { _ } = (0, useSafeLingui_cjs_namespaceObject.useSafeLingui)();
50
76
  const [root, setRoot] = (0, external_react_namespaceObject.useState)(null);
51
77
  const [draft, setDraft] = (0, external_react_namespaceObject.useState)({
52
78
  label: field.label,
53
- binding: field.binding,
54
- typeRef: field.typeRef,
55
- allowedValues: field.allowedValues ?? ''
79
+ binding: bindingOf(field),
80
+ type: field.type,
81
+ allowedValues: field.allowedValues
56
82
  });
57
- const missing = field.required && '' === draft.binding.trim();
83
+ const required = 'input' === field.kind || field.nameRequired;
84
+ const missing = required && '' === draft.binding.trim();
58
85
  const missingLabel = '' === draft.label.trim();
59
- const typed = types.map((type)=>({
60
- ...type,
61
- icon: type.icon ?? (0, external_bandColumns_cjs_namespaceObject.valueTypeIcon)(type.type)
62
- }));
63
- const options = types.some((type)=>type.id === field.typeRef) ? typed : [
64
- {
65
- id: field.typeRef,
66
- label: field.typeRef
67
- },
68
- ...typed
69
- ];
70
- const placeholder = types.find((type)=>type.id === draft.typeRef)?.allowedValuesPlaceholder;
86
+ const choices = (0, external_columnTypes_cjs_namespaceObject.columnTypeChoicesOf)(types, _);
87
+ const place = types.findIndex((option)=>option.type === draft.type);
88
+ const placeholder = choices.find((_choice, index)=>index === place)?.allowedValuesPlaceholder;
71
89
  const set = (key)=>(event)=>{
72
90
  const value = event.currentTarget.value;
73
91
  setDraft((current)=>({
@@ -136,7 +154,7 @@ const ColumnPopover = ({ column, field, types, onApply, onCancel, onMoreProperti
136
154
  className: external_sentenceStyles_cjs_namespaceObject.COLUMN_FIELD_LABEL_CLASS,
137
155
  children: [
138
156
  bindingLabel,
139
- field.required && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
157
+ required && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
140
158
  "aria-hidden": true,
141
159
  className: external_sentenceStyles_cjs_namespaceObject.COLUMN_REQUIRED_CLASS,
142
160
  children: ' *'
@@ -146,7 +164,7 @@ const ColumnPopover = ({ column, field, types, onApply, onCancel, onMoreProperti
146
164
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Input, {
147
165
  id: `${id}-binding`,
148
166
  className: external_sentenceStyles_cjs_namespaceObject.COLUMN_CODE_FIELD_CLASS,
149
- "aria-required": field.required,
167
+ "aria-required": required,
150
168
  "aria-invalid": missing,
151
169
  "aria-describedby": missing ? `${id}-missing` : void 0,
152
170
  value: draft.binding,
@@ -170,19 +188,22 @@ const ColumnPopover = ({ column, field, types, onApply, onCancel, onMoreProperti
170
188
  }),
171
189
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_PopoverSelect_cjs_namespaceObject.PopoverSelect, {
172
190
  id: `${id}-type`,
173
- value: draft.typeRef,
174
- options: options,
175
- onChange: (typeRef)=>setDraft((current)=>({
191
+ value: String(place),
192
+ options: choices,
193
+ onChange: (picked)=>{
194
+ const option = types.find((_option, index)=>String(index) === picked);
195
+ if (option) setDraft((current)=>({
176
196
  ...current,
177
- typeRef
178
- })),
197
+ type: option.type
198
+ }));
199
+ },
179
200
  container: root,
180
201
  label: labels.dataType,
181
202
  dataTestId: `${dataTestId}-type`
182
203
  })
183
204
  ]
184
205
  }),
185
- void 0 !== field.allowedValues && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
206
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
186
207
  className: external_sentenceStyles_cjs_namespaceObject.COLUMN_FIELD_CLASS,
187
208
  children: [
188
209
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Label, {
@@ -1,24 +1,37 @@
1
1
  import type React from 'react';
2
+ import { type ColumnTypeOption } from './columnTypes';
2
3
  import { type PopoverFooterLabels } from './PopoverFooter';
3
- import { type PopoverSelectOption } from './PopoverSelect';
4
- import type { SentenceBand, SentenceNameToken, SentenceValueType } from './sentenceTypes';
5
- export interface ColumnField {
6
- kind: SentenceNameToken['kind'];
4
+ import type { SentenceBand } from './sentenceTypes';
5
+ export type ColumnFieldData<Type> = {
6
+ kind: 'input';
7
7
  label: string;
8
- binding: string;
9
- required: boolean;
10
- typeRef: string;
8
+ expression: string;
9
+ type: Type;
10
+ allowedValues: string;
11
+ } | {
12
+ kind: 'output';
13
+ label: string;
14
+ name: string;
15
+ nameRequired: boolean;
16
+ type: Type;
17
+ allowedValues: string;
18
+ };
19
+ export type ColumnChange<Type> = {
20
+ kind: 'input';
21
+ label?: string;
22
+ expression?: string;
23
+ type?: Type;
11
24
  allowedValues?: string;
12
- }
13
- export type ColumnChange = Partial<Pick<ColumnField, 'label' | 'binding' | 'typeRef' | 'allowedValues'>>;
14
- export interface ColumnTypeOption extends PopoverSelectOption {
15
- type?: SentenceValueType;
16
- allowedValuesPlaceholder?: string;
17
- }
18
- export interface ColumnEdit {
19
- field: (columnId: string) => ColumnField;
20
- types: readonly ColumnTypeOption[];
21
- onCommit: (columnId: string, change: ColumnChange) => void;
25
+ } | {
26
+ kind: 'output';
27
+ label?: string;
28
+ name?: string;
29
+ type?: Type;
30
+ allowedValues?: string;
31
+ };
32
+ export interface ColumnEdit<Type> {
33
+ field: (columnId: string) => ColumnFieldData<Type> | undefined;
34
+ onCommit: (columnId: string, change: ColumnChange<Type>) => void;
22
35
  onMoreProperties?: (columnId: string) => void;
23
36
  }
24
37
  export interface ColumnPopoverLabels extends PopoverFooterLabels {
@@ -35,16 +48,16 @@ export interface ColumnPopoverLabels extends PopoverFooterLabels {
35
48
  allowedValuesHint: string;
36
49
  moreProperties: string;
37
50
  }
38
- export interface ColumnPopoverProps {
51
+ export interface ColumnPopoverProps<Type> {
39
52
  column: SentenceBand['columns'][number];
40
- field: ColumnField;
41
- types: ColumnEdit['types'];
42
- onApply: (change: ColumnChange) => void;
53
+ field: ColumnFieldData<Type>;
54
+ types: readonly ColumnTypeOption<Type>[];
55
+ onApply: (change: ColumnChange<Type>) => void;
43
56
  onCancel: () => void;
44
57
  onMoreProperties: (() => void) | undefined;
45
58
  labels: ColumnPopoverLabels;
46
59
  dataTestId: string;
47
60
  }
48
- export declare const columnTitle: (kind: ColumnField["kind"], name: string, labels: ColumnPopoverLabels) => string;
49
- export declare const ColumnPopover: React.FC<ColumnPopoverProps>;
61
+ export declare const columnTitle: (kind: ColumnFieldData<unknown>["kind"], name: string, labels: ColumnPopoverLabels) => string;
62
+ export declare const ColumnPopover: <Type>({ column, field, types, onApply, onCancel, onMoreProperties, labels, dataTestId, }: ColumnPopoverProps<Type>) => React.JSX.Element;
50
63
  //# sourceMappingURL=ColumnPopover.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColumnPopover.d.ts","sourceRoot":"","sources":["../../src/decision-table/ColumnPopover.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAiB,KAAK,mBAAmB,EAA0B,MAAM,iBAAiB,CAAC;AAElG,OAAO,EAAi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AC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB,CAAC,IAAI;IACtC,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;IACxC,KAAK,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;IAC7B,KAAK,EAAE,SAAS,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACzC,OAAO,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAC9C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,gBAAgB,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAC3C,MAAM,EAAE,mBAAmB,CAAC;IAE5B,UAAU,EAAE,MAAM,CAAC;CACpB;AAGD,eAAO,MAAM,WAAW,GACtB,MAAM,eAAe,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,EACtC,MAAM,MAAM,EACZ,QAAQ,mBAAmB,KAC1B,MAAmF,CAAC;AAkCvF,eAAO,MAAM,aAAa,GAAI,IAAI,EAAG,oFASlC,kBAAkB,CAAC,IAAI,CAAC,KAAG,KAAK,CAAC,GAAG,CAAC,OA0IvC,CAAC"}
@@ -1,44 +1,62 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Input, Label } from "@uipath/apollo-wind";
3
3
  import { useId, useState } from "react";
4
- import { valueTypeIcon } from "./bandColumns.js";
4
+ import { useSafeLingui } from "../i18n/useSafeLingui.js";
5
+ import { columnTypeChoicesOf } from "./columnTypes.js";
5
6
  import { isComposing } from "./gridEvents.js";
6
7
  import { PopoverFooter } from "./PopoverFooter.js";
7
8
  import { PopoverHeader } from "./PopoverHeader.js";
8
9
  import { PopoverSelect } from "./PopoverSelect.js";
9
10
  import { COLUMN_CODE_FIELD_CLASS, COLUMN_FIELD_CLASS, COLUMN_FIELD_LABEL_CLASS, COLUMN_HINT_CLASS, COLUMN_REQUIRED_CLASS, POPOVER_CLASS, POPOVER_ERROR_CLASS, POPOVER_FIELD_CLASS } from "./sentenceStyles.js";
10
11
  const columnTitle = (kind, name, labels)=>'input' === kind ? labels.inputColumn(name) : labels.outputColumn(name);
12
+ const bindingOf = (field)=>'input' === field.kind ? field.expression : field.name;
13
+ const changed = (draft, held)=>draft.trim() === held.trim() ? void 0 : draft.trim();
11
14
  const changeOf = (field, draft)=>{
12
- const change = {};
13
- if (draft.label.trim() !== field.label.trim()) change.label = draft.label.trim();
14
- if (draft.binding.trim() !== field.binding.trim()) change.binding = draft.binding.trim();
15
- if (draft.typeRef !== field.typeRef) change.typeRef = draft.typeRef;
16
- if (void 0 !== field.allowedValues && draft.allowedValues.trim() !== field.allowedValues.trim()) change.allowedValues = draft.allowedValues.trim();
17
- return change;
15
+ const label = changed(draft.label, field.label);
16
+ const allowedValues = changed(draft.allowedValues, field.allowedValues);
17
+ const common = {
18
+ ...void 0 === label ? {} : {
19
+ label
20
+ },
21
+ ...draft.type === field.type ? {} : {
22
+ type: draft.type
23
+ },
24
+ ...void 0 === allowedValues ? {} : {
25
+ allowedValues
26
+ }
27
+ };
28
+ const binding = changed(draft.binding, bindingOf(field));
29
+ if ('input' === field.kind) return {
30
+ kind: 'input',
31
+ ...common,
32
+ ...void 0 === binding ? {} : {
33
+ expression: binding
34
+ }
35
+ };
36
+ return {
37
+ kind: 'output',
38
+ ...common,
39
+ ...void 0 === binding ? {} : {
40
+ name: binding
41
+ }
42
+ };
18
43
  };
19
44
  const ColumnPopover = ({ column, field, types, onApply, onCancel, onMoreProperties, labels, dataTestId })=>{
20
45
  const id = useId();
46
+ const { _ } = useSafeLingui();
21
47
  const [root, setRoot] = useState(null);
22
48
  const [draft, setDraft] = useState({
23
49
  label: field.label,
24
- binding: field.binding,
25
- typeRef: field.typeRef,
26
- allowedValues: field.allowedValues ?? ''
50
+ binding: bindingOf(field),
51
+ type: field.type,
52
+ allowedValues: field.allowedValues
27
53
  });
28
- const missing = field.required && '' === draft.binding.trim();
54
+ const required = 'input' === field.kind || field.nameRequired;
55
+ const missing = required && '' === draft.binding.trim();
29
56
  const missingLabel = '' === draft.label.trim();
30
- const typed = types.map((type)=>({
31
- ...type,
32
- icon: type.icon ?? valueTypeIcon(type.type)
33
- }));
34
- const options = types.some((type)=>type.id === field.typeRef) ? typed : [
35
- {
36
- id: field.typeRef,
37
- label: field.typeRef
38
- },
39
- ...typed
40
- ];
41
- const placeholder = types.find((type)=>type.id === draft.typeRef)?.allowedValuesPlaceholder;
57
+ const choices = columnTypeChoicesOf(types, _);
58
+ const place = types.findIndex((option)=>option.type === draft.type);
59
+ const placeholder = choices.find((_choice, index)=>index === place)?.allowedValuesPlaceholder;
42
60
  const set = (key)=>(event)=>{
43
61
  const value = event.currentTarget.value;
44
62
  setDraft((current)=>({
@@ -107,7 +125,7 @@ const ColumnPopover = ({ column, field, types, onApply, onCancel, onMoreProperti
107
125
  className: COLUMN_FIELD_LABEL_CLASS,
108
126
  children: [
109
127
  bindingLabel,
110
- field.required && /*#__PURE__*/ jsx("span", {
128
+ required && /*#__PURE__*/ jsx("span", {
111
129
  "aria-hidden": true,
112
130
  className: COLUMN_REQUIRED_CLASS,
113
131
  children: ' *'
@@ -117,7 +135,7 @@ const ColumnPopover = ({ column, field, types, onApply, onCancel, onMoreProperti
117
135
  /*#__PURE__*/ jsx(Input, {
118
136
  id: `${id}-binding`,
119
137
  className: COLUMN_CODE_FIELD_CLASS,
120
- "aria-required": field.required,
138
+ "aria-required": required,
121
139
  "aria-invalid": missing,
122
140
  "aria-describedby": missing ? `${id}-missing` : void 0,
123
141
  value: draft.binding,
@@ -141,19 +159,22 @@ const ColumnPopover = ({ column, field, types, onApply, onCancel, onMoreProperti
141
159
  }),
142
160
  /*#__PURE__*/ jsx(PopoverSelect, {
143
161
  id: `${id}-type`,
144
- value: draft.typeRef,
145
- options: options,
146
- onChange: (typeRef)=>setDraft((current)=>({
162
+ value: String(place),
163
+ options: choices,
164
+ onChange: (picked)=>{
165
+ const option = types.find((_option, index)=>String(index) === picked);
166
+ if (option) setDraft((current)=>({
147
167
  ...current,
148
- typeRef
149
- })),
168
+ type: option.type
169
+ }));
170
+ },
150
171
  container: root,
151
172
  label: labels.dataType,
152
173
  dataTestId: `${dataTestId}-type`
153
174
  })
154
175
  ]
155
176
  }),
156
- void 0 !== field.allowedValues && /*#__PURE__*/ jsxs("div", {
177
+ /*#__PURE__*/ jsxs("div", {
157
178
  className: COLUMN_FIELD_CLASS,
158
179
  children: [
159
180
  /*#__PURE__*/ jsx(Label, {
@@ -29,13 +29,16 @@ __webpack_require__.d(__webpack_exports__, {
29
29
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
30
  const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
31
31
  const external_react_namespaceObject = require("react");
32
+ const useSafeLingui_cjs_namespaceObject = require("../i18n/useSafeLingui.cjs");
32
33
  const external_AddRuleFooter_cjs_namespaceObject = require("./AddRuleFooter.cjs");
33
34
  const external_bandColumns_cjs_namespaceObject = require("./bandColumns.cjs");
34
35
  const external_ColumnEditorOverlay_cjs_namespaceObject = require("./ColumnEditorOverlay.cjs");
36
+ const external_columnTypes_cjs_namespaceObject = require("./columnTypes.cjs");
35
37
  const external_DecisionTextHeader_cjs_namespaceObject = require("./DecisionTextHeader.cjs");
36
38
  const external_decisionTextDiff_cjs_namespaceObject = require("./decisionTextDiff.cjs");
37
39
  const external_EmptyRules_cjs_namespaceObject = require("./EmptyRules.cjs");
38
40
  const external_GridMenu_cjs_namespaceObject = require("./GridMenu.cjs");
41
+ const external_hitPolicyMenu_cjs_namespaceObject = require("./hitPolicyMenu.cjs");
39
42
  const external_MarkTooltip_cjs_namespaceObject = require("./MarkTooltip.cjs");
40
43
  const external_marks_cjs_namespaceObject = require("./marks.cjs");
41
44
  const external_RuleList_cjs_namespaceObject = require("./RuleList.cjs");
@@ -48,11 +51,12 @@ const external_useCellHover_cjs_namespaceObject = require("./useCellHover.cjs");
48
51
  const external_useColumnEditing_cjs_namespaceObject = require("./useColumnEditing.cjs");
49
52
  const external_useContainerHandlers_cjs_namespaceObject = require("./useContainerHandlers.cjs");
50
53
  const external_useDecisionTextStrings_cjs_namespaceObject = require("./useDecisionTextStrings.cjs");
51
- const external_useEditState_cjs_namespaceObject = require("./useEditState.cjs");
54
+ const external_useHostValueEdit_cjs_namespaceObject = require("./useHostValueEdit.cjs");
52
55
  const external_usePendingCondition_cjs_namespaceObject = require("./usePendingCondition.cjs");
53
56
  const external_useRuleMenus_cjs_namespaceObject = require("./useRuleMenus.cjs");
54
57
  const external_useRuleWindow_cjs_namespaceObject = require("./useRuleWindow.cjs");
55
58
  const external_useSentenceNavigation_cjs_namespaceObject = require("./useSentenceNavigation.cjs");
59
+ const external_useTextAnnouncements_cjs_namespaceObject = require("./useTextAnnouncements.cjs");
56
60
  const external_useValueEditing_cjs_namespaceObject = require("./useValueEditing.cjs");
57
61
  const external_ValueEditorOverlay_cjs_namespaceObject = require("./ValueEditorOverlay.cjs");
58
62
  const NO_FOLDS = new Set();
@@ -71,27 +75,45 @@ const nameTokensOf = (bands)=>{
71
75
  text: columnId
72
76
  };
73
77
  };
74
- const DecisionText = ({ rules, inputs, outputs, header, numbered = false, marks = external_marks_cjs_namespaceObject.EMPTY_MARKS, onCellHover, mode, headerMark, onOpenDecision, scroll = 'self', ariaLabel, containerProps, dataTestId, children })=>{
78
+ const DecisionText = ({ table, mode, hitPolicies, columnTypes, numbered = false, marks = external_marks_cjs_namespaceObject.EMPTY_MARKS, onCellHover, headerMark, onOpenDecision, scroll = 'self', ariaLabel, containerProps, dataTestId, children })=>{
79
+ const { rules, inputs, outputs } = table;
75
80
  const selected = 'diff' === mode.kind ? null : mode.selected;
76
81
  const onSelect = 'select' === mode.kind || 'edit' === mode.kind ? mode.onSelect : void 0;
77
82
  const diff = 'diff' === mode.kind ? mode.diff : void 0;
78
83
  const idPrefix = (0, external_react_namespaceObject.useId)();
84
+ const { _ } = (0, useSafeLingui_cjs_namespaceObject.useSafeLingui)();
79
85
  const labels = (0, external_useDecisionTextStrings_cjs_namespaceObject.useDecisionTextLabels)();
80
- const hostEdit = 'edit' === mode.kind ? mode.edit : void 0;
81
- const { edit, refusal } = (0, external_useEditState_cjs_namespaceObject.useEditState)(hostEdit, (0, external_useDecisionTextStrings_cjs_namespaceObject.useDecisionTextEditLabels)());
86
+ const announcements = (0, external_useTextAnnouncements_cjs_namespaceObject.useTextAnnouncements)(_, dataTestId);
87
+ const { edit, refusal } = (0, external_useHostValueEdit_cjs_namespaceObject.useHostValueEdit)('edit' === mode.kind ? mode.edit : void 0, [
88
+ ...inputs,
89
+ ...outputs
90
+ ], (0, external_useDecisionTextStrings_cjs_namespaceObject.useDecisionTextEditLabels)(), announcements);
82
91
  const addRule = 'edit' === mode.kind ? {
83
92
  label: labels.addRule,
84
93
  onAdd: mode.onAddRule
85
94
  } : void 0;
95
+ const policyHeader = (0, external_hitPolicyMenu_cjs_namespaceObject.policyHeaderOf)(hitPolicies, table.hitPolicy);
96
+ const title = 'edit' === mode.kind ? {
97
+ kind: 'picker',
98
+ policy: (0, external_hitPolicyMenu_cjs_namespaceObject.policyMenuOf)(hitPolicies, table.hitPolicy, mode.onPolicyChange, _)
99
+ } : diff?.hitPolicy ? {
100
+ kind: 'change',
101
+ before: (0, external_hitPolicyMenu_cjs_namespaceObject.policyHeaderOf)(hitPolicies, diff.hitPolicy.before).label,
102
+ after: (0, external_hitPolicyMenu_cjs_namespaceObject.policyHeaderOf)(hitPolicies, diff.hitPolicy.after).label
103
+ } : {
104
+ kind: 'label',
105
+ label: policyHeader.label
106
+ };
86
107
  const columns = (0, external_react_namespaceObject.useMemo)(()=>diff && (0, external_decisionTextDiff_cjs_namespaceObject.diffColumnsOf)(inputs, outputs, diff), [
87
108
  inputs,
88
109
  outputs,
89
110
  diff
90
111
  ]);
91
- const bands = (0, external_react_namespaceObject.useMemo)(()=>(0, external_bandColumns_cjs_namespaceObject.bandsOf)(columns?.inputs ?? inputs, columns?.outputs ?? outputs, labels), [
112
+ const bands = (0, external_react_namespaceObject.useMemo)(()=>(0, external_bandColumns_cjs_namespaceObject.bandsOf)(columns?.inputs ?? inputs, columns?.outputs ?? outputs, (type)=>(0, external_columnTypes_cjs_namespaceObject.glyphOf)(columnTypes, type), labels), [
92
113
  columns,
93
114
  inputs,
94
115
  outputs,
116
+ columnTypes,
95
117
  labels
96
118
  ]);
97
119
  const [folds, setFolds] = (0, external_react_namespaceObject.useState)({
@@ -154,7 +176,7 @@ const DecisionText = ({ rules, inputs, outputs, header, numbered = false, marks
154
176
  stopTabbable: selectable && null !== ruleWindow.selectedRow
155
177
  });
156
178
  const columnEditing = (0, external_useColumnEditing_cjs_namespaceObject.useColumnEditing)({
157
- column: edit?.column,
179
+ column: 'edit' === mode.kind ? mode.edit.column : void 0,
158
180
  bands,
159
181
  container: ruleWindow.container
160
182
  });
@@ -175,10 +197,9 @@ const DecisionText = ({ rules, inputs, outputs, header, numbered = false, marks
175
197
  children: [
176
198
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DecisionTextHeader_cjs_namespaceObject.DecisionTextHeader, {
177
199
  ref: ruleWindow.headerRef,
178
- header: header,
179
- policy: 'edit' === mode.kind ? mode.policy : void 0,
200
+ title: title,
201
+ hint: policyHeader.hint,
180
202
  mark: headerMark,
181
- hitPolicy: diff?.hitPolicy,
182
203
  labels: labels,
183
204
  sticky: 'self' === scroll,
184
205
  dataTestId: dataTestId
@@ -245,9 +266,9 @@ const DecisionText = ({ rules, inputs, outputs, header, numbered = false, marks
245
266
  container: ruleWindow.container,
246
267
  dataTestId: dataTestId
247
268
  }, valueEditing.editorKey),
248
- 'edit' === columnEditing.kind && columnEditing.editor && edit?.column && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ColumnEditorOverlay_cjs_namespaceObject.ColumnEditorOverlay, {
269
+ 'edit' === columnEditing.kind && columnEditing.editor && edit && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ColumnEditorOverlay_cjs_namespaceObject.ColumnEditorOverlay, {
249
270
  editor: columnEditing.editor,
250
- edit: edit.column,
271
+ types: columnTypes,
251
272
  labels: edit.labels,
252
273
  container: ruleWindow.container,
253
274
  id: columnEditorId,
@@ -264,6 +285,7 @@ const DecisionText = ({ rules, inputs, outputs, header, numbered = false, marks
264
285
  entries: ruleMenus.entries,
265
286
  onClose: ruleMenus.onClose
266
287
  }),
288
+ announcements.region,
267
289
  children
268
290
  ]
269
291
  });