@cratis/scene.primereact 4.5.0 → 4.6.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/README.md +25 -3
- package/chart/ChartGallery.stories.tsx +63 -0
- package/chart/ChartType.ts +14 -0
- package/chart/ChartTypeResolution.ts +14 -0
- package/chart/PrimeChart.tsx +62 -0
- package/chart/chartHasData.ts +22 -0
- package/chart/chartTypeChoices.ts +32 -0
- package/chart/index.ts +7 -0
- package/chart/resolveChartType.ts +61 -0
- package/chart/useChart.ts +61 -0
- package/dist/cjs/chart/ChartType.js +18 -0
- package/dist/cjs/chart/ChartType.js.map +1 -0
- package/dist/cjs/chart/PrimeChart.js +92 -0
- package/dist/cjs/chart/PrimeChart.js.map +1 -0
- package/dist/cjs/chart/chartHasData.js +24 -0
- package/dist/cjs/chart/chartHasData.js.map +1 -0
- package/dist/cjs/chart/chartTypeChoices.js +43 -0
- package/dist/cjs/chart/chartTypeChoices.js.map +1 -0
- package/dist/cjs/chart/resolveChartType.js +69 -0
- package/dist/cjs/chart/resolveChartType.js.map +1 -0
- package/dist/cjs/chart/useChart.js +62 -0
- package/dist/cjs/chart/useChart.js.map +1 -0
- package/dist/cjs/form/MultiStateGlyph.js +59 -0
- package/dist/cjs/form/MultiStateGlyph.js.map +1 -0
- package/dist/cjs/form/PrimeMultiStateCheckbox.js +123 -0
- package/dist/cjs/form/PrimeMultiStateCheckbox.js.map +1 -0
- package/dist/cjs/form/multiStateOptions.js +77 -0
- package/dist/cjs/form/multiStateOptions.js.map +1 -0
- package/dist/cjs/form/multiStateStates.js +32 -0
- package/dist/cjs/form/multiStateStates.js.map +1 -0
- package/dist/cjs/form/useMultiStateSelection.js +51 -0
- package/dist/cjs/form/useMultiStateSelection.js.map +1 -0
- package/dist/cjs/index.js +12 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/primeReactComponents.js +5 -0
- package/dist/cjs/primeReactComponents.js.map +1 -1
- package/dist/cjs/primeReactDescriptors.js +157 -0
- package/dist/cjs/primeReactDescriptors.js.map +1 -0
- package/dist/cjs/primeReactPackage.js +4 -0
- package/dist/cjs/primeReactPackage.js.map +1 -1
- package/dist/cjs/properties.js +11 -0
- package/dist/cjs/properties.js.map +1 -1
- package/dist/cjs/structurallyEqual.js +27 -0
- package/dist/cjs/structurallyEqual.js.map +1 -0
- package/dist/cjs/useStructuralValue.js +20 -0
- package/dist/cjs/useStructuralValue.js.map +1 -0
- package/dist/esm/chart/ChartGallery.stories.d.ts +14 -0
- package/dist/esm/chart/ChartGallery.stories.d.ts.map +1 -0
- package/dist/esm/chart/ChartGallery.stories.js +47 -0
- package/dist/esm/chart/ChartGallery.stories.js.map +1 -0
- package/dist/esm/chart/ChartType.d.ts +11 -0
- package/dist/esm/chart/ChartType.d.ts.map +1 -0
- package/dist/esm/chart/ChartType.js +16 -0
- package/dist/esm/chart/ChartType.js.map +1 -0
- package/dist/esm/chart/ChartTypeResolution.d.ts +10 -0
- package/dist/esm/chart/ChartTypeResolution.d.ts.map +1 -0
- package/dist/esm/chart/ChartTypeResolution.js +2 -0
- package/dist/esm/chart/ChartTypeResolution.js.map +1 -0
- package/dist/esm/chart/PrimeChart.d.ts +3 -0
- package/dist/esm/chart/PrimeChart.d.ts.map +1 -0
- package/dist/esm/chart/PrimeChart.js +90 -0
- package/dist/esm/chart/PrimeChart.js.map +1 -0
- package/dist/esm/chart/chartHasData.d.ts +2 -0
- package/dist/esm/chart/chartHasData.d.ts.map +1 -0
- package/dist/esm/chart/chartHasData.js +22 -0
- package/dist/esm/chart/chartHasData.js.map +1 -0
- package/dist/esm/chart/chartTypeChoices.d.ts +3 -0
- package/dist/esm/chart/chartTypeChoices.d.ts.map +1 -0
- package/dist/esm/chart/chartTypeChoices.js +41 -0
- package/dist/esm/chart/chartTypeChoices.js.map +1 -0
- package/dist/esm/chart/index.d.ts +5 -0
- package/dist/esm/chart/index.d.ts.map +1 -0
- package/dist/esm/chart/index.js +5 -0
- package/dist/esm/chart/index.js.map +1 -0
- package/dist/esm/chart/resolveChartType.d.ts +6 -0
- package/dist/esm/chart/resolveChartType.d.ts.map +1 -0
- package/dist/esm/chart/resolveChartType.js +66 -0
- package/dist/esm/chart/resolveChartType.js.map +1 -0
- package/dist/esm/chart/useChart.d.ts +4 -0
- package/dist/esm/chart/useChart.d.ts.map +1 -0
- package/dist/esm/chart/useChart.js +60 -0
- package/dist/esm/chart/useChart.js.map +1 -0
- package/dist/esm/form/FormGallery.stories.d.ts.map +1 -1
- package/dist/esm/form/FormGallery.stories.js +8 -0
- package/dist/esm/form/FormGallery.stories.js.map +1 -1
- package/dist/esm/form/MultiStateGlyph.d.ts +8 -0
- package/dist/esm/form/MultiStateGlyph.d.ts.map +1 -0
- package/dist/esm/form/MultiStateGlyph.js +57 -0
- package/dist/esm/form/MultiStateGlyph.js.map +1 -0
- package/dist/esm/form/MultiStateOption.d.ts +7 -0
- package/dist/esm/form/MultiStateOption.d.ts.map +1 -0
- package/dist/esm/form/MultiStateOption.js +2 -0
- package/dist/esm/form/MultiStateOption.js.map +1 -0
- package/dist/esm/form/PrimeMultiStateCheckbox.d.ts +3 -0
- package/dist/esm/form/PrimeMultiStateCheckbox.d.ts.map +1 -0
- package/dist/esm/form/PrimeMultiStateCheckbox.js +121 -0
- package/dist/esm/form/PrimeMultiStateCheckbox.js.map +1 -0
- package/dist/esm/form/index.d.ts +1 -0
- package/dist/esm/form/index.d.ts.map +1 -1
- package/dist/esm/form/index.js +1 -0
- package/dist/esm/form/index.js.map +1 -1
- package/dist/esm/form/multiStateOptions.d.ts +4 -0
- package/dist/esm/form/multiStateOptions.d.ts.map +1 -0
- package/dist/esm/form/multiStateOptions.js +75 -0
- package/dist/esm/form/multiStateOptions.js.map +1 -0
- package/dist/esm/form/multiStateStates.d.ts +4 -0
- package/dist/esm/form/multiStateStates.d.ts.map +1 -0
- package/dist/esm/form/multiStateStates.js +30 -0
- package/dist/esm/form/multiStateStates.js.map +1 -0
- package/dist/esm/form/useMultiStateSelection.d.ts +6 -0
- package/dist/esm/form/useMultiStateSelection.d.ts.map +1 -0
- package/dist/esm/form/useMultiStateSelection.js +49 -0
- package/dist/esm/form/useMultiStateSelection.js.map +1 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +6 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/primeReactComponents.d.ts.map +1 -1
- package/dist/esm/primeReactComponents.js +5 -0
- package/dist/esm/primeReactComponents.js.map +1 -1
- package/dist/esm/primeReactDescriptors.d.ts +3 -0
- package/dist/esm/primeReactDescriptors.d.ts.map +1 -0
- package/dist/esm/primeReactDescriptors.js +155 -0
- package/dist/esm/primeReactDescriptors.js.map +1 -0
- package/dist/esm/primeReactPackage.d.ts.map +1 -1
- package/dist/esm/primeReactPackage.js +4 -0
- package/dist/esm/primeReactPackage.js.map +1 -1
- package/dist/esm/properties.d.ts +1 -0
- package/dist/esm/properties.d.ts.map +1 -1
- package/dist/esm/properties.js +11 -1
- package/dist/esm/properties.js.map +1 -1
- package/dist/esm/structurallyEqual.d.ts +2 -0
- package/dist/esm/structurallyEqual.d.ts.map +1 -0
- package/dist/esm/structurallyEqual.js +25 -0
- package/dist/esm/structurallyEqual.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/useStructuralValue.d.ts +2 -0
- package/dist/esm/useStructuralValue.d.ts.map +1 -0
- package/dist/esm/useStructuralValue.js +18 -0
- package/dist/esm/useStructuralValue.js.map +1 -0
- package/form/FormGallery.stories.tsx +8 -0
- package/form/MultiStateGlyph.tsx +55 -0
- package/form/MultiStateOption.ts +17 -0
- package/form/PrimeMultiStateCheckbox.tsx +101 -0
- package/form/index.ts +1 -0
- package/form/multiStateOptions.ts +78 -0
- package/form/multiStateStates.ts +23 -0
- package/form/useMultiStateSelection.ts +48 -0
- package/index.ts +2 -0
- package/package.json +17 -7
- package/primeReactComponents.ts +4 -0
- package/primeReactDescriptors.ts +48 -0
- package/primeReactPackage.ts +4 -2
- package/properties.ts +14 -0
- package/structurallyEqual.ts +29 -0
- package/useStructuralValue.ts +17 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primeReactComponents.js","sources":["../../primeReactComponents.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 { ComponentRegistry, componentRegistryKey } from '@cratis/scene.react';\nimport { PrimeButton, PrimeButtonGroup, PrimeSpeedDial, PrimeSplitButton } from './button';\nimport {\n PrimeColumn,\n PrimeDataTable,\n PrimeDataView,\n PrimeOrderList,\n PrimeOrganizationChart,\n PrimePaginator,\n PrimePickList,\n PrimeTimeline,\n PrimeTree,\n} from './data';\nimport {\n PrimeAutoComplete,\n PrimeCalendar,\n PrimeCheckbox,\n PrimeChips,\n PrimeColorPicker,\n PrimeDropdown,\n PrimeFloatLabel,\n PrimeIconField,\n PrimeInputNumber,\n PrimeInputText,\n PrimeInputTextarea,\n PrimeKnob,\n PrimeListBox,\n PrimeMultiSelect,\n PrimePassword,\n PrimeRadioButton,\n PrimeRating,\n PrimeSelectButton,\n PrimeSlider,\n PrimeToggleSwitch,\n PrimeTreeSelect,\n} from './form';\nimport { PrimeCarousel, PrimeGalleria, PrimeImage } from './media';\nimport {\n PrimeBreadcrumb,\n PrimeContextMenu,\n PrimeDock,\n PrimeMegaMenu,\n PrimeMenu,\n PrimeMenubar,\n PrimePanelMenu,\n PrimeSteps,\n PrimeTabMenu,\n PrimeTieredMenu,\n} from './menu';\nimport { PrimeInlineMessage, PrimeMessage, PrimeToast } from './messages';\nimport {\n PrimeAvatar,\n PrimeBadge,\n PrimeBlockUI,\n PrimeChip,\n PrimeInplace,\n PrimeProgressBar,\n PrimeProgressSpinner,\n PrimeScrollTop,\n PrimeSkeleton,\n PrimeTag,\n PrimeTerminal,\n} from './misc';\nimport { PrimeConfirmDialog, PrimeDialog, PrimeOverlayPanel, PrimeSidebar, PrimeTooltip } from './overlay';\nimport {\n PrimeAccordion,\n PrimeCard,\n PrimeDivider,\n PrimeFieldset,\n PrimePanel,\n PrimeScrollPanel,\n PrimeSplitter,\n PrimeStepper,\n PrimeTabView,\n PrimeToolbar,\n} from './panel';\nimport { PrimeAction, PrimeField, PrimeSection, PrimeSummary, PrimeText, PrimeTitle } from './screen';\n\n/**\n * The `PrimeReact` package's component registry - every abstract name this package answers to, mapped to\n * the adapter that renders it.\n *\n * Three of these names - `text`, `button` and `card` - are deliberately the same ones `core` declares.\n * That is not a collision to be avoided but the mechanism working as intended: a `ui profile` listing\n * `core` and then `PrimeReact` resolves those names here and records that `core` was shadowed, so an\n * existing screen gets real themed components without being edited.\n *\n * Seven more - `table`, `column`, `title`, `field`, `section`, `summary` and `action` - are the names\n * Screenplay's screen vocabulary emits as directive kinds. Declaring them means a screen compiled from a\n * `.play` file renders through this package directly, rather than through a translation layer that would\n * have to be kept in step with the compiler.\n *\n * `table` and `dataTable` share one adapter on purpose: they are the same component under two names a\n * screen might reasonably use, and duplicating the implementation would let the two drift.\n */\nexport const primeReactComponents: ComponentRegistry = {\n [componentRegistryKey('PrimeReact', 'inputText')]: PrimeInputText,\n [componentRegistryKey('PrimeReact', 'inputTextarea')]: PrimeInputTextarea,\n [componentRegistryKey('PrimeReact', 'inputNumber')]: PrimeInputNumber,\n [componentRegistryKey('PrimeReact', 'password')]: PrimePassword,\n [componentRegistryKey('PrimeReact', 'floatLabel')]: PrimeFloatLabel,\n [componentRegistryKey('PrimeReact', 'iconField')]: PrimeIconField,\n [componentRegistryKey('PrimeReact', 'dropdown')]: PrimeDropdown,\n [componentRegistryKey('PrimeReact', 'multiSelect')]: PrimeMultiSelect,\n [componentRegistryKey('PrimeReact', 'listBox')]: PrimeListBox,\n [componentRegistryKey('PrimeReact', 'selectButton')]: PrimeSelectButton,\n [componentRegistryKey('PrimeReact', 'checkbox')]: PrimeCheckbox,\n [componentRegistryKey('PrimeReact', 'radioButton')]: PrimeRadioButton,\n [componentRegistryKey('PrimeReact', 'toggleSwitch')]: PrimeToggleSwitch,\n [componentRegistryKey('PrimeReact', 'slider')]: PrimeSlider,\n [componentRegistryKey('PrimeReact', 'rating')]: PrimeRating,\n [componentRegistryKey('PrimeReact', 'knob')]: PrimeKnob,\n [componentRegistryKey('PrimeReact', 'calendar')]: PrimeCalendar,\n [componentRegistryKey('PrimeReact', 'colorPicker')]: PrimeColorPicker,\n [componentRegistryKey('PrimeReact', 'chips')]: PrimeChips,\n [componentRegistryKey('PrimeReact', 'autoComplete')]: PrimeAutoComplete,\n [componentRegistryKey('PrimeReact', 'treeSelect')]: PrimeTreeSelect,\n\n [componentRegistryKey('PrimeReact', 'button')]: PrimeButton,\n [componentRegistryKey('PrimeReact', 'splitButton')]: PrimeSplitButton,\n [componentRegistryKey('PrimeReact', 'speedDial')]: PrimeSpeedDial,\n [componentRegistryKey('PrimeReact', 'buttonGroup')]: PrimeButtonGroup,\n\n [componentRegistryKey('PrimeReact', 'dataTable')]: PrimeDataTable,\n [componentRegistryKey('PrimeReact', 'table')]: PrimeDataTable,\n [componentRegistryKey('PrimeReact', 'column')]: PrimeColumn,\n [componentRegistryKey('PrimeReact', 'dataView')]: PrimeDataView,\n [componentRegistryKey('PrimeReact', 'tree')]: PrimeTree,\n [componentRegistryKey('PrimeReact', 'timeline')]: PrimeTimeline,\n [componentRegistryKey('PrimeReact', 'paginator')]: PrimePaginator,\n [componentRegistryKey('PrimeReact', 'orderList')]: PrimeOrderList,\n [componentRegistryKey('PrimeReact', 'pickList')]: PrimePickList,\n [componentRegistryKey('PrimeReact', 'organizationChart')]: PrimeOrganizationChart,\n\n [componentRegistryKey('PrimeReact', 'card')]: PrimeCard,\n [componentRegistryKey('PrimeReact', 'panel')]: PrimePanel,\n [componentRegistryKey('PrimeReact', 'accordion')]: PrimeAccordion,\n [componentRegistryKey('PrimeReact', 'fieldset')]: PrimeFieldset,\n [componentRegistryKey('PrimeReact', 'divider')]: PrimeDivider,\n [componentRegistryKey('PrimeReact', 'splitter')]: PrimeSplitter,\n [componentRegistryKey('PrimeReact', 'scrollPanel')]: PrimeScrollPanel,\n [componentRegistryKey('PrimeReact', 'tabView')]: PrimeTabView,\n [componentRegistryKey('PrimeReact', 'toolbar')]: PrimeToolbar,\n [componentRegistryKey('PrimeReact', 'stepper')]: PrimeStepper,\n\n [componentRegistryKey('PrimeReact', 'dialog')]: PrimeDialog,\n [componentRegistryKey('PrimeReact', 'confirmDialog')]: PrimeConfirmDialog,\n [componentRegistryKey('PrimeReact', 'overlayPanel')]: PrimeOverlayPanel,\n [componentRegistryKey('PrimeReact', 'sidebar')]: PrimeSidebar,\n [componentRegistryKey('PrimeReact', 'tooltip')]: PrimeTooltip,\n\n [componentRegistryKey('PrimeReact', 'menu')]: PrimeMenu,\n [componentRegistryKey('PrimeReact', 'menubar')]: PrimeMenubar,\n [componentRegistryKey('PrimeReact', 'breadcrumb')]: PrimeBreadcrumb,\n [componentRegistryKey('PrimeReact', 'tabMenu')]: PrimeTabMenu,\n [componentRegistryKey('PrimeReact', 'steps')]: PrimeSteps,\n [componentRegistryKey('PrimeReact', 'tieredMenu')]: PrimeTieredMenu,\n [componentRegistryKey('PrimeReact', 'panelMenu')]: PrimePanelMenu,\n [componentRegistryKey('PrimeReact', 'contextMenu')]: PrimeContextMenu,\n [componentRegistryKey('PrimeReact', 'megaMenu')]: PrimeMegaMenu,\n [componentRegistryKey('PrimeReact', 'dock')]: PrimeDock,\n\n [componentRegistryKey('PrimeReact', 'message')]: PrimeMessage,\n [componentRegistryKey('PrimeReact', 'inlineMessage')]: PrimeInlineMessage,\n [componentRegistryKey('PrimeReact', 'toast')]: PrimeToast,\n\n [componentRegistryKey('PrimeReact', 'image')]: PrimeImage,\n [componentRegistryKey('PrimeReact', 'galleria')]: PrimeGalleria,\n [componentRegistryKey('PrimeReact', 'carousel')]: PrimeCarousel,\n\n [componentRegistryKey('PrimeReact', 'avatar')]: PrimeAvatar,\n [componentRegistryKey('PrimeReact', 'badge')]: PrimeBadge,\n [componentRegistryKey('PrimeReact', 'chip')]: PrimeChip,\n [componentRegistryKey('PrimeReact', 'tag')]: PrimeTag,\n [componentRegistryKey('PrimeReact', 'progressBar')]: PrimeProgressBar,\n [componentRegistryKey('PrimeReact', 'progressSpinner')]: PrimeProgressSpinner,\n [componentRegistryKey('PrimeReact', 'skeleton')]: PrimeSkeleton,\n [componentRegistryKey('PrimeReact', 'scrollTop')]: PrimeScrollTop,\n [componentRegistryKey('PrimeReact', 'blockUI')]: PrimeBlockUI,\n [componentRegistryKey('PrimeReact', 'inplace')]: PrimeInplace,\n [componentRegistryKey('PrimeReact', 'terminal')]: PrimeTerminal,\n\n [componentRegistryKey('PrimeReact', 'text')]: PrimeText,\n [componentRegistryKey('PrimeReact', 'title')]: PrimeTitle,\n [componentRegistryKey('PrimeReact', 'field')]: PrimeField,\n [componentRegistryKey('PrimeReact', 'section')]: PrimeSection,\n [componentRegistryKey('PrimeReact', 'summary')]: PrimeSummary,\n [componentRegistryKey('PrimeReact', 'action')]: PrimeAction,\n};\n"],"names":["primeReactComponents","componentRegistryKey","PrimeInputText","PrimeInputTextarea","PrimeInputNumber","PrimePassword","PrimeFloatLabel","PrimeIconField","PrimeDropdown","PrimeMultiSelect","PrimeListBox","PrimeSelectButton","PrimeCheckbox","PrimeRadioButton","PrimeToggleSwitch","PrimeSlider","PrimeRating","PrimeKnob","PrimeCalendar","PrimeColorPicker","PrimeChips","PrimeAutoComplete","PrimeTreeSelect","PrimeButton","PrimeSplitButton","PrimeSpeedDial","PrimeButtonGroup","PrimeDataTable","PrimeColumn","PrimeDataView","PrimeTree","PrimeTimeline","PrimePaginator","PrimeOrderList","PrimePickList","PrimeOrganizationChart","PrimeCard","PrimePanel","PrimeAccordion","PrimeFieldset","PrimeDivider","PrimeSplitter","PrimeScrollPanel","PrimeTabView","PrimeToolbar","PrimeStepper","PrimeDialog","PrimeConfirmDialog","PrimeOverlayPanel","PrimeSidebar","PrimeTooltip","PrimeMenu","PrimeMenubar","PrimeBreadcrumb","PrimeTabMenu","PrimeSteps","PrimeTieredMenu","PrimePanelMenu","PrimeContextMenu","PrimeMegaMenu","PrimeDock","PrimeMessage","PrimeInlineMessage","PrimeToast","PrimeImage","PrimeGalleria","PrimeCarousel","PrimeAvatar","PrimeBadge","PrimeChip","PrimeTag","PrimeProgressBar","PrimeProgressSpinner","PrimeSkeleton","PrimeScrollTop","PrimeBlockUI","PrimeInplace","PrimeTerminal","PrimeText","PrimeTitle","PrimeField","PrimeSection","PrimeSummary","PrimeAction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAgFA;;;;;;;;;;;;;;;;UAiBaA,oBAAAA,GAA0C;IACnD,CAACC,oBAAAA,CAAqB,YAAA,EAAc,WAAA,CAAA,GAAeC,cAAAA;IACnD,CAACD,oBAAAA,CAAqB,YAAA,EAAc,eAAA,CAAA,GAAmBE,kBAAAA;IACvD,CAACF,oBAAAA,CAAqB,YAAA,EAAc,aAAA,CAAA,GAAiBG,gBAAAA;IACrD,CAACH,oBAAAA,CAAqB,YAAA,EAAc,UAAA,CAAA,GAAcI,aAAAA;IAClD,CAACJ,oBAAAA,CAAqB,YAAA,EAAc,YAAA,CAAA,GAAgBK,eAAAA;IACpD,CAACL,oBAAAA,CAAqB,YAAA,EAAc,WAAA,CAAA,GAAeM,cAAAA;IACnD,CAACN,oBAAAA,CAAqB,YAAA,EAAc,UAAA,CAAA,GAAcO,aAAAA;IAClD,CAACP,oBAAAA,CAAqB,YAAA,EAAc,aAAA,CAAA,GAAiBQ,gBAAAA;IACrD,CAACR,oBAAAA,CAAqB,YAAA,EAAc,SAAA,CAAA,GAAaS,YAAAA;IACjD,CAACT,oBAAAA,CAAqB,YAAA,EAAc,cAAA,CAAA,GAAkBU,iBAAAA;IACtD,CAACV,oBAAAA,CAAqB,YAAA,E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,YAAA,EAAc,SAAA,CAAA,GAAaiF,YAAAA;IACjD,CAACjF,oBAAAA,CAAqB,YAAA,EAAc,QAAA,CAAA,GAAYkF;AACpD;;"}
|
|
1
|
+
{"version":3,"file":"primeReactComponents.js","sources":["../../primeReactComponents.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 { ComponentRegistry, componentRegistryKey } from '@cratis/scene.react';\nimport { PrimeButton, PrimeButtonGroup, PrimeSpeedDial, PrimeSplitButton } from './button';\nimport { PrimeChart } from './chart';\nimport {\n PrimeColumn,\n PrimeDataTable,\n PrimeDataView,\n PrimeOrderList,\n PrimeOrganizationChart,\n PrimePaginator,\n PrimePickList,\n PrimeTimeline,\n PrimeTree,\n} from './data';\nimport {\n PrimeAutoComplete,\n PrimeCalendar,\n PrimeCheckbox,\n PrimeChips,\n PrimeColorPicker,\n PrimeDropdown,\n PrimeFloatLabel,\n PrimeIconField,\n PrimeInputNumber,\n PrimeInputText,\n PrimeInputTextarea,\n PrimeKnob,\n PrimeListBox,\n PrimeMultiSelect,\n PrimePassword,\n PrimeRadioButton,\n PrimeRating,\n PrimeSelectButton,\n PrimeMultiStateCheckbox,\n PrimeSlider,\n PrimeToggleSwitch,\n PrimeTreeSelect,\n} from './form';\nimport { PrimeCarousel, PrimeGalleria, PrimeImage } from './media';\nimport {\n PrimeBreadcrumb,\n PrimeContextMenu,\n PrimeDock,\n PrimeMegaMenu,\n PrimeMenu,\n PrimeMenubar,\n PrimePanelMenu,\n PrimeSteps,\n PrimeTabMenu,\n PrimeTieredMenu,\n} from './menu';\nimport { PrimeInlineMessage, PrimeMessage, PrimeToast } from './messages';\nimport {\n PrimeAvatar,\n PrimeBadge,\n PrimeBlockUI,\n PrimeChip,\n PrimeInplace,\n PrimeProgressBar,\n PrimeProgressSpinner,\n PrimeScrollTop,\n PrimeSkeleton,\n PrimeTag,\n PrimeTerminal,\n} from './misc';\nimport { PrimeConfirmDialog, PrimeDialog, PrimeOverlayPanel, PrimeSidebar, PrimeTooltip } from './overlay';\nimport {\n PrimeAccordion,\n PrimeCard,\n PrimeDivider,\n PrimeFieldset,\n PrimePanel,\n PrimeScrollPanel,\n PrimeSplitter,\n PrimeStepper,\n PrimeTabView,\n PrimeToolbar,\n} from './panel';\nimport { PrimeAction, PrimeField, PrimeSection, PrimeSummary, PrimeText, PrimeTitle } from './screen';\n\n/**\n * The `PrimeReact` package's component registry - every abstract name this package answers to, mapped to\n * the adapter that renders it.\n *\n * Three of these names - `text`, `button` and `card` - are deliberately the same ones `core` declares.\n * That is not a collision to be avoided but the mechanism working as intended: a `ui profile` listing\n * `core` and then `PrimeReact` resolves those names here and records that `core` was shadowed, so an\n * existing screen gets real themed components without being edited.\n *\n * Seven more - `table`, `column`, `title`, `field`, `section`, `summary` and `action` - are the names\n * Screenplay's screen vocabulary emits as directive kinds. Declaring them means a screen compiled from a\n * `.play` file renders through this package directly, rather than through a translation layer that would\n * have to be kept in step with the compiler.\n *\n * `table` and `dataTable` share one adapter on purpose: they are the same component under two names a\n * screen might reasonably use, and duplicating the implementation would let the two drift.\n */\nexport const primeReactComponents: ComponentRegistry = {\n [componentRegistryKey('PrimeReact', 'inputText')]: PrimeInputText,\n [componentRegistryKey('PrimeReact', 'inputTextarea')]: PrimeInputTextarea,\n [componentRegistryKey('PrimeReact', 'inputNumber')]: PrimeInputNumber,\n [componentRegistryKey('PrimeReact', 'password')]: PrimePassword,\n [componentRegistryKey('PrimeReact', 'floatLabel')]: PrimeFloatLabel,\n [componentRegistryKey('PrimeReact', 'iconField')]: PrimeIconField,\n [componentRegistryKey('PrimeReact', 'dropdown')]: PrimeDropdown,\n [componentRegistryKey('PrimeReact', 'multiSelect')]: PrimeMultiSelect,\n [componentRegistryKey('PrimeReact', 'listBox')]: PrimeListBox,\n [componentRegistryKey('PrimeReact', 'selectButton')]: PrimeSelectButton,\n [componentRegistryKey('PrimeReact', 'checkbox')]: PrimeCheckbox,\n [componentRegistryKey('PrimeReact', 'multiStateCheckbox')]: PrimeMultiStateCheckbox,\n [componentRegistryKey('PrimeReact', 'radioButton')]: PrimeRadioButton,\n [componentRegistryKey('PrimeReact', 'toggleSwitch')]: PrimeToggleSwitch,\n [componentRegistryKey('PrimeReact', 'slider')]: PrimeSlider,\n [componentRegistryKey('PrimeReact', 'rating')]: PrimeRating,\n [componentRegistryKey('PrimeReact', 'knob')]: PrimeKnob,\n [componentRegistryKey('PrimeReact', 'calendar')]: PrimeCalendar,\n [componentRegistryKey('PrimeReact', 'colorPicker')]: PrimeColorPicker,\n [componentRegistryKey('PrimeReact', 'chips')]: PrimeChips,\n [componentRegistryKey('PrimeReact', 'autoComplete')]: PrimeAutoComplete,\n [componentRegistryKey('PrimeReact', 'treeSelect')]: PrimeTreeSelect,\n\n [componentRegistryKey('PrimeReact', 'button')]: PrimeButton,\n [componentRegistryKey('PrimeReact', 'splitButton')]: PrimeSplitButton,\n [componentRegistryKey('PrimeReact', 'speedDial')]: PrimeSpeedDial,\n [componentRegistryKey('PrimeReact', 'buttonGroup')]: PrimeButtonGroup,\n\n [componentRegistryKey('PrimeReact', 'dataTable')]: PrimeDataTable,\n [componentRegistryKey('PrimeReact', 'table')]: PrimeDataTable,\n [componentRegistryKey('PrimeReact', 'column')]: PrimeColumn,\n [componentRegistryKey('PrimeReact', 'dataView')]: PrimeDataView,\n [componentRegistryKey('PrimeReact', 'tree')]: PrimeTree,\n [componentRegistryKey('PrimeReact', 'timeline')]: PrimeTimeline,\n [componentRegistryKey('PrimeReact', 'paginator')]: PrimePaginator,\n [componentRegistryKey('PrimeReact', 'orderList')]: PrimeOrderList,\n [componentRegistryKey('PrimeReact', 'pickList')]: PrimePickList,\n [componentRegistryKey('PrimeReact', 'organizationChart')]: PrimeOrganizationChart,\n [componentRegistryKey('PrimeReact', 'chart')]: PrimeChart,\n\n [componentRegistryKey('PrimeReact', 'card')]: PrimeCard,\n [componentRegistryKey('PrimeReact', 'panel')]: PrimePanel,\n [componentRegistryKey('PrimeReact', 'accordion')]: PrimeAccordion,\n [componentRegistryKey('PrimeReact', 'fieldset')]: PrimeFieldset,\n [componentRegistryKey('PrimeReact', 'divider')]: PrimeDivider,\n [componentRegistryKey('PrimeReact', 'splitter')]: PrimeSplitter,\n [componentRegistryKey('PrimeReact', 'scrollPanel')]: PrimeScrollPanel,\n [componentRegistryKey('PrimeReact', 'tabView')]: PrimeTabView,\n [componentRegistryKey('PrimeReact', 'toolbar')]: PrimeToolbar,\n [componentRegistryKey('PrimeReact', 'stepper')]: PrimeStepper,\n\n [componentRegistryKey('PrimeReact', 'dialog')]: PrimeDialog,\n [componentRegistryKey('PrimeReact', 'confirmDialog')]: PrimeConfirmDialog,\n [componentRegistryKey('PrimeReact', 'overlayPanel')]: PrimeOverlayPanel,\n [componentRegistryKey('PrimeReact', 'sidebar')]: PrimeSidebar,\n [componentRegistryKey('PrimeReact', 'tooltip')]: PrimeTooltip,\n\n [componentRegistryKey('PrimeReact', 'menu')]: PrimeMenu,\n [componentRegistryKey('PrimeReact', 'menubar')]: PrimeMenubar,\n [componentRegistryKey('PrimeReact', 'breadcrumb')]: PrimeBreadcrumb,\n [componentRegistryKey('PrimeReact', 'tabMenu')]: PrimeTabMenu,\n [componentRegistryKey('PrimeReact', 'steps')]: PrimeSteps,\n [componentRegistryKey('PrimeReact', 'tieredMenu')]: PrimeTieredMenu,\n [componentRegistryKey('PrimeReact', 'panelMenu')]: PrimePanelMenu,\n [componentRegistryKey('PrimeReact', 'contextMenu')]: PrimeContextMenu,\n [componentRegistryKey('PrimeReact', 'megaMenu')]: PrimeMegaMenu,\n [componentRegistryKey('PrimeReact', 'dock')]: PrimeDock,\n\n [componentRegistryKey('PrimeReact', 'message')]: PrimeMessage,\n [componentRegistryKey('PrimeReact', 'inlineMessage')]: PrimeInlineMessage,\n [componentRegistryKey('PrimeReact', 'toast')]: PrimeToast,\n\n [componentRegistryKey('PrimeReact', 'image')]: PrimeImage,\n [componentRegistryKey('PrimeReact', 'galleria')]: PrimeGalleria,\n [componentRegistryKey('PrimeReact', 'carousel')]: PrimeCarousel,\n\n [componentRegistryKey('PrimeReact', 'avatar')]: PrimeAvatar,\n [componentRegistryKey('PrimeReact', 'badge')]: PrimeBadge,\n [componentRegistryKey('PrimeReact', 'chip')]: PrimeChip,\n [componentRegistryKey('PrimeReact', 'tag')]: PrimeTag,\n [componentRegistryKey('PrimeReact', 'progressBar')]: PrimeProgressBar,\n [componentRegistryKey('PrimeReact', 'progressSpinner')]: PrimeProgressSpinner,\n [componentRegistryKey('PrimeReact', 'skeleton')]: PrimeSkeleton,\n [componentRegistryKey('PrimeReact', 'scrollTop')]: PrimeScrollTop,\n [componentRegistryKey('PrimeReact', 'blockUI')]: PrimeBlockUI,\n [componentRegistryKey('PrimeReact', 'inplace')]: PrimeInplace,\n [componentRegistryKey('PrimeReact', 'terminal')]: PrimeTerminal,\n\n [componentRegistryKey('PrimeReact', 'text')]: PrimeText,\n [componentRegistryKey('PrimeReact', 'title')]: PrimeTitle,\n [componentRegistryKey('PrimeReact', 'field')]: PrimeField,\n [componentRegistryKey('PrimeReact', 'section')]: PrimeSection,\n [componentRegistryKey('PrimeReact', 'summary')]: PrimeSummary,\n [componentRegistryKey('PrimeReact', 'action')]: PrimeAction,\n};\n"],"names":["primeReactComponents","componentRegistryKey","PrimeInputText","PrimeInputTextarea","PrimeInputNumber","PrimePassword","PrimeFloatLabel","PrimeIconField","PrimeDropdown","PrimeMultiSelect","PrimeListBox","PrimeSelectButton","PrimeCheckbox","PrimeMultiStateCheckbox","PrimeRadioButton","PrimeToggleSwitch","PrimeSlider","PrimeRating","PrimeKnob","PrimeCalendar","PrimeColorPicker","PrimeChips","PrimeAutoComplete","PrimeTreeSelect","PrimeButton","PrimeSplitButton","PrimeSpeedDial","PrimeButtonGroup","PrimeDataTable","PrimeColumn","PrimeDataView","PrimeTree","PrimeTimeline","PrimePaginator","PrimeOrderList","PrimePickList","PrimeOrganizationChart","PrimeChart","PrimeCard","PrimePanel","PrimeAccordion","PrimeFieldset","PrimeDivider","PrimeSplitter","PrimeScrollPanel","PrimeTabView","PrimeToolbar","PrimeStepper","PrimeDialog","PrimeConfirmDialog","PrimeOverlayPanel","PrimeSidebar","PrimeTooltip","PrimeMenu","PrimeMenubar","PrimeBreadcrumb","PrimeTabMenu","PrimeSteps","PrimeTieredMenu","PrimePanelMenu","PrimeContextMenu","PrimeMegaMenu","PrimeDock","PrimeMessage","PrimeInlineMessage","PrimeToast","PrimeImage","PrimeGalleria","PrimeCarousel","PrimeAvatar","PrimeBadge","PrimeChip","PrimeTag","PrimeProgressBar","PrimeProgressSpinner","PrimeSkeleton","PrimeScrollTop","PrimeBlockUI","PrimeInplace","PrimeTerminal","PrimeText","PrimeTitle","PrimeField","PrimeSection","PrimeSummary","PrimeAction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAkFA;;;;;;;;;;;;;;;;UAiBaA,oBAAAA,GAA0C;IACnD,CAACC,oBAAAA,CAAqB,YAAA,EAAc,WAAA,CAAA,GAAeC,cAAAA;IACnD,CAACD,oBAAAA,CAAqB,YAAA,EAAc,eAAA,CAAA,GAAmBE,kBAAAA;IACvD,CAACF,oBAAAA,CAAqB,YAAA,EAAc,aAAA,CAAA,GAAiBG,gBAAAA;IACrD,CAACH,oBAAAA,CAAqB,YAAA,EAAc,UAAA,CAAA,GAAcI,aAAAA;IAClD,CAACJ,oBAAAA,CAAqB,YAAA,EAAc,YAAA,CAAA,GAAgBK,eAAAA;IACpD,CAACL,oBAAAA,CAAqB,YAAA,EAAc,WAAA,CAAA,GAAeM,cAAAA;IACnD,CAACN,oBAAAA,CAAqB,YAAA,EAAc,UAAA,CAAA,GAAcO,aAAAA;IAClD,CAACP,oBAAAA,CAAqB,YAAA,EAAc,aAAA,CAAA,GAAiBQ,gBAAAA;IACrD,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A;IAElD,CAAC9E,oBAAAA,CAAqB,YAAA,EAAc,MAAA,CAAA,GAAU+E,SAAAA;IAC9C,CAAC/E,oBAAAA,CAAqB,YAAA,EAAc,OAAA,CAAA,GAAWgF,UAAAA;IAC/C,CAAChF,oBAAAA,CAAqB,YAAA,EAAc,OAAA,CAAA,GAAWiF,UAAAA;IAC/C,CAACjF,oBAAAA,CAAqB,YAAA,EAAc,SAAA,CAAA,GAAakF,YAAAA;IACjD,CAAClF,oBAAAA,CAAqB,YAAA,EAAc,SAAA,CAAA,GAAamF,YAAAA;IACjD,CAACnF,oBAAAA,CAAqB,YAAA,EAAc,QAAA,CAAA,GAAYoF;AACpD;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primeReactDescriptors.d.ts","sourceRoot":"","sources":["../../primeReactDescriptors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAqB,MAAM,qBAAqB,CAAC;AAQ7E,eAAO,MAAM,qBAAqB,EAAE,mBAAmB,EAoCtD,CAAC"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { PropertyValueType } from '@cratis/scene.model';
|
|
2
|
+
import { componentRegistryKey } from '@cratis/scene.react';
|
|
3
|
+
import { chartTypeChoices } from './chart/chartTypeChoices.js';
|
|
4
|
+
import { ChartType } from './chart/ChartType.js';
|
|
5
|
+
import 'react/jsx-runtime';
|
|
6
|
+
import 'react';
|
|
7
|
+
import './chart/resolveChartType.js';
|
|
8
|
+
|
|
9
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
10
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
11
|
+
const key = (name)=>componentRegistryKey('PrimeReact', name);
|
|
12
|
+
/** Design-time descriptors for PrimeReact controls whose authored data has structured configuration. */ const primeReactDescriptors = [
|
|
13
|
+
{
|
|
14
|
+
component: key('chart'),
|
|
15
|
+
displayName: 'Chart',
|
|
16
|
+
description: 'A Chart.js chart. Legacy numeric types are rendered without changing stored data; new documents use stable type names. The host application must install chart.js.',
|
|
17
|
+
properties: [
|
|
18
|
+
{
|
|
19
|
+
path: 'type',
|
|
20
|
+
label: 'Type',
|
|
21
|
+
group: 'Chart',
|
|
22
|
+
valueType: PropertyValueType.Enum,
|
|
23
|
+
default: ChartType.Bar,
|
|
24
|
+
choices: chartTypeChoices
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
path: 'data',
|
|
28
|
+
label: 'Data',
|
|
29
|
+
group: 'Data',
|
|
30
|
+
valueType: PropertyValueType.Json,
|
|
31
|
+
description: 'The Chart.js data object, including labels and datasets in their authored order.'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
path: 'options',
|
|
35
|
+
label: 'Options',
|
|
36
|
+
group: 'Chart',
|
|
37
|
+
valueType: PropertyValueType.Json,
|
|
38
|
+
description: 'The Chart.js options object.'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
path: 'emptyLabel',
|
|
42
|
+
label: 'No data label',
|
|
43
|
+
group: 'Accessibility',
|
|
44
|
+
valueType: PropertyValueType.String,
|
|
45
|
+
default: 'No chart data',
|
|
46
|
+
description: 'Shown instead of the chart while it has no data points. Data is never invented.'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
path: 'responsive',
|
|
50
|
+
label: 'Responsive',
|
|
51
|
+
group: 'Layout',
|
|
52
|
+
valueType: PropertyValueType.Boolean,
|
|
53
|
+
default: true
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
path: 'style',
|
|
57
|
+
label: 'Style',
|
|
58
|
+
group: 'Layout',
|
|
59
|
+
valueType: PropertyValueType.Json,
|
|
60
|
+
description: 'The CSS style object applied to the chart surface.'
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
path: 'ariaLabel',
|
|
64
|
+
label: 'Accessible name',
|
|
65
|
+
group: 'Accessibility',
|
|
66
|
+
valueType: PropertyValueType.String
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
component: key('multiStateCheckbox'),
|
|
72
|
+
displayName: 'Multi-state checkbox',
|
|
73
|
+
description: 'An accessible button that cycles through its authored states in order, showing the current state as a checkbox-style glyph.',
|
|
74
|
+
properties: [
|
|
75
|
+
{
|
|
76
|
+
path: 'value',
|
|
77
|
+
label: 'Value',
|
|
78
|
+
group: 'State',
|
|
79
|
+
valueType: PropertyValueType.Json,
|
|
80
|
+
description: 'The selected value. It may be null when the empty state is enabled.'
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
path: 'options',
|
|
84
|
+
label: 'Options',
|
|
85
|
+
group: 'State',
|
|
86
|
+
valueType: PropertyValueType.Json,
|
|
87
|
+
description: 'The ordered state options. Each may provide label, value, and icon fields.'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
path: 'optionLabel',
|
|
91
|
+
label: 'Option label field',
|
|
92
|
+
group: 'State',
|
|
93
|
+
valueType: PropertyValueType.String,
|
|
94
|
+
default: 'label'
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
path: 'optionValue',
|
|
98
|
+
label: 'Option value field',
|
|
99
|
+
group: 'State',
|
|
100
|
+
valueType: PropertyValueType.String,
|
|
101
|
+
default: 'value'
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
path: 'empty',
|
|
105
|
+
label: 'Allow empty state',
|
|
106
|
+
group: 'State',
|
|
107
|
+
valueType: PropertyValueType.Boolean,
|
|
108
|
+
default: true
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
path: 'emptyLabel',
|
|
112
|
+
label: 'Empty state label',
|
|
113
|
+
group: 'Accessibility',
|
|
114
|
+
valueType: PropertyValueType.String,
|
|
115
|
+
default: 'No selection'
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
path: 'icons',
|
|
119
|
+
label: 'Icons',
|
|
120
|
+
group: 'Appearance',
|
|
121
|
+
valueType: PropertyValueType.Json,
|
|
122
|
+
description: 'Icons aligned with the options, or keyed by their values. Each is a PrimeIcons class name or a qualified icon reference. Icons inside this value are not tracked by the icon library diagnostics; use the empty state icon where a tracked icon is needed.'
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
path: 'emptyIcon',
|
|
126
|
+
label: 'Empty state icon',
|
|
127
|
+
group: 'Appearance',
|
|
128
|
+
valueType: PropertyValueType.Icon
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
path: 'readOnly',
|
|
132
|
+
label: 'Read only',
|
|
133
|
+
group: 'Behavior',
|
|
134
|
+
valueType: PropertyValueType.Boolean,
|
|
135
|
+
default: false
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
path: 'disabled',
|
|
139
|
+
label: 'Disabled',
|
|
140
|
+
group: 'Behavior',
|
|
141
|
+
valueType: PropertyValueType.Boolean,
|
|
142
|
+
default: false
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
path: 'ariaLabel',
|
|
146
|
+
label: 'Accessible name',
|
|
147
|
+
group: 'Accessibility',
|
|
148
|
+
valueType: PropertyValueType.String
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
];
|
|
153
|
+
|
|
154
|
+
export { primeReactDescriptors };
|
|
155
|
+
//# sourceMappingURL=primeReactDescriptors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primeReactDescriptors.js","sources":["../../primeReactDescriptors.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 { ComponentDescriptor, PropertyValueType } from '@cratis/scene.model';\nimport { componentRegistryKey } from '@cratis/scene.react';\nimport { chartTypeChoices } from './chart/chartTypeChoices';\nimport { ChartType } from './chart';\n\nconst key = (name: string) => componentRegistryKey('PrimeReact', name);\n\n/** Design-time descriptors for PrimeReact controls whose authored data has structured configuration. */\nexport const primeReactDescriptors: ComponentDescriptor[] = [\n {\n component: key('chart'),\n displayName: 'Chart',\n description: 'A Chart.js chart. Legacy numeric types are rendered without changing stored data; new documents use stable type names. The host application must install chart.js.',\n properties: [\n {\n path: 'type', label: 'Type', group: 'Chart', valueType: PropertyValueType.Enum, default: ChartType.Bar,\n choices: chartTypeChoices,\n },\n { path: 'data', label: 'Data', group: 'Data', valueType: PropertyValueType.Json, description: 'The Chart.js data object, including labels and datasets in their authored order.' },\n { path: 'options', label: 'Options', group: 'Chart', valueType: PropertyValueType.Json, description: 'The Chart.js options object.' },\n { path: 'emptyLabel', label: 'No data label', group: 'Accessibility', valueType: PropertyValueType.String, default: 'No chart data', description: 'Shown instead of the chart while it has no data points. Data is never invented.' },\n { path: 'responsive', label: 'Responsive', group: 'Layout', valueType: PropertyValueType.Boolean, default: true },\n { path: 'style', label: 'Style', group: 'Layout', valueType: PropertyValueType.Json, description: 'The CSS style object applied to the chart surface.' },\n { path: 'ariaLabel', label: 'Accessible name', group: 'Accessibility', valueType: PropertyValueType.String },\n ],\n },\n {\n component: key('multiStateCheckbox'),\n displayName: 'Multi-state checkbox',\n description: 'An accessible button that cycles through its authored states in order, showing the current state as a checkbox-style glyph.',\n properties: [\n { path: 'value', label: 'Value', group: 'State', valueType: PropertyValueType.Json, description: 'The selected value. It may be null when the empty state is enabled.' },\n { path: 'options', label: 'Options', group: 'State', valueType: PropertyValueType.Json, description: 'The ordered state options. Each may provide label, value, and icon fields.' },\n { path: 'optionLabel', label: 'Option label field', group: 'State', valueType: PropertyValueType.String, default: 'label' },\n { path: 'optionValue', label: 'Option value field', group: 'State', valueType: PropertyValueType.String, default: 'value' },\n { path: 'empty', label: 'Allow empty state', group: 'State', valueType: PropertyValueType.Boolean, default: true },\n { path: 'emptyLabel', label: 'Empty state label', group: 'Accessibility', valueType: PropertyValueType.String, default: 'No selection' },\n { path: 'icons', label: 'Icons', group: 'Appearance', valueType: PropertyValueType.Json, description: 'Icons aligned with the options, or keyed by their values. Each is a PrimeIcons class name or a qualified icon reference. Icons inside this value are not tracked by the icon library diagnostics; use the empty state icon where a tracked icon is needed.' },\n { path: 'emptyIcon', label: 'Empty state icon', group: 'Appearance', valueType: PropertyValueType.Icon },\n { path: 'readOnly', label: 'Read only', group: 'Behavior', valueType: PropertyValueType.Boolean, default: false },\n { path: 'disabled', label: 'Disabled', group: 'Behavior', valueType: PropertyValueType.Boolean, default: false },\n { path: 'ariaLabel', label: 'Accessible name', group: 'Accessibility', valueType: PropertyValueType.String },\n ],\n },\n];\n"],"names":["key","name","componentRegistryKey","primeReactDescriptors","component","displayName","description","properties","path","label","group","valueType","PropertyValueType","Enum","default","ChartType","Bar","choices","chartTypeChoices","Json","String","Boolean","Icon"],"mappings":";;;;;;;;AAAA;AACA;AAOA,MAAMA,GAAAA,GAAM,CAACC,IAAAA,GAAiBC,oBAAAA,CAAqB,YAAA,EAAcD,IAAAA,CAAAA;AAEjE,yGACO,MAAME,qBAAAA,GAA+C;AACxD,IAAA;AACIC,QAAAA,SAAAA,EAAWJ,GAAAA,CAAI,OAAA,CAAA;QACfK,WAAAA,EAAa,OAAA;QACbC,WAAAA,EAAa,oKAAA;QACbC,UAAAA,EAAY;AACR,YAAA;gBACIC,IAAAA,EAAM,MAAA;gBAAQC,KAAAA,EAAO,MAAA;gBAAQC,KAAAA,EAAO,OAAA;AAASC,gBAAAA,SAAAA,EAAWC,kBAAkBC,IAAI;AAAEC,gBAAAA,OAAAA,EAASC,UAAUC,GAAG;gBACtGC,OAAAA,EAASC;AACb,aAAA;AACA,YAAA;gBAAEV,IAAAA,EAAM,MAAA;gBAAQC,KAAAA,EAAO,MAAA;gBAAQC,KAAAA,EAAO,MAAA;AAAQC,gBAAAA,SAAAA,EAAWC,kBAAkBO,IAAI;gBAAEb,WAAAA,EAAa;AAAmF,aAAA;AACjL,YAAA;gBAAEE,IAAAA,EAAM,SAAA;gBAAWC,KAAAA,EAAO,SAAA;gBAAWC,KAAAA,EAAO,OAAA;AAASC,gBAAAA,SAAAA,EAAWC,kBAAkBO,IAAI;gBAAEb,WAAAA,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AM,UAAA;gBAAYC,KAAAA,EAAO,UAAA;gBAAYC,KAAAA,EAAO,UAAA;AAAYC,gBAAAA,SAAAA,EAAWC,kBAAkBS,OAAO;gBAAEP,OAAAA,EAAS;AAAM,aAAA;AAC/G,YAAA;gBAAEN,IAAAA,EAAM,WAAA;gBAAaC,KAAAA,EAAO,iBAAA;gBAAmBC,KAAAA,EAAO,eAAA;AAAiBC,gBAAAA,SAAAA,EAAWC,kBAAkBQ;AAAO;AAC9G;AACL;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primeReactPackage.d.ts","sourceRoot":"","sources":["../../primeReactPackage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"primeReactPackage.d.ts","sourceRoot":"","sources":["../../primeReactPackage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAezD,eAAO,MAAM,yBAAyB,EAAE,YA4DvC,CAAC;AAMF,eAAO,MAAM,iBAAiB,EAAE,kBAK/B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PackageKind } from '@cratis/scene.model';
|
|
2
2
|
import { primeReactComponents } from './primeReactComponents.js';
|
|
3
|
+
import { primeReactDescriptors } from './primeReactDescriptors.js';
|
|
3
4
|
import './theme/themePresets.js';
|
|
4
5
|
import { primeReactThemes, primeReactThemeNames } from './theme/primeReactThemes.js';
|
|
5
6
|
import './theme/primeReactThemePreset.js';
|
|
@@ -45,6 +46,7 @@ import 'react';
|
|
|
45
46
|
'listBox',
|
|
46
47
|
'selectButton',
|
|
47
48
|
'checkbox',
|
|
49
|
+
'multiStateCheckbox',
|
|
48
50
|
'radioButton',
|
|
49
51
|
'toggleSwitch',
|
|
50
52
|
'slider',
|
|
@@ -69,6 +71,7 @@ import 'react';
|
|
|
69
71
|
'orderList',
|
|
70
72
|
'pickList',
|
|
71
73
|
'organizationChart',
|
|
74
|
+
'chart',
|
|
72
75
|
'card',
|
|
73
76
|
'panel',
|
|
74
77
|
'accordion',
|
|
@@ -150,6 +153,7 @@ import 'react';
|
|
|
150
153
|
*/ const primeReactPackage = {
|
|
151
154
|
manifest: primeReactPackageManifest,
|
|
152
155
|
components: primeReactComponents,
|
|
156
|
+
descriptors: primeReactDescriptors,
|
|
153
157
|
themes: primeReactThemes
|
|
154
158
|
};
|
|
155
159
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primeReactPackage.js","sources":["../../primeReactPackage.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 { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle } from '@cratis/scene.react';\nimport { primeReactComponents } from './primeReactComponents';\nimport { primeReactThemeNames, primeReactThemes } from './theme';\n\n/**\n * The `PrimeReact` package's declaration - what a `ui profile` lists by name and what a\n * `PackageDependency` refers to.\n *\n * The component list is written out rather than derived from the registry, on purpose. A manifest is\n * read by Stage's build and Studio's design-time queries *without loading a single component*, so it has\n * to stand on its own as the statement of what this package offers. Keeping it as its own list is also\n * what gives `validatePackageBundle` something real to check: two independently maintained lists that\n * must agree, rather than one list compared against itself.\n */\nexport const primeReactPackageManifest: ScenePackage = {\n name: 'PrimeReact',\n version: '11.1.0',\n kind: PackageKind.ComponentLibrary,\n\n /**\n * PrimeReact's own components need nothing from Tailwind - they are skinned by the `--p-*` custom\n * properties the active `@primeuix/themes` preset emits. The dependency is here because *this\n * package's wrappers* use Tailwind utility classes\n * for the layout around them: the row a checkbox and its label sit on, the column a radio group\n * stacks into, the grid a summary lays its pairs out in. A profile that activates this package\n * without Tailwind renders those wrappers unstyled, so declaring it is what makes the profile picker\n * offer Tailwind alongside PrimeReact instead of leaving the gap to be discovered on screen.\n */\n dependencies: [{ name: 'Tailwind' }],\n\n components: [\n 'inputText', 'inputTextarea', 'inputNumber', 'password', 'floatLabel', 'iconField', 'dropdown', 'multiSelect',\n 'listBox', 'selectButton', 'checkbox', 'radioButton', 'toggleSwitch', 'slider', 'rating', 'knob', 'calendar', 'colorPicker',\n 'chips', 'autoComplete', 'treeSelect', 'button', 'splitButton', 'speedDial', 'buttonGroup', 'dataTable', 'table',\n 'column', 'dataView', 'tree', 'timeline', 'paginator', 'orderList', 'pickList', 'organizationChart',\n 'card', 'panel', 'accordion', 'fieldset', 'divider', 'splitter', 'scrollPanel', 'tabView', 'toolbar', 'stepper', 'dialog',\n 'confirmDialog', 'overlayPanel', 'sidebar', 'tooltip', 'menu', 'menubar', 'breadcrumb', 'tabMenu', 'steps', 'tieredMenu',\n 'panelMenu', 'contextMenu', 'megaMenu', 'dock', 'message', 'inlineMessage', 'toast', 'image', 'galleria', 'carousel', 'avatar',\n 'badge', 'chip', 'tag', 'progressBar', 'progressSpinner', 'skeleton', 'scrollTop', 'blockUI', 'inplace', 'terminal', 'text',\n 'title', 'field', 'section', 'summary', 'action',\n ],\n\n /**\n * Empty, and it stays empty. A layout is an application's base navigational look - one per\n * application - and choosing it is a decision about the product, not about which widgets are\n * available. A component library supplies the vocabulary a layout is built *from*; a\n * {@link PackageKind.Blueprint} package supplies the layout itself.\n */\n layouts: [],\n\n /**\n * Empty for the same reason `layouts` is. A screen template is a reusable page shape at module,\n * feature or slice level - \"list with filters and a detail pane\" - and it is composed *out of* the\n * names declared above. Shipping one here would mean this package had opinions about how a screen is\n * arranged, which is a Blueprint's job and not a component library's.\n */\n screenTemplates: [],\n\n /**\n * Empty, as above: a dialog template is a reusable dialog shape, composed from these components by a\n * Blueprint package rather than provided by the library the components come from.\n */\n dialogTemplates: [],\n\n themes: primeReactThemeNames,\n\n displayName: 'PrimeReact',\n description: 'PrimeReact 11 components and PrimeTek\\'s @primeuix/themes presets, mapped onto Scene\\'s abstract component names.',\n module: '@cratis/scene.primereact',\n // PrimeReact 11 is PrimeTek's commercial PrimeUI, not MIT as version 10 was. The Community\n // tier is free for eligible projects but still requires a key, so an author selecting this\n // package needs to see the terms before they select it, not after a banner appears.\n license: 'PrimeUI Community / Commercial',\n licenseUrl: 'https://primeui.dev/licenses/community',\n};\n\n/**\n * The `PrimeReact` package as a loadable bundle - the manifest plus the React components and themes\n * behind the names it declares.\n */\nexport const primeReactPackage: ScenePackageBundle = {\n manifest: primeReactPackageManifest,\n components: primeReactComponents,\n themes: primeReactThemes,\n};\n"],"names":["primeReactPackageManifest","name","version","kind","PackageKind","ComponentLibrary","dependencies","components","layouts","screenTemplates","dialogTemplates","themes","primeReactThemeNames","displayName","description","module","license","licenseUrl","primeReactPackage","manifest","primeReactComponents","primeReactThemes"],"mappings":"
|
|
1
|
+
{"version":3,"file":"primeReactPackage.js","sources":["../../primeReactPackage.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 { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle } from '@cratis/scene.react';\nimport { primeReactComponents } from './primeReactComponents';\nimport { primeReactDescriptors } from './primeReactDescriptors';\nimport { primeReactThemeNames, primeReactThemes } from './theme';\n\n/**\n * The `PrimeReact` package's declaration - what a `ui profile` lists by name and what a\n * `PackageDependency` refers to.\n *\n * The component list is written out rather than derived from the registry, on purpose. A manifest is\n * read by Stage's build and Studio's design-time queries *without loading a single component*, so it has\n * to stand on its own as the statement of what this package offers. Keeping it as its own list is also\n * what gives `validatePackageBundle` something real to check: two independently maintained lists that\n * must agree, rather than one list compared against itself.\n */\nexport const primeReactPackageManifest: ScenePackage = {\n name: 'PrimeReact',\n version: '11.1.0',\n kind: PackageKind.ComponentLibrary,\n\n /**\n * PrimeReact's own components need nothing from Tailwind - they are skinned by the `--p-*` custom\n * properties the active `@primeuix/themes` preset emits. The dependency is here because *this\n * package's wrappers* use Tailwind utility classes\n * for the layout around them: the row a checkbox and its label sit on, the column a radio group\n * stacks into, the grid a summary lays its pairs out in. A profile that activates this package\n * without Tailwind renders those wrappers unstyled, so declaring it is what makes the profile picker\n * offer Tailwind alongside PrimeReact instead of leaving the gap to be discovered on screen.\n */\n dependencies: [{ name: 'Tailwind' }],\n\n components: [\n 'inputText', 'inputTextarea', 'inputNumber', 'password', 'floatLabel', 'iconField', 'dropdown', 'multiSelect',\n 'listBox', 'selectButton', 'checkbox', 'multiStateCheckbox', 'radioButton', 'toggleSwitch', 'slider', 'rating', 'knob', 'calendar', 'colorPicker',\n 'chips', 'autoComplete', 'treeSelect', 'button', 'splitButton', 'speedDial', 'buttonGroup', 'dataTable', 'table',\n 'column', 'dataView', 'tree', 'timeline', 'paginator', 'orderList', 'pickList', 'organizationChart', 'chart',\n 'card', 'panel', 'accordion', 'fieldset', 'divider', 'splitter', 'scrollPanel', 'tabView', 'toolbar', 'stepper', 'dialog',\n 'confirmDialog', 'overlayPanel', 'sidebar', 'tooltip', 'menu', 'menubar', 'breadcrumb', 'tabMenu', 'steps', 'tieredMenu',\n 'panelMenu', 'contextMenu', 'megaMenu', 'dock', 'message', 'inlineMessage', 'toast', 'image', 'galleria', 'carousel', 'avatar',\n 'badge', 'chip', 'tag', 'progressBar', 'progressSpinner', 'skeleton', 'scrollTop', 'blockUI', 'inplace', 'terminal', 'text',\n 'title', 'field', 'section', 'summary', 'action',\n ],\n\n /**\n * Empty, and it stays empty. A layout is an application's base navigational look - one per\n * application - and choosing it is a decision about the product, not about which widgets are\n * available. A component library supplies the vocabulary a layout is built *from*; a\n * {@link PackageKind.Blueprint} package supplies the layout itself.\n */\n layouts: [],\n\n /**\n * Empty for the same reason `layouts` is. A screen template is a reusable page shape at module,\n * feature or slice level - \"list with filters and a detail pane\" - and it is composed *out of* the\n * names declared above. Shipping one here would mean this package had opinions about how a screen is\n * arranged, which is a Blueprint's job and not a component library's.\n */\n screenTemplates: [],\n\n /**\n * Empty, as above: a dialog template is a reusable dialog shape, composed from these components by a\n * Blueprint package rather than provided by the library the components come from.\n */\n dialogTemplates: [],\n\n themes: primeReactThemeNames,\n\n displayName: 'PrimeReact',\n description: 'PrimeReact 11 components and PrimeTek\\'s @primeuix/themes presets, mapped onto Scene\\'s abstract component names.',\n module: '@cratis/scene.primereact',\n // PrimeReact 11 is PrimeTek's commercial PrimeUI, not MIT as version 10 was. The Community\n // tier is free for eligible projects but still requires a key, so an author selecting this\n // package needs to see the terms before they select it, not after a banner appears.\n license: 'PrimeUI Community / Commercial',\n licenseUrl: 'https://primeui.dev/licenses/community',\n};\n\n/**\n * The `PrimeReact` package as a loadable bundle - the manifest plus the React components and themes\n * behind the names it declares.\n */\nexport const primeReactPackage: ScenePackageBundle = {\n manifest: primeReactPackageManifest,\n components: primeReactComponents,\n descriptors: primeReactDescriptors,\n themes: primeReactThemes,\n};\n"],"names":["primeReactPackageManifest","name","version","kind","PackageKind","ComponentLibrary","dependencies","components","layouts","screenTemplates","dialogTemplates","themes","primeReactThemeNames","displayName","description","module","license","licenseUrl","primeReactPackage","manifest","primeReactComponents","descriptors","primeReactDescriptors","primeReactThemes"],"mappings":";;;;;;;;AAAA;AACA;AAQA;;;;;;;;;UAUaA,yBAAAA,GAA0C;IACnDC,IAAAA,EAAM,YAAA;IACNC,OAAAA,EAAS,QAAA;AACTC,IAAAA,IAAAA,EAAMC,YAAYC,gBAAgB;AAElC;;;;;;;;AAQC,QACDC,YAAAA,EAAc;AAAC,QAAA;YAAEL,IAAAA,EAAM;AAAW;AAAE,KAAA;IAEpCM,UAAAA,EAAY;AACR,QAAA,WAAA;AAAa,QAAA,eAAA;AAAiB,QAAA,aAAA;AAAe,QAAA,UAAA;AAAY,QAAA,YAAA;AAAc,QAAA,WAAA;AAAa,QAAA,UAAA;AAAY,QAAA,aAAA;AAChG,QAAA,SAAA;AAAW,QAAA,cAAA;AAAgB,QAAA,UAAA;AAAY,QAAA,oBAAA;AAAsB,QAA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AAA;AACrH,QAAA,OAAA;AAAS,QAAA,OAAA;AAAS,QAAA,SAAA;AAAW,QAAA,SAAA;AAAW,QAAA;AAC3C,KAAA;AAED;;;;;AAKC,QACDC,SAAS,EAAE;AAEX;;;;;AAKC,QACDC,iBAAiB,EAAE;AAEnB;;;AAGC,QACDC,iBAAiB,EAAE;IAEnBC,MAAAA,EAAQC,oBAAAA;IAERC,WAAAA,EAAa,YAAA;IACbC,WAAAA,EAAa,mHAAA;IACbC,MAAAA,EAAQ,0BAAA;;;;IAIRC,OAAAA,EAAS,gCAAA;IACTC,UAAAA,EAAY;AAChB;AAEA;;;UAIaC,iBAAAA,GAAwC;IACjDC,QAAAA,EAAUnB,yBAAAA;IACVO,UAAAA,EAAYa,oBAAAA;IACZC,WAAAA,EAAaC,qBAAAA;IACbX,MAAAA,EAAQY;AACZ;;"}
|
package/dist/esm/properties.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export declare function numberProperty(element: SceneElement, name: string, fall
|
|
|
10
10
|
export declare function arrayProperty(element: SceneElement, name: string): unknown[];
|
|
11
11
|
export declare function stringArrayProperty(element: SceneElement, name: string): string[];
|
|
12
12
|
export declare function recordArrayProperty(element: SceneElement, name: string): Record<string, unknown>[];
|
|
13
|
+
export declare function recordProperty(element: SceneElement, name: string): Record<string, unknown> | undefined;
|
|
13
14
|
export declare function optionsProperty(element: SceneElement, name: string): SelectOption[];
|
|
14
15
|
export declare function severityProperty(element: SceneElement, name: string): PrimeSeverity | undefined;
|
|
15
16
|
export declare function severityProperty(element: SceneElement, name: string, fallback: PrimeSeverity): PrimeSeverity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../properties.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CA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AgB,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAKvG;AAcD,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,EAAE,CAiBnF;AAoBD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC;AACjG,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,aAAa,CAAC"}
|
package/dist/esm/properties.js
CHANGED
|
@@ -56,6 +56,16 @@ function numberProperty(element, name, fallback) {
|
|
|
56
56
|
*/ function recordArrayProperty(element, name) {
|
|
57
57
|
return arrayProperty(element, name).filter((entry)=>typeof entry === 'object' && entry !== undefined && entry !== null && !Array.isArray(entry));
|
|
58
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Reads one structured value off a Scene element.
|
|
61
|
+
*
|
|
62
|
+
* Chart data and options intentionally stay as authored objects: these adapters pass their vocabulary to
|
|
63
|
+
* their underlying library instead of choosing a partial Scene-owned chart schema that would discard
|
|
64
|
+
* future Chart.js fields during a legacy migration.
|
|
65
|
+
*/ function recordProperty(element, name) {
|
|
66
|
+
const value = element.properties[name];
|
|
67
|
+
return typeof value === 'object' && value !== undefined && value !== null && !Array.isArray(value) ? value : undefined;
|
|
68
|
+
}
|
|
59
69
|
/**
|
|
60
70
|
* Reads a selection component's options off a Scene element, normalizing both shapes a screen may use.
|
|
61
71
|
*
|
|
@@ -94,5 +104,5 @@ function severityProperty(element, name, fallback) {
|
|
|
94
104
|
return severities.includes(translated) ? translated : fallback;
|
|
95
105
|
}
|
|
96
106
|
|
|
97
|
-
export { arrayProperty, booleanProperty, numberProperty, optionsProperty, recordArrayProperty, severityProperty, stringArrayProperty, stringProperty };
|
|
107
|
+
export { arrayProperty, booleanProperty, numberProperty, optionsProperty, recordArrayProperty, recordProperty, severityProperty, stringArrayProperty, stringProperty };
|
|
98
108
|
//# sourceMappingURL=properties.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"properties.js","sources":["../../properties.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 { SceneElement } from '@cratis/scene.model';\nimport { PrimeSeverity } from './PrimeSeverity';\nimport { SelectOption } from './SelectOption';\n\n/** Every severity PrimeReact 11 knows, so an unrecognized one can fall back rather than reach a component. */\nconst severities: PrimeSeverity[] = ['secondary', 'info', 'success', 'warn', 'danger', 'help', 'contrast'];\n\n/**\n * Reads a string configuration value off a Scene element.\n *\n * `SceneElement.properties` is `Record<string, unknown>` because a screen's properties come from\n * authored model data, not from a compiler that knows this package's expectations. Every adapter\n * therefore has to narrow before it can use a value, and doing that with a cast would defeat the point -\n * a mistyped property would sail through and blow up inside PrimeReact instead of quietly falling back\n * here. These helpers are the single narrowing point, so a wrong type behaves exactly like an absent\n * one everywhere.\n *\n * @param element The element whose properties to read.\n * @param name The property name.\n * @param fallback The value to use when the property is missing or is not a string.\n * @returns The string value, or `fallback` (`undefined` when none was given).\n */\nexport function stringProperty(element: SceneElement, name: string): string | undefined;\nexport function stringProperty(element: SceneElement, name: string, fallback: string): string;\nexport function stringProperty(element: SceneElement, name: string, fallback?: string): string | undefined {\n const value = element.properties[name];\n return typeof value === 'string' ? value : fallback;\n}\n\n/**\n * Reads a boolean configuration value off a Scene element.\n *\n * @param element The element whose properties to read.\n * @param name The property name.\n * @param fallback The value to use when the property is missing or is not a boolean.\n * @returns The boolean value, or `fallback` (`undefined` when none was given).\n */\nexport function booleanProperty(element: SceneElement, name: string): boolean | undefined;\nexport function booleanProperty(element: SceneElement, name: string, fallback: boolean): boolean;\nexport function booleanProperty(element: SceneElement, name: string, fallback?: boolean): boolean | undefined {\n const value = element.properties[name];\n return typeof value === 'boolean' ? value : fallback;\n}\n\n/**\n * Reads a numeric configuration value off a Scene element.\n *\n * `NaN` is rejected alongside non-numbers: it is a number by `typeof` but never a usable size, count or\n * bound, and letting it through would surface as an unexplained blank component rather than a fallback.\n *\n * @param element The element whose properties to read.\n * @param name The property name.\n * @param fallback The value to use when the property is missing or is not a usable number.\n * @returns The numeric value, or `fallback` (`undefined` when none was given).\n */\nexport function numberProperty(element: SceneElement, name: string): number | undefined;\nexport function numberProperty(element: SceneElement, name: string, fallback: number): number;\nexport function numberProperty(element: SceneElement, name: string, fallback?: number): number | undefined {\n const value = element.properties[name];\n return typeof value === 'number' && !Number.isNaN(value) ? value : fallback;\n}\n\n/**\n * Reads an array configuration value off a Scene element, as raw entries.\n *\n * Always returns an array - an absent or wrongly typed property becomes an empty one - because every\n * caller is about to map over it, and a component rendering nothing is a far better failure than one\n * throwing on `undefined.map`.\n *\n * @param element The element whose properties to read.\n * @param name The property name.\n * @returns The entries, or an empty array when the property is missing or is not an array.\n */\nexport function arrayProperty(element: SceneElement, name: string): unknown[] {\n const value = element.properties[name];\n return Array.isArray(value) ? value : [];\n}\n\n/**\n * Reads an array of strings off a Scene element, dropping any entry that is not one.\n *\n * @param element The element whose properties to read.\n * @param name The property name.\n * @returns The string entries, in order.\n */\nexport function stringArrayProperty(element: SceneElement, name: string): string[] {\n return arrayProperty(element, name).filter((entry): entry is string => typeof entry === 'string');\n}\n\n/**\n * Reads an array of objects off a Scene element, dropping any entry that is not one.\n *\n * This is the shape row data, column definitions and menu items all arrive in, so it is the common\n * bottom step every structured reader in this package builds on.\n *\n * @param element The element whose properties to read.\n * @param name The property name.\n * @returns The object entries, in order.\n */\nexport function recordArrayProperty(element: SceneElement, name: string): Record<string, unknown>[] {\n return arrayProperty(element, name).filter(\n (entry): entry is Record<string, unknown> => typeof entry === 'object' && entry !== undefined && entry !== null && !Array.isArray(entry)\n );\n}\n\n/**\n * Reads a selection component's options off a Scene element, normalizing both shapes a screen may use.\n *\n * A screen written by hand tends to say `options: ['Draft', 'Published']`; one generated from a model\n * says `options: [{ label: 'Draft', value: 'draft' }]`. Both are reasonable, so both are accepted and\n * flattened to {@link SelectOption} - an entry with only a label uses that label as its value, which is\n * exactly what the shorthand means.\n *\n * @param element The element whose properties to read.\n * @param name The property name.\n * @returns The normalized options, in order, skipping entries that carry no usable label.\n */\nexport function optionsProperty(element: SceneElement, name: string): SelectOption[] {\n const options: SelectOption[] = [];\n for (const entry of arrayProperty(element, name)) {\n if (typeof entry === 'string') {\n options.push({ label: entry, value: 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 label = typeof record.label === 'string' ? record.label : undefined;\n const value = typeof record.value === 'string' ? record.value : label;\n if (label !== undefined && value !== undefined) options.push({ label, value });\n }\n\n return options;\n}\n\n/**\n * Reads a severity off a Scene element, in the vocabulary PrimeReact 11 uses.\n *\n * This exists because PrimeReact renamed one severity between v10 and v11 - `warning` became `warn` - and\n * the rename is silent in the worst way. The v11 prop types are string-literal unions, so an unchanged\n * `warning` does not fail to compile when it arrives through `stringProperty`; it simply falls through to\n * the default color, and a screen authored against the old vocabulary loses its warning styling without\n * anything reporting a problem.\n *\n * Six adapters need that translation, which is five too many to leave copied. Putting it here also keeps\n * the promise the rest of this file makes: properties are narrowed in exactly one place, so an\n * unrecognized value behaves the same way everywhere - like an absent one, rather than like a broken one.\n *\n * @param element The element whose properties to read.\n * @param name The property name, `severity` for every current caller.\n * @param fallback The severity to use when the property is missing or is not one PrimeReact knows.\n * @returns The severity, or `fallback` (`undefined` when none was given).\n */\nexport function severityProperty(element: SceneElement, name: string): PrimeSeverity | undefined;\nexport function severityProperty(element: SceneElement, name: string, fallback: PrimeSeverity): PrimeSeverity;\nexport function severityProperty(element: SceneElement, name: string, fallback?: PrimeSeverity): PrimeSeverity | undefined {\n const authored = stringProperty(element, name);\n const translated = authored === 'warning' ? 'warn' : authored;\n return severities.includes(translated as PrimeSeverity) ? (translated as PrimeSeverity) : fallback;\n}\n"],"names":["severities","stringProperty","element","name","fallback","value","properties","booleanProperty","numberProperty","Number","isNaN","arrayProperty","Array","isArray","stringArrayProperty","filter","entry","recordArrayProperty","undefined","optionsProperty","options","push","label","record","severityProperty","authored","translated","includes"],"mappings":"AAAA;AACA;AAMA,+GACA,MAAMA,UAAAA,GAA8B;AAAC,IAAA,WAAA;AAAa,IAAA,MAAA;AAAQ,IAAA,SAAA;AAAW,IAAA,MAAA;AAAQ,IAAA,QAAA;AAAU,IAAA,MAAA;AAAQ,IAAA;AAAW,CAAA;AAmBnG,SAASC,cAAAA,CAAeC,OAAqB,EAAEC,IAAY,EAAEC,QAAiB,EAAA;AACjF,IAAA,MAAMC,KAAAA,GAAQH,OAAAA,CAAQI,UAAU,CAACH,IAAAA,CAAK;IACtC,OAAO,OAAOE,KAAAA,KAAU,QAAA,GAAWA,KAAAA,GAAQD,QAAAA;AAC/C;AAYO,SAASG,eAAAA,CAAgBL,OAAqB,EAAEC,IAAY,EAAEC,QAAkB,EAAA;AACnF,IAAA,MAAMC,KAAAA,GAAQH,OAAAA,CAAQI,UAAU,CAACH,IAAAA,CAAK;IACtC,OAAO,OAAOE,KAAAA,KAAU,SAAA,GAAYA,KAAAA,GAAQD,QAAAA;AAChD;AAeO,SAASI,cAAAA,CAAeN,OAAqB,EAAEC,IAAY,EAAEC,QAAiB,EAAA;AACjF,IAAA,MAAMC,KAAAA,GAAQH,OAAAA,CAAQI,UAAU,CAACH,IAAAA,CAAK;IACtC,OAAO,OAAOE,UAAU,QAAA,IAAY,CAACI,OAAOC,KAAK,CAACL,SAASA,KAAAA,GAAQD,QAAAA;AACvE;AAEA;;;;;;;;;;AAUC,IACM,SAASO,aAAAA,CAAcT,OAAqB,EAAEC,IAAY,EAAA;AAC7D,IAAA,MAAME,KAAAA,GAAQH,OAAAA,CAAQI,UAAU,CAACH,IAAAA,CAAK;AACtC,IAAA,OAAOS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,GAAGJ,SAAAA;QAChE,MAAMb,KAAAA,GAAQ,OAAOkB,MAAAA,CAAOlB,KAAK,KAAK,QAAA,GAAWkB,MAAAA,CAAOlB,KAAK,GAAGiB,KAAAA;AAChE,QAAA,IAAIA,UAAUJ,SAAAA,IAAab,KAAAA,KAAUa,SAAAA,EAAWE,OAAAA,CAAQC,IAAI,CAAC;AAAEC,YAAAA,KAAAA;AAAOjB,YAAAA;AAAM,SAAA,CAAA;AAChF,IAAA;IAEA,OAAOe,OAAAA;AACX;AAsBO,SAASI,gBAAAA,CAAiBtB,OAAqB,EAAEC,IAAY,EAAEC,QAAwB,EAAA;IAC1F,MAAMqB,QAAAA,GAAWxB,eAAeC,OAAAA,EAASC,IAAAA,CAAAA;IACzC,MAAMuB,UAAAA,GAAaD,QAAAA,KAAa,SAAA,GAAY,MAAA,GAASA,QAAAA;AACrD,IAAA,OAAOzB,UAAAA,CAAW2B,QAAQ,CAACD,UAAAA,CAAAA,GAAgCA,UAAAA,GAA+BtB,QAAAA;AAC9F;;"}
|
|
1
|
+
{"version":3,"file":"properties.js","sources":["../../properties.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 { SceneElement } from '@cratis/scene.model';\nimport { PrimeSeverity } from './PrimeSeverity';\nimport { SelectOption } from './SelectOption';\n\n/** Every severity PrimeReact 11 knows, so an unrecognized one can fall back rather than reach a component. */\nconst severities: PrimeSeverity[] = ['secondary', 'info', 'success', 'warn', 'danger', 'help', 'contrast'];\n\n/**\n * Reads a string configuration value off a Scene element.\n *\n * `SceneElement.properties` is `Record<string, unknown>` because a screen's properties come from\n * authored model data, not from a compiler that knows this package's expectations. Every adapter\n * therefore has to narrow before it can use a value, and doing that with a cast would defeat the point -\n * a mistyped property would sail through and blow up inside PrimeReact instead of quietly falling back\n * here. These helpers are the single narrowing point, so a wrong type behaves exactly like an absent\n * one everywhere.\n *\n * @param element The element whose properties to read.\n * @param name The property name.\n * @param fallback The value to use when the property is missing or is not a string.\n * @returns The string value, or `fallback` (`undefined` when none was given).\n */\nexport function stringProperty(element: SceneElement, name: string): string | undefined;\nexport function stringProperty(element: SceneElement, name: string, fallback: string): string;\nexport function stringProperty(element: SceneElement, name: string, fallback?: string): string | undefined {\n const value = element.properties[name];\n return typeof value === 'string' ? value : fallback;\n}\n\n/**\n * Reads a boolean configuration value off a Scene element.\n *\n * @param element The element whose properties to read.\n * @param name The property name.\n * @param fallback The value to use when the property is missing or is not a boolean.\n * @returns The boolean value, or `fallback` (`undefined` when none was given).\n */\nexport function booleanProperty(element: SceneElement, name: string): boolean | undefined;\nexport function booleanProperty(element: SceneElement, name: string, fallback: boolean): boolean;\nexport function booleanProperty(element: SceneElement, name: string, fallback?: boolean): boolean | undefined {\n const value = element.properties[name];\n return typeof value === 'boolean' ? value : fallback;\n}\n\n/**\n * Reads a numeric configuration value off a Scene element.\n *\n * `NaN` is rejected alongside non-numbers: it is a number by `typeof` but never a usable size, count or\n * bound, and letting it through would surface as an unexplained blank component rather than a fallback.\n *\n * @param element The element whose properties to read.\n * @param name The property name.\n * @param fallback The value to use when the property is missing or is not a usable number.\n * @returns The numeric value, or `fallback` (`undefined` when none was given).\n */\nexport function numberProperty(element: SceneElement, name: string): number | undefined;\nexport function numberProperty(element: SceneElement, name: string, fallback: number): number;\nexport function numberProperty(element: SceneElement, name: string, fallback?: number): number | undefined {\n const value = element.properties[name];\n return typeof value === 'number' && !Number.isNaN(value) ? value : fallback;\n}\n\n/**\n * Reads an array configuration value off a Scene element, as raw entries.\n *\n * Always returns an array - an absent or wrongly typed property becomes an empty one - because every\n * caller is about to map over it, and a component rendering nothing is a far better failure than one\n * throwing on `undefined.map`.\n *\n * @param element The element whose properties to read.\n * @param name The property name.\n * @returns The entries, or an empty array when the property is missing or is not an array.\n */\nexport function arrayProperty(element: SceneElement, name: string): unknown[] {\n const value = element.properties[name];\n return Array.isArray(value) ? value : [];\n}\n\n/**\n * Reads an array of strings off a Scene element, dropping any entry that is not one.\n *\n * @param element The element whose properties to read.\n * @param name The property name.\n * @returns The string entries, in order.\n */\nexport function stringArrayProperty(element: SceneElement, name: string): string[] {\n return arrayProperty(element, name).filter((entry): entry is string => typeof entry === 'string');\n}\n\n/**\n * Reads an array of objects off a Scene element, dropping any entry that is not one.\n *\n * This is the shape row data, column definitions and menu items all arrive in, so it is the common\n * bottom step every structured reader in this package builds on.\n *\n * @param element The element whose properties to read.\n * @param name The property name.\n * @returns The object entries, in order.\n */\nexport function recordArrayProperty(element: SceneElement, name: string): Record<string, unknown>[] {\n return arrayProperty(element, name).filter(\n (entry): entry is Record<string, unknown> => typeof entry === 'object' && entry !== undefined && entry !== null && !Array.isArray(entry)\n );\n}\n\n/**\n * Reads one structured value off a Scene element.\n *\n * Chart data and options intentionally stay as authored objects: these adapters pass their vocabulary to\n * their underlying library instead of choosing a partial Scene-owned chart schema that would discard\n * future Chart.js fields during a legacy migration.\n */\nexport function recordProperty(element: SceneElement, name: string): Record<string, unknown> | undefined {\n const value = element.properties[name];\n return typeof value === 'object' && value !== undefined && value !== null && !Array.isArray(value)\n ? value as Record<string, unknown>\n : undefined;\n}\n\n/**\n * Reads a selection component's options off a Scene element, normalizing both shapes a screen may use.\n *\n * A screen written by hand tends to say `options: ['Draft', 'Published']`; one generated from a model\n * says `options: [{ label: 'Draft', value: 'draft' }]`. Both are reasonable, so both are accepted and\n * flattened to {@link SelectOption} - an entry with only a label uses that label as its value, which is\n * exactly what the shorthand means.\n *\n * @param element The element whose properties to read.\n * @param name The property name.\n * @returns The normalized options, in order, skipping entries that carry no usable label.\n */\nexport function optionsProperty(element: SceneElement, name: string): SelectOption[] {\n const options: SelectOption[] = [];\n for (const entry of arrayProperty(element, name)) {\n if (typeof entry === 'string') {\n options.push({ label: entry, value: 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 label = typeof record.label === 'string' ? record.label : undefined;\n const value = typeof record.value === 'string' ? record.value : label;\n if (label !== undefined && value !== undefined) options.push({ label, value });\n }\n\n return options;\n}\n\n/**\n * Reads a severity off a Scene element, in the vocabulary PrimeReact 11 uses.\n *\n * This exists because PrimeReact renamed one severity between v10 and v11 - `warning` became `warn` - and\n * the rename is silent in the worst way. The v11 prop types are string-literal unions, so an unchanged\n * `warning` does not fail to compile when it arrives through `stringProperty`; it simply falls through to\n * the default color, and a screen authored against the old vocabulary loses its warning styling without\n * anything reporting a problem.\n *\n * Six adapters need that translation, which is five too many to leave copied. Putting it here also keeps\n * the promise the rest of this file makes: properties are narrowed in exactly one place, so an\n * unrecognized value behaves the same way everywhere - like an absent one, rather than like a broken one.\n *\n * @param element The element whose properties to read.\n * @param name The property name, `severity` for every current caller.\n * @param fallback The severity to use when the property is missing or is not one PrimeReact knows.\n * @returns The severity, or `fallback` (`undefined` when none was given).\n */\nexport function severityProperty(element: SceneElement, name: string): PrimeSeverity | undefined;\nexport function severityProperty(element: SceneElement, name: string, fallback: PrimeSeverity): PrimeSeverity;\nexport function severityProperty(element: SceneElement, name: string, fallback?: PrimeSeverity): PrimeSeverity | undefined {\n const authored = stringProperty(element, name);\n const translated = authored === 'warning' ? 'warn' : authored;\n return severities.includes(translated as PrimeSeverity) ? (translated as PrimeSeverity) : fallback;\n}\n"],"names":["severities","stringProperty","element","name","fallback","value","properties","booleanProperty","numberProperty","Number","isNaN","arrayProperty","Array","isArray","stringArrayProperty","filter","entry","recordArrayProperty","undefined","recordProperty","optionsProperty","options","push","label","record","severityProperty","authored","translated","includes"],"mappings":"AAAA;AACA;AAMA,+GACA,MAAMA,UAAAA,GAA8B;AAAC,IAAA,WAAA;AAAa,IAAA,MAAA;AAAQ,IAAA,SAAA;AAAW,IAAA,MAAA;AAAQ,IAAA,QAAA;AAAU,IAAA,MAAA;AAAQ,IAAA;AAAW,CAAA;AAmBnG,SAASC,cAAAA,CAAeC,OAAqB,EAAEC,IAAY,EAAEC,QAAiB,EAAA;AAC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AA,IAAIA,UAAUL,SAAAA,IAAab,KAAAA,KAAUa,SAAAA,EAAWG,OAAAA,CAAQC,IAAI,CAAC;AAAEC,YAAAA,KAAAA;AAAOlB,YAAAA;AAAM,SAAA,CAAA;AAChF,IAAA;IAEA,OAAOgB,OAAAA;AACX;AAsBO,SAASI,gBAAAA,CAAiBvB,OAAqB,EAAEC,IAAY,EAAEC,QAAwB,EAAA;IAC1F,MAAMsB,QAAAA,GAAWzB,eAAeC,OAAAA,EAASC,IAAAA,CAAAA;IACzC,MAAMwB,UAAAA,GAAaD,QAAAA,KAAa,SAAA,GAAY,MAAA,GAASA,QAAAA;AACrD,IAAA,OAAO1B,UAAAA,CAAW4B,QAAQ,CAACD,UAAAA,CAAAA,GAAgCA,UAAAA,GAA+BvB,QAAAA;AAC9F;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structurallyEqual.d.ts","sourceRoot":"","sources":["../../structurallyEqual.ts"],"names":[],"mappings":"AAWA,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAaxE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/**
|
|
4
|
+
* Compares values that can survive a Scene document serialization round trip.
|
|
5
|
+
*
|
|
6
|
+
* Authored data (chart datasets, option values, current values) arrives as plain JSON. Every edit to a
|
|
7
|
+
* Scene document clones the whole document, so the same data gets a new object identity with no change in
|
|
8
|
+
* content; reference equality would treat each unrelated edit as a change. Primitives compare with
|
|
9
|
+
* `Object.is`, so `0` and `-0`, or `NaN` and `NaN`, are told apart exactly as `Object.is` does.
|
|
10
|
+
*/ function structurallyEqual(left, right) {
|
|
11
|
+
if (Object.is(left, right)) return true;
|
|
12
|
+
if (Array.isArray(left) || Array.isArray(right)) {
|
|
13
|
+
return Array.isArray(left) && Array.isArray(right) && left.length === right.length && left.every((value, index)=>structurallyEqual(value, right[index]));
|
|
14
|
+
}
|
|
15
|
+
if (!isRecord(left) || !isRecord(right)) return false;
|
|
16
|
+
const leftKeys = Object.keys(left).sort();
|
|
17
|
+
const rightKeys = Object.keys(right).sort();
|
|
18
|
+
return leftKeys.length === rightKeys.length && leftKeys.every((key, index)=>key === rightKeys[index] && structurallyEqual(left[key], right[key]));
|
|
19
|
+
}
|
|
20
|
+
function isRecord(value) {
|
|
21
|
+
return value !== null && typeof value === 'object';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { structurallyEqual };
|
|
25
|
+
//# sourceMappingURL=structurallyEqual.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structurallyEqual.js","sources":["../../structurallyEqual.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * Compares values that can survive a Scene document serialization round trip.\n *\n * Authored data (chart datasets, option values, current values) arrives as plain JSON. Every edit to a\n * Scene document clones the whole document, so the same data gets a new object identity with no change in\n * content; reference equality would treat each unrelated edit as a change. Primitives compare with\n * `Object.is`, so `0` and `-0`, or `NaN` and `NaN`, are told apart exactly as `Object.is` does.\n */\nexport function structurallyEqual(left: unknown, right: unknown): boolean {\n if (Object.is(left, right)) return true;\n if (Array.isArray(left) || Array.isArray(right)) {\n return Array.isArray(left) && Array.isArray(right)\n && left.length === right.length\n && left.every((value, index) => structurallyEqual(value, right[index]));\n }\n\n if (!isRecord(left) || !isRecord(right)) return false;\n const leftKeys = Object.keys(left).sort();\n const rightKeys = Object.keys(right).sort();\n return leftKeys.length === rightKeys.length\n && leftKeys.every((key, index) => key === rightKeys[index] && structurallyEqual(left[key], right[key]));\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object';\n}\n"],"names":["structurallyEqual","left","right","Object","is","Array","isArray","length","every","value","index","isRecord","leftKeys","keys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