@cratis/scene.primereact 3.2.0 → 3.3.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/cjs/button/PrimeButton.js.map +1 -1
- package/dist/cjs/button/PrimeButtonGroup.js.map +1 -1
- package/dist/cjs/button/PrimeSpeedDial.js.map +1 -1
- package/dist/cjs/button/PrimeSplitButton.js.map +1 -1
- package/dist/cjs/button/SplitButton.js.map +1 -1
- package/dist/cjs/data/Column.js.map +1 -1
- package/dist/cjs/data/Pagination.js.map +1 -1
- package/dist/cjs/data/PrimeColumn.js.map +1 -1
- package/dist/cjs/data/PrimeDataTable.js.map +1 -1
- package/dist/cjs/data/PrimeDataView.js.map +1 -1
- package/dist/cjs/data/PrimeOrderList.js.map +1 -1
- package/dist/cjs/data/PrimeOrganizationChart.js.map +1 -1
- package/dist/cjs/data/PrimePaginator.js.map +1 -1
- package/dist/cjs/data/PrimePickList.js.map +1 -1
- package/dist/cjs/data/PrimeTimeline.js.map +1 -1
- package/dist/cjs/data/PrimeTree.js.map +1 -1
- package/dist/cjs/data/columnDefinitions.js.map +1 -1
- package/dist/cjs/data/primeTreeNodes.js.map +1 -1
- package/dist/cjs/data/selectOptions.js.map +1 -1
- package/dist/cjs/form/PrimeAutoComplete.js.map +1 -1
- package/dist/cjs/form/PrimeCalendar.js.map +1 -1
- package/dist/cjs/form/PrimeCheckbox.js.map +1 -1
- package/dist/cjs/form/PrimeChips.js.map +1 -1
- package/dist/cjs/form/PrimeColorPicker.js.map +1 -1
- package/dist/cjs/form/PrimeDropdown.js.map +1 -1
- package/dist/cjs/form/PrimeFloatLabel.js.map +1 -1
- package/dist/cjs/form/PrimeIconField.js.map +1 -1
- package/dist/cjs/form/PrimeInputNumber.js.map +1 -1
- package/dist/cjs/form/PrimeInputText.js.map +1 -1
- package/dist/cjs/form/PrimeInputTextarea.js.map +1 -1
- package/dist/cjs/form/PrimeKnob.js.map +1 -1
- package/dist/cjs/form/PrimeListBox.js.map +1 -1
- package/dist/cjs/form/PrimeMultiSelect.js.map +1 -1
- package/dist/cjs/form/PrimePassword.js.map +1 -1
- package/dist/cjs/form/PrimeRadioButton.js.map +1 -1
- package/dist/cjs/form/PrimeRating.js.map +1 -1
- package/dist/cjs/form/PrimeSelectButton.js.map +1 -1
- package/dist/cjs/form/PrimeSlider.js.map +1 -1
- package/dist/cjs/form/PrimeToggleSwitch.js.map +1 -1
- package/dist/cjs/form/PrimeTreeSelect.js.map +1 -1
- package/dist/cjs/form/TreeSelect.js.map +1 -1
- package/dist/cjs/media/Image.js.map +1 -1
- package/dist/cjs/media/PrimeCarousel.js.map +1 -1
- package/dist/cjs/media/PrimeGalleria.js.map +1 -1
- package/dist/cjs/media/PrimeImage.js.map +1 -1
- package/dist/cjs/menu/Dock.js.map +1 -1
- package/dist/cjs/menu/DockPosition.js.map +1 -1
- package/dist/cjs/menu/MegaMenu.js.map +1 -1
- package/dist/cjs/menu/MenuItemAction.js.map +1 -1
- package/dist/cjs/menu/MenuItemContent.js.map +1 -1
- package/dist/cjs/menu/Menubar.js.map +1 -1
- package/dist/cjs/menu/PanelMenu.js.map +1 -1
- package/dist/cjs/menu/PrimeBreadcrumb.js.map +1 -1
- package/dist/cjs/menu/PrimeContextMenu.js.map +1 -1
- package/dist/cjs/menu/PrimeDock.js.map +1 -1
- package/dist/cjs/menu/PrimeMegaMenu.js.map +1 -1
- package/dist/cjs/menu/PrimeMenu.js.map +1 -1
- package/dist/cjs/menu/PrimeMenubar.js.map +1 -1
- package/dist/cjs/menu/PrimePanelMenu.js.map +1 -1
- package/dist/cjs/menu/PrimeSteps.js.map +1 -1
- package/dist/cjs/menu/PrimeTabMenu.js.map +1 -1
- package/dist/cjs/menu/PrimeTieredMenu.js.map +1 -1
- package/dist/cjs/menu/Steps.js.map +1 -1
- package/dist/cjs/menu/TabMenu.js.map +1 -1
- package/dist/cjs/menu/TieredMenu.js.map +1 -1
- package/dist/cjs/menuItems.js.map +1 -1
- package/dist/cjs/messages/PrimeInlineMessage.js.map +1 -1
- package/dist/cjs/messages/PrimeMessage.js.map +1 -1
- package/dist/cjs/messages/PrimeToast.js.map +1 -1
- package/dist/cjs/misc/BlockUI.js.map +1 -1
- package/dist/cjs/misc/PrimeAvatar.js.map +1 -1
- package/dist/cjs/misc/PrimeBadge.js.map +1 -1
- package/dist/cjs/misc/PrimeBlockUI.js.map +1 -1
- package/dist/cjs/misc/PrimeChip.js.map +1 -1
- package/dist/cjs/misc/PrimeInplace.js.map +1 -1
- package/dist/cjs/misc/PrimeProgressBar.js.map +1 -1
- package/dist/cjs/misc/PrimeProgressSpinner.js.map +1 -1
- package/dist/cjs/misc/PrimeScrollTop.js.map +1 -1
- package/dist/cjs/misc/PrimeSkeleton.js.map +1 -1
- package/dist/cjs/misc/PrimeTag.js.map +1 -1
- package/dist/cjs/misc/PrimeTerminal.js.map +1 -1
- package/dist/cjs/misc/ScrollTop.js.map +1 -1
- package/dist/cjs/overlay/ConfirmDialog.js.map +1 -1
- package/dist/cjs/overlay/PrimeConfirmDialog.js.map +1 -1
- package/dist/cjs/overlay/PrimeDialog.js.map +1 -1
- package/dist/cjs/overlay/PrimeOverlayPanel.js.map +1 -1
- package/dist/cjs/overlay/PrimeSidebar.js.map +1 -1
- package/dist/cjs/overlay/PrimeTooltip.js.map +1 -1
- package/dist/cjs/panel/PrimeAccordion.js.map +1 -1
- package/dist/cjs/panel/PrimeCard.js.map +1 -1
- package/dist/cjs/panel/PrimeDivider.js.map +1 -1
- package/dist/cjs/panel/PrimeFieldset.js.map +1 -1
- package/dist/cjs/panel/PrimePanel.js.map +1 -1
- package/dist/cjs/panel/PrimeScrollPanel.js.map +1 -1
- package/dist/cjs/panel/PrimeSplitter.js.map +1 -1
- package/dist/cjs/panel/PrimeStepper.js.map +1 -1
- package/dist/cjs/panel/PrimeTabView.js.map +1 -1
- package/dist/cjs/panel/PrimeToolbar.js.map +1 -1
- package/dist/cjs/primeReactComponents.js.map +1 -1
- package/dist/cjs/primeReactPackage.js.map +1 -1
- package/dist/cjs/properties.js.map +1 -1
- package/dist/cjs/screen/PrimeAction.js.map +1 -1
- package/dist/cjs/screen/PrimeField.js.map +1 -1
- package/dist/cjs/screen/PrimeSection.js.map +1 -1
- package/dist/cjs/screen/PrimeSummary.js.map +1 -1
- package/dist/cjs/screen/PrimeText.js.map +1 -1
- package/dist/cjs/screen/PrimeTitle.js.map +1 -1
- package/dist/cjs/theme/PrimeReactThemeFamily.js.map +1 -1
- package/dist/cjs/theme/primeReactThemePreset.js.map +1 -1
- package/dist/cjs/theme/primeReactThemes.js.map +1 -1
- package/dist/cjs/theme/themePresets.js.map +1 -1
- package/dist/cjs/theme/usePrimeReactTheme.js.map +1 -1
- package/dist/cjs/treeNodes.js.map +1 -1
- package/dist/esm/button/PrimeButton.js.map +1 -1
- package/dist/esm/button/PrimeButtonGroup.js.map +1 -1
- package/dist/esm/button/PrimeSpeedDial.js.map +1 -1
- package/dist/esm/button/PrimeSplitButton.js.map +1 -1
- package/dist/esm/button/SplitButton.js.map +1 -1
- package/dist/esm/data/Column.js.map +1 -1
- package/dist/esm/data/Pagination.js.map +1 -1
- package/dist/esm/data/PrimeColumn.js.map +1 -1
- package/dist/esm/data/PrimeDataTable.js.map +1 -1
- package/dist/esm/data/PrimeDataView.js.map +1 -1
- package/dist/esm/data/PrimeOrderList.js.map +1 -1
- package/dist/esm/data/PrimeOrganizationChart.js.map +1 -1
- package/dist/esm/data/PrimePaginator.js.map +1 -1
- package/dist/esm/data/PrimePickList.js.map +1 -1
- package/dist/esm/data/PrimeTimeline.js.map +1 -1
- package/dist/esm/data/PrimeTree.js.map +1 -1
- package/dist/esm/data/columnDefinitions.js.map +1 -1
- package/dist/esm/data/primeTreeNodes.js.map +1 -1
- package/dist/esm/data/selectOptions.js.map +1 -1
- package/dist/esm/form/PrimeAutoComplete.js.map +1 -1
- package/dist/esm/form/PrimeCalendar.js.map +1 -1
- package/dist/esm/form/PrimeCheckbox.js.map +1 -1
- package/dist/esm/form/PrimeChips.js.map +1 -1
- package/dist/esm/form/PrimeColorPicker.js.map +1 -1
- package/dist/esm/form/PrimeDropdown.js.map +1 -1
- package/dist/esm/form/PrimeFloatLabel.js.map +1 -1
- package/dist/esm/form/PrimeIconField.js.map +1 -1
- package/dist/esm/form/PrimeInputNumber.js.map +1 -1
- package/dist/esm/form/PrimeInputText.js.map +1 -1
- package/dist/esm/form/PrimeInputTextarea.js.map +1 -1
- package/dist/esm/form/PrimeKnob.js.map +1 -1
- package/dist/esm/form/PrimeListBox.js.map +1 -1
- package/dist/esm/form/PrimeMultiSelect.js.map +1 -1
- package/dist/esm/form/PrimePassword.js.map +1 -1
- package/dist/esm/form/PrimeRadioButton.js.map +1 -1
- package/dist/esm/form/PrimeRating.js.map +1 -1
- package/dist/esm/form/PrimeSelectButton.js.map +1 -1
- package/dist/esm/form/PrimeSlider.js.map +1 -1
- package/dist/esm/form/PrimeToggleSwitch.js.map +1 -1
- package/dist/esm/form/PrimeTreeSelect.js.map +1 -1
- package/dist/esm/form/TreeSelect.js.map +1 -1
- package/dist/esm/media/Image.js.map +1 -1
- package/dist/esm/media/PrimeCarousel.js.map +1 -1
- package/dist/esm/media/PrimeGalleria.js.map +1 -1
- package/dist/esm/media/PrimeImage.js.map +1 -1
- package/dist/esm/menu/Dock.js.map +1 -1
- package/dist/esm/menu/DockPosition.js.map +1 -1
- package/dist/esm/menu/MegaMenu.js.map +1 -1
- package/dist/esm/menu/MenuItemAction.js.map +1 -1
- package/dist/esm/menu/MenuItemContent.js.map +1 -1
- package/dist/esm/menu/Menubar.js.map +1 -1
- package/dist/esm/menu/PanelMenu.js.map +1 -1
- package/dist/esm/menu/PrimeBreadcrumb.js.map +1 -1
- package/dist/esm/menu/PrimeContextMenu.js.map +1 -1
- package/dist/esm/menu/PrimeDock.js.map +1 -1
- package/dist/esm/menu/PrimeMegaMenu.js.map +1 -1
- package/dist/esm/menu/PrimeMenu.js.map +1 -1
- package/dist/esm/menu/PrimeMenubar.js.map +1 -1
- package/dist/esm/menu/PrimePanelMenu.js.map +1 -1
- package/dist/esm/menu/PrimeSteps.js.map +1 -1
- package/dist/esm/menu/PrimeTabMenu.js.map +1 -1
- package/dist/esm/menu/PrimeTieredMenu.js.map +1 -1
- package/dist/esm/menu/Steps.js.map +1 -1
- package/dist/esm/menu/TabMenu.js.map +1 -1
- package/dist/esm/menu/TieredMenu.js.map +1 -1
- package/dist/esm/menuItems.js.map +1 -1
- package/dist/esm/messages/PrimeInlineMessage.js.map +1 -1
- package/dist/esm/messages/PrimeMessage.js.map +1 -1
- package/dist/esm/messages/PrimeToast.js.map +1 -1
- package/dist/esm/misc/BlockUI.js.map +1 -1
- package/dist/esm/misc/PrimeAvatar.js.map +1 -1
- package/dist/esm/misc/PrimeBadge.js.map +1 -1
- package/dist/esm/misc/PrimeBlockUI.js.map +1 -1
- package/dist/esm/misc/PrimeChip.js.map +1 -1
- package/dist/esm/misc/PrimeInplace.js.map +1 -1
- package/dist/esm/misc/PrimeProgressBar.js.map +1 -1
- package/dist/esm/misc/PrimeProgressSpinner.js.map +1 -1
- package/dist/esm/misc/PrimeScrollTop.js.map +1 -1
- package/dist/esm/misc/PrimeSkeleton.js.map +1 -1
- package/dist/esm/misc/PrimeTag.js.map +1 -1
- package/dist/esm/misc/PrimeTerminal.js.map +1 -1
- package/dist/esm/misc/ScrollTop.js.map +1 -1
- package/dist/esm/overlay/ConfirmDialog.js.map +1 -1
- package/dist/esm/overlay/PrimeConfirmDialog.js.map +1 -1
- package/dist/esm/overlay/PrimeDialog.js.map +1 -1
- package/dist/esm/overlay/PrimeOverlayPanel.js.map +1 -1
- package/dist/esm/overlay/PrimeSidebar.js.map +1 -1
- package/dist/esm/overlay/PrimeTooltip.js.map +1 -1
- package/dist/esm/panel/PrimeAccordion.js.map +1 -1
- package/dist/esm/panel/PrimeCard.js.map +1 -1
- package/dist/esm/panel/PrimeDivider.js.map +1 -1
- package/dist/esm/panel/PrimeFieldset.js.map +1 -1
- package/dist/esm/panel/PrimePanel.js.map +1 -1
- package/dist/esm/panel/PrimeScrollPanel.js.map +1 -1
- package/dist/esm/panel/PrimeSplitter.js.map +1 -1
- package/dist/esm/panel/PrimeStepper.js.map +1 -1
- package/dist/esm/panel/PrimeTabView.js.map +1 -1
- package/dist/esm/panel/PrimeToolbar.js.map +1 -1
- package/dist/esm/primeReactComponents.js.map +1 -1
- package/dist/esm/primeReactPackage.js.map +1 -1
- package/dist/esm/properties.js.map +1 -1
- package/dist/esm/screen/PrimeAction.js.map +1 -1
- package/dist/esm/screen/PrimeField.js.map +1 -1
- package/dist/esm/screen/PrimeSection.js.map +1 -1
- package/dist/esm/screen/PrimeSummary.js.map +1 -1
- package/dist/esm/screen/PrimeText.js.map +1 -1
- package/dist/esm/screen/PrimeTitle.js.map +1 -1
- package/dist/esm/theme/PrimeReactThemeFamily.js.map +1 -1
- package/dist/esm/theme/primeReactThemePreset.js.map +1 -1
- package/dist/esm/theme/primeReactThemes.js.map +1 -1
- package/dist/esm/theme/themePresets.js.map +1 -1
- package/dist/esm/theme/usePrimeReactTheme.js.map +1 -1
- package/dist/esm/treeNodes.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeGalleria.js","sources":["../../../media/PrimeGalleria.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 { Gallery } from 'primereact/gallery';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, numberProperty, recordArrayProperty } from '../properties';\n\n/**\n * The `PrimeReact:galleria` component - a gallery with thumbnails and a large view.\n *\n * PrimeReact 11 renamed the module to `gallery` and turned it into a composition, which removes the\n * awkwardness the v10 adapter had to work around: there are no `item` and `thumbnail` render-prop\n * templates to supply, only two lists the adapter writes out itself. Each entry is still read as\n * `{ src, thumbnail, alt }`, with the thumbnail falling back to the full image - the common case for a\n * small gallery that has no separately generated thumbnails.\n *\n * The abstract name stays `galleria`. Renaming it would be renaming Scene's vocabulary because PrimeReact\n * renamed a module, and every screen that says `galleria` today would have to be edited to say the same\n * thing.\n *\n * Navigation and the thumbnail rail are rendered only when there is something to navigate: a single image\n * needs no previous and next, and no items at all leave a bare, empty gallery rather than a frame of\n * chrome around nothing.\n */\nexport function PrimeGalleria({ element }: RegisteredComponentProps) {\n const items = recordArrayProperty(element, 'items');\n const showThumbnails = booleanProperty(element, 'showThumbnails', true);\n return (\n <Gallery.Root data-scene-id={element.id} style={{ maxWidth: `${numberProperty(element, 'maxWidth', 480)}px` }}>\n <Gallery.Content>\n {items.map((item, index) => (\n <Gallery.Item key={index}>\n <img src={String(item.src ?? '')} alt={String(item.alt ?? '')} className='block w-full' />\n </Gallery.Item>\n ))}\n {items.length > 1 && (\n <>\n <Gallery.Prev aria-label='Previous image'>\n <i className='pi pi-chevron-left' aria-hidden='true' />\n </Gallery.Prev>\n <Gallery.Next aria-label='Next image'>\n <i className='pi pi-chevron-right' aria-hidden='true' />\n </Gallery.Next>\n </>\n )}\n </Gallery.Content>\n {showThumbnails && items.length > 1 && (\n <Gallery.Thumbnail slidesPerPage={numberProperty(element, 'numVisible', 5)} loop={booleanProperty(element, 'circular', true)}>\n <Gallery.ThumbnailContent>\n {items.map((item, index) => (\n <Gallery.ThumbnailItem key={index} index={index}>\n <img src={String(item.thumbnail ?? item.src ?? '')} alt={String(item.alt ?? '')} className='block h-12' />\n </Gallery.ThumbnailItem>\n ))}\n </Gallery.ThumbnailContent>\n </Gallery.Thumbnail>\n )}\n </Gallery.Root>\n );\n}\n"],"names":["PrimeGalleria","element","items","recordArrayProperty","showThumbnails","booleanProperty","_jsxs","Gallery","Root","data-scene-id","id","style","maxWidth","numberProperty","Content","map","item","index","_jsx","Item","img","src","String","alt","className","length","_Fragment","Prev","aria-label","i","aria-hidden","Next","Thumbnail","slidesPerPage","loop","ThumbnailContent","ThumbnailItem","thumbnail"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B,gCAAA,QAAA,gBAAAV,cAAA,CAACW,GAAAA,EAAAA;oCAAEL,SAAAA,EAAU,qBAAA;oCAAsBM,aAAAA,EAAY;;;;;;;AAK9D1B,YAAAA,cAAAA,IAAkBF,MAAMuB,MAAM,GAAG,CAAA,kBAC9BP,cAAA,CAACX,gBAAQyB,SAAS,EAAA;gBAACC,aAAAA,EAAepB,yBAAAA,CAAeZ,SAAS,YAAA,EAAc,CAAA,CAAA;gBAAIiC,IAAAA,EAAM7B,0BAAAA,CAAgBJ,SAAS,UAAA,EAAY,IAAA,CAAA;wCACnHiB,cAAA,CAACX,gBAAQ4B,gBAAgB,EAAA;AACpBjC,oBAAAA,QAAAA,EAAAA,KAAAA,CAAMa,GAAG,CAAC,CAACC,MAAMC,KAAAA,iBACdC,cAAA,CAACX,gBAAQ6B,aAAa,EAAA;4BAAanB,KAAAA,EAAOA,KAAAA;AACtC,4BAAA,QAAA,gBAAAC,cAAA,CAACE,KAAAA,EAAAA;AAAIC,gCAAAA,GAAAA,EAAKC,OAAON,IAAAA,CAAKqB,SAAS,IAAIrB,IAAAA,CAAKK,GAAG,IAAI,EAAA,CAAA;gCAAKE,GAAAA,EAAKD,MAAAA,CAAON,IAAAA,CAAKO,GAAG,IAAI,EAAA,CAAA;gCAAKC,SAAAA,EAAU;;AADnEP,yBAAAA,EAAAA,KAAAA,CAAAA;;;;;AASxD
|
|
1
|
+
{"version":3,"file":"PrimeGalleria.js","sources":["../../../media/PrimeGalleria.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 { Gallery } from 'primereact/gallery';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, numberProperty, recordArrayProperty } from '../properties';\n\n/**\n * The `PrimeReact:galleria` component - a gallery with thumbnails and a large view.\n *\n * PrimeReact 11 renamed the module to `gallery` and turned it into a composition, which removes the\n * awkwardness the v10 adapter had to work around: there are no `item` and `thumbnail` render-prop\n * templates to supply, only two lists the adapter writes out itself. Each entry is still read as\n * `{ src, thumbnail, alt }`, with the thumbnail falling back to the full image - the common case for a\n * small gallery that has no separately generated thumbnails.\n *\n * The abstract name stays `galleria`. Renaming it would be renaming Scene's vocabulary because PrimeReact\n * renamed a module, and every screen that says `galleria` today would have to be edited to say the same\n * thing.\n *\n * Navigation and the thumbnail rail are rendered only when there is something to navigate: a single image\n * needs no previous and next, and no items at all leave a bare, empty gallery rather than a frame of\n * chrome around nothing.\n */\nexport function PrimeGalleria({ element }: RegisteredComponentProps) {\n const items = recordArrayProperty(element, 'items');\n const showThumbnails = booleanProperty(element, 'showThumbnails', true);\n return (\n <Gallery.Root data-scene-id={element.id} style={{ maxWidth: `${numberProperty(element, 'maxWidth', 480)}px` }}>\n <Gallery.Content>\n {items.map((item, index) => (\n <Gallery.Item key={index}>\n <img src={String(item.src ?? '')} alt={String(item.alt ?? '')} className='block w-full' />\n </Gallery.Item>\n ))}\n {items.length > 1 && (\n <>\n <Gallery.Prev aria-label='Previous image'>\n <i className='pi pi-chevron-left' aria-hidden='true' />\n </Gallery.Prev>\n <Gallery.Next aria-label='Next image'>\n <i className='pi pi-chevron-right' aria-hidden='true' />\n </Gallery.Next>\n </>\n )}\n </Gallery.Content>\n {showThumbnails && items.length > 1 && (\n <Gallery.Thumbnail slidesPerPage={numberProperty(element, 'numVisible', 5)} loop={booleanProperty(element, 'circular', true)}>\n <Gallery.ThumbnailContent>\n {items.map((item, index) => (\n <Gallery.ThumbnailItem key={index} index={index}>\n <img src={String(item.thumbnail ?? item.src ?? '')} alt={String(item.alt ?? '')} className='block h-12' />\n </Gallery.ThumbnailItem>\n ))}\n </Gallery.ThumbnailContent>\n </Gallery.Thumbnail>\n )}\n </Gallery.Root>\n );\n}\n"],"names":["PrimeGalleria","element","items","recordArrayProperty","showThumbnails","booleanProperty","_jsxs","Gallery","Root","data-scene-id","id","style","maxWidth","numberProperty","Content","map","item","index","_jsx","Item","img","src","String","alt","className","length","_Fragment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ElD,0CAAAZ,cAAA,CAACX,gBAAQwB,IAAI,EAAA;gCAACH,YAAAA,EAAW,YAAA;AACrB,gCAAA,QAAA,gBAAAV,cAAA,CAACW,GAAAA,EAAAA;oCAAEL,SAAAA,EAAU,qBAAA;oCAAsBM,aAAAA,EAAY;;;;;;;AAK9D1B,YAAAA,cAAAA,IAAkBF,MAAMuB,MAAM,GAAG,CAAA,kBAC9BP,cAAA,CAACX,gBAAQyB,SAAS,EAAA;gBAACC,aAAAA,EAAepB,yBAAAA,CAAeZ,SAAS,YAAA,EAAc,CAAA,CAAA;gBAAIiC,IAAAA,EAAM7B,0BAAAA,CAAgBJ,SAAS,UAAA,EAAY,IAAA,CAAA;wCACnHiB,cAAA,CAACX,gBAAQ4B,gBAAgB,EAAA;AACpBjC,oBAAAA,QAAAA,EAAAA,KAAAA,CAAMa,GAAG,CAAC,CAACC,MAAMC,KAAAA,iBACdC,cAAA,CAACX,gBAAQ6B,aAAa,EAAA;4BAAanB,KAAAA,EAAOA,KAAAA;AACtC,4BAAA,QAAA,gBAAAC,cAAA,CAACE,KAAAA,EAAAA;AAAIC,gCAAAA,GAAAA,EAAKC,OAAON,IAAAA,CAAKqB,SAAS,IAAIrB,IAAAA,CAAKK,GAAG,IAAI,EAAA,CAAA;gCAAKE,GAAAA,EAAKD,MAAAA,CAAON,IAAAA,CAAKO,GAAG,IAAI,EAAA,CAAA;gCAAKC,SAAAA,EAAU;;AADnEP,yBAAAA,EAAAA,KAAAA,CAAAA;;;;;AASxD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeImage.js","sources":["../../../media/PrimeImage.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { Image } from './Image';\nimport { booleanProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:image` component - an image with an optional full-screen preview.\n *\n * PrimeReact 11 removed `Image` with no replacement and no headless hook, so the adapter renders Cratis's\n * own {@link Image}. The element's authored contract is unchanged, which is the point: which library\n * happens to draw an `img` is not something a screen should have to be rewritten over.\n *\n * `alt` defaults to an empty string rather than to the file name: an image with no authored alternative\n * text is decorative until someone says otherwise, and inventing one would put a URL fragment in front of\n * a screen reader.\n */\nexport function PrimeImage({ element }: RegisteredComponentProps) {\n return (\n <Image\n data-scene-id={element.id}\n src={stringProperty(element, 'src')}\n alt={stringProperty(element, 'alt', '')}\n width={stringProperty(element, 'width')}\n height={stringProperty(element, 'height')}\n preview={booleanProperty(element, 'preview', false)}\n />\n );\n}\n"],"names":["PrimeImage","element","_jsx","Image","data-scene-id","id","src","stringProperty","alt","width","height","preview","booleanProperty"],"mappings":";;;;;;AAAA;AACA;AAMA;;;;;;;;;;AAUC,IACM,SAASA,UAAAA,CAAW,EAAEC,OAAO,EAA4B,EAAA;AAC5D,IAAA,qBACIC,cAAA,CAACC,WAAAA,EAAAA;AACGC,QAAAA,eAAAA,EAAeH,QAAQI,EAAE;AACzBC,QAAAA,GAAAA,EAAKC,0BAAeN,OAAAA,EAAS,KAAA,CAAA;QAC7BO,GAAAA,EAAKD,yBAAAA,CAAeN,SAAS,KAAA,EAAO,EAAA,CAAA;AACpCQ,QAAAA,KAAAA,EAAOF,0BAAeN,OAAAA,EAAS,OAAA,CAAA;AAC/BS,QAAAA,MAAAA,EAAQH,0BAAeN,OAAAA,EAAS,QAAA,CAAA;QAChCU,OAAAA,EAASC,0BAAAA,CAAgBX,SAAS,SAAA,EAAW,KAAA;;AAGzD
|
|
1
|
+
{"version":3,"file":"PrimeImage.js","sources":["../../../media/PrimeImage.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { Image } from './Image';\nimport { booleanProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:image` component - an image with an optional full-screen preview.\n *\n * PrimeReact 11 removed `Image` with no replacement and no headless hook, so the adapter renders Cratis's\n * own {@link Image}. The element's authored contract is unchanged, which is the point: which library\n * happens to draw an `img` is not something a screen should have to be rewritten over.\n *\n * `alt` defaults to an empty string rather than to the file name: an image with no authored alternative\n * text is decorative until someone says otherwise, and inventing one would put a URL fragment in front of\n * a screen reader.\n */\nexport function PrimeImage({ element }: RegisteredComponentProps) {\n return (\n <Image\n data-scene-id={element.id}\n src={stringProperty(element, 'src')}\n alt={stringProperty(element, 'alt', '')}\n width={stringProperty(element, 'width')}\n height={stringProperty(element, 'height')}\n preview={booleanProperty(element, 'preview', false)}\n />\n );\n}\n"],"names":["PrimeImage","element","_jsx","Image","data-scene-id","id","src","stringProperty","alt","width","height","preview","booleanProperty"],"mappings":";;;;;;AAAA;AACA;AAMA;;;;;;;;;;AAUC,IACM,SAASA,UAAAA,CAAW,EAAEC,OAAO,EAA4B,EAAA;AAC5D,IAAA,qBACIC,cAAA,CAACC,WAAAA,EAAAA;AACGC,QAAAA,eAAAA,EAAeH,QAAQI,EAAE;AACzBC,QAAAA,GAAAA,EAAKC,0BAAeN,OAAAA,EAAS,KAAA,CAAA;QAC7BO,GAAAA,EAAKD,yBAAAA,CAAeN,SAAS,KAAA,EAAO,EAAA,CAAA;AACpCQ,QAAAA,KAAAA,EAAOF,0BAAeN,OAAAA,EAAS,OAAA,CAAA;AAC/BS,QAAAA,MAAAA,EAAQH,0BAAeN,OAAAA,EAAS,QAAA,CAAA;QAChCU,OAAAA,EAASC,0BAAAA,CAAgBX,SAAS,SAAA,EAAW,KAAA;;AAGzD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dock.js","sources":["../../../menu/Dock.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 { CSSProperties, HTMLAttributes } from 'react';\nimport { MenuItem } from '../MenuItem';\nimport { DockPosition } from './DockPosition';\n\nconst dockStyle: CSSProperties = {\n position: 'absolute',\n background: 'var(--scene-surface-overlay)',\n border: '1px solid var(--scene-surface-border)',\n borderRadius: 'var(--scene-content-border-radius)',\n color: 'var(--scene-text-color)',\n};\n\nconst entryStyle: CSSProperties = {\n background: 'transparent',\n border: 'none',\n color: 'inherit',\n cursor: 'pointer',\n font: 'inherit',\n fontSize: '1.5rem',\n lineHeight: 1,\n textDecoration: 'none',\n};\n\n/**\n * Where the dock sits within its container, for one edge.\n *\n * The offset lives here rather than in four CSS classes because this package ships no component\n * stylesheets, and because the two axes are genuinely coupled: an edge decides both which side is pinned\n * and which axis is centered, so writing them together is what keeps them consistent.\n */\nfunction anchor(position: DockPosition): CSSProperties {\n switch (position) {\n case DockPosition.Top:\n return { top: 0, left: '50%', transform: 'translateX(-50%)' };\n case DockPosition.Left:\n return { left: 0, top: '50%', transform: 'translateY(-50%)' };\n case DockPosition.Right:\n return { right: 0, top: '50%', transform: 'translateY(-50%)' };\n default:\n return { bottom: 0, left: '50%', transform: 'translateX(-50%)' };\n }\n}\n\n/**\n * The configuration {@link Dock} takes.\n */\nexport interface DockProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * The entries to show. Each is shown as its icon alone, with its label as the accessible name.\n */\n items?: MenuItem[];\n\n /**\n * The edge of the containing box to anchor against.\n */\n position?: DockPosition;\n}\n\n/**\n * A small strip of icons anchored to one edge of its container. Cratis-owned.\n *\n * This exists because PrimeReact 11 removed `primereact/dock` outright, with no successor and no headless\n * hook. It positions itself absolutely, so it expects a positioned container to sit in - dropped straight\n * into a page it would pin itself to the page, which is why the Scene adapter wraps it in a sized relative\n * box.\n *\n * Entries are icon-only, and that is precisely why each one carries its label as `aria-label` and as a\n * `title`: a control whose only content is a decorative glyph has no accessible name at all otherwise, and\n * a dock is exactly the shape of component where that gets forgotten. An entry with no icon still renders,\n * as a neutral placeholder glyph, so a half-authored screen shows a gap rather than an invisible control.\n *\n * What it deliberately does not carry over from the v10 `Dock`: there is no magnification of the icon under\n * the pointer, which was the component's signature effect and is pure decoration; there are no tooltips\n * beyond the browser's own `title`; and item templates are not supported.\n */\nexport function Dock({ items = [], position = DockPosition.Bottom, ...rest }: DockProps) {\n const vertical = position === DockPosition.Left || position === DockPosition.Right;\n\n return (\n <div\n {...rest}\n role='toolbar'\n aria-orientation={vertical ? 'vertical' : 'horizontal'}\n className={vertical ? 'flex flex-col items-center gap-2 p-3' : 'flex items-center gap-2 p-3'}\n style={{ ...dockStyle, ...anchor(position) }}>\n {items.map((item, index) =>\n item.url === undefined ? (\n <button\n key={index}\n type='button'\n style={entryStyle}\n disabled={item.disabled}\n title={item.label}\n aria-label={item.label}\n onClick={() => item.command?.()}>\n <i className={item.icon ?? 'pi pi-circle'} aria-hidden='true' />\n </button>\n ) : (\n <a key={index} href={item.url} style={entryStyle} title={item.label} aria-label={item.label}>\n <i className={item.icon ?? 'pi pi-circle'} aria-hidden='true' />\n </a>\n )\n )}\n </div>\n );\n}\n"],"names":["dockStyle","position","background","border","borderRadius","color","entryStyle","cursor","font","fontSize","lineHeight","textDecoration","anchor","DockPosition","Top","top","left","transform","Left","Right","right","bottom","Dock","items","Bottom","rest","vertical","_jsx","div","role","aria-orientation","className","style","map","item","index","url","undefined","button","type","disabled","title","label","aria-label","onClick","command","i","icon","aria-hidden","a","href"],"mappings":";;;;;AAAA;AACA;AAMA,MAAMA,SAAAA,GAA2B;IAC7BC,QAAAA,EAAU,UAAA;IACVC,UAAAA,EAAY,8BAAA;IACZC,MAAAA,EAAQ,uCAAA;IACRC,YAAAA,EAAc,oCAAA;IACdC,KAAAA,EAAO;AACX,CAAA;AAEA,MAAMC,UAAAA,GAA4B;IAC9BJ,UAAAA,EAAY,aAAA;IACZC,MAAAA,EAAQ,MAAA;IACRE,KAAAA,EAAO,SAAA;IACPE,MAAAA,EAAQ,SAAA;IACRC,IAAAA,EAAM,SAAA;IACNC,QAAAA,EAAU,QAAA;IACVC,UAAAA,EAAY,CAAA;IACZC,cAAAA,EAAgB;AACpB,CAAA;AAE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AA,CAAKE,GAAG,KAAKC,SAAAA,iBACTV,cAAA,CAACW,QAAAA,EAAAA;gBAEGC,IAAAA,EAAK,QAAA;gBACLP,KAAAA,EAAO1B,UAAAA;AACPkC,gBAAAA,QAAAA,EAAUN,KAAKM,QAAQ;AACvBC,gBAAAA,KAAAA,EAAOP,KAAKQ,KAAK;AACjBC,gBAAAA,YAAAA,EAAYT,KAAKQ,KAAK;gBACtBE,OAAAA,EAAS,IAAMV,KAAKW,OAAO,IAAA;AAC3B,gBAAA,QAAA,gBAAAlB,cAAA,CAACmB,GAAAA,EAAAA;oBAAEf,SAAAA,EAAWG,IAAAA,CAAKa,IAAI,IAAI,cAAA;oBAAgBC,aAAAA,EAAY;;AAPlDb,aAAAA,EAAAA,KAAAA,CAAAA,iBAUTR,cAAA,CAACsB,GAAAA,EAAAA;AAAcC,gBAAAA,IAAAA,EAAMhB,KAAKE,GAAG;gBAAEJ,KAAAA,EAAO1B,UAAAA;AAAYmC,gBAAAA,KAAAA,EAAOP,KAAKQ,KAAK;AAAEC,gBAAAA,YAAAA,EAAYT,KAAKQ,KAAK;AACvF,gBAAA,QAAA,gBAAAf,cAAA,CAACmB,GAAAA,EAAAA;oBAAEf,SAAAA,EAAWG,IAAAA,CAAKa,IAAI,IAAI,cAAA;oBAAgBC,aAAAA,EAAY;;AADnDb,aAAAA,EAAAA,KAAAA,CAAAA;;AAO5B
|
|
1
|
+
{"version":3,"file":"Dock.js","sources":["../../../menu/Dock.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 { CSSProperties, HTMLAttributes } from 'react';\nimport { MenuItem } from '../MenuItem';\nimport { DockPosition } from './DockPosition';\n\nconst dockStyle: CSSProperties = {\n position: 'absolute',\n background: 'var(--scene-surface-overlay)',\n border: '1px solid var(--scene-surface-border)',\n borderRadius: 'var(--scene-content-border-radius)',\n color: 'var(--scene-text-color)',\n};\n\nconst entryStyle: CSSProperties = {\n background: 'transparent',\n border: 'none',\n color: 'inherit',\n cursor: 'pointer',\n font: 'inherit',\n fontSize: '1.5rem',\n lineHeight: 1,\n textDecoration: 'none',\n};\n\n/**\n * Where the dock sits within its container, for one edge.\n *\n * The offset lives here rather than in four CSS classes because this package ships no component\n * stylesheets, and because the two axes are genuinely coupled: an edge decides both which side is pinned\n * and which axis is centered, so writing them together is what keeps them consistent.\n */\nfunction anchor(position: DockPosition): CSSProperties {\n switch (position) {\n case DockPosition.Top:\n return { top: 0, left: '50%', transform: 'translateX(-50%)' };\n case DockPosition.Left:\n return { left: 0, top: '50%', transform: 'translateY(-50%)' };\n case DockPosition.Right:\n return { right: 0, top: '50%', transform: 'translateY(-50%)' };\n default:\n return { bottom: 0, left: '50%', transform: 'translateX(-50%)' };\n }\n}\n\n/**\n * The configuration {@link Dock} takes.\n */\nexport interface DockProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * The entries to show. Each is shown as its icon alone, with its label as the accessible name.\n */\n items?: MenuItem[];\n\n /**\n * The edge of the containing box to anchor against.\n */\n position?: DockPosition;\n}\n\n/**\n * A small strip of icons anchored to one edge of its container. Cratis-owned.\n *\n * This exists because PrimeReact 11 removed `primereact/dock` outright, with no successor and no headless\n * hook. It positions itself absolutely, so it expects a positioned container to sit in - dropped straight\n * into a page it would pin itself to the page, which is why the Scene adapter wraps it in a sized relative\n * box.\n *\n * Entries are icon-only, and that is precisely why each one carries its label as `aria-label` and as a\n * `title`: a control whose only content is a decorative glyph has no accessible name at all otherwise, and\n * a dock is exactly the shape of component where that gets forgotten. An entry with no icon still renders,\n * as a neutral placeholder glyph, so a half-authored screen shows a gap rather than an invisible control.\n *\n * What it deliberately does not carry over from the v10 `Dock`: there is no magnification of the icon under\n * the pointer, which was the component's signature effect and is pure decoration; there are no tooltips\n * beyond the browser's own `title`; and item templates are not supported.\n */\nexport function Dock({ items = [], position = DockPosition.Bottom, ...rest }: DockProps) {\n const vertical = position === DockPosition.Left || position === DockPosition.Right;\n\n return (\n <div\n {...rest}\n role='toolbar'\n aria-orientation={vertical ? 'vertical' : 'horizontal'}\n className={vertical ? 'flex flex-col items-center gap-2 p-3' : 'flex items-center gap-2 p-3'}\n style={{ ...dockStyle, ...anchor(position) }}>\n {items.map((item, index) =>\n item.url === undefined ? (\n <button\n key={index}\n type='button'\n style={entryStyle}\n disabled={item.disabled}\n title={item.label}\n aria-label={item.label}\n onClick={() => item.command?.()}>\n <i className={item.icon ?? 'pi pi-circle'} aria-hidden='true' />\n </button>\n ) : (\n <a key={index} href={item.url} style={entryStyle} title={item.label} aria-label={item.label}>\n <i className={item.icon ?? 'pi pi-circle'} aria-hidden='true' />\n </a>\n )\n )}\n </div>\n );\n}\n"],"names":["dockStyle","position","background","border","borderRadius","color","entryStyle","cursor","font","fontSize","lineHeight","textDecoration","anchor","DockPosition","Top","top","left","transform","Left","Right","right","bottom","Dock","items","Bottom","rest","vertical","_jsx","div","role","aria-orientation","className","style","map","item","index","url","undefined","button","type","disabled","title","label","aria-label","onClick","command","i","icon","aria-hidden","a","href"],"mappings":";;;;;AAAA;AACA;AAMA,MAAMA,SAAAA,GAA2B;IAC7BC,QAAAA,EAAU,UAAA;IACVC,UAAAA,EAAY,8BAAA;IACZC,MAAAA,EAAQ,uCAAA;IACRC,YAAAA,EAAc,oCAAA;IACdC,KAAAA,EAAO;AACX,CAAA;AAEA,MAAMC,UAAAA,GAA4B;IAC9BJ,UAAAA,EAAY,aAAA;IACZC,MAAAA,EAAQ,MAAA;IACRE,KAAAA,EAAO,SAAA;IACPE,MAAAA,EAAQ,SAAA;IACRC,IAAAA,EAAM,SAAA;IACNC,QAAAA,EAAU,QAAA;IACVC,UAAAA,EAAY,CAAA;IACZC,cAAAA,EAAgB;AACpB,CAAA;AAEA;;;;;;IAOA,SAASC,OAAOX,QAAsB,EAAA;IAClC,OAAQA,QAAAA;AACJ,QAAA,KAAKY,0BAAaC,GAAG;YACjB,OAAO;gBAAEC,GAAAA,EAAK,CAAA;gBAAGC,IAAAA,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N,KAAKM,QAAQ;AACvBC,gBAAAA,KAAAA,EAAOP,KAAKQ,KAAK;AACjBC,gBAAAA,YAAAA,EAAYT,KAAKQ,KAAK;gBACtBE,OAAAA,EAAS,IAAMV,KAAKW,OAAO,IAAA;AAC3B,gBAAA,QAAA,gBAAAlB,cAAA,CAACmB,GAAAA,EAAAA;oBAAEf,SAAAA,EAAWG,IAAAA,CAAKa,IAAI,IAAI,cAAA;oBAAgBC,aAAAA,EAAY;;AAPlDb,aAAAA,EAAAA,KAAAA,CAAAA,iBAUTR,cAAA,CAACsB,GAAAA,EAAAA;AAAcC,gBAAAA,IAAAA,EAAMhB,KAAKE,GAAG;gBAAEJ,KAAAA,EAAO1B,UAAAA;AAAYmC,gBAAAA,KAAAA,EAAOP,KAAKQ,KAAK;AAAEC,gBAAAA,YAAAA,EAAYT,KAAKQ,KAAK;AACvF,gBAAA,QAAA,gBAAAf,cAAA,CAACmB,GAAAA,EAAAA;oBAAEf,SAAAA,EAAWG,IAAAA,CAAKa,IAAI,IAAI,cAAA;oBAAgBC,aAAAA,EAAY;;AADnDb,aAAAA,EAAAA,KAAAA,CAAAA;;AAO5B;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DockPosition.js","sources":["../../../menu/DockPosition.ts"],"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\n/**\n * The edge a {@link Dock} is anchored to.\n *\n * This is an enum rather than a union of string literals so the four edges are discoverable from the type\n * itself and a `switch` over them stays exhaustive: adding a fifth edge becomes a compile error at every\n * place that maps an edge onto a position, instead of a silently missing case. The values are the same\n * lowercase words a screen authors, so an authored `position` maps straight onto a member.\n */\nexport enum DockPosition {\n /**\n * Anchored to the top edge, laid out across.\n */\n Top = 'top',\n\n /**\n * Anchored to the bottom edge, laid out across. The macOS-style default.\n */\n Bottom = 'bottom',\n\n /**\n * Anchored to the left edge, laid out down.\n */\n Left = 'left',\n\n /**\n * Anchored to the right edge, laid out down.\n */\n Right = 'right',\n}\n"],"names":["DockPosition"],"mappings":";;AAAA;AACA;AAEA;;;;;;;IAQO,IAAKA,YAAAA,iBAAAA,SAAAA,YAAAA,EAAAA;AACR;;AAEC,QAAA,YAAA,CAAA,KAAA,CAAA,GAAA,KAAA;AAGD;;AAEC,QAAA,YAAA,CAAA,QAAA,CAAA,GAAA,QAAA;AAGD;;AAEC,QAAA,YAAA,CAAA,MAAA,CAAA,GAAA,MAAA;AAGD;;AAEC,QAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAA;AAlBOA,IAAAA,OAAAA,YAAAA;AAoBX,CAAA,CAAA,EAAA
|
|
1
|
+
{"version":3,"file":"DockPosition.js","sources":["../../../menu/DockPosition.ts"],"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\n/**\n * The edge a {@link Dock} is anchored to.\n *\n * This is an enum rather than a union of string literals so the four edges are discoverable from the type\n * itself and a `switch` over them stays exhaustive: adding a fifth edge becomes a compile error at every\n * place that maps an edge onto a position, instead of a silently missing case. The values are the same\n * lowercase words a screen authors, so an authored `position` maps straight onto a member.\n */\nexport enum DockPosition {\n /**\n * Anchored to the top edge, laid out across.\n */\n Top = 'top',\n\n /**\n * Anchored to the bottom edge, laid out across. The macOS-style default.\n */\n Bottom = 'bottom',\n\n /**\n * Anchored to the left edge, laid out down.\n */\n Left = 'left',\n\n /**\n * Anchored to the right edge, laid out down.\n */\n Right = 'right',\n}\n"],"names":["DockPosition"],"mappings":";;AAAA;AACA;AAEA;;;;;;;IAQO,IAAKA,YAAAA,iBAAAA,SAAAA,YAAAA,EAAAA;AACR;;AAEC,QAAA,YAAA,CAAA,KAAA,CAAA,GAAA,KAAA;AAGD;;AAEC,QAAA,YAAA,CAAA,QAAA,CAAA,GAAA,QAAA;AAGD;;AAEC,QAAA,YAAA,CAAA,MAAA,CAAA,GAAA,MAAA;AAGD;;AAEC,QAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAA;AAlBOA,IAAAA,OAAAA,YAAAA;AAoBX,CAAA,CAAA,EAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MegaMenu.js","sources":["../../../menu/MegaMenu.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 { CSSProperties, HTMLAttributes, useEffect, useState } from 'react';\nimport { MenuItem } from '../MenuItem';\nimport { MenuItemAction } from './MenuItemAction';\nimport { MenuItemContent } from './MenuItemContent';\n\nconst barStyle: CSSProperties = {\n background: 'var(--scene-surface-card)',\n border: '1px solid var(--scene-surface-border)',\n borderRadius: 'var(--scene-content-border-radius)',\n color: 'var(--scene-text-color)',\n};\n\nconst triggerStyle: CSSProperties = {\n background: 'transparent',\n border: 'none',\n color: 'inherit',\n cursor: 'pointer',\n font: 'inherit',\n textDecoration: 'none',\n};\n\nconst panelStyle: CSSProperties = {\n position: 'absolute',\n top: '100%',\n left: 0,\n zIndex: 1,\n background: 'var(--scene-surface-overlay)',\n border: '1px solid var(--scene-surface-border)',\n borderRadius: 'var(--scene-content-border-radius)',\n};\n\nconst columnHeadingStyle: CSSProperties = { color: 'var(--scene-text-muted-color)' };\n\nconst columnItemStyle: CSSProperties = { ...triggerStyle, width: '100%', textAlign: 'left' };\n\n/**\n * The configuration {@link MegaMenu} takes.\n */\nexport interface MegaMenuProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * The commands to show. Each top-level entry's children are the columns of its panel, and each\n * column's own children are the commands in that column.\n */\n items?: MenuItem[];\n}\n\n/**\n * A horizontal bar whose panels lay their commands out in labeled columns. Cratis-owned.\n *\n * This exists because PrimeReact 11 removed `primereact/megamenu` outright, with no successor and no\n * headless hook, so a screen that authored a mega menu had nothing left to render. It is a separate\n * component from {@link Menubar} rather than a flag on it because the two read genuinely different item\n * models - a menubar's children are commands, a mega menu's children are columns - and collapsing that\n * into a boolean would make both harder to read than keeping them apart.\n *\n * The column model is where this deliberately departs from v10. PrimeReact 10 spelled columns as an array\n * of arrays, so an entry's `items` held column groups rather than menu entries. Scene's item reader\n * follows nested *objects* and drops nested arrays, which means that shape never reached the component\n * intact anyway. Columns are therefore one ordinary level of nesting here: an entry's children are\n * columns, and a column's children are its commands. The same authored model now survives the reader.\n *\n * What it otherwise does not carry over from v10: there is no vertical orientation, so the `orientation`\n * property a v10 screen may have set is ignored rather than half-honored; panels open on click only,\n * never on hover; and item templates are not supported.\n */\nexport function MegaMenu({ items = [], ...rest }: MegaMenuProps) {\n const [openIndex, setOpenIndex] = useState<number | undefined>(undefined);\n\n useEffect(() => {\n const close = () => setOpenIndex(undefined);\n document.addEventListener('click', close);\n return () => document.removeEventListener('click', close);\n }, []);\n\n return (\n <div\n {...rest}\n role='menubar'\n className='relative flex items-center gap-2 p-3'\n style={barStyle}\n onKeyDown={(event) => {\n if (event.key === 'Escape') setOpenIndex(undefined);\n }}>\n {items.map((item, index) => {\n const columns = item.items ?? [];\n\n return (\n <div key={index} role='none' className='relative'>\n {columns.length > 0 ? (\n <>\n <button\n type='button'\n role='menuitem'\n className='inline-flex items-center gap-2'\n style={triggerStyle}\n disabled={item.disabled}\n aria-haspopup='true'\n aria-expanded={openIndex === index}\n onClick={(event) => {\n event.stopPropagation();\n setOpenIndex(openIndex === index ? undefined : index);\n }}>\n <MenuItemContent item={item} />\n <i className='pi pi-angle-down' aria-hidden='true' />\n </button>\n {openIndex === index && (\n <div role='menu' aria-label={item.label} className='flex gap-4 p-3' style={panelStyle}>\n {columns.map((column, columnIndex) => (\n <div key={columnIndex} role='group' aria-label={column.label} className='flex flex-col gap-1'>\n <span className='text-sm font-semibold' style={columnHeadingStyle}>\n {column.label}\n </span>\n {(column.items ?? []).map((child, childIndex) => (\n <MenuItemAction\n key={childIndex}\n item={child}\n role='menuitem'\n className='flex items-center gap-2'\n style={columnItemStyle}\n />\n ))}\n </div>\n ))}\n </div>\n )}\n </>\n ) : (\n <MenuItemAction item={item} role='menuitem' className='inline-flex items-center gap-2' style={triggerStyle} />\n )}\n </div>\n );\n })}\n </div>\n );\n}\n"],"names":["barStyle","background","border","borderRadius","color","triggerStyle","cursor","font","textDecoration","panelStyle","position","top","left","zIndex","columnHeadingStyle","columnItemStyle","width","textAlign","MegaMenu","items","rest","openIndex","setOpenIndex","useState","undefined","useEffect","close","document","addEventListener","removeEventListener","_jsx","div","role","className","style","onKeyDown","event","key","map","item","index","columns","length","_jsxs","_Fragment","button","type","disabled","aria-haspopup","aria-expanded","onClick","stopPropagation","MenuItemContent","i","aria-hidden","aria-label","label","column","columnIndex","span","child","childIndex","MenuItemAction"],"mappings":";;;;;;;AAQA,MAAMA,QAAAA,GAA0B;IAC5BC,UAAAA,EAAY,2BAAA;IACZC,MAAAA,EAAQ,uCAAA;IACRC,YAAAA,EAAc,oCAAA;IACdC,KAAAA,EAAO;AACX,CAAA;AAEA,MAAMC,YAAAA,GAA8B;IAChCJ,UAAAA,EAAY,aAAA;IACZC,MAAAA,EAAQ,MAAA;IACRE,KAAAA,EAAO,SAAA;IACPE,MAAAA,EAAQ,SAAA;IACRC,IAAAA,EAAM,SAAA;IACNC,cAAAA,EAAgB;AACpB,CAAA;AAEA,MAAMC,UAAAA,GAA4B;IAC9BC,QAAAA,EAAU,UAAA;IACVC,GAAAA,EAAK,MAAA;IACLC,IAAAA,EAAM,CAAA;IACNC,MAAAA,EAAQ,CAAA;IACRZ,UAAAA,EAAY,8BAAA;IACZC,MAAAA,EAAQ,uCAAA;IACRC,YAAAA,EAAc;AAClB,CAAA;AAEA,MAAMW,kBAAAA,GAAoC;IAAEV,KAAAA,EAAO;AAAgC,CAAA;AAEnF,MAAMW,eAAAA,GAAiC;AAAE,IAAA,GAAGV,YAAY;IAAEW,KAAAA,EAAO,MAAA;IAAQC,SAAAA,EAAW;AAAO,CAAA;AAa3F;;;;;;;;;;;;;;;;;;IAmBO,SAASC,QAAAA,CAAS,EAAEC,QAAQ,EAAE,EAAE,GA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,UAAAA,CAAAA;;AANPH,iCAAAA,EAAAA,WAAAA,CAAAA;;;mCAmB1B5B,cAAA,CAACgC,6BAAAA,EAAAA;oBAAevB,IAAAA,EAAMA,IAAAA;oBAAMP,IAAAA,EAAK,UAAA;oBAAWC,SAAAA,EAAU,gCAAA;oBAAiCC,KAAAA,EAAO7B;;AAxC5FmC,aAAAA,EAAAA,KAAAA,CAAAA;AA4ClB,QAAA,CAAA;;AAGZ;;;;"}
|
|
1
|
+
{"version":3,"file":"MegaMenu.js","sources":["../../../menu/MegaMenu.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 { CSSProperties, HTMLAttributes, useEffect, useState } from 'react';\nimport { MenuItem } from '../MenuItem';\nimport { MenuItemAction } from './MenuItemAction';\nimport { MenuItemContent } from './MenuItemContent';\n\nconst barStyle: CSSProperties = {\n background: 'var(--scene-surface-card)',\n border: '1px solid var(--scene-surface-border)',\n borderRadius: 'var(--scene-content-border-radius)',\n color: 'var(--scene-text-color)',\n};\n\nconst triggerStyle: CSSProperties = {\n background: 'transparent',\n border: 'none',\n color: 'inherit',\n cursor: 'pointer',\n font: 'inherit',\n textDecoration: 'none',\n};\n\nconst panelStyle: CSSProperties = {\n position: 'absolute',\n top: '100%',\n left: 0,\n zIndex: 1,\n background: 'var(--scene-surface-overlay)',\n border: '1px solid var(--scene-surface-border)',\n borderRadius: 'var(--scene-content-border-radius)',\n};\n\nconst columnHeadingStyle: CSSProperties = { color: 'var(--scene-text-muted-color)' };\n\nconst columnItemStyle: CSSProperties = { ...triggerStyle, width: '100%', textAlign: 'left' };\n\n/**\n * The configuration {@link MegaMenu} takes.\n */\nexport interface MegaMenuProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * The commands to show. Each top-level entry's children are the columns of its panel, and each\n * column's own children are the commands in that column.\n */\n items?: MenuItem[];\n}\n\n/**\n * A horizontal bar whose panels lay their commands out in labeled columns. Cratis-owned.\n *\n * This exists because PrimeReact 11 removed `primereact/megamenu` outright, with no successor and no\n * headless hook, so a screen that authored a mega menu had nothing left to render. It is a separate\n * component from {@link Menubar} rather than a flag on it because the two read genuinely different item\n * models - a menubar's children are commands, a mega menu's children are columns - and collapsing that\n * into a boolean would make both harder to read than keeping them apart.\n *\n * The column model is where this deliberately departs from v10. PrimeReact 10 spelled columns as an array\n * of arrays, so an entry's `items` held column groups rather than menu entries. Scene's item reader\n * follows nested *objects* and drops nested arrays, which means that shape never reached the component\n * intact anyway. Columns are therefore one ordinary level of nesting here: an entry's children are\n * columns, and a column's children are its commands. The same authored model now survives the reader.\n *\n * What it otherwise does not carry over from v10: there is no vertical orientation, so the `orientation`\n * property a v10 screen may have set is ignored rather than half-honored; panels open on click only,\n * never on hover; and item templates are not supported.\n */\nexport function MegaMenu({ items = [], ...rest }: MegaMenuProps) {\n const [openIndex, setOpenIndex] = useState<number | undefined>(undefined);\n\n useEffect(() => {\n const close = () => setOpenIndex(undefined);\n document.addEventListener('click', close);\n return () => document.removeEventListener('click', close);\n }, []);\n\n return (\n <div\n {...rest}\n role='menubar'\n className='relative flex items-center gap-2 p-3'\n style={barStyle}\n onKeyDown={(event) => {\n if (event.key === 'Escape') setOpenIndex(undefined);\n }}>\n {items.map((item, index) => {\n const columns = item.items ?? [];\n\n return (\n <div key={index} role='none' className='relative'>\n {columns.length > 0 ? (\n <>\n <button\n type='button'\n role='menuitem'\n className='inline-flex items-center gap-2'\n style={triggerStyle}\n disabled={item.disabled}\n aria-haspopup='true'\n aria-expanded={openIndex === index}\n onClick={(event) => {\n event.stopPropagation();\n setOpenIndex(openIndex === index ? undefined : index);\n }}>\n <MenuItemContent item={item} />\n <i className='pi pi-angle-down' aria-hidden='true' />\n </button>\n {openIndex === index && (\n <div role='menu' aria-label={item.label} className='flex gap-4 p-3' style={panelStyle}>\n {columns.map((column, columnIndex) => (\n <div key={columnIndex} role='group' aria-label={column.label} className='flex flex-col gap-1'>\n <span className='text-sm font-semibold' style={columnHeadingStyle}>\n {column.label}\n </span>\n {(column.items ?? []).map((child, childIndex) => (\n <MenuItemAction\n key={childIndex}\n item={child}\n role='menuitem'\n className='flex items-center gap-2'\n style={columnItemStyle}\n />\n ))}\n </div>\n ))}\n </div>\n )}\n </>\n ) : (\n <MenuItemAction item={item} role='menuitem' className='inline-flex items-center gap-2' style={triggerStyle} />\n )}\n </div>\n );\n })}\n </div>\n );\n}\n"],"names":["barStyle","background","border","borderRadius","color","triggerStyle","cursor","font","textDecoration","panelStyle","position","top","left","zIndex","columnHeadingStyle","columnItemStyle","width","textAlign","MegaMenu","items","rest","openIndex","setOpenIndex","useState","undefined","useEffect","close","document","addEventListener","removeEventListener","_jsx","div","role","className","style","onKeyDown","event","key","map","item","index","columns","length","_jsxs","_Fragment","button","type","disabled","aria-haspopup","aria-expanded","onClick","stopPropagation","MenuItemContent","i","aria-hidden","aria-label","label","column","columnIndex","span","child","childIndex","MenuItemAction"],"mappings":";;;;;;;AAQA,MAAMA,QAAAA,GAA0B;IAC5BC,UAAAA,EAAY,2BAAA;IACZC,MAAAA,EAAQ,uCAAA;IACRC,YAAAA,EAAc,oCAAA;IACdC,KAAAA,EAAO;AACX,CAAA;AAEA,MAAMC,YAAAA,GAA8B;IAChCJ,UAAAA,EAAY,aAAA;IACZC,MAAAA,EAAQ,MAAA;IACRE,KAAAA,EAAO,SAAA;IACPE,MAAAA,EAAQ,SAAA;IACRC,IAAAA,EAAM,SAAA;IACNC,cAAAA,EAAgB;AACpB,CAAA;AAEA,MAAMC,UAAAA,GAA4B;IAC9BC,QAAAA,EAAU,UAAA;IACVC,GAAAA,EAAK,MAAA;IACLC,IAAAA,EAAM,CAAA;IACNC,MAAAA,EAAQ,CAAA;IACRZ,UAAAA,EAAY,8BAAA;IACZC,MAAAA,EAAQ,uCAAA;IACRC,YAAAA,EAAc;AAClB,CAAA;AAEA,MAAMW,kBAAAA,GAAoC;IAAEV,KAAAA,EAAO;AAAgC,CAAA;AAEnF,MAAMW,eAA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AAA,iBAC9B/B,cAAA,CAACgC,6BAAAA,EAAAA;gDAEGvB,IAAAA,EAAMqB,KAAAA;gDACN5B,IAAAA,EAAK,UAAA;gDACLC,SAAAA,EAAU,yBAAA;gDACVC,KAAAA,EAAOnB;AAJF8C,6CAAAA,EAAAA,UAAAA,CAAAA;;AANPH,iCAAAA,EAAAA,WAAAA,CAAAA;;;mCAmB1B5B,cAAA,CAACgC,6BAAAA,EAAAA;oBAAevB,IAAAA,EAAMA,IAAAA;oBAAMP,IAAAA,EAAK,UAAA;oBAAWC,SAAAA,EAAU,gCAAA;oBAAiCC,KAAAA,EAAO7B;;AAxC5FmC,aAAAA,EAAAA,KAAAA,CAAAA;AA4ClB,QAAA,CAAA;;AAGZ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItemAction.js","sources":["../../../menu/MenuItemAction.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 { AriaRole, CSSProperties } from 'react';\nimport { MenuItem } from '../MenuItem';\nimport { MenuItemContent } from './MenuItemContent';\n\n/**\n * The configuration {@link MenuItemAction} takes.\n */\nexport interface MenuItemActionProps {\n /**\n * The entry to make selectable.\n */\n item: MenuItem;\n\n /**\n * The ARIA role the entry plays inside its container - `menuitem` inside a menu, left unset inside a\n * plain navigation bar where the surrounding markup already says what the entry is.\n */\n role?: AriaRole;\n\n /**\n * Whether this entry is the one the user is currently on, which is announced as `aria-current`.\n */\n current?: boolean;\n\n /**\n * Classes for the entry, so each menu can keep its own layout while sharing this behavior.\n */\n className?: string;\n\n /**\n * Inline styling for the entry. This package ships no component stylesheets - a `.css` import would\n * not survive the `tsc` build - so chrome that cannot be expressed with the shared utility classes is\n * written here.\n */\n style?: CSSProperties;\n\n /**\n * Invoked after the entry's own `command`, so a menu can close itself or record a selection.\n */\n onActivate?: () => void;\n}\n\n/**\n * One selectable menu entry, rendered as a link when it navigates and as a button when it commands.\n *\n * The distinction is not cosmetic and it is the reason this is shared rather than repeated. An entry\n * carrying a `url` is navigation: it belongs in an anchor so it can be opened in a new tab, copied,\n * followed by a screen reader's link list and reached the way every other link on the page is. An entry\n * carrying a `command` changes something on the current screen, which is what a button is for. Getting\n * that wrong is invisible to a sighted mouse user and immediately wrong for everyone else, so the five\n * Cratis-owned menus that need a selectable entry all defer the choice to here.\n *\n * A disabled entry is always a button, even when it has a `url`, because there is no way to disable an\n * anchor - `aria-disabled` still leaves it clickable and focusable. Rendering the button lets the\n * platform's own disabled semantics do the work.\n */\nexport function MenuItemAction({ item, role, current, className, style, onActivate }: MenuItemActionProps) {\n const activate = () => {\n item.command?.();\n onActivate?.();\n };\n\n if (item.url !== undefined && item.disabled !== true) {\n return (\n <a\n href={item.url}\n role={role}\n className={className}\n style={style}\n aria-current={current === true ? 'page' : undefined}\n onClick={activate}>\n <MenuItemContent item={item} />\n </a>\n );\n }\n\n return (\n <button\n type='button'\n role={role}\n className={className}\n style={style}\n disabled={item.disabled}\n aria-current={current === true ? 'page' : undefined}\n onClick={activate}>\n <MenuItemContent item={item} />\n </button>\n );\n}\n"],"names":["MenuItemAction","item","role","current","className","style","onActivate","activate","command","url","undefined","disabled","_jsx","a","href","aria-current","onClick","MenuItemContent","button","type"],"mappings":";;;;;AAAA;AACA;AA4CA;;;;;;;;;;;;;AAaC,IACM,SAASA,cAAAA,CAAe,EAAEC,IAAI,EAAEC,IAAI,EAAEC,OAAO,EAAEC,SAAS,EAAEC,KAAK,EAAEC,UAAU,EAAuB,EAAA;AACrG,IAAA,MAAMC,QAAAA,GAAW,IAAA;AACbN,QAAAA,IAAAA,CAAKO,OAAO,IAAA;AACZF,QAAAA,UAAAA,IAAAA;AACJ,IAAA,CAAA;AAEA,IAAA,IAAIL,KAAKQ,GAAG,KAAKC,aAAaT,IAAAA,CAAKU,QAAQ,KAAK,IAAA,EAAM;AAClD,QAAA,qBACIC,cAAA,CAACC,GAAAA,EAAAA;AACGC,YAAAA,IAAAA,EAAMb,KAAKQ,GAAG;YACdP,IAAAA,EAAMA,IAAAA;YACNE,SAAAA,EAAWA,SAAAA;YACXC,KAAAA,EAAOA,KAAAA;YACPU,cAAAA,EAAcZ,OAAAA,KAAY,OAAO,MAAA,GAASO,SAAAA;YAC1CM,OAAAA,EAAST,QAAAA;AACT,YAAA,QAAA,gBAAAK,cAAA,CAACK,+BAAAA,EAAAA;gBAAgBhB,IAAAA,EAAMA;;;AAGnC,IAAA;AAEA,IAAA,qBACIW,cAAA,CAACM,QAAAA,EAAAA;QACGC,IAAAA,EAAK,QAAA;QACLjB,IAAAA,EAAMA,IAAAA;QACNE,SAAAA,EAAWA,SAAAA;QACXC,KAAAA,EAAOA,KAAAA;AACPM,QAAAA,QAAAA,EAAUV,KAAKU,QAAQ;QACvBI,cAAAA,EAAcZ,OAAAA,KAAY,OAAO,MAAA,GAASO,SAAAA;QAC1CM,OAAAA,EAAST,QAAAA;AACT,QAAA,QAAA,gBAAAK,cAAA,CAACK,+BAAAA,EAAAA;YAAgBhB,IAAAA,EAAMA;;;AAGnC
|
|
1
|
+
{"version":3,"file":"MenuItemAction.js","sources":["../../../menu/MenuItemAction.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 { AriaRole, CSSProperties } from 'react';\nimport { MenuItem } from '../MenuItem';\nimport { MenuItemContent } from './MenuItemContent';\n\n/**\n * The configuration {@link MenuItemAction} takes.\n */\nexport interface MenuItemActionProps {\n /**\n * The entry to make selectable.\n */\n item: MenuItem;\n\n /**\n * The ARIA role the entry plays inside its container - `menuitem` inside a menu, left unset inside a\n * plain navigation bar where the surrounding markup already says what the entry is.\n */\n role?: AriaRole;\n\n /**\n * Whether this entry is the one the user is currently on, which is announced as `aria-current`.\n */\n current?: boolean;\n\n /**\n * Classes for the entry, so each menu can keep its own layout while sharing this behavior.\n */\n className?: string;\n\n /**\n * Inline styling for the entry. This package ships no component stylesheets - a `.css` import would\n * not survive the `tsc` build - so chrome that cannot be expressed with the shared utility classes is\n * written here.\n */\n style?: CSSProperties;\n\n /**\n * Invoked after the entry's own `command`, so a menu can close itself or record a selection.\n */\n onActivate?: () => void;\n}\n\n/**\n * One selectable menu entry, rendered as a link when it navigates and as a button when it commands.\n *\n * The distinction is not cosmetic and it is the reason this is shared rather than repeated. An entry\n * carrying a `url` is navigation: it belongs in an anchor so it can be opened in a new tab, copied,\n * followed by a screen reader's link list and reached the way every other link on the page is. An entry\n * carrying a `command` changes something on the current screen, which is what a button is for. Getting\n * that wrong is invisible to a sighted mouse user and immediately wrong for everyone else, so the five\n * Cratis-owned menus that need a selectable entry all defer the choice to here.\n *\n * A disabled entry is always a button, even when it has a `url`, because there is no way to disable an\n * anchor - `aria-disabled` still leaves it clickable and focusable. Rendering the button lets the\n * platform's own disabled semantics do the work.\n */\nexport function MenuItemAction({ item, role, current, className, style, onActivate }: MenuItemActionProps) {\n const activate = () => {\n item.command?.();\n onActivate?.();\n };\n\n if (item.url !== undefined && item.disabled !== true) {\n return (\n <a\n href={item.url}\n role={role}\n className={className}\n style={style}\n aria-current={current === true ? 'page' : undefined}\n onClick={activate}>\n <MenuItemContent item={item} />\n </a>\n );\n }\n\n return (\n <button\n type='button'\n role={role}\n className={className}\n style={style}\n disabled={item.disabled}\n aria-current={current === true ? 'page' : undefined}\n onClick={activate}>\n <MenuItemContent item={item} />\n </button>\n );\n}\n"],"names":["MenuItemAction","item","role","current","className","style","onActivate","activate","command","url","undefined","disabled","_jsx","a","href","aria-current","onClick","MenuItemContent","button","type"],"mappings":";;;;;AAAA;AACA;AA4CA;;;;;;;;;;;;;AAaC,IACM,SAASA,cAAAA,CAAe,EAAEC,IAAI,EAAEC,IAAI,EAAEC,OAAO,EAAEC,SAAS,EAAEC,KAAK,EAAEC,UAAU,EAAuB,EAAA;AACrG,IAAA,MAAMC,QAAAA,GAAW,IAAA;AACbN,QAAAA,IAAAA,CAAKO,OAAO,IAAA;AACZF,QAAAA,UAAAA,IAAAA;AACJ,IAAA,CAAA;AAEA,IAAA,IAAIL,KAAKQ,GAAG,KAAKC,aAAaT,IAAAA,CAAKU,QAAQ,KAAK,IAAA,EAAM;AAClD,QAAA,qBACIC,cAAA,CAACC,GAAAA,EAAAA;AACGC,YAAAA,IAAAA,EAAMb,KAAKQ,GAAG;YACdP,IAAAA,EAAMA,IAAAA;YACNE,SAAAA,EAAWA,SAAAA;YACXC,KAAAA,EAAOA,KAAAA;YACPU,cAAAA,EAAcZ,OAAAA,KAAY,OAAO,MAAA,GAASO,SAAAA;YAC1CM,OAAAA,EAAST,QAAAA;AACT,YAAA,QAAA,gBAAAK,cAAA,CAACK,+BAAAA,EAAAA;gBAAgBhB,IAAAA,EAAMA;;;AAGnC,IAAA;AAEA,IAAA,qBACIW,cAAA,CAACM,QAAAA,EAAAA;QACGC,IAAAA,EAAK,QAAA;QACLjB,IAAAA,EAAMA,IAAAA;QACNE,SAAAA,EAAWA,SAAAA;QACXC,KAAAA,EAAOA,KAAAA;AACPM,QAAAA,QAAAA,EAAUV,KAAKU,QAAQ;QACvBI,cAAAA,EAAcZ,OAAAA,KAAY,OAAO,MAAA,GAASO,SAAAA;QAC1CM,OAAAA,EAAST,QAAAA;AACT,QAAA,QAAA,gBAAAK,cAAA,CAACK,+BAAAA,EAAAA;YAAgBhB,IAAAA,EAAMA;;;AAGnC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItemContent.js","sources":["../../../menu/MenuItemContent.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 { MenuItem } from '../MenuItem';\n\n/**\n * The configuration {@link MenuItemContent} takes.\n */\nexport interface MenuItemContentProps {\n /**\n * The entry whose icon and label to show.\n */\n item: MenuItem;\n}\n\n/**\n * The inside of one menu entry - its icon and its label - without the element that makes it selectable.\n *\n * Seven of the components in this folder are Cratis-owned replacements for menus PrimeReact 11 removed,\n * and each of them wraps an entry in a different element: a menubar puts it in a button, a tiered menu in\n * a list row, a dock in an icon-only control. What never differs is the inside, so it is written once\n * here instead of seven times, where six copies would eventually drift apart.\n *\n * Sharing it also settles one accessibility decision in a single place rather than repeatedly: the label\n * already carries the meaning, so the icon beside it is decoration and is hidden from assistive\n * technology. Left to each component, that is exactly the kind of detail one of them would quietly get\n * wrong.\n */\nexport function MenuItemContent({ item }: MenuItemContentProps) {\n return (\n <>\n {item.icon !== undefined && <i className={item.icon} aria-hidden='true' />}\n {item.label !== undefined && <span>{item.label}</span>}\n </>\n );\n}\n"],"names":["MenuItemContent","item","_jsxs","_Fragment","icon","undefined","_jsx","i","className","aria-hidden","label","span"],"mappings":";;;;AAAA;AACA;AAcA;;;;;;;;;;;;AAYC,IACM,SAASA,eAAAA,CAAgB,EAAEC,IAAI,EAAwB,EAAA;IAC1D,qBACIC,eAAA,CAAAC,mBAAA,EAAA;;YACKF,IAAAA,CAAKG,IAAI,KAAKC,SAAAA,kBAAaC,cAAA,CAACC,GAAAA,EAAAA;AAAEC,gBAAAA,SAAAA,EAAWP,KAAKG,IAAI;gBAAEK,aAAAA,EAAY;;YAChER,IAAAA,CAAKS,KAAK,KAAKL,SAAAA,kBAAaC,cAAA,CAACK,MAAAA,EAAAA;AAAMV,gBAAAA,QAAAA,EAAAA,IAAAA,CAAKS;;;;AAGrD
|
|
1
|
+
{"version":3,"file":"MenuItemContent.js","sources":["../../../menu/MenuItemContent.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 { MenuItem } from '../MenuItem';\n\n/**\n * The configuration {@link MenuItemContent} takes.\n */\nexport interface MenuItemContentProps {\n /**\n * The entry whose icon and label to show.\n */\n item: MenuItem;\n}\n\n/**\n * The inside of one menu entry - its icon and its label - without the element that makes it selectable.\n *\n * Seven of the components in this folder are Cratis-owned replacements for menus PrimeReact 11 removed,\n * and each of them wraps an entry in a different element: a menubar puts it in a button, a tiered menu in\n * a list row, a dock in an icon-only control. What never differs is the inside, so it is written once\n * here instead of seven times, where six copies would eventually drift apart.\n *\n * Sharing it also settles one accessibility decision in a single place rather than repeatedly: the label\n * already carries the meaning, so the icon beside it is decoration and is hidden from assistive\n * technology. Left to each component, that is exactly the kind of detail one of them would quietly get\n * wrong.\n */\nexport function MenuItemContent({ item }: MenuItemContentProps) {\n return (\n <>\n {item.icon !== undefined && <i className={item.icon} aria-hidden='true' />}\n {item.label !== undefined && <span>{item.label}</span>}\n </>\n );\n}\n"],"names":["MenuItemContent","item","_jsxs","_Fragment","icon","undefined","_jsx","i","className","aria-hidden","label","span"],"mappings":";;;;AAAA;AACA;AAcA;;;;;;;;;;;;AAYC,IACM,SAASA,eAAAA,CAAgB,EAAEC,IAAI,EAAwB,EAAA;IAC1D,qBACIC,eAAA,CAAAC,mBAAA,EAAA;;YACKF,IAAAA,CAAKG,IAAI,KAAKC,SAAAA,kBAAaC,cAAA,CAACC,GAAAA,EAAAA;AAAEC,gBAAAA,SAAAA,EAAWP,KAAKG,IAAI;gBAAEK,aAAAA,EAAY;;YAChER,IAAAA,CAAKS,KAAK,KAAKL,SAAAA,kBAAaC,cAAA,CAACK,MAAAA,EAAAA;AAAMV,gBAAAA,QAAAA,EAAAA,IAAAA,CAAKS;;;;AAGrD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menubar.js","sources":["../../../menu/Menubar.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 { CSSProperties, HTMLAttributes, ReactNode, useEffect, useState } from 'react';\nimport { MenuItem } from '../MenuItem';\nimport { MenuItemAction } from './MenuItemAction';\nimport { MenuItemContent } from './MenuItemContent';\n\nconst barStyle: CSSProperties = {\n background: 'var(--scene-surface-card)',\n border: '1px solid var(--scene-surface-border)',\n borderRadius: 'var(--scene-content-border-radius)',\n color: 'var(--scene-text-color)',\n};\n\nconst triggerStyle: CSSProperties = {\n background: 'transparent',\n border: 'none',\n color: 'inherit',\n cursor: 'pointer',\n font: 'inherit',\n textDecoration: 'none',\n};\n\nconst panelStyle: CSSProperties = {\n position: 'absolute',\n top: '100%',\n left: 0,\n zIndex: 1,\n minWidth: '12rem',\n background: 'var(--scene-surface-overlay)',\n border: '1px solid var(--scene-surface-border)',\n borderRadius: 'var(--scene-content-border-radius)',\n};\n\nconst panelItemStyle: CSSProperties = { ...triggerStyle, width: '100%', textAlign: 'left' };\n\nconst separatorStyle: CSSProperties = { border: 'none', borderTop: '1px solid var(--scene-surface-border)', margin: 0 };\n\n/**\n * The configuration {@link Menubar} takes.\n */\nexport interface MenubarProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * The commands to show, top level across the bar and one level of children in a dropdown.\n */\n items?: MenuItem[];\n\n /**\n * Content pinned before the commands - branding, in a real application.\n */\n start?: ReactNode;\n\n /**\n * Content pinned after the commands - account and status controls, in a real application.\n */\n end?: ReactNode;\n}\n\n/**\n * A horizontal bar of commands, each of which may drop down a panel of its children. Cratis-owned.\n *\n * This exists because PrimeReact 11 removed `primereact/menubar` outright, with no successor component\n * and no headless hook to rebuild it from - unlike `menu`, `breadcrumb` and `contextmenu`, which survived\n * as compositional part namespaces. Scene still has to render an element authored as a menubar, so the\n * component is Scene's now. It follows `ActionMenubar` in `@cratis/components`, which is the same answer\n * Cratis already reached for its own bar of actions after the v11 removal.\n *\n * What it deliberately does not carry over from the v10 `Menubar`: submenus nest exactly one level rather\n * than arbitrarily deep (author a `tieredMenu` when a third level is genuinely needed); panels open on\n * click only, never on hover; there is no responsive collapse to a hamburger at narrow widths; there is\n * no roving-focus keyboard model across the bar, only the tab order and Escape the browser and this\n * component give for free; and item templates are not supported, since a Scene item model has no place to\n * put a React node.\n *\n * A panel does close when the pointer goes elsewhere on the page. That is not a feature carried over so\n * much as the absence of a defect - a dropdown that survives a click on the rest of the screen is broken,\n * not minimal.\n */\nexport function Menubar({ items = [], start, end, ...rest }: MenubarProps) {\n const [openIndex, setOpenIndex] = useState<number | undefined>(undefined);\n\n useEffect(() => {\n const close = () => setOpenIndex(undefined);\n document.addEventListener('click', close);\n return () => document.removeEventListener('click', close);\n }, []);\n\n return (\n <div\n {...rest}\n className='relative flex items-center gap-2 p-3'\n style={barStyle}\n onKeyDown={(event) => {\n if (event.key === 'Escape') setOpenIndex(undefined);\n }}>\n {start}\n <div role='menubar' className='flex items-center gap-2'>\n {items.map((item, index) => {\n const children = item.items ?? [];\n\n return (\n <div key={index} role='none' className='relative'>\n {children.length > 0 ? (\n <>\n <button\n type='button'\n role='menuitem'\n className='inline-flex items-center gap-2'\n style={triggerStyle}\n disabled={item.disabled}\n aria-haspopup='true'\n aria-expanded={openIndex === index}\n onClick={(event) => {\n event.stopPropagation();\n setOpenIndex(openIndex === index ? undefined : index);\n }}>\n <MenuItemContent item={item} />\n <i className='pi pi-angle-down' aria-hidden='true' />\n </button>\n {openIndex === index && (\n <div role='menu' aria-label={item.label} className='flex flex-col' style={panelStyle}>\n {children.map((child, childIndex) =>\n child.separator === true ? (\n <hr key={childIndex} style={separatorStyle} />\n ) : (\n <MenuItemAction\n key={childIndex}\n item={child}\n role='menuitem'\n className='flex items-center gap-2 p-3'\n style={panelItemStyle}\n />\n )\n )}\n </div>\n )}\n </>\n ) : (\n <MenuItemAction item={item} role='menuitem' className='inline-flex items-center gap-2' style={triggerStyle} />\n )}\n </div>\n );\n })}\n </div>\n {end}\n </div>\n );\n}\n"],"names":["barStyle","background","border","borderRadius","color","triggerStyle","cursor","font","textDecoration","panelStyle","position","top","left","zIndex","minWidth","panelItemStyle","width","textAlign","separatorStyle","borderTop","margin","Menubar","items","start","end","rest","openIndex","setOpenIndex","useState","undefined","useEffect","close","document","addEventListener","removeEventListener","_jsxs","div","className","style","onKeyDown","event","key","_jsx","role","map","item","index","children","length","_Fragment","button","type","disabled","aria-haspopup","aria-expanded","onClick","stopPropagation","MenuItemContent","i","aria-hidden","aria-label","label","child","childIndex","separator","hr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AA,GAAYiB,KAAAA,CAAAA;AACnD,oCAAA,CAAA;;sDACAJ,cAAA,CAACe,+BAAAA,EAAAA;4CAAgBZ,IAAAA,EAAMA;;sDACvBH,cAAA,CAACgB,GAAAA,EAAAA;4CAAErB,SAAAA,EAAU,kBAAA;4CAAmBsB,aAAAA,EAAY;;;;AAE/CjC,gCAAAA,SAAAA,KAAcoB,uBACXJ,cAAA,CAACN,KAAAA,EAAAA;oCAAIO,IAAAA,EAAK,MAAA;AAAOiB,oCAAAA,YAAAA,EAAYf,KAAKgB,KAAK;oCAAExB,SAAAA,EAAU,eAAA;oCAAgBC,KAAAA,EAAO7B,UAAAA;8CACrEsC,QAAAA,CAASH,GAAG,CAAC,CAACkB,KAAAA,EAAOC,aAClBD,KAAAA,CAAME,SAAS,KAAK,IAAA,iBAChBtB,cAAA,CAACuB,IAAAA,EAAAA;4CAAoB3B,KAAAA,EAAOpB;AAAnB6C,yCAAAA,EAAAA,UAAAA,CAAAA,iBAETrB,cAAA,CAACwB,6BAAAA,EAAAA;4CAEGrB,IAAAA,EAAMiB,KAAAA;4CACNnB,IAAAA,EAAK,UAAA;4CACLN,SAAAA,EAAU,6BAAA;4CACVC,KAAAA,EAAOvB;AAJFgD,yCAAAA,EAAAA,UAAAA,CAAAA;;;2CAY7BrB,cAAA,CAACwB,6BAAAA,EAAAA;4BAAerB,IAAAA,EAAMA,IAAAA;4BAAMF,IAAAA,EAAK,UAAA;4BAAWN,SAAAA,EAAU,gCAAA;4BAAiCC,KAAAA,EAAOjC;;AArC5FyC,qBAAAA,EAAAA,KAAAA,CAAAA;AAyClB,gBAAA,CAAA;;AAEHtB,YAAAA;;;AAGb;;;;"}
|
|
1
|
+
{"version":3,"file":"Menubar.js","sources":["../../../menu/Menubar.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 { CSSProperties, HTMLAttributes, ReactNode, useEffect, useState } from 'react';\nimport { MenuItem } from '../MenuItem';\nimport { MenuItemAction } from './MenuItemAction';\nimport { MenuItemContent } from './MenuItemContent';\n\nconst barStyle: CSSProperties = {\n background: 'var(--scene-surface-card)',\n border: '1px solid var(--scene-surface-border)',\n borderRadius: 'var(--scene-content-border-radius)',\n color: 'var(--scene-text-color)',\n};\n\nconst triggerStyle: CSSProperties = {\n background: 'transparent',\n border: 'none',\n color: 'inherit',\n cursor: 'pointer',\n font: 'inherit',\n textDecoration: 'none',\n};\n\nconst panelStyle: CSSProperties = {\n position: 'absolute',\n top: '100%',\n left: 0,\n zIndex: 1,\n minWidth: '12rem',\n background: 'var(--scene-surface-overlay)',\n border: '1px solid var(--scene-surface-border)',\n borderRadius: 'var(--scene-content-border-radius)',\n};\n\nconst panelItemStyle: CSSProperties = { ...triggerStyle, width: '100%', textAlign: 'left' };\n\nconst separatorStyle: CSSProperties = { border: 'none', borderTop: '1px solid var(--scene-surface-border)', margin: 0 };\n\n/**\n * The configuration {@link Menubar} takes.\n */\nexport interface MenubarProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * The commands to show, top level across the bar and one level of children in a dropdown.\n */\n items?: MenuItem[];\n\n /**\n * Content pinned before the commands - branding, in a real application.\n */\n start?: ReactNode;\n\n /**\n * Content pinned after the commands - account and status controls, in a real application.\n */\n end?: ReactNode;\n}\n\n/**\n * A horizontal bar of commands, each of which may drop down a panel of its children. Cratis-owned.\n *\n * This exists because PrimeReact 11 removed `primereact/menubar` outright, with no successor component\n * and no headless hook to rebuild it from - unlike `menu`, `breadcrumb` and `contextmenu`, which survived\n * as compositional part namespaces. Scene still has to render an element authored as a menubar, so the\n * component is Scene's now. It follows `ActionMenubar` in `@cratis/components`, which is the same answer\n * Cratis already reached for its own bar of actions after the v11 removal.\n *\n * What it deliberately does not carry over from the v10 `Menubar`: submenus nest exactly one level rather\n * than arbitrarily deep (author a `tieredMenu` when a third level is genuinely needed); panels open on\n * click only, never on hover; there is no responsive collapse to a hamburger at narrow widths; there is\n * no roving-focus keyboard model across the bar, only the tab order and Escape the browser and this\n * component give for free; and item templates are not supported, since a Scene item model has no place to\n * put a React node.\n *\n * A panel does close when the pointer goes elsewhere on the page. That is not a feature carried over so\n * much as the absence of a defect - a dropdown that survives a click on the rest of the screen is broken,\n * not minimal.\n */\nexport function Menubar({ items = [], start, end, ...rest }: MenubarProps) {\n const [openIndex, setOpenIndex] = useState<number | undefined>(undefined);\n\n useEffect(() => {\n const close = () => setOpenIndex(undefined);\n document.addEventListener('click', close);\n return () => document.removeEventListener('click', close);\n }, []);\n\n return (\n <div\n {...rest}\n className='relative flex items-center gap-2 p-3'\n style={barStyle}\n onKeyDown={(event) => {\n if (event.key === 'Escape') setOpenIndex(undefined);\n }}>\n {start}\n <div role='menubar' className='flex items-center gap-2'>\n {items.map((item, index) => {\n const children = item.items ?? [];\n\n return (\n <div key={index} role='none' className='relative'>\n {children.length > 0 ? (\n <>\n <button\n type='button'\n role='menuitem'\n className='inline-flex items-center gap-2'\n style={triggerStyle}\n disabled={item.disabled}\n aria-haspopup='true'\n aria-expanded={openIndex === index}\n onClick={(event) => {\n event.stopPropagation();\n setOpenIndex(openIndex === index ? undefined : index);\n }}>\n <MenuItemContent item={item} />\n <i className='pi pi-angle-down' aria-hidden='true' />\n </button>\n {openIndex === index && (\n <div role='menu' aria-label={item.label} className='flex flex-col' style={panelStyle}>\n {children.map((child, childIndex) =>\n child.separator === true ? (\n <hr key={childIndex} style={separatorStyle} />\n ) : (\n <MenuItemAction\n key={childIndex}\n item={child}\n role='menuitem'\n className='flex items-center gap-2 p-3'\n style={panelItemStyle}\n />\n )\n )}\n </div>\n )}\n </>\n ) : (\n <MenuItemAction item={item} role='menuitem' className='inline-flex items-center gap-2' style={triggerStyle} />\n )}\n </div>\n );\n })}\n </div>\n {end}\n </div>\n );\n}\n"],"names":["barStyle","background","border","borderRadius","color","triggerStyle","cursor","font","textDecoration","panelStyle","position","top","left","zIndex","minWidth","panelItemStyle","width","textAlign","separatorStyle","borderTop","margin","Menubar","items","start","end","rest","openIndex","setOpenIndex","useState","undefined","useEffect","close","document","addEventListener","removeEventListener","_jsxs","div","className","style","onKeyDown","event","key","_jsx","role","map","item","index","children","length","_Fragment","button","type","disabled","aria-haspopup","aria-expanded","onClick","stopPropagation","MenuItemContent","i","aria-hidden","aria-label","label","child","childIndex","separator","hr","MenuItemAction"],"mappings":";;;;;;;AAQA,MAAMA,QAAAA,GAA0B;IAC5BC,UAAAA,EAAY,2BAAA;IACZC,MAAAA,EAAQ,uCAAA;IACRC,YAAAA,EAAc,oCAAA;IACdC,KAAAA,EAAO;AACX,CAAA;AAEA,MAAMC,YAAAA,GAA8B;IAChCJ,UAAAA,EAAY,aAAA;IACZC,MAAAA,EAAQ,MAAA;IACRE,KAAAA,EAAO,SAAA;IACPE,MAAAA,EAAQ,SAAA;IACRC,IAAAA,EAAM,SAAA;IACNC,cAAAA,EAAgB;AACpB,CAAA;AAEA,MAAMC,UAAAA,GAA4B;IAC9BC,QAAAA,EAAU,UAAA;IACVC,GAAAA,EAAK,MAAA;IACLC,IAAAA,EAAM,CAAA;IACNC,MAAAA,EAAQ,CAAA;IACRC,QAAAA,EAAU,OAAA;IACVb,UAAAA,EAAY,8BAAA;IACZC,MAAAA,EAAQ,uCAAA;IACRC,YAAAA,EAAc;AAClB,CAAA;AAEA,MAAMY,cAAAA,GAAgC;AAAE,IAAA,GAAGV,YAAY;IAAEW,KAAAA,EAAO,MAAA;IAAQC,SAAAA,EAAW;AAAO,CAAA;AAE1F,MAAMC,cAAAA,GAAgC;IAAEhB,MAAAA,EAAQ,MAAA;IAAQiB,SAAAA,EAAW,uCAAA;IAAyCC,MAAAA,EAAQ;AAAE,CAAA;AAsBtH;;;;;;;;;;;;;;;;;;;AAmBC,IACM,SAASC,OAAAA,CAAQ,EAAEC,KAAAA,GAAQ,EAAE,EAAEC,KAAK,EAAEC,GAAG,EAAE,GAAGC,IAAAA,EAAoB,EAAA;AACrE,IAAA,MAAM,CAACC,SAAAA,EAAWC,YAAAA,CAAa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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelMenu.js","sources":["../../../menu/PanelMenu.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 { CSSProperties, HTMLAttributes } from 'react';\nimport { Accordion } from 'primereact/accordion';\nimport { MenuItem } from '../MenuItem';\nimport { MenuItemAction } from './MenuItemAction';\nimport { MenuItemContent } from './MenuItemContent';\n\nconst rootStyle: CSSProperties = { color: 'var(--scene-text-color)', width: '16rem' };\n\nconst headerStyle: CSSProperties = {\n background: 'var(--scene-surface-card)',\n border: '1px solid var(--scene-surface-border)',\n borderRadius: 'var(--scene-content-border-radius)',\n color: 'inherit',\n cursor: 'pointer',\n font: 'inherit',\n justifyContent: 'space-between',\n textAlign: 'left',\n textDecoration: 'none',\n width: '100%',\n};\n\nconst listStyle: CSSProperties = { listStyle: 'none', margin: 0, padding: 0 };\n\nconst childStyle: CSSProperties = {\n background: 'transparent',\n border: 'none',\n color: 'inherit',\n cursor: 'pointer',\n font: 'inherit',\n textAlign: 'left',\n textDecoration: 'none',\n width: '100%',\n};\n\n/**\n * The configuration {@link PanelMenu} takes.\n *\n * `defaultValue` is omitted from the inherited attributes because the props are spread onto\n * `Accordion.Root`, which has a `defaultValue` of its own meaning \"the panels open to begin with\".\n * `HTMLAttributes` declares the form-control `defaultValue` (which includes `readonly string[]`), and the\n * two are not assignable. Dropping it is the honest resolution: a `<div>` has no default value, so nothing\n * is lost, and leaving both in scope would let a caller set one and silently get the other.\n */\nexport interface PanelMenuProps extends Omit<HTMLAttributes<HTMLDivElement>, 'defaultValue'> {\n /**\n * The commands to show. A top-level entry with children becomes an expandable panel; one without\n * stays a plain row.\n */\n items?: MenuItem[];\n\n /**\n * Whether more than one panel may be open at once.\n */\n multiple?: boolean;\n}\n\n/**\n * A vertical menu whose sections expand in place, accordion style. Cratis-owned.\n *\n * This exists because PrimeReact 11 removed `primereact/panelmenu` outright. Unlike the other removals in\n * this folder, though, the mechanism it needed did survive: `primereact/accordion` is exactly the\n * expand-collapse behavior a panel menu is, so this composes the v11 `Accordion` parts rather than\n * hand-rolling open state. That is worth doing rather than clever - the accordion already brings the\n * `aria-expanded` and `aria-controls` wiring between a trigger and its content, the disabled handling, and\n * the single-versus-multiple open policy, and every one of those is a thing a hand-rolled version would\n * get subtly wrong. What is Cratis's here is only the mapping from a Scene item model onto those parts.\n *\n * What it deliberately does not carry over from the v10 `PanelMenu`: sections expand exactly one level\n * deep rather than nesting arbitrarily, because an accordion panel holds content and not another\n * accordion; there is no keyboard model beyond the accordion's own; and item templates are not supported.\n */\nexport function PanelMenu({ items = [], multiple = false, ...rest }: PanelMenuProps) {\n return (\n <Accordion.Root {...rest} multiple={multiple} className='flex flex-col gap-1' style={rootStyle}>\n {items.map((item, index) => {\n const children = item.items ?? [];\n\n if (children.length === 0) return <MenuItemAction key={index} item={item} className='flex items-center gap-2 p-3' style={headerStyle} />;\n\n return (\n <Accordion.Panel key={index} value={String(index)} disabled={item.disabled}>\n <Accordion.Header>\n <Accordion.Trigger className='flex items-center gap-2 p-3' style={headerStyle}>\n <MenuItemContent item={item} />\n <Accordion.Indicator>\n <i className='pi pi-chevron-down' aria-hidden='true' />\n </Accordion.Indicator>\n </Accordion.Trigger>\n </Accordion.Header>\n <Accordion.Content>\n <ul role='menu' aria-label={item.label} style={listStyle}>\n {children.map((child, childIndex) => (\n <li key={childIndex} role='none'>\n <MenuItemAction item={child} role='menuitem' className='flex items-center gap-2 p-3' style={childStyle} />\n </li>\n ))}\n </ul>\n </Accordion.Content>\n </Accordion.Panel>\n );\n })}\n </Accordion.Root>\n );\n}\n"],"names":["rootStyle","color","width","headerStyle","background","border","borderRadius","cursor","font","justifyContent","textAlign","textDecoration","listStyle","margin","padding","childStyle","PanelMenu","items","multiple","rest","_jsx","Accordion","Root","className","style","map","item","index","children","length","MenuItemAction","_jsxs","Panel","value","String","disabled","Header","Trigger","MenuItemContent","Indicator","i","a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AA;wCAAWrB,SAAAA,EAAU,6BAAA;wCAA8BC,KAAAA,EAAOT;;AADvFiC,iCAAAA,EAAAA,UAAAA,CAAAA;;;;AAZHrB,aAAAA,EAAAA,KAAAA,CAAAA;AAoB9B,QAAA,CAAA;;AAGZ
|
|
1
|
+
{"version":3,"file":"PanelMenu.js","sources":["../../../menu/PanelMenu.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 { CSSProperties, HTMLAttributes } from 'react';\nimport { Accordion } from 'primereact/accordion';\nimport { MenuItem } from '../MenuItem';\nimport { MenuItemAction } from './MenuItemAction';\nimport { MenuItemContent } from './MenuItemContent';\n\nconst rootStyle: CSSProperties = { color: 'var(--scene-text-color)', width: '16rem' };\n\nconst headerStyle: CSSProperties = {\n background: 'var(--scene-surface-card)',\n border: '1px solid var(--scene-surface-border)',\n borderRadius: 'var(--scene-content-border-radius)',\n color: 'inherit',\n cursor: 'pointer',\n font: 'inherit',\n justifyContent: 'space-between',\n textAlign: 'left',\n textDecoration: 'none',\n width: '100%',\n};\n\nconst listStyle: CSSProperties = { listStyle: 'none', margin: 0, padding: 0 };\n\nconst childStyle: CSSProperties = {\n background: 'transparent',\n border: 'none',\n color: 'inherit',\n cursor: 'pointer',\n font: 'inherit',\n textAlign: 'left',\n textDecoration: 'none',\n width: '100%',\n};\n\n/**\n * The configuration {@link PanelMenu} takes.\n *\n * `defaultValue` is omitted from the inherited attributes because the props are spread onto\n * `Accordion.Root`, which has a `defaultValue` of its own meaning \"the panels open to begin with\".\n * `HTMLAttributes` declares the form-control `defaultValue` (which includes `readonly string[]`), and the\n * two are not assignable. Dropping it is the honest resolution: a `<div>` has no default value, so nothing\n * is lost, and leaving both in scope would let a caller set one and silently get the other.\n */\nexport interface PanelMenuProps extends Omit<HTMLAttributes<HTMLDivElement>, 'defaultValue'> {\n /**\n * The commands to show. A top-level entry with children becomes an expandable panel; one without\n * stays a plain row.\n */\n items?: MenuItem[];\n\n /**\n * Whether more than one panel may be open at once.\n */\n multiple?: boolean;\n}\n\n/**\n * A vertical menu whose sections expand in place, accordion style. Cratis-owned.\n *\n * This exists because PrimeReact 11 removed `primereact/panelmenu` outright. Unlike the other removals in\n * this folder, though, the mechanism it needed did survive: `primereact/accordion` is exactly the\n * expand-collapse behavior a panel menu is, so this composes the v11 `Accordion` parts rather than\n * hand-rolling open state. That is worth doing rather than clever - the accordion already brings the\n * `aria-expanded` and `aria-controls` wiring between a trigger and its content, the disabled handling, and\n * the single-versus-multiple open policy, and every one of those is a thing a hand-rolled version would\n * get subtly wrong. What is Cratis's here is only the mapping from a Scene item model onto those parts.\n *\n * What it deliberately does not carry over from the v10 `PanelMenu`: sections expand exactly one level\n * deep rather than nesting arbitrarily, because an accordion panel holds content and not another\n * accordion; there is no keyboard model beyond the accordion's own; and item templates are not supported.\n */\nexport function PanelMenu({ items = [], multiple = false, ...rest }: PanelMenuProps) {\n return (\n <Accordion.Root {...rest} multiple={multiple} className='flex flex-col gap-1' style={rootStyle}>\n {items.map((item, index) => {\n const children = item.items ?? [];\n\n if (children.length === 0) return <MenuItemAction key={index} item={item} className='flex items-center gap-2 p-3' style={headerStyle} />;\n\n return (\n <Accordion.Panel key={index} value={String(index)} disabled={item.disabled}>\n <Accordion.Header>\n <Accordion.Trigger className='flex items-center gap-2 p-3' style={headerStyle}>\n <MenuItemContent item={item} />\n <Accordion.Indicator>\n <i className='pi pi-chevron-down' aria-hidden='true' />\n </Accordion.Indicator>\n </Accordion.Trigger>\n </Accordion.Header>\n <Accordion.Content>\n <ul role='menu' aria-label={item.label} style={listStyle}>\n {children.map((child, childIndex) => (\n <li key={childIndex} role='none'>\n <MenuItemAction item={child} role='menuitem' className='flex items-center gap-2 p-3' style={childStyle} />\n </li>\n ))}\n </ul>\n </Accordion.Content>\n </Accordion.Panel>\n );\n })}\n </Accordion.Root>\n );\n}\n"],"names":["rootStyle","color","width","headerStyle","background","border","borderRadius","cursor","font","justifyContent","textAlign","textDecoration","listStyle","margin","padding","childStyle","PanelMenu","items","multiple","rest","_jsx","Accordion","Root","className","style","map","item","index","children","length","MenuItemAction","_jsxs","Panel","value","String","disabled","Header","Trigger","MenuItemContent","Indicator","i","aria-hidden","Content","ul","role","aria-label","label","child","childIndex","li"],"mappings":";;;;;;;AAAA;AACA;AAQA,MAAMA,SAAAA,GAA2B;IAAEC,KAAAA,EAAO,yBAAA;IAA2BC,KAAAA,EAAO;AAAQ,CAAA;AAEpF,MAAMC,WAAAA,GAA6B;IAC/BC,UAAAA,EAAY,2BAAA;IACZC,MAAAA,EAAQ,uCAAA;IACRC,YAAAA,EAAc,oCAAA;IACdL,KAAAA,EAAO,SAAA;IACPM,MAAAA,EAAQ,SAAA;IACRC,IAAAA,EAAM,SAAA;IACNC,cAAAA,EAAgB,eAAA;IAChBC,SAAAA,EAAW,MAAA;IACXC,cAAAA,EAAgB,MAAA;IAChBT,KAAAA,EAAO;AACX,CAAA;AAEA,MAAMU,SAAAA,GAA2B;IAAEA,SAAAA,EAAW,MAAA;IAAQC,MAAAA,EAAQ,CAAA;IAAGC,OAAAA,EAAS;AAAE,CAAA;AAE5E,MAAMC,UAAAA,GAA4B;IAC9BX,UAAAA,EAAY,aAAA;IACZC,MAAAA,EAAQ,MAAA;IACRJ,KAAAA,EAAO,SAAA;IACPM,MAAAA,EAAQ,SAAA;IACRC,IAAAA,EAAM,SAAA;IACNE,SAAAA,EAAW,MAAA;IACXC,cAAAA,EAAgB,MAAA;IAChBT,KAAAA,EAAO;AACX,CAAA;AAwBA;;;;;;;;;;;;;;IAeO,SAASc,SAAAA,CAAU,EAAEC,KAAAA,GAAQ,EAAE,EAAEC,QAAAA,GAAW,KAAK,EAAE,GAAGC,IAAAA,EAAsB,EAAA;IAC/E,qBACIC,cAAA,CAACC,oBAAUC,IAAI,EAAA;AAAE,QAAA,GAAGH,IAAI;QAAED,QAAAA,EAAUA,QAAAA;QAAUK,SAAAA,EAAU,qBAAA;QAAsBC,KA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AAA;oCAAoBL,IAAAA,EAAK,MAAA;AACtB,oCAAA,QAAA,gBAAAxB,cAAA,CAACU,6BAAAA,EAAAA;wCAAeJ,IAAAA,EAAMqB,KAAAA;wCAAOH,IAAAA,EAAK,UAAA;wCAAWrB,SAAAA,EAAU,6BAAA;wCAA8BC,KAAAA,EAAOT;;AADvFiC,iCAAAA,EAAAA,UAAAA,CAAAA;;;;AAZHrB,aAAAA,EAAAA,KAAAA,CAAAA;AAoB9B,QAAA,CAAA;;AAGZ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeBreadcrumb.js","sources":["../../../menu/PrimeBreadcrumb.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, ReactNode } from 'react';\nimport { Breadcrumb } from 'primereact/breadcrumb';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { MenuItem } from '../MenuItem';\nimport { menuItemsProperty } from '../menuItems';\nimport { stringProperty } from '../properties';\nimport { MenuItemContent } from './MenuItemContent';\n\n/**\n * One entry in the trail, as the strongest thing the authored data supports.\n *\n * The three cases are genuinely different to assistive technology and only one of them is a link. Where\n * the user already is gets `Breadcrumb.Current`, which carries `aria-current=\"page\"` and is what tells a\n * screen reader the trail has ended - a trailing link says the opposite. An earlier entry that names a\n * target is a link. An earlier entry that names none is plain text, because an anchor with no `href` is\n * not focusable and only looks like a link.\n *\n * @param item The entry to render.\n * @param current Whether this is the last entry, and so where the user is now.\n * @returns The rendered entry.\n */\nfunction breadcrumbEntry(item: MenuItem, current: boolean): ReactNode {\n if (current) {\n return (\n <Breadcrumb.Current>\n <MenuItemContent item={item} />\n </Breadcrumb.Current>\n );\n }\n\n if (item.url === undefined) return <MenuItemContent item={item} />;\n\n return (\n <Breadcrumb.Link href={item.url}>\n <MenuItemContent item={item} />\n </Breadcrumb.Link>\n );\n}\n\n/**\n * The `PrimeReact:breadcrumb` component - the path to where the user currently is.\n *\n * The home entry is separate from the trail in the authored model, so it is read from its own `homeUrl`\n * property and always rendered as an icon.\n *\n * PrimeReact 11 replaced the single `BreadCrumb` component and its `model`/`home` props with a namespace\n * of parts, so the trail is assembled here. The parts are worth assembling rather than working around:\n * the root is a `nav` carrying an accessible name, the list is an ordered list, and every separator is\n * marked presentational so it is never read out as part of the path. The old `model` prop produced all of\n * that too, but only because the component decided it - none of it is something a hand-rolled trail would\n * reliably reproduce.\n */\nexport function PrimeBreadcrumb({ element }: RegisteredComponentProps) {\n const items = menuItemsProperty(element, 'items');\n\n return (\n <Breadcrumb.Root data-scene-id={element.id}>\n <Breadcrumb.List>\n <Breadcrumb.Item>\n <Breadcrumb.Link href={stringProperty(element, 'homeUrl', '/')} aria-label='Home'>\n <i className='pi pi-home' aria-hidden='true' />\n </Breadcrumb.Link>\n </Breadcrumb.Item>\n {items.map((item, index) => (\n <Fragment key={index}>\n <Breadcrumb.Separator>\n <i className='pi pi-angle-right' aria-hidden='true' />\n </Breadcrumb.Separator>\n <Breadcrumb.Item>{breadcrumbEntry(item, index === items.length - 1)}</Breadcrumb.Item>\n </Fragment>\n ))}\n </Breadcrumb.List>\n </Breadcrumb.Root>\n );\n}\n"],"names":["breadcrumbEntry","item","current","_jsx","Breadcrumb","Current","MenuItemContent","url","undefined","Link","href","PrimeBreadcrumb","element","items","menuItemsProperty","Root","data-scene-id","id","_jsxs","List","Item","stringProperty","aria-label","i","className","aria-hidden","map","index","Fragment","Separator","length"],"mappings":";;;;;;;;;AAWA;;;;;;;;;;;;AAYC,IACD,SAASA,eAAAA,CAAgBC,IAAc,EAAEC,OAAgB,EAAA;AACrD,IAAA,IAAIA,OAAAA,EAAS;QACT,qBACIC,cAAA,CAACC,sBAAWC,OAAO,EAAA;AACf,YAAA,QAAA,gBAAAF,cAAA,CAACG,+BAAAA,EAAAA;gBAAgBL,IAAAA,EAAMA;;;AAGnC,IAAA;AAEA,IAAA,IAAIA,IAAAA,CAAKM,GAAG,KAAK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G,CAAA;;;AAJtDH,qBAAAA,EAAAA,KAAAA,CAAAA;;;;AAUnC
|
|
1
|
+
{"version":3,"file":"PrimeBreadcrumb.js","sources":["../../../menu/PrimeBreadcrumb.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, ReactNode } from 'react';\nimport { Breadcrumb } from 'primereact/breadcrumb';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { MenuItem } from '../MenuItem';\nimport { menuItemsProperty } from '../menuItems';\nimport { stringProperty } from '../properties';\nimport { MenuItemContent } from './MenuItemContent';\n\n/**\n * One entry in the trail, as the strongest thing the authored data supports.\n *\n * The three cases are genuinely different to assistive technology and only one of them is a link. Where\n * the user already is gets `Breadcrumb.Current`, which carries `aria-current=\"page\"` and is what tells a\n * screen reader the trail has ended - a trailing link says the opposite. An earlier entry that names a\n * target is a link. An earlier entry that names none is plain text, because an anchor with no `href` is\n * not focusable and only looks like a link.\n *\n * @param item The entry to render.\n * @param current Whether this is the last entry, and so where the user is now.\n * @returns The rendered entry.\n */\nfunction breadcrumbEntry(item: MenuItem, current: boolean): ReactNode {\n if (current) {\n return (\n <Breadcrumb.Current>\n <MenuItemContent item={item} />\n </Breadcrumb.Current>\n );\n }\n\n if (item.url === undefined) return <MenuItemContent item={item} />;\n\n return (\n <Breadcrumb.Link href={item.url}>\n <MenuItemContent item={item} />\n </Breadcrumb.Link>\n );\n}\n\n/**\n * The `PrimeReact:breadcrumb` component - the path to where the user currently is.\n *\n * The home entry is separate from the trail in the authored model, so it is read from its own `homeUrl`\n * property and always rendered as an icon.\n *\n * PrimeReact 11 replaced the single `BreadCrumb` component and its `model`/`home` props with a namespace\n * of parts, so the trail is assembled here. The parts are worth assembling rather than working around:\n * the root is a `nav` carrying an accessible name, the list is an ordered list, and every separator is\n * marked presentational so it is never read out as part of the path. The old `model` prop produced all of\n * that too, but only because the component decided it - none of it is something a hand-rolled trail would\n * reliably reproduce.\n */\nexport function PrimeBreadcrumb({ element }: RegisteredComponentProps) {\n const items = menuItemsProperty(element, 'items');\n\n return (\n <Breadcrumb.Root data-scene-id={element.id}>\n <Breadcrumb.List>\n <Breadcrumb.Item>\n <Breadcrumb.Link href={stringProperty(element, 'homeUrl', '/')} aria-label='Home'>\n <i className='pi pi-home' aria-hidden='true' />\n </Breadcrumb.Link>\n </Breadcrumb.Item>\n {items.map((item, index) => (\n <Fragment key={index}>\n <Breadcrumb.Separator>\n <i className='pi pi-angle-right' aria-hidden='true' />\n </Breadcrumb.Separator>\n <Breadcrumb.Item>{breadcrumbEntry(item, index === items.length - 1)}</Breadcrumb.Item>\n </Fragment>\n ))}\n </Breadcrumb.List>\n </Breadcrumb.Root>\n );\n}\n"],"names":["breadcrumbEntry","item","current","_jsx","Breadcrumb","Current","MenuItemContent","url","undefined","Link","href","PrimeBreadcrumb","element","items","menuItemsProperty","Root","data-scene-id","id","_jsxs","List","Item","stringProperty","aria-label","i","className","aria-hidden","map","index","Fragment","Separator","length"],"mappings":";;;;;;;;;AAWA;;;;;;;;;;;;AAYC,IACD,SAASA,eAAAA,CAAgBC,IAAc,EAAEC,OAAgB,EAAA;AACrD,IAAA,IAAIA,OAAAA,EAAS;QACT,qBACIC,cAAA,CAACC,sBAAWC,OAAO,EAAA;AACf,YAAA,QAAA,gBAAAF,cAAA,CAACG,+BAAAA,EAAAA;gBAAgBL,IAAAA,EAAMA;;;AAGnC,IAAA;AAEA,IAAA,IAAIA,IAAAA,CAAKM,GAAG,KAAKC,SAAAA,EAAW,qBAAOL,cAAA,CAACG,+BAAAA,EAAAA;QAAgBL,IAAAA,EAAMA;;IAE1D,qBACIE,cAAA,CAACC,sBAAWK,IAAI,EAAA;AAACC,QAAAA,IAAAA,EAAMT,KAAKM,GAAG;AAC3B,QAAA,QAAA,gBAAAJ,cAAA,CAACG,+BAAAA,EAAAA;YAAgBL,IAAAA,EAAMA;;;AAGnC;AAEA;;;;;;;;;;;;AAYC,IACM,SAASU,eAAAA,CAAgB,EAAEC,OAAO,EAA4B,EAAA;IACjE,MAAMC,KAAAA,GAAQC,4BAAkBF,OAAAA,EAAS,OAAA,CAAA;IAEzC,qBACIT,cAAA,CAACC,sBAAWW,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;gCACtCC,eAAA,CAACd,sBAAWe,IAAI,EAAA;;AACZ,8BAAAhB,cAAA,CAACC,sBAAWgB,IAAI,EAAA;4CACZjB,cAAA,CAACC,sBAAWK,IAAI,EAAA;wBAACC,IAAAA,EAAMW,yBAAAA,CAAeT,SAAS,SAAA,EAAW,GAAA,CAAA;wBAAMU,YAAAA,EAAW,MAAA;AACvE,wBAAA,QAAA,gBAAAnB,cAAA,CAACoB,GAAAA,EAAAA;4BAAEC,SAAAA,EAAU,YAAA;4BAAaC,aAAAA,EAAY;;;;AAG7CZ,gBAAAA,KAAAA,CAAMa,GAAG,CAAC,CAACzB,IAAAA,EAAM0B,sBACdT,eAAA,CAACU,cAAAA,EAAAA;;AACG,0CAAAzB,cAAA,CAACC,sBAAWyB,SAAS,EAAA;AACjB,gCAAA,QAAA,gBAAA1B,cAAA,CAACoB,GAAAA,EAAAA;oCAAEC,SAAAA,EAAU,mBAAA;oCAAoBC,aAAAA,EAAY;;;AAEjD,0CAAAtB,cAAA,CAACC,sBAAWgB,IAAI,EAAA;AAAEpB,gCAAAA,QAAAA,EAAAA,eAAAA,CAAgBC,IAAAA,EAAM0B,KAAAA,KAAUd,KAAAA,CAAMiB,MAAM,GAAG,CAAA;;;AAJtDH,qBAAAA,EAAAA,KAAAA,CAAAA;;;;AAUnC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeContextMenu.js","sources":["../../../menu/PrimeContextMenu.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 { ContextMenu } from 'primereact/contextmenu';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { menuItemsProperty } from '../menuItems';\nimport { stringProperty } from '../properties';\nimport { MenuItemContent } from './MenuItemContent';\n\n/**\n * The `PrimeReact:contextMenu` component - commands revealed by right-clicking a region.\n *\n * The adapter renders the region that owns the context-menu event as well as the menu itself. Without it\n * the menu could never be opened and the element would render as nothing at all.\n *\n * What changed in PrimeReact 11 is who owns that event. In v10 the menu was one component and the caller\n * had to hold a ref to it and call `show(event)` from its own `onContextMenu` handler. In v11\n * `ContextMenu.Trigger` is a part that already carries the handler, the `aria-haspopup` and the expanded\n * state, so the ref and the hand-written handler are both gone - the region is now declared as the\n * trigger rather than wired to the menu after the fact.\n *\n * The overlay is spelled out as portal, positioner and popup because those are separate parts now. That is\n * not ceremony: the positioner is what keeps the menu on screen near the pointer, and it renders nothing\n * at all until the menu is actually open, which is what makes an unopened context menu cost nothing.\n */\nexport function PrimeContextMenu({ element, slots }: RegisteredComponentProps) {\n const items = menuItemsProperty(element, 'items');\n\n return (\n <ContextMenu.Root data-scene-id={element.id}>\n <ContextMenu.Trigger>\n {slots.content?.length ? slots.content : <span>{stringProperty(element, 'label', 'Right-click here')}</span>}\n </ContextMenu.Trigger>\n <ContextMenu.Portal>\n <ContextMenu.Positioner>\n <ContextMenu.Popup>\n <ContextMenu.List>\n {items.map((item, index) =>\n item.separator === true ? (\n <ContextMenu.Separator key={index} />\n ) : (\n <ContextMenu.Item\n key={index}\n value={`${index}`}\n as={item.url === undefined ? 'div' : 'a'}\n href={item.url}\n disabled={item.disabled}\n onSelect={() => item.command?.()}>\n <MenuItemContent item={item} />\n </ContextMenu.Item>\n )\n )}\n </ContextMenu.List>\n </ContextMenu.Popup>\n </ContextMenu.Positioner>\n </ContextMenu.Portal>\n </ContextMenu.Root>\n );\n}\n"],"names":["PrimeContextMenu","element","slots","items","menuItemsProperty","_jsxs","ContextMenu","Root","data-scene-id","id","_jsx","Trigger","content","length","span","stringProperty","Portal","Positioner","Popup","List","map","item","index","separator","Separator","Item","value","as","url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,oCAAA,QAAA,gBAAAvB,cAAA,CAACwB,+BAAAA,EAAAA;wCAAgBb,IAAAA,EAAMA;;AANlBC,iCAAAA,EAAAA,KAAAA,CAAAA;;;;;;;AAgB7C
|
|
1
|
+
{"version":3,"file":"PrimeContextMenu.js","sources":["../../../menu/PrimeContextMenu.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 { ContextMenu } from 'primereact/contextmenu';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { menuItemsProperty } from '../menuItems';\nimport { stringProperty } from '../properties';\nimport { MenuItemContent } from './MenuItemContent';\n\n/**\n * The `PrimeReact:contextMenu` component - commands revealed by right-clicking a region.\n *\n * The adapter renders the region that owns the context-menu event as well as the menu itself. Without it\n * the menu could never be opened and the element would render as nothing at all.\n *\n * What changed in PrimeReact 11 is who owns that event. In v10 the menu was one component and the caller\n * had to hold a ref to it and call `show(event)` from its own `onContextMenu` handler. In v11\n * `ContextMenu.Trigger` is a part that already carries the handler, the `aria-haspopup` and the expanded\n * state, so the ref and the hand-written handler are both gone - the region is now declared as the\n * trigger rather than wired to the menu after the fact.\n *\n * The overlay is spelled out as portal, positioner and popup because those are separate parts now. That is\n * not ceremony: the positioner is what keeps the menu on screen near the pointer, and it renders nothing\n * at all until the menu is actually open, which is what makes an unopened context menu cost nothing.\n */\nexport function PrimeContextMenu({ element, slots }: RegisteredComponentProps) {\n const items = menuItemsProperty(element, 'items');\n\n return (\n <ContextMenu.Root data-scene-id={element.id}>\n <ContextMenu.Trigger>\n {slots.content?.length ? slots.content : <span>{stringProperty(element, 'label', 'Right-click here')}</span>}\n </ContextMenu.Trigger>\n <ContextMenu.Portal>\n <ContextMenu.Positioner>\n <ContextMenu.Popup>\n <ContextMenu.List>\n {items.map((item, index) =>\n item.separator === true ? (\n <ContextMenu.Separator key={index} />\n ) : (\n <ContextMenu.Item\n key={index}\n value={`${index}`}\n as={item.url === undefined ? 'div' : 'a'}\n href={item.url}\n disabled={item.disabled}\n onSelect={() => item.command?.()}>\n <MenuItemContent item={item} />\n </ContextMenu.Item>\n )\n )}\n </ContextMenu.List>\n </ContextMenu.Popup>\n </ContextMenu.Positioner>\n </ContextMenu.Portal>\n </ContextMenu.Root>\n );\n}\n"],"names":["PrimeContextMenu","element","slots","items","menuItemsProperty","_jsxs","ContextMenu","Root","data-scene-id","id","_jsx","Trigger","content","length","span","stringProperty","Portal","Positioner","Popup","List","map","item","index","separator","Separator","Item","value","as","url","undefined","href","disabled","onSelect","command","MenuItemContent"],"mappings":";;;;;;;;AASA;;;;;;;;;;;;;;;AAeC,IACM,SAASA,gBAAAA,CAAiB,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACzE,MAAMC,KAAAA,GAAQC,4BAAkBH,OAAAA,EAAS,OAAA,CAAA;IAEzC,qBACII,eAAA,CAACC,wBAAYC,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAeP,QAAQQ,EAAE;;AACvC,0BAAAC,cAAA,CAACJ,wBAAYK,OAAO,EAAA;AACfT,gBAAAA,QAAAA,EAAAA,KAAAA,CAAMU,OAAO,EAAEC,MAAAA,GAASX,KAAAA,CAAMU,OAAO,iBAAGF,cAAA,CAACI,MAAAA,EAAAA;AAAMC,oBAAAA,QAAAA,EAAAA,yBAAAA,CAAed,SAAS,OAAA,EAAS,kBAAA;;;AAErF,0BAAAS,cAAA,CAACJ,wBAAYU,MAAM,EAAA;wCACfN,cAAA,CAACJ,wBAAYW,UAAU,EAAA;4CACnBP,cAAA,CAACJ,wBAAYY,KAAK,EAAA;gDACdR,cAAA,CAACJ,wBAAYa,IAAI,EAAA;AACZhB,4BAAAA,QAAAA,EAAAA,KAAAA,CAAMiB,GAAG,CAAC,CAACC,IAAAA,EAAMC,KAAAA,GACdD,KAAKE,SAAS,KAAK,IAAA,iBACfb,cAAA,CAACJ,wBAAYkB,SAAS,EAAA,EAAA,EAAMF,KAAAA,CAAAA,iBAE5BZ,cAAA,CAACJ,wBAAYmB,IAAI,EAAA;AAEbC,oCAAAA,KAAAA,EAAO,GAAGJ,KAAAA,CAAAA,CAAO;AACjBK,oCAAAA,EAAAA,EAAIN,IAAAA,CAAKO,GAAG,KAAKC,SAAAA,GAAY,KAAA,GAAQ,GAAA;AACrCC,oCAAAA,IAAAA,EAAMT,KAAKO,GAAG;AACdG,oCAAAA,QAAAA,EAAUV,KAAKU,QAAQ;oCACvBC,QAAAA,EAAU,IAAMX,KAAKY,OAAO,IAAA;AAC5B,oCAAA,QAAA,gBAAAvB,cAAA,CAACwB,+BAAAA,EAAAA;wCAAgBb,IAAAA,EAAMA;;AANlBC,iCAAAA,EAAAA,KAAAA,CAAAA;;;;;;;AAgB7C;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeDock.js","sources":["../../../menu/PrimeDock.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { menuItemsProperty } from '../menuItems';\nimport { stringProperty } from '../properties';\nimport { Dock } from './Dock';\nimport { DockPosition } from './DockPosition';\n\n/**\n * Narrows an authored `position` onto the edges a dock can actually be anchored to.\n *\n * A screen's properties are authored data rather than compiler-checked values, so an unrecognized edge is\n * an ordinary thing to encounter. Falling back to the bottom edge - the dock's own default - keeps a\n * mistyped property behaving exactly like an absent one, which is the rule every reader in this package\n * follows.\n *\n * @param value The authored position.\n * @returns The matching edge, or the bottom edge when the value names none.\n */\nfunction dockPosition(value: string): DockPosition {\n switch (value) {\n case DockPosition.Top:\n return DockPosition.Top;\n case DockPosition.Left:\n return DockPosition.Left;\n case DockPosition.Right:\n return DockPosition.Right;\n default:\n return DockPosition.Bottom;\n }\n}\n\n/**\n * The `PrimeReact:dock` component - a strip of icons anchored to one edge.\n *\n * PrimeReact 11 removed `dock` with nothing to replace it, so what this adapts is Scene's own\n * {@link Dock}. The magnifying effect that made v10's dock recognizable is not part of the replacement;\n * what a screen actually depends on is a row of icon commands pinned to an edge, and that is what remains.\n *\n * A dock positions itself absolutely against its nearest positioned ancestor, so it is wrapped in a sized\n * relative box here; dropped straight into a Scene tree it would otherwise pin itself to the page.\n */\nexport function PrimeDock({ element }: RegisteredComponentProps) {\n return (\n <div data-scene-id={element.id} className='relative h-40 w-full'>\n <Dock items={menuItemsProperty(element, 'items')} position={dockPosition(stringProperty(element, 'position', DockPosition.Bottom))} />\n </div>\n );\n}\n"],"names":["dockPosition","value","DockPosition","Top","Left","Right","Bottom","PrimeDock","element","_jsx","div","data-scene-id","id","className","Dock","items","menuItemsProperty","position","stringProperty"],"mappings":";;;;;;;;AAAA;AACA;AAQA;;;;;;;;;;IAWA,SAASA,aAAaC,KAAa,EAAA;IAC/B,OAAQA,KAAAA;AACJ,QAAA,KAAKC,0BAAaC,GAAG;AACjB,YAAA,OAAOD,0BAAaC,GAAG;AAC3B,QAAA,KAAKD,0BAAaE,IAAI;AAClB,YAAA,OAAOF,0BAAaE,IAAI;AAC5B,QAAA,KAAKF,0BAAaG,KAAK;AACnB,YAAA,OAAOH,0BAAaG,KAAK;AAC7B,QAAA;AACI,YAAA,OAAOH,0BAAaI,MAAM;AAClC;AACJ;AAEA;;;;;;;;;AASC,IACM,SAASC,SAAAA,CAAU,EAAEC,OAAO,EAA4B,EAAA;AAC3D,IAAA,qBACIC,cAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeH,QAAQI,EAAE;QAAEC,SAAAA,EAAU,sBAAA;AACtC,QAAA,QAAA,gBAAAJ,cAAA,CAACK,SAAAA,EAAAA;AAAKC,YAAAA,KAAAA,EAAOC,4BAAkBR,OAAAA,EAAS,OAAA,CAAA;AAAUS,YAAAA,QAAAA,EAAUjB,YAAAA,CAAakB,yBAAAA,CAAeV,OAAAA,EAAS,UAAA,EAAYN,0BAAaI,MAAM,CAAA;;;AAG5I
|
|
1
|
+
{"version":3,"file":"PrimeDock.js","sources":["../../../menu/PrimeDock.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { menuItemsProperty } from '../menuItems';\nimport { stringProperty } from '../properties';\nimport { Dock } from './Dock';\nimport { DockPosition } from './DockPosition';\n\n/**\n * Narrows an authored `position` onto the edges a dock can actually be anchored to.\n *\n * A screen's properties are authored data rather than compiler-checked values, so an unrecognized edge is\n * an ordinary thing to encounter. Falling back to the bottom edge - the dock's own default - keeps a\n * mistyped property behaving exactly like an absent one, which is the rule every reader in this package\n * follows.\n *\n * @param value The authored position.\n * @returns The matching edge, or the bottom edge when the value names none.\n */\nfunction dockPosition(value: string): DockPosition {\n switch (value) {\n case DockPosition.Top:\n return DockPosition.Top;\n case DockPosition.Left:\n return DockPosition.Left;\n case DockPosition.Right:\n return DockPosition.Right;\n default:\n return DockPosition.Bottom;\n }\n}\n\n/**\n * The `PrimeReact:dock` component - a strip of icons anchored to one edge.\n *\n * PrimeReact 11 removed `dock` with nothing to replace it, so what this adapts is Scene's own\n * {@link Dock}. The magnifying effect that made v10's dock recognizable is not part of the replacement;\n * what a screen actually depends on is a row of icon commands pinned to an edge, and that is what remains.\n *\n * A dock positions itself absolutely against its nearest positioned ancestor, so it is wrapped in a sized\n * relative box here; dropped straight into a Scene tree it would otherwise pin itself to the page.\n */\nexport function PrimeDock({ element }: RegisteredComponentProps) {\n return (\n <div data-scene-id={element.id} className='relative h-40 w-full'>\n <Dock items={menuItemsProperty(element, 'items')} position={dockPosition(stringProperty(element, 'position', DockPosition.Bottom))} />\n </div>\n );\n}\n"],"names":["dockPosition","value","DockPosition","Top","Left","Right","Bottom","PrimeDock","element","_jsx","div","data-scene-id","id","className","Dock","items","menuItemsProperty","position","stringProperty"],"mappings":";;;;;;;;AAAA;AACA;AAQA;;;;;;;;;;IAWA,SAASA,aAAaC,KAAa,EAAA;IAC/B,OAAQA,KAAAA;AACJ,QAAA,KAAKC,0BAAaC,GAAG;AACjB,YAAA,OAAOD,0BAAaC,GAAG;AAC3B,QAAA,KAAKD,0BAAaE,IAAI;AAClB,YAAA,OAAOF,0BAAaE,IAAI;AAC5B,QAAA,KAAKF,0BAAaG,KAAK;AACnB,YAAA,OAAOH,0BAAaG,KAAK;AAC7B,QAAA;AACI,YAAA,OAAOH,0BAAaI,MAAM;AAClC;AACJ;AAEA;;;;;;;;;AASC,IACM,SAASC,SAAAA,CAAU,EAAEC,OAAO,EAA4B,EAAA;AAC3D,IAAA,qBACIC,cAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeH,QAAQI,EAAE;QAAEC,SAAAA,EAAU,sBAAA;AACtC,QAAA,QAAA,gBAAAJ,cAAA,CAACK,SAAAA,EAAAA;AAAKC,YAAAA,KAAAA,EAAOC,4BAAkBR,OAAAA,EAAS,OAAA,CAAA;AAAUS,YAAAA,QAAAA,EAAUjB,YAAAA,CAAakB,yBAAAA,CAAeV,OAAAA,EAAS,UAAA,EAAYN,0BAAaI,MAAM,CAAA;;;AAG5I;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeMegaMenu.js","sources":["../../../menu/PrimeMegaMenu.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { menuItemsProperty } from '../menuItems';\nimport { MegaMenu } from './MegaMenu';\n\n/**\n * The `PrimeReact:megaMenu` component - a menubar whose submenus open as multi-column panels.\n *\n * PrimeReact 11 removed `megamenu` with nothing to replace it, so what this adapts is Scene's own\n * {@link MegaMenu}.\n *\n * Columns are one ordinary level of nesting: each root entry's `items` are the columns, and each column's\n * `items` are the commands in it. PrimeReact 10 spelled that as an array of arrays, but `menuItemsProperty`\n * follows nested objects and drops nested arrays, so the doubly-nested form never survived the read in the\n * first place. Authoring it as objects is both what the reader supports and one bracket less to get right.\n */\nexport function PrimeMegaMenu({ element }: RegisteredComponentProps) {\n return <MegaMenu data-scene-id={element.id} items={menuItemsProperty(element, 'items')} />;\n}\n"],"names":["PrimeMegaMenu","element","_jsx","MegaMenu","data-scene-id","id","items","menuItemsProperty"],"mappings":";;;;;;AAAA;AACA;AAMA;;;;;;;;;;AAUC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAA4B,EAAA;AAC/D,IAAA,qBAAOC,cAAA,CAACC,iBAAAA,EAAAA;AAASC,QAAAA,eAAAA,EAAeH,QAAQI,EAAE;AAAEC,QAAAA,KAAAA,EAAOC,4BAAkBN,OAAAA,EAAS,OAAA;;AAClF
|
|
1
|
+
{"version":3,"file":"PrimeMegaMenu.js","sources":["../../../menu/PrimeMegaMenu.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { menuItemsProperty } from '../menuItems';\nimport { MegaMenu } from './MegaMenu';\n\n/**\n * The `PrimeReact:megaMenu` component - a menubar whose submenus open as multi-column panels.\n *\n * PrimeReact 11 removed `megamenu` with nothing to replace it, so what this adapts is Scene's own\n * {@link MegaMenu}.\n *\n * Columns are one ordinary level of nesting: each root entry's `items` are the columns, and each column's\n * `items` are the commands in it. PrimeReact 10 spelled that as an array of arrays, but `menuItemsProperty`\n * follows nested objects and drops nested arrays, so the doubly-nested form never survived the read in the\n * first place. Authoring it as objects is both what the reader supports and one bracket less to get right.\n */\nexport function PrimeMegaMenu({ element }: RegisteredComponentProps) {\n return <MegaMenu data-scene-id={element.id} items={menuItemsProperty(element, 'items')} />;\n}\n"],"names":["PrimeMegaMenu","element","_jsx","MegaMenu","data-scene-id","id","items","menuItemsProperty"],"mappings":";;;;;;AAAA;AACA;AAMA;;;;;;;;;;AAUC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAA4B,EAAA;AAC/D,IAAA,qBAAOC,cAAA,CAACC,iBAAAA,EAAAA;AAASC,QAAAA,eAAAA,EAAeH,QAAQI,EAAE;AAAEC,QAAAA,KAAAA,EAAOC,4BAAkBN,OAAAA,EAAS,OAAA;;AAClF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeMenu.js","sources":["../../../menu/PrimeMenu.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 { ReactNode } from 'react';\nimport { Menu } from 'primereact/menu';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { MenuItem } from '../MenuItem';\nimport { menuItemsProperty } from '../menuItems';\nimport { MenuItemContent } from './MenuItemContent';\n\n/**\n * One selectable entry, as either a command or a link depending on whether the entry names a target.\n *\n * `Menu.Item` renders whatever element `as` names, so the link case is the same part with an anchor\n * underneath rather than a different code path - which is what keeps the menu's own keyboard handling,\n * focus tracking and identifiers working for both kinds of entry.\n *\n * @param item The entry to render.\n * @param value The entry's identity within the menu, which the menu turns into a stable element id.\n * @returns The rendered entry.\n */\nfunction menuEntry(item: MenuItem, value: string): ReactNode {\n return (\n <Menu.Item\n key={value}\n value={value}\n as={item.url === undefined ? 'div' : 'a'}\n href={item.url}\n disabled={item.disabled}\n onSelect={() => item.command?.()}>\n <MenuItemContent item={item} />\n </Menu.Item>\n );\n}\n\n/**\n * The `PrimeReact:menu` component - a flat list of commands.\n *\n * PrimeReact 11 turned `Menu` from one component taking a `model` array into a namespace of parts that a\n * caller assembles, so the adapter now walks the item model itself. That is more lines, but it is the only\n * way to reach the parts, and it buys the thing the `model` prop never allowed: an entry can be an anchor\n * when it navigates and a plain item when it commands.\n *\n * `Menu.Root` renders no element of its own unless told which one to be, so `as` is given explicitly -\n * without it the root collapses to a fragment and takes the element's `data-scene-id` and the theme's own\n * scope attributes with it.\n *\n * An entry that carries children is rendered as a labeled group rather than being flattened to its own\n * label, which is what the v10 `Menu` did with a nested entry. Dropping the children instead would lose\n * authored content silently; a menu that genuinely needs a *side-opening* submenu is a `tieredMenu`.\n */\nexport function PrimeMenu({ element }: RegisteredComponentProps) {\n const items = menuItemsProperty(element, 'items');\n\n return (\n <Menu.Root as='div' data-scene-id={element.id}>\n <Menu.List>\n {items.map((item, index) => {\n if (item.separator === true) return <Menu.Separator key={index} />;\n\n const children = item.items ?? [];\n if (children.length === 0) return menuEntry(item, `${index}`);\n\n return (\n <Menu.Group key={index}>\n <Menu.Label>\n <MenuItemContent item={item} />\n </Menu.Label>\n {children.map((child, childIndex) => menuEntry(child, `${index}-${childIndex}`))}\n </Menu.Group>\n );\n })}\n </Menu.List>\n </Menu.Root>\n );\n}\n"],"names":["menuEntry","item","value","_jsx","Menu","Item","as","url","undefined","href","disabled","onSelect","command","MenuItemContent","PrimeMenu","element","items","menuItemsProperty","Root","data-scene-id","id","List","map","index","separator","Separator","children","length","_jsxs","Group","Label","child","childIndex"],"mappings":";;;;;;;AAAA;AACA;AASA;;;;;;;;;;AAUC,IACD,SAASA,SAAAA,CAAUC,IAAc,EAAEC,KAAa,EAAA;IAC5C,qBACIC,cAAA,CAACC,UAAKC,IAAI,EAAA;QAENH,KAAAA,EAAOA,KAAAA;AACPI,QAAAA,EAAAA,EAAIL,IAAAA,CAAKM,GAAG,KAAKC,SAAAA,GAAY,KAAA,GAAQ,GAAA;AACrCC,QAAAA,IAAAA,EAAMR,KAAKM,GAAG;AACdG,QAAAA,QAAAA,EAAUT,KAAKS,QAAQ;QACvBC,QAAAA,EAAU,IAAMV,KAAKW,OAAO,IAAA;AAC5B,QAAA,QAAA,gBAAAT,cAAA,CAACU,+BAAAA,EAAAA;YAAgBZ,IAAAA,EAAMA;;AANlBC,KAAAA,EAAAA,KAAAA,CAAAA;AASjB;AAEA;;;;;;;;;;;;;;;AAeC,IACM,SAASY,SAAAA,CAAU,EAAEC,OAAO,EAA4B,EAAA;IAC3D,MAAMC,KAAAA,GAAQC,4BAAkBF,OAAAA,EAAS,OAAA,CAAA;IAEzC,qBACIZ,cAAA,CAACC,UAAKc,IAAI,EAAA;QAACZ,EAAAA,EAAG,KAAA;AAAMa,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;gCACzCjB,cAAA,CAACC,UAAKiB,IAAI,EAAA;sBACLL,KAAAA,CAAMM,GAAG,CAAC,CAACrB,IAAAA,EAAMsB,KAAAA,GAAAA;gBACd,IAAItB,IAAAA,CAAKuB,SAAS,KAAK,IAAA,EAAM,qBAAOrB,cAAA,CAACC,SAAAA,CAAKqB,SAAS,EAAA,EAAA,EAAMF,KAAAA,CAAAA;AAEzD,gBAAA,MAAMG,QAAAA,GAAWzB,IAAAA,CAAKe,KAAK,IAAI,EAAE;gBACjC,IAAIU,QAAAA,CAASC,MAAM,KAAK,CAAA,EAAG,OAAO3B,SAAAA,CAAUC,IAAAA,EAAM,GAAGsB,KAAAA,CAAAA,CAAO,CAAA;gBAE5D,qBACIK,eAAA,CAACxB,UAAKyB,KAAK,EAAA;;AACP,sCAAA1B,cAAA,CAACC,UAAK0B,KAAK,EAAA;AACP,4BAAA,QAAA,gBAAA3B,cAAA,CAACU,+BAAAA,EAAAA;gCAAgBZ,IAAAA,EAAMA;;;wBAE1ByB,QAAAA,CAASJ,GAAG,CAAC,CAACS,KAAAA,EAAOC,UAAAA,GAAehC,SAAAA,CAAU+B,KAAAA,EAAO,CAAA,EAAGR,KAAAA,CAAM,CAAC,EAAES,UAAAA,CAAAA,CAAY,CAAA;;AAJjET,iBAAAA,EAAAA,KAAAA,CAAAA;AAOzB,YAAA,CAAA;;;AAIhB
|
|
1
|
+
{"version":3,"file":"PrimeMenu.js","sources":["../../../menu/PrimeMenu.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 { ReactNode } from 'react';\nimport { Menu } from 'primereact/menu';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { MenuItem } from '../MenuItem';\nimport { menuItemsProperty } from '../menuItems';\nimport { MenuItemContent } from './MenuItemContent';\n\n/**\n * One selectable entry, as either a command or a link depending on whether the entry names a target.\n *\n * `Menu.Item` renders whatever element `as` names, so the link case is the same part with an anchor\n * underneath rather than a different code path - which is what keeps the menu's own keyboard handling,\n * focus tracking and identifiers working for both kinds of entry.\n *\n * @param item The entry to render.\n * @param value The entry's identity within the menu, which the menu turns into a stable element id.\n * @returns The rendered entry.\n */\nfunction menuEntry(item: MenuItem, value: string): ReactNode {\n return (\n <Menu.Item\n key={value}\n value={value}\n as={item.url === undefined ? 'div' : 'a'}\n href={item.url}\n disabled={item.disabled}\n onSelect={() => item.command?.()}>\n <MenuItemContent item={item} />\n </Menu.Item>\n );\n}\n\n/**\n * The `PrimeReact:menu` component - a flat list of commands.\n *\n * PrimeReact 11 turned `Menu` from one component taking a `model` array into a namespace of parts that a\n * caller assembles, so the adapter now walks the item model itself. That is more lines, but it is the only\n * way to reach the parts, and it buys the thing the `model` prop never allowed: an entry can be an anchor\n * when it navigates and a plain item when it commands.\n *\n * `Menu.Root` renders no element of its own unless told which one to be, so `as` is given explicitly -\n * without it the root collapses to a fragment and takes the element's `data-scene-id` and the theme's own\n * scope attributes with it.\n *\n * An entry that carries children is rendered as a labeled group rather than being flattened to its own\n * label, which is what the v10 `Menu` did with a nested entry. Dropping the children instead would lose\n * authored content silently; a menu that genuinely needs a *side-opening* submenu is a `tieredMenu`.\n */\nexport function PrimeMenu({ element }: RegisteredComponentProps) {\n const items = menuItemsProperty(element, 'items');\n\n return (\n <Menu.Root as='div' data-scene-id={element.id}>\n <Menu.List>\n {items.map((item, index) => {\n if (item.separator === true) return <Menu.Separator key={index} />;\n\n const children = item.items ?? [];\n if (children.length === 0) return menuEntry(item, `${index}`);\n\n return (\n <Menu.Group key={index}>\n <Menu.Label>\n <MenuItemContent item={item} />\n </Menu.Label>\n {children.map((child, childIndex) => menuEntry(child, `${index}-${childIndex}`))}\n </Menu.Group>\n );\n })}\n </Menu.List>\n </Menu.Root>\n );\n}\n"],"names":["menuEntry","item","value","_jsx","Menu","Item","as","url","undefined","href","disabled","onSelect","command","MenuItemContent","PrimeMenu","element","items","menuItemsProperty","Root","data-scene-id","id","List","map","index","separator","Separator","children","length","_jsxs","Group","Label","child","childIndex"],"mappings":";;;;;;;AAAA;AACA;AASA;;;;;;;;;;AAUC,IACD,SAASA,SAAAA,CAAUC,IAAc,EAAEC,KAAa,EAAA;IAC5C,qBACIC,cAAA,CAACC,UAAKC,IAAI,EAAA;QAENH,KAAAA,EAAOA,KAAAA;AACPI,QAAAA,EAAAA,EAAIL,IAAAA,CAAKM,GAAG,KAAKC,SAAAA,GAAY,KAAA,GAAQ,GAAA;AACrCC,QAAAA,IAAAA,EAAMR,KAAKM,GAAG;AACdG,QAAAA,QAAAA,EAAUT,KAAKS,QAAQ;QACvBC,QAAAA,EAAU,IAAMV,KAAKW,OAAO,IAAA;AAC5B,QAAA,QAAA,gBAAAT,cAAA,CAACU,+BAAAA,EAAAA;YAAgBZ,IAAAA,EAAMA;;AANlBC,KAAAA,EAAAA,KAAAA,CAAAA;AASjB;AAEA;;;;;;;;;;;;;;;AAeC,IACM,SAASY,SAAAA,CAAU,EAAEC,OAAO,EAA4B,EAAA;IAC3D,MAAMC,KAAAA,GAAQC,4BAAkBF,OAAAA,EAAS,OAAA,CAAA;IAEzC,qBACIZ,cAAA,CAACC,UAAKc,IAAI,EAAA;QAACZ,EAAAA,EAAG,KAAA;AAAMa,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;gCACzCjB,cAAA,CAACC,UAAKiB,IAAI,EAAA;sBACLL,KAAAA,CAAMM,GAAG,CAAC,CAACrB,IAAAA,EAAMsB,KAAAA,GAAAA;gBACd,IAAItB,IAAAA,CAAKuB,SAAS,KAAK,IAAA,EAAM,qBAAOrB,cAAA,CAACC,SAAAA,CAAKqB,SAAS,EAAA,EAAA,EAAMF,KAAAA,CAAAA;AAEzD,gBAAA,MAAMG,QAAAA,GAAWzB,IAAAA,CAAKe,KAAK,IAAI,EAAE;gBACjC,IAAIU,QAAAA,CAASC,MAAM,KAAK,CAAA,EAAG,OAAO3B,SAAAA,CAAUC,IAAAA,EAAM,GAAGsB,KAAAA,CAAAA,CAAO,CAAA;gBAE5D,qBACIK,eAAA,CAACxB,UAAKyB,KAAK,EAAA;;AACP,sCAAA1B,cAAA,CAACC,UAAK0B,KAAK,EAAA;AACP,4BAAA,QAAA,gBAAA3B,cAAA,CAACU,+BAAAA,EAAAA;gCAAgBZ,IAAAA,EAAMA;;;wBAE1ByB,QAAAA,CAASJ,GAAG,CAAC,CAACS,KAAAA,EAAOC,UAAAA,GAAehC,SAAAA,CAAU+B,KAAAA,EAAO,CAAA,EAAGR,KAAAA,CAAM,CAAC,EAAES,UAAAA,CAAAA,CAAY,CAAA;;AAJjET,iBAAAA,EAAAA,KAAAA,CAAAA;AAOzB,YAAA,CAAA;;;AAIhB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeMenubar.js","sources":["../../../menu/PrimeMenubar.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { menuItemsProperty } from '../menuItems';\nimport { Menubar } from './Menubar';\n\n/**\n * The `PrimeReact:menubar` component - a horizontal menu with nested submenus.\n *\n * The `start` and `end` slots take the branding and account controls that flank a real application's\n * menubar; the commands themselves come from the `items` property.\n *\n * PrimeReact 11 removed `menubar` with nothing to replace it, so what this adapts is Scene's own\n * {@link Menubar}. The registered name and the authored properties are unchanged, which is the point -\n * a screen written against the PrimeReact 10 package keeps working, and the substitution shows up as a\n * shorter list of behaviors rather than as a broken screen.\n */\nexport function PrimeMenubar({ element, slots }: RegisteredComponentProps) {\n return <Menubar data-scene-id={element.id} items={menuItemsProperty(element, 'items')} start={slots.start} end={slots.end} />;\n}\n"],"names":["PrimeMenubar","element","slots","_jsx","Menubar","data-scene-id","id","items","menuItemsProperty","start","end"],"mappings":";;;;;;AAAA;AACA;AAMA;;;;;;;;;;AAUC,IACM,SAASA,YAAAA,CAAa,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACrE,IAAA,qBAAOC,cAAA,CAACC,eAAAA,EAAAA;AAAQC,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;AAAEC,QAAAA,KAAAA,EAAOC,4BAAkBP,OAAAA,EAAS,OAAA,CAAA;AAAUQ,QAAAA,KAAAA,EAAOP,MAAMO,KAAK;AAAEC,QAAAA,GAAAA,EAAKR,MAAMQ;;AAC1H
|
|
1
|
+
{"version":3,"file":"PrimeMenubar.js","sources":["../../../menu/PrimeMenubar.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { menuItemsProperty } from '../menuItems';\nimport { Menubar } from './Menubar';\n\n/**\n * The `PrimeReact:menubar` component - a horizontal menu with nested submenus.\n *\n * The `start` and `end` slots take the branding and account controls that flank a real application's\n * menubar; the commands themselves come from the `items` property.\n *\n * PrimeReact 11 removed `menubar` with nothing to replace it, so what this adapts is Scene's own\n * {@link Menubar}. The registered name and the authored properties are unchanged, which is the point -\n * a screen written against the PrimeReact 10 package keeps working, and the substitution shows up as a\n * shorter list of behaviors rather than as a broken screen.\n */\nexport function PrimeMenubar({ element, slots }: RegisteredComponentProps) {\n return <Menubar data-scene-id={element.id} items={menuItemsProperty(element, 'items')} start={slots.start} end={slots.end} />;\n}\n"],"names":["PrimeMenubar","element","slots","_jsx","Menubar","data-scene-id","id","items","menuItemsProperty","start","end"],"mappings":";;;;;;AAAA;AACA;AAMA;;;;;;;;;;AAUC,IACM,SAASA,YAAAA,CAAa,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACrE,IAAA,qBAAOC,cAAA,CAACC,eAAAA,EAAAA;AAAQC,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;AAAEC,QAAAA,KAAAA,EAAOC,4BAAkBP,OAAAA,EAAS,OAAA,CAAA;AAAUQ,QAAAA,KAAAA,EAAOP,MAAMO,KAAK;AAAEC,QAAAA,GAAAA,EAAKR,MAAMQ;;AAC1H;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimePanelMenu.js","sources":["../../../menu/PrimePanelMenu.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { menuItemsProperty } from '../menuItems';\nimport { booleanProperty } from '../properties';\nimport { PanelMenu } from './PanelMenu';\n\n/**\n * The `PrimeReact:panelMenu` component - a vertical menu whose submenus expand in place, accordion style.\n *\n * PrimeReact 11 removed `panelmenu` with nothing to replace it, so what this adapts is Scene's own\n * {@link PanelMenu}. That replacement is the least hand-rolled of the seven in this folder: v11 still ships\n * `accordion`, and an accordion is exactly what a panel menu's expand-and-collapse behavior is, so only the\n * mapping from the authored item model onto those parts is Scene's.\n */\nexport function PrimePanelMenu({ element }: RegisteredComponentProps) {\n return <PanelMenu data-scene-id={element.id} items={menuItemsProperty(element, 'items')} multiple={booleanProperty(element, 'multiple', false)} />;\n}\n"],"names":["PrimePanelMenu","element","_jsx","PanelMenu","data-scene-id","id","items","menuItemsProperty","multiple","booleanProperty"],"mappings":";;;;;;;AAAA;AACA;AAOA;;;;;;;AAOC,IACM,SAASA,cAAAA,CAAe,EAAEC,OAAO,EAA4B,EAAA;AAChE,IAAA,qBAAOC,cAAA,CAACC,mBAAAA,EAAAA;AAAUC,QAAAA,eAAAA,EAAeH,QAAQI,EAAE;AAAEC,QAAAA,KAAAA,EAAOC,4BAAkBN,OAAAA,EAAS,OAAA,CAAA;QAAUO,QAAAA,EAAUC,0BAAAA,CAAgBR,SAAS,UAAA,EAAY,KAAA;;AAC5I
|
|
1
|
+
{"version":3,"file":"PrimePanelMenu.js","sources":["../../../menu/PrimePanelMenu.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { menuItemsProperty } from '../menuItems';\nimport { booleanProperty } from '../properties';\nimport { PanelMenu } from './PanelMenu';\n\n/**\n * The `PrimeReact:panelMenu` component - a vertical menu whose submenus expand in place, accordion style.\n *\n * PrimeReact 11 removed `panelmenu` with nothing to replace it, so what this adapts is Scene's own\n * {@link PanelMenu}. That replacement is the least hand-rolled of the seven in this folder: v11 still ships\n * `accordion`, and an accordion is exactly what a panel menu's expand-and-collapse behavior is, so only the\n * mapping from the authored item model onto those parts is Scene's.\n */\nexport function PrimePanelMenu({ element }: RegisteredComponentProps) {\n return <PanelMenu data-scene-id={element.id} items={menuItemsProperty(element, 'items')} multiple={booleanProperty(element, 'multiple', false)} />;\n}\n"],"names":["PrimePanelMenu","element","_jsx","PanelMenu","data-scene-id","id","items","menuItemsProperty","multiple","booleanProperty"],"mappings":";;;;;;;AAAA;AACA;AAOA;;;;;;;AAOC,IACM,SAASA,cAAAA,CAAe,EAAEC,OAAO,EAA4B,EAAA;AAChE,IAAA,qBAAOC,cAAA,CAACC,mBAAAA,EAAAA;AAAUC,QAAAA,eAAAA,EAAeH,QAAQI,EAAE;AAAEC,QAAAA,KAAAA,EAAOC,4BAAkBN,OAAAA,EAAS,OAAA,CAAA;QAAUO,QAAAA,EAAUC,0BAAAA,CAAgBR,SAAS,UAAA,EAAY,KAAA;;AAC5I;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeSteps.js","sources":["../../../menu/PrimeSteps.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { menuItemsProperty } from '../menuItems';\nimport { numberProperty } from '../properties';\nimport { Steps } from './Steps';\n\n/**\n * The `PrimeReact:steps` component - progress through a sequence, shown as numbered labels.\n *\n * Unlike `stepper` this shows position only and owns no content; a screen pairs it with whatever it wants\n * to render per step.\n *\n * PrimeReact 11 removed `steps` with nothing to replace it - `stepper` survives, but it owns the content of\n * each step and drives moving between them, which is the other component Scene already registers - so what\n * this adapts is Scene's own {@link Steps}.\n *\n * The position is now read straight from the element on every render rather than seeded into local state.\n * Scene's own {@link Steps} is a read-only indicator, so there is nothing left that could move the position\n * behind the authored value's back, and holding a copy of it would only let the two disagree.\n */\nexport function PrimeSteps({ element }: RegisteredComponentProps) {\n return <Steps data-scene-id={element.id} items={menuItemsProperty(element, 'items')} activeIndex={numberProperty(element, 'activeIndex', 0)} />;\n}\n"],"names":["PrimeSteps","element","_jsx","Steps","data-scene-id","id","items","menuItemsProperty","activeIndex","numberProperty"],"mappings":";;;;;;;AAAA;AACA;AAOA;;;;;;;;;;;;;AAaC,IACM,SAASA,UAAAA,CAAW,EAAEC,OAAO,EAA4B,EAAA;AAC5D,IAAA,qBAAOC,cAAA,CAACC,WAAAA,EAAAA;AAAMC,QAAAA,eAAAA,EAAeH,QAAQI,EAAE;AAAEC,QAAAA,KAAAA,EAAOC,4BAAkBN,OAAAA,EAAS,OAAA,CAAA;QAAUO,WAAAA,EAAaC,yBAAAA,CAAeR,SAAS,aAAA,EAAe,CAAA;;AAC7I
|
|
1
|
+
{"version":3,"file":"PrimeSteps.js","sources":["../../../menu/PrimeSteps.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { menuItemsProperty } from '../menuItems';\nimport { numberProperty } from '../properties';\nimport { Steps } from './Steps';\n\n/**\n * The `PrimeReact:steps` component - progress through a sequence, shown as numbered labels.\n *\n * Unlike `stepper` this shows position only and owns no content; a screen pairs it with whatever it wants\n * to render per step.\n *\n * PrimeReact 11 removed `steps` with nothing to replace it - `stepper` survives, but it owns the content of\n * each step and drives moving between them, which is the other component Scene already registers - so what\n * this adapts is Scene's own {@link Steps}.\n *\n * The position is now read straight from the element on every render rather than seeded into local state.\n * Scene's own {@link Steps} is a read-only indicator, so there is nothing left that could move the position\n * behind the authored value's back, and holding a copy of it would only let the two disagree.\n */\nexport function PrimeSteps({ element }: RegisteredComponentProps) {\n return <Steps data-scene-id={element.id} items={menuItemsProperty(element, 'items')} activeIndex={numberProperty(element, 'activeIndex', 0)} />;\n}\n"],"names":["PrimeSteps","element","_jsx","Steps","data-scene-id","id","items","menuItemsProperty","activeIndex","numberProperty"],"mappings":";;;;;;;AAAA;AACA;AAOA;;;;;;;;;;;;;AAaC,IACM,SAASA,UAAAA,CAAW,EAAEC,OAAO,EAA4B,EAAA;AAC5D,IAAA,qBAAOC,cAAA,CAACC,WAAAA,EAAAA;AAAMC,QAAAA,eAAAA,EAAeH,QAAQI,EAAE;AAAEC,QAAAA,KAAAA,EAAOC,4BAAkBN,OAAAA,EAAS,OAAA,CAAA;QAAUO,WAAAA,EAAaC,yBAAAA,CAAeR,SAAS,aAAA,EAAe,CAAA;;AAC7I;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeTabMenu.js","sources":["../../../menu/PrimeTabMenu.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { menuItemsProperty } from '../menuItems';\nimport { numberProperty } from '../properties';\nimport { TabMenu } from './TabMenu';\n\n/**\n * The `PrimeReact:tabMenu` component - tabs used for navigation rather than for hiding content.\n *\n * PrimeReact 11 removed `tabmenu` with nothing to replace it, so what this adapts is Scene's own\n * {@link TabMenu}. `primereact/tabs` does exist in v11 and looks like the obvious substitute, but it is\n * built for tabs that control panels; a navigation bar has none, and adopting it would announce panels\n * that are not there. Scene's replacement keeps the look and tells the truth about the semantics.\n *\n * The selected entry is held by the component itself so the control responds to clicks in a preview,\n * exactly as the v10 adapter did; the authored `activeIndex` is where it starts.\n */\nexport function PrimeTabMenu({ element }: RegisteredComponentProps) {\n return <TabMenu data-scene-id={element.id} items={menuItemsProperty(element, 'items')} activeIndex={numberProperty(element, 'activeIndex', 0)} />;\n}\n"],"names":["PrimeTabMenu","element","_jsx","TabMenu","data-scene-id","id","items","menuItemsProperty","activeIndex","numberProperty"],"mappings":";;;;;;;AAAA;AACA;AAOA;;;;;;;;;;AAUC,IACM,SAASA,YAAAA,CAAa,EAAEC,OAAO,EAA4B,EAAA;AAC9D,IAAA,qBAAOC,cAAA,CAACC,eAAAA,EAAAA;AAAQC,QAAAA,eAAAA,EAAeH,QAAQI,EAAE;AAAEC,QAAAA,KAAAA,EAAOC,4BAAkBN,OAAAA,EAAS,OAAA,CAAA;QAAUO,WAAAA,EAAaC,yBAAAA,CAAeR,SAAS,aAAA,EAAe,CAAA;;AAC/I
|
|
1
|
+
{"version":3,"file":"PrimeTabMenu.js","sources":["../../../menu/PrimeTabMenu.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { menuItemsProperty } from '../menuItems';\nimport { numberProperty } from '../properties';\nimport { TabMenu } from './TabMenu';\n\n/**\n * The `PrimeReact:tabMenu` component - tabs used for navigation rather than for hiding content.\n *\n * PrimeReact 11 removed `tabmenu` with nothing to replace it, so what this adapts is Scene's own\n * {@link TabMenu}. `primereact/tabs` does exist in v11 and looks like the obvious substitute, but it is\n * built for tabs that control panels; a navigation bar has none, and adopting it would announce panels\n * that are not there. Scene's replacement keeps the look and tells the truth about the semantics.\n *\n * The selected entry is held by the component itself so the control responds to clicks in a preview,\n * exactly as the v10 adapter did; the authored `activeIndex` is where it starts.\n */\nexport function PrimeTabMenu({ element }: RegisteredComponentProps) {\n return <TabMenu data-scene-id={element.id} items={menuItemsProperty(element, 'items')} activeIndex={numberProperty(element, 'activeIndex', 0)} />;\n}\n"],"names":["PrimeTabMenu","element","_jsx","TabMenu","data-scene-id","id","items","menuItemsProperty","activeIndex","numberProperty"],"mappings":";;;;;;;AAAA;AACA;AAOA;;;;;;;;;;AAUC,IACM,SAASA,YAAAA,CAAa,EAAEC,OAAO,EAA4B,EAAA;AAC9D,IAAA,qBAAOC,cAAA,CAACC,eAAAA,EAAAA;AAAQC,QAAAA,eAAAA,EAAeH,QAAQI,EAAE;AAAEC,QAAAA,KAAAA,EAAOC,4BAAkBN,OAAAA,EAAS,OAAA,CAAA;QAAUO,WAAAA,EAAaC,yBAAAA,CAAeR,SAAS,aAAA,EAAe,CAAA;;AAC/I;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeTieredMenu.js","sources":["../../../menu/PrimeTieredMenu.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { menuItemsProperty } from '../menuItems';\nimport { TieredMenu } from './TieredMenu';\n\n/**\n * The `PrimeReact:tieredMenu` component - a vertical menu whose submenus open to the side.\n *\n * PrimeReact 11 removed `tieredmenu` with nothing to replace it, so what this adapts is Scene's own\n * {@link TieredMenu}. It is the one component in this family that keeps unlimited nesting, which is why an\n * authored menu that genuinely goes three levels deep belongs here rather than in a `menubar`.\n */\nexport function PrimeTieredMenu({ element }: RegisteredComponentProps) {\n return <TieredMenu data-scene-id={element.id} items={menuItemsProperty(element, 'items')} />;\n}\n"],"names":["PrimeTieredMenu","element","_jsx","TieredMenu","data-scene-id","id","items","menuItemsProperty"],"mappings":";;;;;;AAAA;AACA;AAMA;;;;;;AAMC,IACM,SAASA,eAAAA,CAAgB,EAAEC,OAAO,EAA4B,EAAA;AACjE,IAAA,qBAAOC,cAAA,CAACC,qBAAAA,EAAAA;AAAWC,QAAAA,eAAAA,EAAeH,QAAQI,EAAE;AAAEC,QAAAA,KAAAA,EAAOC,4BAAkBN,OAAAA,EAAS,OAAA;;AACpF
|
|
1
|
+
{"version":3,"file":"PrimeTieredMenu.js","sources":["../../../menu/PrimeTieredMenu.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { menuItemsProperty } from '../menuItems';\nimport { TieredMenu } from './TieredMenu';\n\n/**\n * The `PrimeReact:tieredMenu` component - a vertical menu whose submenus open to the side.\n *\n * PrimeReact 11 removed `tieredmenu` with nothing to replace it, so what this adapts is Scene's own\n * {@link TieredMenu}. It is the one component in this family that keeps unlimited nesting, which is why an\n * authored menu that genuinely goes three levels deep belongs here rather than in a `menubar`.\n */\nexport function PrimeTieredMenu({ element }: RegisteredComponentProps) {\n return <TieredMenu data-scene-id={element.id} items={menuItemsProperty(element, 'items')} />;\n}\n"],"names":["PrimeTieredMenu","element","_jsx","TieredMenu","data-scene-id","id","items","menuItemsProperty"],"mappings":";;;;;;AAAA;AACA;AAMA;;;;;;AAMC,IACM,SAASA,eAAAA,CAAgB,EAAEC,OAAO,EAA4B,EAAA;AACjE,IAAA,qBAAOC,cAAA,CAACC,qBAAAA,EAAAA;AAAWC,QAAAA,eAAAA,EAAeH,QAAQI,EAAE;AAAEC,QAAAA,KAAAA,EAAOC,4BAAkBN,OAAAA,EAAS,OAAA;;AACpF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Steps.js","sources":["../../../menu/Steps.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 { CSSProperties, HTMLAttributes } from 'react';\nimport { MenuItem } from '../MenuItem';\nimport { MenuItemContent } from './MenuItemContent';\n\nconst listStyle: CSSProperties = { listStyle: 'none', margin: 0, padding: 0, color: 'var(--scene-text-color)' };\n\nconst markerStyle: CSSProperties = {\n width: '1.75rem',\n height: '1.75rem',\n borderRadius: '50%',\n border: '1px solid var(--scene-surface-border)',\n background: 'var(--scene-surface-card)',\n color: 'var(--scene-text-muted-color)',\n};\n\nconst reachedMarkerStyle: CSSProperties = {\n ...markerStyle,\n background: 'var(--scene-primary-color)',\n borderColor: 'var(--scene-primary-color)',\n color: 'var(--scene-primary-contrast-color)',\n};\n\nconst pendingStepStyle: CSSProperties = { color: 'var(--scene-text-muted-color)' };\n\n/**\n * The configuration {@link Steps} takes.\n */\nexport interface StepsProps extends HTMLAttributes<HTMLOListElement> {\n /**\n * The steps in the sequence, in order.\n */\n items?: MenuItem[];\n\n /**\n * The zero-based step the user is on. Everything before it counts as reached.\n */\n activeIndex?: number;\n}\n\n/**\n * A numbered horizontal indicator of where the user is in a sequence. Cratis-owned.\n *\n * This exists because PrimeReact 11 removed `primereact/steps` outright. `primereact/stepper` survives,\n * but it is not a replacement: a stepper owns the content of each step and drives moving between them,\n * whereas `steps` shows position and nothing else, next to whatever a screen chose to render itself. Scene\n * has both concepts and they are registered separately, so collapsing one into the other would silently\n * change what an authored screen means.\n *\n * It is an ordered list because that is what it is - a numbered sequence, read in order - and the step the\n * user is on is marked with `aria-current` rather than only with color, so the position is available to a\n * screen reader and not just to an eye.\n *\n * What it deliberately does not carry over from the v10 `Steps`: the indicator is read-only, so v10's\n * `readOnly={false}` mode where clicking a step jumped to it is gone, and with it the `onSelect` callback\n * and the internally held selection. A screen that wants navigable steps should hold the position itself\n * and render whatever control it wants to move between them. Item templates and the vertical layout are\n * not supported either.\n */\nexport function Steps({ items = [], activeIndex = 0, ...rest }: StepsProps) {\n return (\n <ol {...rest} className='flex items-center gap-4' style={listStyle}>\n {items.map((item, index) => (\n <li\n key={index}\n className='inline-flex items-center gap-2'\n style={index <= activeIndex ? undefined : pendingStepStyle}\n aria-current={index === activeIndex ? 'step' : undefined}>\n <span className='inline-flex items-center justify-center' aria-hidden='true' style={index <= activeIndex ? reachedMarkerStyle : markerStyle}>\n {index + 1}\n </span>\n <MenuItemContent item={item} />\n </li>\n ))}\n </ol>\n );\n}\n"],"names":["listStyle","margin","padding","color","markerStyle","width","height","borderRadius","border","background","reachedMarkerStyle","borderColor","pendingStepStyle","Steps","items","activeIndex","rest","_jsx","ol","className","style","map","item","index","_jsxs","li","undefined","aria-current","span","aria-hidden","MenuItemContent"],"mappings":";;;;;AAAA;AACA;AAMA,MAAMA,SAAAA,GAA2B;IAAEA,SAAAA,EAAW,MAAA;IAAQC,MAAAA,EAAQ,CAAA;IAAGC,OAAAA,EAAS,CAAA;IAAGC,KAAAA,EAAO;AAA0B,CAAA;AAE9G,MAAMC,WAAAA,GAA6B;IAC/BC,KAAAA,EAAO,SAAA;IACPC,MAAAA,EAAQ,SAAA;IACRC,YAAAA,EAAc,KAAA;IACdC,MAAAA,EAAQ,uCAAA;IACRC,UAAAA,EAAY,2BAAA;IACZN,KAAAA,EAAO;AACX,CAAA;AAEA,MAAMO,kBAAAA,GAAoC;AACtC,IAAA,GAAGN,WAAW;IACdK,UAAAA,EAAY,4BAAA;IACZE,WAAAA,EAAa,4BAAA;IACbR,KAAAA,EAAO;AACX,CAAA;AAEA,MAAMS,gBAAAA,GAAkC;IAAET,KAAAA,EAAO;AAAgC,CAAA;AAiBjF;;;;;;;;;;;;;;;;;;IAmBO,SAASU,KAAAA,CAAM,EAAEC,KAAAA,GAAQ,EAAE,EAAEC,WAAAA,GAAc,CAAC,EAAE,GAAGC,IAAAA,EAAkB,EAAA;AACtE,IAAA,qBACIC,cAAA,CAACC,IAAAA,EAAAA;AAAI,QAAA,GAAGF,IAAI;QAAEG,SAAAA,EAAU,yBAAA;QAA0BC,KAAAA,EAAOpB,SAAAA;AACpDc,QAAAA,QAAAA,EAAAA,KAAAA,CAAMO,GAAG,CAAC,CAACC,IAAAA,EAAMC,sBACdC,eAAA,CAACC,IAAAA,EAAAA;gBAEGN,SAAAA,EAAU,gCAAA;gBACVC,KAAAA,EAAOG,KAAAA,IAASR,cAAcW,SAAAA,GAAYd,gBAAAA;gBAC1Ce,cAAAA,EAAcJ,KAAAA,KAAUR,cAAc,MAAA,GAASW,SAAAA;;kCAC/CT,cAAA,CAACW,MAAAA,EAAAA;wBAAKT,SAAAA,EAAU,yCAAA;wBAA0CU,aAAAA,EAAY,MAAA;wBAAOT,KAAAA,EAAOG,KAAAA,IAASR,cAAcL,kBAAAA,GAAqBN,WAAAA;kCAC3HmB,KAAAA,GAAQ;;kCAEbN,cAAA,CAACa,+BAAAA,EAAAA;wBAAgBR,IAAAA,EAAMA;;;AAPlBC,aAAAA,EAAAA,KAAAA,CAAAA;;AAYzB
|
|
1
|
+
{"version":3,"file":"Steps.js","sources":["../../../menu/Steps.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 { CSSProperties, HTMLAttributes } from 'react';\nimport { MenuItem } from '../MenuItem';\nimport { MenuItemContent } from './MenuItemContent';\n\nconst listStyle: CSSProperties = { listStyle: 'none', margin: 0, padding: 0, color: 'var(--scene-text-color)' };\n\nconst markerStyle: CSSProperties = {\n width: '1.75rem',\n height: '1.75rem',\n borderRadius: '50%',\n border: '1px solid var(--scene-surface-border)',\n background: 'var(--scene-surface-card)',\n color: 'var(--scene-text-muted-color)',\n};\n\nconst reachedMarkerStyle: CSSProperties = {\n ...markerStyle,\n background: 'var(--scene-primary-color)',\n borderColor: 'var(--scene-primary-color)',\n color: 'var(--scene-primary-contrast-color)',\n};\n\nconst pendingStepStyle: CSSProperties = { color: 'var(--scene-text-muted-color)' };\n\n/**\n * The configuration {@link Steps} takes.\n */\nexport interface StepsProps extends HTMLAttributes<HTMLOListElement> {\n /**\n * The steps in the sequence, in order.\n */\n items?: MenuItem[];\n\n /**\n * The zero-based step the user is on. Everything before it counts as reached.\n */\n activeIndex?: number;\n}\n\n/**\n * A numbered horizontal indicator of where the user is in a sequence. Cratis-owned.\n *\n * This exists because PrimeReact 11 removed `primereact/steps` outright. `primereact/stepper` survives,\n * but it is not a replacement: a stepper owns the content of each step and drives moving between them,\n * whereas `steps` shows position and nothing else, next to whatever a screen chose to render itself. Scene\n * has both concepts and they are registered separately, so collapsing one into the other would silently\n * change what an authored screen means.\n *\n * It is an ordered list because that is what it is - a numbered sequence, read in order - and the step the\n * user is on is marked with `aria-current` rather than only with color, so the position is available to a\n * screen reader and not just to an eye.\n *\n * What it deliberately does not carry over from the v10 `Steps`: the indicator is read-only, so v10's\n * `readOnly={false}` mode where clicking a step jumped to it is gone, and with it the `onSelect` callback\n * and the internally held selection. A screen that wants navigable steps should hold the position itself\n * and render whatever control it wants to move between them. Item templates and the vertical layout are\n * not supported either.\n */\nexport function Steps({ items = [], activeIndex = 0, ...rest }: StepsProps) {\n return (\n <ol {...rest} className='flex items-center gap-4' style={listStyle}>\n {items.map((item, index) => (\n <li\n key={index}\n className='inline-flex items-center gap-2'\n style={index <= activeIndex ? undefined : pendingStepStyle}\n aria-current={index === activeIndex ? 'step' : undefined}>\n <span className='inline-flex items-center justify-center' aria-hidden='true' style={index <= activeIndex ? reachedMarkerStyle : markerStyle}>\n {index + 1}\n </span>\n <MenuItemContent item={item} />\n </li>\n ))}\n </ol>\n );\n}\n"],"names":["listStyle","margin","padding","color","markerStyle","width","height","borderRadius","border","background","reachedMarkerStyle","borderColor","pendingStepStyle","Steps","items","activeIndex","rest","_jsx","ol","className","style","map","item","index","_jsxs","li","undefined","aria-current","span","aria-hidden","MenuItemContent"],"mappings":";;;;;AAAA;AACA;AAMA,MAAMA,SAAAA,GAA2B;IAAEA,SAAAA,EAAW,MAAA;IAAQC,MAAAA,EAAQ,CAAA;IAAGC,OAAAA,EAAS,CAAA;IAAGC,KAAAA,EAAO;AAA0B,CAAA;AAE9G,MAAMC,WAAAA,GAA6B;IAC/BC,KAAAA,EAAO,SAAA;IACPC,MAAAA,EAAQ,SAAA;IACRC,YAAAA,EAAc,KAAA;IACdC,MAAAA,EAAQ,uCAAA;IACRC,UAAAA,EAAY,2BAAA;IACZN,KAAAA,EAAO;AACX,CAAA;AAEA,MAAMO,kBAAAA,GAAoC;AACtC,IAAA,GAAGN,WAAW;IACdK,UAAAA,EAAY,4BAAA;IACZE,WAAAA,EAAa,4BAAA;IACbR,KAAAA,EAAO;AACX,CAAA;AAEA,MAAMS,gBAAAA,GAAkC;IAAET,KAAAA,EAAO;AAAgC,CAAA;AAiBjF;;;;;;;;;;;;;;;;;;IAmBO,SAASU,KAAAA,CAAM,EAAEC,KAAAA,GAAQ,EAAE,EAAEC,WAAAA,GAAc,CAAC,EAAE,GAAGC,IAAAA,EAAkB,EAAA;AACtE,IAAA,qBACIC,cAAA,CAACC,IAAAA,EAAAA;AAAI,QAAA,GAAGF,IAAI;QAAEG,SAAAA,EAAU,yBAAA;QAA0BC,KAAAA,EAAOpB,SAAAA;AACpDc,QAAAA,QAAAA,EAAAA,KAAAA,CAAMO,GAAG,CAAC,CAACC,IAAAA,EAAMC,sBACdC,eAAA,CAACC,IAAAA,EAAAA;gBAEGN,SAAAA,EAAU,gCAAA;gBACVC,KAAAA,EAAOG,KAAAA,IAASR,cAAcW,SAAAA,GAAYd,gBAAAA;gBAC1Ce,cAAAA,EAAcJ,KAAAA,KAAUR,cAAc,MAAA,GAASW,SAAAA;;kCAC/CT,cAAA,CAACW,MAAAA,EAAAA;wBAAKT,SAAAA,EAAU,yCAAA;wBAA0CU,aAAAA,EAAY,MAAA;wBAAOT,KAAAA,EAAOG,KAAAA,IAASR,cAAcL,kBAAAA,GAAqBN,WAAAA;kCAC3HmB,KAAAA,GAAQ;;kCAEbN,cAAA,CAACa,+BAAAA,EAAAA;wBAAgBR,IAAAA,EAAMA;;;AAPlBC,aAAAA,EAAAA,KAAAA,CAAAA;;AAYzB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabMenu.js","sources":["../../../menu/TabMenu.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 { CSSProperties, HTMLAttributes, useState } from 'react';\nimport { MenuItem } from '../MenuItem';\nimport { MenuItemAction } from './MenuItemAction';\n\nconst barStyle: CSSProperties = { borderBottom: '1px solid var(--scene-surface-border)', color: 'var(--scene-text-color)' };\n\nconst tabStyle: CSSProperties = {\n background: 'transparent',\n border: 'none',\n borderBottom: '2px solid transparent',\n color: 'var(--scene-text-muted-color)',\n cursor: 'pointer',\n font: 'inherit',\n textDecoration: 'none',\n};\n\nconst selectedTabStyle: CSSProperties = { ...tabStyle, borderBottomColor: 'var(--scene-primary-color)', color: 'var(--scene-text-color)' };\n\n/**\n * The configuration {@link TabMenu} takes.\n */\nexport interface TabMenuProps extends HTMLAttributes<HTMLElement> {\n /**\n * The destinations to show, in order.\n */\n items?: MenuItem[];\n\n /**\n * The zero-based entry to start on.\n */\n activeIndex?: number;\n}\n\n/**\n * Tab-styled horizontal navigation between destinations. Cratis-owned.\n *\n * This exists because PrimeReact 11 removed `primereact/tabmenu` outright. `primereact/tabs` survives and\n * was the obvious candidate to build on, but it was rejected on purpose: `Tabs.Tab` emits `role=\"tab\"` and\n * an `aria-controls` pointing at the tab panel it expects to sit beside, and a navigation bar has no\n * panels. Adopting it would produce markup that announces panels which do not exist and references ids\n * that resolve to nothing - a real accessibility defect traded for a little less code.\n *\n * So this is a `nav` holding links and buttons, with the current entry marked `aria-current`, which is the\n * pattern the tabs look is imitating. The tab appearance is styling; the semantics are navigation, and\n * they now agree.\n *\n * What it deliberately does not carry over from the v10 `TabMenu`: there is no roving-focus keyboard model\n * with arrow keys moving between entries - the entries are ordinary links and buttons in the tab order -\n * no scroll buttons when the entries overflow, no sliding active-bar animation, and no item templates. The\n * selected entry is held here so the control responds in a preview, exactly as the v10 adapter did.\n */\nexport function TabMenu({ items = [], activeIndex = 0, ...rest }: TabMenuProps) {\n const [selectedIndex, setSelectedIndex] = useState(activeIndex);\n\n return (\n <nav {...rest} className='flex items-center gap-2' style={barStyle}>\n {items.map((item, index) => (\n <MenuItemAction\n key={index}\n item={item}\n current={index === selectedIndex}\n className='inline-flex items-center gap-2 p-3'\n style={index === selectedIndex ? selectedTabStyle : tabStyle}\n onActivate={() => setSelectedIndex(index)}\n />\n ))}\n </nav>\n );\n}\n"],"names":["barStyle","borderBottom","color","tabStyle","background","border","cursor","font","textDecoration","selectedTabStyle","borderBottomColor","TabMenu","items","activeIndex","rest","selectedIndex","setSelectedIndex","useState","_jsx","nav","className","style","map","item","index","MenuItemAction","current","onActivate"],"mappings":";;;;;;AAOA,MAAMA,QAAAA,GAA0B;IAAEC,YAAAA,EAAc,uCAAA;IAAyCC,KAAAA,EAAO;AAA0B,CAAA;AAE1H,MAAMC,QAAAA,GAA0B;IAC5BC,UAAAA,EAAY,aAAA;IACZC,MAAAA,EAAQ,MAAA;IACRJ,YAAAA,EAAc,uBAAA;IACdC,KAAAA,EAAO,+BAAA;IACPI,MAAAA,EAAQ,SAAA;IACRC,IAAAA,EAAM,SAAA;IACNC,cAAAA,EAAgB;AACpB,CAAA;AAEA,MAAMC,gBAAAA,GAAkC;AAAE,IAAA,GAAGN,QAAQ;IAAEO,iBAAAA,EAAmB,4BAAA;IAA8BR,KAAAA,EAAO;AAA0B,CAAA;AAiBzI;;;;;;;;;;;;;;;;;IAkBO,SAASS,OAAAA,CAAQ,EAAEC,KAAAA,GAAQ,EAAE,EAAEC,WAAAA,GAAc,CAAC,EAAE,GAAGC,IAAAA,EAAoB,EAAA;AAC1E,IAAA,MAAM,CAACC,aAAAA,EAAeC,gBAAAA,CAAiB,GAAGC,cAAAA,CAASJ,WAAAA,CAAAA;AAEnD,IAAA,qBACIK,cAAA,CAACC,KAAAA,EAAAA;AAAK,QAAA,GAAGL,IAAI;QAAEM,SAAAA,EAAU,yBAAA;QAA0BC,KAAAA,EAAOrB,QAAAA;AACrDY,QAAAA,QAAAA,EAAAA,KAAAA,CAAMU,GAAG,CAAC,CAACC,IAAAA,EAAMC,sBACdN,cAAA,CAACO,6BAAAA,EAAAA;gBAEGF,IAAAA,EAAMA,IAAAA;AACNG,gBAAAA,OAAAA,EAASF,KAAAA,KAAUT,aAAAA;gBACnBK,SAAAA,EAAU,oCAAA;gBACVC,KAAAA,EAAOG,KAAAA,KAAUT,gBAAgBN,gBAAAA,GAAmBN,QAAAA;AACpDwB,gBAAAA,UAAAA,EAAY,IAAMX,gBAAAA,CAAiBQ,KAAAA;AAL9BA,aAAAA,EAAAA,KAAAA,CAAAA;;AAUzB
|
|
1
|
+
{"version":3,"file":"TabMenu.js","sources":["../../../menu/TabMenu.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 { CSSProperties, HTMLAttributes, useState } from 'react';\nimport { MenuItem } from '../MenuItem';\nimport { MenuItemAction } from './MenuItemAction';\n\nconst barStyle: CSSProperties = { borderBottom: '1px solid var(--scene-surface-border)', color: 'var(--scene-text-color)' };\n\nconst tabStyle: CSSProperties = {\n background: 'transparent',\n border: 'none',\n borderBottom: '2px solid transparent',\n color: 'var(--scene-text-muted-color)',\n cursor: 'pointer',\n font: 'inherit',\n textDecoration: 'none',\n};\n\nconst selectedTabStyle: CSSProperties = { ...tabStyle, borderBottomColor: 'var(--scene-primary-color)', color: 'var(--scene-text-color)' };\n\n/**\n * The configuration {@link TabMenu} takes.\n */\nexport interface TabMenuProps extends HTMLAttributes<HTMLElement> {\n /**\n * The destinations to show, in order.\n */\n items?: MenuItem[];\n\n /**\n * The zero-based entry to start on.\n */\n activeIndex?: number;\n}\n\n/**\n * Tab-styled horizontal navigation between destinations. Cratis-owned.\n *\n * This exists because PrimeReact 11 removed `primereact/tabmenu` outright. `primereact/tabs` survives and\n * was the obvious candidate to build on, but it was rejected on purpose: `Tabs.Tab` emits `role=\"tab\"` and\n * an `aria-controls` pointing at the tab panel it expects to sit beside, and a navigation bar has no\n * panels. Adopting it would produce markup that announces panels which do not exist and references ids\n * that resolve to nothing - a real accessibility defect traded for a little less code.\n *\n * So this is a `nav` holding links and buttons, with the current entry marked `aria-current`, which is the\n * pattern the tabs look is imitating. The tab appearance is styling; the semantics are navigation, and\n * they now agree.\n *\n * What it deliberately does not carry over from the v10 `TabMenu`: there is no roving-focus keyboard model\n * with arrow keys moving between entries - the entries are ordinary links and buttons in the tab order -\n * no scroll buttons when the entries overflow, no sliding active-bar animation, and no item templates. The\n * selected entry is held here so the control responds in a preview, exactly as the v10 adapter did.\n */\nexport function TabMenu({ items = [], activeIndex = 0, ...rest }: TabMenuProps) {\n const [selectedIndex, setSelectedIndex] = useState(activeIndex);\n\n return (\n <nav {...rest} className='flex items-center gap-2' style={barStyle}>\n {items.map((item, index) => (\n <MenuItemAction\n key={index}\n item={item}\n current={index === selectedIndex}\n className='inline-flex items-center gap-2 p-3'\n style={index === selectedIndex ? selectedTabStyle : tabStyle}\n onActivate={() => setSelectedIndex(index)}\n />\n ))}\n </nav>\n );\n}\n"],"names":["barStyle","borderBottom","color","tabStyle","background","border","cursor","font","textDecoration","selectedTabStyle","borderBottomColor","TabMenu","items","activeIndex","rest","selectedIndex","setSelectedIndex","useState","_jsx","nav","className","style","map","item","index","MenuItemAction","current","onActivate"],"mappings":";;;;;;AAOA,MAAMA,QAAAA,GAA0B;IAAEC,YAAAA,EAAc,uCAAA;IAAyCC,KAAAA,EAAO;AAA0B,CAAA;AAE1H,MAAMC,QAAAA,GAA0B;IAC5BC,UAAAA,EAAY,aAAA;IACZC,MAAAA,EAAQ,MAAA;IACRJ,YAAAA,EAAc,uBAAA;IACdC,KAAAA,EAAO,+BAAA;IACPI,MAAAA,EAAQ,SAAA;IACRC,IAAAA,EAAM,SAAA;IACNC,cAAAA,EAAgB;AACpB,CAAA;AAEA,MAAMC,gBAAAA,GAAkC;AAAE,IAAA,GAAGN,QAAQ;IAAEO,iBAAAA,EAAmB,4BAAA;IAA8BR,KAAAA,EAAO;AAA0B,CAAA;AAiBzI;;;;;;;;;;;;;;;;;IAkBO,SAASS,OAAAA,CAAQ,EAAEC,KAAAA,GAAQ,EAAE,EAAEC,WAAAA,GAAc,CAAC,EAAE,GAAGC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