@declarion/react 0.87.0 → 0.88.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/app.js +28 -28
- package/dist-lib/components/actions/ActionButton.js +86 -85
- package/dist-lib/components/actions/ActionResultDialog.impl.js +47 -47
- package/dist-lib/components/actions/ActionRunner.js +47 -47
- package/dist-lib/components/actions/ObjectActionBar.js +9 -9
- package/dist-lib/components/actions/RowActionsKebab.js +19 -19
- package/dist-lib/components/agents/AgentChatPanel.impl.js +53 -53
- package/dist-lib/components/chrome/AssociationTabs.js +21 -21
- package/dist-lib/components/chrome/RecordHeader.js +33 -40
- package/dist-lib/components/detail-layout/AssociatedBlock.js +387 -381
- package/dist-lib/components/detail-layout/ChildrenBlock.js +12 -13
- package/dist-lib/components/detail-layout/ChildrenTimeline.js +198 -198
- package/dist-lib/components/detail-layout/DraggableChildrenTable.js +114 -114
- package/dist-lib/components/detail-layout/EditableChildrenTable.js +160 -160
- package/dist-lib/components/detail-layout/EvidenceBlock.js +20 -21
- package/dist-lib/components/detail-layout/PropertiesBlock.js +45 -39
- package/dist-lib/components/detail-layout/QuickAddForm.js +9 -9
- package/dist-lib/components/detail-layout/TimelineComposer.js +87 -89
- package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +100 -99
- package/dist-lib/components/fields/FileReferenceField.js +9 -9
- package/dist-lib/components/fields/StructureField.js +57 -47
- package/dist-lib/components/fields/TimestampField.js +59 -54
- package/dist-lib/components/fields/cells/factories/money.js +14 -23
- package/dist-lib/components/fields/cells/factories/nextRun.js +1 -1
- package/dist-lib/components/fields/cells/factories/text.js +18 -3
- package/dist-lib/components/fields/cells/factories/timestamp.js +24 -12
- package/dist-lib/components/file-widgets/DocumentCard.js +108 -106
- package/dist-lib/components/layout/Layout.js +306 -361
- package/dist-lib/components/layout/Rail.js +42 -41
- package/dist-lib/components/layout/Sidebar.js +132 -117
- package/dist-lib/components/layout/TabStrip.js +116 -115
- package/dist-lib/components/layout/TenantChip.js +47 -54
- package/dist-lib/components/layout/TopBar.js +108 -105
- package/dist-lib/components/list/InlineEditCell.js +23 -23
- package/dist-lib/components/list/QuickPeek.js +65 -66
- package/dist-lib/components/pages/DocumentsMenu.js +42 -42
- package/dist-lib/components/pages/ExportMenu.js +25 -25
- package/dist-lib/components/pages/RecordDocumentsPanel.js +35 -35
- package/dist-lib/components/pages/RecordNotesPanel.js +94 -93
- package/dist-lib/components/pages/SmartDetailPage.impl.js +421 -417
- package/dist-lib/components/pages/SmartListPage.impl.js +293 -295
- package/dist-lib/components/pages/SmartRecordListPage.impl.js +310 -310
- package/dist-lib/components/pages/auth/AuthShell.js +73 -73
- package/dist-lib/components/pages/auth/SignIn.js +32 -32
- package/dist-lib/components/pages/auth/SignUp.impl.js +3 -3
- package/dist-lib/components/pages/auth/SignUpCode.js +9 -9
- package/dist-lib/components/pages/list/ListFloatbar.js +12 -12
- package/dist-lib/components/pages/list/ListHeader.js +19 -19
- package/dist-lib/components/pages/list/ListNoRows.js +15 -15
- package/dist-lib/components/pages/list/ListToolbar.js +145 -145
- package/dist-lib/components/pages/list/useActiveView.js +14 -5
- package/dist-lib/components/pages/list/useListQuery.js +121 -81
- package/dist-lib/components/pages/list/useListRowInteraction.js +70 -70
- package/dist-lib/components/pages/list/useRowMenu.js +7 -7
- package/dist-lib/components/pages/profile/Preferences.impl.js +81 -78
- package/dist-lib/components/pages/profile/Profile.impl.js +191 -189
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +166 -158
- package/dist-lib/components/shared/ChangePasswordDialog.impl.js +23 -23
- package/dist-lib/components/shared/MarkdownRenderer.js +9 -9
- package/dist-lib/hooks/useAuth.js +11 -11
- package/dist-lib/hooks/useBranding.js +4 -4
- package/dist-lib/hooks/useDisplayTimeZone.js +8 -0
- package/dist-lib/hooks/useFollowAgentOpen.js +24 -24
- package/dist-lib/hooks/useImpersonation.js +6 -6
- package/dist-lib/hooks/useMutations.js +23 -23
- package/dist-lib/hooks/useObjectStatus.js +5 -5
- package/dist-lib/hooks/useParams.js +59 -51
- package/dist-lib/hooks/useProperties.js +8 -8
- package/dist-lib/hooks/useRowTenant.js +18 -6
- package/dist-lib/hooks/useText.js +9 -7
- package/dist-lib/hooks/useUiPreferences.js +71 -0
- package/dist-lib/index.d.ts +22 -6
- package/dist-lib/index.js +127 -126
- package/dist-lib/lib/actions.js +116 -84
- package/dist-lib/lib/child-config.js +10 -1
- package/dist-lib/lib/format-count.js +16 -1
- package/dist-lib/lib/language.js +23 -21
- package/dist-lib/lib/money-text.js +29 -0
- package/dist-lib/lib/profile.js +4 -0
- package/dist-lib/lib/role-label.js +8 -0
- package/dist-lib/lib/schema-routing.js +34 -14
- package/dist-lib/lib/shortcut.js +10 -0
- package/dist-lib/lib/timestamp.js +93 -31
- package/dist-lib/stores/auth.js +9 -8
- package/dist-lib/stores/preferences.js +56 -17
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/testing.js +25 -28
- package/dist-lib/types/schema.js +33 -27
- package/dist-lib/{useResponsiveMode-D3SKz5z4.d.ts → useResponsiveMode-9_eJT18k.d.ts} +5 -5
- package/package.json +1 -1
|
@@ -3,20 +3,21 @@ import { useAnchoredTooltip as t } from "../primitives/Tooltip.js";
|
|
|
3
3
|
import { useText as n } from "../../hooks/useText.js";
|
|
4
4
|
import { DynamicIcon as r } from "../shared/DynamicIcon.js";
|
|
5
5
|
import { isValidLogoUrl as i } from "../../lib/branding.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { shortcutLabel as a } from "../../lib/shortcut.js";
|
|
7
|
+
import { useRef as o, useState as s } from "react";
|
|
8
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
9
|
//#region src/components/layout/Rail.tsx
|
|
9
|
-
var
|
|
10
|
-
function
|
|
10
|
+
var u = 32;
|
|
11
|
+
function d(e, t) {
|
|
11
12
|
return !t || t.length === 0 ? [] : t.map((t) => ({
|
|
12
13
|
id: t.code,
|
|
13
14
|
icon: t.icon || void 0,
|
|
14
15
|
label: e(t.name) || t.code
|
|
15
16
|
}));
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
-
let
|
|
19
|
-
return /* @__PURE__ */
|
|
18
|
+
function f({ activeArea: t, onPick: r, onToggleAI: o, aiOpen: s, onCmdK: f, areas: h, branding: g }) {
|
|
19
|
+
let _ = n(), v = d(_, h), y = g?.app_name ?? "", b = i(g?.app_logo) ? g?.app_logo : void 0;
|
|
20
|
+
return /* @__PURE__ */ l("div", {
|
|
20
21
|
style: {
|
|
21
22
|
gridArea: "rail",
|
|
22
23
|
background: "var(--rail)",
|
|
@@ -28,66 +29,66 @@ function d({ activeArea: t, onPick: r, onToggleAI: a, aiOpen: o, onCmdK: d, area
|
|
|
28
29
|
gap: 2
|
|
29
30
|
},
|
|
30
31
|
children: [
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ c("div", {
|
|
32
33
|
style: {
|
|
33
|
-
width:
|
|
34
|
-
height:
|
|
34
|
+
width: u,
|
|
35
|
+
height: u,
|
|
35
36
|
borderRadius: "var(--radius-md)",
|
|
36
|
-
background:
|
|
37
|
+
background: b ? "transparent" : "linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%)",
|
|
37
38
|
display: "flex",
|
|
38
39
|
alignItems: "center",
|
|
39
40
|
justifyContent: "center",
|
|
40
41
|
marginBottom: 8,
|
|
41
|
-
boxShadow:
|
|
42
|
+
boxShadow: b ? "none" : "var(--shadow-sm)",
|
|
42
43
|
overflow: "hidden"
|
|
43
44
|
},
|
|
44
|
-
title:
|
|
45
|
-
children:
|
|
46
|
-
src:
|
|
47
|
-
alt:
|
|
48
|
-
width:
|
|
49
|
-
height:
|
|
45
|
+
title: y ? _("shell.rail.home_named", "{brand} — home", { brand: y }) : _("shell.rail.home", "home"),
|
|
46
|
+
children: b ? /* @__PURE__ */ c("img", {
|
|
47
|
+
src: b,
|
|
48
|
+
alt: y,
|
|
49
|
+
width: u,
|
|
50
|
+
height: u,
|
|
50
51
|
style: {
|
|
51
52
|
display: "block",
|
|
52
53
|
objectFit: "contain"
|
|
53
54
|
}
|
|
54
|
-
}) :
|
|
55
|
+
}) : y ? /* @__PURE__ */ c("span", {
|
|
55
56
|
style: {
|
|
56
57
|
fontSize: 11,
|
|
57
58
|
fontWeight: 700,
|
|
58
59
|
letterSpacing: "0.04em"
|
|
59
60
|
},
|
|
60
|
-
children:
|
|
61
|
+
children: y.charAt(0).toUpperCase()
|
|
61
62
|
}) : null
|
|
62
63
|
}),
|
|
63
|
-
|
|
64
|
+
v.map((e) => /* @__PURE__ */ c(p, {
|
|
64
65
|
item: e,
|
|
65
66
|
active: t === e.id,
|
|
66
67
|
onPick: r
|
|
67
68
|
}, e.id)),
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
onClick:
|
|
71
|
-
title:
|
|
72
|
-
style:
|
|
73
|
-
children: e.command && /* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ c("div", { style: { flex: 1 } }),
|
|
70
|
+
/* @__PURE__ */ c("button", {
|
|
71
|
+
onClick: f,
|
|
72
|
+
title: _("shell.palette.open", "Command Palette ({keys})", { keys: a("K") }),
|
|
73
|
+
style: m(!1),
|
|
74
|
+
children: e.command && /* @__PURE__ */ c(e.command, { size: 16 })
|
|
74
75
|
}),
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
onClick:
|
|
77
|
-
title:
|
|
76
|
+
/* @__PURE__ */ c("button", {
|
|
77
|
+
onClick: o,
|
|
78
|
+
title: _("shell.ai_assistant", "AI Assistant"),
|
|
78
79
|
style: {
|
|
79
|
-
...
|
|
80
|
-
background:
|
|
81
|
-
color:
|
|
80
|
+
...m(!1),
|
|
81
|
+
background: s ? "var(--accent)" : "transparent",
|
|
82
|
+
color: s ? "var(--rail-fg)" : "var(--rail-muted)"
|
|
82
83
|
},
|
|
83
|
-
children: e.sparkle && /* @__PURE__ */
|
|
84
|
+
children: e.sparkle && /* @__PURE__ */ c(e.sparkle, { size: 16 })
|
|
84
85
|
})
|
|
85
86
|
]
|
|
86
87
|
});
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
-
let [
|
|
90
|
-
return /* @__PURE__ */
|
|
89
|
+
function p({ item: e, active: n, onPick: i }) {
|
|
90
|
+
let [a, u] = s(!1), d = o(null), f = t(d, e.label), p = n ? "var(--rail-active)" : a ? "var(--rail-hover)" : "transparent", m = n || a ? "var(--rail-fg)" : "var(--rail-muted)";
|
|
91
|
+
return /* @__PURE__ */ l("button", {
|
|
91
92
|
ref: d,
|
|
92
93
|
onClick: () => i(e.id),
|
|
93
94
|
"aria-label": e.label,
|
|
@@ -114,11 +115,11 @@ function f({ item: e, active: n, onPick: i }) {
|
|
|
114
115
|
position: "relative"
|
|
115
116
|
},
|
|
116
117
|
children: [
|
|
117
|
-
e.icon ? /* @__PURE__ */
|
|
118
|
+
e.icon ? /* @__PURE__ */ c(r, {
|
|
118
119
|
name: e.icon,
|
|
119
120
|
size: 16
|
|
120
121
|
}) : null,
|
|
121
|
-
n && /* @__PURE__ */
|
|
122
|
+
n && /* @__PURE__ */ c("span", { style: {
|
|
122
123
|
position: "absolute",
|
|
123
124
|
left: -1,
|
|
124
125
|
top: 8,
|
|
@@ -131,7 +132,7 @@ function f({ item: e, active: n, onPick: i }) {
|
|
|
131
132
|
]
|
|
132
133
|
});
|
|
133
134
|
}
|
|
134
|
-
function
|
|
135
|
+
function m(e) {
|
|
135
136
|
return {
|
|
136
137
|
width: 36,
|
|
137
138
|
height: 36,
|
|
@@ -146,4 +147,4 @@ function p(e) {
|
|
|
146
147
|
};
|
|
147
148
|
}
|
|
148
149
|
//#endregion
|
|
149
|
-
export {
|
|
150
|
+
export { f as Rail };
|
|
@@ -1,33 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
1
|
+
import { usePreferencesStore as e } from "../../stores/preferences.js";
|
|
2
|
+
import { useSchema as t } from "../../hooks/useSchema.js";
|
|
3
|
+
import { Icon as n } from "../primitives/Icons.js";
|
|
4
|
+
import { Kbd as r } from "../primitives/Kbd.js";
|
|
5
|
+
import { useText as i } from "../../hooks/useText.js";
|
|
6
|
+
import { useUiPreferences as a } from "../../hooks/useUiPreferences.js";
|
|
7
|
+
import { DynamicIcon as o } from "../shared/DynamicIcon.js";
|
|
8
|
+
import { shortcutLabel as s } from "../../lib/shortcut.js";
|
|
9
|
+
import { BrandLogo as c } from "../primitives/BrandLogo.js";
|
|
10
|
+
import { useBrandingIdentity as l } from "../../hooks/useBranding.js";
|
|
11
|
+
import { isModifiedClick as u } from "../../lib/utils.js";
|
|
12
|
+
import { useTabNavigate as d } from "../../hooks/useTabNavigate.js";
|
|
13
|
+
import { findNavMatch as f } from "../../lib/schema-routing.js";
|
|
14
|
+
import { useIntentPrefetch as p } from "../../hooks/useIntentPrefetch.js";
|
|
15
|
+
import { useMemo as m, useState as h } from "react";
|
|
16
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
17
|
+
import { useLocation as y } from "react-router";
|
|
15
18
|
//#region src/components/layout/Sidebar.tsx
|
|
16
|
-
function
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
]),
|
|
19
|
+
function b({ activeArea: o }) {
|
|
20
|
+
let u = i(), { data: p } = t(), b = y(), S = d(), w = e((e) => e.sidebar), { set: T } = a(), E = w === "collapsed", [D, O] = h({}), k = l(), A = k?.app_name ?? "", j = k?.app_logo, M = k?.version_label ?? "", N = m(() => x(u, p?.navigation ?? [], o), [
|
|
21
|
+
u,
|
|
22
|
+
p?.navigation,
|
|
23
|
+
o
|
|
24
|
+
]), P = m(() => {
|
|
25
|
+
if (p) return f(p.navigation, p.screens, b.pathname)?.chain.at(-1)?.screen;
|
|
26
|
+
}, [p, b.pathname]), F = (e, t) => {
|
|
22
27
|
if (!e.screen) return;
|
|
23
|
-
let n =
|
|
24
|
-
n &&
|
|
25
|
-
title:
|
|
28
|
+
let n = p?.screens[e.screen];
|
|
29
|
+
n && S(n.route, {
|
|
30
|
+
title: u(e.name),
|
|
26
31
|
icon: e.icon,
|
|
27
32
|
topLevel: !0
|
|
28
33
|
});
|
|
29
34
|
};
|
|
30
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ v("aside", {
|
|
31
36
|
style: {
|
|
32
37
|
gridArea: "sidebar",
|
|
33
38
|
background: "var(--sidebar)",
|
|
@@ -37,41 +42,47 @@ function _({ activeArea: i }) {
|
|
|
37
42
|
overflow: "hidden"
|
|
38
43
|
},
|
|
39
44
|
children: [
|
|
40
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ _("div", {
|
|
41
46
|
style: {
|
|
42
47
|
height: 44,
|
|
43
48
|
display: "flex",
|
|
44
49
|
alignItems: "center",
|
|
45
|
-
padding:
|
|
46
|
-
justifyContent:
|
|
50
|
+
padding: E ? 0 : "0 12px",
|
|
51
|
+
justifyContent: E ? "center" : "flex-start",
|
|
47
52
|
borderBottom: "1px solid var(--divider)",
|
|
48
53
|
gap: 8
|
|
49
54
|
},
|
|
50
|
-
children:
|
|
51
|
-
appLogo:
|
|
55
|
+
children: E ? j ? /* @__PURE__ */ _(c, {
|
|
56
|
+
appLogo: j,
|
|
52
57
|
size: 18
|
|
53
|
-
}) :
|
|
58
|
+
}) : A ? /* @__PURE__ */ _("span", {
|
|
54
59
|
style: {
|
|
55
60
|
fontSize: 11,
|
|
56
61
|
fontWeight: 700,
|
|
57
62
|
color: "var(--accent-text)"
|
|
58
63
|
},
|
|
59
|
-
children:
|
|
60
|
-
}) : null : /* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
appLogo:
|
|
64
|
+
children: A.charAt(0)
|
|
65
|
+
}) : null : /* @__PURE__ */ v(g, { children: [
|
|
66
|
+
/* @__PURE__ */ _(c, {
|
|
67
|
+
appLogo: j,
|
|
63
68
|
size: 20
|
|
64
69
|
}),
|
|
65
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ _("div", {
|
|
71
|
+
title: A,
|
|
66
72
|
style: {
|
|
67
73
|
fontSize: 13,
|
|
68
74
|
fontWeight: 600,
|
|
69
75
|
letterSpacing: "-0.01em",
|
|
70
|
-
color: "var(--text)"
|
|
76
|
+
color: "var(--text)",
|
|
77
|
+
minWidth: 0,
|
|
78
|
+
overflow: "hidden",
|
|
79
|
+
textOverflow: "ellipsis",
|
|
80
|
+
whiteSpace: "nowrap"
|
|
71
81
|
},
|
|
72
|
-
children:
|
|
82
|
+
children: A
|
|
73
83
|
}),
|
|
74
|
-
|
|
84
|
+
M && /* @__PURE__ */ _("span", {
|
|
85
|
+
title: M,
|
|
75
86
|
style: {
|
|
76
87
|
padding: "1px 6px",
|
|
77
88
|
background: "var(--accent-soft)",
|
|
@@ -80,21 +91,25 @@ function _({ activeArea: i }) {
|
|
|
80
91
|
fontWeight: 600,
|
|
81
92
|
borderRadius: "var(--radius-xs)",
|
|
82
93
|
letterSpacing: "0.04em",
|
|
83
|
-
|
|
94
|
+
flexShrink: 0,
|
|
95
|
+
maxWidth: 96,
|
|
96
|
+
overflow: "hidden",
|
|
97
|
+
textOverflow: "ellipsis",
|
|
98
|
+
whiteSpace: "nowrap"
|
|
84
99
|
},
|
|
85
|
-
children:
|
|
100
|
+
children: M
|
|
86
101
|
})
|
|
87
102
|
] })
|
|
88
103
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ _("nav", {
|
|
90
105
|
style: {
|
|
91
106
|
flex: 1,
|
|
92
107
|
overflowY: "auto",
|
|
93
|
-
padding:
|
|
108
|
+
padding: E ? "8px 4px" : "8px 6px"
|
|
94
109
|
},
|
|
95
|
-
children:
|
|
110
|
+
children: N.map((e, t) => /* @__PURE__ */ v("div", {
|
|
96
111
|
style: { marginBottom: 12 },
|
|
97
|
-
children: [!
|
|
112
|
+
children: [!E && e.title && /* @__PURE__ */ _("div", {
|
|
98
113
|
style: {
|
|
99
114
|
fontSize: 9.5,
|
|
100
115
|
fontWeight: 700,
|
|
@@ -105,24 +120,24 @@ function _({ activeArea: i }) {
|
|
|
105
120
|
},
|
|
106
121
|
children: e.title
|
|
107
122
|
}), e.items.map((e, n) => {
|
|
108
|
-
let r = `${t}-${n}-${e.screen ||
|
|
109
|
-
return /* @__PURE__ */
|
|
123
|
+
let r = `${t}-${n}-${e.screen || u(e.name)}`, i = e.screen ? p?.screens[e.screen] : void 0, a = !!e.screen && e.screen === P, o = !!(e.children && e.children.length > 0), s = !!D[r];
|
|
124
|
+
return /* @__PURE__ */ _(C, {
|
|
110
125
|
item: e,
|
|
111
126
|
href: i?.route,
|
|
112
|
-
collapsed:
|
|
127
|
+
collapsed: E,
|
|
113
128
|
active: a,
|
|
114
129
|
hasKids: o,
|
|
115
130
|
expanded: s,
|
|
116
|
-
onToggleExpand: () =>
|
|
131
|
+
onToggleExpand: () => O((e) => ({
|
|
117
132
|
...e,
|
|
118
133
|
[r]: !e[r]
|
|
119
134
|
})),
|
|
120
|
-
onPick: (t) =>
|
|
121
|
-
resolveChild: (e) => e.screen ?
|
|
135
|
+
onPick: (t) => F(e, t),
|
|
136
|
+
resolveChild: (e) => e.screen ? p?.screens[e.screen] : void 0,
|
|
122
137
|
onPickChild: (e) => {
|
|
123
|
-
let t = e.screen ?
|
|
124
|
-
t &&
|
|
125
|
-
title:
|
|
138
|
+
let t = e.screen ? p?.screens[e.screen] : void 0;
|
|
139
|
+
t && S(t.route, {
|
|
140
|
+
title: u(e.name),
|
|
126
141
|
icon: e.icon,
|
|
127
142
|
topLevel: !0
|
|
128
143
|
});
|
|
@@ -131,18 +146,18 @@ function _({ activeArea: i }) {
|
|
|
131
146
|
})]
|
|
132
147
|
}, t))
|
|
133
148
|
}),
|
|
134
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ v("div", {
|
|
135
150
|
style: {
|
|
136
151
|
padding: "6px 8px",
|
|
137
152
|
borderTop: "1px solid var(--divider)",
|
|
138
153
|
display: "flex",
|
|
139
154
|
alignItems: "center",
|
|
140
155
|
gap: 6,
|
|
141
|
-
justifyContent:
|
|
156
|
+
justifyContent: E ? "center" : "space-between"
|
|
142
157
|
},
|
|
143
|
-
children: [/* @__PURE__ */
|
|
144
|
-
onClick: () =>
|
|
145
|
-
title:
|
|
158
|
+
children: [/* @__PURE__ */ _("button", {
|
|
159
|
+
onClick: () => void T("sidebar", E ? "wide" : "collapsed"),
|
|
160
|
+
title: E ? u("shell.sidebar.expand", "Expand sidebar ({keys})", { keys: s("B") }) : u("shell.sidebar.collapse", "Collapse sidebar ({keys})", { keys: s("B") }),
|
|
146
161
|
style: {
|
|
147
162
|
display: "flex",
|
|
148
163
|
alignItems: "center",
|
|
@@ -155,22 +170,22 @@ function _({ activeArea: i }) {
|
|
|
155
170
|
color: "var(--text-3)",
|
|
156
171
|
cursor: "pointer"
|
|
157
172
|
},
|
|
158
|
-
children:
|
|
159
|
-
}), !
|
|
173
|
+
children: _(E ? n.right : n.left, { size: 14 })
|
|
174
|
+
}), !E && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("span", {
|
|
160
175
|
style: {
|
|
161
176
|
flex: 1,
|
|
162
177
|
fontSize: 11,
|
|
163
178
|
color: "var(--text-3)"
|
|
164
179
|
},
|
|
165
|
-
children:
|
|
166
|
-
}), /* @__PURE__ */
|
|
180
|
+
children: u("shell.sidebar.footer", "Docs · API · Help")
|
|
181
|
+
}), /* @__PURE__ */ _(r, { children: "?" })] })]
|
|
167
182
|
})
|
|
168
183
|
]
|
|
169
184
|
});
|
|
170
185
|
}
|
|
171
|
-
function
|
|
186
|
+
function x(e, t, n) {
|
|
172
187
|
let r = [];
|
|
173
|
-
for (let i of t) if (
|
|
188
|
+
for (let i of t) if (S(i, n)) {
|
|
174
189
|
if (i.items && i.items.length > 0) r.push({
|
|
175
190
|
title: e(i.name) || "",
|
|
176
191
|
items: i.items
|
|
@@ -185,13 +200,13 @@ function v(e, t, n) {
|
|
|
185
200
|
}
|
|
186
201
|
return r;
|
|
187
202
|
}
|
|
188
|
-
function
|
|
203
|
+
function S(e, t) {
|
|
189
204
|
return (e.area || "default") === t;
|
|
190
205
|
}
|
|
191
|
-
function
|
|
192
|
-
let y =
|
|
193
|
-
if (
|
|
194
|
-
let
|
|
206
|
+
function C({ item: e, href: t, collapsed: r, active: a, hasKids: s, expanded: c, onToggleExpand: l, onPick: d, onPickChild: f, resolveChild: m }) {
|
|
207
|
+
let y = i(), [b, x] = h(!1), S = p(t), C = !!e.icon, T = y(e.name) || e.screen || "";
|
|
208
|
+
if (r) {
|
|
209
|
+
let n = {
|
|
195
210
|
width: 40,
|
|
196
211
|
height: 32,
|
|
197
212
|
margin: "2px auto",
|
|
@@ -201,32 +216,32 @@ function b({ item: e, href: n, collapsed: a, active: o, hasKids: s, expanded: l,
|
|
|
201
216
|
display: "flex",
|
|
202
217
|
alignItems: "center",
|
|
203
218
|
justifyContent: "center",
|
|
204
|
-
background:
|
|
205
|
-
color:
|
|
219
|
+
background: a ? "var(--sidebar-active)" : b ? "var(--sidebar-hover)" : "transparent",
|
|
220
|
+
color: a ? "var(--accent)" : "var(--text-3)",
|
|
206
221
|
textDecoration: "none"
|
|
207
222
|
};
|
|
208
|
-
return
|
|
209
|
-
href:
|
|
223
|
+
return t ? /* @__PURE__ */ _("a", {
|
|
224
|
+
href: t,
|
|
210
225
|
"data-declarion-native-link": "",
|
|
211
|
-
...
|
|
226
|
+
...S,
|
|
212
227
|
onClick: (e) => {
|
|
213
|
-
|
|
228
|
+
u(e) || (e.preventDefault(), d());
|
|
214
229
|
},
|
|
215
230
|
title: T,
|
|
216
|
-
onMouseEnter: () =>
|
|
217
|
-
onMouseLeave: () =>
|
|
218
|
-
style:
|
|
219
|
-
children:
|
|
231
|
+
onMouseEnter: () => x(!0),
|
|
232
|
+
onMouseLeave: () => x(!1),
|
|
233
|
+
style: n,
|
|
234
|
+
children: C && /* @__PURE__ */ _(o, {
|
|
220
235
|
name: e.icon,
|
|
221
236
|
size: 14
|
|
222
237
|
})
|
|
223
|
-
}) : /* @__PURE__ */
|
|
224
|
-
onClick: () =>
|
|
238
|
+
}) : /* @__PURE__ */ _("button", {
|
|
239
|
+
onClick: () => d(),
|
|
225
240
|
title: T,
|
|
226
|
-
onMouseEnter: () =>
|
|
227
|
-
onMouseLeave: () =>
|
|
228
|
-
style:
|
|
229
|
-
children:
|
|
241
|
+
onMouseEnter: () => x(!0),
|
|
242
|
+
onMouseLeave: () => x(!1),
|
|
243
|
+
style: n,
|
|
244
|
+
children: C && /* @__PURE__ */ _(o, {
|
|
230
245
|
name: e.icon,
|
|
231
246
|
size: 14
|
|
232
247
|
})
|
|
@@ -243,21 +258,21 @@ function b({ item: e, href: n, collapsed: a, active: o, hasKids: s, expanded: l,
|
|
|
243
258
|
border: 0,
|
|
244
259
|
cursor: "pointer",
|
|
245
260
|
textAlign: "left",
|
|
246
|
-
background:
|
|
247
|
-
color:
|
|
261
|
+
background: a ? "var(--sidebar-active)" : b ? "var(--sidebar-hover)" : "transparent",
|
|
262
|
+
color: a ? "var(--accent)" : "var(--text-2)",
|
|
248
263
|
fontSize: 12.5,
|
|
249
|
-
fontWeight:
|
|
264
|
+
fontWeight: a ? 600 : 500,
|
|
250
265
|
textDecoration: "none"
|
|
251
|
-
}, D = /* @__PURE__ */
|
|
252
|
-
|
|
266
|
+
}, D = /* @__PURE__ */ v(g, { children: [
|
|
267
|
+
C && /* @__PURE__ */ _(o, {
|
|
253
268
|
name: e.icon,
|
|
254
269
|
size: 14
|
|
255
270
|
}),
|
|
256
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ _("span", {
|
|
257
272
|
style: { flex: 1 },
|
|
258
273
|
children: T
|
|
259
274
|
}),
|
|
260
|
-
e.badge && /* @__PURE__ */
|
|
275
|
+
e.badge && /* @__PURE__ */ _("span", {
|
|
261
276
|
style: {
|
|
262
277
|
padding: "1px 5px",
|
|
263
278
|
background: "var(--surface-3)",
|
|
@@ -268,65 +283,65 @@ function b({ item: e, href: n, collapsed: a, active: o, hasKids: s, expanded: l,
|
|
|
268
283
|
},
|
|
269
284
|
children: e.badge
|
|
270
285
|
}),
|
|
271
|
-
s && /* @__PURE__ */
|
|
286
|
+
s && /* @__PURE__ */ _("span", {
|
|
272
287
|
role: "button",
|
|
273
|
-
"aria-label":
|
|
288
|
+
"aria-label": c ? y("shell.sidebar.collapse_item", "Collapse") : y("shell.sidebar.expand_item", "Expand"),
|
|
274
289
|
onClick: (e) => {
|
|
275
|
-
e.stopPropagation(), e.preventDefault(),
|
|
290
|
+
e.stopPropagation(), e.preventDefault(), l();
|
|
276
291
|
},
|
|
277
292
|
style: {
|
|
278
293
|
display: "inline-flex",
|
|
279
294
|
padding: 2,
|
|
280
295
|
cursor: "pointer"
|
|
281
296
|
},
|
|
282
|
-
children: /* @__PURE__ */
|
|
297
|
+
children: /* @__PURE__ */ _(n.down, {
|
|
283
298
|
size: 11,
|
|
284
299
|
style: {
|
|
285
|
-
transform:
|
|
300
|
+
transform: c ? "rotate(0)" : "rotate(-90deg)",
|
|
286
301
|
transition: "transform .15s",
|
|
287
302
|
color: "var(--text-3)"
|
|
288
303
|
}
|
|
289
304
|
})
|
|
290
305
|
})
|
|
291
306
|
] });
|
|
292
|
-
return /* @__PURE__ */
|
|
293
|
-
href:
|
|
307
|
+
return /* @__PURE__ */ v("div", { children: [t ? /* @__PURE__ */ _("a", {
|
|
308
|
+
href: t,
|
|
294
309
|
"data-declarion-native-link": "",
|
|
295
|
-
...
|
|
310
|
+
...S,
|
|
296
311
|
onClick: (e) => {
|
|
297
|
-
|
|
312
|
+
u(e) || (e.preventDefault(), d());
|
|
298
313
|
},
|
|
299
|
-
onMouseEnter: () =>
|
|
300
|
-
onMouseLeave: () =>
|
|
314
|
+
onMouseEnter: () => x(!0),
|
|
315
|
+
onMouseLeave: () => x(!1),
|
|
301
316
|
style: E,
|
|
302
317
|
children: D
|
|
303
|
-
}) : /* @__PURE__ */
|
|
318
|
+
}) : /* @__PURE__ */ _("button", {
|
|
304
319
|
onClick: () => {
|
|
305
|
-
s &&
|
|
320
|
+
s && l();
|
|
306
321
|
},
|
|
307
|
-
onMouseEnter: () =>
|
|
308
|
-
onMouseLeave: () =>
|
|
322
|
+
onMouseEnter: () => x(!0),
|
|
323
|
+
onMouseLeave: () => x(!1),
|
|
309
324
|
style: E,
|
|
310
325
|
children: D
|
|
311
|
-
}), s &&
|
|
326
|
+
}), s && c && /* @__PURE__ */ _("div", {
|
|
312
327
|
style: {
|
|
313
328
|
marginLeft: 22,
|
|
314
329
|
borderLeft: "1px solid var(--divider)",
|
|
315
330
|
paddingLeft: 6
|
|
316
331
|
},
|
|
317
332
|
children: (e.children || []).map((e, t) => {
|
|
318
|
-
let n =
|
|
319
|
-
return /* @__PURE__ */
|
|
333
|
+
let n = m(e), r = e.screen || `${t}`;
|
|
334
|
+
return /* @__PURE__ */ _(w, {
|
|
320
335
|
label: y(e.name) || e.screen || "",
|
|
321
336
|
href: n?.route,
|
|
322
337
|
enabled: !!n,
|
|
323
|
-
onPick: () =>
|
|
338
|
+
onPick: () => f(e)
|
|
324
339
|
}, r);
|
|
325
340
|
})
|
|
326
341
|
})] });
|
|
327
342
|
}
|
|
328
|
-
function
|
|
329
|
-
let [i, a] =
|
|
343
|
+
function w({ label: e, href: t, enabled: n, onPick: r }) {
|
|
344
|
+
let [i, a] = h(!1), o = p(n ? t : void 0), s = {
|
|
330
345
|
width: "100%",
|
|
331
346
|
display: "block",
|
|
332
347
|
padding: "4px 8px",
|
|
@@ -339,18 +354,18 @@ function x({ label: e, href: t, enabled: n, onPick: r }) {
|
|
|
339
354
|
color: "var(--text-3)",
|
|
340
355
|
textDecoration: "none"
|
|
341
356
|
};
|
|
342
|
-
return n && t ? /* @__PURE__ */
|
|
357
|
+
return n && t ? /* @__PURE__ */ _("a", {
|
|
343
358
|
href: t,
|
|
344
359
|
"data-declarion-native-link": "",
|
|
345
360
|
...o,
|
|
346
361
|
onClick: (e) => {
|
|
347
|
-
|
|
362
|
+
u(e) || (e.preventDefault(), r());
|
|
348
363
|
},
|
|
349
364
|
onMouseEnter: () => a(!0),
|
|
350
365
|
onMouseLeave: () => a(!1),
|
|
351
366
|
style: s,
|
|
352
367
|
children: e
|
|
353
|
-
}) : /* @__PURE__ */
|
|
368
|
+
}) : /* @__PURE__ */ _("button", {
|
|
354
369
|
onClick: () => n && r(),
|
|
355
370
|
onMouseEnter: () => a(!0),
|
|
356
371
|
onMouseLeave: () => a(!1),
|
|
@@ -359,4 +374,4 @@ function x({ label: e, href: t, enabled: n, onPick: r }) {
|
|
|
359
374
|
});
|
|
360
375
|
}
|
|
361
376
|
//#endregion
|
|
362
|
-
export {
|
|
377
|
+
export { b as Sidebar, x as buildSections };
|