@consciousclouds/shell-primitive 0.1.2 → 0.1.3
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# 0.1.3 (unreleased) — a tablet starts with the icon rail
|
|
2
|
+
|
|
3
|
+
Not published: it is published only under its own owner GO, then its digest is recorded (Lane 5's ruling (A); the
|
|
4
|
+
second frontend publish batch, after operator-shell 0.2.3's).
|
|
5
|
+
|
|
6
|
+
- **A tablet starts with the icon rail** (CCU Admin inventory R5). `sidebarDefaultOpen` is now the operator's SAVED
|
|
7
|
+
choice, absent when there is none (it was a boolean defaulting to `true`). With no choice the sidebar is expanded,
|
|
8
|
+
except at 768 to 1023px of shell, where it is the icon rail so the page keeps its width; the width keeps deciding
|
|
9
|
+
until the operator toggles. That automatic state is never written to the `sidebar_state` cookie: the frame now
|
|
10
|
+
controls the registry sidebar (`open` / `onOpenChange`), and only the operator's toggle reaches the sidebar's own
|
|
11
|
+
cookie write. A saved choice wins at every width. Because the shell is measured after mount, a tablet's first paint
|
|
12
|
+
is expanded and settles to the rail once measured (the header's post-measure reflow, too); the server cannot know
|
|
13
|
+
the width, and the collapsed look is the sidebar's own `data-collapsible` state, which no media query can set.
|
|
14
|
+
A product that passed `true` for "no cookie" should now pass nothing.
|
|
15
|
+
|
|
1
16
|
# 0.1.2 — Responsive shell local candidate
|
|
2
17
|
|
|
3
18
|
Add ShellViewportProvider/useShellViewport for container-aware composition. ShellFrame measures header height, uses available CSS layout width for sidebar/reflow and bounds portals. Default host is 100dvh; consumers can supply a sized provider. Existing slots and motion tokens remain supported.
|
|
@@ -117,10 +117,13 @@ export interface ShellFrameProps {
|
|
|
117
117
|
*/
|
|
118
118
|
overlays?: React.ReactNode;
|
|
119
119
|
/**
|
|
120
|
-
*
|
|
121
|
-
* writes its state to the `sidebar_state` cookie on every toggle; a product
|
|
122
|
-
*
|
|
123
|
-
*
|
|
120
|
+
* The operator's SAVED sidebar choice: `true` expanded, `false` collapsed, absent when they have made none. The
|
|
121
|
+
* registry sidebar writes its state to the `sidebar_state` cookie on every toggle; a product that reads that cookie
|
|
122
|
+
* on the server passes it here (absent when there is no cookie), so a choice survives a reload.
|
|
123
|
+
*
|
|
124
|
+
* With no saved choice, the sidebar is expanded, except on a tablet (768 to 1023px of shell), where it starts as the
|
|
125
|
+
* icon rail so the page keeps its width (CCU Admin inventory R5). That automatic state is never written to the
|
|
126
|
+
* cookie: only the operator's own toggle is, so a tablet never decides the desktop's sidebar.
|
|
124
127
|
*/
|
|
125
128
|
sidebarDefaultOpen?: boolean;
|
|
126
129
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShellFrame.d.ts","sourceRoot":"","sources":["../../src/frame/ShellFrame.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAE5D,kFAAkF;AAClF,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,cAAc,CAAC;AAE7D,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,8DAA8D;IAC9D,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,yEAAyE;IACzE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;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;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mDAAmD;IACnD,eAAe,CAAC,EAAE,oBAAoB,CAAC;IACvC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;;;;;;OAQG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAiBD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CAGhD"}
|
package/dist/frame/ShellFrame.js
CHANGED
|
@@ -67,8 +67,15 @@ export function ShellFrame(props) {
|
|
|
67
67
|
const viewport = useShellViewport();
|
|
68
68
|
return viewport ? _jsx(ShellFrameBody, { ...props }) : _jsx(ShellViewportProvider, { children: _jsx(ShellFrameBody, { ...props }) });
|
|
69
69
|
}
|
|
70
|
-
function ShellFrameBody({ header, sidebar, children, assistant, assistantBehavior = "push", assistantWidth = 420, assistantOpen = false, inspector, inspectorOpen = false, inspectorWidth = 384, workspaceChrome = "framed", skipLinkLabel = "Skip to content", overlays, sidebarDefaultOpen
|
|
70
|
+
function ShellFrameBody({ header, sidebar, children, assistant, assistantBehavior = "push", assistantWidth = 420, assistantOpen = false, inspector, inspectorOpen = false, inspectorWidth = 384, workspaceChrome = "framed", skipLinkLabel = "Skip to content", overlays, sidebarDefaultOpen, }) {
|
|
71
71
|
const viewport = useShellViewport();
|
|
72
|
+
// The operator's choice, once they have one (saved, or toggled here). Until then the width decides: the icon rail
|
|
73
|
+
// on a tablet, expanded otherwise. The shell is measured after mount, so a tablet's first paint is expanded and it
|
|
74
|
+
// settles to the rail once measured (the same post-measure reflow as the header's): the server cannot know the
|
|
75
|
+
// width, and the collapsed look is the sidebar's own data-collapsible state, not CSS a media query could reach.
|
|
76
|
+
const [sidebarChoice, setSidebarChoice] = React.useState(sidebarDefaultOpen);
|
|
77
|
+
const tablet = viewport?.width !== undefined && viewport.width >= 768 && viewport.width < 1024;
|
|
78
|
+
const sidebarOpen = sidebarChoice ?? !tablet;
|
|
72
79
|
const headerRef = React.useRef(null);
|
|
73
80
|
const [headerHeight, setHeaderHeight] = React.useState(56);
|
|
74
81
|
React.useEffect(() => {
|
|
@@ -102,7 +109,13 @@ function ShellFrameBody({ header, sidebar, children, assistant, assistantBehavio
|
|
|
102
109
|
// FRAMED chrome: the workspace card and the inspector share their own flex row, so the inspector's gap is
|
|
103
110
|
// independent of the assistant's (a closed, zero-width region never adds a second gap beside the assistant).
|
|
104
111
|
const withInspector = (workspace) => hasInspector ? (_jsxs("div", { "data-slot": "shell-inspector-reflow", className: cn("flex min-h-0 min-w-0 flex-1", inspectorOpen ? "gap-4" : "gap-0"), style: reflowTransition, children: [workspace, inspector] })) : (workspace);
|
|
105
|
-
return (_jsxs(SidebarProvider
|
|
112
|
+
return (_jsxs(SidebarProvider
|
|
113
|
+
// Controlled: the registry sidebar writes its cookie only through its own setOpen (the operator's toggle), so
|
|
114
|
+
// the automatic tablet rail above is never saved as a choice.
|
|
115
|
+
, {
|
|
116
|
+
// Controlled: the registry sidebar writes its cookie only through its own setOpen (the operator's toggle), so
|
|
117
|
+
// the automatic tablet rail above is never saved as a choice.
|
|
118
|
+
open: sidebarOpen, onOpenChange: setSidebarChoice, mobile: viewport?.width === undefined ? undefined : viewport.width < 768, mobileContainer: viewport?.element, className: "h-full min-h-0 flex-col overflow-hidden", style: {
|
|
106
119
|
"--header-height": `${headerHeight}px`,
|
|
107
120
|
"--assistant-width": `${assistantWidth}px`,
|
|
108
121
|
"--inspector-width": `${inspectorWidth}px`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShellFrame.js","sourceRoot":"","sources":["../../src/frame/ShellFrame.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,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,MAAM,CAAC,CAAC,CAAC;wBACR,6DAA6D;wBAC7D,gEAAgE;wBAChE,kEAAkE;wBAClE,4BACY,cAAc,EACxB,SAAS,EAAE,EAAE,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,EAAE,SAAS,CAAC,EACtF,KAAK,EAAE,gBAAgB,aAStB,aAAa,CACZ,cACE,EAAE,EAAE,YAAY,EAChB,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,EAAE,CAAC,iJAAiJ,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,YAE9L,QAAQ,GACL,CACP,EAGA,SAAS,IACN,CACP,CAAC,CAAC,CAAC;wBACF,kEAAkE;wBAClE,8BACE,cACE,EAAE,EAAE,YAAY,EAChB,QAAQ,EAAE,CAAC,EACX,SAAS,EAAC,wGAAwG,YAEjH,QAAQ,GACL,EACL,SAAS,EACT,SAAS,IACT,CACJ,GACY,IACX,IACU,CACnB,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@consciousclouds/shell-primitive",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "ConsciousClouds Shell Primitive \u2014 the neutral shell FRAME (mechanism, not meaning): the header + sidebar + main-region layout skeleton over @consciousclouds/ui, the responsive assistant-panel placement mechanics (push | overlay | rail reflow), and workspace chrome (framed | edge-to-edge). No product, no Chief, no nav, no permission guard. The shared primitive the Operator / Business / Consumer shells frame around. Layer 3\u00b75 of the Frontend Platform.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|