nucleus-core-ts 0.9.841 → 0.9.843

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.
@@ -18,8 +18,16 @@ import { integrationsPageTheme as theme } from '../theme';
18
18
  */ export function ConnectionSwitcher() {
19
19
  const store = useIntegrationsStore();
20
20
  const labels = useLabels();
21
+ /**
22
+ * The way back does not depend on finding anything.
23
+ *
24
+ * `store.sources` is the rail's CURRENT PAGE, and the rail is unmounted the
25
+ * moment a connection is chosen — so a selected connection that is not on
26
+ * that page rendered nothing at all here: no name, and no way back to the
27
+ * list short of reloading the page. The name is what needs looking up; the
28
+ * button is not.
29
+ */ if (!store.selectedSourceId) return null;
21
30
  const source = store.sources.find((candidate)=>candidate.id === store.selectedSourceId);
22
- if (!source) return null;
23
31
  return /*#__PURE__*/ _jsxs("div", {
24
32
  className: cn('flex flex-wrap items-center justify-between gap-3 rounded-2xl border border-slate-200/80 bg-white px-4 py-3 dark:border-slate-800 dark:bg-slate-900'),
25
33
  children: [
@@ -32,12 +40,12 @@ import { integrationsPageTheme as theme } from '../theme';
32
40
  }),
33
41
  /*#__PURE__*/ _jsx("span", {
34
42
  className: "truncate font-semibold text-base text-slate-900 dark:text-slate-100",
35
- children: source.name
43
+ children: source?.name ?? labels.connections.heading
36
44
  }),
37
- /*#__PURE__*/ _jsx("span", {
45
+ source?.baseUrl ? /*#__PURE__*/ _jsx("span", {
38
46
  className: cn(theme.list.itemMeta, 'mt-0.5'),
39
47
  children: source.baseUrl
40
- })
48
+ }) : null
41
49
  ]
42
50
  }),
43
51
  /*#__PURE__*/ _jsx("button", {
@@ -6,7 +6,7 @@ import { useLabels } from '../text/context';
6
6
  import { integrationsPageTheme } from '../theme';
7
7
  import { FieldMappingRow } from './FieldMappingRow';
8
8
  import { EMPTY_FIELD_MAPPING, FIELD_MAPPING_COLUMNS, FIELD_MAPPING_GRID, PARENT_PREFIX } from './fieldMappingOptions';
9
- import { Notice } from './Primitives';
9
+ import { Notice, Section } from './Primitives';
10
10
  /**
11
11
  * The rows that say which incoming value becomes which column.
12
12
  *
@@ -33,28 +33,20 @@ export function FieldMappingRows({ rows, sourceFields, targetFields, disabled, o
33
33
  if (!moving || !displaced) return;
34
34
  onChange(rows.with(index, displaced).with(target, moving));
35
35
  };
36
- return /*#__PURE__*/ _jsxs("section", {
37
- className: "flex flex-col gap-3",
36
+ return /*#__PURE__*/ _jsxs(Section, {
37
+ action: /*#__PURE__*/ _jsx("button", {
38
+ className: theme.button.secondary,
39
+ disabled: disabled,
40
+ onClick: ()=>onChange([
41
+ ...rows,
42
+ EMPTY_FIELD_MAPPING
43
+ ]),
44
+ type: "button",
45
+ children: "Add field"
46
+ }),
47
+ purpose: "Which incoming value becomes which column. The order is the order they are applied in.",
48
+ title: labels.mappings.fieldsHeading,
38
49
  children: [
39
- /*#__PURE__*/ _jsxs("div", {
40
- className: "flex flex-wrap items-center justify-between gap-2",
41
- children: [
42
- /*#__PURE__*/ _jsx("h3", {
43
- className: theme.card.title,
44
- children: labels.mappings.fieldsHeading
45
- }),
46
- /*#__PURE__*/ _jsx("button", {
47
- className: theme.button.secondary,
48
- disabled: disabled,
49
- onClick: ()=>onChange([
50
- ...rows,
51
- EMPTY_FIELD_MAPPING
52
- ]),
53
- type: "button",
54
- children: "Add field"
55
- })
56
- ]
57
- }),
58
50
  sourceFields.length === 0 ? /*#__PURE__*/ _jsx(Notice, {
59
51
  title: labels.mappings.sampleFirstTitle,
60
52
  tone: "warning",