nucleus-core-ts 0.9.790 → 0.9.791

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.
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { useGSAP } from '@gsap/react';
4
4
  import gsap from 'gsap';
5
- import { useEffect, useEffectEvent, useRef } from 'react';
5
+ import { useEffect, useEffectEvent, useRef, useState } from 'react';
6
6
  import { cn } from '../../../utils/cn';
7
7
  import { useIntegrationsStore } from '../store';
8
8
  import { integrationsPageTheme } from '../theme';
@@ -26,6 +26,19 @@ export function IntegrationsPage({ title = 'Integrations', subtitle = 'Connect a
26
26
  const store = useIntegrationsStore();
27
27
  const containerRef = useRef(null);
28
28
  const contentRef = useRef(null);
29
+ /**
30
+ * Bumped after a connection is written, to pull the rail again.
31
+ *
32
+ * `ConnectionList` and `ConnectionSettingsTab` were both built to be told
33
+ * about a save and neither was ever told: the shell mounted them with only
34
+ * `actions`. Creating the first connection therefore selected a record the
35
+ * rail had never fetched, so the rail kept saying "0 connections" while the
36
+ * detail treated the missing record as still loading and sat on skeletons
37
+ * until the page was reloaded by hand. The write itself had succeeded.
38
+ */ const [sourcesReloadToken, setSourcesReloadToken] = useState(0);
39
+ const handleSourceSaved = ()=>{
40
+ setSourcesReloadToken((token)=>token + 1);
41
+ };
29
42
  // One measured entrance. Anything longer makes an operator wait to read counts
30
43
  // they came here to check.
31
44
  useGSAP(()=>{
@@ -114,7 +127,8 @@ export function IntegrationsPage({ title = 'Integrations', subtitle = 'Connect a
114
127
  "aria-label": "Connections",
115
128
  className: theme.layout.aside,
116
129
  children: /*#__PURE__*/ _jsx(ConnectionList, {
117
- actions: actions
130
+ actions: actions,
131
+ reloadToken: sourcesReloadToken
118
132
  })
119
133
  }),
120
134
  /*#__PURE__*/ _jsx("section", {
@@ -138,7 +152,8 @@ export function IntegrationsPage({ title = 'Integrations', subtitle = 'Connect a
138
152
  role: "tabpanel",
139
153
  children: [
140
154
  tab === 'connection' ? /*#__PURE__*/ _jsx(ConnectionSettingsTab, {
141
- actions: actions
155
+ actions: actions,
156
+ onSaved: handleSourceSaved
142
157
  }) : null,
143
158
  tab === 'endpoints' ? /*#__PURE__*/ _jsx(EndpointsTab, {
144
159
  actions: actions
@@ -163,7 +178,8 @@ export function IntegrationsPage({ title = 'Integrations', subtitle = 'Connect a
163
178
  children: "Select a connection on the left, or set up a new one here."
164
179
  }),
165
180
  /*#__PURE__*/ _jsx(ConnectionSettingsTab, {
166
- actions: actions
181
+ actions: actions,
182
+ onSaved: handleSourceSaved
167
183
  })
168
184
  ]
169
185
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nucleus-core-ts",
3
- "version": "0.9.790",
3
+ "version": "0.9.791",
4
4
  "description": "Production-ready, enterprise-grade TypeScript framework for building multi-tenant APIs",
5
5
  "author": "Hidayet Can Özcan <hidayetcan@gmail.com>",
6
6
  "license": "SEE LICENSE IN LICENSE",