@entifix/next-shell 0.18.1 → 0.19.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.
- package/dist/lib/back-office/breadcrumbs.d.ts.map +1 -1
- package/dist/lib/back-office/breadcrumbs.js +2 -0
- package/dist/lib/back-office/breadcrumbs.js.map +1 -1
- package/dist/lib/workspace/workspace-shell.d.ts.map +1 -1
- package/dist/lib/workspace/workspace-shell.js +14 -4
- package/dist/lib/workspace/workspace-shell.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../../src/lib/back-office/breadcrumbs.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,yBAAyB,CAAC;AAKjC,MAAM,WAAW,0BAA0B;IACzC;;gEAE4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAMD,0EAA0E;AAC1E,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,SAAS,EAAE,MAAM,GAChB,cAAc,EAAE,CAclB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,MAAW,GACZ,EAAE,0BAA0B,+
|
|
1
|
+
{"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../../src/lib/back-office/breadcrumbs.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,yBAAyB,CAAC;AAKjC,MAAM,WAAW,0BAA0B;IACzC;;gEAE4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAMD,0EAA0E;AAC1E,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,SAAS,EAAE,MAAM,GAChB,cAAc,EAAE,CAclB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,MAAW,GACZ,EAAE,0BAA0B,+BAiB5B"}
|
|
@@ -38,9 +38,11 @@ function humanize(segment) {
|
|
|
38
38
|
*/ export function BackOfficeBreadcrumbs({ labels = {} }) {
|
|
39
39
|
var _usePathname;
|
|
40
40
|
const t = useT('shell');
|
|
41
|
+
const controls = useT();
|
|
41
42
|
const pathname = (_usePathname = usePathname()) != null ? _usePathname : '/';
|
|
42
43
|
const items = buildCrumbs(pathname, labels, t('breadcrumbs.home'));
|
|
43
44
|
return /*#__PURE__*/ _jsx(Breadcrumbs, {
|
|
45
|
+
label: controls('breadcrumbs.label'),
|
|
44
46
|
items: items,
|
|
45
47
|
renderLink: (item)=>/*#__PURE__*/ _jsx(LocaleLink, {
|
|
46
48
|
href: item.href,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/back-office/breadcrumbs.tsx"],"sourcesContent":["'use client';\n\nimport { splitLocalePath } from '@entifix/core';\nimport {\n type BreadcrumbItem,\n Breadcrumbs,\n useT,\n} from '@entifix/react-controls';\nimport { usePathname } from 'next/navigation';\n\nimport { LocaleLink } from '../i18n/index.js';\n\nexport interface BackOfficeBreadcrumbsProps {\n /** Map a path segment to an already-translated label; unmapped segments are\n * title-cased. Hosts resolve these through `useT` — the shell has no way to\n * know which namespace an app keeps its route names in. */\n labels?: Record<string, string>;\n}\n\nfunction humanize(segment: string): string {\n return segment.replace(/-/g, ' ').replace(/\\b\\w/g, c => c.toUpperCase());\n}\n\n/** Derives the crumb trail from a pathname. Exported for unit testing. */\nexport function buildCrumbs(\n pathname: string,\n labels: Record<string, string>,\n homeLabel: string,\n): BreadcrumbItem[] {\n const crumbs: BreadcrumbItem[] = [{ label: homeLabel, href: '/' }];\n let href = '';\n // The locale prefix is routing, not a place — a crumb reading \"Es\" would be\n // both meaningless and un-navigable.\n const { rest } = splitLocalePath(pathname);\n for (const segment of rest.split('/').filter(Boolean)) {\n href += `/${segment}`;\n crumbs.push({ label: labels[segment] ?? humanize(segment), href });\n }\n // The last crumb is the current page: drop its href so it renders as such.\n const last = crumbs[crumbs.length - 1];\n last.href = undefined;\n return crumbs;\n}\n\n/**\n * The root crumb is the shell's own copy: it names the shell's `/`, not\n * anything the host app authored. Apps used to pass their brand here\n * (\"Admin\", \"Identidad\"), which duplicated what the sidebar already shows.\n */\nexport function BackOfficeBreadcrumbs({\n labels = {},\n}: BackOfficeBreadcrumbsProps) {\n const t = useT('shell');\n const pathname = usePathname() ?? '/';\n const items = buildCrumbs(pathname, labels, t('breadcrumbs.home'));\n\n return (\n <Breadcrumbs\n items={items}\n renderLink={item => (\n <LocaleLink href={item.href} className={item.className}>\n {item.label}\n </LocaleLink>\n )}\n />\n );\n}\n"],"names":["splitLocalePath","Breadcrumbs","useT","usePathname","LocaleLink","humanize","segment","replace","c","toUpperCase","buildCrumbs","pathname","labels","homeLabel","crumbs","label","href","rest","split","filter","Boolean","push","last","length","undefined","BackOfficeBreadcrumbs","t","items","renderLink","item","className"],"mappings":"AAAA;;AAEA,SAASA,eAAe,QAAQ,gBAAgB;AAChD,SAEEC,WAAW,EACXC,IAAI,QACC,0BAA0B;AACjC,SAASC,WAAW,QAAQ,kBAAkB;AAE9C,SAASC,UAAU,QAAQ,mBAAmB;AAS9C,SAASC,SAASC,OAAe;IAC/B,OAAOA,QAAQC,OAAO,CAAC,MAAM,KAAKA,OAAO,CAAC,SAASC,CAAAA,IAAKA,EAAEC,WAAW;AACvE;AAEA,wEAAwE,GACxE,OAAO,SAASC,YACdC,QAAgB,EAChBC,MAA8B,EAC9BC,SAAiB;IAEjB,MAAMC,SAA2B;QAAC;YAAEC,OAAOF;YAAWG,MAAM;QAAI;KAAE;IAClE,IAAIA,OAAO;IACX,4EAA4E;IAC5E,qCAAqC;IACrC,MAAM,EAAEC,IAAI,EAAE,GAAGjB,gBAAgBW;IACjC,KAAK,MAAML,WAAWW,KAAKC,KAAK,CAAC,KAAKC,MAAM,CAACC,SAAU;YAEhCR;QADrBI,QAAQ,CAAC,CAAC,EAAEV,SAAS;QACrBQ,OAAOO,IAAI,CAAC;YAAEN,KAAK,GAAEH,kBAAAA,MAAM,CAACN,QAAQ,YAAfM,kBAAmBP,SAASC;YAAUU;QAAK;IAClE;IACA,2EAA2E;IAC3E,MAAMM,OAAOR,MAAM,CAACA,OAAOS,MAAM,GAAG,EAAE;IACtCD,KAAKN,IAAI,GAAGQ;IACZ,OAAOV;AACT;AAEA;;;;CAIC,GACD,OAAO,SAASW,sBAAsB,EACpCb,SAAS,CAAC,CAAC,EACgB;
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/back-office/breadcrumbs.tsx"],"sourcesContent":["'use client';\n\nimport { splitLocalePath } from '@entifix/core';\nimport {\n type BreadcrumbItem,\n Breadcrumbs,\n useT,\n} from '@entifix/react-controls';\nimport { usePathname } from 'next/navigation';\n\nimport { LocaleLink } from '../i18n/index.js';\n\nexport interface BackOfficeBreadcrumbsProps {\n /** Map a path segment to an already-translated label; unmapped segments are\n * title-cased. Hosts resolve these through `useT` — the shell has no way to\n * know which namespace an app keeps its route names in. */\n labels?: Record<string, string>;\n}\n\nfunction humanize(segment: string): string {\n return segment.replace(/-/g, ' ').replace(/\\b\\w/g, c => c.toUpperCase());\n}\n\n/** Derives the crumb trail from a pathname. Exported for unit testing. */\nexport function buildCrumbs(\n pathname: string,\n labels: Record<string, string>,\n homeLabel: string,\n): BreadcrumbItem[] {\n const crumbs: BreadcrumbItem[] = [{ label: homeLabel, href: '/' }];\n let href = '';\n // The locale prefix is routing, not a place — a crumb reading \"Es\" would be\n // both meaningless and un-navigable.\n const { rest } = splitLocalePath(pathname);\n for (const segment of rest.split('/').filter(Boolean)) {\n href += `/${segment}`;\n crumbs.push({ label: labels[segment] ?? humanize(segment), href });\n }\n // The last crumb is the current page: drop its href so it renders as such.\n const last = crumbs[crumbs.length - 1];\n last.href = undefined;\n return crumbs;\n}\n\n/**\n * The root crumb is the shell's own copy: it names the shell's `/`, not\n * anything the host app authored. Apps used to pass their brand here\n * (\"Admin\", \"Identidad\"), which duplicated what the sidebar already shows.\n */\nexport function BackOfficeBreadcrumbs({\n labels = {},\n}: BackOfficeBreadcrumbsProps) {\n const t = useT('shell');\n const controls = useT();\n const pathname = usePathname() ?? '/';\n const items = buildCrumbs(pathname, labels, t('breadcrumbs.home'));\n\n return (\n <Breadcrumbs\n label={controls('breadcrumbs.label')}\n items={items}\n renderLink={item => (\n <LocaleLink href={item.href} className={item.className}>\n {item.label}\n </LocaleLink>\n )}\n />\n );\n}\n"],"names":["splitLocalePath","Breadcrumbs","useT","usePathname","LocaleLink","humanize","segment","replace","c","toUpperCase","buildCrumbs","pathname","labels","homeLabel","crumbs","label","href","rest","split","filter","Boolean","push","last","length","undefined","BackOfficeBreadcrumbs","t","controls","items","renderLink","item","className"],"mappings":"AAAA;;AAEA,SAASA,eAAe,QAAQ,gBAAgB;AAChD,SAEEC,WAAW,EACXC,IAAI,QACC,0BAA0B;AACjC,SAASC,WAAW,QAAQ,kBAAkB;AAE9C,SAASC,UAAU,QAAQ,mBAAmB;AAS9C,SAASC,SAASC,OAAe;IAC/B,OAAOA,QAAQC,OAAO,CAAC,MAAM,KAAKA,OAAO,CAAC,SAASC,CAAAA,IAAKA,EAAEC,WAAW;AACvE;AAEA,wEAAwE,GACxE,OAAO,SAASC,YACdC,QAAgB,EAChBC,MAA8B,EAC9BC,SAAiB;IAEjB,MAAMC,SAA2B;QAAC;YAAEC,OAAOF;YAAWG,MAAM;QAAI;KAAE;IAClE,IAAIA,OAAO;IACX,4EAA4E;IAC5E,qCAAqC;IACrC,MAAM,EAAEC,IAAI,EAAE,GAAGjB,gBAAgBW;IACjC,KAAK,MAAML,WAAWW,KAAKC,KAAK,CAAC,KAAKC,MAAM,CAACC,SAAU;YAEhCR;QADrBI,QAAQ,CAAC,CAAC,EAAEV,SAAS;QACrBQ,OAAOO,IAAI,CAAC;YAAEN,KAAK,GAAEH,kBAAAA,MAAM,CAACN,QAAQ,YAAfM,kBAAmBP,SAASC;YAAUU;QAAK;IAClE;IACA,2EAA2E;IAC3E,MAAMM,OAAOR,MAAM,CAACA,OAAOS,MAAM,GAAG,EAAE;IACtCD,KAAKN,IAAI,GAAGQ;IACZ,OAAOV;AACT;AAEA;;;;CAIC,GACD,OAAO,SAASW,sBAAsB,EACpCb,SAAS,CAAC,CAAC,EACgB;QAGVT;IAFjB,MAAMuB,IAAIxB,KAAK;IACf,MAAMyB,WAAWzB;IACjB,MAAMS,YAAWR,eAAAA,yBAAAA,eAAiB;IAClC,MAAMyB,QAAQlB,YAAYC,UAAUC,QAAQc,EAAE;IAE9C,qBACE,KAACzB;QACCc,OAAOY,SAAS;QAChBC,OAAOA;QACPC,YAAYC,CAAAA,qBACV,KAAC1B;gBAAWY,MAAMc,KAAKd,IAAI;gBAAEe,WAAWD,KAAKC,SAAS;0BACnDD,KAAKf,KAAK;;;AAKrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-shell.d.ts","sourceRoot":"","sources":["../../../src/lib/workspace/workspace-shell.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workspace-shell.d.ts","sourceRoot":"","sources":["../../../src/lib/workspace/workspace-shell.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,SAAS,EAA8B,MAAM,OAAO,CAAC;AAGnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;OAQG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,QAAQ,EAAE,WAAW,CAAC;IACtB,yEAAyE;IACzE,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,gCAAgC;IAChC,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,UAAU,GACX,EAAE,mBAAmB,+BAgNrB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { ConfirmDialog, Tab, TabStrip, TopBar, useT, useTranslateKey } from '@entifix/react-controls';
|
|
3
|
+
import { ConfirmDialog, Tab, TabPanel, TabStrip, TopBar, useT, useTranslateKey } from '@entifix/react-controls';
|
|
4
4
|
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
|
|
5
|
-
import { useEffect, useState } from 'react';
|
|
5
|
+
import { useEffect, useId, useState } from 'react';
|
|
6
6
|
import { useDraftsState } from './drafts-state.js';
|
|
7
7
|
import { useTabsState } from './tabs-state.js';
|
|
8
8
|
/**
|
|
@@ -147,6 +147,12 @@ import { useTabsState } from './tabs-state.js';
|
|
|
147
147
|
const copyDeepLink = (param)=>{
|
|
148
148
|
void navigator.clipboard.writeText(`${window.location.origin}${pathname}?tab=${encodeURIComponent(param)}`);
|
|
149
149
|
};
|
|
150
|
+
// Tab and panel ids: DOM ids, so derived from the tab's position under one
|
|
151
|
+
// per-shell prefix rather than from its param, which holds `:` and `#`.
|
|
152
|
+
const idBase = useId();
|
|
153
|
+
const panelId = `${idBase}-panel`;
|
|
154
|
+
const tabId = (index)=>`${idBase}-tab-${index}`;
|
|
155
|
+
const activeIndex = tabs.findIndex((tab)=>tab.param === activeParam);
|
|
150
156
|
const activeResolved = activeParam ? registry.resolve(activeParam, translate) : null;
|
|
151
157
|
const body = deadLink ? fallback : activeResolved ? activeResolved.render() : emptyState;
|
|
152
158
|
return /*#__PURE__*/ _jsxs("div", {
|
|
@@ -166,10 +172,12 @@ import { useTabsState } from './tabs-state.js';
|
|
|
166
172
|
})
|
|
167
173
|
}),
|
|
168
174
|
/*#__PURE__*/ _jsx(TabStrip, {
|
|
169
|
-
children: tabs.map((tab)=>{
|
|
175
|
+
children: tabs.map((tab, index)=>{
|
|
170
176
|
var _ref;
|
|
171
177
|
var _registry_resolve;
|
|
172
178
|
return /*#__PURE__*/ _jsx(Tab, {
|
|
179
|
+
id: tabId(index),
|
|
180
|
+
controls: panelId,
|
|
173
181
|
// Re-derived from the registry rather than read back from the
|
|
174
182
|
// store: the persisted title is whatever locale it was opened
|
|
175
183
|
// in, so a locale switch would leave stale captions behind.
|
|
@@ -183,7 +191,9 @@ import { useTabsState } from './tabs-state.js';
|
|
|
183
191
|
}, tab.param);
|
|
184
192
|
})
|
|
185
193
|
}),
|
|
186
|
-
/*#__PURE__*/ _jsx(
|
|
194
|
+
/*#__PURE__*/ _jsx(TabPanel, {
|
|
195
|
+
id: panelId,
|
|
196
|
+
labelledBy: !deadLink && activeIndex >= 0 ? tabId(activeIndex) : undefined,
|
|
187
197
|
className: "min-w-0 flex-1 p-m",
|
|
188
198
|
children: body
|
|
189
199
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/workspace/workspace-shell.tsx"],"sourcesContent":["'use client';\n\nimport {\n ConfirmDialog,\n Tab,\n TabStrip,\n TopBar,\n useT,\n useTranslateKey,\n} from '@entifix/react-controls';\nimport { usePathname, useRouter, useSearchParams } from 'next/navigation';\nimport { type ReactNode, useEffect, useState } from 'react';\n\nimport { useDraftsState } from './drafts-state.js';\nimport type { TabRegistry } from './tab-kind.js';\nimport { useTabsState } from './tabs-state.js';\n\nexport interface WorkspaceShellProps {\n /**\n * Who this workspace belongs to — `workspaceScopeKey({ userId,\n * organizationId })`, resolved on the server from the session.\n *\n * Required, deliberately: IndexedDB is a property of the browser profile, so a\n * host that forgets to pass one hands the next account to sign in on that\n * machine the previous account's open tabs and half-finished edits. A default\n * would make that the quiet outcome of doing nothing.\n */\n scope: string;\n /** Resolves `?tab=` values to renderable tabs. */\n registry: TabRegistry;\n /** Right-aligned actions above the tab strip (search, the user menu). */\n actions?: ReactNode;\n /** Body when `?tab=` names something the registry cannot resolve. */\n fallback?: ReactNode;\n /** Body when no tab is open. */\n emptyState?: ReactNode;\n}\n\n/**\n * The tab workspace: a strip of persisted tabs over the active tab's body — no\n * sidebar or brand of its own. It is mounted inside a host shell (the\n * back-office layout, say) that already supplies those, so nesting two\n * sidebars never happens. The open set lives in {@link useTabsState}\n * (IndexedDB); the URL's `?tab=` projects only the active tab, so a deep link\n * opens or focuses exactly that tab and an unknown kind shows the fallback\n * instead of crashing.\n */\nexport function WorkspaceShell({\n scope,\n registry,\n actions,\n fallback,\n emptyState,\n}: WorkspaceShellProps) {\n const t = useT('shell');\n // Tab captions are catalog keys carried in a registry, not authored copy.\n const translate = useTranslateKey();\n const searchParams = useSearchParams();\n const router = useRouter();\n const pathname = usePathname();\n const urlTab = searchParams.get('tab');\n\n const tabs = useTabsState(state => state.tabs);\n const activeParam = useTabsState(state => state.activeParam);\n const open = useTabsState(state => state.open);\n const close = useTabsState(state => state.close);\n const activate = useTabsState(state => state.activate);\n\n const drafts = useDraftsState(state => state.drafts);\n const clearDraft = useDraftsState(state => state.clearDraft);\n\n // Load the persisted tab set and drafts once, on the client (hydration is\n // skipped at creation so SSR never touches IndexedDB).\n //\n // Both URL effects below wait on this flag, because the read is async and\n // lands *after* the first commit: opening the deep-linked tab before it\n // resolves means the restored snapshot's `activeParam` overwrites the tab the\n // URL asked for, and the write-back then projects that wrong tab into the\n // address bar. The URL is the more specific instruction, so it is applied\n // once the store has finished restoring rather than before.\n const [hydrated, setHydrated] = useState(false);\n useEffect(() => {\n // The scope is applied *before* the read, not after: the storage key is what\n // decides whose tabs and drafts come back, so setting it late would restore\n // the unscoped set first and only then start writing to the right key. Both\n // stores are module singletons with `skipHydration`, and this is the only\n // place that rehydrates them, so re-pointing them here is enough — no store\n // factory or provider is needed to keep two accounts apart.\n useTabsState.persist.setOptions({ name: `tabs:${scope}` });\n useDraftsState.persist.setOptions({ name: `drafts:${scope}` });\n void Promise.all([\n useTabsState.persist.rehydrate(),\n useDraftsState.persist.rehydrate(),\n ]).finally(() => setHydrated(true));\n }, [scope]);\n\n // The `?tab=` value the registry cannot resolve, if any — derived, so it is\n // known on the very first render rather than an effect later. An\n // unresolvable address used to be dropped on the floor: no tab, no error,\n // and the write-back below then replaced it with the previously active tab,\n // so even the URL stopped saying what was asked for. Here it answers with\n // the fallback and the bad address stays in the bar, where it can be read.\n //\n // `dismissed` is the escape: a deliberate tab interaction is a newer\n // instruction than the address that failed, and it holds the *value* rather\n // than a flag so the next dead link is dead again.\n const [dismissed, setDismissed] = useState<string | null>(null);\n const deadLink =\n urlTab && urlTab !== dismissed && !registry.resolve(urlTab, translate)\n ? urlTab\n : null;\n\n // A tab is dirty while its address has an unsaved draft; closing one confirms.\n //\n // The confirmation is a rendered dialog, so the decision spans two commits\n // rather than one blocking call: `handleClose` either closes outright or\n // parks the address, and the dialog's own buttons finish it. `window.confirm`\n // could not be styled, blocked the thread while it was up, and in Playwright\n // had to be driven by a global `page.on('dialog')` handler registered before\n // the click — which is why the workspace had no end-to-end test at all.\n const [pendingClose, setPendingClose] = useState<string | null>(null);\n\n const commitClose = (param: string) => {\n // Unconditional: `clearDraft` returns the state unchanged when the address\n // holds no draft, so the clean path costs a no-op rather than a branch.\n clearDraft(param);\n setDismissed(urlTab);\n close(param);\n };\n\n const handleClose = (param: string) => {\n if (param in drafts) {\n setPendingClose(param);\n return;\n }\n commitClose(param);\n };\n\n const handleActivate = (param: string) => {\n setDismissed(urlTab);\n activate(param);\n };\n\n // Deep link → open/focus the addressed tab (a dead one shows the fallback).\n useEffect(() => {\n if (!hydrated || !urlTab) return;\n const resolved = registry.resolve(urlTab, translate);\n if (resolved) {\n open({ param: resolved.param, title: resolved.title });\n }\n }, [hydrated, urlTab, registry, open, translate]);\n\n // Project the active tab back to the URL so it stays shareable.\n //\n // The active tab is read from the *committed* store rather than from this\n // render's snapshot. Following a link to a second tab changes the URL one\n // commit before the store catches up, so the snapshot still names the\n // previously active tab — writing that back would undo the navigation, the\n // effect above would re-open the URL's tab, and the two would trade the\n // address bar back and forth forever (a visible flicker between, say, brands\n // and categories). The effect above runs first in the same commit, so by the\n // time this one reads the store the URL's tab is already active.\n // That ordering is also what makes the `hydrated` gate work: when the flag\n // flips, the effect above has already re-applied the URL's tab over the\n // restored snapshot, so there is nothing here to write back.\n //\n // A dead deep link suspends it: overwriting the address the visitor typed\n // with an unrelated tab is what made the failure invisible in the first place.\n useEffect(() => {\n if (!hydrated || deadLink) return;\n const active = useTabsState.getState().activeParam;\n if (active && active !== urlTab) {\n router.replace(`${pathname}?tab=${encodeURIComponent(active)}`);\n }\n }, [hydrated, deadLink, activeParam, urlTab, pathname, router]);\n\n const copyDeepLink = (param: string) => {\n void navigator.clipboard.writeText(\n `${window.location.origin}${pathname}?tab=${encodeURIComponent(param)}`,\n );\n };\n\n const activeResolved = activeParam\n ? registry.resolve(activeParam, translate)\n : null;\n const body = deadLink\n ? fallback\n : activeResolved\n ? activeResolved.render()\n : emptyState;\n\n return (\n <div className=\"min-w-0 flex flex-1 flex-col\">\n <TopBar>\n <TopBar.Actions>\n {activeParam && (\n <button\n type=\"button\"\n onClick={() => copyDeepLink(activeParam)}\n className=\"rounded-md px-2xs py-3xs text-step-sm text-content-muted focus-ring transition hover:bg-surface hover:text-content\"\n >\n {t('workspace.copyLink')}\n </button>\n )}\n {actions}\n </TopBar.Actions>\n </TopBar>\n\n <TabStrip>\n {tabs.map(tab => (\n <Tab\n key={tab.param}\n // Re-derived from the registry rather than read back from the\n // store: the persisted title is whatever locale it was opened\n // in, so a locale switch would leave stale captions behind.\n label={registry.resolve(tab.param, translate)?.title ?? tab.title}\n // Nothing is selected while the fallback is up: a highlighted\n // tab beside a body that is not its own reads as a render bug.\n active={!deadLink && tab.param === activeParam}\n state={tab.param in drafts ? 'dirty' : 'idle'}\n onSelect={() => handleActivate(tab.param)}\n onClose={() => handleClose(tab.param)}\n />\n ))}\n </TabStrip>\n\n <div className=\"min-w-0 flex-1 p-m\">{body}</div>\n\n {pendingClose && (\n <ConfirmDialog\n open\n tone=\"destructive\"\n title={t('workspace.discardTitle')}\n message={t('workspace.discard')}\n confirmLabel={t('workspace.discardConfirm')}\n onCancel={() => setPendingClose(null)}\n onConfirm={() => {\n commitClose(pendingClose);\n setPendingClose(null);\n }}\n />\n )}\n </div>\n );\n}\n"],"names":["ConfirmDialog","Tab","TabStrip","TopBar","useT","useTranslateKey","usePathname","useRouter","useSearchParams","useEffect","useState","useDraftsState","useTabsState","WorkspaceShell","scope","registry","actions","fallback","emptyState","t","translate","searchParams","router","pathname","urlTab","get","tabs","state","activeParam","open","close","activate","drafts","clearDraft","hydrated","setHydrated","persist","setOptions","name","Promise","all","rehydrate","finally","dismissed","setDismissed","deadLink","resolve","pendingClose","setPendingClose","commitClose","param","handleClose","handleActivate","resolved","title","active","getState","replace","encodeURIComponent","copyDeepLink","navigator","clipboard","writeText","window","location","origin","activeResolved","body","render","div","className","Actions","button","type","onClick","map","tab","label","onSelect","onClose","tone","message","confirmLabel","onCancel","onConfirm"],"mappings":"AAAA;;AAEA,SACEA,aAAa,EACbC,GAAG,EACHC,QAAQ,EACRC,MAAM,EACNC,IAAI,EACJC,eAAe,QACV,0BAA0B;AACjC,SAASC,WAAW,EAAEC,SAAS,EAAEC,eAAe,QAAQ,kBAAkB;AAC1E,SAAyBC,SAAS,EAAEC,QAAQ,QAAQ,QAAQ;AAE5D,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,SAASC,YAAY,QAAQ,kBAAkB;AAuB/C;;;;;;;;CAQC,GACD,OAAO,SAASC,eAAe,EAC7BC,KAAK,EACLC,QAAQ,EACRC,OAAO,EACPC,QAAQ,EACRC,UAAU,EACU;IACpB,MAAMC,IAAIf,KAAK;IACf,0EAA0E;IAC1E,MAAMgB,YAAYf;IAClB,MAAMgB,eAAeb;IACrB,MAAMc,SAASf;IACf,MAAMgB,W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AE;gBACX+D,cAAc/D,EAAE;gBAChBgE,UAAU,IAAMnC,gBAAgB;gBAChCoC,WAAW;oBACTnC,YAAYF;oBACZC,gBAAgB;gBAClB;;;;AAKV"}
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/workspace/workspace-shell.tsx"],"sourcesContent":["'use client';\n\nimport {\n ConfirmDialog,\n Tab,\n TabPanel,\n TabStrip,\n TopBar,\n useT,\n useTranslateKey,\n} from '@entifix/react-controls';\nimport { usePathname, useRouter, useSearchParams } from 'next/navigation';\nimport { type ReactNode, useEffect, useId, useState } from 'react';\n\nimport { useDraftsState } from './drafts-state.js';\nimport type { TabRegistry } from './tab-kind.js';\nimport { useTabsState } from './tabs-state.js';\n\nexport interface WorkspaceShellProps {\n /**\n * Who this workspace belongs to — `workspaceScopeKey({ userId,\n * organizationId })`, resolved on the server from the session.\n *\n * Required, deliberately: IndexedDB is a property of the browser profile, so a\n * host that forgets to pass one hands the next account to sign in on that\n * machine the previous account's open tabs and half-finished edits. A default\n * would make that the quiet outcome of doing nothing.\n */\n scope: string;\n /** Resolves `?tab=` values to renderable tabs. */\n registry: TabRegistry;\n /** Right-aligned actions above the tab strip (search, the user menu). */\n actions?: ReactNode;\n /** Body when `?tab=` names something the registry cannot resolve. */\n fallback?: ReactNode;\n /** Body when no tab is open. */\n emptyState?: ReactNode;\n}\n\n/**\n * The tab workspace: a strip of persisted tabs over the active tab's body — no\n * sidebar or brand of its own. It is mounted inside a host shell (the\n * back-office layout, say) that already supplies those, so nesting two\n * sidebars never happens. The open set lives in {@link useTabsState}\n * (IndexedDB); the URL's `?tab=` projects only the active tab, so a deep link\n * opens or focuses exactly that tab and an unknown kind shows the fallback\n * instead of crashing.\n */\nexport function WorkspaceShell({\n scope,\n registry,\n actions,\n fallback,\n emptyState,\n}: WorkspaceShellProps) {\n const t = useT('shell');\n // Tab captions are catalog keys carried in a registry, not authored copy.\n const translate = useTranslateKey();\n const searchParams = useSearchParams();\n const router = useRouter();\n const pathname = usePathname();\n const urlTab = searchParams.get('tab');\n\n const tabs = useTabsState(state => state.tabs);\n const activeParam = useTabsState(state => state.activeParam);\n const open = useTabsState(state => state.open);\n const close = useTabsState(state => state.close);\n const activate = useTabsState(state => state.activate);\n\n const drafts = useDraftsState(state => state.drafts);\n const clearDraft = useDraftsState(state => state.clearDraft);\n\n // Load the persisted tab set and drafts once, on the client (hydration is\n // skipped at creation so SSR never touches IndexedDB).\n //\n // Both URL effects below wait on this flag, because the read is async and\n // lands *after* the first commit: opening the deep-linked tab before it\n // resolves means the restored snapshot's `activeParam` overwrites the tab the\n // URL asked for, and the write-back then projects that wrong tab into the\n // address bar. The URL is the more specific instruction, so it is applied\n // once the store has finished restoring rather than before.\n const [hydrated, setHydrated] = useState(false);\n useEffect(() => {\n // The scope is applied *before* the read, not after: the storage key is what\n // decides whose tabs and drafts come back, so setting it late would restore\n // the unscoped set first and only then start writing to the right key. Both\n // stores are module singletons with `skipHydration`, and this is the only\n // place that rehydrates them, so re-pointing them here is enough — no store\n // factory or provider is needed to keep two accounts apart.\n useTabsState.persist.setOptions({ name: `tabs:${scope}` });\n useDraftsState.persist.setOptions({ name: `drafts:${scope}` });\n void Promise.all([\n useTabsState.persist.rehydrate(),\n useDraftsState.persist.rehydrate(),\n ]).finally(() => setHydrated(true));\n }, [scope]);\n\n // The `?tab=` value the registry cannot resolve, if any — derived, so it is\n // known on the very first render rather than an effect later. An\n // unresolvable address used to be dropped on the floor: no tab, no error,\n // and the write-back below then replaced it with the previously active tab,\n // so even the URL stopped saying what was asked for. Here it answers with\n // the fallback and the bad address stays in the bar, where it can be read.\n //\n // `dismissed` is the escape: a deliberate tab interaction is a newer\n // instruction than the address that failed, and it holds the *value* rather\n // than a flag so the next dead link is dead again.\n const [dismissed, setDismissed] = useState<string | null>(null);\n const deadLink =\n urlTab && urlTab !== dismissed && !registry.resolve(urlTab, translate)\n ? urlTab\n : null;\n\n // A tab is dirty while its address has an unsaved draft; closing one confirms.\n //\n // The confirmation is a rendered dialog, so the decision spans two commits\n // rather than one blocking call: `handleClose` either closes outright or\n // parks the address, and the dialog's own buttons finish it. `window.confirm`\n // could not be styled, blocked the thread while it was up, and in Playwright\n // had to be driven by a global `page.on('dialog')` handler registered before\n // the click — which is why the workspace had no end-to-end test at all.\n const [pendingClose, setPendingClose] = useState<string | null>(null);\n\n const commitClose = (param: string) => {\n // Unconditional: `clearDraft` returns the state unchanged when the address\n // holds no draft, so the clean path costs a no-op rather than a branch.\n clearDraft(param);\n setDismissed(urlTab);\n close(param);\n };\n\n const handleClose = (param: string) => {\n if (param in drafts) {\n setPendingClose(param);\n return;\n }\n commitClose(param);\n };\n\n const handleActivate = (param: string) => {\n setDismissed(urlTab);\n activate(param);\n };\n\n // Deep link → open/focus the addressed tab (a dead one shows the fallback).\n useEffect(() => {\n if (!hydrated || !urlTab) return;\n const resolved = registry.resolve(urlTab, translate);\n if (resolved) {\n open({ param: resolved.param, title: resolved.title });\n }\n }, [hydrated, urlTab, registry, open, translate]);\n\n // Project the active tab back to the URL so it stays shareable.\n //\n // The active tab is read from the *committed* store rather than from this\n // render's snapshot. Following a link to a second tab changes the URL one\n // commit before the store catches up, so the snapshot still names the\n // previously active tab — writing that back would undo the navigation, the\n // effect above would re-open the URL's tab, and the two would trade the\n // address bar back and forth forever (a visible flicker between, say, brands\n // and categories). The effect above runs first in the same commit, so by the\n // time this one reads the store the URL's tab is already active.\n // That ordering is also what makes the `hydrated` gate work: when the flag\n // flips, the effect above has already re-applied the URL's tab over the\n // restored snapshot, so there is nothing here to write back.\n //\n // A dead deep link suspends it: overwriting the address the visitor typed\n // with an unrelated tab is what made the failure invisible in the first place.\n useEffect(() => {\n if (!hydrated || deadLink) return;\n const active = useTabsState.getState().activeParam;\n if (active && active !== urlTab) {\n router.replace(`${pathname}?tab=${encodeURIComponent(active)}`);\n }\n }, [hydrated, deadLink, activeParam, urlTab, pathname, router]);\n\n const copyDeepLink = (param: string) => {\n void navigator.clipboard.writeText(\n `${window.location.origin}${pathname}?tab=${encodeURIComponent(param)}`,\n );\n };\n\n // Tab and panel ids: DOM ids, so derived from the tab's position under one\n // per-shell prefix rather than from its param, which holds `:` and `#`.\n const idBase = useId();\n const panelId = `${idBase}-panel`;\n const tabId = (index: number) => `${idBase}-tab-${index}`;\n const activeIndex = tabs.findIndex(tab => tab.param === activeParam);\n\n const activeResolved = activeParam\n ? registry.resolve(activeParam, translate)\n : null;\n const body = deadLink\n ? fallback\n : activeResolved\n ? activeResolved.render()\n : emptyState;\n\n return (\n <div className=\"min-w-0 flex flex-1 flex-col\">\n <TopBar>\n <TopBar.Actions>\n {activeParam && (\n <button\n type=\"button\"\n onClick={() => copyDeepLink(activeParam)}\n className=\"rounded-md px-2xs py-3xs text-step-sm text-content-muted focus-ring transition hover:bg-surface hover:text-content\"\n >\n {t('workspace.copyLink')}\n </button>\n )}\n {actions}\n </TopBar.Actions>\n </TopBar>\n\n <TabStrip>\n {tabs.map((tab, index) => (\n <Tab\n key={tab.param}\n id={tabId(index)}\n controls={panelId}\n // Re-derived from the registry rather than read back from the\n // store: the persisted title is whatever locale it was opened\n // in, so a locale switch would leave stale captions behind.\n label={registry.resolve(tab.param, translate)?.title ?? tab.title}\n // Nothing is selected while the fallback is up: a highlighted\n // tab beside a body that is not its own reads as a render bug.\n active={!deadLink && tab.param === activeParam}\n state={tab.param in drafts ? 'dirty' : 'idle'}\n onSelect={() => handleActivate(tab.param)}\n onClose={() => handleClose(tab.param)}\n />\n ))}\n </TabStrip>\n\n <TabPanel\n id={panelId}\n labelledBy={\n !deadLink && activeIndex >= 0 ? tabId(activeIndex) : undefined\n }\n className=\"min-w-0 flex-1 p-m\"\n >\n {body}\n </TabPanel>\n\n {pendingClose && (\n <ConfirmDialog\n open\n tone=\"destructive\"\n title={t('workspace.discardTitle')}\n message={t('workspace.discard')}\n confirmLabel={t('workspace.discardConfirm')}\n onCancel={() => setPendingClose(null)}\n onConfirm={() => {\n commitClose(pendingClose);\n setPendingClose(null);\n }}\n />\n )}\n </div>\n );\n}\n"],"names":["ConfirmDialog","Tab","TabPanel","TabStrip","TopBar","useT","useTranslateKey","usePathname","useRouter","useSearchParams","useEffect","useId","useState","useDraftsState","useTabsState","WorkspaceShell","scope","registry","actions","fallback","emptyState","t","translate","searchParams","router","pathname","urlTab","get","tabs","state","activeParam","open","close","activate","drafts","clearDraft","hydrated","setHydrated","persist","setOptions","name","Promise","all","rehydrate","finally","dismissed","setDismissed","deadLink","resolve","pendingClose","setPendingClose","commitClose","param","handleClose","handleActivate","resolved","title","active","getState","replace","encodeURIComponent","copyDeepLink","navigator","clipboard","writeText","window","location","origin","idBase","panelId","tabId","index","activeIndex","findIndex","tab","activeResolved","body","render","div","className","Actions","button","type","onClick","map","id","controls","label","onSelect","onClose","labelledBy","undefined","tone","message","confirmLabel","onCancel","onConfirm"],"mappings":"AAAA;;AAEA,SACEA,aAAa,EACbC,GAAG,EACHC,QAAQ,EACRC,QAAQ,EACRC,MAAM,EACNC,IAAI,EACJC,eAAe,QACV,0BAA0B;AACjC,SAASC,WAAW,EAAEC,SAAS,EAAEC,eAAe,QAAQ,kBAAkB;AAC1E,SAAyBC,SAAS,EAAEC,KAAK,EAAEC,QAAQ,QAAQ,QAAQ;AAEnE,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,SAASC,YAAY,QAAQ,kBAAkB;AAuB/C;;;;;;;;CAQC,GACD,OAAO,SAASC,eAAe,EAC7BC,KAAK,EACLC,QAAQ,EACRC,OAAO,EACPC,QAAQ,EACRC,UAAU,EACU;IACpB,MAAMC,IAAIhB,KAAK;IACf,0EAA0E;IAC1E,MAAMiB,YAAYhB;IAClB,MAAMiB,eAAed;IACrB,MAAMe,SAAShB;IACf,MAAMiB,WAAWlB;IACjB,MAAMmB,SAASH,aAAaI,GAAG,CAAC;IAEhC,MAAMC,OAAOd,aAAae,CAAAA,QAASA,MAAMD,IAAI;IAC7C,MAAME,cAAchB,aAAae,CAAAA,QAASA,MAAMC,WAAW;IAC3D,MAAMC,OAAOjB,aA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AIhB;gBACJqB,YACE,CAAC3C,YAAYyB,eAAe,IAAIF,MAAME,eAAemB;gBAEvDZ,WAAU;0BAETH;;YAGF3B,8BACC,KAACjD;gBACC+B,IAAI;gBACJ6D,MAAK;gBACLpC,OAAOnC,EAAE;gBACTwE,SAASxE,EAAE;gBACXyE,cAAczE,EAAE;gBAChB0E,UAAU,IAAM7C,gBAAgB;gBAChC8C,WAAW;oBACT7C,YAAYF;oBACZC,gBAAgB;gBAClB;;;;AAKV"}
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
|
-
"version": "0.
|
|
24
|
+
"version": "0.19.0",
|
|
25
25
|
"description": "Next.js application shell: back-office chrome, workspace tabs, CRUD screens derived from entity metadata, and session and proxy routes.",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"repository": {
|
|
@@ -57,17 +57,17 @@
|
|
|
57
57
|
"react": "19.3.1",
|
|
58
58
|
"react-dom": "19.3.1",
|
|
59
59
|
"zustand": "^5.0.16",
|
|
60
|
-
"@entifix/testing-unit": "0.
|
|
60
|
+
"@entifix/testing-unit": "0.19.0"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"idb": "^8.0.4",
|
|
64
|
-
"@entifix/authz": "0.
|
|
65
|
-
"@entifix/business": "0.
|
|
66
|
-
"@entifix/core": "0.
|
|
67
|
-
"@entifix/i18n": "0.
|
|
68
|
-
"@entifix/react-controls": "0.
|
|
69
|
-
"@entifix/react-integration": "0.
|
|
70
|
-
"@entifix/transactions": "0.
|
|
64
|
+
"@entifix/authz": "0.19.0",
|
|
65
|
+
"@entifix/business": "0.19.0",
|
|
66
|
+
"@entifix/core": "0.19.0",
|
|
67
|
+
"@entifix/i18n": "0.19.0",
|
|
68
|
+
"@entifix/react-controls": "0.19.0",
|
|
69
|
+
"@entifix/react-integration": "0.19.0",
|
|
70
|
+
"@entifix/transactions": "0.19.0"
|
|
71
71
|
},
|
|
72
72
|
"files": [
|
|
73
73
|
"dist",
|