@cratis/scene.blueprint.default 1.0.0 → 2.0.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/.storybook/preview.tsx +44 -0
- package/README.md +25 -12
- package/dist/cjs/shell/Breadcrumb.js +47 -10
- package/dist/cjs/shell/Breadcrumb.js.map +1 -1
- package/dist/cjs/shell/ConfigPanel.js +111 -82
- package/dist/cjs/shell/ConfigPanel.js.map +1 -1
- package/dist/cjs/shell/Sidebar.js +7 -3
- package/dist/cjs/shell/Sidebar.js.map +1 -1
- package/dist/cjs/shell/Topbar.js +7 -3
- package/dist/cjs/shell/Topbar.js.map +1 -1
- package/dist/cjs/shell/UserMenu.js +48 -21
- package/dist/cjs/shell/UserMenu.js.map +1 -1
- package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.js +2 -1
- package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.js.map +1 -1
- package/dist/esm/shell/Breadcrumb.d.ts.map +1 -1
- package/dist/esm/shell/Breadcrumb.js +49 -12
- package/dist/esm/shell/Breadcrumb.js.map +1 -1
- package/dist/esm/shell/ConfigPanel.d.ts.map +1 -1
- package/dist/esm/shell/ConfigPanel.js +112 -83
- package/dist/esm/shell/ConfigPanel.js.map +1 -1
- package/dist/esm/shell/MenuEntry.d.ts +6 -0
- package/dist/esm/shell/MenuEntry.d.ts.map +1 -0
- package/dist/esm/shell/MenuEntry.js +2 -0
- package/dist/esm/shell/MenuEntry.js.map +1 -0
- package/dist/esm/shell/Sidebar.d.ts.map +1 -1
- package/dist/esm/shell/Sidebar.js +7 -3
- package/dist/esm/shell/Sidebar.js.map +1 -1
- package/dist/esm/shell/Topbar.d.ts.map +1 -1
- package/dist/esm/shell/Topbar.js +7 -3
- package/dist/esm/shell/Topbar.js.map +1 -1
- package/dist/esm/shell/UserMenu.d.ts.map +1 -1
- package/dist/esm/shell/UserMenu.js +48 -21
- package/dist/esm/shell/UserMenu.js.map +1 -1
- package/dist/esm/shell/index.d.ts +1 -0
- package/dist/esm/shell/index.d.ts.map +1 -1
- package/dist/esm/shell/index.js +1 -0
- package/dist/esm/shell/index.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/for_AppShell/when_rendering_a_gallery_screen.tsx +10 -1
- package/package.json +18 -12
- package/shell/Breadcrumb.tsx +44 -8
- package/shell/ConfigPanel.tsx +72 -61
- package/shell/MenuEntry.ts +27 -0
- package/shell/Sidebar.tsx +5 -4
- package/shell/Topbar.tsx +5 -4
- package/shell/UserMenu.tsx +32 -17
- package/shell/index.ts +1 -0
- package/shell/layout.css +5 -5
- package/.storybook/preview.ts +0 -20
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var react = require('react');
|
|
5
4
|
var avatar = require('primereact/avatar');
|
|
6
5
|
var button = require('primereact/button');
|
|
7
6
|
var menu = require('primereact/menu');
|
|
@@ -12,10 +11,16 @@ var elementProperties = require('./elementProperties.js');
|
|
|
12
11
|
*
|
|
13
12
|
* The popup is PrimeReact's `Menu` rather than hand-written markup: an overlay that positions itself,
|
|
14
13
|
* traps focus and closes on escape is framework behavior, and re-implementing it in a layout package is
|
|
15
|
-
* how a shell ends up with its own subtly broken menu. The shell hand-writes CSS only where PrimeReact
|
|
14
|
+
* how a shell ends up with its own subtly broken menu. The shell hand-writes CSS only where PrimeReact
|
|
16
15
|
* has no primitive at all - the app-shell modes - and uses the library everywhere else.
|
|
16
|
+
*
|
|
17
|
+
* PrimeReact 11 replaced the `model` array with composition, so the entries are rendered here rather than
|
|
18
|
+
* handed over as data - and `primereact/menuitem`, the type that array was made of, went with it, which is
|
|
19
|
+
* why they are mapped into this package's own {@link MenuEntry}. The trade is worth taking: `Menu.Trigger`
|
|
20
|
+
* now owns opening the popup and reporting `aria-haspopup`/`aria-expanded` for it, so the ref, the toggle
|
|
21
|
+
* handler and the hand-maintained aria that used to sit here - and could drift out of step with the popup
|
|
22
|
+
* they described - are gone.
|
|
17
23
|
*/ function UserMenu({ element }) {
|
|
18
|
-
const menu$1 = react.useRef(null);
|
|
19
24
|
const name = elementProperties.readString(element, 'name');
|
|
20
25
|
const role = elementProperties.readString(element, 'role');
|
|
21
26
|
const initials = elementProperties.readString(element, 'initials', name.slice(0, 1).toUpperCase());
|
|
@@ -28,9 +33,11 @@ var elementProperties = require('./elementProperties.js');
|
|
|
28
33
|
className: "layout-user-menu",
|
|
29
34
|
"data-scene-id": element.id,
|
|
30
35
|
children: [
|
|
31
|
-
/*#__PURE__*/ jsxRuntime.jsx(avatar.Avatar, {
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
/*#__PURE__*/ jsxRuntime.jsx(avatar.Avatar.Root, {
|
|
37
|
+
shape: "circle",
|
|
38
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(avatar.Avatar.Fallback, {
|
|
39
|
+
children: initials
|
|
40
|
+
})
|
|
34
41
|
}),
|
|
35
42
|
/*#__PURE__*/ jsxRuntime.jsxs("span", {
|
|
36
43
|
className: "layout-user-menu-name",
|
|
@@ -44,21 +51,41 @@ var elementProperties = require('./elementProperties.js');
|
|
|
44
51
|
})
|
|
45
52
|
]
|
|
46
53
|
}),
|
|
47
|
-
/*#__PURE__*/ jsxRuntime.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
/*#__PURE__*/ jsxRuntime.jsxs(menu.Menu.Root, {
|
|
55
|
+
children: [
|
|
56
|
+
/*#__PURE__*/ jsxRuntime.jsx(menu.Menu.Trigger, {
|
|
57
|
+
as: button.Button,
|
|
58
|
+
variant: "text",
|
|
59
|
+
rounded: true,
|
|
60
|
+
iconOnly: true,
|
|
61
|
+
"aria-label": `Open the menu for ${name}`,
|
|
62
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("i", {
|
|
63
|
+
className: "pi pi-angle-down",
|
|
64
|
+
"aria-hidden": "true"
|
|
65
|
+
})
|
|
66
|
+
}),
|
|
67
|
+
/*#__PURE__*/ jsxRuntime.jsx(menu.Menu.Portal, {
|
|
68
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(menu.Menu.Positioner, {
|
|
69
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(menu.Menu.Popup, {
|
|
70
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(menu.Menu.List, {
|
|
71
|
+
children: items.map((item)=>/*#__PURE__*/ jsxRuntime.jsxs(menu.Menu.Item, {
|
|
72
|
+
as: "a",
|
|
73
|
+
href: item.url,
|
|
74
|
+
children: [
|
|
75
|
+
item.icon && /*#__PURE__*/ jsxRuntime.jsx("i", {
|
|
76
|
+
className: item.icon,
|
|
77
|
+
"aria-hidden": "true"
|
|
78
|
+
}),
|
|
79
|
+
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
80
|
+
children: item.label
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
}, item.label))
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
})
|
|
88
|
+
]
|
|
62
89
|
})
|
|
63
90
|
]
|
|
64
91
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserMenu.js","sources":["../../../shell/UserMenu.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport {
|
|
1
|
+
{"version":3,"file":"UserMenu.js","sources":["../../../shell/UserMenu.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Avatar } from 'primereact/avatar';\nimport { Button } from 'primereact/button';\nimport { Menu as PrimeMenu } from 'primereact/menu';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { MenuEntry } from './MenuEntry';\nimport { readRecords, readString, recordString } from './elementProperties';\n\n/**\n * The signed-in user's avatar and menu.\n *\n * The popup is PrimeReact's `Menu` rather than hand-written markup: an overlay that positions itself,\n * traps focus and closes on escape is framework behavior, and re-implementing it in a layout package is\n * how a shell ends up with its own subtly broken menu. The shell hand-writes CSS only where PrimeReact\n * has no primitive at all - the app-shell modes - and uses the library everywhere else.\n *\n * PrimeReact 11 replaced the `model` array with composition, so the entries are rendered here rather than\n * handed over as data - and `primereact/menuitem`, the type that array was made of, went with it, which is\n * why they are mapped into this package's own {@link MenuEntry}. The trade is worth taking: `Menu.Trigger`\n * now owns opening the popup and reporting `aria-haspopup`/`aria-expanded` for it, so the ref, the toggle\n * handler and the hand-maintained aria that used to sit here - and could drift out of step with the popup\n * they described - are gone.\n */\nexport function UserMenu({ element }: RegisteredComponentProps) {\n const name = readString(element, 'name');\n const role = readString(element, 'role');\n const initials = readString(element, 'initials', name.slice(0, 1).toUpperCase());\n const items = readRecords(element, 'items').map(\n (item): MenuEntry => ({\n label: recordString(item, 'label'),\n icon: recordString(item, 'icon') || undefined,\n url: recordString(item, 'targetScreen') ? `#/${recordString(item, 'targetScreen')}` : undefined,\n }),\n );\n\n return (\n <div className='layout-user-menu' data-scene-id={element.id}>\n <Avatar.Root shape='circle'>\n <Avatar.Fallback>{initials}</Avatar.Fallback>\n </Avatar.Root>\n <span className='layout-user-menu-name'>\n <span>{name}</span>\n {role && <span className='layout-user-menu-role'>{role}</span>}\n </span>\n <PrimeMenu.Root>\n <PrimeMenu.Trigger as={Button} variant='text' rounded iconOnly aria-label={`Open the menu for ${name}`}>\n <i className='pi pi-angle-down' aria-hidden='true' />\n </PrimeMenu.Trigger>\n <PrimeMenu.Portal>\n <PrimeMenu.Positioner>\n <PrimeMenu.Popup>\n <PrimeMenu.List>\n {items.map(item => (\n <PrimeMenu.Item key={item.label} as='a' href={item.url}>\n {item.icon && <i className={item.icon} aria-hidden='true' />}\n <span>{item.label}</span>\n </PrimeMenu.Item>\n ))}\n </PrimeMenu.List>\n </PrimeMenu.Popup>\n </PrimeMenu.Positioner>\n </PrimeMenu.Portal>\n </PrimeMenu.Root>\n </div>\n );\n}\n"],"names":["UserMenu","element","name","readString","role","initials","slice","toUpperCase","items","readRecords","map","item","label","recordString","icon","undefined","url","_jsxs","div","className","data-scene-id","id","_jsx","Avatar","Root","shape","Fallback","span","PrimeMenu","Trigger","as","Button","variant","rounded","iconOnly","aria-label","i","aria-hidden","Portal","Positioner","Popup","List","Item","href"],"mappings":";;;;;;;;AAUA;;;;;;;;;;;;;;AAcC,IACM,SAASA,QAAAA,CAAS,EAAEC,OAAO,EAA4B,EAAA;IAC1D,MAAMC,IAAAA,GAAOC,6BAAWF,OAAAA,EAAS,MAAA,CAAA;IACjC,MAAMG,IAAAA,GAAOD,6BAAWF,OAAAA,EAAS,MAAA,CAAA;IACjC,MAAMI,QAAAA,GAAWF,6BAAWF,OAAAA,EAAS,UAAA,EAAYC,KAAKI,KAAK,CAAC,CAAA,EAAG,CAAA,CAAA,CAAGC,WAAW,EAAA,CAAA;IAC7E,MAAMC,KAAAA,GAAQC,8BAAYR,OAAAA,EAAS,OAAA,CAAA,CAASS,GAAG,CAC3C,CAACC,QAAqB;AAClBC,YAAAA,KAAAA,EAAOC,+BAAaF,IAAAA,EAAM,OAAA,CAAA;YAC1BG,IAAAA,EAAMD,8BAAAA,CAAaF,MAAM,MAAA,CAAA,IAAWI,SAAAA;YACpCC,GAAAA,EAAKH,8BAAAA,CAAaF,MAAM,cAAA,CAAA,GAAkB,CAAC,EAAE,EAAEE,8BAAAA,CAAaF,IAAAA,EAAM,cAAA,CAAA,CAAA,CAAiB,GAAGI;SAC1F,CAAA,CAAA;AAGJ,IAAA,qBACIE,eAAA,CAACC,KAAAA,EAAAA;QAAIC,SAAAA,EAAU,kBAAA;AAAmBC,QAAAA,eAAAA,EAAenB,QAAQoB,EAAE;;AACvD,0BAAAC,cAAA,CAACC,cAAO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8DACnDf,cAAA,CAACK,MAAAA,EAAAA;AAAMhB,oDAAAA,QAAAA,EAAAA,IAAAA,CAAKC;;;AAFKD,yCAAAA,EAAAA,IAAAA,CAAKC,KAAK,CAAA;;;;;;;;;AAYnE;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { PrimeReactProvider } from '@primereact/core';
|
|
3
4
|
import { SceneElementView, coreComponents, corePackage, mergePackageRegistries } from '@cratis/scene.react';
|
|
4
5
|
import { defaultBlueprint } from '../defaultBlueprint';
|
|
5
6
|
import { composeScreenElement, galleryComponentCatalog, galleryPreviewProfile, galleryScreen, resolveElementComponentNames } from '../gallery';
|
|
@@ -7,7 +8,7 @@ const registry = mergePackageRegistries([corePackage, defaultBlueprint]);
|
|
|
7
8
|
function renderGalleryScreen(name) {
|
|
8
9
|
const galleryItem = galleryScreen(name);
|
|
9
10
|
const element = resolveElementComponentNames(composeScreenElement(galleryItem), galleryPreviewProfile, galleryComponentCatalog);
|
|
10
|
-
render(_jsx(SceneElementView, { element: element, registry: registry, resolveBinding: () => undefined }));
|
|
11
|
+
render(_jsx(PrimeReactProvider, { children: _jsx(SceneElementView, { element: element, registry: registry, resolveBinding: () => undefined }) }));
|
|
11
12
|
}
|
|
12
13
|
function has(selector) {
|
|
13
14
|
return document.querySelector(selector) !== null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"when_rendering_a_gallery_screen.js","sourceRoot":"","sources":["../../../for_AppShell/when_rendering_a_gallery_screen.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC5G,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;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ts","sourceRoot":"","sources":["../../../shell/Breadcrumb.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAmB/D,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,EAAE,wBAAwB,+BA0C/D"}
|
|
@@ -1,28 +1,65 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { Fragment } from 'react';
|
|
3
|
+
import { Breadcrumb as Breadcrumb$1 } from 'primereact/breadcrumb';
|
|
3
4
|
import { readOptionalString, readRecords, recordString } from './elementProperties.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* The trail above the content.
|
|
7
8
|
*
|
|
8
|
-
* PrimeReact's own `
|
|
9
|
+
* PrimeReact's own `Breadcrumb` does the rendering rather than hand-written markup, because a breadcrumb
|
|
9
10
|
* is an ordinary component with no layout-mode behavior at all - it looks the same in every one of the
|
|
10
|
-
* eight modes. The shell only writes CSS where PrimeReact
|
|
11
|
-
*
|
|
11
|
+
* eight modes. The shell only writes CSS where PrimeReact genuinely has no answer, and this is not one of
|
|
12
|
+
* those places: `Breadcrumb.Root` still supplies the `nav`, its `aria-label` and the list semantics, which
|
|
13
|
+
* is the part that is easy to get wrong by hand.
|
|
14
|
+
*
|
|
15
|
+
* What PrimeReact 11 no longer supplies is the `model` array - the component is composed now, and the
|
|
16
|
+
* `primereact/menuitem` type the array was made of is gone with it, which is why the trail is mapped into
|
|
17
|
+
* this package's own {@link MenuEntry}. The last entry is `Breadcrumb.Current` rather than a link: a trail
|
|
18
|
+
* whose final crumb navigates to the page already open is a link that does nothing, and it takes
|
|
19
|
+
* `aria-current='page'` away from the one element that should carry it.
|
|
12
20
|
*/ function Breadcrumb({ element }) {
|
|
13
21
|
const home = readOptionalString(element, 'homeTargetScreen');
|
|
14
|
-
const
|
|
22
|
+
const trail = readRecords(element, 'items').map((item)=>({
|
|
15
23
|
label: recordString(item, 'label'),
|
|
16
24
|
url: recordString(item, 'targetScreen') ? `#/${recordString(item, 'targetScreen')}` : undefined
|
|
17
25
|
}));
|
|
18
26
|
return /*#__PURE__*/ jsx("div", {
|
|
19
27
|
"data-scene-id": element.id,
|
|
20
|
-
children: /*#__PURE__*/ jsx(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
children: /*#__PURE__*/ jsx(Breadcrumb$1.Root, {
|
|
29
|
+
children: /*#__PURE__*/ jsxs(Breadcrumb$1.List, {
|
|
30
|
+
children: [
|
|
31
|
+
home && /*#__PURE__*/ jsx(Breadcrumb$1.Item, {
|
|
32
|
+
children: /*#__PURE__*/ jsx(Breadcrumb$1.Link, {
|
|
33
|
+
as: "a",
|
|
34
|
+
href: `#/${home}`,
|
|
35
|
+
"aria-label": "Home",
|
|
36
|
+
children: /*#__PURE__*/ jsx("i", {
|
|
37
|
+
className: "pi pi-home",
|
|
38
|
+
"aria-hidden": "true"
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
}),
|
|
42
|
+
trail.map((entry, index)=>/*#__PURE__*/ jsxs(Fragment, {
|
|
43
|
+
children: [
|
|
44
|
+
(!!home || index > 0) && /*#__PURE__*/ jsx(Breadcrumb$1.Separator, {
|
|
45
|
+
children: /*#__PURE__*/ jsx("i", {
|
|
46
|
+
className: "pi pi-chevron-right",
|
|
47
|
+
"aria-hidden": "true"
|
|
48
|
+
})
|
|
49
|
+
}),
|
|
50
|
+
/*#__PURE__*/ jsx(Breadcrumb$1.Item, {
|
|
51
|
+
children: entry.url ? /*#__PURE__*/ jsx(Breadcrumb$1.Link, {
|
|
52
|
+
as: "a",
|
|
53
|
+
href: entry.url,
|
|
54
|
+
children: entry.label
|
|
55
|
+
}) : /*#__PURE__*/ jsx(Breadcrumb$1.Current, {
|
|
56
|
+
children: entry.label
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
]
|
|
60
|
+
}, `${index}-${entry.label}`))
|
|
61
|
+
]
|
|
62
|
+
})
|
|
26
63
|
})
|
|
27
64
|
});
|
|
28
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.js","sources":["../../../shell/Breadcrumb.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport {
|
|
1
|
+
{"version":3,"file":"Breadcrumb.js","sources":["../../../shell/Breadcrumb.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Fragment } from 'react';\nimport { Breadcrumb as PrimeBreadcrumb } from 'primereact/breadcrumb';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { MenuEntry } from './MenuEntry';\nimport { readOptionalString, readRecords, recordString } from './elementProperties';\n\n/**\n * The trail above the content.\n *\n * PrimeReact's own `Breadcrumb` does the rendering rather than hand-written markup, because a breadcrumb\n * is an ordinary component with no layout-mode behavior at all - it looks the same in every one of the\n * eight modes. The shell only writes CSS where PrimeReact genuinely has no answer, and this is not one of\n * those places: `Breadcrumb.Root` still supplies the `nav`, its `aria-label` and the list semantics, which\n * is the part that is easy to get wrong by hand.\n *\n * What PrimeReact 11 no longer supplies is the `model` array - the component is composed now, and the\n * `primereact/menuitem` type the array was made of is gone with it, which is why the trail is mapped into\n * this package's own {@link MenuEntry}. The last entry is `Breadcrumb.Current` rather than a link: a trail\n * whose final crumb navigates to the page already open is a link that does nothing, and it takes\n * `aria-current='page'` away from the one element that should carry it.\n */\nexport function Breadcrumb({ element }: RegisteredComponentProps) {\n const home = readOptionalString(element, 'homeTargetScreen');\n const trail = readRecords(element, 'items').map(\n (item): MenuEntry => ({\n label: recordString(item, 'label'),\n url: recordString(item, 'targetScreen') ? `#/${recordString(item, 'targetScreen')}` : undefined,\n }),\n );\n\n return (\n <div data-scene-id={element.id}>\n <PrimeBreadcrumb.Root>\n <PrimeBreadcrumb.List>\n {home && (\n <PrimeBreadcrumb.Item>\n <PrimeBreadcrumb.Link as='a' href={`#/${home}`} aria-label='Home'>\n <i className='pi pi-home' aria-hidden='true' />\n </PrimeBreadcrumb.Link>\n </PrimeBreadcrumb.Item>\n )}\n {trail.map((entry, index) => (\n <Fragment key={`${index}-${entry.label}`}>\n {(!!home || index > 0) && (\n <PrimeBreadcrumb.Separator>\n <i className='pi pi-chevron-right' aria-hidden='true' />\n </PrimeBreadcrumb.Separator>\n )}\n <PrimeBreadcrumb.Item>\n {entry.url ? (\n <PrimeBreadcrumb.Link as='a' href={entry.url}>\n {entry.label}\n </PrimeBreadcrumb.Link>\n ) : (\n <PrimeBreadcrumb.Current>{entry.label}</PrimeBreadcrumb.Current>\n )}\n </PrimeBreadcrumb.Item>\n </Fragment>\n ))}\n </PrimeBreadcrumb.List>\n </PrimeBreadcrumb.Root>\n </div>\n );\n}\n"],"names":["Breadcrumb","element","home","readOptionalString","trail","readRecords","map","item","label","recordString","url","undefined","_jsx","div","data-scene-id","id","PrimeBreadcrumb","Root","_jsxs","List","Item","Link","as","href","aria-label","i","className","aria-hidden","entry","index","Fragment","Separator","Current"],"mappings":";;;;;AASA;;;;;;;;;;;;;;AAcC,IACM,SAASA,UAAAA,CAAW,EAAEC,OAAO,EAA4B,EAAA;IAC5D,MAAMC,IAAAA,GAAOC,mBAAmBF,OAAAA,EAAS,kBAAA,CAAA;IACzC,MAAMG,KAAAA,GAAQC,YAAYJ,OAAAA,EAAS,OAAA,CAAA,CAASK,GAAG,CAC3C,CAACC,QAAqB;AAClBC,YAAAA,KAAAA,EAAOC,aAAaF,IAAAA,EAAM,OAAA,CAAA;YAC1BG,GAAAA,EAAKD,YAAAA,CAAaF,MAAM,cAAA,CAAA,GAAkB,CAAC,EAAE,EAAEE,YAAAA,CAAaF,IAAAA,EAAM,cAAA,CAAA,CAAA,CAAiB,GAAGI;SAC1F,CAAA,CAAA;AAGJ,I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AC,EAAED,KAAAA,CAAMpB,KAAK,CAAA,CAAE,CAAA;;;;;AAqBhE;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigPanel.d.ts","sourceRoot":"","sources":["../../../shell/ConfigPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConfigPanel.d.ts","sourceRoot":"","sources":["../../../shell/ConfigPanel.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAsC/D,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,wBAAwB,+BAwEvE"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { jsxs,
|
|
2
|
-
import { useState } from 'react';
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { Button } from 'primereact/button';
|
|
4
|
-
import {
|
|
3
|
+
import { Drawer } from 'primereact/drawer';
|
|
5
4
|
import { colorSchemes, ColorScheme } from '../configuration/ColorScheme.js';
|
|
6
5
|
import { menuThemes, MenuTheme } from '../configuration/MenuTheme.js';
|
|
7
6
|
import { useLayoutConfig } from '../configuration/LayoutConfigProvider.js';
|
|
@@ -25,98 +24,128 @@ import { readString, readBoolean } from './elementProperties.js';
|
|
|
25
24
|
* theme - because those are the four choices that actually change how an application feels, and a
|
|
26
25
|
* configurator with more knobs than that becomes a settings screen nobody finishes reading.
|
|
27
26
|
*
|
|
28
|
-
* The panel
|
|
29
|
-
*
|
|
30
|
-
*
|
|
27
|
+
* The panel is `primereact/drawer`, which is the slide-in overlay this component has always wanted.
|
|
28
|
+
* PrimeReact 11 gave the name `Sidebar` to something else entirely - a new app-shell primitive with
|
|
29
|
+
* `SidebarLayout`/`SidebarAside`/`SidebarPanel` parts - so the v10 `Sidebar` import this file used to
|
|
30
|
+
* carry would still resolve after the upgrade and would silently render an app shell inside the shell.
|
|
31
|
+
* That is the one rename in the whole library that fails quietly rather than loudly, which is why it is
|
|
32
|
+
* called out here: this is `Drawer`, deliberately, and it is not the {@link Sidebar} next door either -
|
|
33
|
+
* that one is this package's own component for the docked panel's chrome.
|
|
34
|
+
*
|
|
35
|
+
* Open state is the drawer's own. `Drawer.Trigger` renders in place through `Drawer.Root`'s fragment, so
|
|
36
|
+
* the floating cog sits exactly where it did while getting `aria-expanded`/`aria-controls` from the
|
|
37
|
+
* component rather than from hand-written props that can drift out of step with the panel.
|
|
31
38
|
*/ function ConfigPanel({ element, slots }) {
|
|
32
|
-
const [isVisible, setIsVisible] = useState(false);
|
|
33
39
|
const { config, setColorScheme, setMenuTheme } = useLayoutConfig();
|
|
34
40
|
const title = readString(element, 'title', 'Settings');
|
|
35
41
|
const showsMenuTheme = readBoolean(element, 'showMenuTheme', true);
|
|
36
42
|
const showsMode = readBoolean(element, 'showLayoutMode', true);
|
|
37
|
-
return /*#__PURE__*/ jsxs(
|
|
43
|
+
return /*#__PURE__*/ jsxs(Drawer.Root, {
|
|
44
|
+
position: "right",
|
|
38
45
|
children: [
|
|
39
|
-
/*#__PURE__*/ jsx(
|
|
40
|
-
|
|
46
|
+
/*#__PURE__*/ jsx(Drawer.Trigger, {
|
|
47
|
+
as: Button,
|
|
41
48
|
rounded: true,
|
|
42
|
-
|
|
49
|
+
iconOnly: true,
|
|
43
50
|
className: "layout-config-button",
|
|
44
51
|
"aria-label": title,
|
|
45
52
|
"data-scene-id": element.id,
|
|
46
|
-
|
|
53
|
+
children: /*#__PURE__*/ jsx("i", {
|
|
54
|
+
className: "pi pi-cog",
|
|
55
|
+
"aria-hidden": "true"
|
|
56
|
+
})
|
|
47
57
|
}),
|
|
48
|
-
/*#__PURE__*/
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
58
|
+
/*#__PURE__*/ jsxs(Drawer.Portal, {
|
|
59
|
+
children: [
|
|
60
|
+
/*#__PURE__*/ jsx(Drawer.Backdrop, {}),
|
|
61
|
+
/*#__PURE__*/ jsxs(Drawer.Popup, {
|
|
62
|
+
children: [
|
|
63
|
+
/*#__PURE__*/ jsxs(Drawer.Header, {
|
|
64
|
+
children: [
|
|
65
|
+
/*#__PURE__*/ jsx(Drawer.Title, {
|
|
66
|
+
children: title
|
|
67
|
+
}),
|
|
68
|
+
/*#__PURE__*/ jsx(Drawer.Close, {
|
|
69
|
+
"aria-label": `Close ${title}`,
|
|
70
|
+
children: /*#__PURE__*/ jsx("i", {
|
|
71
|
+
className: "pi pi-times",
|
|
72
|
+
"aria-hidden": "true"
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
]
|
|
76
|
+
}),
|
|
77
|
+
/*#__PURE__*/ jsx(Drawer.Content, {
|
|
78
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
79
|
+
className: "layout-config-panel",
|
|
80
|
+
children: [
|
|
81
|
+
/*#__PURE__*/ jsxs("div", {
|
|
82
|
+
children: [
|
|
83
|
+
/*#__PURE__*/ jsx("h3", {
|
|
84
|
+
className: "layout-config-section-title",
|
|
85
|
+
children: "Color scheme"
|
|
86
|
+
}),
|
|
87
|
+
/*#__PURE__*/ jsx("div", {
|
|
88
|
+
className: "layout-config-options",
|
|
89
|
+
role: "group",
|
|
90
|
+
"aria-label": "Color scheme",
|
|
91
|
+
children: colorSchemes.map((scheme)=>/*#__PURE__*/ jsx("button", {
|
|
92
|
+
type: "button",
|
|
93
|
+
className: "layout-config-option",
|
|
94
|
+
"aria-pressed": config.colorScheme === scheme,
|
|
95
|
+
onClick: ()=>setColorScheme(scheme),
|
|
96
|
+
children: colorSchemeLabels[scheme]
|
|
97
|
+
}, scheme))
|
|
98
|
+
})
|
|
99
|
+
]
|
|
100
|
+
}),
|
|
101
|
+
/*#__PURE__*/ jsx(ThemeSwitcher, {
|
|
102
|
+
element: {
|
|
103
|
+
...element,
|
|
104
|
+
id: `${element.id}-theme`,
|
|
105
|
+
properties: {
|
|
106
|
+
...element.properties,
|
|
107
|
+
label: 'Theme'
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
slots: {}
|
|
111
|
+
}),
|
|
112
|
+
showsMode && /*#__PURE__*/ jsx(LayoutModeSwitcher, {
|
|
113
|
+
element: {
|
|
114
|
+
...element,
|
|
115
|
+
id: `${element.id}-mode`,
|
|
116
|
+
properties: {
|
|
117
|
+
label: 'Menu mode'
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
slots: {}
|
|
121
|
+
}),
|
|
122
|
+
showsMenuTheme && /*#__PURE__*/ jsxs("div", {
|
|
123
|
+
children: [
|
|
124
|
+
/*#__PURE__*/ jsx("h3", {
|
|
125
|
+
className: "layout-config-section-title",
|
|
126
|
+
children: "Menu theme"
|
|
127
|
+
}),
|
|
128
|
+
/*#__PURE__*/ jsx("div", {
|
|
129
|
+
className: "layout-config-options",
|
|
130
|
+
role: "group",
|
|
131
|
+
"aria-label": "Menu theme",
|
|
132
|
+
children: menuThemes.map((menuTheme)=>/*#__PURE__*/ jsx("button", {
|
|
133
|
+
type: "button",
|
|
134
|
+
className: "layout-config-option",
|
|
135
|
+
"aria-pressed": config.menuTheme === menuTheme,
|
|
136
|
+
onClick: ()=>setMenuTheme(menuTheme),
|
|
137
|
+
children: menuThemeLabels[menuTheme]
|
|
138
|
+
}, menuTheme))
|
|
139
|
+
})
|
|
140
|
+
]
|
|
141
|
+
}),
|
|
142
|
+
slots.content
|
|
143
|
+
]
|
|
73
144
|
})
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
...element,
|
|
79
|
-
id: `${element.id}-theme`,
|
|
80
|
-
properties: {
|
|
81
|
-
...element.properties,
|
|
82
|
-
label: 'Theme'
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
slots: {}
|
|
86
|
-
}),
|
|
87
|
-
showsMode && /*#__PURE__*/ jsx(LayoutModeSwitcher, {
|
|
88
|
-
element: {
|
|
89
|
-
...element,
|
|
90
|
-
id: `${element.id}-mode`,
|
|
91
|
-
properties: {
|
|
92
|
-
label: 'Menu mode'
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
slots: {}
|
|
96
|
-
}),
|
|
97
|
-
showsMenuTheme && /*#__PURE__*/ jsxs("div", {
|
|
98
|
-
children: [
|
|
99
|
-
/*#__PURE__*/ jsx("h3", {
|
|
100
|
-
className: "layout-config-section-title",
|
|
101
|
-
children: "Menu theme"
|
|
102
|
-
}),
|
|
103
|
-
/*#__PURE__*/ jsx("div", {
|
|
104
|
-
className: "layout-config-options",
|
|
105
|
-
role: "group",
|
|
106
|
-
"aria-label": "Menu theme",
|
|
107
|
-
children: menuThemes.map((menuTheme)=>/*#__PURE__*/ jsx("button", {
|
|
108
|
-
type: "button",
|
|
109
|
-
className: "layout-config-option",
|
|
110
|
-
"aria-pressed": config.menuTheme === menuTheme,
|
|
111
|
-
onClick: ()=>setMenuTheme(menuTheme),
|
|
112
|
-
children: menuThemeLabels[menuTheme]
|
|
113
|
-
}, menuTheme))
|
|
114
|
-
})
|
|
115
|
-
]
|
|
116
|
-
}),
|
|
117
|
-
slots.content
|
|
118
|
-
]
|
|
119
|
-
})
|
|
145
|
+
})
|
|
146
|
+
]
|
|
147
|
+
})
|
|
148
|
+
]
|
|
120
149
|
})
|
|
121
150
|
]
|
|
122
151
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigPanel.js","sources":["../../../shell/ConfigPanel.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState } from 'react';\nimport { Button } from 'primereact/button';\nimport { Sidebar } from 'primereact/sidebar';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ColorScheme, MenuTheme, colorSchemes, menuThemes, useLayoutConfig } from '../configuration';\nimport { LayoutModeSwitcher } from './LayoutModeSwitcher';\nimport { ThemeSwitcher } from './ThemeSwitcher';\nimport { readBoolean, readString } from './elementProperties';\n\n/** What each color scheme is called in the configurator. */\nconst colorSchemeLabels: Record<ColorScheme, string> = {\n [ColorScheme.Light]: 'Light',\n [ColorScheme.Dark]: 'Dark',\n};\n\n/** What each menu theme is called in the configurator. */\nconst menuThemeLabels: Record<MenuTheme, string> = {\n [MenuTheme.Light]: 'Light',\n [MenuTheme.Dark]: 'Dark',\n [MenuTheme.Primary]: 'Primary',\n};\n\n/**\n * The floating configurator.\n *\n * The axes are the ones the modern PrimeTek templates expose - color scheme, menu mode, menu theme and\n * theme - because those are the four choices that actually change how an application feels, and a\n * configurator with more knobs than that becomes a settings screen nobody finishes reading.\n *\n * The panel itself is PrimeReact 10's `Sidebar`, which is an overlay drawer rather than an app-shell\n * sidebar - this is the one use it was designed for. (v11 renames it `Drawer` precisely to stop the\n * confusion, and gives the app-shell role to a new `Sidebar`.)\n */\nexport function ConfigPanel({ element, slots }: RegisteredComponentProps) {\n const [isVisible, setIsVisible] = useState(false);\n const { config, setColorScheme, setMenuTheme } = useLayoutConfig();\n const title = readString(element, 'title', 'Settings');\n const showsMenuTheme = readBoolean(element, 'showMenuTheme', true);\n const showsMode = readBoolean(element, 'showLayoutMode', true);\n\n return (\n <>\n <Button\n type='button'\n rounded\n icon='pi pi-cog'\n className='layout-config-button'\n aria-label={title}\n data-scene-id={element.id}\n onClick={() => setIsVisible(true)}\n />\n <Sidebar visible={isVisible} position='right' header={title} onHide={() => setIsVisible(false)}>\n <div className='layout-config-panel'>\n <div>\n <h3 className='layout-config-section-title'>Color scheme</h3>\n <div className='layout-config-options' role='group' aria-label='Color scheme'>\n {colorSchemes.map(scheme => (\n <button\n key={scheme}\n type='button'\n className='layout-config-option'\n aria-pressed={config.colorScheme === scheme}\n onClick={() => setColorScheme(scheme)}>\n {colorSchemeLabels[scheme]}\n </button>\n ))}\n </div>\n </div>\n\n <ThemeSwitcher\n element={{ ...element, id: `${element.id}-theme`, properties: { ...element.properties, label: 'Theme' } }}\n slots={{}}\n />\n\n {showsMode && (\n <LayoutModeSwitcher element={{ ...element, id: `${element.id}-mode`, properties: { label: 'Menu mode' } }} slots={{}} />\n )}\n\n {showsMenuTheme && (\n <div>\n <h3 className='layout-config-section-title'>Menu theme</h3>\n <div className='layout-config-options' role='group' aria-label='Menu theme'>\n {menuThemes.map(menuTheme => (\n <button\n key={menuTheme}\n type='button'\n className='layout-config-option'\n aria-pressed={config.menuTheme === menuTheme}\n onClick={() => setMenuTheme(menuTheme)}>\n {menuThemeLabels[menuTheme]}\n </button>\n ))}\n </div>\n </div>\n )}\n\n {slots.content}\n </div>\n </Sidebar>\n </>\n );\n}\n"],"names":["colorSchemeLabels","ColorScheme","Light","Dark","menuThemeLabels","MenuTheme","Primary","ConfigPanel","element","slots","isVisible","setIsVisible","useState","config","setColorScheme","setMenuTheme","useLayoutConfig","title","readString","showsMenuTheme","readBoolean","showsMode","_jsxs","_Fragment","_jsx","Button","type","rounded","icon","className","aria-label","data-scene-id","id","onClick","Sidebar","visible","position","header","onHide","div","h3","role","colorSchemes","map","scheme","button","aria-pressed","colorScheme","ThemeSwitcher","properties","label","LayoutModeSwitcher","menuThemes","menuTheme","content"],"mappings":";;;;;;;;;;;AAYA,6DACA,MAAMA,iBAAAA,GAAiD;IACnD,CAACC,WAAAA,CAAYC,KAAK,GAAG,OAAA;IACrB,CAACD,WAAAA,CAAYE,IAAI,GAAG;AACxB,CAAA;AAEA,2DACA,MAAMC,eAAAA,GAA6C;IAC/C,CAACC,SAAAA,CAAUH,KAAK,GAAG,OAAA;IACnB,CAACG,SAAAA,CAAUF,IAAI,GAAG,MAAA;IAClB,CAACE,SAAAA,CAAUC,OAAO,GAAG;AACzB,CAAA;AAE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AAA;;8CAC5CL,GAAA,CAACe,KAAAA,EAAAA;oCAAIV,SAAAA,EAAU,uBAAA;oCAAwBY,IAAAA,EAAK,OAAA;oCAAQX,YAAAA,EAAW,YAAA;AAC1DsB,oCAAAA,QAAAA,EAAAA,UAAAA,CAAWT,GAAG,CAACU,CAAAA,SAAAA,iBACZ7B,GAAA,CAACqB,QAAAA,EAAAA;4CAEGnB,IAAAA,EAAK,QAAA;4CACLG,SAAAA,EAAU,sBAAA;4CACViB,cAAAA,EAAcjC,MAAAA,CAAOwC,SAAS,KAAKA,SAAAA;AACnCpB,4CAAAA,OAAAA,EAAS,IAAMlB,YAAAA,CAAasC,SAAAA,CAAAA;AAC3BjD,4CAAAA,QAAAA,EAAAA,eAAe,CAACiD,SAAAA;AALZA,yCAAAA,EAAAA,SAAAA,CAAAA;;;;AAYxB5C,wBAAAA,KAAAA,CAAM6C;;;;;;AAK3B;;;;"}
|
|
1
|
+
{"version":3,"file":"ConfigPanel.js","sources":["../../../shell/ConfigPanel.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Button } from 'primereact/button';\nimport { Drawer } from 'primereact/drawer';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ColorScheme, MenuTheme, colorSchemes, menuThemes, useLayoutConfig } from '../configuration';\nimport { LayoutModeSwitcher } from './LayoutModeSwitcher';\nimport { ThemeSwitcher } from './ThemeSwitcher';\nimport { readBoolean, readString } from './elementProperties';\n\n/** What each color scheme is called in the configurator. */\nconst colorSchemeLabels: Record<ColorScheme, string> = {\n [ColorScheme.Light]: 'Light',\n [ColorScheme.Dark]: 'Dark',\n};\n\n/** What each menu theme is called in the configurator. */\nconst menuThemeLabels: Record<MenuTheme, string> = {\n [MenuTheme.Light]: 'Light',\n [MenuTheme.Dark]: 'Dark',\n [MenuTheme.Primary]: 'Primary',\n};\n\n/**\n * The floating configurator.\n *\n * The axes are the ones the modern PrimeTek templates expose - color scheme, menu mode, menu theme and\n * theme - because those are the four choices that actually change how an application feels, and a\n * configurator with more knobs than that becomes a settings screen nobody finishes reading.\n *\n * The panel is `primereact/drawer`, which is the slide-in overlay this component has always wanted.\n * PrimeReact 11 gave the name `Sidebar` to something else entirely - a new app-shell primitive with\n * `SidebarLayout`/`SidebarAside`/`SidebarPanel` parts - so the v10 `Sidebar` import this file used to\n * carry would still resolve after the upgrade and would silently render an app shell inside the shell.\n * That is the one rename in the whole library that fails quietly rather than loudly, which is why it is\n * called out here: this is `Drawer`, deliberately, and it is not the {@link Sidebar} next door either -\n * that one is this package's own component for the docked panel's chrome.\n *\n * Open state is the drawer's own. `Drawer.Trigger` renders in place through `Drawer.Root`'s fragment, so\n * the floating cog sits exactly where it did while getting `aria-expanded`/`aria-controls` from the\n * component rather than from hand-written props that can drift out of step with the panel.\n */\nexport function ConfigPanel({ element, slots }: RegisteredComponentProps) {\n const { config, setColorScheme, setMenuTheme } = useLayoutConfig();\n const title = readString(element, 'title', 'Settings');\n const showsMenuTheme = readBoolean(element, 'showMenuTheme', true);\n const showsMode = readBoolean(element, 'showLayoutMode', true);\n\n return (\n <Drawer.Root position='right'>\n <Drawer.Trigger as={Button} rounded iconOnly className='layout-config-button' aria-label={title} data-scene-id={element.id}>\n <i className='pi pi-cog' aria-hidden='true' />\n </Drawer.Trigger>\n <Drawer.Portal>\n <Drawer.Backdrop />\n <Drawer.Popup>\n <Drawer.Header>\n <Drawer.Title>{title}</Drawer.Title>\n <Drawer.Close aria-label={`Close ${title}`}>\n <i className='pi pi-times' aria-hidden='true' />\n </Drawer.Close>\n </Drawer.Header>\n <Drawer.Content>\n <div className='layout-config-panel'>\n <div>\n <h3 className='layout-config-section-title'>Color scheme</h3>\n <div className='layout-config-options' role='group' aria-label='Color scheme'>\n {colorSchemes.map(scheme => (\n <button\n key={scheme}\n type='button'\n className='layout-config-option'\n aria-pressed={config.colorScheme === scheme}\n onClick={() => setColorScheme(scheme)}>\n {colorSchemeLabels[scheme]}\n </button>\n ))}\n </div>\n </div>\n\n <ThemeSwitcher\n element={{ ...element, id: `${element.id}-theme`, properties: { ...element.properties, label: 'Theme' } }}\n slots={{}}\n />\n\n {showsMode && (\n <LayoutModeSwitcher element={{ ...element, id: `${element.id}-mode`, properties: { label: 'Menu mode' } }} slots={{}} />\n )}\n\n {showsMenuTheme && (\n <div>\n <h3 className='layout-config-section-title'>Menu theme</h3>\n <div className='layout-config-options' role='group' aria-label='Menu theme'>\n {menuThemes.map(menuTheme => (\n <button\n key={menuTheme}\n type='button'\n className='layout-config-option'\n aria-pressed={config.menuTheme === menuTheme}\n onClick={() => setMenuTheme(menuTheme)}>\n {menuThemeLabels[menuTheme]}\n </button>\n ))}\n </div>\n </div>\n )}\n\n {slots.content}\n </div>\n </Drawer.Content>\n </Drawer.Popup>\n </Drawer.Portal>\n </Drawer.Root>\n );\n}\n"],"names":["colorSchemeLabels","ColorScheme","Light","Dark","menuThemeLabels","MenuTheme","Primary","ConfigPanel","element","slots","config","setColorScheme","setMenuTheme","useLayoutConfig","title","readString","showsMenuTheme","readBoolean","showsMode","_jsxs","Drawer","Root","position","_jsx","Trigger","as","Button","rounded","iconOnly","className","aria-label","data-scene-id","id","i","aria-hidden","Portal","Backdrop","Popup","Header","Title","Close","Content","div","h3","role","colorSchemes","map","scheme","button","type","aria-pressed","colorScheme","onClick","ThemeSwitcher","properties","label","LayoutModeSwitcher","menuThemes","menuTheme","content"],"mappings":";;;;;;;;;;AAWA,6DACA,MAAMA,iBAAAA,GAAiD;IACnD,CAACC,WAAAA,CAAYC,KAAK,GAAG,OAAA;IACrB,CAACD,WAAAA,CAAYE,IAAI,GAAG;AACxB,CAAA;AAEA,2DACA,MAAMC,eAAAA,GAA6C;IAC/C,CAACC,SAAAA,CAAUH,KAAK,GAAG,OAAA;IACnB,CAACG,SAAAA,CAAUF,IAAI,GAAG,MAAA;IAClB,CAACE,SAAAA,CAAUC,OAAO,GAAG;AACzB,CAAA;AAEA;;;;;;;;;;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
+
{"version":3,"file":"MenuEntry.js","sourceRoot":"","sources":["../../../shell/MenuEntry.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../shell/Sidebar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAe/D,wBAAgB,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,wBAAwB,+
|
|
1
|
+
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../shell/Sidebar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAe/D,wBAAgB,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,wBAAwB,+BA0BnE"}
|
|
@@ -31,12 +31,16 @@ import { readString } from './elementProperties.js';
|
|
|
31
31
|
}),
|
|
32
32
|
isPinnable && /*#__PURE__*/ jsx(Button, {
|
|
33
33
|
type: "button",
|
|
34
|
-
|
|
34
|
+
variant: "text",
|
|
35
35
|
rounded: true,
|
|
36
|
-
|
|
36
|
+
iconOnly: true,
|
|
37
37
|
"aria-label": config.isSidebarAnchored ? 'Unpin the menu' : 'Pin the menu open',
|
|
38
38
|
"aria-pressed": config.isSidebarAnchored,
|
|
39
|
-
onClick: toggleSidebarAnchor
|
|
39
|
+
onClick: toggleSidebarAnchor,
|
|
40
|
+
children: /*#__PURE__*/ jsx("i", {
|
|
41
|
+
className: config.isSidebarAnchored ? 'pi pi-lock' : 'pi pi-lock-open',
|
|
42
|
+
"aria-hidden": "true"
|
|
43
|
+
})
|
|
40
44
|
})
|
|
41
45
|
]
|
|
42
46
|
}),
|