@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":"TieredMenu.js","sources":["../../../menu/TieredMenu.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';\nimport { MenuItemContent } from './MenuItemContent';\n\nconst rootStyle: 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 width: 'fit-content',\n};\n\nconst listStyle: CSSProperties = { listStyle: 'none', margin: 0, padding: 0, minWidth: '12rem' };\n\nconst entryStyle: 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\nconst submenuStyle: CSSProperties = {\n position: 'absolute',\n top: 0,\n left: '100%',\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 separatorStyle: CSSProperties = { borderTop: '1px solid var(--scene-surface-border)', margin: 0 };\n\n/**\n * The configuration {@link TieredMenu} takes.\n */\nexport interface TieredMenuProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * The commands to show. Nesting is followed to any depth - each level opens beside its parent.\n */\n items?: MenuItem[];\n}\n\n/**\n * A vertical menu whose submenus open to the side, to any depth. Cratis-owned.\n *\n * This exists because PrimeReact 11 removed `primereact/tieredmenu` outright, with no successor and no\n * headless hook. The surviving `primereact/menu` parts can nest through `Menu.Submenu`, but only inside a\n * popup anchored to a trigger; a tiered menu is an *inline* control that is already open, which those\n * parts have no shape for. Rebuilding it as plain markup is both smaller and more honest than bending an\n * overlay into standing still.\n *\n * Depth is the one thing this keeps unrestricted, because depth is the whole point of the component: each\n * level renders the same way and holds its own open child, so an authored model nests as far as its\n * author took it.\n *\n * What it deliberately does not carry over from the v10 `TieredMenu`: submenus open on click, never on\n * hover; there is no roving-focus keyboard model with arrow keys walking levels, only the tab order the\n * browser gives; the popup form (`popup` plus an imperative `toggle`) is gone entirely, since Scene only\n * ever rendered the inline one; opening a deep branch does not flip the level to the other side when it\n * would run off the viewport; and item templates are not supported.\n */\nexport function TieredMenu({ items = [], ...rest }: TieredMenuProps) {\n return (\n <div {...rest} style={rootStyle}>\n <TieredMenuLevel items={items} />\n </div>\n );\n}\n\n/**\n * The configuration one level of a tiered menu takes.\n */\ninterface TieredMenuLevelProps {\n /**\n * The entries at this level.\n */\n items: MenuItem[];\n}\n\n/**\n * One level of a tiered menu, holding which of its own entries is currently expanded.\n *\n * Keeping the open entry per level rather than as one path in the root is what makes the recursion\n * trivial: a level knows only about its own children, so it can render another of itself for them without\n * threading an index path down and back.\n */\nfunction TieredMenuLevel({ items }: TieredMenuLevelProps) {\n const [openIndex, setOpenIndex] = useState<number | undefined>(undefined);\n\n return (\n <ul role='menu' style={listStyle}>\n {items.map((item, index) => {\n if (item.separator === true) return <li key={index} role='separator' style={separatorStyle} />;\n\n const children = item.items ?? [];\n\n return (\n <li key={index} role='none' className='relative'>\n {children.length > 0 ? (\n <>\n <button\n type='button'\n role='menuitem'\n className='flex items-center gap-2 p-3'\n style={entryStyle}\n disabled={item.disabled}\n aria-haspopup='true'\n aria-expanded={openIndex === index}\n onClick={() => setOpenIndex(openIndex === index ? undefined : index)}>\n <MenuItemContent item={item} />\n <i className='pi pi-angle-right' aria-hidden='true' />\n </button>\n {openIndex === index && (\n <div style={submenuStyle}>\n <TieredMenuLevel items={children} />\n </div>\n )}\n </>\n ) : (\n <MenuItemAction item={item} role='menuitem' className='flex items-center gap-2 p-3' style={entryStyle} />\n )}\n </li>\n );\n })}\n </ul>\n );\n}\n"],"names":["rootStyle","background","border","borderRadius","color","width","listStyle","margin","padding","minWidth","entryStyle","cursor","font","textAlign","textDecoration","submenuStyle","position","top","left","zIndex","separatorStyle","borderTop","TieredMenu","items","rest","_jsx","div","style","TieredMenuLevel","openIndex","setOpenIndex","useState","undefined","ul","role","map","item","index","separator","li","children","className","length","_jsxs","_Fragment","button","type","disabled","aria-haspopup","aria-expanded","onClick","MenuItemContent","i","aria-hidden","MenuItemAction"],"mappings":"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
|
|
1
|
+
{"version":3,"file":"TieredMenu.js","sources":["../../../menu/TieredMenu.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';\nimport { MenuItemContent } from './MenuItemContent';\n\nconst rootStyle: 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 width: 'fit-content',\n};\n\nconst listStyle: CSSProperties = { listStyle: 'none', margin: 0, padding: 0, minWidth: '12rem' };\n\nconst entryStyle: 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\nconst submenuStyle: CSSProperties = {\n position: 'absolute',\n top: 0,\n left: '100%',\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 separatorStyle: CSSProperties = { borderTop: '1px solid var(--scene-surface-border)', margin: 0 };\n\n/**\n * The configuration {@link TieredMenu} takes.\n */\nexport interface TieredMenuProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * The commands to show. Nesting is followed to any depth - each level opens beside its parent.\n */\n items?: MenuItem[];\n}\n\n/**\n * A vertical menu whose submenus open to the side, to any depth. Cratis-owned.\n *\n * This exists because PrimeReact 11 removed `primereact/tieredmenu` outright, with no successor and no\n * headless hook. The surviving `primereact/menu` parts can nest through `Menu.Submenu`, but only inside a\n * popup anchored to a trigger; a tiered menu is an *inline* control that is already open, which those\n * parts have no shape for. Rebuilding it as plain markup is both smaller and more honest than bending an\n * overlay into standing still.\n *\n * Depth is the one thing this keeps unrestricted, because depth is the whole point of the component: each\n * level renders the same way and holds its own open child, so an authored model nests as far as its\n * author took it.\n *\n * What it deliberately does not carry over from the v10 `TieredMenu`: submenus open on click, never on\n * hover; there is no roving-focus keyboard model with arrow keys walking levels, only the tab order the\n * browser gives; the popup form (`popup` plus an imperative `toggle`) is gone entirely, since Scene only\n * ever rendered the inline one; opening a deep branch does not flip the level to the other side when it\n * would run off the viewport; and item templates are not supported.\n */\nexport function TieredMenu({ items = [], ...rest }: TieredMenuProps) {\n return (\n <div {...rest} style={rootStyle}>\n <TieredMenuLevel items={items} />\n </div>\n );\n}\n\n/**\n * The configuration one level of a tiered menu takes.\n */\ninterface TieredMenuLevelProps {\n /**\n * The entries at this level.\n */\n items: MenuItem[];\n}\n\n/**\n * One level of a tiered menu, holding which of its own entries is currently expanded.\n *\n * Keeping the open entry per level rather than as one path in the root is what makes the recursion\n * trivial: a level knows only about its own children, so it can render another of itself for them without\n * threading an index path down and back.\n */\nfunction TieredMenuLevel({ items }: TieredMenuLevelProps) {\n const [openIndex, setOpenIndex] = useState<number | undefined>(undefined);\n\n return (\n <ul role='menu' style={listStyle}>\n {items.map((item, index) => {\n if (item.separator === true) return <li key={index} role='separator' style={separatorStyle} />;\n\n const children = item.items ?? [];\n\n return (\n <li key={index} role='none' className='relative'>\n {children.length > 0 ? (\n <>\n <button\n type='button'\n role='menuitem'\n className='flex items-center gap-2 p-3'\n style={entryStyle}\n disabled={item.disabled}\n aria-haspopup='true'\n aria-expanded={openIndex === index}\n onClick={() => setOpenIndex(openIndex === index ? undefined : index)}>\n <MenuItemContent item={item} />\n <i className='pi pi-angle-right' aria-hidden='true' />\n </button>\n {openIndex === index && (\n <div style={submenuStyle}>\n <TieredMenuLevel items={children} />\n </div>\n )}\n </>\n ) : (\n <MenuItemAction item={item} role='menuitem' className='flex items-center gap-2 p-3' style={entryStyle} />\n )}\n </li>\n );\n })}\n </ul>\n );\n}\n"],"names":["rootStyle","background","border","borderRadius","color","width","listStyle","margin","padding","minWidth","entryStyle","cursor","font","textAlign","textDecoration","submenuStyle","position","top","left","zIndex","separatorStyle","borderTop","TieredMenu","items","rest","_jsx","div","style","TieredMenuLevel","openIndex","setOpenIndex","useState","undefined","ul","role","map","item","index","separator","li","children","className","length","_jsxs","_Fragment","button","type","disabled","aria-haspopup","aria-expanded","onClick","MenuItemContent","i","aria-hidden","MenuItemAction"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menuItems.js","sources":["../../menuItems.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\nimport { MenuItem } from './MenuItem';\nimport { SceneElement } from '@cratis/scene.model';\nimport { arrayProperty } from './properties';\n\n/**\n * Turns raw authored entries into the `MenuItem` model every PrimeReact menu, menubar, breadcrumb,\n * split button and dock takes.\n *\n * Ten different components in this package all want the same nested `{ label, icon, items }` shape, so\n * reading it lives here once rather than in each of them. Nesting is followed to any depth because a\n * menubar and a tiered menu differ only in how deep an author actually goes - the reader should not be\n * the thing that decides.\n *\n * Entries with no usable label are dropped rather than rendered blank, and a `separator: true` entry is\n * kept without one, because that is PrimeReact's own way of spelling a divider.\n *\n * @param entries The raw entries to convert.\n * @returns The converted menu items, in order.\n */\nexport function toMenuItems(entries: unknown[]): MenuItem[] {\n const items: MenuItem[] = [];\n for (const entry of entries) {\n if (typeof entry === 'string') {\n items.push({ label: entry });\n continue;\n }\n\n if (typeof entry !== 'object' || entry === undefined || entry === null || Array.isArray(entry)) continue;\n\n const record = entry as Record<string, unknown>;\n const item: MenuItem = {};\n if (typeof record.label === 'string') item.label = record.label;\n if (typeof record.icon === 'string') item.icon = record.icon;\n if (typeof record.url === 'string') item.url = record.url;\n if (typeof record.disabled === 'boolean') item.disabled = record.disabled;\n if (record.separator === true) item.separator = true;\n if (Array.isArray(record.items)) item.items = toMenuItems(record.items);\n if (item.label === undefined && item.separator !== true) continue;\n items.push(item);\n }\n\n return items;\n}\n\n/**\n * Reads a menu model off a Scene element's properties.\n *\n * @param element The element whose properties to read.\n * @param name The property name holding the entries.\n * @returns The converted menu items, empty when the property is missing or is not an array.\n */\nexport function menuItemsProperty(element: SceneElement, name: string): MenuItem[] {\n return toMenuItems(arrayProperty(element, name));\n}\n"],"names":["toMenuItems","entries","items","entry","push","label","undefined","Array","isArray","record","item","icon","url","disabled","separator","menuItemsProperty","element","name","arrayProperty"],"mappings":";;;;AAAA;AACA;AAMA;;;;;;;;;;;;;;IAeO,SAASA,WAAAA,CAAYC,OAAkB,EAAA;AAC1C,IAAA,MAAMC,QAAoB,EAAE;IAC5B,KAAK,MAAMC,SAASF,OAAAA,CAAS;QACzB,IAAI,OAAOE,UAAU,QAAA,EAAU;AAC3BD,YAAAA,KAAAA,CAAME,IAAI,CAAC;gBAAEC,KAAAA,EAAOF;AAAM,aAAA,CAAA;AAC1B,YAAA;AACJ,QAAA;QAEA,IAAI,OAAOA,KAAAA,KAAU,QAAA,IAAYA,KAAAA,KAAUG,SAAAA,IAAaH,UAAU,IAAA,IAAQI,KAAAA,CAAMC,OAAO,CAACL,KAAAA,CAAAA,EAAQ;AAEhG,QAAA,MAAMM,MAAAA,GAASN,KAAAA;AACf,QAAA,MAAMO,OAAiB,EAAC;QACxB,IAAI,OAAOD,OAAOJ,KAAK,KAAK,UAAUK,IAAAA,CAAKL,KAAK,GAAGI,MAAAA,CAAOJ,KAAK;QAC/D,IAAI,OAAOI,OAAOE,IAAI,KAAK,UAAUD,IAAAA,CAAKC,IAAI,GAAGF,MAAAA,CAAOE,IAAI;QAC5D,IAAI,OAAOF,OAAOG,GAAG,KAAK,UAAUF,IAAAA,CAAKE,GAAG,GAAGH,MAAAA,CAAOG,GAAG;QACzD,IAAI,OAAOH,OAAOI,QAAQ,KAAK,WAAWH,IAAAA,CAAKG,QAAQ,GAAGJ,MAAAA,CAAOI,QAAQ;AACzE,QAAA,IAAIJ,OAAOK,SAAS,KAAK,IAAA,EAAMJ,IAAAA,CAAKI,SAAS,GAAG,IAAA;QAChD,IAAIP,KAAAA,CAAMC,OAAO,CAACC,MAAAA,CAAOP,KAAK,CAAA,EAAGQ,IAAAA,CAAKR,KAAK,GAAGF,WAAAA,CAAYS,MAAAA,CAAOP,KAAK,CAAA;AACtE,QAAA,IAAIQ,KAAKL,KAAK,KAAKC,aAAaI,IAAAA,CAAKI,SAAS,KAAK,IAAA,EAAM;AACzDZ,QAAAA,KAAAA,CAAME,IAAI,CAACM,IAAAA,CAAAA;AACf,IAAA;IAEA,OAAOR,KAAAA;AACX;AAEA;;;;;;AAMC,IACM,SAASa,iBAAAA,CAAkBC,OAAqB,EAAEC,IAAY,EAAA;IACjE,OAAOjB,WAAAA,CAAYkB,yBAAcF,OAAAA,EAASC,IAAAA,CAAAA,CAAAA;AAC9C
|
|
1
|
+
{"version":3,"file":"menuItems.js","sources":["../../menuItems.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\nimport { MenuItem } from './MenuItem';\nimport { SceneElement } from '@cratis/scene.model';\nimport { arrayProperty } from './properties';\n\n/**\n * Turns raw authored entries into the `MenuItem` model every PrimeReact menu, menubar, breadcrumb,\n * split button and dock takes.\n *\n * Ten different components in this package all want the same nested `{ label, icon, items }` shape, so\n * reading it lives here once rather than in each of them. Nesting is followed to any depth because a\n * menubar and a tiered menu differ only in how deep an author actually goes - the reader should not be\n * the thing that decides.\n *\n * Entries with no usable label are dropped rather than rendered blank, and a `separator: true` entry is\n * kept without one, because that is PrimeReact's own way of spelling a divider.\n *\n * @param entries The raw entries to convert.\n * @returns The converted menu items, in order.\n */\nexport function toMenuItems(entries: unknown[]): MenuItem[] {\n const items: MenuItem[] = [];\n for (const entry of entries) {\n if (typeof entry === 'string') {\n items.push({ label: entry });\n continue;\n }\n\n if (typeof entry !== 'object' || entry === undefined || entry === null || Array.isArray(entry)) continue;\n\n const record = entry as Record<string, unknown>;\n const item: MenuItem = {};\n if (typeof record.label === 'string') item.label = record.label;\n if (typeof record.icon === 'string') item.icon = record.icon;\n if (typeof record.url === 'string') item.url = record.url;\n if (typeof record.disabled === 'boolean') item.disabled = record.disabled;\n if (record.separator === true) item.separator = true;\n if (Array.isArray(record.items)) item.items = toMenuItems(record.items);\n if (item.label === undefined && item.separator !== true) continue;\n items.push(item);\n }\n\n return items;\n}\n\n/**\n * Reads a menu model off a Scene element's properties.\n *\n * @param element The element whose properties to read.\n * @param name The property name holding the entries.\n * @returns The converted menu items, empty when the property is missing or is not an array.\n */\nexport function menuItemsProperty(element: SceneElement, name: string): MenuItem[] {\n return toMenuItems(arrayProperty(element, name));\n}\n"],"names":["toMenuItems","entries","items","entry","push","label","undefined","Array","isArray","record","item","icon","url","disabled","separator","menuItemsProperty","element","name","arrayProperty"],"mappings":";;;;AAAA;AACA;AAMA;;;;;;;;;;;;;;IAeO,SAASA,WAAAA,CAAYC,OAAkB,EAAA;AAC1C,IAAA,MAAMC,QAAoB,EAAE;IAC5B,KAAK,MAAMC,SAASF,OAAAA,CAAS;QACzB,IAAI,OAAOE,UAAU,QAAA,EAAU;AAC3BD,YAAAA,KAAAA,CAAME,IAAI,CAAC;gBAAEC,KAAAA,EAAOF;AAAM,aAAA,CAAA;AAC1B,YAAA;AACJ,QAAA;QAEA,IAAI,OAAOA,KAAAA,KAAU,QAAA,IAAYA,KAAAA,KAAUG,SAAAA,IAAaH,UAAU,IAAA,IAAQI,KAAAA,CAAMC,OAAO,CAACL,KAAAA,CAAAA,EAAQ;AAEhG,QAAA,MAAMM,MAAAA,GAASN,KAAAA;AACf,QAAA,MAAMO,OAAiB,EAAC;QACxB,IAAI,OAAOD,OAAOJ,KAAK,KAAK,UAAUK,IAAAA,CAAKL,KAAK,GAAGI,MAAAA,CAAOJ,KAAK;QAC/D,IAAI,OAAOI,OAAOE,IAAI,KAAK,UAAUD,IAAAA,CAAKC,IAAI,GAAGF,MAAAA,CAAOE,IAAI;QAC5D,IAAI,OAAOF,OAAOG,GAAG,KAAK,UAAUF,IAAAA,CAAKE,GAAG,GAAGH,MAAAA,CAAOG,GAAG;QACzD,IAAI,OAAOH,OAAOI,QAAQ,KAAK,WAAWH,IAAAA,CAAKG,QAAQ,GAAGJ,MAAAA,CAAOI,QAAQ;AACzE,QAAA,IAAIJ,OAAOK,SAAS,KAAK,IAAA,EAAMJ,IAAAA,CAAKI,SAAS,GAAG,IAAA;QAChD,IAAIP,KAAAA,CAAMC,OAAO,CAACC,MAAAA,CAAOP,KAAK,CAAA,EAAGQ,IAAAA,CAAKR,KAAK,GAAGF,WAAAA,CAAYS,MAAAA,CAAOP,KAAK,CAAA;AACtE,QAAA,IAAIQ,KAAKL,KAAK,KAAKC,aAAaI,IAAAA,CAAKI,SAAS,KAAK,IAAA,EAAM;AACzDZ,QAAAA,KAAAA,CAAME,IAAI,CAACM,IAAAA,CAAAA;AACf,IAAA;IAEA,OAAOR,KAAAA;AACX;AAEA;;;;;;AAMC,IACM,SAASa,iBAAAA,CAAkBC,OAAqB,EAAEC,IAAY,EAAA;IACjE,OAAOjB,WAAAA,CAAYkB,yBAAcF,OAAAA,EAASC,IAAAA,CAAAA,CAAAA;AAC9C;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeInlineMessage.js","sources":["../../../messages/PrimeInlineMessage.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 { Message } from 'primereact/message';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport {severityProperty, stringProperty} from '../properties';\n\n/**\n * The `primeicons` class that stands for each severity.\n *\n * Deliberately duplicated from `PrimeMessage` rather than shared. Both adapters need it and neither needs\n * the other, and lifting six lines into a module would put a helper nobody outside this folder wants into\n * the package's public surface - `index.ts` re-exports everything a file exports.\n *\n * The icon is kept even for the compact variant, because severity is otherwise carried by color alone,\n * and \"the red one means you have to fix it\" is not information a reader who cannot see the color gets.\n */\nconst severityIcons: Record<string, string> = {\n success: 'pi pi-check-circle',\n info: 'pi pi-info-circle',\n warn: 'pi pi-exclamation-triangle',\n error: 'pi pi-times-circle',\n};\n\n/**\n * The `PrimeReact:inlineMessage` component - a short notice sitting beside the field it is about.\n *\n * The same PrimeReact `Message` as `message`, sized to its content instead of the row, so a validation\n * hint reads as belonging to one field rather than to the whole form. PrimeReact 11 gives that intent a\n * name of its own - `variant='simple'` drops the panel and leaves the icon and the words - which is\n * exactly what the v10 adapter was approximating with a width class, so the distinction survives the\n * migration and lands on a real prop rather than on CSS.\n *\n * The v11 module is `primereact/message`, singular. The plural `messages` module - a list of notices\n * driven imperatively - was removed with no replacement, but this package never declared a name for it,\n * so nothing here is lost with it.\n */\nexport function PrimeInlineMessage({ element }: RegisteredComponentProps) {\n const severity = severityProperty(element, 'severity', 'info');\n return (\n <Message.Root\n data-scene-id={element.id}\n className='inline-flex'\n variant='simple'\n severity={severity as 'success' | 'info' | 'warn' | 'error'}>\n <Message.Icon>\n <i className={severityIcons[severity] ?? severityIcons.info} aria-hidden='true' />\n </Message.Icon>\n <Message.Content>\n <Message.Text>{stringProperty(element, 'text', '')}</Message.Text>\n </Message.Content>\n </Message.Root>\n );\n}\n"],"names":["severityIcons","success","info","warn","error","PrimeInlineMessage","element","severity","severityProperty","_jsxs","Message","Root","data-scene-id","id","className","variant","_jsx","Icon","i","aria-hidden","Content","Text","stringProperty"],"mappings":";;;;;;AAOA;;;;;;;;;AASC,IACD,MAAMA,aAAAA,GAAwC;IAC1CC,OAAAA,EAAS,oBAAA;IACTC,IAAAA,EAAM,mBAAA;IACNC,IAAAA,EAAM,4BAAA;IACNC,KAAAA,EAAO;AACX,CAAA;AAEA;;;;;;;;;;;;AAYC,IACM,SAASC,kBAAAA,CAAmB,EAAEC,OAAO,EAA4B,EAAA;IACpE,MAAMC,QAAAA,GAAWC,2BAAAA,CAAiBF,OAAAA,EAAS,UAAA,EAAY,MAAA,CAAA;IACvD,qBACIG,eAAA,CAACC,gBAAQC,IAAI,EAAA;AACTC,QAAAA,eAAAA,EAAeN,QAAQO,EAAE;QACzBC,SAAAA,EAAU,aAAA;QACVC,OAAAA,EAAQ,QAAA;QACRR,QAAAA,EAAUA,QAAAA;;AACV,0BAAAS,cAAA,CAACN,gBAAQO,IAAI,EAAA;AACT,gBAAA,QAAA,gBAAAD,cAAA,CAACE,GAAAA,EAAAA;AAAEJ,oBAAAA,SAAAA,EAAWd,aAAa,CAACO,QAAAA,CAAS,IAAIP,cAAcE,IAAI;oBAAEiB,aAAAA,EAAY;;;AAE7E,0BAAAH,cAAA,CAACN,gBAAQU,OAAO,EAAA;wCACZJ,cAAA,CAACN,gBAAQW,IAAI,EAAA;AAAEC,oBAAAA,QAAAA,EAAAA,yBAAAA,CAAehB,SAAS,MAAA,EAAQ,EAAA;;;;;AAI/D
|
|
1
|
+
{"version":3,"file":"PrimeInlineMessage.js","sources":["../../../messages/PrimeInlineMessage.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 { Message } from 'primereact/message';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport {severityProperty, stringProperty} from '../properties';\n\n/**\n * The `primeicons` class that stands for each severity.\n *\n * Deliberately duplicated from `PrimeMessage` rather than shared. Both adapters need it and neither needs\n * the other, and lifting six lines into a module would put a helper nobody outside this folder wants into\n * the package's public surface - `index.ts` re-exports everything a file exports.\n *\n * The icon is kept even for the compact variant, because severity is otherwise carried by color alone,\n * and \"the red one means you have to fix it\" is not information a reader who cannot see the color gets.\n */\nconst severityIcons: Record<string, string> = {\n success: 'pi pi-check-circle',\n info: 'pi pi-info-circle',\n warn: 'pi pi-exclamation-triangle',\n error: 'pi pi-times-circle',\n};\n\n/**\n * The `PrimeReact:inlineMessage` component - a short notice sitting beside the field it is about.\n *\n * The same PrimeReact `Message` as `message`, sized to its content instead of the row, so a validation\n * hint reads as belonging to one field rather than to the whole form. PrimeReact 11 gives that intent a\n * name of its own - `variant='simple'` drops the panel and leaves the icon and the words - which is\n * exactly what the v10 adapter was approximating with a width class, so the distinction survives the\n * migration and lands on a real prop rather than on CSS.\n *\n * The v11 module is `primereact/message`, singular. The plural `messages` module - a list of notices\n * driven imperatively - was removed with no replacement, but this package never declared a name for it,\n * so nothing here is lost with it.\n */\nexport function PrimeInlineMessage({ element }: RegisteredComponentProps) {\n const severity = severityProperty(element, 'severity', 'info');\n return (\n <Message.Root\n data-scene-id={element.id}\n className='inline-flex'\n variant='simple'\n severity={severity as 'success' | 'info' | 'warn' | 'error'}>\n <Message.Icon>\n <i className={severityIcons[severity] ?? severityIcons.info} aria-hidden='true' />\n </Message.Icon>\n <Message.Content>\n <Message.Text>{stringProperty(element, 'text', '')}</Message.Text>\n </Message.Content>\n </Message.Root>\n );\n}\n"],"names":["severityIcons","success","info","warn","error","PrimeInlineMessage","element","severity","severityProperty","_jsxs","Message","Root","data-scene-id","id","className","variant","_jsx","Icon","i","aria-hidden","Content","Text","stringProperty"],"mappings":";;;;;;AAOA;;;;;;;;;AASC,IACD,MAAMA,aAAAA,GAAwC;IAC1CC,OAAAA,EAAS,oBAAA;IACTC,IAAAA,EAAM,mBAAA;IACNC,IAAAA,EAAM,4BAAA;IACNC,KAAAA,EAAO;AACX,CAAA;AAEA;;;;;;;;;;;;AAYC,IACM,SAASC,kBAAAA,CAAmB,EAAEC,OAAO,EAA4B,EAAA;IACpE,MAAMC,QAAAA,GAAWC,2BAAAA,CAAiBF,OAAAA,EAAS,UAAA,EAAY,MAAA,CAAA;IACvD,qBACIG,eAAA,CAACC,gBAAQC,IAAI,EAAA;AACTC,QAAAA,eAAAA,EAAeN,QAAQO,EAAE;QACzBC,SAAAA,EAAU,aAAA;QACVC,OAAAA,EAAQ,QAAA;QACRR,QAAAA,EAAUA,QAAAA;;AACV,0BAAAS,cAAA,CAACN,gBAAQO,IAAI,EAAA;AACT,gBAAA,QAAA,gBAAAD,cAAA,CAACE,GAAAA,EAAAA;AAAEJ,oBAAAA,SAAAA,EAAWd,aAAa,CAACO,QAAAA,CAAS,IAAIP,cAAcE,IAAI;oBAAEiB,aAAAA,EAAY;;;AAE7E,0BAAAH,cAAA,CAACN,gBAAQU,OAAO,EAAA;wCACZJ,cAAA,CAACN,gBAAQW,IAAI,EAAA;AAAEC,oBAAAA,QAAAA,EAAAA,yBAAAA,CAAehB,SAAS,MAAA,EAAQ,EAAA;;;;;AAI/D;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeMessage.js","sources":["../../../messages/PrimeMessage.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 { Message } from 'primereact/message';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport {severityProperty, stringProperty} from '../properties';\n\n/**\n * The `primeicons` class that stands for each severity.\n *\n * PrimeReact 10 chose this icon for you; PrimeReact 11 made the icon a part you compose, which is right\n * for an application - it can use its own icon set - and wrong for a Scene element, which has no way to\n * name one. The mapping is restored here so a notice still reads at a glance rather than as an\n * undifferentiated colored box.\n */\nconst severityIcons: Record<string, string> = {\n success: 'pi pi-check-circle',\n info: 'pi pi-info-circle',\n warn: 'pi pi-exclamation-triangle',\n error: 'pi pi-times-circle',\n};\n\n/**\n * The `PrimeReact:message` component - a block-level notice attached to a region of a screen.\n *\n * Rendered full width, which is what separates it from `inlineMessage`: the two share PrimeReact's\n * `Message` component but mean different things on a screen, and the width is the difference a reader\n * actually sees. PrimeReact 11 adds a second axis for the same distinction - `variant` - and this one is\n * the default, bordered variant, because a region-level notice is meant to be a block you notice.\n *\n * The v11 module is `primereact/message`, singular, which is the one that survived; the plural `messages`\n * module - a list of notices with its own imperative API - was removed outright, and this package never\n * declared a name for it.\n *\n * v10's `warning` is translated to v11's `warn` so screens written against the old vocabulary keep their\n * color; `error` was and still is spelled the same here, unlike everywhere else in PrimeReact where the\n * danger severity is called `danger`.\n */\nexport function PrimeMessage({ element }: RegisteredComponentProps) {\n const severity = severityProperty(element, 'severity', 'info');\n return (\n <Message.Root data-scene-id={element.id} className='w-full' severity={severity as 'success' | 'info' | 'warn' | 'error'}>\n <Message.Icon>\n <i className={severityIcons[severity] ?? severityIcons.info} aria-hidden='true' />\n </Message.Icon>\n <Message.Content>\n <Message.Text>{stringProperty(element, 'text', '')}</Message.Text>\n </Message.Content>\n </Message.Root>\n );\n}\n"],"names":["severityIcons","success","info","warn","error","PrimeMessage","element","severity","severityProperty","_jsxs","Message","Root","data-scene-id","id","className","_jsx","Icon","i","aria-hidden","Content","Text","stringProperty"],"mappings":";;;;;;AAOA;;;;;;;AAOC,IACD,MAAMA,aAAAA,GAAwC;IAC1CC,OAAAA,EAAS,oBAAA;IACTC,IAAAA,EAAM,mBAAA;IACNC,IAAAA,EAAM,4BAAA;IACNC,KAAAA,EAAO;AACX,CAAA;AAEA;;;;;;;;;;;;;;;AAeC,IACM,SAASC,YAAAA,CAAa,EAAEC,OAAO,EAA4B,EAAA;IAC9D,MAAMC,QAAAA,GAAWC,2BAAAA,CAAiBF,OAAAA,EAAS,UAAA,EAAY,MAAA,CAAA;IACvD,qBACIG,eAAA,CAACC,gBAAQC,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAeN,QAAQO,EAAE;QAAEC,SAAAA,EAAU,QAAA;QAASP,QAAAA,EAAUA,QAAAA;;AAClE,0BAAAQ,cAAA,CAACL,gBAAQM,IAAI,EAAA;AACT,gBAAA,QAAA,gBAAAD,cAAA,CAACE,GAAAA,EAAAA;AAAEH,oBAAAA,SAAAA,EAAWd,aAAa,CAACO,QAAAA,CAAS,IAAIP,cAAcE,IAAI;oBAAEgB,aAAAA,EAAY;;;AAE7E,0BAAAH,cAAA,CAACL,gBAAQS,OAAO,EAAA;wCACZJ,cAAA,CAACL,gBAAQU,IAAI,EAAA;AAAEC,oBAAAA,QAAAA,EAAAA,yBAAAA,CAAef,SAAS,MAAA,EAAQ,EAAA;;;;;AAI/D
|
|
1
|
+
{"version":3,"file":"PrimeMessage.js","sources":["../../../messages/PrimeMessage.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 { Message } from 'primereact/message';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport {severityProperty, stringProperty} from '../properties';\n\n/**\n * The `primeicons` class that stands for each severity.\n *\n * PrimeReact 10 chose this icon for you; PrimeReact 11 made the icon a part you compose, which is right\n * for an application - it can use its own icon set - and wrong for a Scene element, which has no way to\n * name one. The mapping is restored here so a notice still reads at a glance rather than as an\n * undifferentiated colored box.\n */\nconst severityIcons: Record<string, string> = {\n success: 'pi pi-check-circle',\n info: 'pi pi-info-circle',\n warn: 'pi pi-exclamation-triangle',\n error: 'pi pi-times-circle',\n};\n\n/**\n * The `PrimeReact:message` component - a block-level notice attached to a region of a screen.\n *\n * Rendered full width, which is what separates it from `inlineMessage`: the two share PrimeReact's\n * `Message` component but mean different things on a screen, and the width is the difference a reader\n * actually sees. PrimeReact 11 adds a second axis for the same distinction - `variant` - and this one is\n * the default, bordered variant, because a region-level notice is meant to be a block you notice.\n *\n * The v11 module is `primereact/message`, singular, which is the one that survived; the plural `messages`\n * module - a list of notices with its own imperative API - was removed outright, and this package never\n * declared a name for it.\n *\n * v10's `warning` is translated to v11's `warn` so screens written against the old vocabulary keep their\n * color; `error` was and still is spelled the same here, unlike everywhere else in PrimeReact where the\n * danger severity is called `danger`.\n */\nexport function PrimeMessage({ element }: RegisteredComponentProps) {\n const severity = severityProperty(element, 'severity', 'info');\n return (\n <Message.Root data-scene-id={element.id} className='w-full' severity={severity as 'success' | 'info' | 'warn' | 'error'}>\n <Message.Icon>\n <i className={severityIcons[severity] ?? severityIcons.info} aria-hidden='true' />\n </Message.Icon>\n <Message.Content>\n <Message.Text>{stringProperty(element, 'text', '')}</Message.Text>\n </Message.Content>\n </Message.Root>\n );\n}\n"],"names":["severityIcons","success","info","warn","error","PrimeMessage","element","severity","severityProperty","_jsxs","Message","Root","data-scene-id","id","className","_jsx","Icon","i","aria-hidden","Content","Text","stringProperty"],"mappings":";;;;;;AAOA;;;;;;;AAOC,IACD,MAAMA,aAAAA,GAAwC;IAC1CC,OAAAA,EAAS,oBAAA;IACTC,IAAAA,EAAM,mBAAA;IACNC,IAAAA,EAAM,4BAAA;IACNC,KAAAA,EAAO;AACX,CAAA;AAEA;;;;;;;;;;;;;;;AAeC,IACM,SAASC,YAAAA,CAAa,EAAEC,OAAO,EAA4B,EAAA;IAC9D,MAAMC,QAAAA,GAAWC,2BAAAA,CAAiBF,OAAAA,EAAS,UAAA,EAAY,MAAA,CAAA;IACvD,qBACIG,eAAA,CAACC,gBAAQC,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAeN,QAAQO,EAAE;QAAEC,SAAAA,EAAU,QAAA;QAASP,QAAAA,EAAUA,QAAAA;;AAClE,0BAAAQ,cAAA,CAACL,gBAAQM,IAAI,EAAA;AACT,gBAAA,QAAA,gBAAAD,cAAA,CAACE,GAAAA,EAAAA;AAAEH,oBAAAA,SAAAA,EAAWd,aAAa,CAACO,QAAAA,CAAS,IAAIP,cAAcE,IAAI;oBAAEgB,aAAAA,EAAY;;;AAE7E,0BAAAH,cAAA,CAACL,gBAAQS,OAAO,EAAA;wCACZJ,cAAA,CAACL,gBAAQU,IAAI,EAAA;AAAEC,oBAAAA,QAAAA,EAAAA,yBAAAA,CAAef,SAAS,MAAA,EAAQ,EAAA;;;;;AAI/D;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeToast.js","sources":["../../../messages/PrimeToast.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 { useEffect } from 'react';\nimport { Toast } from 'primereact/toast';\nimport { Toaster, toast, useToasterContext } from 'primereact/toaster';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport {numberProperty, severityProperty, stringProperty} from '../properties';\n\n/**\n * Renders whatever notifications are currently queued for the surrounding toaster.\n *\n * PrimeReact 11 splits a toast in two: a `Toaster` owns the queue, the position and the timers, and the\n * caller decides what one notification looks like. Nothing renders until someone maps the queue, which is\n * what this does - it has to be its own component because reading the queue means reading the toaster's\n * context, and that context is only available below the `Toaster.Root` that provides it.\n *\n * The severity icons are chosen here rather than left out because `Toast.Icon` renders only when its\n * `match` equals the toast's severity, so the four are alternatives, not four icons at once.\n */\nfunction ToastList() {\n const toaster = useToasterContext();\n if (toaster === undefined) return null;\n\n return (\n <>\n {toaster.toasts.map((item) => (\n <Toast.Root key={item.id} toast={item}>\n <Toast.Icon match='success'>\n <i className='pi pi-check-circle' aria-hidden='true' />\n </Toast.Icon>\n <Toast.Icon match='info'>\n <i className='pi pi-info-circle' aria-hidden='true' />\n </Toast.Icon>\n <Toast.Icon match='warn'>\n <i className='pi pi-exclamation-triangle' aria-hidden='true' />\n </Toast.Icon>\n <Toast.Icon match='error'>\n <i className='pi pi-times-circle' aria-hidden='true' />\n </Toast.Icon>\n <Toast.Content>\n <Toast.Title />\n <Toast.Description />\n </Toast.Content>\n <Toast.Close aria-label='Dismiss'>\n <i className='pi pi-times' aria-hidden='true' />\n </Toast.Close>\n </Toast.Root>\n ))}\n </>\n );\n}\n\n/**\n * The `PrimeReact:toast` component - a transient notification in a corner of the screen.\n *\n * A toast is purely imperative: nothing renders until someone announces something. A Scene element cannot\n * make that call, so the adapter makes it once on mount from the element's own properties. The element\n * therefore reads as \"this screen announces this\" rather than as a component that happens to render\n * nothing, which is what a literal wrapper would produce.\n *\n * PrimeReact 11 replaced v10's per-component ref and `show()` with a module-level queue and a free\n * `toast()` function - a better arrangement for an application, since anything can announce without\n * holding a ref, but a shared one. The element's own id is used as the toast's group so this toaster shows\n * only what this element announced, and the announcement is withdrawn on unmount; without both, several\n * `toast` elements on one screen would each show all of each other's notifications and leave them behind.\n *\n * `data-scene-id` sits on a wrapper rather than on the toaster, because the toaster renders through a\n * portal to the end of the document: the identifying attribute would leave the position in the tree where\n * the element was actually authored, which is where a design-time tool looks for it.\n */\nexport function PrimeToast({ element }: RegisteredComponentProps) {\n const severity = severityProperty(element, 'severity', 'info');\n const summary = stringProperty(element, 'summary', '');\n const detail = stringProperty(element, 'detail', '');\n const life = numberProperty(element, 'life', 3000);\n const group = element.id;\n\n useEffect(() => {\n const id = toast({\n group,\n severity: severity as 'success' | 'info' | 'warn' | 'error',\n title: summary,\n description: detail,\n duration: life,\n });\n return () => toast.dismiss(id);\n }, [group, severity, summary, detail, life]);\n\n return (\n <div data-scene-id={element.id}>\n <Toaster.Root\n group={group}\n timeout={life}\n position={stringProperty(element, 'position', 'top-right') as 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center' | 'center'}>\n <Toaster.Portal>\n <Toaster.Region>\n <ToastList />\n </Toaster.Region>\n </Toaster.Portal>\n </Toaster.Root>\n </div>\n );\n}\n"],"names":["ToastList","toaster","useToasterContext","undefined","_jsx","_Fragment","toasts","map","item","_jsxs","Toast","Root","toast","Icon","match","i","className","aria-hidden","Content","Title","Description","Close","aria-label","id","PrimeToast","element","severity","severityProperty","summary","stringProperty","detail","life","numberProperty","group","useEffect","title","description","duration","dismiss","div","data-scene-id","Toaster","timeout","position","Portal","Region"],"mappings":"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
|
|
1
|
+
{"version":3,"file":"PrimeToast.js","sources":["../../../messages/PrimeToast.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 { useEffect } from 'react';\nimport { Toast } from 'primereact/toast';\nimport { Toaster, toast, useToasterContext } from 'primereact/toaster';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport {numberProperty, severityProperty, stringProperty} from '../properties';\n\n/**\n * Renders whatever notifications are currently queued for the surrounding toaster.\n *\n * PrimeReact 11 splits a toast in two: a `Toaster` owns the queue, the position and the timers, and the\n * caller decides what one notification looks like. Nothing renders until someone maps the queue, which is\n * what this does - it has to be its own component because reading the queue means reading the toaster's\n * context, and that context is only available below the `Toaster.Root` that provides it.\n *\n * The severity icons are chosen here rather than left out because `Toast.Icon` renders only when its\n * `match` equals the toast's severity, so the four are alternatives, not four icons at once.\n */\nfunction ToastList() {\n const toaster = useToasterContext();\n if (toaster === undefined) return null;\n\n return (\n <>\n {toaster.toasts.map((item) => (\n <Toast.Root key={item.id} toast={item}>\n <Toast.Icon match='success'>\n <i className='pi pi-check-circle' aria-hidden='true' />\n </Toast.Icon>\n <Toast.Icon match='info'>\n <i className='pi pi-info-circle' aria-hidden='true' />\n </Toast.Icon>\n <Toast.Icon match='warn'>\n <i className='pi pi-exclamation-triangle' aria-hidden='true' />\n </Toast.Icon>\n <Toast.Icon match='error'>\n <i className='pi pi-times-circle' aria-hidden='true' />\n </Toast.Icon>\n <Toast.Content>\n <Toast.Title />\n <Toast.Description />\n </Toast.Content>\n <Toast.Close aria-label='Dismiss'>\n <i className='pi pi-times' aria-hidden='true' />\n </Toast.Close>\n </Toast.Root>\n ))}\n </>\n );\n}\n\n/**\n * The `PrimeReact:toast` component - a transient notification in a corner of the screen.\n *\n * A toast is purely imperative: nothing renders until someone announces something. A Scene element cannot\n * make that call, so the adapter makes it once on mount from the element's own properties. The element\n * therefore reads as \"this screen announces this\" rather than as a component that happens to render\n * nothing, which is what a literal wrapper would produce.\n *\n * PrimeReact 11 replaced v10's per-component ref and `show()` with a module-level queue and a free\n * `toast()` function - a better arrangement for an application, since anything can announce without\n * holding a ref, but a shared one. The element's own id is used as the toast's group so this toaster shows\n * only what this element announced, and the announcement is withdrawn on unmount; without both, several\n * `toast` elements on one screen would each show all of each other's notifications and leave them behind.\n *\n * `data-scene-id` sits on a wrapper rather than on the toaster, because the toaster renders through a\n * portal to the end of the document: the identifying attribute would leave the position in the tree where\n * the element was actually authored, which is where a design-time tool looks for it.\n */\nexport function PrimeToast({ element }: RegisteredComponentProps) {\n const severity = severityProperty(element, 'severity', 'info');\n const summary = stringProperty(element, 'summary', '');\n const detail = stringProperty(element, 'detail', '');\n const life = numberProperty(element, 'life', 3000);\n const group = element.id;\n\n useEffect(() => {\n const id = toast({\n group,\n severity: severity as 'success' | 'info' | 'warn' | 'error',\n title: summary,\n description: detail,\n duration: life,\n });\n return () => toast.dismiss(id);\n }, [group, severity, summary, detail, life]);\n\n return (\n <div data-scene-id={element.id}>\n <Toaster.Root\n group={group}\n timeout={life}\n position={stringProperty(element, 'position', 'top-right') as 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center' | 'center'}>\n <Toaster.Portal>\n <Toaster.Region>\n <ToastList />\n </Toaster.Region>\n </Toaster.Portal>\n </Toaster.Root>\n </div>\n );\n}\n"],"names":["ToastList","toaster","useToasterContext","undefined","_jsx","_Fragment","toasts","map","item","_jsxs","Toast","Root","toast","Icon","match","i","className","aria-hidden","Content","Title","Description","Close","aria-label","id","PrimeToast","element","severity","severityProperty","summary","stringProperty","detail","life","numberProperty","group","useEffect","title","description","duration","dismiss","div","data-scene-id","Toaster","timeout","position","Portal","Region"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockUI.js","sources":["../../../misc/BlockUI.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 { HTMLAttributes } from 'react';\n\n/**\n * Configuration for {@link BlockUI}.\n */\nexport interface BlockUIProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Whether the region is currently blocked. While this is `false` the component adds nothing but a\n * positioned wrapper, so it is safe to leave mounted around content that is only occasionally busy.\n */\n blocked?: boolean;\n\n /**\n * Whether the mask covers the whole viewport rather than only the wrapped content. A long-running\n * action that would leave the rest of the screen misleadingly usable wants the page; a panel\n * refreshing its own data does not.\n */\n fullScreen?: boolean;\n}\n\n/**\n * A region that greys itself out and stops accepting input while something is in flight.\n *\n * Cratis owns this component. PrimeReact 10 had `BlockUI`; PrimeReact 11 removed it with no replacement\n * and no headless hook, and the `blockUI` name is one this package's manifest already publishes - screens\n * are written against it. Rebuilding it here is what keeps that promise, and it turns out to be a small\n * thing to own: the whole component is a positioned wrapper, an `inert` subtree and a translucent mask.\n *\n * Blocking is expressed twice on purpose, because the two audiences need different things. `aria-busy`\n * tells assistive technology that the region's content is being updated and should not be announced as\n * final. `inert` on the wrapped subtree takes it out of the tab order and stops it responding to clicks -\n * without that, a mask is only a visual suggestion and a keyboard user tabs straight through it into\n * controls the screen believes are unavailable.\n *\n * What it deliberately does not carry over from v10: the `template` and `containerTemplate` props (a\n * screen that wants a spinner or a message over the mask composes one into the blocked content itself),\n * the enter/leave transitions, `baseZIndex` / `autoZIndex` layering (the mask uses one fixed stacking\n * level and does not negotiate with dialogs), and the `onBlock` / `onUnblock` callbacks - a Scene element\n * has nowhere to route a callback to, and the blocked state is authored rather than discovered.\n */\nexport function BlockUI({ blocked = false, fullScreen = false, className, children, ...rest }: BlockUIProps) {\n return (\n <div {...rest} className={['relative', className].filter(Boolean).join(' ')} aria-busy={blocked}>\n <div inert={blocked}>{children}</div>\n {blocked && <div className={fullScreen ? 'fixed inset-0 z-50 bg-black/40' : 'absolute inset-0 z-10 bg-black/40'} />}\n </div>\n );\n}\n"],"names":["BlockUI","blocked","fullScreen","className","children","rest","_jsxs","div","filter","Boolean","join","aria-busy","_jsx","inert"],"mappings":";;;;AAAA;AACA;AAsBA;;;;;;;;;;;;;;;;;;;AAmBC,IACM,SAASA,OAAAA,CAAQ,EAAEC,UAAU,KAAK,EAAEC,UAAAA,GAAa,KAAK,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,IAAAA,EAAoB,EAAA;AACvG,IAAA,qBACIC,eAAA,CAACC,KAAAA,EAAAA;AAAK,QAAA,GAAGF,IAAI;QAAEF,SAAAA,EAAW;AAAC,YAAA,UAAA;AAAYA,YAAAA;AAAU,SAAA,CAACK,MAAM,CAACC,OAAAA,CAAAA,CAASC,IAAI,CAAC,GAAA,CAAA;QAAMC,WAAAA,EAAWV,OAAAA;;0BACpFW,cAAA,CAACL,KAAAA,EAAAA;gBAAIM,KAAAA,EAAOZ,OAAAA;AAAUG,gBAAAA,QAAAA,EAAAA;;AACrBH,YAAAA,OAAAA,kBAAWW,cAAA,CAACL,KAAAA,EAAAA;AAAIJ,gBAAAA,SAAAA,EAAWD,aAAa,gCAAA,GAAmC;;;;AAGxF
|
|
1
|
+
{"version":3,"file":"BlockUI.js","sources":["../../../misc/BlockUI.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 { HTMLAttributes } from 'react';\n\n/**\n * Configuration for {@link BlockUI}.\n */\nexport interface BlockUIProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Whether the region is currently blocked. While this is `false` the component adds nothing but a\n * positioned wrapper, so it is safe to leave mounted around content that is only occasionally busy.\n */\n blocked?: boolean;\n\n /**\n * Whether the mask covers the whole viewport rather than only the wrapped content. A long-running\n * action that would leave the rest of the screen misleadingly usable wants the page; a panel\n * refreshing its own data does not.\n */\n fullScreen?: boolean;\n}\n\n/**\n * A region that greys itself out and stops accepting input while something is in flight.\n *\n * Cratis owns this component. PrimeReact 10 had `BlockUI`; PrimeReact 11 removed it with no replacement\n * and no headless hook, and the `blockUI` name is one this package's manifest already publishes - screens\n * are written against it. Rebuilding it here is what keeps that promise, and it turns out to be a small\n * thing to own: the whole component is a positioned wrapper, an `inert` subtree and a translucent mask.\n *\n * Blocking is expressed twice on purpose, because the two audiences need different things. `aria-busy`\n * tells assistive technology that the region's content is being updated and should not be announced as\n * final. `inert` on the wrapped subtree takes it out of the tab order and stops it responding to clicks -\n * without that, a mask is only a visual suggestion and a keyboard user tabs straight through it into\n * controls the screen believes are unavailable.\n *\n * What it deliberately does not carry over from v10: the `template` and `containerTemplate` props (a\n * screen that wants a spinner or a message over the mask composes one into the blocked content itself),\n * the enter/leave transitions, `baseZIndex` / `autoZIndex` layering (the mask uses one fixed stacking\n * level and does not negotiate with dialogs), and the `onBlock` / `onUnblock` callbacks - a Scene element\n * has nowhere to route a callback to, and the blocked state is authored rather than discovered.\n */\nexport function BlockUI({ blocked = false, fullScreen = false, className, children, ...rest }: BlockUIProps) {\n return (\n <div {...rest} className={['relative', className].filter(Boolean).join(' ')} aria-busy={blocked}>\n <div inert={blocked}>{children}</div>\n {blocked && <div className={fullScreen ? 'fixed inset-0 z-50 bg-black/40' : 'absolute inset-0 z-10 bg-black/40'} />}\n </div>\n );\n}\n"],"names":["BlockUI","blocked","fullScreen","className","children","rest","_jsxs","div","filter","Boolean","join","aria-busy","_jsx","inert"],"mappings":";;;;AAAA;AACA;AAsBA;;;;;;;;;;;;;;;;;;;AAmBC,IACM,SAASA,OAAAA,CAAQ,EAAEC,UAAU,KAAK,EAAEC,UAAAA,GAAa,KAAK,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,IAAAA,EAAoB,EAAA;AACvG,IAAA,qBACIC,eAAA,CAACC,KAAAA,EAAAA;AAAK,QAAA,GAAGF,IAAI;QAAEF,SAAAA,EAAW;AAAC,YAAA,UAAA;AAAYA,YAAAA;AAAU,SAAA,CAACK,MAAM,CAACC,OAAAA,CAAAA,CAASC,IAAI,CAAC,GAAA,CAAA;QAAMC,WAAAA,EAAWV,OAAAA;;0BACpFW,cAAA,CAACL,KAAAA,EAAAA;gBAAIM,KAAAA,EAAOZ,OAAAA;AAAUG,gBAAAA,QAAAA,EAAAA;;AACrBH,YAAAA,OAAAA,kBAAWW,cAAA,CAACL,KAAAA,EAAAA;AAAIJ,gBAAAA,SAAAA,EAAWD,aAAa,gCAAA,GAAmC;;;;AAGxF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeAvatar.js","sources":["../../../misc/PrimeAvatar.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Avatar } from 'primereact/avatar';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:avatar` component - a person or entity shown as initials, an icon or a picture.\n *\n * PrimeReact 11 turned Avatar into a composition, and the split is the interesting part: `Avatar.Image`\n * renders only once the browser has actually loaded the source, and `Avatar.Fallback` renders only while\n * it has not. That is exactly the behavior a screen wants and could not previously express - a picture\n * that 404s now degrades to the initials instead of leaving a broken image icon in a list of faces.\n *\n * The image part is left out entirely when no `image` was authored, rather than mounted with an empty\n * source: it would spend an effect on a load that can never happen, and the fallback is what shows either\n * way.\n */\nexport function PrimeAvatar({ element }: RegisteredComponentProps) {\n const label = stringProperty(element, 'label');\n const icon = stringProperty(element, 'icon');\n const image = stringProperty(element, 'image');\n return (\n <Avatar.Root\n data-scene-id={element.id}\n size={stringProperty(element, 'size', 'normal') as 'normal' | 'large' | 'xlarge'}\n shape={stringProperty(element, 'shape', 'square') as 'square' | 'circle'}>\n {image !== undefined && <Avatar.Image src={image} alt={label ?? ''} />}\n <Avatar.Fallback>{icon !== undefined ? <i className={icon} aria-hidden='true' /> : label}</Avatar.Fallback>\n </Avatar.Root>\n );\n}\n"],"names":["PrimeAvatar","element","label","stringProperty","icon","image","_jsxs","Avatar","Root","data-scene-id","id","size","shape","undefined","_jsx","Image","src","alt","Fallback","i","className","aria-hidden"],"mappings":";;;;;;AAOA;;;;;;;;;;;AAWC,IACM,SAASA,WAAAA,CAAY,EAAEC,OAAO,EAA4B,EAAA;IAC7D,MAAMC,KAAAA,GAAQC,0BAAeF,OAAAA,EAAS,OAAA,CAAA;IACtC,MAAMG,IAAAA,GAAOD,0BAAeF,OAAAA,EAAS,MAAA,CAAA;IACrC,MAAMI,KAAAA,GAAQF,0BAAeF,OAAAA,EAAS,OAAA,CAAA;IACtC,qBACIK,eAAA,CAACC,cAAOC,IAAI,EAAA;AACRC,QAAAA,eAAAA,EAAeR,QAAQS,EAAE;QACzBC,IAAAA,EAAMR,yBAAAA,CAAeF,SAAS,MAAA,EAAQ,QAAA,CAAA;QACtCW,KAAAA,EAAOT,yBAAAA,CAAeF,SAAS,OAAA,EAAS,QAAA,CAAA;;YACvCI,KAAAA,KAAUQ,SAAAA,kBAAaC,cAAA,CAACP,aAAAA,CAAOQ,KAAK,EAAA;gBAACC,GAAAA,EAAKX,KAAAA;AAAOY,gBAAAA,GAAAA,EAAKf,KAAAA,IAAS;;AAChE,0BAAAY,cAAA,CAACP,cAAOW,QAAQ,EAAA;AAAEd,gBAAAA,QAAAA,EAAAA,IAAAA,KAASS,0BAAYC,cAAA,CAACK,GAAAA,EAAAA;oBAAEC,SAAAA,EAAWhB,IAAAA;oBAAMiB,aAAAA,EAAY;AAAYnB,iBAAAA,CAAAA,GAAAA;;;;AAG/F
|
|
1
|
+
{"version":3,"file":"PrimeAvatar.js","sources":["../../../misc/PrimeAvatar.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Avatar } from 'primereact/avatar';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:avatar` component - a person or entity shown as initials, an icon or a picture.\n *\n * PrimeReact 11 turned Avatar into a composition, and the split is the interesting part: `Avatar.Image`\n * renders only once the browser has actually loaded the source, and `Avatar.Fallback` renders only while\n * it has not. That is exactly the behavior a screen wants and could not previously express - a picture\n * that 404s now degrades to the initials instead of leaving a broken image icon in a list of faces.\n *\n * The image part is left out entirely when no `image` was authored, rather than mounted with an empty\n * source: it would spend an effect on a load that can never happen, and the fallback is what shows either\n * way.\n */\nexport function PrimeAvatar({ element }: RegisteredComponentProps) {\n const label = stringProperty(element, 'label');\n const icon = stringProperty(element, 'icon');\n const image = stringProperty(element, 'image');\n return (\n <Avatar.Root\n data-scene-id={element.id}\n size={stringProperty(element, 'size', 'normal') as 'normal' | 'large' | 'xlarge'}\n shape={stringProperty(element, 'shape', 'square') as 'square' | 'circle'}>\n {image !== undefined && <Avatar.Image src={image} alt={label ?? ''} />}\n <Avatar.Fallback>{icon !== undefined ? <i className={icon} aria-hidden='true' /> : label}</Avatar.Fallback>\n </Avatar.Root>\n );\n}\n"],"names":["PrimeAvatar","element","label","stringProperty","icon","image","_jsxs","Avatar","Root","data-scene-id","id","size","shape","undefined","_jsx","Image","src","alt","Fallback","i","className","aria-hidden"],"mappings":";;;;;;AAOA;;;;;;;;;;;AAWC,IACM,SAASA,WAAAA,CAAY,EAAEC,OAAO,EAA4B,EAAA;IAC7D,MAAMC,KAAAA,GAAQC,0BAAeF,OAAAA,EAAS,OAAA,CAAA;IACtC,MAAMG,IAAAA,GAAOD,0BAAeF,OAAAA,EAAS,MAAA,CAAA;IACrC,MAAMI,KAAAA,GAAQF,0BAAeF,OAAAA,EAAS,OAAA,CAAA;IACtC,qBACIK,eAAA,CAACC,cAAOC,IAAI,EAAA;AACRC,QAAAA,eAAAA,EAAeR,QAAQS,EAAE;QACzBC,IAAAA,EAAMR,yBAAAA,CAAeF,SAAS,MAAA,EAAQ,QAAA,CAAA;QACtCW,KAAAA,EAAOT,yBAAAA,CAAeF,SAAS,OAAA,EAAS,QAAA,CAAA;;YACvCI,KAAAA,KAAUQ,SAAAA,kBAAaC,cAAA,CAACP,aAAAA,CAAOQ,KAAK,EAAA;gBAACC,GAAAA,EAAKX,KAAAA;AAAOY,gBAAAA,GAAAA,EAAKf,KAAAA,IAAS;;AAChE,0BAAAY,cAAA,CAACP,cAAOW,QAAQ,EAAA;AAAEd,gBAAAA,QAAAA,EAAAA,IAAAA,KAASS,0BAAYC,cAAA,CAACK,GAAAA,EAAAA;oBAAEC,SAAAA,EAAWhB,IAAAA;oBAAMiB,aAAAA,EAAY;AAAYnB,iBAAAA,CAAAA,GAAAA;;;;AAG/F;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeBadge.js","sources":["../../../misc/PrimeBadge.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 { Badge } from 'primereact/badge';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport {severityProperty, stringProperty} from '../properties';\n\n/**\n * The `PrimeReact:badge` component - a small count or status marker.\n *\n * PrimeReact 11 dropped the `value` prop in favor of children, which is why the authored value is placed\n * inside the element rather than passed to it. The badge keeps rendering with no value at all - v11 marks\n * that case `data-empty` and styles it as the bare dot a \"there is something here\" indicator wants.\n *\n * Two vocabulary changes are absorbed here rather than pushed onto screens. `warning` became `warn`, so a\n * screen written against PrimeReact 10 keeps its color instead of silently falling back to the default.\n * The `normal` size, on the other hand, is simply gone: v11 sizes are `small`, `large` and `xlarge`, and\n * the unsized badge *is* the normal one, so nothing needs translating.\n */\nexport function PrimeBadge({ element }: RegisteredComponentProps) {\n // Tag and Badge are the two components PrimeReact 11 gives no `help` variant, so an authored\n // `help` degrades to the default styling rather than failing to compile.\n const severity = severityProperty(element, 'severity');\n return (\n <Badge\n data-scene-id={element.id}\n severity={severity === 'help' ? undefined : severity}\n size={stringProperty(element, 'size') as 'small' | 'large' | 'xlarge' | undefined}>\n {stringProperty(element, 'value', '')}\n </Badge>\n );\n}\n"],"names":["PrimeBadge","element","severity","severityProperty","_jsx","Badge","data-scene-id","id","undefined","size","stringProperty"],"mappings":";;;;;;AAOA;;;;;;;;;;;AAWC,IACM,SAASA,UAAAA,CAAW,EAAEC,OAAO,EAA4B,EAAA;;;IAG5D,MAAMC,QAAAA,GAAWC,4BAAiBF,OAAAA,EAAS,UAAA,CAAA;AAC3C,IAAA,qBACIG,cAAA,CAACC,WAAAA,EAAAA;AACGC,QAAAA,eAAAA,EAAeL,QAAQM,EAAE;QACzBL,QAAAA,EAAUA,QAAAA,KAAa,SAASM,SAAAA,GAAYN,QAAAA;AAC5CO,QAAAA,IAAAA,EAAMC,0BAAeT,OAAAA,EAAS,MAAA,CAAA;AAC7BS,QAAAA,QAAAA,EAAAA,yBAAAA,CAAeT,SAAS,OAAA,EAAS,EAAA;;AAG9C
|
|
1
|
+
{"version":3,"file":"PrimeBadge.js","sources":["../../../misc/PrimeBadge.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 { Badge } from 'primereact/badge';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport {severityProperty, stringProperty} from '../properties';\n\n/**\n * The `PrimeReact:badge` component - a small count or status marker.\n *\n * PrimeReact 11 dropped the `value` prop in favor of children, which is why the authored value is placed\n * inside the element rather than passed to it. The badge keeps rendering with no value at all - v11 marks\n * that case `data-empty` and styles it as the bare dot a \"there is something here\" indicator wants.\n *\n * Two vocabulary changes are absorbed here rather than pushed onto screens. `warning` became `warn`, so a\n * screen written against PrimeReact 10 keeps its color instead of silently falling back to the default.\n * The `normal` size, on the other hand, is simply gone: v11 sizes are `small`, `large` and `xlarge`, and\n * the unsized badge *is* the normal one, so nothing needs translating.\n */\nexport function PrimeBadge({ element }: RegisteredComponentProps) {\n // Tag and Badge are the two components PrimeReact 11 gives no `help` variant, so an authored\n // `help` degrades to the default styling rather than failing to compile.\n const severity = severityProperty(element, 'severity');\n return (\n <Badge\n data-scene-id={element.id}\n severity={severity === 'help' ? undefined : severity}\n size={stringProperty(element, 'size') as 'small' | 'large' | 'xlarge' | undefined}>\n {stringProperty(element, 'value', '')}\n </Badge>\n );\n}\n"],"names":["PrimeBadge","element","severity","severityProperty","_jsx","Badge","data-scene-id","id","undefined","size","stringProperty"],"mappings":";;;;;;AAOA;;;;;;;;;;;AAWC,IACM,SAASA,UAAAA,CAAW,EAAEC,OAAO,EAA4B,EAAA;;;IAG5D,MAAMC,QAAAA,GAAWC,4BAAiBF,OAAAA,EAAS,UAAA,CAAA;AAC3C,IAAA,qBACIG,cAAA,CAACC,WAAAA,EAAAA;AACGC,QAAAA,eAAAA,EAAeL,QAAQM,EAAE;QACzBL,QAAAA,EAAUA,QAAAA,KAAa,SAASM,SAAAA,GAAYN,QAAAA;AAC5CO,QAAAA,IAAAA,EAAMC,0BAAeT,OAAAA,EAAS,MAAA,CAAA;AAC7BS,QAAAA,QAAAA,EAAAA,yBAAAA,CAAeT,SAAS,OAAA,EAAS,EAAA;;AAG9C;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeBlockUI.js","sources":["../../../misc/PrimeBlockUI.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 { BlockUI } from './BlockUI';\nimport { booleanProperty } from '../properties';\n\n/**\n * The `PrimeReact:blockUI` component - a region masked while something is in flight.\n *\n * PrimeReact 11 removed `BlockUI` outright: no renamed module, no compositional replacement, no headless\n * hook. The name is in this package's manifest and screens are authored against it, so the adapter now\n * renders Cratis's own {@link BlockUI} instead. The element's contract is unchanged - a `blocked` flag and\n * whatever the `content` slot holds - which is the point: the removal is a fact about PrimeReact, not\n * something a screen should have to know.\n *\n * The default is `blocked`, because an element a screen bothered to place is there to say \"this region is\n * waiting\"; an unblocked block is a wrapper that does nothing.\n */\nexport function PrimeBlockUI({ element, slots }: RegisteredComponentProps) {\n return (\n <BlockUI\n data-scene-id={element.id}\n blocked={booleanProperty(element, 'blocked', true)}\n fullScreen={booleanProperty(element, 'fullScreen', false)}>\n {slots.content}\n </BlockUI>\n );\n}\n"],"names":["PrimeBlockUI","element","slots","_jsx","BlockUI","data-scene-id","id","blocked","booleanProperty","fullScreen","content"],"mappings":";;;;;;AAAA;AACA;AAMA;;;;;;;;;;;AAWC,IACM,SAASA,YAAAA,CAAa,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACrE,IAAA,qBACIC,cAAA,CAACC,eAAAA,EAAAA;AACGC,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;QACzBC,OAAAA,EAASC,0BAAAA,CAAgBP,SAAS,SAAA,EAAW,IAAA,CAAA;QAC7CQ,UAAAA,EAAYD,0BAAAA,CAAgBP,SAAS,YAAA,EAAc,KAAA,CAAA;AAClDC,QAAAA,QAAAA,EAAAA,KAAAA,CAAMQ;;AAGnB
|
|
1
|
+
{"version":3,"file":"PrimeBlockUI.js","sources":["../../../misc/PrimeBlockUI.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 { BlockUI } from './BlockUI';\nimport { booleanProperty } from '../properties';\n\n/**\n * The `PrimeReact:blockUI` component - a region masked while something is in flight.\n *\n * PrimeReact 11 removed `BlockUI` outright: no renamed module, no compositional replacement, no headless\n * hook. The name is in this package's manifest and screens are authored against it, so the adapter now\n * renders Cratis's own {@link BlockUI} instead. The element's contract is unchanged - a `blocked` flag and\n * whatever the `content` slot holds - which is the point: the removal is a fact about PrimeReact, not\n * something a screen should have to know.\n *\n * The default is `blocked`, because an element a screen bothered to place is there to say \"this region is\n * waiting\"; an unblocked block is a wrapper that does nothing.\n */\nexport function PrimeBlockUI({ element, slots }: RegisteredComponentProps) {\n return (\n <BlockUI\n data-scene-id={element.id}\n blocked={booleanProperty(element, 'blocked', true)}\n fullScreen={booleanProperty(element, 'fullScreen', false)}>\n {slots.content}\n </BlockUI>\n );\n}\n"],"names":["PrimeBlockUI","element","slots","_jsx","BlockUI","data-scene-id","id","blocked","booleanProperty","fullScreen","content"],"mappings":";;;;;;AAAA;AACA;AAMA;;;;;;;;;;;AAWC,IACM,SAASA,YAAAA,CAAa,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACrE,IAAA,qBACIC,cAAA,CAACC,eAAAA,EAAAA;AACGC,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;QACzBC,OAAAA,EAASC,0BAAAA,CAAgBP,SAAS,SAAA,EAAW,IAAA,CAAA;QAC7CQ,UAAAA,EAAYD,0BAAAA,CAAgBP,SAAS,YAAA,EAAc,KAAA,CAAA;AAClDC,QAAAA,QAAAA,EAAAA,KAAAA,CAAMQ;;AAGnB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeChip.js","sources":["../../../misc/PrimeChip.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 { Chip } from 'primereact/chip';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:chip` component - a compact, optionally removable label.\n *\n * PrimeReact 11 replaced the `label` / `icon` / `image` / `removable` props with named parts, so the\n * adapter is what decides that an authored image wins over an authored icon and that both sit in the\n * leading `Start` slot. A screen can therefore only ever produce one leading adornment, which is the\n * whole point of a chip: a second one turns it into a toolbar.\n *\n * `Chip.Remove` carries the removal behavior itself - clicking it hides the chip through the component's\n * own state, so the adapter has nothing to wire. It renders a `span`, so the accessible name and button\n * role are supplied here rather than left to a screen that has no way to reach the part.\n */\nexport function PrimeChip({ element }: RegisteredComponentProps) {\n const label = stringProperty(element, 'label');\n const icon = stringProperty(element, 'icon');\n const image = stringProperty(element, 'image');\n\n let adornment: ReactNode;\n if (image !== undefined) adornment = <img src={image} alt='' className='h-full w-full rounded-full object-cover' />;\n else if (icon !== undefined) adornment = <i className={icon} aria-hidden='true' />;\n\n return (\n <Chip.Root data-scene-id={element.id}>\n {adornment !== undefined && <Chip.Start>{adornment}</Chip.Start>}\n <Chip.Label>{label}</Chip.Label>\n {booleanProperty(element, 'removable', false) && (\n <Chip.Remove role='button' aria-label={label === undefined ? 'Remove' : `Remove ${label}`}>\n <i className='pi pi-times-circle' aria-hidden='true' />\n </Chip.Remove>\n )}\n </Chip.Root>\n );\n}\n"],"names":["PrimeChip","element","label","stringProperty","icon","image","adornment","undefined","_jsx","img","src","alt","className","i","aria-hidden","_jsxs","Chip","Root","data-scene-id","id","Start","Label","booleanProperty","Remove","role","aria-label"],"mappings":";;;;;;AAAA;AACA;AAOA;;;;;;;;;;;AAWC,IACM,SAASA,SAAAA,CAAU,EAAEC,OAAO,EAA4B,EAAA;IAC3D,MAAMC,KAAAA,GAAQC,0BAAeF,OAAAA,EAAS,OAAA,CAAA;IACtC,MAAMG,IAAAA,GAAOD,0BAAeF,OAAAA,EAAS,MAAA,CAAA;IACrC,MAAMI,KAAAA,GAAQF,0BAAeF,OAAAA,EAAS,OAAA,CAAA;IAEtC,IAAIK,SAAAA;IACJ,IAAID,KAAAA,KAAUE,SAAAA,EAAWD,SAAAA,iBAAYE,cAAA,CAACC,KAAAA,EAAAA;QAAIC,GAAAA,EAAKL,KAAAA;QAAOM,GAAAA,EAAI,EAAA;QAAGC,SAAAA,EAAU;;SAClE,IAAIR,IAAAA,KAASG,SAAAA,EAAWD,SAAAA,iBAAYE,cAAA,CAACK,GAAAA,EAAAA;QAAED,SAAAA,EAAWR,IAAAA;QAAMU,aAAAA,EAAY;;IAEzE,qBACIC,eAAA,CAACC,UAAKC,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAejB,QAAQkB,EAAE;;YAC/Bb,SAAAA,KAAcC,SAAAA,kBAAaC,cAAA,CAACQ,SAAAA,CAAKI,KAAK,EAAA;AAAEd,gBAAAA,QAAAA,EAAAA;;AACzC,0BAAAE,cAAA,CAACQ,UAAKK,KAAK,EAAA;AAAEnB,gBAAAA,QAAAA,EAAAA;;AACZoB,YAAAA,0BAAAA,CAAgBrB,OAAAA,EAAS,WAAA,EAAa,KAAA,CAAA,kBACnCO,cAAA,CAACQ,UAAKO,MAAM,EAAA;gBAACC,IAAAA,EAAK,QAAA;AAASC,gBAAAA,YAAAA,EAAYvB,UAAUK,SAAAA,GAAY,QAAA,GAAW,CAAC,OAAO,EAAEL,KAAAA,CAAAA,CAAO;AACrF,gBAAA,QAAA,gBAAAM,cAAA,CAACK,GAAAA,EAAAA;oBAAED,SAAAA,EAAU,oBAAA;oBAAqBE,aAAAA,EAAY;;;;;AAKlE
|
|
1
|
+
{"version":3,"file":"PrimeChip.js","sources":["../../../misc/PrimeChip.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 { Chip } from 'primereact/chip';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:chip` component - a compact, optionally removable label.\n *\n * PrimeReact 11 replaced the `label` / `icon` / `image` / `removable` props with named parts, so the\n * adapter is what decides that an authored image wins over an authored icon and that both sit in the\n * leading `Start` slot. A screen can therefore only ever produce one leading adornment, which is the\n * whole point of a chip: a second one turns it into a toolbar.\n *\n * `Chip.Remove` carries the removal behavior itself - clicking it hides the chip through the component's\n * own state, so the adapter has nothing to wire. It renders a `span`, so the accessible name and button\n * role are supplied here rather than left to a screen that has no way to reach the part.\n */\nexport function PrimeChip({ element }: RegisteredComponentProps) {\n const label = stringProperty(element, 'label');\n const icon = stringProperty(element, 'icon');\n const image = stringProperty(element, 'image');\n\n let adornment: ReactNode;\n if (image !== undefined) adornment = <img src={image} alt='' className='h-full w-full rounded-full object-cover' />;\n else if (icon !== undefined) adornment = <i className={icon} aria-hidden='true' />;\n\n return (\n <Chip.Root data-scene-id={element.id}>\n {adornment !== undefined && <Chip.Start>{adornment}</Chip.Start>}\n <Chip.Label>{label}</Chip.Label>\n {booleanProperty(element, 'removable', false) && (\n <Chip.Remove role='button' aria-label={label === undefined ? 'Remove' : `Remove ${label}`}>\n <i className='pi pi-times-circle' aria-hidden='true' />\n </Chip.Remove>\n )}\n </Chip.Root>\n );\n}\n"],"names":["PrimeChip","element","label","stringProperty","icon","image","adornment","undefined","_jsx","img","src","alt","className","i","aria-hidden","_jsxs","Chip","Root","data-scene-id","id","Start","Label","booleanProperty","Remove","role","aria-label"],"mappings":";;;;;;AAAA;AACA;AAOA;;;;;;;;;;;AAWC,IACM,SAASA,SAAAA,CAAU,EAAEC,OAAO,EAA4B,EAAA;IAC3D,MAAMC,KAAAA,GAAQC,0BAAeF,OAAAA,EAAS,OAAA,CAAA;IACtC,MAAMG,IAAAA,GAAOD,0BAAeF,OAAAA,EAAS,MAAA,CAAA;IACrC,MAAMI,KAAAA,GAAQF,0BAAeF,OAAAA,EAAS,OAAA,CAAA;IAEtC,IAAIK,SAAAA;IACJ,IAAID,KAAAA,KAAUE,SAAAA,EAAWD,SAAAA,iBAAYE,cAAA,CAACC,KAAAA,EAAAA;QAAIC,GAAAA,EAAKL,KAAAA;QAAOM,GAAAA,EAAI,EAAA;QAAGC,SAAAA,EAAU;;SAClE,IAAIR,IAAAA,KAASG,SAAAA,EAAWD,SAAAA,iBAAYE,cAAA,CAACK,GAAAA,EAAAA;QAAED,SAAAA,EAAWR,IAAAA;QAAMU,aAAAA,EAAY;;IAEzE,qBACIC,eAAA,CAACC,UAAKC,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAejB,QAAQkB,EAAE;;YAC/Bb,SAAAA,KAAcC,SAAAA,kBAAaC,cAAA,CAACQ,SAAAA,CAAKI,KAAK,EAAA;AAAEd,gBAAAA,QAAAA,EAAAA;;AACzC,0BAAAE,cAAA,CAACQ,UAAKK,KAAK,EAAA;AAAEnB,gBAAAA,QAAAA,EAAAA;;AACZoB,YAAAA,0BAAAA,CAAgBrB,OAAAA,EAAS,WAAA,EAAa,KAAA,CAAA,kBACnCO,cAAA,CAACQ,UAAKO,MAAM,EAAA;gBAACC,IAAAA,EAAK,QAAA;AAASC,gBAAAA,YAAAA,EAAYvB,UAAUK,SAAAA,GAAY,QAAA,GAAW,CAAC,OAAO,EAAEL,KAAAA,CAAAA,CAAO;AACrF,gBAAA,QAAA,gBAAAM,cAAA,CAACK,GAAAA,EAAAA;oBAAED,SAAAA,EAAU,oBAAA;oBAAqBE,aAAAA,EAAY;;;;;AAKlE;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeInplace.js","sources":["../../../misc/PrimeInplace.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 { Inplace } from 'primereact/inplace';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:inplace` component - a read-only value that becomes an editor when clicked.\n *\n * The collapsed view comes from the `label` property and the expanded view from the `content` slot,\n * because the two are different kinds of thing: one is a value, the other is whatever editor the screen\n * wants behind it.\n *\n * PrimeReact 11 turned the `closable` flag into a `Close` part, which is a better arrangement than it\n * looks: the button now lives *inside* the editor, so it is reached by the same tab order as the editor\n * itself instead of floating beside a region the reader has already left. The property is kept and simply\n * decides whether that part is rendered, so screens written against v10 keep meaning what they said.\n */\nexport function PrimeInplace({ element, slots }: RegisteredComponentProps) {\n return (\n <Inplace.Root data-scene-id={element.id}>\n <Inplace.Display>{stringProperty(element, 'label', 'Click to edit')}</Inplace.Display>\n <Inplace.Content>\n {slots.content}\n {booleanProperty(element, 'closable', true) && (\n <Inplace.Close aria-label='Close editor'>\n <i className='pi pi-times' aria-hidden='true' />\n </Inplace.Close>\n )}\n </Inplace.Content>\n </Inplace.Root>\n );\n}\n"],"names":["PrimeInplace","element","slots","_jsxs","Inplace","Root","data-scene-id","id","_jsx","Display","stringProperty","Content","content","booleanProperty","Close","aria-label","i","className","aria-hidden"],"mappings":";;;;;;AAOA;;;;;;;;;;;AAWC,IACM,SAASA,YAAAA,CAAa,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACrE,qBACIC,eAAA,CAACC,gBAAQC,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAeL,QAAQM,EAAE;;AACnC,0BAAAC,cAAA,CAACJ,gBAAQK,OAAO,EAAA;AAAEC,gBAAAA,QAAAA,EAAAA,yBAAAA,CAAeT,SAAS,OAAA,EAAS,eAAA;;AACnD,0BAAAE,eAAA,CAACC,gBAAQO,OAAO,EAAA;;AACXT,oBAAAA,KAAAA,CAAMU,OAAO;AACbC,oBAAAA,0BAAAA,CAAgBZ,OAAAA,EAAS,UAAA,EAAY,IAAA,CAAA,kBAClCO,cAAA,CAACJ,gBAAQU,KAAK,EAAA;wBAACC,YAAAA,EAAW,cAAA;AACtB,wBAAA,QAAA,gBAAAP,cAAA,CAACQ,GAAAA,EAAAA;4BAAEC,SAAAA,EAAU,aAAA;4BAAcC,aAAAA,EAAY;;;;;;;AAM/D
|
|
1
|
+
{"version":3,"file":"PrimeInplace.js","sources":["../../../misc/PrimeInplace.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 { Inplace } from 'primereact/inplace';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:inplace` component - a read-only value that becomes an editor when clicked.\n *\n * The collapsed view comes from the `label` property and the expanded view from the `content` slot,\n * because the two are different kinds of thing: one is a value, the other is whatever editor the screen\n * wants behind it.\n *\n * PrimeReact 11 turned the `closable` flag into a `Close` part, which is a better arrangement than it\n * looks: the button now lives *inside* the editor, so it is reached by the same tab order as the editor\n * itself instead of floating beside a region the reader has already left. The property is kept and simply\n * decides whether that part is rendered, so screens written against v10 keep meaning what they said.\n */\nexport function PrimeInplace({ element, slots }: RegisteredComponentProps) {\n return (\n <Inplace.Root data-scene-id={element.id}>\n <Inplace.Display>{stringProperty(element, 'label', 'Click to edit')}</Inplace.Display>\n <Inplace.Content>\n {slots.content}\n {booleanProperty(element, 'closable', true) && (\n <Inplace.Close aria-label='Close editor'>\n <i className='pi pi-times' aria-hidden='true' />\n </Inplace.Close>\n )}\n </Inplace.Content>\n </Inplace.Root>\n );\n}\n"],"names":["PrimeInplace","element","slots","_jsxs","Inplace","Root","data-scene-id","id","_jsx","Display","stringProperty","Content","content","booleanProperty","Close","aria-label","i","className","aria-hidden"],"mappings":";;;;;;AAOA;;;;;;;;;;;AAWC,IACM,SAASA,YAAAA,CAAa,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACrE,qBACIC,eAAA,CAACC,gBAAQC,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAeL,QAAQM,EAAE;;AACnC,0BAAAC,cAAA,CAACJ,gBAAQK,OAAO,EAAA;AAAEC,gBAAAA,QAAAA,EAAAA,yBAAAA,CAAeT,SAAS,OAAA,EAAS,eAAA;;AACnD,0BAAAE,eAAA,CAACC,gBAAQO,OAAO,EAAA;;AACXT,oBAAAA,KAAAA,CAAMU,OAAO;AACbC,oBAAAA,0BAAAA,CAAgBZ,OAAAA,EAAS,UAAA,EAAY,IAAA,CAAA,kBAClCO,cAAA,CAACJ,gBAAQU,KAAK,EAAA;wBAACC,YAAAA,EAAW,cAAA;AACtB,wBAAA,QAAA,gBAAAP,cAAA,CAACQ,GAAAA,EAAAA;4BAAEC,SAAAA,EAAU,aAAA;4BAAcC,aAAAA,EAAY;;;;;;;AAM/D;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeProgressBar.js","sources":["../../../misc/PrimeProgressBar.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 { ProgressBar } from 'primereact/progressbar';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, numberProperty } from '../properties';\n\n/**\n * The `PrimeReact:progressBar` component - determinate or indeterminate progress.\n *\n * The mode follows whether a `value` was given at all: progress you cannot measure is exactly what\n * indeterminate mode is for, so an element with no value animates rather than sitting at zero.\n *\n * In PrimeReact 11 the root is a headless wrapper that renders no element of its own - `Track` is the\n * first real DOM node and the one carrying the ARIA `progressbar` role - so `data-scene-id` and the bar's\n * height belong there rather than on `Root`. `Indicator` renders its children only in determinate mode,\n * which is why the value label can be handed to it unconditionally: an indeterminate bar has no\n * percentage to print and drops it on its own.\n */\nexport function PrimeProgressBar({ element }: RegisteredComponentProps) {\n const value = numberProperty(element, 'value');\n return (\n <ProgressBar.Root value={value} mode={value === undefined ? 'indeterminate' : 'determinate'}>\n <ProgressBar.Track data-scene-id={element.id} style={{ height: '1rem' }}>\n <ProgressBar.Indicator>{booleanProperty(element, 'showValue', true) && <ProgressBar.Value />}</ProgressBar.Indicator>\n </ProgressBar.Track>\n </ProgressBar.Root>\n );\n}\n"],"names":["PrimeProgressBar","element","value","numberProperty","_jsx","ProgressBar","Root","mode","undefined","Track","data-scene-id","id","style","height","Indicator","booleanProperty","Value"],"mappings":";;;;;;AAOA;;;;;;;;;;;AAWC,IACM,SAASA,gBAAAA,CAAiB,EAAEC,OAAO,EAA4B,EAAA;IAClE,MAAMC,KAAAA,GAAQC,0BAAeF,OAAAA,EAAS,OAAA,CAAA;IACtC,qBACIG,cAAA,CAACC,wBAAYC,IAAI,EAAA;QAACJ,KAAAA,EAAOA,KAAAA;QAAOK,IAAAA,EAAML,KAAAA,KAAUM,YAAY,eAAA,GAAkB,aAAA;gCAC1EJ,cAAA,CAACC,wBAAYI,KAAK,EAAA;AAACC,YAAAA,eAAAA,EAAeT,QAAQU,EAAE;YAAEC,KAAAA,EAAO;gBAAEC,MAAAA,EAAQ;AAAO,aAAA;oCAClET,cAAA,CAACC,wBAAYS,SAAS,EAAA;AAAEC,gBAAAA,QAAAA,EAAAA,0BAAAA,CAAgBd,OAAAA,EAAS,WAAA,EAAa,IAAA,CAAA,kBAASG,cAAA,CAACC,wBAAYW,KAAK,EAAA,EAAA;;;;AAIzG
|
|
1
|
+
{"version":3,"file":"PrimeProgressBar.js","sources":["../../../misc/PrimeProgressBar.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 { ProgressBar } from 'primereact/progressbar';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, numberProperty } from '../properties';\n\n/**\n * The `PrimeReact:progressBar` component - determinate or indeterminate progress.\n *\n * The mode follows whether a `value` was given at all: progress you cannot measure is exactly what\n * indeterminate mode is for, so an element with no value animates rather than sitting at zero.\n *\n * In PrimeReact 11 the root is a headless wrapper that renders no element of its own - `Track` is the\n * first real DOM node and the one carrying the ARIA `progressbar` role - so `data-scene-id` and the bar's\n * height belong there rather than on `Root`. `Indicator` renders its children only in determinate mode,\n * which is why the value label can be handed to it unconditionally: an indeterminate bar has no\n * percentage to print and drops it on its own.\n */\nexport function PrimeProgressBar({ element }: RegisteredComponentProps) {\n const value = numberProperty(element, 'value');\n return (\n <ProgressBar.Root value={value} mode={value === undefined ? 'indeterminate' : 'determinate'}>\n <ProgressBar.Track data-scene-id={element.id} style={{ height: '1rem' }}>\n <ProgressBar.Indicator>{booleanProperty(element, 'showValue', true) && <ProgressBar.Value />}</ProgressBar.Indicator>\n </ProgressBar.Track>\n </ProgressBar.Root>\n );\n}\n"],"names":["PrimeProgressBar","element","value","numberProperty","_jsx","ProgressBar","Root","mode","undefined","Track","data-scene-id","id","style","height","Indicator","booleanProperty","Value"],"mappings":";;;;;;AAOA;;;;;;;;;;;AAWC,IACM,SAASA,gBAAAA,CAAiB,EAAEC,OAAO,EAA4B,EAAA;IAClE,MAAMC,KAAAA,GAAQC,0BAAeF,OAAAA,EAAS,OAAA,CAAA;IACtC,qBACIG,cAAA,CAACC,wBAAYC,IAAI,EAAA;QAACJ,KAAAA,EAAOA,KAAAA;QAAOK,IAAAA,EAAML,KAAAA,KAAUM,YAAY,eAAA,GAAkB,aAAA;gCAC1EJ,cAAA,CAACC,wBAAYI,KAAK,EAAA;AAACC,YAAAA,eAAAA,EAAeT,QAAQU,EAAE;YAAEC,KAAAA,EAAO;gBAAEC,MAAAA,EAAQ;AAAO,aAAA;oCAClET,cAAA,CAACC,wBAAYS,SAAS,EAAA;AAAEC,gBAAAA,QAAAA,EAAAA,0BAAAA,CAAgBd,OAAAA,EAAS,WAAA,EAAa,IAAA,CAAA,kBAASG,cAAA,CAACC,wBAAYW,KAAK,EAAA,EAAA;;;;AAIzG;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeProgressSpinner.js","sources":["../../../misc/PrimeProgressSpinner.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 { ProgressSpinner } from 'primereact/progressspinner';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { numberProperty } from '../properties';\n\n/**\n * The `PrimeReact:progressSpinner` component - an indeterminate busy indicator.\n *\n * PrimeReact 11 opens the SVG up into parts: `Root` draws the `svg` and its viewBox, `Track` is the\n * circle that stays put and `Range` the arc that turns. Both are needed for the spinner to read as a ring\n * rather than a lone rotating stroke, so the adapter always supplies the pair - a Scene element has no\n * property that would sensibly omit one.\n *\n * `strokeWidth` is a number in v11 where v10 took a string, and it is left at the component's own default\n * because the only thing a screen sizes here is the diameter.\n */\nexport function PrimeProgressSpinner({ element }: RegisteredComponentProps) {\n const size = numberProperty(element, 'size', 50);\n return (\n <ProgressSpinner.Root data-scene-id={element.id} style={{ width: `${size}px`, height: `${size}px` }}>\n <ProgressSpinner.Track />\n <ProgressSpinner.Range />\n </ProgressSpinner.Root>\n );\n}\n"],"names":["PrimeProgressSpinner","element","size","numberProperty","_jsxs","ProgressSpinner","Root","data-scene-id","id","style","width","height","_jsx","Track","Range"],"mappings":";;;;;;AAOA;;;;;;;;;;AAUC,IACM,SAASA,oBAAAA,CAAqB,EAAEC,OAAO,EAA4B,EAAA;IACtE,MAAMC,IAAAA,GAAOC,yBAAAA,CAAeF,OAAAA,EAAS,MAAA,EAAQ,EAAA,CAAA;IAC7C,qBACIG,eAAA,CAACC,gCAAgBC,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAeN,QAAQO,EAAE;QAAEC,KAAAA,EAAO;YAAEC,KAAAA,EAAO,CAAA,EAAGR,IAAAA,CAAK,EAAE,CAAC;YAAES,MAAAA,EAAQ,CAAA,EAAGT,IAAAA,CAAK,EAAE;AAAE,SAAA;;AAC9F,0BAAAU,cAAA,CAACP,gCAAgBQ,KAAK,EAAA,EAAA,CAAA;AACtB,0BAAAD,cAAA,CAACP,gCAAgBS,KAAK,EAAA,EAAA;;;AAGlC
|
|
1
|
+
{"version":3,"file":"PrimeProgressSpinner.js","sources":["../../../misc/PrimeProgressSpinner.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 { ProgressSpinner } from 'primereact/progressspinner';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { numberProperty } from '../properties';\n\n/**\n * The `PrimeReact:progressSpinner` component - an indeterminate busy indicator.\n *\n * PrimeReact 11 opens the SVG up into parts: `Root` draws the `svg` and its viewBox, `Track` is the\n * circle that stays put and `Range` the arc that turns. Both are needed for the spinner to read as a ring\n * rather than a lone rotating stroke, so the adapter always supplies the pair - a Scene element has no\n * property that would sensibly omit one.\n *\n * `strokeWidth` is a number in v11 where v10 took a string, and it is left at the component's own default\n * because the only thing a screen sizes here is the diameter.\n */\nexport function PrimeProgressSpinner({ element }: RegisteredComponentProps) {\n const size = numberProperty(element, 'size', 50);\n return (\n <ProgressSpinner.Root data-scene-id={element.id} style={{ width: `${size}px`, height: `${size}px` }}>\n <ProgressSpinner.Track />\n <ProgressSpinner.Range />\n </ProgressSpinner.Root>\n );\n}\n"],"names":["PrimeProgressSpinner","element","size","numberProperty","_jsxs","ProgressSpinner","Root","data-scene-id","id","style","width","height","_jsx","Track","Range"],"mappings":";;;;;;AAOA;;;;;;;;;;AAUC,IACM,SAASA,oBAAAA,CAAqB,EAAEC,OAAO,EAA4B,EAAA;IACtE,MAAMC,IAAAA,GAAOC,yBAAAA,CAAeF,OAAAA,EAAS,MAAA,EAAQ,EAAA,CAAA;IAC7C,qBACIG,eAAA,CAACC,gCAAgBC,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAeN,QAAQO,EAAE;QAAEC,KAAAA,EAAO;YAAEC,KAAAA,EAAO,CAAA,EAAGR,IAAAA,CAAK,EAAE,CAAC;YAAES,MAAAA,EAAQ,CAAA,EAAGT,IAAAA,CAAK,EAAE;AAAE,SAAA;;AAC9F,0BAAAU,cAAA,CAACP,gCAAgBQ,KAAK,EAAA,EAAA,CAAA;AACtB,0BAAAD,cAAA,CAACP,gCAAgBS,KAAK,EAAA,EAAA;;;AAGlC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeScrollTop.js","sources":["../../../misc/PrimeScrollTop.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 { useRef } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ScrollTop } from './ScrollTop';\nimport { numberProperty } from '../properties';\n\n/**\n * The `PrimeReact:scrollTop` component - a button that returns the reader to the top.\n *\n * PrimeReact 11 removed `ScrollTop` with no replacement and no headless hook, so the adapter renders\n * Cratis's own {@link ScrollTop}. The element keeps the shape it had: a sized, scrollable box holding the\n * `content` slot, with the button watching that box rather than the window. A window-targeted button\n * inside a composed screen would scroll something the element does not own, and would stay invisible in\n * any preview shorter than a page.\n *\n * The box and the scrolling region are two elements rather than one, which is what lets the button sit\n * still while the content moves under it. Anchored inside the scroller it would drift off with the\n * content it is offering to escape.\n */\nexport function PrimeScrollTop({ element, slots }: RegisteredComponentProps) {\n const scroller = useRef<HTMLDivElement>(null);\n return (\n <div data-scene-id={element.id} className='relative'>\n <div ref={scroller} className='overflow-auto' style={{ height: `${numberProperty(element, 'height', 200)}px` }}>\n {slots.content}\n </div>\n <ScrollTop target={scroller} threshold={numberProperty(element, 'threshold', 100)} />\n </div>\n );\n}\n"],"names":["PrimeScrollTop","element","slots","scroller","useRef","_jsxs","div","data-scene-id","id","className","_jsx","ref","style","height","numberProperty","content","ScrollTop","target","threshold"],"mappings":";;;;;;;AAQA;;;;;;;;;;;;AAYC,IACM,SAASA,cAAAA,CAAe,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACvE,IAAA,MAAMC,WAAWC,YAAAA,CAAuB,IAAA,CAAA;AACxC,IAAA,qBACIC,eAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeN,QAAQO,EAAE;QAAEC,SAAAA,EAAU,UAAA;;0BACtCC,cAAA,CAACJ,KAAAA,EAAAA;gBAAIK,GAAAA,EAAKR,QAAAA;gBAAUM,SAAAA,EAAU,eAAA;gBAAgBG,KAAAA,EAAO;AAAEC,oBAAAA,MAAAA,EAAQ,GAAGC,yBAAAA,CAAeb,OAAAA,EAAS,QAAA,EAAU,GAAA,CAAA,CAAK,EAAE;AAAE,iBAAA;AACxGC,gBAAAA,QAAAA,EAAAA,KAAAA,CAAMa;;0BAEXL,cAAA,CAACM,mBAAAA,EAAAA;gBAAUC,MAAAA,EAAQd,QAAAA;gBAAUe,SAAAA,EAAWJ,yBAAAA,CAAeb,SAAS,WAAA,EAAa,GAAA;;;;AAGzF
|
|
1
|
+
{"version":3,"file":"PrimeScrollTop.js","sources":["../../../misc/PrimeScrollTop.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 { useRef } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ScrollTop } from './ScrollTop';\nimport { numberProperty } from '../properties';\n\n/**\n * The `PrimeReact:scrollTop` component - a button that returns the reader to the top.\n *\n * PrimeReact 11 removed `ScrollTop` with no replacement and no headless hook, so the adapter renders\n * Cratis's own {@link ScrollTop}. The element keeps the shape it had: a sized, scrollable box holding the\n * `content` slot, with the button watching that box rather than the window. A window-targeted button\n * inside a composed screen would scroll something the element does not own, and would stay invisible in\n * any preview shorter than a page.\n *\n * The box and the scrolling region are two elements rather than one, which is what lets the button sit\n * still while the content moves under it. Anchored inside the scroller it would drift off with the\n * content it is offering to escape.\n */\nexport function PrimeScrollTop({ element, slots }: RegisteredComponentProps) {\n const scroller = useRef<HTMLDivElement>(null);\n return (\n <div data-scene-id={element.id} className='relative'>\n <div ref={scroller} className='overflow-auto' style={{ height: `${numberProperty(element, 'height', 200)}px` }}>\n {slots.content}\n </div>\n <ScrollTop target={scroller} threshold={numberProperty(element, 'threshold', 100)} />\n </div>\n );\n}\n"],"names":["PrimeScrollTop","element","slots","scroller","useRef","_jsxs","div","data-scene-id","id","className","_jsx","ref","style","height","numberProperty","content","ScrollTop","target","threshold"],"mappings":";;;;;;;AAQA;;;;;;;;;;;;AAYC,IACM,SAASA,cAAAA,CAAe,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACvE,IAAA,MAAMC,WAAWC,YAAAA,CAAuB,IAAA,CAAA;AACxC,IAAA,qBACIC,eAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeN,QAAQO,EAAE;QAAEC,SAAAA,EAAU,UAAA;;0BACtCC,cAAA,CAACJ,KAAAA,EAAAA;gBAAIK,GAAAA,EAAKR,QAAAA;gBAAUM,SAAAA,EAAU,eAAA;gBAAgBG,KAAAA,EAAO;AAAEC,oBAAAA,MAAAA,EAAQ,GAAGC,yBAAAA,CAAeb,OAAAA,EAAS,QAAA,EAAU,GAAA,CAAA,CAAK,EAAE;AAAE,iBAAA;AACxGC,gBAAAA,QAAAA,EAAAA,KAAAA,CAAMa;;0BAEXL,cAAA,CAACM,mBAAAA,EAAAA;gBAAUC,MAAAA,EAAQd,QAAAA;gBAAUe,SAAAA,EAAWJ,yBAAAA,CAAeb,SAAS,WAAA,EAAa,GAAA;;;;AAGzF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeSkeleton.js","sources":["../../../misc/PrimeSkeleton.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 { Skeleton } from 'primereact/skeleton';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:skeleton` component - the shape of content that has not arrived yet.\n *\n * One of the few components PrimeReact 11 left whole, and the props survived with it. The defaults are\n * repeated here rather than left to the component because a skeleton is only ever authored for a specific\n * gap in a layout, and a full-width one-line bar is the gap a screen most often has.\n */\nexport function PrimeSkeleton({ element }: RegisteredComponentProps) {\n return (\n <Skeleton\n data-scene-id={element.id}\n shape={stringProperty(element, 'shape', 'rectangle') as 'rectangle' | 'circle'}\n width={stringProperty(element, 'width', '100%')}\n height={stringProperty(element, 'height', '1rem')}\n />\n );\n}\n"],"names":["PrimeSkeleton","element","_jsx","Skeleton","data-scene-id","id","shape","stringProperty","width","height"],"mappings":";;;;;;AAOA;;;;;;AAMC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAA4B,EAAA;AAC/D,IAAA,qBACIC,cAAA,CAACC,iBAAAA,EAAAA;AACGC,QAAAA,eAAAA,EAAeH,QAAQI,EAAE;QACzBC,KAAAA,EAAOC,yBAAAA,CAAeN,SAAS,OAAA,EAAS,WAAA,CAAA;QACxCO,KAAAA,EAAOD,yBAAAA,CAAeN,SAAS,OAAA,EAAS,MAAA,CAAA;QACxCQ,MAAAA,EAAQF,yBAAAA,CAAeN,SAAS,QAAA,EAAU,MAAA;;AAGtD
|
|
1
|
+
{"version":3,"file":"PrimeSkeleton.js","sources":["../../../misc/PrimeSkeleton.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 { Skeleton } from 'primereact/skeleton';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:skeleton` component - the shape of content that has not arrived yet.\n *\n * One of the few components PrimeReact 11 left whole, and the props survived with it. The defaults are\n * repeated here rather than left to the component because a skeleton is only ever authored for a specific\n * gap in a layout, and a full-width one-line bar is the gap a screen most often has.\n */\nexport function PrimeSkeleton({ element }: RegisteredComponentProps) {\n return (\n <Skeleton\n data-scene-id={element.id}\n shape={stringProperty(element, 'shape', 'rectangle') as 'rectangle' | 'circle'}\n width={stringProperty(element, 'width', '100%')}\n height={stringProperty(element, 'height', '1rem')}\n />\n );\n}\n"],"names":["PrimeSkeleton","element","_jsx","Skeleton","data-scene-id","id","shape","stringProperty","width","height"],"mappings":";;;;;;AAOA;;;;;;AAMC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAA4B,EAAA;AAC/D,IAAA,qBACIC,cAAA,CAACC,iBAAAA,EAAAA;AACGC,QAAAA,eAAAA,EAAeH,QAAQI,EAAE;QACzBC,KAAAA,EAAOC,yBAAAA,CAAeN,SAAS,OAAA,EAAS,WAAA,CAAA;QACxCO,KAAAA,EAAOD,yBAAAA,CAAeN,SAAS,OAAA,EAAS,MAAA,CAAA;QACxCQ,MAAAA,EAAQF,yBAAAA,CAAeN,SAAS,QAAA,EAAU,MAAA;;AAGtD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeTag.js","sources":["../../../misc/PrimeTag.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 { Tag } from 'primereact/tag';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport {booleanProperty, severityProperty, stringProperty} from '../properties';\n\n/**\n * The `PrimeReact:tag` component - a colored status label, the read-only counterpart to a chip.\n *\n * PrimeReact 11 dropped the `value` and `icon` props; a tag renders its children now. The icon is marked\n * decorative because the value beside it already carries the meaning - a screen reader announcing\n * \"check-circle Published\" would be reading the styling out loud.\n *\n * The v10 severity `warning` is translated to v11's `warn` rather than passed through, so a screen\n * authored against the old vocabulary keeps its color instead of quietly rendering in the default one.\n */\nexport function PrimeTag({ element }: RegisteredComponentProps) {\n const icon = stringProperty(element, 'icon');\n // Tag and Badge are the two components PrimeReact 11 gives no `help` variant, so an authored\n // `help` degrades to the default styling rather than failing to compile.\n const severity = severityProperty(element, 'severity');\n return (\n <Tag\n data-scene-id={element.id}\n severity={severity === 'help' ? undefined : severity}\n rounded={booleanProperty(element, 'rounded', false)}>\n {icon !== undefined && <i className={icon} aria-hidden='true' />}\n {stringProperty(element, 'value', '')}\n </Tag>\n );\n}\n"],"names":["PrimeTag","element","icon","stringProperty","severity","severityProperty","_jsxs","Tag","data-scene-id","id","undefined","rounded","booleanProperty","_jsx","i","className","aria-hidden"],"mappings":";;;;;;AAOA;;;;;;;;;AASC,IACM,SAASA,QAAAA,CAAS,EAAEC,OAAO,EAA4B,EAAA;IAC1D,MAAMC,IAAAA,GAAOC,0BAAeF,OAAAA,EAAS,MAAA,CAAA;;;IAGrC,MAAMG,QAAAA,GAAWC,4BAAiBJ,OAAAA,EAAS,UAAA,CAAA;AAC3C,IAAA,qBACIK,eAAA,CAACC,OAAAA,EAAAA;AACGC,QAAAA,eAAAA,EAAeP,QAAQQ,EAAE;QACzBL,QAAAA,EAAUA,QAAAA,KAAa,SAASM,SAAAA,GAAYN,QAAAA;QAC5CO,OAAAA,EAASC,0BAAAA,CAAgBX,SAAS,SAAA,EAAW,KAAA,CAAA;;AAC5CC,YAAAA,IAAAA,KAASQ,2BAAaG,cAAA,CAACC,GAAAA,EAAAA;gBAAEC,SAAAA,EAAWb,IAAAA;gBAAMc,aAAAA,EAAY;;AACtDb,YAAAA,yBAAAA,CAAeF,SAAS,OAAA,EAAS,EAAA;;;AAG9C
|
|
1
|
+
{"version":3,"file":"PrimeTag.js","sources":["../../../misc/PrimeTag.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 { Tag } from 'primereact/tag';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport {booleanProperty, severityProperty, stringProperty} from '../properties';\n\n/**\n * The `PrimeReact:tag` component - a colored status label, the read-only counterpart to a chip.\n *\n * PrimeReact 11 dropped the `value` and `icon` props; a tag renders its children now. The icon is marked\n * decorative because the value beside it already carries the meaning - a screen reader announcing\n * \"check-circle Published\" would be reading the styling out loud.\n *\n * The v10 severity `warning` is translated to v11's `warn` rather than passed through, so a screen\n * authored against the old vocabulary keeps its color instead of quietly rendering in the default one.\n */\nexport function PrimeTag({ element }: RegisteredComponentProps) {\n const icon = stringProperty(element, 'icon');\n // Tag and Badge are the two components PrimeReact 11 gives no `help` variant, so an authored\n // `help` degrades to the default styling rather than failing to compile.\n const severity = severityProperty(element, 'severity');\n return (\n <Tag\n data-scene-id={element.id}\n severity={severity === 'help' ? undefined : severity}\n rounded={booleanProperty(element, 'rounded', false)}>\n {icon !== undefined && <i className={icon} aria-hidden='true' />}\n {stringProperty(element, 'value', '')}\n </Tag>\n );\n}\n"],"names":["PrimeTag","element","icon","stringProperty","severity","severityProperty","_jsxs","Tag","data-scene-id","id","undefined","rounded","booleanProperty","_jsx","i","className","aria-hidden"],"mappings":";;;;;;AAOA;;;;;;;;;AASC,IACM,SAASA,QAAAA,CAAS,EAAEC,OAAO,EAA4B,EAAA;IAC1D,MAAMC,IAAAA,GAAOC,0BAAeF,OAAAA,EAAS,MAAA,CAAA;;;IAGrC,MAAMG,QAAAA,GAAWC,4BAAiBJ,OAAAA,EAAS,UAAA,CAAA;AAC3C,IAAA,qBACIK,eAAA,CAACC,OAAAA,EAAAA;AACGC,QAAAA,eAAAA,EAAeP,QAAQQ,EAAE;QACzBL,QAAAA,EAAUA,QAAAA,KAAa,SAASM,SAAAA,GAAYN,QAAAA;QAC5CO,OAAAA,EAASC,0BAAAA,CAAgBX,SAAS,SAAA,EAAW,KAAA,CAAA;;AAC5CC,YAAAA,IAAAA,KAASQ,2BAAaG,cAAA,CAACC,GAAAA,EAAAA;gBAAEC,SAAAA,EAAWb,IAAAA;gBAAMc,aAAAA,EAAY;;AACtDb,YAAAA,yBAAAA,CAAeF,SAAS,OAAA,EAAS,EAAA;;;AAG9C;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeTerminal.js","sources":["../../../misc/PrimeTerminal.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 { Terminal } from 'primereact/terminal';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:terminal` component - a command-line surface.\n *\n * Terminal accepts input and waits for something to answer. Nothing in this package answers, because\n * responding to a command is application behavior and a Scene element cannot express it. The component\n * therefore echoes what is typed and prints nothing back until the hosting application supplies an\n * answer - which is the honest shape of a terminal with no backend, not a broken one.\n *\n * PrimeReact 11 changed how that answer arrives: v10 published commands on a global `TerminalService`\n * that any listener could subscribe to, and v11 takes an `onCommand` callback on the component instead.\n * That is a real improvement for an application - the wiring is local and typed rather than a global\n * channel keyed by nothing - but it is also why the gap cannot be closed here: a callback has to come from\n * whoever mounts the screen, and the adapter only has the element.\n *\n * `CommandList` and `Prompt` render themselves from the component's own state when given no children, so\n * the composition is just naming the three regions a terminal has.\n */\nexport function PrimeTerminal({ element }: RegisteredComponentProps) {\n return (\n <Terminal.Root data-scene-id={element.id} prompt={stringProperty(element, 'prompt', '$')}>\n <Terminal.Welcome>{stringProperty(element, 'welcomeMessage', 'Welcome')}</Terminal.Welcome>\n <Terminal.CommandList />\n <Terminal.Prompt />\n </Terminal.Root>\n );\n}\n"],"names":["PrimeTerminal","element","_jsxs","Terminal","Root","data-scene-id","id","prompt","stringProperty","_jsx","Welcome","CommandList","Prompt"],"mappings":";;;;;;AAOA;;;;;;;;;;;;;;;;AAgBC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAA4B,EAAA;IAC/D,qBACIC,eAAA,CAACC,kBAASC,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;QAAEC,MAAAA,EAAQC,yBAAAA,CAAeP,SAAS,QAAA,EAAU,GAAA,CAAA;;AAChF,0BAAAQ,cAAA,CAACN,kBAASO,OAAO,EAAA;AAAEF,gBAAAA,QAAAA,EAAAA,yBAAAA,CAAeP,SAAS,gBAAA,EAAkB,SAAA;;AAC7D,0BAAAQ,cAAA,CAACN,kBAASQ,WAAW,EAAA,EAAA,CAAA;AACrB,0BAAAF,cAAA,CAACN,kBAASS,MAAM,EAAA,EAAA;;;AAG5B
|
|
1
|
+
{"version":3,"file":"PrimeTerminal.js","sources":["../../../misc/PrimeTerminal.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 { Terminal } from 'primereact/terminal';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:terminal` component - a command-line surface.\n *\n * Terminal accepts input and waits for something to answer. Nothing in this package answers, because\n * responding to a command is application behavior and a Scene element cannot express it. The component\n * therefore echoes what is typed and prints nothing back until the hosting application supplies an\n * answer - which is the honest shape of a terminal with no backend, not a broken one.\n *\n * PrimeReact 11 changed how that answer arrives: v10 published commands on a global `TerminalService`\n * that any listener could subscribe to, and v11 takes an `onCommand` callback on the component instead.\n * That is a real improvement for an application - the wiring is local and typed rather than a global\n * channel keyed by nothing - but it is also why the gap cannot be closed here: a callback has to come from\n * whoever mounts the screen, and the adapter only has the element.\n *\n * `CommandList` and `Prompt` render themselves from the component's own state when given no children, so\n * the composition is just naming the three regions a terminal has.\n */\nexport function PrimeTerminal({ element }: RegisteredComponentProps) {\n return (\n <Terminal.Root data-scene-id={element.id} prompt={stringProperty(element, 'prompt', '$')}>\n <Terminal.Welcome>{stringProperty(element, 'welcomeMessage', 'Welcome')}</Terminal.Welcome>\n <Terminal.CommandList />\n <Terminal.Prompt />\n </Terminal.Root>\n );\n}\n"],"names":["PrimeTerminal","element","_jsxs","Terminal","Root","data-scene-id","id","prompt","stringProperty","_jsx","Welcome","CommandList","Prompt"],"mappings":";;;;;;AAOA;;;;;;;;;;;;;;;;AAgBC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAA4B,EAAA;IAC/D,qBACIC,eAAA,CAACC,kBAASC,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;QAAEC,MAAAA,EAAQC,yBAAAA,CAAeP,SAAS,QAAA,EAAU,GAAA,CAAA;;AAChF,0BAAAQ,cAAA,CAACN,kBAASO,OAAO,EAAA;AAAEF,gBAAAA,QAAAA,EAAAA,yBAAAA,CAAeP,SAAS,gBAAA,EAAkB,SAAA;;AAC7D,0BAAAQ,cAAA,CAACN,kBAASQ,WAAW,EAAA,EAAA,CAAA;AACrB,0BAAAF,cAAA,CAACN,kBAASS,MAAM,EAAA,EAAA;;;AAG5B;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollTop.js","sources":["../../../misc/ScrollTop.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 { HTMLAttributes, RefObject, useEffect, useState } from 'react';\nimport { Button } from 'primereact/button';\n\n/**\n * Configuration for {@link ScrollTop}.\n */\nexport interface ScrollTopProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'children'> {\n /**\n * How far the target has to have scrolled, in pixels, before the button appears. A button that is\n * always there is clutter; one that appears too late is never found.\n */\n threshold?: number;\n\n /**\n * The element to watch and return to the top of. Left out, the button watches the window - which is\n * the right default for a page, and the wrong one for a component embedded in a composed screen,\n * which is why the caller supplies it.\n */\n target?: RefObject<HTMLElement | null>;\n\n /**\n * The icon class to show, so an application using its own icon font is not forced onto `primeicons`.\n */\n icon?: string;\n}\n\n/**\n * A button that appears once its target has been scrolled past a threshold and takes the reader back to\n * the top.\n *\n * Cratis owns this component. PrimeReact 10 had `ScrollTop`; PrimeReact 11 removed it with no replacement\n * and no headless hook, and `scrollTop` is a name this package's manifest publishes, so screens are\n * written against it. The button itself is a PrimeReact `Button` - the piece that survived - so the\n * component still picks up whatever theme the application is running, and only the scroll watching is\n * ours.\n *\n * The listener is registered on the target and removed when the component unmounts or the target changes.\n * That is not incidental tidiness: this button is typically mounted inside a scrolling region that a\n * screen creates and destroys as the reader navigates, and a leaked `scroll` handler on a detached\n * element keeps the whole subtree alive.\n *\n * What it deliberately does not carry over from v10: the enter/leave transition (the button appears and\n * disappears outright), `behavior` as a prop - scrolling is always smooth, since an instant jump to the\n * top is disorienting and the only reason v10 exposed it was browsers that lacked support - and the\n * `pt` / passthrough styling hooks, which have no meaning outside PrimeReact's own component base.\n */\nexport function ScrollTop({ threshold = 400, target, icon = 'pi pi-chevron-up', className, ...rest }: ScrollTopProps) {\n const [visible, setVisible] = useState(false);\n\n useEffect(() => {\n const element = target?.current;\n const source: EventTarget = element ?? window;\n const update = () => setVisible((element ? element.scrollTop : window.scrollY) > threshold);\n\n update();\n source.addEventListener('scroll', update, { passive: true });\n return () => source.removeEventListener('scroll', update);\n }, [target, threshold]);\n\n if (!visible) return null;\n\n const scrollToTop = () => {\n const element = target?.current;\n if (element) element.scrollTo({ top: 0, behavior: 'smooth' });\n else window.scrollTo({ top: 0, behavior: 'smooth' });\n };\n\n return (\n <Button\n aria-label='Scroll to top'\n {...rest}\n rounded\n className={[target === undefined ? 'fixed bottom-6 right-6 z-40' : 'absolute bottom-3 right-3 z-10', className].filter(Boolean).join(' ')}\n onClick={scrollToTop}>\n <i className={icon} aria-hidden='true' />\n </Button>\n );\n}\n"],"names":["ScrollTop","threshold","target","icon","className","rest","visible","setVisible","useState","useEffect","element","current","source","window","update","scrollTop","scrollY","addEventListener","passive","removeEventListener","scrollToTop","scrollTo","top","behavior","_jsx","Button","aria-label","rounded","undefined","filter","Boolean","join","onClick","i","aria-hidden"],"mappings":";;;;;;AA6BA;;;;;;;;;;;;;;;;;;;AAmBC,IACM,SAASA,SAAAA,CAAU,EAAEC,YAAY,GAAG,EAAEC,MAAM,EAAEC,OAAO,kBAAkB,EAAEC,SAAS,EAAE,GAAGC,IAAAA,EAAsB,EAAA;AAChH,IAAA,MAAM,CAACC,OAAAA,EAASC,UAAAA,CAAW,GAAGC,cAAAA,CAAS,KAAA,CAAA;IAEvCC,eAAAA,CAAU,IAAA;AACN,QAAA,MAAMC,UAAUR,MAAAA,EAAQS,OAAAA;AACxB,QAAA,MAAMC,SAAsBF,OAAAA,IAAWG,MAAAA;AACvC,QAAA,MAAMC,MAAAA,GAAS,IAAMP,UAAAA,CAAYG,CAAAA,OAAAA,GAAUA,OAAAA,CAAQK,SAAS,GAAGF,MAAAA,CAAOG,OAAM,IAAKf,SAAAA,CAAAA;AAEjFa,QAAAA,MAAAA,EAAAA;QACAF,MAAAA,CAAOK,gBAAgB,CAAC,QAAA,EAAUH,MAAAA,EAAQ;YAAEI,OAAAA,EAAS;AAAK,SAAA,CAAA;AAC1D,QAAA,OAAO,IAAMN,MAAAA,CAAOO,mBAAmB,CAAC,QAAA,EAAUL,MAAAA,CAAAA;IACtD,CAAA,EAAG;AAACZ,QAAAA,MAAAA;AAAQD,QAAAA;AAAU,KAAA,CAAA;IAEtB,IAAI,CAACK,SAAS,OAAO,IAAA;AAErB,IAAA,MAAMc,WAAAA,GAAc,IAAA;AAChB,QAAA,MAAMV,UAAUR,MAAAA,EAAQS,OAAAA;QACxB,IAAID,OAAAA,EAASA,OAAAA,CAAQW,QAAQ,CAAC;YAAEC,GAAAA,EAAK,CAAA;YAAGC,QAAAA,EAAU;AAAS,SAAA,CAAA;AACtDV,aAAAA,MAAAA,CAAOQ,QAAQ,CAAC;YAAEC,GAAAA,EAAK,CAAA;YAAGC,QAAAA,EAAU;AAAS,SAAA,CAAA;AACtD,IAAA,CAAA;AAEA,IAAA,qBACIC,cAAA,CAACC,aAAAA,EAAAA;QACGC,YAAAA,EAAW,eAAA;AACV,QAAA,GAAGrB,IAAI;QACRsB,OAAO,EAAA,IAAA;QACPvB,SAAAA,EAAW;AAACF,YAAAA,MAAAA,KAAW0B,YAAY,6BAAA,GAAgC,gCAAA;AAAkCxB,YAAAA;AAAU,SAAA,CAACyB,MAAM,CAACC,OAAAA,CAAAA,CAASC,IAAI,CAAC,GAAA,CAAA;QACrIC,OAAAA,EAASZ,WAAAA;AACT,QAAA,QAAA,gBAAAI,cAAA,CAACS,GAAAA,EAAAA;YAAE7B,SAAAA,EAAWD,IAAAA;YAAM+B,aAAAA,EAAY;;;AAG5C
|
|
1
|
+
{"version":3,"file":"ScrollTop.js","sources":["../../../misc/ScrollTop.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 { HTMLAttributes, RefObject, useEffect, useState } from 'react';\nimport { Button } from 'primereact/button';\n\n/**\n * Configuration for {@link ScrollTop}.\n */\nexport interface ScrollTopProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'children'> {\n /**\n * How far the target has to have scrolled, in pixels, before the button appears. A button that is\n * always there is clutter; one that appears too late is never found.\n */\n threshold?: number;\n\n /**\n * The element to watch and return to the top of. Left out, the button watches the window - which is\n * the right default for a page, and the wrong one for a component embedded in a composed screen,\n * which is why the caller supplies it.\n */\n target?: RefObject<HTMLElement | null>;\n\n /**\n * The icon class to show, so an application using its own icon font is not forced onto `primeicons`.\n */\n icon?: string;\n}\n\n/**\n * A button that appears once its target has been scrolled past a threshold and takes the reader back to\n * the top.\n *\n * Cratis owns this component. PrimeReact 10 had `ScrollTop`; PrimeReact 11 removed it with no replacement\n * and no headless hook, and `scrollTop` is a name this package's manifest publishes, so screens are\n * written against it. The button itself is a PrimeReact `Button` - the piece that survived - so the\n * component still picks up whatever theme the application is running, and only the scroll watching is\n * ours.\n *\n * The listener is registered on the target and removed when the component unmounts or the target changes.\n * That is not incidental tidiness: this button is typically mounted inside a scrolling region that a\n * screen creates and destroys as the reader navigates, and a leaked `scroll` handler on a detached\n * element keeps the whole subtree alive.\n *\n * What it deliberately does not carry over from v10: the enter/leave transition (the button appears and\n * disappears outright), `behavior` as a prop - scrolling is always smooth, since an instant jump to the\n * top is disorienting and the only reason v10 exposed it was browsers that lacked support - and the\n * `pt` / passthrough styling hooks, which have no meaning outside PrimeReact's own component base.\n */\nexport function ScrollTop({ threshold = 400, target, icon = 'pi pi-chevron-up', className, ...rest }: ScrollTopProps) {\n const [visible, setVisible] = useState(false);\n\n useEffect(() => {\n const element = target?.current;\n const source: EventTarget = element ?? window;\n const update = () => setVisible((element ? element.scrollTop : window.scrollY) > threshold);\n\n update();\n source.addEventListener('scroll', update, { passive: true });\n return () => source.removeEventListener('scroll', update);\n }, [target, threshold]);\n\n if (!visible) return null;\n\n const scrollToTop = () => {\n const element = target?.current;\n if (element) element.scrollTo({ top: 0, behavior: 'smooth' });\n else window.scrollTo({ top: 0, behavior: 'smooth' });\n };\n\n return (\n <Button\n aria-label='Scroll to top'\n {...rest}\n rounded\n className={[target === undefined ? 'fixed bottom-6 right-6 z-40' : 'absolute bottom-3 right-3 z-10', className].filter(Boolean).join(' ')}\n onClick={scrollToTop}>\n <i className={icon} aria-hidden='true' />\n </Button>\n );\n}\n"],"names":["ScrollTop","threshold","target","icon","className","rest","visible","setVisible","useState","useEffect","element","current","source","window","update","scrollTop","scrollY","addEventListener","passive","removeEventListener","scrollToTop","scrollTo","top","behavior","_jsx","Button","aria-label","rounded","undefined","filter","Boolean","join","onClick","i","aria-hidden"],"mappings":";;;;;;AA6BA;;;;;;;;;;;;;;;;;;;AAmBC,IACM,SAASA,SAAAA,CAAU,EAAEC,YAAY,GAAG,EAAEC,MAAM,EAAEC,OAAO,kBAAkB,EAAEC,SAAS,EAAE,GAAGC,IAAAA,EAAsB,EAAA;AAChH,IAAA,MAAM,CAACC,OAAAA,EAASC,UAAAA,CAAW,GAAGC,cAAAA,CAAS,KAAA,CAAA;IAEvCC,eAAAA,CAAU,IAAA;AACN,QAAA,MAAMC,UAAUR,MAAAA,EAAQS,OAAAA;AACxB,QAAA,MAAMC,SAAsBF,OAAAA,IAAWG,MAAAA;AACvC,QAAA,MAAMC,MAAAA,GAAS,IAAMP,UAAAA,CAAYG,CAAAA,OAAAA,GAAUA,OAAAA,CAAQK,SAAS,GAAGF,MAAAA,CAAOG,OAAM,IAAKf,SAAAA,CAAAA;AAEjFa,QAAAA,MAAAA,EAAAA;QACAF,MAAAA,CAAOK,gBAAgB,CAAC,QAAA,EAAUH,MAAAA,EAAQ;YAAEI,OAAAA,EAAS;AAAK,SAAA,CAAA;AAC1D,QAAA,OAAO,IAAMN,MAAAA,CAAOO,mBAAmB,CAAC,QAAA,EAAUL,MAAAA,CAAAA;IACtD,CAAA,EAAG;AAACZ,QAAAA,MAAAA;AAAQD,QAAAA;AAAU,KAAA,CAAA;IAEtB,IAAI,CAACK,SAAS,OAAO,IAAA;AAErB,IAAA,MAAMc,WAAAA,GAAc,IAAA;AAChB,QAAA,MAAMV,UAAUR,MAAAA,EAAQS,OAAAA;QACxB,IAAID,OAAAA,EAASA,OAAAA,CAAQW,QAAQ,CAAC;YAAEC,GAAAA,EAAK,CAAA;YAAGC,QAAAA,EAAU;AAAS,SAAA,CAAA;AACtDV,aAAAA,MAAAA,CAAOQ,QAAQ,CAAC;YAAEC,GAAAA,EAAK,CAAA;YAAGC,QAAAA,EAAU;AAAS,SAAA,CAAA;AACtD,IAAA,CAAA;AAEA,IAAA,qBACIC,cAAA,CAACC,aAAAA,EAAAA;QACGC,YAAAA,EAAW,eAAA;AACV,QAAA,GAAGrB,IAAI;QACRsB,OAAO,EAAA,IAAA;QACPvB,SAAAA,EAAW;AAACF,YAAAA,MAAAA,KAAW0B,YAAY,6BAAA,GAAgC,gCAAA;AAAkCxB,YAAAA;AAAU,SAAA,CAACyB,MAAM,CAACC,OAAAA,CAAAA,CAASC,IAAI,CAAC,GAAA,CAAA;QACrIC,OAAAA,EAASZ,WAAAA;AACT,QAAA,QAAA,gBAAAI,cAAA,CAACS,GAAAA,EAAAA;YAAE7B,SAAAA,EAAWD,IAAAA;YAAM+B,aAAAA,EAAY;;;AAG5C;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmDialog.js","sources":["../../../overlay/ConfirmDialog.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 { Button } from 'primereact/button';\nimport { Dialog } from 'primereact/dialog';\n\n/**\n * Configuration for {@link ConfirmDialog}.\n */\nexport interface ConfirmDialogProps {\n /**\n * Whether the dialog is showing. The dialog is a controlled overlay - it never hides itself - so the\n * owner keeps this in state and lowers it from {@link ConfirmDialogProps.onHide}.\n */\n visible: boolean;\n\n /**\n * The question being asked. Typed as a node rather than a string so a caller can pose a question that\n * needs emphasis or a name in it, which is exactly the kind of question worth confirming.\n */\n message?: ReactNode;\n\n /**\n * The dialog's title.\n */\n header?: string;\n\n /**\n * A PrimeIcons class shown beside the message. Omitted entirely when absent rather than defaulted,\n * because the icon on a confirmation carries tone - a warning triangle on a harmless question is\n * misleading - and only the caller knows which is right.\n */\n icon?: string;\n\n /**\n * Label for the accepting button.\n */\n acceptLabel?: string;\n\n /**\n * Label for the rejecting button.\n */\n rejectLabel?: string;\n\n /**\n * Called when the user accepts. Always followed by {@link ConfirmDialogProps.onHide}.\n */\n onAccept?: () => void;\n\n /**\n * Called when the user rejects. Always followed by {@link ConfirmDialogProps.onHide}.\n */\n onReject?: () => void;\n\n /**\n * Called whenever the dialog should close - after either answer, and on every dismissal gesture\n * (the close button, `Escape`, a click on the backdrop). Answering and closing are reported\n * separately so a caller can lower `visible` in one place instead of in three.\n */\n onHide?: () => void;\n}\n\n/**\n * A Cratis-owned confirmation dialog - a question, an accepting answer and a rejecting one.\n *\n * This component is owned by Cratis because PrimeReact 11 removed `primereact/confirmdialog` outright.\n * There is no renamed successor to adapt to: what v11 ships instead is the compositional `Dialog` this is\n * built from, on the reasoning that a confirmation is a dialog with a known footer rather than a distinct\n * component. That is a fair reading, but it would otherwise push the same header/message/two-buttons\n * assembly into every caller, so this package assembles it once here and keeps the shape v10 callers\n * already expect.\n *\n * Two v10 capabilities are deliberately **not** carried over:\n *\n * - **The imperative `confirmDialog()` service API.** v10 let any code open a confirmation by calling a\n * module-level function that reached a singleton mounted elsewhere. That needs a caller and a global\n * mount point; this component is rendered and controlled by whoever owns the answer, which is the only\n * form a Scene element - configuration, not a caller - can use anyway.\n * - **`appendTo`.** v10 needed it to escape stacking contexts. v11 renders through `Dialog.Portal` under\n * an overlay manager that handles layering, so the prop existed only to work around a problem that is\n * now gone.\n *\n * @param props - {@link ConfirmDialogProps}.\n */\nexport function ConfirmDialog({ visible, message, header, icon, acceptLabel, rejectLabel, onAccept, onReject, onHide }: ConfirmDialogProps) {\n const accept = () => {\n onAccept?.();\n onHide?.();\n };\n\n const reject = () => {\n onReject?.();\n onHide?.();\n };\n\n return (\n <Dialog.Root\n open={visible}\n modal\n dismissable\n closeOnEscape\n onOpenChange={(event) => {\n if (!event.value) onHide?.();\n }}>\n <Dialog.Portal>\n <Dialog.Backdrop />\n <Dialog.Positioner>\n <Dialog.Popup style={{ width: '30rem' }}>\n <Dialog.Header>\n <Dialog.Title>{header}</Dialog.Title>\n <Dialog.Close aria-label='Close'>\n <i className='pi pi-times' />\n </Dialog.Close>\n </Dialog.Header>\n <Dialog.Content>\n <div className='flex items-center gap-3'>\n {icon !== undefined && <i className={icon} />}\n <span>{message}</span>\n </div>\n </Dialog.Content>\n <Dialog.Footer>\n <div className='flex justify-end gap-2'>\n <Button variant='outlined' onClick={reject}>\n {rejectLabel}\n </Button>\n <Button onClick={accept}>{acceptLabel}</Button>\n </div>\n </Dialog.Footer>\n </Dialog.Popup>\n </Dialog.Positioner>\n </Dialog.Portal>\n </Dialog.Root>\n );\n}\n"],"names":["ConfirmDialog","visible","message","header","icon","acceptLabel","rejectLabel","onAccept","onReject","onHide","accept","reject","_jsx","Dialog","Root","open","modal","dismissable","closeOnEscape","onOpenChange","event","value","_jsxs","Portal","Backdrop","Positioner","Popup","style","width","Header","Title","Close","aria-label","i","className","Content","div","undefined","span","Footer","Button","variant","onClick"],"mappings":";;;;;;AAAA;AACA;AA8DA;;;;;;;;;;;;;;;;;;;;;IAsBO,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAAEC,OAAO,EAAEC,MAAM,EAAEC,IAAI,EAAEC,WAAW,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,MAAM,EAAsB,EAAA;AACtI,IAAA,MAAMC,MAAAA,GAAS,IAAA;AACXH,QAAAA,QAAAA,IAAAA;AACAE,QAAAA,MAAAA,IAAAA;AACJ,IAAA,CAAA;AAEA,IAAA,MAAME,MAAAA,GAAS,IAAA;AACXH,QAAAA,QAAAA,IAAAA;AACAC,QAAAA,MAAAA,IAAAA;AACJ,IAAA,CAAA;IAEA,qBACIG,cAAA,CAACC,cAAOC,IAAI,EAAA;QACRC,IAAAA,EAAMd,OAAAA;QACNe,KAAK,EAAA,IAAA;QACLC,WAAW,EAAA,IAAA;QACXC,aAAa,EAAA,IAAA;AACbC,QAAAA,YAAAA,EAAc,CAACC,KAAAA,GAAAA;YACX,IAAI,CAACA,KAAAA,CAAMC,KAAK,EAAEZ,MAAAA,IAAAA;AACtB,QAAA,CAAA;gCACAa,eAAA,CAACT,cAAOU,MAAM,EAAA;;AACV,8BAAAX,cAAA,CAACC,cAAOW,QAAQ,EAAA,EAAA,CAAA;AAChB,8BAAAZ,cAAA,CAACC,cAAOY,UAAU,EAAA;4CACdH,eAAA,CAACT,cAAOa,KAAK,EAAA;wBAACC,KAAAA,EAAO;4BAAEC,KAAAA,EAAO;AAAQ,yBAAA;;AAClC,0CAAAN,eAAA,CAACT,cAAOgB,MAAM,EAAA;;AACV,kDAAAjB,cAAA,CAACC,cAAOiB,KAAK,EAAA;AAAE3B,wCAAAA,QAAAA,EAAAA;;AACf,kDAAAS,cAAA,CAACC,cAAOkB,KAAK,EAAA;wCAACC,YAAAA,EAAW,OAAA;AACrB,wCAAA,QAAA,gBAAApB,cAAA,CAACqB,GAAAA,EAAAA;4CAAEC,SAAAA,EAAU;;;;;AAGrB,0CAAAtB,cAAA,CAACC,cAAOsB,OAAO,EAAA;AACX,gCAAA,QAAA,gBAAAb,eAAA,CAACc,KAAAA,EAAAA;oCAAIF,SAAAA,EAAU,yBAAA;;AACV9B,wCAAAA,IAAAA,KAASiC,2BAAazB,cAAA,CAACqB,GAAAA,EAAAA;4CAAEC,SAAAA,EAAW9B;;sDACrCQ,cAAA,CAAC0B,MAAAA,EAAAA;AAAMpC,4CAAAA,QAAAA,EAAAA;;;;;AAGf,0CAAAU,cAAA,CAACC,cAAO0B,MAAM,EAAA;AACV,gCAAA,QAAA,gBAAAjB,eAAA,CAACc,KAAAA,EAAAA;oCAAIF,SAAAA,EAAU,wBAAA;;sDACXtB,cAAA,CAAC4B,aAAAA,EAAAA;4CAAOC,OAAAA,EAAQ,UAAA;4CAAWC,OAAAA,EAAS/B,MAAAA;AAC/BL,4CAAAA,QAAAA,EAAAA;;sDAELM,cAAA,CAAC4B,aAAAA,EAAAA;4CAAOE,OAAAA,EAAShC,MAAAA;AAASL,4CAAAA,QAAAA,EAAAA;;;;;;;;;;;AAQ1D
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.js","sources":["../../../overlay/ConfirmDialog.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 { Button } from 'primereact/button';\nimport { Dialog } from 'primereact/dialog';\n\n/**\n * Configuration for {@link ConfirmDialog}.\n */\nexport interface ConfirmDialogProps {\n /**\n * Whether the dialog is showing. The dialog is a controlled overlay - it never hides itself - so the\n * owner keeps this in state and lowers it from {@link ConfirmDialogProps.onHide}.\n */\n visible: boolean;\n\n /**\n * The question being asked. Typed as a node rather than a string so a caller can pose a question that\n * needs emphasis or a name in it, which is exactly the kind of question worth confirming.\n */\n message?: ReactNode;\n\n /**\n * The dialog's title.\n */\n header?: string;\n\n /**\n * A PrimeIcons class shown beside the message. Omitted entirely when absent rather than defaulted,\n * because the icon on a confirmation carries tone - a warning triangle on a harmless question is\n * misleading - and only the caller knows which is right.\n */\n icon?: string;\n\n /**\n * Label for the accepting button.\n */\n acceptLabel?: string;\n\n /**\n * Label for the rejecting button.\n */\n rejectLabel?: string;\n\n /**\n * Called when the user accepts. Always followed by {@link ConfirmDialogProps.onHide}.\n */\n onAccept?: () => void;\n\n /**\n * Called when the user rejects. Always followed by {@link ConfirmDialogProps.onHide}.\n */\n onReject?: () => void;\n\n /**\n * Called whenever the dialog should close - after either answer, and on every dismissal gesture\n * (the close button, `Escape`, a click on the backdrop). Answering and closing are reported\n * separately so a caller can lower `visible` in one place instead of in three.\n */\n onHide?: () => void;\n}\n\n/**\n * A Cratis-owned confirmation dialog - a question, an accepting answer and a rejecting one.\n *\n * This component is owned by Cratis because PrimeReact 11 removed `primereact/confirmdialog` outright.\n * There is no renamed successor to adapt to: what v11 ships instead is the compositional `Dialog` this is\n * built from, on the reasoning that a confirmation is a dialog with a known footer rather than a distinct\n * component. That is a fair reading, but it would otherwise push the same header/message/two-buttons\n * assembly into every caller, so this package assembles it once here and keeps the shape v10 callers\n * already expect.\n *\n * Two v10 capabilities are deliberately **not** carried over:\n *\n * - **The imperative `confirmDialog()` service API.** v10 let any code open a confirmation by calling a\n * module-level function that reached a singleton mounted elsewhere. That needs a caller and a global\n * mount point; this component is rendered and controlled by whoever owns the answer, which is the only\n * form a Scene element - configuration, not a caller - can use anyway.\n * - **`appendTo`.** v10 needed it to escape stacking contexts. v11 renders through `Dialog.Portal` under\n * an overlay manager that handles layering, so the prop existed only to work around a problem that is\n * now gone.\n *\n * @param props - {@link ConfirmDialogProps}.\n */\nexport function ConfirmDialog({ visible, message, header, icon, acceptLabel, rejectLabel, onAccept, onReject, onHide }: ConfirmDialogProps) {\n const accept = () => {\n onAccept?.();\n onHide?.();\n };\n\n const reject = () => {\n onReject?.();\n onHide?.();\n };\n\n return (\n <Dialog.Root\n open={visible}\n modal\n dismissable\n closeOnEscape\n onOpenChange={(event) => {\n if (!event.value) onHide?.();\n }}>\n <Dialog.Portal>\n <Dialog.Backdrop />\n <Dialog.Positioner>\n <Dialog.Popup style={{ width: '30rem' }}>\n <Dialog.Header>\n <Dialog.Title>{header}</Dialog.Title>\n <Dialog.Close aria-label='Close'>\n <i className='pi pi-times' />\n </Dialog.Close>\n </Dialog.Header>\n <Dialog.Content>\n <div className='flex items-center gap-3'>\n {icon !== undefined && <i className={icon} />}\n <span>{message}</span>\n </div>\n </Dialog.Content>\n <Dialog.Footer>\n <div className='flex justify-end gap-2'>\n <Button variant='outlined' onClick={reject}>\n {rejectLabel}\n </Button>\n <Button onClick={accept}>{acceptLabel}</Button>\n </div>\n </Dialog.Footer>\n </Dialog.Popup>\n </Dialog.Positioner>\n </Dialog.Portal>\n </Dialog.Root>\n );\n}\n"],"names":["ConfirmDialog","visible","message","header","icon","acceptLabel","rejectLabel","onAccept","onReject","onHide","accept","reject","_jsx","Dialog","Root","open","modal","dismissable","closeOnEscape","onOpenChange","event","value","_jsxs","Portal","Backdrop","Positioner","Popup","style","width","Header","Title","Close","aria-label","i","className","Content","div","undefined","span","Footer","Button","variant","onClick"],"mappings":";;;;;;AAAA;AACA;AA8DA;;;;;;;;;;;;;;;;;;;;;IAsBO,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAAEC,OAAO,EAAEC,MAAM,EAAEC,IAAI,EAAEC,WAAW,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,MAAM,EAAsB,EAAA;AACtI,IAAA,MAAMC,MAAAA,GAAS,IAAA;AACXH,QAAAA,QAAAA,IAAAA;AACAE,QAAAA,MAAAA,IAAAA;AACJ,IAAA,CAAA;AAEA,IAAA,MAAME,MAAAA,GAAS,IAAA;AACXH,QAAAA,QAAAA,IAAAA;AACAC,QAAAA,MAAAA,IAAAA;AACJ,IAAA,CAAA;IAEA,qBACIG,cAAA,CAACC,cAAOC,IAAI,EAAA;QACRC,IAAAA,EAAMd,OAAAA;QACNe,KAAK,EAAA,IAAA;QACLC,WAAW,EAAA,IAAA;QACXC,aAAa,EAAA,IAAA;AACbC,QAAAA,YAAAA,EAAc,CAACC,KAAAA,GAAAA;YACX,IAAI,CAACA,KAAAA,CAAMC,KAAK,EAAEZ,MAAAA,IAAAA;AACtB,QAAA,CAAA;gCACAa,eAAA,CAACT,cAAOU,MAAM,EAAA;;AACV,8BAAAX,cAAA,CAACC,cAAOW,QAAQ,EAAA,EAAA,CAAA;AAChB,8BAAAZ,cAAA,CAACC,cAAOY,UAAU,EAAA;4CACdH,eAAA,CAACT,cAAOa,KAAK,EAAA;wBAACC,KAAAA,EAAO;4BAAEC,KAAAA,EAAO;AAAQ,yBAAA;;AAClC,0CAAAN,eAAA,CAACT,cAAOgB,MAAM,EAAA;;AACV,kDAAAjB,cAAA,CAACC,cAAOiB,KAAK,EAAA;AAAE3B,wCAAAA,QAAAA,EAAAA;;AACf,kDAAAS,cAAA,CAACC,cAAOkB,KAAK,EAAA;wCAACC,YAAAA,EAAW,OAAA;AACrB,wCAAA,QAAA,gBAAApB,cAAA,CAACqB,GAAAA,EAAAA;4CAAEC,SAAAA,EAAU;;;;;AAGrB,0CAAAtB,cAAA,CAACC,cAAOsB,OAAO,EAAA;AACX,gCAAA,QAAA,gBAAAb,eAAA,CAACc,KAAAA,EAAAA;oCAAIF,SAAAA,EAAU,yBAAA;;AACV9B,wCAAAA,IAAAA,KAASiC,2BAAazB,cAAA,CAACqB,GAAAA,EAAAA;4CAAEC,SAAAA,EAAW9B;;sDACrCQ,cAAA,CAAC0B,MAAAA,EAAAA;AAAMpC,4CAAAA,QAAAA,EAAAA;;;;;AAGf,0CAAAU,cAAA,CAACC,cAAO0B,MAAM,EAAA;AACV,gCAAA,QAAA,gBAAAjB,eAAA,CAACc,KAAAA,EAAAA;oCAAIF,SAAAA,EAAU,wBAAA;;sDACXtB,cAAA,CAAC4B,aAAAA,EAAAA;4CAAOC,OAAAA,EAAQ,UAAA;4CAAWC,OAAAA,EAAS/B,MAAAA;AAC/BL,4CAAAA,QAAAA,EAAAA;;sDAELM,cAAA,CAAC4B,aAAAA,EAAAA;4CAAOE,OAAAA,EAAShC,MAAAA;AAASL,4CAAAA,QAAAA,EAAAA;;;;;;;;;;;AAQ1D;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeConfirmDialog.js","sources":["../../../overlay/PrimeConfirmDialog.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState } from 'react';\nimport { Button } from 'primereact/button';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { stringProperty } from '../properties';\nimport { ConfirmDialog } from './ConfirmDialog';\n\n/**\n * The `PrimeReact:confirmDialog` component - a yes/no question before a consequential action.\n *\n * Adapts {@link ConfirmDialog}, which this package owns because PrimeReact 11 removed\n * `primereact/confirmdialog` and shipped no successor - see that component for what the replacement\n * deliberately leaves behind. The adapter itself is unchanged in spirit from the v10 one: it was already\n * using the declarative form rather than the imperative `confirmDialog()` call, because that call needs a\n * caller and a Scene element is configuration, not a caller. That choice is what made this the one\n * removal in the family that cost nothing at the adapter boundary.\n *\n * Visibility is owned locally for the reason described on {@link PrimeDialog}.\n *\n * A Scene element has nowhere to send an answer - there is no handler to bind to - so accepting and\n * rejecting differ only in closing the dialog. The two callbacks are still wired rather than omitted, so\n * the seam is here the moment Scene grows a way to express an action.\n */\nexport function PrimeConfirmDialog({ element }: RegisteredComponentProps) {\n const [visible, setVisible] = useState(false);\n return (\n <div data-scene-id={element.id}>\n <Button severity={stringProperty(element, 'severity', 'danger')} onClick={() => setVisible(true)}>\n {stringProperty(element, 'triggerLabel', 'Confirm')}\n </Button>\n <ConfirmDialog\n visible={visible}\n onHide={() => setVisible(false)}\n header={stringProperty(element, 'header', 'Are you sure?')}\n message={stringProperty(element, 'message', 'This action cannot be undone.')}\n icon={stringProperty(element, 'icon', 'pi pi-exclamation-triangle')}\n acceptLabel={stringProperty(element, 'acceptLabel', 'Yes')}\n rejectLabel={stringProperty(element, 'rejectLabel', 'No')}\n />\n </div>\n );\n}\n"],"names":["PrimeConfirmDialog","element","visible","setVisible","useState","_jsxs","div","data-scene-id","id","_jsx","Button","severity","stringProperty","onClick","ConfirmDialog","onHide","header","message","icon","acceptLabel","rejectLabel"],"mappings":";;;;;;;;AASA;;;;;;;;;;;;;;;AAeC,IACM,SAASA,kBAAAA,CAAmB,EAAEC,OAAO,EAA4B,EAAA;AACpE,IAAA,MAAM,CAACC,OAAAA,EAASC,UAAAA,CAAW,GAAGC,cAAAA,CAAS,KAAA,CAAA;AACvC,IAAA,qBACIC,eAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeN,QAAQO,EAAE;;0BAC1BC,cAAA,CAACC,aAAAA,EAAAA;gBAAOC,QAAAA,EAAUC,yBAAAA,CAAeX,SAAS,UAAA,EAAY,QAAA,CAAA;AAAWY,gBAAAA,OAAAA,EAAS,IAAMV,UAAAA,CAAW,IAAA,CAAA;AACtFS,gBAAAA,QAAAA,EAAAA,yBAAAA,CAAeX,SAAS,cAAA,EAAgB,SAAA;;0BAE7CQ,cAAA,CAACK,2BAAAA,EAAAA;gBACGZ,OAAAA,EAASA,OAAAA;AACTa,gBAAAA,MAAAA,EAAQ,IAAMZ,UAAAA,CAAW,KAAA,CAAA;gBACzBa,MAAAA,EAAQJ,yBAAAA,CAAeX,SAAS,QAAA,EAAU,eAAA,CAAA;gBAC1CgB,OAAAA,EAASL,yBAAAA,CAAeX,SAAS,SAAA,EAAW,+BAAA,CAAA;gBAC5CiB,IAAAA,EAAMN,yBAAAA,CAAeX,SAAS,MAAA,EAAQ,4BAAA,CAAA;gBACtCkB,WAAAA,EAAaP,yBAAAA,CAAeX,SAAS,aAAA,EAAe,KAAA,CAAA;gBACpDmB,WAAAA,EAAaR,yBAAAA,CAAeX,SAAS,aAAA,EAAe,IAAA;;;;AAIpE
|
|
1
|
+
{"version":3,"file":"PrimeConfirmDialog.js","sources":["../../../overlay/PrimeConfirmDialog.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState } from 'react';\nimport { Button } from 'primereact/button';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { stringProperty } from '../properties';\nimport { ConfirmDialog } from './ConfirmDialog';\n\n/**\n * The `PrimeReact:confirmDialog` component - a yes/no question before a consequential action.\n *\n * Adapts {@link ConfirmDialog}, which this package owns because PrimeReact 11 removed\n * `primereact/confirmdialog` and shipped no successor - see that component for what the replacement\n * deliberately leaves behind. The adapter itself is unchanged in spirit from the v10 one: it was already\n * using the declarative form rather than the imperative `confirmDialog()` call, because that call needs a\n * caller and a Scene element is configuration, not a caller. That choice is what made this the one\n * removal in the family that cost nothing at the adapter boundary.\n *\n * Visibility is owned locally for the reason described on {@link PrimeDialog}.\n *\n * A Scene element has nowhere to send an answer - there is no handler to bind to - so accepting and\n * rejecting differ only in closing the dialog. The two callbacks are still wired rather than omitted, so\n * the seam is here the moment Scene grows a way to express an action.\n */\nexport function PrimeConfirmDialog({ element }: RegisteredComponentProps) {\n const [visible, setVisible] = useState(false);\n return (\n <div data-scene-id={element.id}>\n <Button severity={stringProperty(element, 'severity', 'danger')} onClick={() => setVisible(true)}>\n {stringProperty(element, 'triggerLabel', 'Confirm')}\n </Button>\n <ConfirmDialog\n visible={visible}\n onHide={() => setVisible(false)}\n header={stringProperty(element, 'header', 'Are you sure?')}\n message={stringProperty(element, 'message', 'This action cannot be undone.')}\n icon={stringProperty(element, 'icon', 'pi pi-exclamation-triangle')}\n acceptLabel={stringProperty(element, 'acceptLabel', 'Yes')}\n rejectLabel={stringProperty(element, 'rejectLabel', 'No')}\n />\n </div>\n );\n}\n"],"names":["PrimeConfirmDialog","element","visible","setVisible","useState","_jsxs","div","data-scene-id","id","_jsx","Button","severity","stringProperty","onClick","ConfirmDialog","onHide","header","message","icon","acceptLabel","rejectLabel"],"mappings":";;;;;;;;AASA;;;;;;;;;;;;;;;AAeC,IACM,SAASA,kBAAAA,CAAmB,EAAEC,OAAO,EAA4B,EAAA;AACpE,IAAA,MAAM,CAACC,OAAAA,EAASC,UAAAA,CAAW,GAAGC,cAAAA,CAAS,KAAA,CAAA;AACvC,IAAA,qBACIC,eAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeN,QAAQO,EAAE;;0BAC1BC,cAAA,CAACC,aAAAA,EAAAA;gBAAOC,QAAAA,EAAUC,yBAAAA,CAAeX,SAAS,UAAA,EAAY,QAAA,CAAA;AAAWY,gBAAAA,OAAAA,EAAS,IAAMV,UAAAA,CAAW,IAAA,CAAA;AACtFS,gBAAAA,QAAAA,EAAAA,yBAAAA,CAAeX,SAAS,cAAA,EAAgB,SAAA;;0BAE7CQ,cAAA,CAACK,2BAAAA,EAAAA;gBACGZ,OAAAA,EAASA,OAAAA;AACTa,gBAAAA,MAAAA,EAAQ,IAAMZ,UAAAA,CAAW,KAAA,CAAA;gBACzBa,MAAAA,EAAQJ,yBAAAA,CAAeX,SAAS,QAAA,EAAU,eAAA,CAAA;gBAC1CgB,OAAAA,EAASL,yBAAAA,CAAeX,SAAS,SAAA,EAAW,+BAAA,CAAA;gBAC5CiB,IAAAA,EAAMN,yBAAAA,CAAeX,SAAS,MAAA,EAAQ,4BAAA,CAAA;gBACtCkB,WAAAA,EAAaP,yBAAAA,CAAeX,SAAS,aAAA,EAAe,KAAA,CAAA;gBACpDmB,WAAAA,EAAaR,yBAAAA,CAAeX,SAAS,aAAA,EAAe,IAAA;;;;AAIpE;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeDialog.js","sources":["../../../overlay/PrimeDialog.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState } from 'react';\nimport { Button } from 'primereact/button';\nimport { Dialog } from 'primereact/dialog';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:dialog` component - a modal window.\n *\n * A dialog is only ever interesting while it is open, and \"the user closed it\" is state a Scene element\n * has no place to record. The adapter therefore owns visibility locally, seeded from the `visible`\n * property, and always renders a trigger button beside it. That keeps a dialog reachable again after it\n * is dismissed - without the trigger, closing a previewed dialog would leave a permanently blank spot on\n * the screen with no way back.\n *\n * PrimeReact 11 made `Dialog` compositional, which turns that local visibility into a two-way\n * arrangement: `open` pushes the state down, and every dismissal gesture - the close button, `Escape`, a\n * click on the backdrop - comes back as `onOpenChange`. Both have to be wired, because a v11 dialog never\n * hides itself; ignoring the callback would leave a dialog that opens once and can never be closed.\n *\n * The parts are assembled here rather than by the component: `Dialog.Portal` and `Dialog.Backdrop` are\n * what make it modal, and `Dialog.Close` is the only reason the header gets an X.\n *\n * **Not available in v11:** the headless dialog has no resize handle, so a dialog cannot be made\n * user-resizable. No Scene property is lost to this - this adapter never exposed one - but `draggable`,\n * which v11 does still support, is the only direct-manipulation affordance left.\n */\nexport function PrimeDialog({ element, slots }: RegisteredComponentProps) {\n const [visible, setVisible] = useState(booleanProperty(element, 'visible', false));\n const header = stringProperty(element, 'header', 'Dialog');\n return (\n <div data-scene-id={element.id}>\n <Button onClick={() => setVisible(true)}>{stringProperty(element, 'triggerLabel', header)}</Button>\n <Dialog.Root\n open={visible}\n modal={booleanProperty(element, 'modal', true)}\n draggable={booleanProperty(element, 'draggable', false)}\n dismissable\n closeOnEscape\n onOpenChange={(event) => {\n if (!event.value) setVisible(false);\n }}>\n <Dialog.Portal>\n <Dialog.Backdrop />\n <Dialog.Positioner>\n <Dialog.Popup style={{ width: stringProperty(element, 'width', '32rem') }}>\n <Dialog.Header>\n <Dialog.Title>{header}</Dialog.Title>\n <Dialog.Close aria-label='Close'>\n <i className='pi pi-times' />\n </Dialog.Close>\n </Dialog.Header>\n <Dialog.Content>{slots.content}</Dialog.Content>\n </Dialog.Popup>\n </Dialog.Positioner>\n </Dialog.Portal>\n </Dialog.Root>\n </div>\n );\n}\n"],"names":["PrimeDialog","element","slots","visible","setVisible","useState","booleanProperty","header","stringProperty","_jsxs","div","data-scene-id","id","_jsx","Button","onClick","Dialog","Root","open","modal","draggable","dismissable","closeOnEscape","onOpenChange","event","value","Portal","Backdrop","Positioner","Popup","style","width","Header","Title","Close","aria-label","i","className","Content","content"],"mappings":";;;;;;;;AASA;;;;;;;;;;;;;;;;;;;;AAoBC,IACM,SAASA,WAAAA,CAAY,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACpE,IAAA,MAAM,CAACC,OAAAA,EAASC,UAAAA,CAAW,GAAGC,cAAAA,CAASC,0BAAAA,CAAgBL,SAAS,SAAA,EAAW,KAAA,CAAA,CAAA;IAC3E,MAAMM,MAAAA,GAASC,yBAAAA,CAAeP,OAAAA,EAAS,QAAA,EAAU,QAAA,CAAA;AACjD,IAAA,qBACIQ,eAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeV,QAAQW,EAAE;;0BAC1BC,cAAA,CAACC,aAAAA,EAAAA;AAAOC,gBAAAA,OAAAA,EAAS,IAAMX,UAAAA,CAAW,IAAA,CAAA;AAAQI,gBAAAA,QAAAA,EAAAA,yBAAAA,CAAeP,SAAS,cAAA,EAAgBM,MAAAA;;AAClF,0BAAAM,cAAA,CAACG,cAAOC,IAAI,EAAA;gBACRC,IAAAA,EAAMf,OAAAA;gBACNgB,KAAAA,EAAOb,0BAAAA,CAAgBL,SAAS,OAAA,EAAS,IAAA,CAAA;gBACzCmB,SAAAA,EAAWd,0BAAAA,CAAgBL,SAAS,WAAA,EAAa,KAAA,CAAA;gBACjDoB,WAAW,EAAA,IAAA;gBACXC,aAAa,EAAA,IAAA;AACbC,gBAAAA,YAAAA,EAAc,CAACC,KAAAA,GAAAA;AACX,oBAAA,IAAI,CAACA,KAAAA,CAAMC,KAAK,EAAErB,UAAAA,CAAW,KAAA,CAAA;AACjC,gBAAA,CAAA;wCACAK,eAAA,CAACO,cAAOU,MAAM,EAAA;;AACV,sCAAAb,cAAA,CAACG,cAAOW,QAAQ,EAAA,EAAA,CAAA;AAChB,sCAAAd,cAAA,CAACG,cAAOY,UAAU,EAAA;oDACdnB,eAAA,CAACO,cAAOa,KAAK,EAAA;gCAACC,KAAAA,EAAO;oCAAEC,KAAAA,EAAOvB,yBAAAA,CAAeP,SAAS,OAAA,EAAS,OAAA;AAAS,iCAAA;;AACpE,kDAAAQ,eAAA,CAACO,cAAOgB,MAAM,EAAA;;AACV,0DAAAnB,cAAA,CAACG,cAAOiB,KAAK,EAAA;AAAE1B,gDAAAA,QAAAA,EAAAA;;AACf,0DAAAM,cAAA,CAACG,cAAOkB,KAAK,EAAA;gDAACC,YAAAA,EAAW,OAAA;AACrB,gDAAA,QAAA,gBAAAtB,cAAA,CAACuB,GAAAA,EAAAA;oDAAEC,SAAAA,EAAU;;;;;AAGrB,kDAAAxB,cAAA,CAACG,cAAOsB,OAAO,EAAA;AAAEpC,wCAAAA,QAAAA,EAAAA,KAAAA,CAAMqC;;;;;;;;;;AAOnD
|
|
1
|
+
{"version":3,"file":"PrimeDialog.js","sources":["../../../overlay/PrimeDialog.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState } from 'react';\nimport { Button } from 'primereact/button';\nimport { Dialog } from 'primereact/dialog';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:dialog` component - a modal window.\n *\n * A dialog is only ever interesting while it is open, and \"the user closed it\" is state a Scene element\n * has no place to record. The adapter therefore owns visibility locally, seeded from the `visible`\n * property, and always renders a trigger button beside it. That keeps a dialog reachable again after it\n * is dismissed - without the trigger, closing a previewed dialog would leave a permanently blank spot on\n * the screen with no way back.\n *\n * PrimeReact 11 made `Dialog` compositional, which turns that local visibility into a two-way\n * arrangement: `open` pushes the state down, and every dismissal gesture - the close button, `Escape`, a\n * click on the backdrop - comes back as `onOpenChange`. Both have to be wired, because a v11 dialog never\n * hides itself; ignoring the callback would leave a dialog that opens once and can never be closed.\n *\n * The parts are assembled here rather than by the component: `Dialog.Portal` and `Dialog.Backdrop` are\n * what make it modal, and `Dialog.Close` is the only reason the header gets an X.\n *\n * **Not available in v11:** the headless dialog has no resize handle, so a dialog cannot be made\n * user-resizable. No Scene property is lost to this - this adapter never exposed one - but `draggable`,\n * which v11 does still support, is the only direct-manipulation affordance left.\n */\nexport function PrimeDialog({ element, slots }: RegisteredComponentProps) {\n const [visible, setVisible] = useState(booleanProperty(element, 'visible', false));\n const header = stringProperty(element, 'header', 'Dialog');\n return (\n <div data-scene-id={element.id}>\n <Button onClick={() => setVisible(true)}>{stringProperty(element, 'triggerLabel', header)}</Button>\n <Dialog.Root\n open={visible}\n modal={booleanProperty(element, 'modal', true)}\n draggable={booleanProperty(element, 'draggable', false)}\n dismissable\n closeOnEscape\n onOpenChange={(event) => {\n if (!event.value) setVisible(false);\n }}>\n <Dialog.Portal>\n <Dialog.Backdrop />\n <Dialog.Positioner>\n <Dialog.Popup style={{ width: stringProperty(element, 'width', '32rem') }}>\n <Dialog.Header>\n <Dialog.Title>{header}</Dialog.Title>\n <Dialog.Close aria-label='Close'>\n <i className='pi pi-times' />\n </Dialog.Close>\n </Dialog.Header>\n <Dialog.Content>{slots.content}</Dialog.Content>\n </Dialog.Popup>\n </Dialog.Positioner>\n </Dialog.Portal>\n </Dialog.Root>\n </div>\n );\n}\n"],"names":["PrimeDialog","element","slots","visible","setVisible","useState","booleanProperty","header","stringProperty","_jsxs","div","data-scene-id","id","_jsx","Button","onClick","Dialog","Root","open","modal","draggable","dismissable","closeOnEscape","onOpenChange","event","value","Portal","Backdrop","Positioner","Popup","style","width","Header","Title","Close","aria-label","i","className","Content","content"],"mappings":";;;;;;;;AASA;;;;;;;;;;;;;;;;;;;;AAoBC,IACM,SAASA,WAAAA,CAAY,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACpE,IAAA,MAAM,CAACC,OAAAA,EAASC,UAAAA,CAAW,GAAGC,cAAAA,CAASC,0BAAAA,CAAgBL,SAAS,SAAA,EAAW,KAAA,CAAA,CAAA;IAC3E,MAAMM,MAAAA,GAASC,yBAAAA,CAAeP,OAAAA,EAAS,QAAA,EAAU,QAAA,CAAA;AACjD,IAAA,qBACIQ,eAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeV,QAAQW,EAAE;;0BAC1BC,cAAA,CAACC,aAAAA,EAAAA;AAAOC,gBAAAA,OAAAA,EAAS,IAAMX,UAAAA,CAAW,IAAA,CAAA;AAAQI,gBAAAA,QAAAA,EAAAA,yBAAAA,CAAeP,SAAS,cAAA,EAAgBM,MAAAA;;AAClF,0BAAAM,cAAA,CAACG,cAAOC,IAAI,EAAA;gBACRC,IAAAA,EAAMf,OAAAA;gBACNgB,KAAAA,EAAOb,0BAAAA,CAAgBL,SAAS,OAAA,EAAS,IAAA,CAAA;gBACzCmB,SAAAA,EAAWd,0BAAAA,CAAgBL,SAAS,WAAA,EAAa,KAAA,CAAA;gBACjDoB,WAAW,EAAA,IAAA;gBACXC,aAAa,EAAA,IAAA;AACbC,gBAAAA,YAAAA,EAAc,CAACC,KAAAA,GAAAA;AACX,oBAAA,IAAI,CAACA,KAAAA,CAAMC,KAAK,EAAErB,UAAAA,CAAW,KAAA,CAAA;AACjC,gBAAA,CAAA;wCACAK,eAAA,CAACO,cAAOU,MAAM,EAAA;;AACV,sCAAAb,cAAA,CAACG,cAAOW,QAAQ,EAAA,EAAA,CAAA;AAChB,sCAAAd,cAAA,CAACG,cAAOY,UAAU,EAAA;oDACdnB,eAAA,CAACO,cAAOa,KAAK,EAAA;gCAACC,KAAAA,EAAO;oCAAEC,KAAAA,EAAOvB,yBAAAA,CAAeP,SAAS,OAAA,EAAS,OAAA;AAAS,iCAAA;;AACpE,kDAAAQ,eAAA,CAACO,cAAOgB,MAAM,EAAA;;AACV,0DAAAnB,cAAA,CAACG,cAAOiB,KAAK,EAAA;AAAE1B,gDAAAA,QAAAA,EAAAA;;AACf,0DAAAM,cAAA,CAACG,cAAOkB,KAAK,EAAA;gDAACC,YAAAA,EAAW,OAAA;AACrB,gDAAA,QAAA,gBAAAtB,cAAA,CAACuB,GAAAA,EAAAA;oDAAEC,SAAAA,EAAU;;;;;AAGrB,kDAAAxB,cAAA,CAACG,cAAOsB,OAAO,EAAA;AAAEpC,wCAAAA,QAAAA,EAAAA,KAAAA,CAAMqC;;;;;;;;;;AAOnD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeOverlayPanel.js","sources":["../../../overlay/PrimeOverlayPanel.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Button } from 'primereact/button';\nimport { Popover } from 'primereact/popover';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:overlayPanel` component - content revealed next to whatever opened it.\n *\n * A popover positions itself against the thing that opened it, so it is meaningless without a trigger;\n * the adapter renders one.\n *\n * PrimeReact 11 renamed `OverlayPanel` to `Popover` and changed how that trigger is wired. v10 needed a\n * ref and a `toggle(event)` call because it positioned against the *event*; v11 positions against the\n * trigger *element*, which `Popover.Trigger` registers itself. That removes the ref, the click handler\n * and the local visibility state in one go - the composition owns all three - so the trigger here is a\n * real `Button` supplied as `Popover.Trigger`'s `as`, rather than a separate button wired to a ref.\n *\n * The abstract Scene name stays `overlayPanel` so existing screens keep resolving.\n */\nexport function PrimeOverlayPanel({ element, slots }: RegisteredComponentProps) {\n return (\n <div data-scene-id={element.id}>\n <Popover.Root>\n <Popover.Trigger as={Button}>{stringProperty(element, 'triggerLabel', 'Show')}</Popover.Trigger>\n <Popover.Portal>\n <Popover.Positioner side='bottom'>\n <Popover.Popup>\n <Popover.Content>{slots.content}</Popover.Content>\n </Popover.Popup>\n </Popover.Positioner>\n </Popover.Portal>\n </Popover.Root>\n </div>\n );\n}\n"],"names":["PrimeOverlayPanel","element","slots","_jsx","div","data-scene-id","id","_jsxs","Popover","Root","Trigger","as","Button","stringProperty","Portal","Positioner","side","Popup","Content","content"],"mappings":";;;;;;;AAQA;;;;;;;;;;;;;AAaC,IACM,SAASA,iBAAAA,CAAkB,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AAC1E,IAAA,qBACIC,cAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;gCAC1BC,eAAA,CAACC,gBAAQC,IAAI,EAAA;;AACT,8BAAAN,cAAA,CAACK,gBAAQE,OAAO,EAAA;oBAACC,EAAAA,EAAIC,aAAAA;AAASC,oBAAAA,QAAAA,EAAAA,yBAAAA,CAAeZ,SAAS,cAAA,EAAgB,MAAA;;AACtE,8BAAAE,cAAA,CAACK,gBAAQM,MAAM,EAAA;4CACXX,cAAA,CAACK,gBAAQO,UAAU,EAAA;wBAACC,IAAAA,EAAK,QAAA;gDACrBb,cAAA,CAACK,gBAAQS,KAAK,EAAA;oDACVd,cAAA,CAACK,gBAAQU,OAAO,EAAA;AAAEhB,gCAAAA,QAAAA,EAAAA,KAAAA,CAAMiB;;;;;;;;AAOpD
|
|
1
|
+
{"version":3,"file":"PrimeOverlayPanel.js","sources":["../../../overlay/PrimeOverlayPanel.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Button } from 'primereact/button';\nimport { Popover } from 'primereact/popover';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:overlayPanel` component - content revealed next to whatever opened it.\n *\n * A popover positions itself against the thing that opened it, so it is meaningless without a trigger;\n * the adapter renders one.\n *\n * PrimeReact 11 renamed `OverlayPanel` to `Popover` and changed how that trigger is wired. v10 needed a\n * ref and a `toggle(event)` call because it positioned against the *event*; v11 positions against the\n * trigger *element*, which `Popover.Trigger` registers itself. That removes the ref, the click handler\n * and the local visibility state in one go - the composition owns all three - so the trigger here is a\n * real `Button` supplied as `Popover.Trigger`'s `as`, rather than a separate button wired to a ref.\n *\n * The abstract Scene name stays `overlayPanel` so existing screens keep resolving.\n */\nexport function PrimeOverlayPanel({ element, slots }: RegisteredComponentProps) {\n return (\n <div data-scene-id={element.id}>\n <Popover.Root>\n <Popover.Trigger as={Button}>{stringProperty(element, 'triggerLabel', 'Show')}</Popover.Trigger>\n <Popover.Portal>\n <Popover.Positioner side='bottom'>\n <Popover.Popup>\n <Popover.Content>{slots.content}</Popover.Content>\n </Popover.Popup>\n </Popover.Positioner>\n </Popover.Portal>\n </Popover.Root>\n </div>\n );\n}\n"],"names":["PrimeOverlayPanel","element","slots","_jsx","div","data-scene-id","id","_jsxs","Popover","Root","Trigger","as","Button","stringProperty","Portal","Positioner","side","Popup","Content","content"],"mappings":";;;;;;;AAQA;;;;;;;;;;;;;AAaC,IACM,SAASA,iBAAAA,CAAkB,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AAC1E,IAAA,qBACIC,cAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;gCAC1BC,eAAA,CAACC,gBAAQC,IAAI,EAAA;;AACT,8BAAAN,cAAA,CAACK,gBAAQE,OAAO,EAAA;oBAACC,EAAAA,EAAIC,aAAAA;AAASC,oBAAAA,QAAAA,EAAAA,yBAAAA,CAAeZ,SAAS,cAAA,EAAgB,MAAA;;AACtE,8BAAAE,cAAA,CAACK,gBAAQM,MAAM,EAAA;4CACXX,cAAA,CAACK,gBAAQO,UAAU,EAAA;wBAACC,IAAAA,EAAK,QAAA;gDACrBb,cAAA,CAACK,gBAAQS,KAAK,EAAA;oDACVd,cAAA,CAACK,gBAAQU,OAAO,EAAA;AAAEhB,gCAAAA,QAAAA,EAAAA,KAAAA,CAAMiB;;;;;;;;AAOpD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeSidebar.js","sources":["../../../overlay/PrimeSidebar.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState } from 'react';\nimport { Button } from 'primereact/button';\nimport { Drawer } from 'primereact/drawer';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:sidebar` component - a panel that slides in from an edge of the viewport.\n *\n * **This is built on `primereact/drawer`, and that is not a mistake.** PrimeReact 11 renamed this\n * component to `Drawer` *and* introduced an unrelated new component under the name `Sidebar` -\n * `primereact/sidebar` in v11 is an application-shell primitive (`SidebarLayout`, `SidebarAside`,\n * `SidebarPanel`, `SidebarMenu` and friends) for persistent navigation, with no slide-in overlay\n * behavior anywhere in it. Importing `Sidebar` from v11 to port a v10 `Sidebar` compiles perfectly and\n * silently replaces a dismissable overlay with a static shell element, which is why the module here is\n * the one that does not match the name. The abstract Scene name stays `sidebar` so existing screens keep\n * resolving; only the implementation moved.\n *\n * Visibility is owned locally and a trigger is always rendered, for the reason described on\n * {@link PrimeDialog}, and v11's controlled `open` / `onOpenChange` pair is wired for the reason\n * described there too.\n *\n * v10's `fullScreen` flag became a fifth `position` value rather than a separate prop, so the two Scene\n * properties collapse into one: `fullScreen` wins when set, since a drawer covering the viewport has no\n * edge left to slide in from.\n */\nexport function PrimeSidebar({ element, slots }: RegisteredComponentProps) {\n const [visible, setVisible] = useState(booleanProperty(element, 'visible', false));\n const position = booleanProperty(element, 'fullScreen', false) ? 'full' : stringProperty(element, 'position', 'left');\n return (\n <div data-scene-id={element.id}>\n <Button onClick={() => setVisible(true)}>{stringProperty(element, 'triggerLabel', 'Open')}</Button>\n <Drawer.Root\n open={visible}\n position={position as 'left' | 'right' | 'top' | 'bottom' | 'full'}\n onOpenChange={(event) => {\n if (!event.value) setVisible(false);\n }}>\n <Drawer.Portal>\n <Drawer.Backdrop />\n <Drawer.Popup>\n <Drawer.Header>\n <Drawer.Title>{stringProperty(element, 'header')}</Drawer.Title>\n <Drawer.Close aria-label='Close'>\n <i className='pi pi-times' />\n </Drawer.Close>\n </Drawer.Header>\n <Drawer.Content>{slots.content}</Drawer.Content>\n </Drawer.Popup>\n </Drawer.Portal>\n </Drawer.Root>\n </div>\n );\n}\n"],"names":["PrimeSidebar","element","slots","visible","setVisible","useState","booleanProperty","position","stringProperty","_jsxs","div","data-scene-id","id","_jsx","Button","onClick","Drawer","Root","open","onOpenChange","event","value","Portal","Backdrop","Popup","Header","Title","Close","aria-label","i","className","Content","content"],"mappings":";;;;;;;;AASA;;;;;;;;;;;;;;;;;;;AAmBC,IACM,SAASA,YAAAA,CAAa,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACrE,IAAA,MAAM,CAACC,OAAAA,EAASC,UAAAA,CAAW,GAAGC,cAAAA,CAASC,0BAAAA,CAAgBL,SAAS,SAAA,EAAW,KAAA,CAAA,CAAA;IAC3E,MAAMM,QAAAA,GAAWD,2BAAgBL,OAAAA,EAAS,YAAA,EAAc,SAAS,MAAA,GAASO,yBAAAA,CAAeP,SAAS,UAAA,EAAY,MAAA,CAAA;AAC9G,IAAA,qBACIQ,eAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeV,QAAQW,EAAE;;0BAC1BC,cAAA,CAACC,aAAAA,EAAAA;AAAOC,gBAAAA,OAAAA,EAAS,IAAMX,UAAAA,CAAW,IAAA,CAAA;AAAQI,gBAAAA,QAAAA,EAAAA,yBAAAA,CAAeP,SAAS,cAAA,EAAgB,MAAA;;AAClF,0BAAAY,cAAA,CAACG,cAAOC,IAAI,EAAA;gBACRC,IAAAA,EAAMf,OAAAA;gBACNI,QAAAA,EAAUA,QAAAA;AACVY,gBAAAA,YAAAA,EAAc,CAACC,KAAAA,GAAAA;AACX,oBAAA,IAAI,CAACA,KAAAA,CAAMC,KAAK,EAAEjB,UAAAA,CAAW,KAAA,CAAA;AACjC,gBAAA,CAAA;wCACAK,eAAA,CAACO,cAAOM,MAAM,EAAA;;AACV,sCAAAT,cAAA,CAACG,cAAOO,QAAQ,EAAA,EAAA,CAAA;AAChB,sCAAAd,eAAA,CAACO,cAAOQ,KAAK,EAAA;;AACT,8CAAAf,eAAA,CAACO,cAAOS,MAAM,EAAA;;AACV,sDAAAZ,cAAA,CAACG,cAAOU,KAAK,EAAA;AAAElB,4CAAAA,QAAAA,EAAAA,yBAAAA,CAAeP,OAAAA,EAAS,QAAA;;AACvC,sDAAAY,cAAA,CAACG,cAAOW,KAAK,EAAA;4CAACC,YAAAA,EAAW,OAAA;AACrB,4CAAA,QAAA,gBAAAf,cAAA,CAACgB,GAAAA,EAAAA;gDAAEC,SAAAA,EAAU;;;;;AAGrB,8CAAAjB,cAAA,CAACG,cAAOe,OAAO,EAAA;AAAE7B,oCAAAA,QAAAA,EAAAA,KAAAA,CAAM8B;;;;;;;;;AAM/C
|
|
1
|
+
{"version":3,"file":"PrimeSidebar.js","sources":["../../../overlay/PrimeSidebar.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState } from 'react';\nimport { Button } from 'primereact/button';\nimport { Drawer } from 'primereact/drawer';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:sidebar` component - a panel that slides in from an edge of the viewport.\n *\n * **This is built on `primereact/drawer`, and that is not a mistake.** PrimeReact 11 renamed this\n * component to `Drawer` *and* introduced an unrelated new component under the name `Sidebar` -\n * `primereact/sidebar` in v11 is an application-shell primitive (`SidebarLayout`, `SidebarAside`,\n * `SidebarPanel`, `SidebarMenu` and friends) for persistent navigation, with no slide-in overlay\n * behavior anywhere in it. Importing `Sidebar` from v11 to port a v10 `Sidebar` compiles perfectly and\n * silently replaces a dismissable overlay with a static shell element, which is why the module here is\n * the one that does not match the name. The abstract Scene name stays `sidebar` so existing screens keep\n * resolving; only the implementation moved.\n *\n * Visibility is owned locally and a trigger is always rendered, for the reason described on\n * {@link PrimeDialog}, and v11's controlled `open` / `onOpenChange` pair is wired for the reason\n * described there too.\n *\n * v10's `fullScreen` flag became a fifth `position` value rather than a separate prop, so the two Scene\n * properties collapse into one: `fullScreen` wins when set, since a drawer covering the viewport has no\n * edge left to slide in from.\n */\nexport function PrimeSidebar({ element, slots }: RegisteredComponentProps) {\n const [visible, setVisible] = useState(booleanProperty(element, 'visible', false));\n const position = booleanProperty(element, 'fullScreen', false) ? 'full' : stringProperty(element, 'position', 'left');\n return (\n <div data-scene-id={element.id}>\n <Button onClick={() => setVisible(true)}>{stringProperty(element, 'triggerLabel', 'Open')}</Button>\n <Drawer.Root\n open={visible}\n position={position as 'left' | 'right' | 'top' | 'bottom' | 'full'}\n onOpenChange={(event) => {\n if (!event.value) setVisible(false);\n }}>\n <Drawer.Portal>\n <Drawer.Backdrop />\n <Drawer.Popup>\n <Drawer.Header>\n <Drawer.Title>{stringProperty(element, 'header')}</Drawer.Title>\n <Drawer.Close aria-label='Close'>\n <i className='pi pi-times' />\n </Drawer.Close>\n </Drawer.Header>\n <Drawer.Content>{slots.content}</Drawer.Content>\n </Drawer.Popup>\n </Drawer.Portal>\n </Drawer.Root>\n </div>\n );\n}\n"],"names":["PrimeSidebar","element","slots","visible","setVisible","useState","booleanProperty","position","stringProperty","_jsxs","div","data-scene-id","id","_jsx","Button","onClick","Drawer","Root","open","onOpenChange","event","value","Portal","Backdrop","Popup","Header","Title","Close","aria-label","i","className","Content","content"],"mappings":";;;;;;;;AASA;;;;;;;;;;;;;;;;;;;AAmBC,IACM,SAASA,YAAAA,CAAa,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACrE,IAAA,MAAM,CAACC,OAAAA,EAASC,UAAAA,CAAW,GAAGC,cAAAA,CAASC,0BAAAA,CAAgBL,SAAS,SAAA,EAAW,KAAA,CAAA,CAAA;IAC3E,MAAMM,QAAAA,GAAWD,2BAAgBL,OAAAA,EAAS,YAAA,EAAc,SAAS,MAAA,GAASO,yBAAAA,CAAeP,SAAS,UAAA,EAAY,MAAA,CAAA;AAC9G,IAAA,qBACIQ,eAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeV,QAAQW,EAAE;;0BAC1BC,cAAA,CAACC,aAAAA,EAAAA;AAAOC,gBAAAA,OAAAA,EAAS,IAAMX,UAAAA,CAAW,IAAA,CAAA;AAAQI,gBAAAA,QAAAA,EAAAA,yBAAAA,CAAeP,SAAS,cAAA,EAAgB,MAAA;;AAClF,0BAAAY,cAAA,CAACG,cAAOC,IAAI,EAAA;gBACRC,IAAAA,EAAMf,OAAAA;gBACNI,QAAAA,EAAUA,QAAAA;AACVY,gBAAAA,YAAAA,EAAc,CAACC,KAAAA,GAAAA;AACX,oBAAA,IAAI,CAACA,KAAAA,CAAMC,KAAK,EAAEjB,UAAAA,CAAW,KAAA,CAAA;AACjC,gBAAA,CAAA;wCACAK,eAAA,CAACO,cAAOM,MAAM,EAAA;;AACV,sCAAAT,cAAA,CAACG,cAAOO,QAAQ,EAAA,EAAA,CAAA;AAChB,sCAAAd,eAAA,CAACO,cAAOQ,KAAK,EAAA;;AACT,8CAAAf,eAAA,CAACO,cAAOS,MAAM,EAAA;;AACV,sDAAAZ,cAAA,CAACG,cAAOU,KAAK,EAAA;AAAElB,4CAAAA,QAAAA,EAAAA,yBAAAA,CAAeP,OAAAA,EAAS,QAAA;;AACvC,sDAAAY,cAAA,CAACG,cAAOW,KAAK,EAAA;4CAACC,YAAAA,EAAW,OAAA;AACrB,4CAAA,QAAA,gBAAAf,cAAA,CAACgB,GAAAA,EAAAA;gDAAEC,SAAAA,EAAU;;;;;AAGrB,8CAAAjB,cAAA,CAACG,cAAOe,OAAO,EAAA;AAAE7B,oCAAAA,QAAAA,EAAAA,KAAAA,CAAM8B;;;;;;;;;AAM/C;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeTooltip.js","sources":["../../../overlay/PrimeTooltip.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 { Tooltip } from 'primereact/tooltip';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:tooltip` component - explanatory text shown on hover.\n *\n * The adapter renders the hover target as well as the tooltip, because a tooltip with nothing to point\n * at has nothing to do.\n *\n * PrimeReact 11 replaced the v10 mechanism entirely and this adapter got simpler for it. v10's `Tooltip`\n * attached itself to a CSS selector and read its text from a `data-pr-tooltip` attribute on whatever it\n * found, which forced this adapter to invent a unique attribute selector - and to use an attribute rather\n * than a class, because a Scene element id is free-form and may legally start with a digit, which is not\n * a valid class selector. v11 wraps the target instead: `Tooltip.Trigger` *is* the target, so the\n * selector, the generated attribute and the whole indirection are gone.\n *\n * The trigger is rendered as a `span` rather than v11's default `button`, because the `content` slot may\n * hold any Scene children at all - including a button, which nested inside another button is invalid\n * markup that browsers silently restructure. The cost is that a bare label is not keyboard focusable and\n * so shows on hover only; when a screen puts a real control in the slot, that control brings its own\n * focus behavior.\n */\nexport function PrimeTooltip({ element, slots }: RegisteredComponentProps) {\n return (\n <Tooltip.Root>\n <Tooltip.Trigger as='span' data-scene-id={element.id}>\n {slots.content?.length ? slots.content : stringProperty(element, 'label', 'Hover me')}\n </Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Positioner side={stringProperty(element, 'position', 'top') as 'top' | 'bottom' | 'left' | 'right'}>\n <Tooltip.Popup>{stringProperty(element, 'text', '')}</Tooltip.Popup>\n </Tooltip.Positioner>\n </Tooltip.Portal>\n </Tooltip.Root>\n );\n}\n"],"names":["PrimeTooltip","element","slots","_jsxs","Tooltip","Root","_jsx","Trigger","as","data-scene-id","id","content","length","stringProperty","Portal","Positioner","side","Popup"],"mappings":";;;;;;AAOA;;;;;;;;;;;;;;;;;;AAkBC,IACM,SAASA,YAAAA,CAAa,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACrE,qBACIC,eAAA,CAACC,gBAAQC,IAAI,EAAA;;AACT,0BAAAC,cAAA,CAACF,gBAAQG,OAAO,EAAA;gBAACC,EAAAA,EAAG,MAAA;AAAOC,gBAAAA,eAAAA,EAAeR,QAAQS,EAAE;0BAC/CR,KAAAA,CAAMS,OAAO,EAAEC,MAAAA,GAASV,KAAAA,CAAMS,OAAO,GAAGE,yBAAAA,CAAeZ,SAAS,OAAA,EAAS,UAAA;;AAE9E,0BAAAK,cAAA,CAACF,gBAAQU,MAAM,EAAA;wCACXR,cAAA,CAACF,gBAAQW,UAAU,EAAA;oBAACC,IAAAA,EAAMH,yBAAAA,CAAeZ,SAAS,UAAA,EAAY,KAAA,CAAA;4CAC1DK,cAAA,CAACF,gBAAQa,KAAK,EAAA;AAAEJ,wBAAAA,QAAAA,EAAAA,yBAAAA,CAAeZ,SAAS,MAAA,EAAQ,EAAA;;;;;;AAKpE
|
|
1
|
+
{"version":3,"file":"PrimeTooltip.js","sources":["../../../overlay/PrimeTooltip.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 { Tooltip } from 'primereact/tooltip';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:tooltip` component - explanatory text shown on hover.\n *\n * The adapter renders the hover target as well as the tooltip, because a tooltip with nothing to point\n * at has nothing to do.\n *\n * PrimeReact 11 replaced the v10 mechanism entirely and this adapter got simpler for it. v10's `Tooltip`\n * attached itself to a CSS selector and read its text from a `data-pr-tooltip` attribute on whatever it\n * found, which forced this adapter to invent a unique attribute selector - and to use an attribute rather\n * than a class, because a Scene element id is free-form and may legally start with a digit, which is not\n * a valid class selector. v11 wraps the target instead: `Tooltip.Trigger` *is* the target, so the\n * selector, the generated attribute and the whole indirection are gone.\n *\n * The trigger is rendered as a `span` rather than v11's default `button`, because the `content` slot may\n * hold any Scene children at all - including a button, which nested inside another button is invalid\n * markup that browsers silently restructure. The cost is that a bare label is not keyboard focusable and\n * so shows on hover only; when a screen puts a real control in the slot, that control brings its own\n * focus behavior.\n */\nexport function PrimeTooltip({ element, slots }: RegisteredComponentProps) {\n return (\n <Tooltip.Root>\n <Tooltip.Trigger as='span' data-scene-id={element.id}>\n {slots.content?.length ? slots.content : stringProperty(element, 'label', 'Hover me')}\n </Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Positioner side={stringProperty(element, 'position', 'top') as 'top' | 'bottom' | 'left' | 'right'}>\n <Tooltip.Popup>{stringProperty(element, 'text', '')}</Tooltip.Popup>\n </Tooltip.Positioner>\n </Tooltip.Portal>\n </Tooltip.Root>\n );\n}\n"],"names":["PrimeTooltip","element","slots","_jsxs","Tooltip","Root","_jsx","Trigger","as","data-scene-id","id","content","length","stringProperty","Portal","Positioner","side","Popup"],"mappings":";;;;;;AAOA;;;;;;;;;;;;;;;;;;AAkBC,IACM,SAASA,YAAAA,CAAa,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACrE,qBACIC,eAAA,CAACC,gBAAQC,IAAI,EAAA;;AACT,0BAAAC,cAAA,CAACF,gBAAQG,OAAO,EAAA;gBAACC,EAAAA,EAAG,MAAA;AAAOC,gBAAAA,eAAAA,EAAeR,QAAQS,EAAE;0BAC/CR,KAAAA,CAAMS,OAAO,EAAEC,MAAAA,GAASV,KAAAA,CAAMS,OAAO,GAAGE,yBAAAA,CAAeZ,SAAS,OAAA,EAAS,UAAA;;AAE9E,0BAAAK,cAAA,CAACF,gBAAQU,MAAM,EAAA;wCACXR,cAAA,CAACF,gBAAQW,UAAU,EAAA;oBAACC,IAAAA,EAAMH,yBAAAA,CAAeZ,SAAS,UAAA,EAAY,KAAA,CAAA;4CAC1DK,cAAA,CAACF,gBAAQa,KAAK,EAAA;AAAEJ,wBAAAA,QAAAA,EAAAA,yBAAAA,CAAeZ,SAAS,MAAA,EAAQ,EAAA;;;;;;AAKpE;;"}
|