@persona/design-system 0.10.9 → 0.10.11
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/CHANGELOG.md +43 -0
- package/dist/{Action-CHWYwpYR.d.mts → Action-sLO73eKq.d.mts} +2 -2
- package/dist/Action.d.mts +1 -1
- package/dist/AdvancedFilterRuleRow.d.mts +2 -2
- package/dist/AdvancedFilterRulesPopover.d.mts +2 -2
- package/dist/ArrayValueControl.d.mts +1 -1
- package/dist/Attribute.d.mts +2 -2
- package/dist/{Badge-BCdsVKuj.mjs → Badge-DZq6ByIU.mjs} +2 -2
- package/dist/{Badge-BCdsVKuj.mjs.map → Badge-DZq6ByIU.mjs.map} +1 -1
- package/dist/BooleanValueControl.d.mts +1 -1
- package/dist/{Breadcrumbs-CMf3Uvow.mjs → Breadcrumbs-DpsNZWF9.mjs} +9 -9
- package/dist/Breadcrumbs-DpsNZWF9.mjs.map +1 -0
- package/dist/{Button-DjD8QxcY.d.mts → Button-C4a4BTjL.d.mts} +2 -2
- package/dist/Button.d.mts +1 -1
- package/dist/CalendarBase.d.mts +1 -1
- package/dist/{Card-DiUHtYg_.d.mts → Card-CPV4_mHk.d.mts} +4 -4
- package/dist/Card.d.mts +1 -1
- package/dist/Card2.d.mts +1 -1
- package/dist/CardGrouping.d.mts +1 -1
- package/dist/{CardV2-ACI5RIzF.mjs → CardV2-DCoDfEvr.mjs} +26 -13
- package/dist/CardV2-DCoDfEvr.mjs.map +1 -0
- package/dist/ChartFrame.d.mts +61 -0
- package/dist/ChartLegend.d.mts +60 -0
- package/dist/ChartPopover.d.mts +155 -0
- package/dist/{Checkbox-Dr4LMKHV.mjs → Checkbox-C3z7UUSC.mjs} +8 -8
- package/dist/Checkbox-C3z7UUSC.mjs.map +1 -0
- package/dist/{CheckboxGroupField-DnVqlpwi.d.mts → CheckboxGroupField-BT87OVOF.d.mts} +2 -2
- package/dist/CheckboxGroupField.d.mts +1 -1
- package/dist/ChoicesValueControl.d.mts +1 -1
- package/dist/{Combobox-Gb_j1dg6.mjs → Combobox-BkK_tosd.mjs} +300 -116
- package/dist/Combobox-BkK_tosd.mjs.map +1 -0
- package/dist/Combobox-aOJDTjzC.d.mts +12 -0
- package/dist/Combobox.d.mts +3 -3
- package/dist/{ComboboxBase-Mb8HyeAI.d.mts → ComboboxBase-Brgv5nxk.d.mts} +65 -25
- package/dist/ComboboxBase.d.mts +2 -2
- package/dist/{ComboboxMultiSelect-C87lkXr7.d.mts → ComboboxMultiSelect-DJyAv0Eg.d.mts} +10 -6
- package/dist/ComboboxMultiSelect.d.mts +2 -2
- package/dist/{ComboboxSingleSelect-CIYakRW5.d.mts → ComboboxSingleSelect-CP8-HLKl.d.mts} +8 -6
- package/dist/ComboboxSingleSelect.d.mts +2 -2
- package/dist/{CompactBar-BLZZWtIE.d.mts → CompactBar-B0LhjrYV.d.mts} +2 -2
- package/dist/CompactBar.d.mts +1 -1
- package/dist/{ConfigFormGroup-BCTWCws5.mjs → ConfigFormGroup-DAUqAhJW.mjs} +2 -2
- package/dist/{ConfigFormGroup-BCTWCws5.mjs.map → ConfigFormGroup-DAUqAhJW.mjs.map} +1 -1
- package/dist/{DataTable-Bf1WDY0z.d.mts → DataTable-CSl5Jn3E.d.mts} +18 -8
- package/dist/{DataTable-CIZJ1vO8.mjs → DataTable-DiwzhNMt.mjs} +41 -28
- package/dist/DataTable-DiwzhNMt.mjs.map +1 -0
- package/dist/DataTable.d.mts +1 -1
- package/dist/{DatePicker-C9redLBr.mjs → DatePicker-BK7ioKBm.mjs} +410 -410
- package/dist/DatePicker-BK7ioKBm.mjs.map +1 -0
- package/dist/DateRangeValueControl.d.mts +1 -1
- package/dist/DateValueControl.d.mts +1 -1
- package/dist/{DropdownButton-DpLG-cIj.mjs → DropdownButton-Dp-MZ5tA.mjs} +3 -3
- package/dist/{DropdownButton-DpLG-cIj.mjs.map → DropdownButton-Dp-MZ5tA.mjs.map} +1 -1
- package/dist/DropdownButton.d.mts +2 -2
- package/dist/{DropdownMenu-DVxXQDRC.d.mts → DropdownMenu-BnHPeHOm.d.mts} +3 -3
- package/dist/{DropdownMenu-c8XK2Lr4.mjs → DropdownMenu-jJSHQaih.mjs} +4 -2
- package/dist/DropdownMenu-jJSHQaih.mjs.map +1 -0
- package/dist/DropdownMenu.d.mts +1 -1
- package/dist/{FieldRegistry-C2NVPhMO.d.mts → FieldRegistry-CJwGpUVK.d.mts} +2 -2
- package/dist/FieldRegistry.d.mts +1 -1
- package/dist/{FilterBar-BE_gBM0H.d.mts → FilterBar-DDyk14sx.d.mts} +4 -4
- package/dist/FilterBar.d.mts +1 -1
- package/dist/FilterPickerMenu.d.mts +2 -2
- package/dist/FilterPill.d.mts +1 -1
- package/dist/FilterPopover.d.mts +1 -1
- package/dist/FloatValueControl.d.mts +3 -2
- package/dist/{FloatingToolbar-DLRaE0o7.mjs → FloatingToolbar-rfKurDs8.mjs} +36 -39
- package/dist/FloatingToolbar-rfKurDs8.mjs.map +1 -0
- package/dist/{FormControl-BztNXLn6.mjs → FormControl--pbTH3bY.mjs} +3 -3
- package/dist/{FormControl-BztNXLn6.mjs.map → FormControl--pbTH3bY.mjs.map} +1 -1
- package/dist/{FormControl-BQe3GRhi.d.mts → FormControl-DPYbLcBK.d.mts} +2 -2
- package/dist/FormControl.d.mts +1 -1
- package/dist/FormControlLabel.d.mts +2 -2
- package/dist/{FormField-BW5uMzId.d.mts → FormField-CYNGm2bJ.d.mts} +2 -2
- package/dist/{FormField-Cf1VMvoa.mjs → FormField-DMxjftFw.mjs} +14 -14
- package/dist/{FormField-Cf1VMvoa.mjs.map → FormField-DMxjftFw.mjs.map} +1 -1
- package/dist/FormField.d.mts +1 -1
- package/dist/{Grid-CYpOqTUu.mjs → Grid-DVC0SSEZ.mjs} +2 -2
- package/dist/{Grid-CYpOqTUu.mjs.map → Grid-DVC0SSEZ.mjs.map} +1 -1
- package/dist/{Header-CV0Lcf0C.d.mts → Header-DaaUprCL.d.mts} +2 -2
- package/dist/Header.d.mts +1 -1
- package/dist/{HelperTooltip-BNM3pTM-.d.mts → HelperTooltip-C5BDdJSI.d.mts} +2 -2
- package/dist/HelperTooltip.d.mts +1 -1
- package/dist/HighlightedText.d.mts +1 -1
- package/dist/{HoverCopyableField-XHC_n9tp.mjs → HoverCopyableField-B2-xlwUt.mjs} +12 -7
- package/dist/HoverCopyableField-B2-xlwUt.mjs.map +1 -0
- package/dist/{IconButton-C_ReZm8v.d.mts → IconButton-7k-wjvH3.d.mts} +2 -2
- package/dist/{IconButton-DxHB2g80.mjs → IconButton-kSjnfhWt.mjs} +11 -10
- package/dist/IconButton-kSjnfhWt.mjs.map +1 -0
- package/dist/IconButton.d.mts +1 -1
- package/dist/ImageTile.d.mts +1 -1
- package/dist/IndexTableLayout.d.mts +4 -4
- package/dist/InlineCombobox.d.mts +1 -1
- package/dist/InlineInput.d.mts +1 -1
- package/dist/{Input-DH-5dKor.d.mts → Input-CwvrBsiS.d.mts} +3 -3
- package/dist/{Input-RHXujO9u.mjs → Input-TRmTBEav.mjs} +5 -5
- package/dist/{Input-RHXujO9u.mjs.map → Input-TRmTBEav.mjs.map} +1 -1
- package/dist/Input.d.mts +1 -1
- package/dist/IntegerValueControl.d.mts +3 -2
- package/dist/{Link-D_kCyLYX.mjs → Link-XvzUN8sY.mjs} +6 -6
- package/dist/Link-XvzUN8sY.mjs.map +1 -0
- package/dist/{ListBox-DxOACf6N.d.mts → ListBox-BePQBYR7.d.mts} +3 -3
- package/dist/{ListBox-BZp6exb8.mjs → ListBox-DahM1PgU.mjs} +12 -12
- package/dist/{ListBox-BZp6exb8.mjs.map → ListBox-DahM1PgU.mjs.map} +1 -1
- package/dist/ListBox.d.mts +1 -1
- package/dist/{ListBoxField-CgnDuhUw.d.mts → ListBoxField-lj7JN1BX.d.mts} +4 -4
- package/dist/ListBoxField.d.mts +1 -1
- package/dist/{LoadingShimmer-oPIv2ESr.mjs → LoadingShimmer-CpfKTSUs.mjs} +4 -3
- package/dist/LoadingShimmer-CpfKTSUs.mjs.map +1 -0
- package/dist/LoadingShimmer.d.mts +1 -1
- package/dist/{LogicRow-Dv_1G1TC.d.mts → LogicRow-Do7t7Suf.d.mts} +2 -2
- package/dist/LogicRow.d.mts +1 -1
- package/dist/MaskedInput.d.mts +2 -2
- package/dist/MatchHighlight.d.mts +1 -1
- package/dist/{Menu-BVn1jh46.mjs → Menu-BvMzSH2I.mjs} +5 -5
- package/dist/{Menu-BVn1jh46.mjs.map → Menu-BvMzSH2I.mjs.map} +1 -1
- package/dist/{Menu-BfjvH8mr.d.mts → Menu-Ca5ftvo6.d.mts} +4 -4
- package/dist/Menu.d.mts +1 -1
- package/dist/{MiddleTruncatedText-DicQsLDG.mjs → MiddleTruncatedText--jzGTD00.mjs} +2 -2
- package/dist/{MiddleTruncatedText-DicQsLDG.mjs.map → MiddleTruncatedText--jzGTD00.mjs.map} +1 -1
- package/dist/{Modal-De5_bPJ_.mjs → Modal-B6X5AgWj.mjs} +54 -25
- package/dist/{Modal-De5_bPJ_.mjs.map → Modal-B6X5AgWj.mjs.map} +1 -1
- package/dist/{Modal-CujB7DuB.d.mts → Modal-BPfFyzkw.d.mts} +3 -3
- package/dist/Modal.d.mts +1 -1
- package/dist/{PageHeader-UPiqJpIF.d.mts → PageHeader-BeBmYmUX.d.mts} +2 -2
- package/dist/{PageHeader-7_Hf6rHl.mjs → PageHeader-bhQTjuZF.mjs} +2 -2
- package/dist/{PageHeader-7_Hf6rHl.mjs.map → PageHeader-bhQTjuZF.mjs.map} +1 -1
- package/dist/PageHeader.d.mts +1 -1
- package/dist/{PageLayout-BdVM37bV.d.mts → PageLayout-BXM_pyrU.d.mts} +2 -2
- package/dist/{PageLayout-DjtGrvJa.mjs → PageLayout-DgEGcZgB.mjs} +3 -3
- package/dist/{PageLayout-DjtGrvJa.mjs.map → PageLayout-DgEGcZgB.mjs.map} +1 -1
- package/dist/PageLayout.d.mts +1 -1
- package/dist/{PageSelector-B5CcAzss.d.mts → PageSelector-C14ABZVL.d.mts} +2 -2
- package/dist/PageSelector.d.mts +1 -1
- package/dist/{Pagination-DMH2IaV0.mjs → Pagination-DE8wT55m.mjs} +5 -5
- package/dist/{Pagination-DMH2IaV0.mjs.map → Pagination-DE8wT55m.mjs.map} +1 -1
- package/dist/{Pii-24D_nSRQ.mjs → Pii-C42ZY88Y.mjs} +2 -2
- package/dist/{Pii-24D_nSRQ.mjs.map → Pii-C42ZY88Y.mjs.map} +1 -1
- package/dist/{PillShell-B7Bm-dsE.d.mts → PillShell-Bkyu5FXB.d.mts} +2 -2
- package/dist/PillShell.d.mts +1 -1
- package/dist/{Popover-DordjYNM.mjs → Popover-DuFjaSoq.mjs} +4 -2
- package/dist/Popover-DuFjaSoq.mjs.map +1 -0
- package/dist/Popover.d.mts +1 -1
- package/dist/ProgressBar.d.mts +1 -1
- package/dist/{ProgressIndicator-zt3ndT9U.mjs → ProgressIndicator-hy1P-RG1.mjs} +3 -3
- package/dist/{ProgressIndicator-zt3ndT9U.mjs.map → ProgressIndicator-hy1P-RG1.mjs.map} +1 -1
- package/dist/{Radio-BlEtetrr.mjs → Radio-B4TBAho6.mjs} +5 -5
- package/dist/Radio-B4TBAho6.mjs.map +1 -0
- package/dist/{RadioGroup-CMrXmmn4.mjs → RadioGroup-Bf24GKOb.mjs} +3 -3
- package/dist/{RadioGroup-CMrXmmn4.mjs.map → RadioGroup-Bf24GKOb.mjs.map} +1 -1
- package/dist/RichTextEditor.d.mts +1 -1
- package/dist/RuleEditorFields.d.mts +2 -2
- package/dist/RulesPill.d.mts +1 -1
- package/dist/SectionHeading.d.mts +1 -1
- package/dist/{SegmentedControl-D_DA-MU1.mjs → SegmentedControl-BpR7sUWO.mjs} +6 -3
- package/dist/SegmentedControl-BpR7sUWO.mjs.map +1 -0
- package/dist/{Select-CaG6OQi1.d.mts → Select-DYdn73Nh.d.mts} +2 -2
- package/dist/{Select-DOlw_LPR.mjs → Select-RdTT2KoH.mjs} +10 -8
- package/dist/Select-RdTT2KoH.mjs.map +1 -0
- package/dist/Select.d.mts +1 -1
- package/dist/SmartTextInput.d.mts +1 -1
- package/dist/SmartTextInputField.d.mts +2 -2
- package/dist/SmartTextInputFunctionDialog.d.mts +1 -1
- package/dist/SmartTextInputPopover.d.mts +1 -1
- package/dist/{Spinner-CXb-KUs1.mjs → Spinner-vcApnJzv.mjs} +2 -2
- package/dist/{Spinner-CXb-KUs1.mjs.map → Spinner-vcApnJzv.mjs.map} +1 -1
- package/dist/{Stack-CODxfzhl.d.mts → Stack-B6MrjJeW.d.mts} +2 -2
- package/dist/Stack.d.mts +1 -1
- package/dist/{StatusIndicator-CzRaEFSz.mjs → StatusIndicator-lwt35J6B.mjs} +3 -3
- package/dist/{StatusIndicator-CzRaEFSz.mjs.map → StatusIndicator-lwt35J6B.mjs.map} +1 -1
- package/dist/{Sticker-CLvRB8V5.d.mts → Sticker-C7Wv3Obx.d.mts} +4 -4
- package/dist/{Sticker-C1_6I08u.mjs → Sticker-jfOM4Yi6.mjs} +5 -5
- package/dist/{Sticker-C1_6I08u.mjs.map → Sticker-jfOM4Yi6.mjs.map} +1 -1
- package/dist/Sticker.d.mts +1 -1
- package/dist/StringValueControl.d.mts +2 -1
- package/dist/Tab.d.mts +2 -2
- package/dist/{TabBar-BCFO38E0.mjs → TabBar-DwHgbIQ6.mjs} +8 -8
- package/dist/TabBar-DwHgbIQ6.mjs.map +1 -0
- package/dist/{Table-DPi4Dt5H.mjs → Table-SMJAWqoe.mjs} +21 -13
- package/dist/Table-SMJAWqoe.mjs.map +1 -0
- package/dist/{TableBox-DNQsgQ8x.mjs → TableBox-DS8mpN3-.mjs} +21 -17
- package/dist/TableBox-DS8mpN3-.mjs.map +1 -0
- package/dist/TableBox.d.mts +1 -1
- package/dist/{TableBoxCell-B9KMWebc.d.mts → TableBoxCell-Bo5xYEmR.d.mts} +6 -6
- package/dist/TableBoxCell.d.mts +1 -1
- package/dist/{TableBoxField-0uIGzBhF.d.mts → TableBoxField-CdgjSGLK.d.mts} +5 -5
- package/dist/TableBoxField.d.mts +1 -1
- package/dist/{TableBoxRow-PjBBDcEk.d.mts → TableBoxRow-DuWS2iRC.d.mts} +2 -2
- package/dist/TableBoxRow.d.mts +1 -1
- package/dist/{TableBoxRowActions-B7stm6Q3.d.mts → TableBoxRowActions-zW74DkXt.d.mts} +2 -2
- package/dist/TableBoxRowActions.d.mts +1 -1
- package/dist/{TableCell-CQsF7t4e.d.mts → TableCell-uv_jqT5e.d.mts} +2 -2
- package/dist/TableCell.d.mts +1 -1
- package/dist/{TableControls-ODHrCDJM.d.mts → TableControls-9vz-HfDu.d.mts} +4 -4
- package/dist/{TableControls-BrP_BqnF.mjs → TableControls-CX7BvgD2.mjs} +107 -43
- package/dist/TableControls-CX7BvgD2.mjs.map +1 -0
- package/dist/TableControls.d.mts +1 -1
- package/dist/{TableControlsContext-CHuLxfa7.d.mts → TableControlsContext-D0Hn3rwL.d.mts} +2 -2
- package/dist/TableControlsContext.d.mts +1 -1
- package/dist/{TableViewConfigurationDropdown-BWBBUXCs.d.mts → TableViewConfigurationDropdown-CZcLH8uR.d.mts} +2 -2
- package/dist/TableViewConfigurationDropdown.d.mts +1 -1
- package/dist/{TechnicalSticker-Cq5jzYKQ.mjs → TechnicalSticker-DrN45Vut.mjs} +9 -7
- package/dist/TechnicalSticker-DrN45Vut.mjs.map +1 -0
- package/dist/{Text-CvaqognH.d.mts → Text-CdHeSHCc.d.mts} +2 -2
- package/dist/Text.d.mts +1 -1
- package/dist/{TextArea-Dro-HH8O.mjs → TextArea-CQ1YNi2b.mjs} +4 -5
- package/dist/TextArea-CQ1YNi2b.mjs.map +1 -0
- package/dist/{TextUnderlineTooltip-Bd5e8KH3.d.mts → TextUnderlineTooltip-By1VVsSs.d.mts} +3 -3
- package/dist/TextUnderlineTooltip.d.mts +1 -1
- package/dist/Tile.d.mts +1 -1
- package/dist/{Toggle-D9MzTIZs.mjs → Toggle-DjmkjJlw.mjs} +13 -9
- package/dist/Toggle-DjmkjJlw.mjs.map +1 -0
- package/dist/{Tooltip-YViXzMdm.mjs → Tooltip-C2VB8I6y.mjs} +18 -5
- package/dist/Tooltip-C2VB8I6y.mjs.map +1 -0
- package/dist/{Tooltip-Ddy2Jq0K.d.mts → Tooltip-OxVvOfn8.d.mts} +3 -3
- package/dist/Tooltip.d.mts +1 -1
- package/dist/{TruncatedText-sr9Fhm3N.d.mts → TruncatedText-Dqj94BFK.d.mts} +2 -2
- package/dist/WizardModal.d.mts +1 -1
- package/dist/chartColors.d.mts +92 -0
- package/dist/chartFrameLayout.d.mts +46 -0
- package/dist/{clientFilterUtils-scLlIuP_.d.mts → clientFilterUtils-CMLuN8kK.d.mts} +2 -2
- package/dist/clientFilterUtils.d.mts +1 -1
- package/dist/components/Accordion/index.mjs +25 -16
- package/dist/components/Accordion/index.mjs.map +1 -1
- package/dist/components/Attribute/index.mjs +8 -6
- package/dist/components/Attribute/index.mjs.map +1 -1
- package/dist/components/Badge/index.mjs +1 -1
- package/dist/components/Banner/index.mjs +3 -3
- package/dist/components/BottomPanel/index.mjs +10 -8
- package/dist/components/BottomPanel/index.mjs.map +1 -1
- package/dist/components/Breadcrumbs/index.mjs +1 -1
- package/dist/components/Button/index.d.mts +2 -2
- package/dist/components/Button/index.mjs +1 -1
- package/dist/components/ButtonGroup/index.mjs +2 -2
- package/dist/components/Card/index.d.mts +2 -2
- package/dist/components/CardV2/index.d.mts +1 -1
- package/dist/components/CardV2/index.mjs +1 -1
- package/dist/components/Chart/index.d.mts +9 -0
- package/dist/components/Chart/index.mjs +680 -0
- package/dist/components/Chart/index.mjs.map +1 -0
- package/dist/components/Checkbox/index.mjs +1 -1
- package/dist/components/CodeHighlight/index.mjs +4 -4
- package/dist/components/Combobox/index.d.mts +5 -3
- package/dist/components/Combobox/index.mjs +1 -1
- package/dist/components/ConfigFormGroup/index.mjs +1 -1
- package/dist/components/DataTable/TableControls/index.d.mts +20 -20
- package/dist/components/DataTable/TableControls/index.mjs +2 -2
- package/dist/components/DataTable/index.d.mts +5 -5
- package/dist/components/DataTable/index.mjs +1 -1
- package/dist/components/DataTable/types.d.mts +1 -1
- package/dist/components/DatePicker/index.mjs +1 -1
- package/dist/components/DropdownButton/index.mjs +1 -1
- package/dist/components/DropdownMenu/index.d.mts +1 -1
- package/dist/components/DropdownMenu/index.mjs +1 -1
- package/dist/components/FloatingPanel/index.mjs +20 -18
- package/dist/components/FloatingPanel/index.mjs.map +1 -1
- package/dist/components/FloatingToolbar/index.mjs +1 -1
- package/dist/components/FormControl/index.d.mts +1 -1
- package/dist/components/FormControl/index.mjs +1 -1
- package/dist/components/FormField/index.d.mts +5 -5
- package/dist/components/FormField/index.mjs +1 -1
- package/dist/components/Grid/index.mjs +1 -1
- package/dist/components/HoverCopyableField/index.mjs +1 -1
- package/dist/components/ImageTile/index.mjs +10 -10
- package/dist/components/ImageTile/index.mjs.map +1 -1
- package/dist/components/Input/index.d.mts +1 -1
- package/dist/components/Input/index.mjs +1 -1
- package/dist/components/Link/index.mjs +1 -1
- package/dist/components/ListBox/index.d.mts +3 -3
- package/dist/components/ListBox/index.mjs +1 -1
- package/dist/components/LoadingShimmer/index.mjs +1 -1
- package/dist/components/MaskedInput/index.mjs +1 -1
- package/dist/components/Menu/index.d.mts +1 -1
- package/dist/components/Menu/index.mjs +1 -1
- package/dist/components/Modal/index.d.mts +1 -1
- package/dist/components/Modal/index.mjs +1 -1
- package/dist/components/PageHeader/index.d.mts +1 -1
- package/dist/components/PageHeader/index.mjs +1 -1
- package/dist/components/Pagination/index.d.mts +1 -1
- package/dist/components/Pagination/index.mjs +1 -1
- package/dist/components/Pii/index.mjs +1 -1
- package/dist/components/Popover/index.mjs +1 -1
- package/dist/components/ProgressBar/index.mjs +20 -3
- package/dist/components/ProgressBar/index.mjs.map +1 -1
- package/dist/components/ProgressIndicator/index.mjs +1 -1
- package/dist/components/Radio/index.mjs +1 -1
- package/dist/components/RadioGroup/index.mjs +1 -1
- package/dist/components/RichTextEditor/index.mjs +9 -9
- package/dist/components/RightPanel/index.mjs +30 -15
- package/dist/components/RightPanel/index.mjs.map +1 -1
- package/dist/components/SegmentedControl/index.mjs +1 -1
- package/dist/components/Select/index.d.mts +1 -1
- package/dist/components/Select/index.mjs +1 -1
- package/dist/components/SelectionCard/index.mjs +5 -5
- package/dist/components/Slider/index.mjs +5 -4
- package/dist/components/Slider/index.mjs.map +1 -1
- package/dist/components/SmartTextInput/index.mjs +11 -18
- package/dist/components/SmartTextInput/index.mjs.map +1 -1
- package/dist/components/Spinner/index.mjs +1 -1
- package/dist/components/Stack/index.d.mts +1 -1
- package/dist/components/StatusIndicator/index.mjs +1 -1
- package/dist/components/Sticker/index.d.mts +1 -1
- package/dist/components/Sticker/index.mjs +1 -1
- package/dist/components/SwatchPicker/index.mjs +2 -1
- package/dist/components/SwatchPicker/index.mjs.map +1 -1
- package/dist/components/TabBar/index.mjs +1 -1
- package/dist/components/Table/index.d.mts +1 -1
- package/dist/components/Table/index.mjs +1 -1
- package/dist/components/TableBox/index.d.mts +1 -1
- package/dist/components/TableBox/index.mjs +1 -1
- package/dist/components/TechnicalSticker/index.mjs +1 -1
- package/dist/components/Text/index.d.mts +1 -1
- package/dist/components/TextArea/index.mjs +1 -1
- package/dist/components/Tile/index.mjs +2 -2
- package/dist/components/Toast/index.mjs +19 -13
- package/dist/components/Toast/index.mjs.map +1 -1
- package/dist/components/Toggle/index.mjs +1 -1
- package/dist/components/Tooltip/index.d.mts +3 -3
- package/dist/components/Tooltip/index.mjs +1 -1
- package/dist/components/VersionHistory/index.mjs +8 -8
- package/dist/compound-expression.d.mts +1 -1
- package/dist/{date-range-rule-value-ASr06ClE.d.mts → date-range-rule-value-DyLlMtjr.d.mts} +2 -2
- package/dist/date-range-rule-value.d.mts +1 -1
- package/dist/display.d.mts +1 -1
- package/dist/duration-token.d.mts +11 -0
- package/dist/exit-motion.d.mts +7 -0
- package/dist/fieldPickerOptions.d.mts +2 -2
- package/dist/{filter-size-context-CmFyIPCm.d.mts → filter-size-context-DVnjmuhk.d.mts} +2 -2
- package/dist/filter-size-context.d.mts +1 -1
- package/dist/{filters-yfzOlqKx.d.mts → filters-By_TYKAZ.d.mts} +3 -3
- package/dist/filters.d.mts +1 -1
- package/dist/{helpers-BeCjgAeE.d.mts → helpers-BIHsqdyX.d.mts} +2 -2
- package/dist/helpers.d.mts +1 -1
- package/dist/{index-kIon1vPp.d.mts → index-BozzRwby.d.mts} +2 -2
- package/dist/{index-BEHNqAZa.d.mts → index-CZJp4Af6.d.mts} +3 -3
- package/dist/index2.d.mts +1 -1
- package/dist/index4.d.mts +3 -3
- package/dist/index5.d.mts +1 -1
- package/dist/index6.d.mts +14 -14
- package/dist/{inputFields-BnCdmuBt.d.mts → inputFields-BqO2H-Kj.d.mts} +6 -6
- package/dist/inputFields.d.mts +1 -1
- package/dist/lib/MiddleTruncatedText.mjs +1 -1
- package/dist/lib/TruncatedText.d.mts +1 -1
- package/dist/lib/TruncatedTextWithTooltip.d.mts +1 -1
- package/dist/lib/TruncatedTextWithTooltip.mjs +1 -1
- package/dist/lib/colorMode.d.mts +1 -1
- package/dist/lib/schemaOptions.mjs +9 -4
- package/dist/lib/schemaOptions.mjs.map +1 -1
- package/dist/lib/useChain.d.mts +1 -1
- package/dist/lib/useModalInsetRight.d.mts +4 -3
- package/dist/lib/useModalInsetRight.mjs +7 -5
- package/dist/lib/useModalInsetRight.mjs.map +1 -1
- package/dist/lint/THIRD_PARTY_NOTICES.md +30 -0
- package/dist/lint/index.mjs +696 -11
- package/dist/lint/index.mjs.map +1 -1
- package/dist/lint/recommended.json +7 -1
- package/dist/mixins/focus.mjs +1 -1
- package/dist/mixins/hoverable.mjs +2 -2
- package/dist/mixins/hoverable.mjs.map +1 -1
- package/dist/mixins/input.mjs +3 -2
- package/dist/mixins/input.mjs.map +1 -1
- package/dist/mixins/menuItem.mjs +2 -0
- package/dist/mixins/menuItem.mjs.map +1 -1
- package/dist/mixins/motion.d.mts +24 -0
- package/dist/mixins/motion.mjs +44 -0
- package/dist/mixins/motion.mjs.map +1 -0
- package/dist/motion-origin.d.mts +7 -0
- package/dist/motion.d.mts +63 -0
- package/dist/no-layout-motion.d.mts +7 -0
- package/dist/no-transition-all.d.mts +7 -0
- package/dist/{operators-BHxKZcpD.d.mts → operators-B8_k3r69.d.mts} +10 -3
- package/dist/operators.d.mts +2 -2
- package/dist/overlay-motion.d.mts +7 -0
- package/dist/patterns/CardGrouping/index.mjs +9 -9
- package/dist/patterns/CardGrouping/index.mjs.map +1 -1
- package/dist/patterns/IndexTableLayout/index.mjs +3 -3
- package/dist/patterns/LayoutLoadingShimmer/index.mjs +4 -4
- package/dist/patterns/LayoutLoadingSpinner/index.mjs +3 -1
- package/dist/patterns/LayoutLoadingSpinner/index.mjs.map +1 -1
- package/dist/patterns/PageLayout/index.d.mts +1 -1
- package/dist/patterns/PageLayout/index.mjs +1 -1
- package/dist/patterns/WizardModal/index.mjs +4 -4
- package/dist/relative-date-label.d.mts +1 -1
- package/dist/tone.d.mts +1 -1
- package/dist/{types-DLnCkvTt.d.mts → types-BJqmRXFV.d.mts} +15 -1
- package/dist/{types-CqcbWyUY.d.mts → types-BOsCi-kZ.d.mts} +8 -2
- package/dist/{types-BXJ6qAGy.d.mts → types-C_CncajO.d.mts} +2 -2
- package/dist/{types-BeFBvQ1c.d.mts → types-D5txFacG.d.mts} +3 -3
- package/dist/types4.d.mts +1 -1
- package/dist/types5.d.mts +1 -1
- package/dist/types6.d.mts +1 -1
- package/dist/{url-state-CXUuK3_r.d.mts → url-state-CXPmXzIZ.d.mts} +2 -2
- package/dist/url-state.d.mts +1 -1
- package/dist/{useChain-B--KAtdN.d.mts → useChain-x9fd9Fyq.d.mts} +2 -2
- package/dist/useChainAtCursor.d.mts +1 -1
- package/dist/useChartColors.d.mts +30 -0
- package/dist/useChartSeriesVisibility.d.mts +22 -0
- package/dist/useChartStyles.d.mts +108 -0
- package/dist/useColumnConfiguration.d.mts +2 -2
- package/dist/useComboboxFooterAction.d.mts +1 -1
- package/dist/{useFilterStateV2-DBpbxAEC.d.mts → useFilterStateV2-DiTS9DTg.d.mts} +3 -3
- package/dist/useFilterStateV2.d.mts +1 -1
- package/dist/{useTableColumns-DJFy0Gp8.d.mts → useTableColumns-BEKJNrb1.d.mts} +2 -2
- package/dist/useTableColumns.d.mts +1 -1
- package/dist/useTruncation.d.mts +1 -1
- package/dist/useValueControlError.d.mts +26 -0
- package/dist/utils.d.mts +1 -1
- package/dist/{validation-Tgg3AhuP.d.mts → validation-BDQdQ1cY.d.mts} +3 -3
- package/dist/validation.d.mts +1 -1
- package/dist/{value-control-resolver-XQbGCdsP.d.mts → value-control-resolver-BFJZEWDn.d.mts} +9 -3
- package/dist/value-control-resolver.d.mts +1 -1
- package/dist/variables/charting.mjs +1 -1
- package/dist/variables/charting.mjs.map +1 -1
- package/dist/variables/keyframes.d.mts +2 -1
- package/dist/variables/keyframes.mjs +9 -1
- package/dist/variables/keyframes.mjs.map +1 -1
- package/dist/variables/transitions.d.mts +31 -1
- package/dist/variables/transitions.mjs +50 -1
- package/dist/variables/transitions.mjs.map +1 -1
- package/llms.txt +3 -2
- package/package.json +14 -4
- package/skills/new-screen/SKILL.md +33 -0
- package/skills/ui-authoring/COMPONENTS.md +19 -1
- package/skills/ui-authoring/PATTERNS.md +57 -33
- package/skills/ui-authoring/STANDARD.md +68 -4
- package/skills/ui-authoring/TOKENS.md +27 -24
- package/dist/Breadcrumbs-CMf3Uvow.mjs.map +0 -1
- package/dist/CardV2-ACI5RIzF.mjs.map +0 -1
- package/dist/Checkbox-Dr4LMKHV.mjs.map +0 -1
- package/dist/Combobox-Gb_j1dg6.mjs.map +0 -1
- package/dist/Combobox-fYZjpn5-.d.mts +0 -11
- package/dist/DataTable-CIZJ1vO8.mjs.map +0 -1
- package/dist/DatePicker-C9redLBr.mjs.map +0 -1
- package/dist/DropdownMenu-c8XK2Lr4.mjs.map +0 -1
- package/dist/FloatingToolbar-DLRaE0o7.mjs.map +0 -1
- package/dist/HoverCopyableField-XHC_n9tp.mjs.map +0 -1
- package/dist/IconButton-DxHB2g80.mjs.map +0 -1
- package/dist/Link-D_kCyLYX.mjs.map +0 -1
- package/dist/LoadingShimmer-oPIv2ESr.mjs.map +0 -1
- package/dist/Popover-DordjYNM.mjs.map +0 -1
- package/dist/Radio-BlEtetrr.mjs.map +0 -1
- package/dist/SegmentedControl-D_DA-MU1.mjs.map +0 -1
- package/dist/Select-DOlw_LPR.mjs.map +0 -1
- package/dist/TabBar-BCFO38E0.mjs.map +0 -1
- package/dist/Table-DPi4Dt5H.mjs.map +0 -1
- package/dist/TableBox-DNQsgQ8x.mjs.map +0 -1
- package/dist/TableControls-BrP_BqnF.mjs.map +0 -1
- package/dist/TechnicalSticker-Cq5jzYKQ.mjs.map +0 -1
- package/dist/TextArea-Dro-HH8O.mjs.map +0 -1
- package/dist/Toggle-D9MzTIZs.mjs.map +0 -1
- package/dist/Tooltip-YViXzMdm.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaOptions.mjs","names":[],"sources":["../../src/lib/schemaOptions.ts"],"sourcesContent":["import { compact, flatten, last, sortBy, trim } from 'lodash-es';\n\nimport { assertNever } from './assertNever';\nimport {\n JsonSchemaAllTypes,\n type JsonSchemaCustomTypes,\n JsonSchemaStringifiableTypes,\n EMPTY_JSON_SCHEMA_OBJECT,\n getNonNullableRefSchema,\n genericArrayItemSchema,\n getNonNullableType,\n isConvertedTypeSchema,\n isFileType,\n isFunctionSchema,\n isGenericParameterSchema,\n isJsonSchemaArray,\n isJsonSchemaDate,\n isJsonSchemaDateTime,\n isJsonSchemaObject,\n isJsonSchemaRef,\n isJsonSchemaString,\n isJsonType,\n isPrecedingSchema,\n type JsonSchema,\n type JsonSchemaArray,\n type JsonSchemaBasicTypes,\n type JsonSchemaObject,\n JsonSchemaTypes,\n type JsonSchemaObjectKey,\n} from './jsonSchema';\nimport { getJsonSchemaType } from './jsonSchemaType';\nimport {\n appendedMethodChain,\n type Chain,\n EMPTY_METHOD_CHAIN,\n isIdentifierNode,\n isFunctionNode,\n isStringNode,\n isValid,\n type MethodChainNode,\n MethodChainNodeTypes,\n methodChainToString,\n parseMethodChain,\n parseWithPartialOption,\n type StringNode,\n} from './methodChain';\nimport type { FunctionJsonSchema, ObjectSchemaMap } from './objectSchemaTypes';\nimport {\n getPlatformObjectTypeFromJsonSchema,\n getSchemaId,\n MERGED_SCHEMA_ID,\n PrimitiveSchemaId,\n resolveJssRef,\n} from './platformObject';\n\ntype VariableSchemaObject = {\n value: string;\n schema?: JsonSchema | null;\n isVariable?: boolean;\n};\n\nconst fullNodeName = (node: MethodChainNode): string =>\n `${node.type === MethodChainNodeTypes.CustomFunction ? '@' : ''}${node.name}`;\n\nexport type Option = {\n label: string;\n value: string;\n property: string;\n schema: JsonSchema | FunctionJsonSchema;\n methodChain: Chain | null;\n utility?: boolean;\n workflowObjectKey?: string;\n isVariable?: boolean;\n};\n\nconst SCHEMA_PATH_PATTERN = /\\/schema\\/([a-z][a-z0-9-_]*)/i;\n\n/**\n * Extracts the top-level platform-object key from a schema's `$ref`/`$id`/\n * `objectKey`/`objectType.const` markers. Collapses subtypes to their root\n * (`/schema/verification/document/merged` -> `verification`) because callers\n * compare against top-level `ApiModel` values.\n */\nexport const extractPlatformObjectKey = (\n schema: JsonSchema | null | undefined,\n platformObjectJsonSchema: ObjectSchemaMap = {},\n): string | null => {\n if (!schema) {\n return null;\n }\n if (isJsonSchemaRef(schema)) {\n const refMatch = schema.$ref?.match(SCHEMA_PATH_PATTERN);\n if (refMatch) {\n return refMatch[1];\n }\n return extractPlatformObjectKey(\n resolveJssRef(schema, platformObjectJsonSchema),\n platformObjectJsonSchema,\n );\n }\n if ('$id' in schema && typeof schema.$id === 'string') {\n const idMatch = schema.$id.match(SCHEMA_PATH_PATTERN);\n if (idMatch) {\n return idMatch[1];\n }\n }\n // Serialized PLOB columns carry `objectKey` on a scalar schema (no `$ref`), so\n // read it regardless of `type`, collapsing subtypes to root like the `$ref` branch.\n if ('objectKey' in schema && typeof schema.objectKey === 'string') {\n return schema.objectKey.split('/')[0];\n }\n return getPlatformObjectTypeFromJsonSchema(schema);\n};\n\ntype PossibleType = JsonSchemaTypes | JsonSchemaCustomTypes | JsonSchemaObjectKey;\ntype PossibleArrayType = JsonSchemaBasicTypes | JsonSchemaTypes.Object | JsonSchemaObjectKey;\n\nconst isMatchingType = (\n schema: JsonSchema,\n allowedTypes: PossibleType[],\n allowedArrayTypes: PossibleArrayType[],\n) => {\n if (allowedTypes.length === 0) {\n return true;\n }\n const jsonSchemaType = getJsonSchemaType(schema);\n // If strings are allowed and the field is string-able, let it through.\n if (\n allowedTypes.some((schemaType) => schemaType === JsonSchemaTypes.String) &&\n JsonSchemaStringifiableTypes.some((schemaType) => schemaType === jsonSchemaType)\n ) {\n return true;\n } else if (jsonSchemaType === JsonSchemaAllTypes.Array) {\n const itemsSchema = 'items' in schema ? schema.items : null;\n if (\n !allowedTypes.includes(JsonSchemaAllTypes.Array) ||\n // Don't recurse on array, otherwise we risk matching on objects within the array\n (allowedArrayTypes?.length &&\n !allowedArrayTypes.some((schemaType) => schemaType === getJsonSchemaType(itemsSchema)))\n ) {\n return false;\n }\n } else if (\n jsonSchemaType !== JsonSchemaAllTypes.Object &&\n !allowedTypes.some((schemaType) => schemaType === jsonSchemaType)\n ) {\n return false;\n }\n return true;\n};\n\n// isValidOptionHelper returns true if the schema provided is (in order of precedence)\n// 1) not a disallowed by name\n// AND 2) not a disallowed type\n// AND 3) allowed field by name (either explicitly or implicitly)\n// at each level (we recurse down for object types), we check that the fields at the level fit the above 1,2 and 3\n//\n// 1) is straight forward. if a field is named as disallowed it has the most precedence\n// 2) the field is disallowed by type if the allowedTypes are specified AND\n// - if the field is an array, then\n// - arrays are in allowedTypes\n// - AND (its `items` type is in `allowedArrayTypes` OR `allowedArrayTypes` is empty)\n// - if the field is an object, we do nothing since the recursion is handled at the `isValidOptionHelper` level\n// - else, the field type appears in allowedTypes\n// 3) we can be allowed by name\n// - explicitly, which means the field is named explicitly as an allowedFieldPath (this has precedence)\n// - implicitly, which means that there are no fields explicitly named in allowedFieldPath\n// - an object field can be allowed implicitly if it has at least one valid children\nconst isValidOptionHelper = (\n schema: JsonSchema,\n allowedFieldPaths: Set<string>,\n disallowedFieldPaths: Set<string>,\n allowedTypes: PossibleType[],\n allowedArrayTypes: PossibleArrayType[],\n path: string[],\n platformObjectJsonSchema: ObjectSchemaMap,\n traversedSchemaIds = new Set(),\n): boolean => {\n const resolvedSchema = isJsonSchemaRef(schema)\n ? resolveJssRef(schema, platformObjectJsonSchema)\n : schema;\n\n if (resolvedSchema.$id) {\n if (traversedSchemaIds.has(resolvedSchema.$id)) {\n // We've already traversed this schema ID, which there were no\n // valid types found for it, so return false to avoid infinite loops\n return false;\n } else {\n // If we haven't traversed this schema ID yet, add it to the set\n // This allows us to avoid infinite loops when resolving references\n // in recursive schemas\n traversedSchemaIds.add(resolvedSchema.$id);\n }\n }\n const dotPath = path.join('.');\n if (disallowedFieldPaths.has(dotPath)) {\n return false;\n }\n if (!isMatchingType(resolvedSchema, allowedTypes, allowedArrayTypes)) {\n return false;\n }\n if (allowedFieldPaths.has(dotPath)) {\n return true;\n }\n // if we are here it means\n // - our type is valid\n // - we are not disallowed\n // - we are not explicitly allowed\n // if we are here, we are only valid if\n // - we are an object and at least one of our properties are valid\n // OR, we are not an object and allowedFieldPaths is empty\n const jsonSchemaType = getJsonSchemaType(resolvedSchema);\n if (jsonSchemaType === JsonSchemaTypes.Object) {\n // A schemaless JSON field is an opaque leaf, so it has no child to qualify it as an option.\n if ('fieldType' in resolvedSchema && isJsonType(resolvedSchema.fieldType)) {\n return allowedFieldPaths.size === 0;\n }\n return (\n 'properties' in resolvedSchema &&\n resolvedSchema.properties != null &&\n Object.entries(resolvedSchema.properties).some(([prop, propSchema]) =>\n isValidOptionHelper(\n propSchema,\n allowedFieldPaths,\n disallowedFieldPaths,\n allowedTypes,\n allowedArrayTypes,\n [...path, prop],\n platformObjectJsonSchema,\n traversedSchemaIds,\n ),\n )\n );\n }\n return allowedFieldPaths.size === 0;\n};\n\nexport const isValidOption = (\n schema: JsonSchema,\n allowedFieldPaths: string[],\n disallowedFieldPaths: string[],\n allowedTypes: PossibleType[],\n allowedArrayTypes: PossibleArrayType[],\n path: string[] = [],\n platformObjectJsonSchema: ObjectSchemaMap,\n): boolean => {\n const allowedFieldPathsSet =\n allowedFieldPaths == null ? new Set<string>() : new Set<string>(allowedFieldPaths);\n const disallowedFieldPathsSet =\n disallowedFieldPaths == null ? new Set<string>() : new Set<string>(disallowedFieldPaths);\n if (\n allowedFieldPathsSet.size === 0 &&\n disallowedFieldPathsSet.size === 0 &&\n allowedTypes.length === 0 &&\n allowedArrayTypes.length === 0\n ) {\n return true;\n }\n return isValidOptionHelper(\n schema,\n allowedFieldPathsSet,\n disallowedFieldPathsSet,\n allowedTypes ?? [],\n allowedArrayTypes ?? [],\n path,\n platformObjectJsonSchema,\n );\n};\n\nconst buildSchemaOptionsFor = (rootSchema: JsonSchemaObject, baseChain: Chain | null) =>\n Object.entries(rootSchema?.properties ?? {}).map(([property, propSchema]) => {\n const appended = appendedMethodChain(baseChain ?? EMPTY_METHOD_CHAIN, property);\n return {\n label: methodChainToString(appended),\n value: methodChainToString(appended),\n property,\n schema: propSchema,\n methodChain: appended,\n workflowObjectKey: 'objectKey' in propSchema ? propSchema.objectKey : undefined,\n isVariable: 'isVariable' in propSchema ? propSchema.isVariable : false,\n };\n });\n\nconst getSupportedArrayFunctions = (\n schema: JsonSchema,\n arrayPrimitive: JsonSchemaObject,\n): string[] => {\n if (isJsonSchemaArray(schema) && schema['supportedFunctions']) {\n return schema['supportedFunctions'];\n }\n return arrayPrimitive['baseSupportedFunctions'] ?? [];\n};\n\nexport const getSchemaOptions = ({\n option,\n optionFilters,\n platformObjectJsonSchema,\n primitiveUtilities,\n digPrimitives = false,\n}: {\n option: Pick<Option, 'schema' | 'methodChain'>;\n optionFilters?: OptionFilters;\n platformObjectJsonSchema: ObjectSchemaMap;\n primitiveUtilities: ObjectSchemaMap;\n digPrimitives?: boolean;\n}): Option[] => {\n const { schema, methodChain } = option;\n const nullableRefSchema = getNonNullableRefSchema(schema);\n const baseSchema = nullableRefSchema ?? schema;\n const refResolved = isJsonSchemaRef(baseSchema)\n ? resolveJssRef(baseSchema, platformObjectJsonSchema)\n : baseSchema;\n const nonNullable = refResolved && getNonNullableType(refResolved);\n const resolvedSchema = nonNullable\n ? ({ ...refResolved, type: nonNullable } as JsonSchema)\n : refResolved;\n const schemaType = getJsonSchemaType(resolvedSchema);\n\n const schemaOptions = (() => {\n switch (schemaType) {\n case JsonSchemaAllTypes.Object:\n return buildSchemaOptionsFor(resolvedSchema as JsonSchemaObject, methodChain);\n case JsonSchemaAllTypes.Array:\n case JsonSchemaAllTypes.MultiEnum: {\n if (!digPrimitives) {\n return [];\n }\n const arrayPrimitive = primitiveUtilities[PrimitiveSchemaId.Array];\n if (!arrayPrimitive) {\n return [];\n }\n const allOptions = buildSchemaOptionsFor(arrayPrimitive, methodChain);\n const supported = getSupportedArrayFunctions(resolvedSchema, arrayPrimitive);\n return allOptions.filter((opt) => supported.includes(opt.property));\n }\n case JsonSchemaAllTypes.String:\n return digPrimitives\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.String], methodChain)\n : [];\n case JsonSchemaAllTypes.Enum: {\n if (digPrimitives && isJsonSchemaString(resolvedSchema)) {\n return buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.String], methodChain);\n }\n return [];\n }\n case JsonSchemaAllTypes.File:\n return digPrimitives\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.File], methodChain)\n : [];\n // Integer/Number share a single /schema/number bucket — see the collapse\n // in `getPrimitiveSchemaId` and the backend `JSON_TYPE_TO_SCHEMA_ID`. The\n // default mock primitives don't ship utilities for these, so the lookup\n // returns CCFs only (the only properties merged in by `useChain`).\n case JsonSchemaAllTypes.Integer:\n case JsonSchemaAllTypes.Number:\n return digPrimitives && primitiveUtilities[PrimitiveSchemaId.Number]\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.Number], methodChain)\n : [];\n case JsonSchemaAllTypes.Boolean:\n return digPrimitives && primitiveUtilities[PrimitiveSchemaId.Boolean]\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.Boolean], methodChain)\n : [];\n // Date and Datetime are distinct buckets, mirroring the backend\n // `PlatformPrimitive::Date` / `PlatformPrimitive::Datetime` split. A\n // calendar-only Date receiver shouldn't surface CCFs authored against\n // timezone-bearing Datetimes (or vice versa).\n case JsonSchemaAllTypes.Date:\n return digPrimitives && primitiveUtilities[PrimitiveSchemaId.Date]\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.Date], methodChain)\n : [];\n case JsonSchemaAllTypes.Datetime:\n return digPrimitives && primitiveUtilities[PrimitiveSchemaId.Datetime]\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.Datetime], methodChain)\n : [];\n case JsonSchemaAllTypes.GroupedEnum:\n case JsonSchemaAllTypes.Null:\n case JsonSchemaAllTypes.Relation:\n case JsonSchemaAllTypes.MaskedString:\n case JsonSchemaAllTypes.Unknown:\n return [];\n default:\n assertNever(schemaType);\n }\n })();\n\n // After a possibly-null value, offer a CCF only when its receiver schema\n // accepts null. Non-CCF members stay for nullable `type` arrays but not\n // for a nullable `$ref | null` union, whose member paths `nextLinkSchema`\n // cannot resolve.\n const possiblyNull = nullableRefSchema != null || nonNullable != null;\n const nullSafeOptions = possiblyNull\n ? schemaOptions.filter((opt) => {\n if (isFunctionSchema(opt.schema) && opt.schema.codeChainFunctionToken != null) {\n return opt.schema.acceptsNullReceiver === true;\n }\n return nullableRefSchema == null;\n })\n : schemaOptions;\n\n const containsFilters = optionFilters && !!flatten(compact(Object.values(optionFilters))).length;\n const finalOptions = containsFilters\n ? filterForAllowedSchemaOptions(nullSafeOptions, optionFilters, platformObjectJsonSchema)\n : nullSafeOptions;\n return sortBy(finalOptions, (opt: Option) => opt.property.replace(/^@/, '')) as Option[];\n};\n\nexport const formatDisplayValue = (value: any) => {\n return typeof value === 'string' ? value : trim(JSON.stringify(value, null, 1), '\"');\n};\n\n/**\n * Resolves the schema at a dotted path (e.g. \"account.birthDate\").\n * Tries direct key lookup first, then traverses into nested object .properties by path part.\n * Normalizes kebab/snake at each level for key lookup.\n */\nexport function getSchemaByPath(\n properties: Record<string, JsonSchema> | null | undefined,\n path: string,\n): JsonSchema | undefined {\n if (!properties || !path) {\n return undefined;\n }\n\n const lookup = (props: Record<string, JsonSchema>, key: string): JsonSchema | undefined =>\n props[key] ?? props[key.replace(/_/g, '-')] ?? props[key.replace(/-/g, '_')];\n\n const byFullPath = lookup(properties, path);\n if (byFullPath != null) {\n return byFullPath;\n }\n\n const i = path.indexOf('.');\n if (i === -1) {\n return undefined;\n }\n const nestedKey = path.slice(0, i);\n const rest = path.slice(i + 1);\n const next = lookup(properties, nestedKey);\n if (next == null || !isJsonSchemaObject(next) || !next.properties) {\n return undefined;\n }\n return getSchemaByPath(next.properties, rest);\n}\n\nconst parseMethodChainForJSS = (path: string): Chain | null => {\n const { methodChain, partial, valid } = parseWithPartialOption(path);\n if (!valid) {\n return null;\n }\n\n if (partial.length > 0) {\n return appendedMethodChain(methodChain, partial);\n }\n\n return methodChain;\n};\n\n/**\n * The schema resolved for a key admitted by `additionalProperties: true`: valid, with an unknown\n * type. Compared by identity (e.g. by the SmartTextInput validator), so do not copy it.\n */\nexport const UNTYPED_ADDITIONAL_PROPERTY_SCHEMA: JsonSchema = Object.freeze({});\n\n/**\n * Resolves an identifier that is not a declared property of `currentSchema` through the object's\n * `additionalProperties`: its schema when one is given, `UNTYPED_ADDITIONAL_PROPERTY_SCHEMA` when\n * it is `true`, and null when extra keys are not allowed.\n */\nconst additionalPropertySchema = (\n currentSchema: JsonSchema | null,\n link: MethodChainNode,\n platformObjectJsonSchema: ObjectSchemaMap,\n): JsonSchema | null => {\n if (currentSchema == null || !isIdentifierNode(link)) {\n return null;\n }\n const resolved = isJsonSchemaRef(currentSchema)\n ? resolveJssRef(currentSchema, platformObjectJsonSchema)\n : currentSchema;\n if (!isJsonSchemaObject(resolved) || resolved.properties?.[link.name] != null) {\n return null;\n }\n const { additionalProperties } = resolved;\n if (additionalProperties === true) {\n return UNTYPED_ADDITIONAL_PROPERTY_SCHEMA;\n }\n return typeof additionalProperties === 'object' && additionalProperties != null\n ? additionalProperties\n : null;\n};\n\nexport const getSchemaForFieldPath = ({\n path,\n initialSchema,\n platformObjectJsonSchema = {},\n primitiveUtilities = {},\n}: {\n path: string;\n initialSchema: JsonSchema;\n platformObjectJsonSchema?: ObjectSchemaMap;\n primitiveUtilities?: ObjectSchemaMap;\n}): {\n schema: JsonSchema | null;\n propertyName: string | null;\n} => {\n if (!initialSchema || (!('type' in initialSchema) && !('$ref' in initialSchema))) {\n return { schema: null, propertyName: null };\n }\n\n const schema: JsonSchema = isJsonSchemaRef(initialSchema)\n ? resolveJssRef(initialSchema, platformObjectJsonSchema)\n : initialSchema;\n\n if (path === '' || !isValid(path)) {\n return { schema: null, propertyName: null };\n }\n const methodChain = parseMethodChain(path);\n if (!methodChain) {\n return { schema: null, propertyName: null };\n }\n const result = methodChain.links.reduce<JsonSchema | null>((currentSchema, link) => {\n return (\n nextLinkSchema({\n currentSchema,\n nextLink: link,\n platformObjectJsonSchema,\n primitiveUtilities,\n }) ?? additionalPropertySchema(currentSchema, link, platformObjectJsonSchema)\n );\n }, schema);\n\n const propertyName = result ? last(methodChain.links)?.name || null : null;\n return { schema: result, propertyName };\n};\n\n/**\n * Get the schema for a variable path from usableObjects.\n */\nexport const getSchemaForVariablePath = ({\n path,\n usableObjects,\n}: {\n path: string;\n usableObjects: VariableSchemaObject[];\n}): {\n schema: JsonSchema | null;\n propertyName: string | null;\n} => {\n // just variables\n const syntheticSchema: JsonSchemaObject = {\n type: JsonSchemaTypes.Object,\n properties: Object.fromEntries(\n usableObjects\n .filter((obj) => obj.schema != null && obj.isVariable === true)\n .map((obj) => [obj.value, obj.schema!]),\n ),\n };\n\n return getSchemaForFieldPath({\n path,\n initialSchema: syntheticSchema,\n });\n};\n\nconst getPrimitiveSchemaId = (schema: JsonSchema): string | null => {\n if (!('type' in schema)) {\n return null;\n }\n // File type has special naming: 'file' -> '/schema/field/file'\n // because the backend uses Field::File.name.underscore = 'field/file'\n // File fields have type: 'object' with fieldType: 'file'\n if (isJsonSchemaObject(schema) && isFileType(schema.fieldType)) {\n return PrimitiveSchemaId.File;\n }\n // Date and Datetime are encoded as `{type: 'string', format: 'date'|'date-time'}`.\n // Check before the generic string branch so date receivers don't bucket as String.\n if (isJsonSchemaDate(schema)) {\n return PrimitiveSchemaId.Date;\n }\n if (isJsonSchemaDateTime(schema)) {\n return PrimitiveSchemaId.Datetime;\n }\n const type = Array.isArray(schema.type) ? getNonNullableType(schema) : schema.type;\n if (!type) {\n return null;\n }\n // Integer and Number share one CCF bucket — mirrors the backend collapse\n // in JSON_TYPE_TO_SCHEMA_ID. A CCF authored against a Number receiver\n // fires for both .length-style integers and float-typed values.\n if (type === JsonSchemaTypes.Integer || type === JsonSchemaTypes.Number) {\n return PrimitiveSchemaId.Number;\n }\n if (type === JsonSchemaTypes.Boolean) {\n return PrimitiveSchemaId.Boolean;\n }\n return getSchemaId(type);\n};\n\nexport const nextLinkSchema = ({\n currentSchema,\n nextLink,\n platformObjectJsonSchema,\n primitiveUtilities,\n}: {\n currentSchema: JsonSchema | null;\n nextLink: MethodChainNode;\n platformObjectJsonSchema: ObjectSchemaMap;\n primitiveUtilities: ObjectSchemaMap;\n}): JsonSchema | null => {\n if (!currentSchema) {\n return null;\n }\n // Runtime dispatches a typed null only to a CCF whose receiver schema\n // accepts null, so a nullable value resolves only through such CCFs.\n if (nextLink.type === MethodChainNodeTypes.CustomFunction) {\n const unwrapped = getNonNullableRefSchema(currentSchema);\n const nonNullType = unwrapped ? null : getNonNullableType(currentSchema);\n const receiver =\n unwrapped ?? (nonNullType ? ({ ...currentSchema, type: nonNullType } as JsonSchema) : null);\n if (receiver) {\n const fn = getFunctionSchemaForNode({\n parentSchema: currentSchema,\n functionName: fullNodeName(nextLink),\n isCustomFunction: true,\n platformObjectJsonSchema,\n primitiveUtilities,\n });\n if (fn?.acceptsNullReceiver !== true) {\n return null;\n }\n currentSchema = receiver;\n }\n }\n if (isJsonSchemaRef(currentSchema)) {\n currentSchema = resolveJssRef(currentSchema, platformObjectJsonSchema);\n } else if (isJsonSchemaArray(currentSchema) && isJsonSchemaRef(currentSchema.items)) {\n currentSchema = {\n ...currentSchema,\n items: {\n ...resolveJssRef(currentSchema.items, platformObjectJsonSchema),\n },\n };\n }\n if (!('type' in currentSchema)) {\n return null;\n }\n\n const schemaId = getPrimitiveSchemaId(currentSchema);\n if (schemaId && schemaId in primitiveUtilities) {\n const utilityReturnType = getPrimitiveUtilitiesReturnSchema(\n currentSchema,\n nextLink,\n primitiveUtilities[schemaId],\n );\n if (utilityReturnType) {\n return utilityReturnType;\n }\n }\n if ('properties' in currentSchema) {\n const propertySchema = currentSchema.properties[fullNodeName(nextLink)];\n if (propertySchema && isFunctionSchema(propertySchema)) {\n return propertySchema.properties.returnType;\n }\n return propertySchema ?? null;\n }\n return null;\n};\n\n/**\n * Returns the FunctionJsonSchema for `functionName` within `parentSchema`, checking both\n * primitive utilities (e.g. array/string methods) and direct object properties.\n * Returns null if not found or not a function schema.\n */\nexport const getFunctionSchemaForNode = ({\n parentSchema,\n functionName,\n isCustomFunction,\n platformObjectJsonSchema,\n primitiveUtilities,\n}: {\n parentSchema: JsonSchema;\n functionName: string;\n isCustomFunction: boolean;\n platformObjectJsonSchema: ObjectSchemaMap;\n primitiveUtilities: ObjectSchemaMap;\n}): FunctionJsonSchema | null => {\n if (isCustomFunction) {\n parentSchema = getNonNullableRefSchema(parentSchema) ?? parentSchema;\n }\n if (isJsonSchemaRef(parentSchema)) {\n parentSchema = resolveJssRef(parentSchema, platformObjectJsonSchema);\n }\n\n const schemaId = getPrimitiveSchemaId(parentSchema);\n if (schemaId && schemaId in primitiveUtilities) {\n const utilitySchema = primitiveUtilities[schemaId].properties[functionName];\n if (utilitySchema && isFunctionSchema(utilitySchema)) {\n return utilitySchema;\n }\n }\n\n if (isJsonSchemaObject(parentSchema) && functionName in parentSchema.properties) {\n const propSchema = parentSchema.properties[functionName];\n if (isFunctionSchema(propSchema)) {\n return propSchema;\n }\n }\n\n return null;\n};\n\n// When the result is an array of platform objects (identified by objectKey on items),\n// inject a $ref so the schema structure matches has_many associations.\n// This ensures consistent operator options in conditionals.\nconst injectRefForPlatformObjectArray = (schema: JsonSchema | null): JsonSchema | null => {\n if (\n schema &&\n isJsonSchemaArray(schema) &&\n isJsonSchemaObject(schema.items) &&\n 'objectKey' in schema.items &&\n schema.items.objectKey\n ) {\n const schemaId = getSchemaId(schema.items.objectKey, MERGED_SCHEMA_ID);\n return {\n ...schema,\n items: {\n ...schema.items,\n $ref: schemaId,\n },\n };\n }\n return schema;\n};\n\nconst getPrimitiveUtilitiesReturnSchema = (\n object: JsonSchema,\n node: MethodChainNode,\n schema: JsonSchemaObject<JsonSchema | FunctionJsonSchema>,\n): JsonSchema | null => {\n const name = fullNodeName(node);\n if (!(name in schema.properties)) {\n return null;\n }\n\n const utilitySchema = schema.properties[name];\n\n const returnSchema = isFunctionSchema(utilitySchema)\n ? utilitySchema.properties.returnType\n : utilitySchema;\n\n const itemSchema = genericArrayItemSchema(object, returnSchema);\n if (itemSchema) {\n return itemSchema;\n }\n\n if (isPrecedingSchema(returnSchema)) {\n return object;\n }\n\n if (\n isConvertedTypeSchema(returnSchema) &&\n isFunctionNode(node) &&\n node.params[returnSchema.position] &&\n isStringNode(node.params[returnSchema.position])\n ) {\n const stringNode = node.params[returnSchema.position] as StringNode;\n return returnSchema.schemaByValue[stringNode.value] ?? EMPTY_JSON_SCHEMA_OBJECT;\n }\n\n if (\n isGenericParameterSchema(returnSchema) &&\n isFunctionNode(node) &&\n node.params[returnSchema.position] &&\n isStringNode(node.params[returnSchema.position])\n ) {\n const stringNode = node.params[returnSchema.position] as StringNode;\n const objectSchema = isJsonSchemaArray(object) ? object.items : object;\n if (isJsonSchemaObject(objectSchema)) {\n const path = stringNode.value.split('.');\n const resultSchema = path.reduce<JsonSchema | null>((schema, key) => {\n if (schema == null || !isJsonSchemaObject(schema) || !schema.properties[key]) {\n return null;\n }\n return schema.properties[key];\n }, objectSchema);\n\n return injectRefForPlatformObjectArray(resultSchema);\n }\n }\n\n return 'genericType' in returnSchema ? EMPTY_JSON_SCHEMA_OBJECT : returnSchema;\n};\n\n/**\n * @param path\n * @param allowedFieldPaths - can be a complete path to a base type field\n * (e.g. 'data.some.string_field'), or a partial path to an object ('data')\n * @param fieldPathsAreStrictMatch - true if we only want to match exact paths in allowedFieldPaths and disallowedFieldPaths\n */\nconst isAllowedPath = (path: string, allowedFieldPaths: string[]) => {\n return allowedFieldPaths.some((fieldPath) => {\n const valueIsPartialMatch = fieldPath.startsWith(path);\n const valueIsNestedProp = path.startsWith(`${fieldPath}.`);\n return valueIsPartialMatch || valueIsNestedProp;\n });\n};\n\n/**\n * @param path\n * @param disallowedFieldPaths - can be a complete path to a base type field\n * (e.g. 'data.some.string_field'), or a partial path to an object ('data')\n */\nconst isDisallowedPath = (path: string, disallowedFieldPaths: string[]) => {\n return disallowedFieldPaths.some((fieldPath) => {\n const valueIsMatch = fieldPath === path;\n const valueIsNestedProp = path.startsWith(`${fieldPath}.`);\n return valueIsMatch || valueIsNestedProp;\n });\n};\n\nexport const isTypeMatch = ({\n fieldJsonSchema,\n types,\n platformObjectJsonSchema = {},\n arrayTypes,\n traversedSchemaIds = new Set(),\n}: {\n fieldJsonSchema: JsonSchema;\n types: PossibleType[];\n platformObjectJsonSchema: ObjectSchemaMap;\n arrayTypes?: PossibleArrayType[];\n traversedSchemaIds?: Set<string>;\n}): boolean => {\n const resolvedSchema = isJsonSchemaRef(fieldJsonSchema)\n ? resolveJssRef(fieldJsonSchema, platformObjectJsonSchema)\n : fieldJsonSchema;\n\n if (resolvedSchema.$id) {\n if (traversedSchemaIds.has(resolvedSchema.$id)) {\n // We've already traversed this schema ID, which there were no\n // valid types found for it, so return false to avoid infinite loops\n return false;\n } else {\n // If we haven't traversed this schema ID yet, add it to the set\n // This allows us to avoid infinite loops when resolving references\n // in recursive schemas\n traversedSchemaIds.add(resolvedSchema.$id);\n }\n }\n\n const fieldJsonSchemaType = getJsonSchemaType(resolvedSchema);\n switch (fieldJsonSchemaType) {\n case JsonSchemaAllTypes.Object: {\n const objectSchema = resolvedSchema as JsonSchemaObject;\n // For generic JsonSchemaObjectKey such as 'report' or 'verification', we match on subtypes\n // like 'business-watchlist' as well; otherwise, generics don't show anything\n const isObjectKeyOfType = (type: JsonSchemaObjectKey) =>\n objectSchema.objectKey &&\n types.includes(type) &&\n objectSchema.objectKey.split('/')[0] === type;\n\n if (\n types.includes(JsonSchemaTypes.Object) ||\n (objectSchema.objectKey && types.includes(objectSchema.objectKey)) ||\n isObjectKeyOfType('report') ||\n isObjectKeyOfType('verification')\n ) {\n return true;\n }\n\n return Object.values(objectSchema.properties || {}).some((propJsonSchema) =>\n isTypeMatch({\n fieldJsonSchema: propJsonSchema,\n types,\n platformObjectJsonSchema,\n arrayTypes,\n traversedSchemaIds: traversedSchemaIds,\n }),\n );\n }\n case JsonSchemaAllTypes.Array: {\n const arraySchema = resolvedSchema as JsonSchemaArray;\n const itemSchema = isJsonSchemaRef(arraySchema.items)\n ? resolveJssRef(arraySchema.items, platformObjectJsonSchema)\n : arraySchema.items;\n return (\n types.includes(JsonSchemaAllTypes.Array) &&\n // Don't recurse on array, otherwise we risk matching on objects within the array\n !!arrayTypes &&\n arrayTypes.some(\n (schemaType) =>\n schemaType === getJsonSchemaType(itemSchema) ||\n (isJsonSchemaObject(itemSchema) && schemaType === itemSchema.objectKey),\n )\n );\n }\n case JsonSchemaAllTypes.String:\n case JsonSchemaAllTypes.Number:\n case JsonSchemaAllTypes.Boolean:\n case JsonSchemaAllTypes.Integer:\n case JsonSchemaAllTypes.Date:\n case JsonSchemaAllTypes.Datetime:\n case JsonSchemaAllTypes.Enum:\n case JsonSchemaAllTypes.MultiEnum:\n case JsonSchemaAllTypes.GroupedEnum:\n case JsonSchemaAllTypes.Unknown: {\n return types.some((schemaType) => schemaType === fieldJsonSchemaType);\n }\n default:\n return false;\n }\n};\n\nexport interface OptionFilters {\n allowedArrayTypes?: PossibleArrayType[];\n allowedFieldPaths?: string[];\n allowedTypes?: PossibleType[];\n disallowedFieldPaths?: string[];\n fieldPathsAreStrictMatch?: boolean;\n requiredPropertyShape?: string[]; // Array of property names that must exist in the schema\n}\n\nexport const hasRequiredPropertyShape = (\n schema: JsonSchema,\n requiredPropertyShape: string[],\n platformObjectJsonSchema: ObjectSchemaMap = {},\n checkRecursively: boolean = true,\n): boolean => {\n if (!requiredPropertyShape?.length) {\n return true;\n }\n\n const resolvedSchema = isJsonSchemaRef(schema)\n ? resolveJssRef(schema, platformObjectJsonSchema)\n : schema;\n\n if (\n resolvedSchema &&\n 'type' in resolvedSchema &&\n resolvedSchema.type === JsonSchemaTypes.Object &&\n 'properties' in resolvedSchema &&\n resolvedSchema.properties\n ) {\n const schemaProperties = resolvedSchema.properties as Record<string, JsonSchema>;\n const hasAllProperties = requiredPropertyShape.every(\n (propName) => propName in schemaProperties,\n );\n\n if (hasAllProperties) {\n return true;\n }\n\n if (checkRecursively) {\n return Object.values(schemaProperties).some((propSchema) =>\n hasRequiredPropertyShape(\n propSchema,\n requiredPropertyShape,\n platformObjectJsonSchema,\n checkRecursively,\n ),\n );\n }\n }\n return false;\n};\n\nconst filterForAllowedSchemaOptions = (\n options: Option[] = [],\n {\n allowedArrayTypes,\n allowedFieldPaths,\n allowedTypes,\n disallowedFieldPaths,\n fieldPathsAreStrictMatch,\n requiredPropertyShape,\n }: OptionFilters,\n platformObjectJsonSchema: ObjectSchemaMap = {},\n) => {\n let filteredOptions = options;\n\n if (fieldPathsAreStrictMatch) {\n if (allowedFieldPaths?.length || disallowedFieldPaths?.length || allowedTypes?.length) {\n filteredOptions = filteredOptions.filter((option) =>\n isValidOption(\n option.schema,\n allowedFieldPaths ?? [],\n disallowedFieldPaths ?? [],\n allowedTypes ?? [],\n allowedArrayTypes ?? [],\n option.value.split('.'),\n platformObjectJsonSchema,\n ),\n );\n }\n } else {\n if (allowedFieldPaths?.length) {\n filteredOptions = filteredOptions.filter((option) =>\n isAllowedPath(option.value, allowedFieldPaths),\n );\n }\n if (disallowedFieldPaths?.length) {\n filteredOptions = filteredOptions.filter(\n (option) => !isDisallowedPath(option.value, disallowedFieldPaths),\n );\n }\n if (allowedTypes?.length) {\n filteredOptions = filteredOptions.filter((option) =>\n isTypeMatch({\n fieldJsonSchema: option.schema,\n types: allowedTypes,\n platformObjectJsonSchema,\n arrayTypes: allowedArrayTypes,\n }),\n );\n }\n }\n\n // Add a recursive function to check if schema or any nested schema has the required properties\n if (requiredPropertyShape?.length) {\n filteredOptions = filteredOptions.filter((option) =>\n hasRequiredPropertyShape(option.schema, requiredPropertyShape, platformObjectJsonSchema),\n );\n }\n\n return filteredOptions;\n};\n\nexport const getOptionForValue = ({\n value,\n jsonSchema,\n schemaForFieldPath,\n}: {\n value: string;\n jsonSchema: JsonSchema;\n schemaForFieldPath: (\n path: string,\n initialSchema: JsonSchema,\n ) => { schema: JsonSchema | null; propertyName: string | null };\n}): Option | null => {\n const { schema, propertyName } = schemaForFieldPath(value, jsonSchema);\n if (!schema || !propertyName) {\n return null;\n }\n\n const methodChain = parseMethodChainForJSS(value);\n return {\n label: methodChain ? methodChainToString(methodChain) : value,\n value: methodChain ? methodChainToString(methodChain) : value,\n property: propertyName,\n schema,\n methodChain,\n };\n};\n\nexport const validatePath = ({\n path,\n jsonSchema,\n platformObjectJsonSchema = {},\n primitiveUtilities = {},\n optionFilters,\n}: {\n path: string;\n jsonSchema: JsonSchema;\n platformObjectJsonSchema: ObjectSchemaMap;\n primitiveUtilities: ObjectSchemaMap;\n optionFilters?: OptionFilters;\n}) => {\n const schemaOptions = getSchemaOptions({\n option: { schema: jsonSchema, methodChain: parseMethodChainForJSS('') },\n optionFilters,\n platformObjectJsonSchema,\n primitiveUtilities,\n });\n const { methodChain, partial } = parseWithPartialOption(path);\n\n const matchedSchemaOptions = methodChain.links.reduce<Option[]>((currentSchema, link) => {\n if (currentSchema.length === 0) {\n return [];\n }\n const optionMatch = currentSchema.find((option) => option.property === link.name);\n if (optionMatch) {\n return getSchemaOptions({\n option: optionMatch,\n optionFilters,\n platformObjectJsonSchema,\n primitiveUtilities,\n });\n }\n return [];\n }, schemaOptions);\n\n const optionsWithPartiallyMatchedFinalLink = matchedSchemaOptions.filter((option) =>\n option.property.includes(partial),\n );\n return {\n valid: optionsWithPartiallyMatchedFinalLink.length > 0,\n schemaOptions: optionsWithPartiallyMatchedFinalLink,\n partial,\n };\n};\n\n/**\n * Given a method chain that corresponds to the passed schema, find the right-most indentifier that\n * is a platform object and split the method chain on that identifier, with the platform object on\n * the left side.\n *\n * This function is used to optimize a method chain into two parts, left side for server resolution\n * and right side for client resolution.\n *\n * For example:\n * current_case.fields.field_a -> ['current_case', 'fields.field_a']\n * current_case.inquiries.first.id -> ['current_case.inquiries.first', 'id']\n * current_case.account.fields.field_b -> ['current_case.account', 'fields.field_b']\n */\nexport const splitAtNearestParentObject = (\n chain: Chain,\n currentSchema: JsonSchemaObject,\n platformSchemaMap: ObjectSchemaMap,\n primitiveUtilities: ObjectSchemaMap,\n): [leftChain: Chain, rightChain: Chain] => {\n // Create a list of schemas that match each link in the method chain.\n // The list is reversed such that the first schema matches the last link of the method chain\n // for the next step.\n const leafUpLinkSchemas: (JsonSchema | null)[] = [currentSchema];\n for (const link of chain.links) {\n const nextSchema = nextLinkSchema({\n currentSchema: leafUpLinkSchemas[0],\n nextLink: link,\n platformObjectJsonSchema: platformSchemaMap,\n primitiveUtilities,\n });\n leafUpLinkSchemas.unshift(nextSchema);\n }\n\n // List of links that correspond to the left and right sides of the split.\n // As we walk the schema from leaf to root, we move links to the right side.\n const leafUpLeftLinks = [...chain.links].reverse();\n const leafUpRightLinks: typeof leafUpLeftLinks = [];\n\n for (const [i, linkSchema] of leafUpLinkSchemas.entries()) {\n if (!linkSchema) {\n // When the schema is unknown, check if the current link is an identifier accessing a\n // property on an unresolvable platform object ref. If any remaining schema in the\n // ancestor chain is a $ref (or array of $refs), we're within a platform object whose\n // schema couldn't be resolved — push the identifier to the client (right) side.\n if (isIdentifierNode(leafUpLeftLinks[0])) {\n const nearestPlatformAncestor = leafUpLinkSchemas\n .slice(i + 1)\n .find(\n (s) => s && (isJsonSchemaRef(s) || (isJsonSchemaArray(s) && isJsonSchemaRef(s.items))),\n );\n if (nearestPlatformAncestor) {\n leafUpRightLinks.push(leafUpLeftLinks.shift()!);\n continue;\n }\n }\n // If we are missing schema, break out asap to keep links on the left.\n break;\n } else if ('$id' in linkSchema || isJsonSchemaRef(linkSchema)) {\n break;\n } else if (isJsonSchemaArray(linkSchema)) {\n if ('$id' in linkSchema.items || isJsonSchemaRef(linkSchema.items)) {\n break;\n }\n // Array-returning functions (filter, sort, etc.) on platform object arrays\n // must be resolved server-side even when the items ref cannot be resolved.\n if (isFunctionNode(leafUpLeftLinks[0])) {\n break;\n }\n } else if (isFunctionNode(leafUpLeftLinks[0])) {\n break;\n } else if (isIdentifierNode(leafUpLeftLinks[0])) {\n const nextSchema = leafUpLinkSchemas[i + 1];\n // If the preceding schema has a primitive schema ID in the utilities, the identifier\n // was resolved via primitive utilities (e.g. 'trim' on a string, 'count' on an array).\n // The server handles these inline, so keep the whole chain server-side.\n if (nextSchema) {\n const primitiveId = getPrimitiveSchemaId(nextSchema);\n if (primitiveId && primitiveId in primitiveUtilities) {\n break;\n }\n }\n // Real special case here. If:\n // - The current link is an identifier\n // - The next schema is an array\n // = break out, because we don't want to load the whole array into the client\n if (nextSchema && isJsonSchemaArray(nextSchema)) {\n break;\n }\n }\n\n leafUpRightLinks.push(leafUpLeftLinks.shift()!);\n }\n\n const leftChain: Chain = {\n type: MethodChainNodeTypes.Chain,\n links: leafUpLeftLinks.reverse(),\n };\n const rightChain: Chain = {\n type: MethodChainNodeTypes.Chain,\n links: leafUpRightLinks.reverse(),\n };\n return [leftChain, rightChain];\n};\n"],"mappings":";;;;;;AA6DA,MAAM,gBAAgB,SACpB,GAAG,KAAK,SAAS,qBAAqB,iBAAiB,MAAM,KAAK,KAAK;AAazE,MAAM,sBAAsB;;;;;;;AAQ5B,MAAa,4BACX,QACA,2BAA4C,EAAE,KAC5B;AAClB,KAAI,CAAC,OACH,QAAO;AAET,KAAI,gBAAgB,OAAO,EAAE;EAC3B,MAAM,WAAW,OAAO,MAAM,MAAM,oBAAoB;AACxD,MAAI,SACF,QAAO,SAAS;AAElB,SAAO,yBACL,cAAc,QAAQ,yBAAyB,EAC/C,yBACD;;AAEH,KAAI,SAAS,UAAU,OAAO,OAAO,QAAQ,UAAU;EACrD,MAAM,UAAU,OAAO,IAAI,MAAM,oBAAoB;AACrD,MAAI,QACF,QAAO,QAAQ;;AAKnB,KAAI,eAAe,UAAU,OAAO,OAAO,cAAc,SACvD,QAAO,OAAO,UAAU,MAAM,IAAI,CAAC;AAErC,QAAO,oCAAoC,OAAO;;AAMpD,MAAM,kBACJ,QACA,cACA,sBACG;AACH,KAAI,aAAa,WAAW,EAC1B,QAAO;CAET,MAAM,iBAAiB,kBAAkB,OAAO;AAEhD,KACE,aAAa,MAAM,eAAe,eAAA,SAAsC,IACxE,6BAA6B,MAAM,eAAe,eAAe,eAAe,CAEhF,QAAO;UACE,mBAAmB,mBAAmB,OAAO;EACtD,MAAM,cAAc,WAAW,SAAS,OAAO,QAAQ;AACvD,MACE,CAAC,aAAa,SAAS,mBAAmB,MAAM,IAE/C,mBAAmB,UAClB,CAAC,kBAAkB,MAAM,eAAe,eAAe,kBAAkB,YAAY,CAAC,CAExF,QAAO;YAGT,mBAAmB,mBAAmB,UACtC,CAAC,aAAa,MAAM,eAAe,eAAe,eAAe,CAEjE,QAAO;AAET,QAAO;;AAoBT,MAAM,uBACJ,QACA,mBACA,s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AI,cAAc,kBAAkB,WAAW,CAC7C;;AAIJ,mBAAiB,KAAK,gBAAgB,OAAO,CAAE;;AAWjD,QAAO,CAAC;EAPN,MAAM,qBAAqB;EAC3B,OAAO,gBAAgB,SAAS;EAMjB,EAAE;EAHjB,MAAM,qBAAqB;EAC3B,OAAO,iBAAiB,SAAS;EAEN,CAAC"}
|
|
1
|
+
{"version":3,"file":"schemaOptions.mjs","names":[],"sources":["../../src/lib/schemaOptions.ts"],"sourcesContent":["import { compact, flatten, last, sortBy, trim } from 'lodash-es';\n\nimport { assertNever } from './assertNever';\nimport {\n JsonSchemaAllTypes,\n type JsonSchemaCustomTypes,\n JsonSchemaStringifiableTypes,\n EMPTY_JSON_SCHEMA_OBJECT,\n getNonNullableRefSchema,\n genericArrayItemSchema,\n getNonNullableType,\n isConvertedTypeSchema,\n isFileType,\n isFunctionSchema,\n isGenericParameterSchema,\n isJsonSchemaArray,\n isJsonSchemaDate,\n isJsonSchemaDateTime,\n isJsonSchemaObject,\n isJsonSchemaRef,\n isJsonSchemaString,\n isJsonType,\n isPrecedingSchema,\n type JsonSchema,\n type JsonSchemaArray,\n type JsonSchemaBasicTypes,\n type JsonSchemaObject,\n JsonSchemaTypes,\n type JsonSchemaObjectKey,\n} from './jsonSchema';\nimport { getJsonSchemaType } from './jsonSchemaType';\nimport {\n appendedMethodChain,\n type Chain,\n EMPTY_METHOD_CHAIN,\n isIdentifierNode,\n isFunctionNode,\n isStringNode,\n isValid,\n type MethodChainNode,\n MethodChainNodeTypes,\n methodChainToString,\n parseMethodChain,\n parseWithPartialOption,\n type StringNode,\n} from './methodChain';\nimport type { FunctionJsonSchema, ObjectSchemaMap } from './objectSchemaTypes';\nimport {\n getPlatformObjectTypeFromJsonSchema,\n getSchemaId,\n MERGED_SCHEMA_ID,\n PrimitiveSchemaId,\n resolveJssRef,\n} from './platformObject';\n\ntype VariableSchemaObject = {\n value: string;\n schema?: JsonSchema | null;\n isVariable?: boolean;\n};\n\nconst fullNodeName = (node: MethodChainNode): string =>\n `${node.type === MethodChainNodeTypes.CustomFunction ? '@' : ''}${node.name}`;\n\nexport type Option = {\n label: string;\n value: string;\n property: string;\n schema: JsonSchema | FunctionJsonSchema;\n methodChain: Chain | null;\n utility?: boolean;\n workflowObjectKey?: string;\n isVariable?: boolean;\n};\n\nconst SCHEMA_PATH_PATTERN = /\\/schema\\/([a-z][a-z0-9-_]*)/i;\n\n/**\n * Extracts the top-level platform-object key from a schema's `$ref`/`$id`/\n * `objectKey`/`objectType.const` markers. Collapses subtypes to their root\n * (`/schema/verification/document/merged` -> `verification`) because callers\n * compare against top-level `ApiModel` values.\n */\nexport const extractPlatformObjectKey = (\n schema: JsonSchema | null | undefined,\n platformObjectJsonSchema: ObjectSchemaMap = {},\n): string | null => {\n if (!schema) {\n return null;\n }\n if (isJsonSchemaRef(schema)) {\n const refMatch = schema.$ref?.match(SCHEMA_PATH_PATTERN);\n if (refMatch) {\n return refMatch[1];\n }\n return extractPlatformObjectKey(\n resolveJssRef(schema, platformObjectJsonSchema),\n platformObjectJsonSchema,\n );\n }\n if ('$id' in schema && typeof schema.$id === 'string') {\n const idMatch = schema.$id.match(SCHEMA_PATH_PATTERN);\n if (idMatch) {\n return idMatch[1];\n }\n }\n // Serialized PLOB columns carry `objectKey` on a scalar schema (no `$ref`), so\n // read it regardless of `type`, collapsing subtypes to root like the `$ref` branch.\n if ('objectKey' in schema && typeof schema.objectKey === 'string') {\n return schema.objectKey.split('/')[0];\n }\n return getPlatformObjectTypeFromJsonSchema(schema);\n};\n\ntype PossibleType = JsonSchemaTypes | JsonSchemaCustomTypes | JsonSchemaObjectKey;\ntype PossibleArrayType = JsonSchemaBasicTypes | JsonSchemaTypes.Object | JsonSchemaObjectKey;\n\nconst isMatchingType = (\n schema: JsonSchema,\n allowedTypes: PossibleType[],\n allowedArrayTypes: PossibleArrayType[],\n) => {\n if (allowedTypes.length === 0) {\n return true;\n }\n const jsonSchemaType = getJsonSchemaType(schema);\n // If strings are allowed and the field is string-able, let it through.\n if (\n allowedTypes.some((schemaType) => schemaType === JsonSchemaTypes.String) &&\n JsonSchemaStringifiableTypes.some((schemaType) => schemaType === jsonSchemaType)\n ) {\n return true;\n } else if (jsonSchemaType === JsonSchemaAllTypes.Array) {\n const itemsSchema = 'items' in schema ? schema.items : null;\n if (\n !allowedTypes.includes(JsonSchemaAllTypes.Array) ||\n // Don't recurse on array, otherwise we risk matching on objects within the array\n (allowedArrayTypes?.length &&\n !allowedArrayTypes.some((schemaType) => schemaType === getJsonSchemaType(itemsSchema)))\n ) {\n return false;\n }\n } else if (\n jsonSchemaType !== JsonSchemaAllTypes.Object &&\n !allowedTypes.some((schemaType) => schemaType === jsonSchemaType)\n ) {\n return false;\n }\n return true;\n};\n\n// isValidOptionHelper returns true if the schema provided is (in order of precedence)\n// 1) not a disallowed by name\n// AND 2) not a disallowed type\n// AND 3) allowed field by name (either explicitly or implicitly)\n// at each level (we recurse down for object types), we check that the fields at the level fit the above 1,2 and 3\n//\n// 1) is straight forward. if a field is named as disallowed it has the most precedence\n// 2) the field is disallowed by type if the allowedTypes are specified AND\n// - if the field is an array, then\n// - arrays are in allowedTypes\n// - AND (its `items` type is in `allowedArrayTypes` OR `allowedArrayTypes` is empty)\n// - if the field is an object, we do nothing since the recursion is handled at the `isValidOptionHelper` level\n// - else, the field type appears in allowedTypes\n// 3) we can be allowed by name\n// - explicitly, which means the field is named explicitly as an allowedFieldPath (this has precedence)\n// - implicitly, which means that there are no fields explicitly named in allowedFieldPath\n// - an object field can be allowed implicitly if it has at least one valid children\nconst isValidOptionHelper = (\n schema: JsonSchema,\n allowedFieldPaths: Set<string>,\n disallowedFieldPaths: Set<string>,\n allowedTypes: PossibleType[],\n allowedArrayTypes: PossibleArrayType[],\n path: string[],\n platformObjectJsonSchema: ObjectSchemaMap,\n traversedSchemaIds = new Set(),\n): boolean => {\n const resolvedSchema = isJsonSchemaRef(schema)\n ? resolveJssRef(schema, platformObjectJsonSchema)\n : schema;\n\n if (resolvedSchema.$id) {\n if (traversedSchemaIds.has(resolvedSchema.$id)) {\n // We've already traversed this schema ID, which there were no\n // valid types found for it, so return false to avoid infinite loops\n return false;\n } else {\n // If we haven't traversed this schema ID yet, add it to the set\n // This allows us to avoid infinite loops when resolving references\n // in recursive schemas\n traversedSchemaIds.add(resolvedSchema.$id);\n }\n }\n const dotPath = path.join('.');\n if (disallowedFieldPaths.has(dotPath)) {\n return false;\n }\n if (!isMatchingType(resolvedSchema, allowedTypes, allowedArrayTypes)) {\n return false;\n }\n if (allowedFieldPaths.has(dotPath)) {\n return true;\n }\n // if we are here it means\n // - our type is valid\n // - we are not disallowed\n // - we are not explicitly allowed\n // if we are here, we are only valid if\n // - we are an object and at least one of our properties are valid\n // OR, we are not an object and allowedFieldPaths is empty\n const jsonSchemaType = getJsonSchemaType(resolvedSchema);\n if (jsonSchemaType === JsonSchemaTypes.Object) {\n // A schemaless JSON field is an opaque leaf, so it has no child to qualify it as an option.\n if ('fieldType' in resolvedSchema && isJsonType(resolvedSchema.fieldType)) {\n return allowedFieldPaths.size === 0;\n }\n return (\n 'properties' in resolvedSchema &&\n resolvedSchema.properties != null &&\n Object.entries(resolvedSchema.properties).some(([prop, propSchema]) =>\n isValidOptionHelper(\n propSchema,\n allowedFieldPaths,\n disallowedFieldPaths,\n allowedTypes,\n allowedArrayTypes,\n [...path, prop],\n platformObjectJsonSchema,\n traversedSchemaIds,\n ),\n )\n );\n }\n return allowedFieldPaths.size === 0;\n};\n\nexport const isValidOption = (\n schema: JsonSchema,\n allowedFieldPaths: string[],\n disallowedFieldPaths: string[],\n allowedTypes: PossibleType[],\n allowedArrayTypes: PossibleArrayType[],\n path: string[] = [],\n platformObjectJsonSchema: ObjectSchemaMap,\n): boolean => {\n const allowedFieldPathsSet =\n allowedFieldPaths == null ? new Set<string>() : new Set<string>(allowedFieldPaths);\n const disallowedFieldPathsSet =\n disallowedFieldPaths == null ? new Set<string>() : new Set<string>(disallowedFieldPaths);\n if (\n allowedFieldPathsSet.size === 0 &&\n disallowedFieldPathsSet.size === 0 &&\n allowedTypes.length === 0 &&\n allowedArrayTypes.length === 0\n ) {\n return true;\n }\n return isValidOptionHelper(\n schema,\n allowedFieldPathsSet,\n disallowedFieldPathsSet,\n allowedTypes ?? [],\n allowedArrayTypes ?? [],\n path,\n platformObjectJsonSchema,\n );\n};\n\nconst buildSchemaOptionsFor = (rootSchema: JsonSchemaObject, baseChain: Chain | null) =>\n Object.entries(rootSchema?.properties ?? {}).map(([property, propSchema]) => {\n const appended = appendedMethodChain(baseChain ?? EMPTY_METHOD_CHAIN, property);\n return {\n label: methodChainToString(appended),\n value: methodChainToString(appended),\n property,\n schema: propSchema,\n methodChain: appended,\n workflowObjectKey: 'objectKey' in propSchema ? propSchema.objectKey : undefined,\n isVariable: 'isVariable' in propSchema ? propSchema.isVariable : false,\n };\n });\n\nconst getSupportedArrayFunctions = (\n schema: JsonSchema,\n arrayPrimitive: JsonSchemaObject,\n): string[] => {\n if (isJsonSchemaArray(schema) && schema['supportedFunctions']) {\n return schema['supportedFunctions'];\n }\n return arrayPrimitive['baseSupportedFunctions'] ?? [];\n};\n\nexport const getSchemaOptions = ({\n option,\n optionFilters,\n platformObjectJsonSchema,\n primitiveUtilities,\n digPrimitives = false,\n}: {\n option: Pick<Option, 'schema' | 'methodChain'>;\n optionFilters?: OptionFilters;\n platformObjectJsonSchema: ObjectSchemaMap;\n primitiveUtilities: ObjectSchemaMap;\n digPrimitives?: boolean;\n}): Option[] => {\n const { schema, methodChain } = option;\n const nullableRefSchema = getNonNullableRefSchema(schema);\n const baseSchema = nullableRefSchema ?? schema;\n const refResolved = isJsonSchemaRef(baseSchema)\n ? resolveJssRef(baseSchema, platformObjectJsonSchema)\n : baseSchema;\n const nonNullable = refResolved && getNonNullableType(refResolved);\n const resolvedSchema = nonNullable\n ? ({ ...refResolved, type: nonNullable } as JsonSchema)\n : refResolved;\n const schemaType = getJsonSchemaType(resolvedSchema);\n\n const schemaOptions = (() => {\n switch (schemaType) {\n case JsonSchemaAllTypes.Object:\n return buildSchemaOptionsFor(resolvedSchema as JsonSchemaObject, methodChain);\n case JsonSchemaAllTypes.Array:\n case JsonSchemaAllTypes.MultiEnum: {\n if (!digPrimitives) {\n return [];\n }\n const arrayPrimitive = primitiveUtilities[PrimitiveSchemaId.Array];\n if (!arrayPrimitive) {\n return [];\n }\n const allOptions = buildSchemaOptionsFor(arrayPrimitive, methodChain);\n const supported = getSupportedArrayFunctions(resolvedSchema, arrayPrimitive);\n return allOptions.filter((opt) => supported.includes(opt.property));\n }\n case JsonSchemaAllTypes.String:\n return digPrimitives\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.String], methodChain)\n : [];\n case JsonSchemaAllTypes.Enum: {\n if (digPrimitives && isJsonSchemaString(resolvedSchema)) {\n return buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.String], methodChain);\n }\n return [];\n }\n case JsonSchemaAllTypes.File:\n return digPrimitives\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.File], methodChain)\n : [];\n // Integer/Number share a single /schema/number bucket — see the collapse\n // in `getPrimitiveSchemaId` and the backend `JSON_TYPE_TO_SCHEMA_ID`. The\n // default mock primitives don't ship utilities for these, so the lookup\n // returns CCFs only (the only properties merged in by `useChain`).\n case JsonSchemaAllTypes.Integer:\n case JsonSchemaAllTypes.Number:\n return digPrimitives && primitiveUtilities[PrimitiveSchemaId.Number]\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.Number], methodChain)\n : [];\n case JsonSchemaAllTypes.Boolean:\n return digPrimitives && primitiveUtilities[PrimitiveSchemaId.Boolean]\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.Boolean], methodChain)\n : [];\n // Date and Datetime are distinct buckets, mirroring the backend\n // `PlatformPrimitive::Date` / `PlatformPrimitive::Datetime` split. A\n // calendar-only Date receiver shouldn't surface CCFs authored against\n // timezone-bearing Datetimes (or vice versa).\n case JsonSchemaAllTypes.Date:\n return digPrimitives && primitiveUtilities[PrimitiveSchemaId.Date]\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.Date], methodChain)\n : [];\n case JsonSchemaAllTypes.Datetime:\n return digPrimitives && primitiveUtilities[PrimitiveSchemaId.Datetime]\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.Datetime], methodChain)\n : [];\n case JsonSchemaAllTypes.GroupedEnum:\n case JsonSchemaAllTypes.Null:\n case JsonSchemaAllTypes.Relation:\n case JsonSchemaAllTypes.MaskedString:\n case JsonSchemaAllTypes.Unknown:\n return [];\n default:\n assertNever(schemaType);\n }\n })();\n\n // After a possibly-null value, offer a CCF only when its receiver schema\n // accepts null. Non-CCF members stay for nullable `type` arrays but not\n // for a nullable `$ref | null` union, whose member paths `nextLinkSchema`\n // cannot resolve.\n const possiblyNull = nullableRefSchema != null || nonNullable != null;\n const nullSafeOptions = possiblyNull\n ? schemaOptions.filter((opt) => {\n if (isFunctionSchema(opt.schema) && opt.schema.codeChainFunctionToken != null) {\n return opt.schema.acceptsNullReceiver === true;\n }\n return nullableRefSchema == null;\n })\n : schemaOptions;\n\n const containsFilters = optionFilters && !!flatten(compact(Object.values(optionFilters))).length;\n const finalOptions = containsFilters\n ? filterForAllowedSchemaOptions(nullSafeOptions, optionFilters, platformObjectJsonSchema)\n : nullSafeOptions;\n return sortBy(finalOptions, (opt: Option) => opt.property.replace(/^@/, '')) as Option[];\n};\n\nexport const formatDisplayValue = (value: any) => {\n return typeof value === 'string' ? value : trim(JSON.stringify(value, null, 1), '\"');\n};\n\n/**\n * Resolves the schema at a dotted path (e.g. \"account.birthDate\").\n * Tries direct key lookup first, then traverses into nested object .properties by path part.\n * Normalizes kebab/snake at each level for key lookup.\n */\nexport function getSchemaByPath(\n properties: Record<string, JsonSchema> | null | undefined,\n path: string,\n): JsonSchema | undefined {\n if (!properties || !path) {\n return undefined;\n }\n\n const lookup = (props: Record<string, JsonSchema>, key: string): JsonSchema | undefined =>\n props[key] ?? props[key.replace(/_/g, '-')] ?? props[key.replace(/-/g, '_')];\n\n const byFullPath = lookup(properties, path);\n if (byFullPath != null) {\n return byFullPath;\n }\n\n const i = path.indexOf('.');\n if (i === -1) {\n return undefined;\n }\n const nestedKey = path.slice(0, i);\n const rest = path.slice(i + 1);\n const next = lookup(properties, nestedKey);\n if (next == null || !isJsonSchemaObject(next) || !next.properties) {\n return undefined;\n }\n return getSchemaByPath(next.properties, rest);\n}\n\nconst parseMethodChainForJSS = (path: string): Chain | null => {\n const { methodChain, partial, valid } = parseWithPartialOption(path);\n if (!valid) {\n return null;\n }\n\n if (partial.length > 0) {\n return appendedMethodChain(methodChain, partial);\n }\n\n return methodChain;\n};\n\n/**\n * The schema resolved for a key admitted by `additionalProperties: true`: valid, with an unknown\n * type. Compared by identity (e.g. by the SmartTextInput validator), so do not copy it.\n */\nexport const UNTYPED_ADDITIONAL_PROPERTY_SCHEMA: JsonSchema = Object.freeze({});\n\n/**\n * Resolves an identifier that is not a declared property of `currentSchema` through the object's\n * `additionalProperties`: its schema when one is given, `UNTYPED_ADDITIONAL_PROPERTY_SCHEMA` when\n * it is `true`, and null when extra keys are not allowed.\n */\nconst additionalPropertySchema = (\n currentSchema: JsonSchema | null,\n link: MethodChainNode,\n platformObjectJsonSchema: ObjectSchemaMap,\n): JsonSchema | null => {\n if (currentSchema == null || !isIdentifierNode(link)) {\n return null;\n }\n const resolved = isJsonSchemaRef(currentSchema)\n ? resolveJssRef(currentSchema, platformObjectJsonSchema)\n : currentSchema;\n if (!isJsonSchemaObject(resolved) || resolved.properties?.[link.name] != null) {\n return null;\n }\n const { additionalProperties } = resolved;\n if (additionalProperties === true) {\n return UNTYPED_ADDITIONAL_PROPERTY_SCHEMA;\n }\n return typeof additionalProperties === 'object' && additionalProperties != null\n ? additionalProperties\n : null;\n};\n\nexport const getSchemaForFieldPath = ({\n path,\n initialSchema,\n platformObjectJsonSchema = {},\n primitiveUtilities = {},\n}: {\n path: string;\n initialSchema: JsonSchema;\n platformObjectJsonSchema?: ObjectSchemaMap;\n primitiveUtilities?: ObjectSchemaMap;\n}): {\n schema: JsonSchema | null;\n propertyName: string | null;\n} => {\n if (!initialSchema || (!('type' in initialSchema) && !('$ref' in initialSchema))) {\n return { schema: null, propertyName: null };\n }\n\n const schema: JsonSchema = isJsonSchemaRef(initialSchema)\n ? resolveJssRef(initialSchema, platformObjectJsonSchema)\n : initialSchema;\n\n if (path === '' || !isValid(path)) {\n return { schema: null, propertyName: null };\n }\n const methodChain = parseMethodChain(path);\n if (!methodChain) {\n return { schema: null, propertyName: null };\n }\n const result = methodChain.links.reduce<JsonSchema | null>((currentSchema, link) => {\n return (\n nextLinkSchema({\n currentSchema,\n nextLink: link,\n platformObjectJsonSchema,\n primitiveUtilities,\n }) ?? additionalPropertySchema(currentSchema, link, platformObjectJsonSchema)\n );\n }, schema);\n\n const propertyName = result ? last(methodChain.links)?.name || null : null;\n return { schema: result, propertyName };\n};\n\n/**\n * Get the schema for a variable path from usableObjects.\n */\nexport const getSchemaForVariablePath = ({\n path,\n usableObjects,\n}: {\n path: string;\n usableObjects: VariableSchemaObject[];\n}): {\n schema: JsonSchema | null;\n propertyName: string | null;\n} => {\n // just variables\n const syntheticSchema: JsonSchemaObject = {\n type: JsonSchemaTypes.Object,\n properties: Object.fromEntries(\n usableObjects\n .filter((obj) => obj.schema != null && obj.isVariable === true)\n .map((obj) => [obj.value, obj.schema!]),\n ),\n };\n\n return getSchemaForFieldPath({\n path,\n initialSchema: syntheticSchema,\n });\n};\n\nconst getPrimitiveSchemaId = (schema: JsonSchema): string | null => {\n if (!('type' in schema)) {\n return null;\n }\n // The object/date/date-time guards match an exact scalar `type`, so narrow an exactly-nullable\n // union to its non-null member first. The cast mirrors `nextLinkSchema`'s receiver narrowing:\n // spreading a union member with a different `type` can't be expressed as a `JsonSchema` member.\n const nonNullableType = Array.isArray(schema.type) ? getNonNullableType(schema) : null;\n const narrowedSchema = nonNullableType\n ? ({ ...schema, type: nonNullableType } as JsonSchema)\n : schema;\n // File type has special naming: 'file' -> '/schema/field/file'\n // because the backend uses Field::File.name.underscore = 'field/file'\n // File fields have type: 'object' with fieldType: 'file'\n if (isJsonSchemaObject(narrowedSchema) && isFileType(narrowedSchema.fieldType)) {\n return PrimitiveSchemaId.File;\n }\n // Date and Datetime are encoded as `{type: 'string', format: 'date'|'date-time'}`.\n // Check before the generic string branch so date receivers don't bucket as String.\n if (isJsonSchemaDate(narrowedSchema)) {\n return PrimitiveSchemaId.Date;\n }\n if (isJsonSchemaDateTime(narrowedSchema)) {\n return PrimitiveSchemaId.Datetime;\n }\n const type = Array.isArray(schema.type) ? nonNullableType : schema.type;\n if (!type) {\n return null;\n }\n // Integer and Number share one CCF bucket — mirrors the backend collapse\n // in JSON_TYPE_TO_SCHEMA_ID. A CCF authored against a Number receiver\n // fires for both .length-style integers and float-typed values.\n if (type === JsonSchemaTypes.Integer || type === JsonSchemaTypes.Number) {\n return PrimitiveSchemaId.Number;\n }\n if (type === JsonSchemaTypes.Boolean) {\n return PrimitiveSchemaId.Boolean;\n }\n return getSchemaId(type);\n};\n\nexport const nextLinkSchema = ({\n currentSchema,\n nextLink,\n platformObjectJsonSchema,\n primitiveUtilities,\n}: {\n currentSchema: JsonSchema | null;\n nextLink: MethodChainNode;\n platformObjectJsonSchema: ObjectSchemaMap;\n primitiveUtilities: ObjectSchemaMap;\n}): JsonSchema | null => {\n if (!currentSchema) {\n return null;\n }\n // Runtime dispatches a typed null only to a CCF whose receiver schema\n // accepts null, so a nullable value resolves only through such CCFs.\n if (nextLink.type === MethodChainNodeTypes.CustomFunction) {\n const unwrapped = getNonNullableRefSchema(currentSchema);\n const nonNullType = unwrapped ? null : getNonNullableType(currentSchema);\n const receiver =\n unwrapped ?? (nonNullType ? ({ ...currentSchema, type: nonNullType } as JsonSchema) : null);\n if (receiver) {\n const fn = getFunctionSchemaForNode({\n parentSchema: currentSchema,\n functionName: fullNodeName(nextLink),\n isCustomFunction: true,\n platformObjectJsonSchema,\n primitiveUtilities,\n });\n if (fn?.acceptsNullReceiver !== true) {\n return null;\n }\n currentSchema = receiver;\n }\n }\n if (isJsonSchemaRef(currentSchema)) {\n currentSchema = resolveJssRef(currentSchema, platformObjectJsonSchema);\n } else if (isJsonSchemaArray(currentSchema) && isJsonSchemaRef(currentSchema.items)) {\n currentSchema = {\n ...currentSchema,\n items: {\n ...resolveJssRef(currentSchema.items, platformObjectJsonSchema),\n },\n };\n }\n if (!('type' in currentSchema)) {\n return null;\n }\n\n const schemaId = getPrimitiveSchemaId(currentSchema);\n if (schemaId && schemaId in primitiveUtilities) {\n const utilityReturnType = getPrimitiveUtilitiesReturnSchema(\n currentSchema,\n nextLink,\n primitiveUtilities[schemaId],\n );\n if (utilityReturnType) {\n return utilityReturnType;\n }\n }\n if ('properties' in currentSchema) {\n const propertySchema = currentSchema.properties[fullNodeName(nextLink)];\n if (propertySchema && isFunctionSchema(propertySchema)) {\n return propertySchema.properties.returnType;\n }\n return propertySchema ?? null;\n }\n return null;\n};\n\n/**\n * Returns the FunctionJsonSchema for `functionName` within `parentSchema`, checking both\n * primitive utilities (e.g. array/string methods) and direct object properties.\n * Returns null if not found or not a function schema.\n */\nexport const getFunctionSchemaForNode = ({\n parentSchema,\n functionName,\n isCustomFunction,\n platformObjectJsonSchema,\n primitiveUtilities,\n}: {\n parentSchema: JsonSchema;\n functionName: string;\n isCustomFunction: boolean;\n platformObjectJsonSchema: ObjectSchemaMap;\n primitiveUtilities: ObjectSchemaMap;\n}): FunctionJsonSchema | null => {\n if (isCustomFunction) {\n parentSchema = getNonNullableRefSchema(parentSchema) ?? parentSchema;\n }\n if (isJsonSchemaRef(parentSchema)) {\n parentSchema = resolveJssRef(parentSchema, platformObjectJsonSchema);\n }\n\n const schemaId = getPrimitiveSchemaId(parentSchema);\n if (schemaId && schemaId in primitiveUtilities) {\n const utilitySchema = primitiveUtilities[schemaId].properties[functionName];\n if (utilitySchema && isFunctionSchema(utilitySchema)) {\n return utilitySchema;\n }\n }\n\n if (isJsonSchemaObject(parentSchema) && functionName in parentSchema.properties) {\n const propSchema = parentSchema.properties[functionName];\n if (isFunctionSchema(propSchema)) {\n return propSchema;\n }\n }\n\n return null;\n};\n\n// When the result is an array of platform objects (identified by objectKey on items),\n// inject a $ref so the schema structure matches has_many associations.\n// This ensures consistent operator options in conditionals.\nconst injectRefForPlatformObjectArray = (schema: JsonSchema | null): JsonSchema | null => {\n if (\n schema &&\n isJsonSchemaArray(schema) &&\n isJsonSchemaObject(schema.items) &&\n 'objectKey' in schema.items &&\n schema.items.objectKey\n ) {\n const schemaId = getSchemaId(schema.items.objectKey, MERGED_SCHEMA_ID);\n return {\n ...schema,\n items: {\n ...schema.items,\n $ref: schemaId,\n },\n };\n }\n return schema;\n};\n\nconst getPrimitiveUtilitiesReturnSchema = (\n object: JsonSchema,\n node: MethodChainNode,\n schema: JsonSchemaObject<JsonSchema | FunctionJsonSchema>,\n): JsonSchema | null => {\n const name = fullNodeName(node);\n if (!(name in schema.properties)) {\n return null;\n }\n\n const utilitySchema = schema.properties[name];\n\n const returnSchema = isFunctionSchema(utilitySchema)\n ? utilitySchema.properties.returnType\n : utilitySchema;\n\n const itemSchema = genericArrayItemSchema(object, returnSchema);\n if (itemSchema) {\n return itemSchema;\n }\n\n if (isPrecedingSchema(returnSchema)) {\n return object;\n }\n\n if (\n isConvertedTypeSchema(returnSchema) &&\n isFunctionNode(node) &&\n node.params[returnSchema.position] &&\n isStringNode(node.params[returnSchema.position])\n ) {\n const stringNode = node.params[returnSchema.position] as StringNode;\n return returnSchema.schemaByValue[stringNode.value] ?? EMPTY_JSON_SCHEMA_OBJECT;\n }\n\n if (\n isGenericParameterSchema(returnSchema) &&\n isFunctionNode(node) &&\n node.params[returnSchema.position] &&\n isStringNode(node.params[returnSchema.position])\n ) {\n const stringNode = node.params[returnSchema.position] as StringNode;\n const objectSchema = isJsonSchemaArray(object) ? object.items : object;\n if (isJsonSchemaObject(objectSchema)) {\n const path = stringNode.value.split('.');\n const resultSchema = path.reduce<JsonSchema | null>((schema, key) => {\n if (schema == null || !isJsonSchemaObject(schema) || !schema.properties[key]) {\n return null;\n }\n return schema.properties[key];\n }, objectSchema);\n\n return injectRefForPlatformObjectArray(resultSchema);\n }\n }\n\n return 'genericType' in returnSchema ? EMPTY_JSON_SCHEMA_OBJECT : returnSchema;\n};\n\n/**\n * @param path\n * @param allowedFieldPaths - can be a complete path to a base type field\n * (e.g. 'data.some.string_field'), or a partial path to an object ('data')\n * @param fieldPathsAreStrictMatch - true if we only want to match exact paths in allowedFieldPaths and disallowedFieldPaths\n */\nconst isAllowedPath = (path: string, allowedFieldPaths: string[]) => {\n return allowedFieldPaths.some((fieldPath) => {\n const valueIsPartialMatch = fieldPath.startsWith(path);\n const valueIsNestedProp = path.startsWith(`${fieldPath}.`);\n return valueIsPartialMatch || valueIsNestedProp;\n });\n};\n\n/**\n * @param path\n * @param disallowedFieldPaths - can be a complete path to a base type field\n * (e.g. 'data.some.string_field'), or a partial path to an object ('data')\n */\nconst isDisallowedPath = (path: string, disallowedFieldPaths: string[]) => {\n return disallowedFieldPaths.some((fieldPath) => {\n const valueIsMatch = fieldPath === path;\n const valueIsNestedProp = path.startsWith(`${fieldPath}.`);\n return valueIsMatch || valueIsNestedProp;\n });\n};\n\nexport const isTypeMatch = ({\n fieldJsonSchema,\n types,\n platformObjectJsonSchema = {},\n arrayTypes,\n traversedSchemaIds = new Set(),\n}: {\n fieldJsonSchema: JsonSchema;\n types: PossibleType[];\n platformObjectJsonSchema: ObjectSchemaMap;\n arrayTypes?: PossibleArrayType[];\n traversedSchemaIds?: Set<string>;\n}): boolean => {\n const resolvedSchema = isJsonSchemaRef(fieldJsonSchema)\n ? resolveJssRef(fieldJsonSchema, platformObjectJsonSchema)\n : fieldJsonSchema;\n\n if (resolvedSchema.$id) {\n if (traversedSchemaIds.has(resolvedSchema.$id)) {\n // We've already traversed this schema ID, which there were no\n // valid types found for it, so return false to avoid infinite loops\n return false;\n } else {\n // If we haven't traversed this schema ID yet, add it to the set\n // This allows us to avoid infinite loops when resolving references\n // in recursive schemas\n traversedSchemaIds.add(resolvedSchema.$id);\n }\n }\n\n const fieldJsonSchemaType = getJsonSchemaType(resolvedSchema);\n switch (fieldJsonSchemaType) {\n case JsonSchemaAllTypes.Object: {\n const objectSchema = resolvedSchema as JsonSchemaObject;\n // For generic JsonSchemaObjectKey such as 'report' or 'verification', we match on subtypes\n // like 'business-watchlist' as well; otherwise, generics don't show anything\n const isObjectKeyOfType = (type: JsonSchemaObjectKey) =>\n objectSchema.objectKey &&\n types.includes(type) &&\n objectSchema.objectKey.split('/')[0] === type;\n\n if (\n types.includes(JsonSchemaTypes.Object) ||\n (objectSchema.objectKey && types.includes(objectSchema.objectKey)) ||\n isObjectKeyOfType('report') ||\n isObjectKeyOfType('verification')\n ) {\n return true;\n }\n\n return Object.values(objectSchema.properties || {}).some((propJsonSchema) =>\n isTypeMatch({\n fieldJsonSchema: propJsonSchema,\n types,\n platformObjectJsonSchema,\n arrayTypes,\n traversedSchemaIds: traversedSchemaIds,\n }),\n );\n }\n case JsonSchemaAllTypes.Array: {\n const arraySchema = resolvedSchema as JsonSchemaArray;\n const itemSchema = isJsonSchemaRef(arraySchema.items)\n ? resolveJssRef(arraySchema.items, platformObjectJsonSchema)\n : arraySchema.items;\n return (\n types.includes(JsonSchemaAllTypes.Array) &&\n // Don't recurse on array, otherwise we risk matching on objects within the array\n !!arrayTypes &&\n arrayTypes.some(\n (schemaType) =>\n schemaType === getJsonSchemaType(itemSchema) ||\n (isJsonSchemaObject(itemSchema) && schemaType === itemSchema.objectKey),\n )\n );\n }\n case JsonSchemaAllTypes.String:\n case JsonSchemaAllTypes.Number:\n case JsonSchemaAllTypes.Boolean:\n case JsonSchemaAllTypes.Integer:\n case JsonSchemaAllTypes.Date:\n case JsonSchemaAllTypes.Datetime:\n case JsonSchemaAllTypes.Enum:\n case JsonSchemaAllTypes.MultiEnum:\n case JsonSchemaAllTypes.GroupedEnum:\n case JsonSchemaAllTypes.Unknown: {\n return types.some((schemaType) => schemaType === fieldJsonSchemaType);\n }\n default:\n return false;\n }\n};\n\nexport interface OptionFilters {\n allowedArrayTypes?: PossibleArrayType[];\n allowedFieldPaths?: string[];\n allowedTypes?: PossibleType[];\n disallowedFieldPaths?: string[];\n fieldPathsAreStrictMatch?: boolean;\n requiredPropertyShape?: string[]; // Array of property names that must exist in the schema\n}\n\nexport const hasRequiredPropertyShape = (\n schema: JsonSchema,\n requiredPropertyShape: string[],\n platformObjectJsonSchema: ObjectSchemaMap = {},\n checkRecursively: boolean = true,\n): boolean => {\n if (!requiredPropertyShape?.length) {\n return true;\n }\n\n const resolvedSchema = isJsonSchemaRef(schema)\n ? resolveJssRef(schema, platformObjectJsonSchema)\n : schema;\n\n if (\n resolvedSchema &&\n 'type' in resolvedSchema &&\n resolvedSchema.type === JsonSchemaTypes.Object &&\n 'properties' in resolvedSchema &&\n resolvedSchema.properties\n ) {\n const schemaProperties = resolvedSchema.properties as Record<string, JsonSchema>;\n const hasAllProperties = requiredPropertyShape.every(\n (propName) => propName in schemaProperties,\n );\n\n if (hasAllProperties) {\n return true;\n }\n\n if (checkRecursively) {\n return Object.values(schemaProperties).some((propSchema) =>\n hasRequiredPropertyShape(\n propSchema,\n requiredPropertyShape,\n platformObjectJsonSchema,\n checkRecursively,\n ),\n );\n }\n }\n return false;\n};\n\nconst filterForAllowedSchemaOptions = (\n options: Option[] = [],\n {\n allowedArrayTypes,\n allowedFieldPaths,\n allowedTypes,\n disallowedFieldPaths,\n fieldPathsAreStrictMatch,\n requiredPropertyShape,\n }: OptionFilters,\n platformObjectJsonSchema: ObjectSchemaMap = {},\n) => {\n let filteredOptions = options;\n\n if (fieldPathsAreStrictMatch) {\n if (allowedFieldPaths?.length || disallowedFieldPaths?.length || allowedTypes?.length) {\n filteredOptions = filteredOptions.filter((option) =>\n isValidOption(\n option.schema,\n allowedFieldPaths ?? [],\n disallowedFieldPaths ?? [],\n allowedTypes ?? [],\n allowedArrayTypes ?? [],\n option.value.split('.'),\n platformObjectJsonSchema,\n ),\n );\n }\n } else {\n if (allowedFieldPaths?.length) {\n filteredOptions = filteredOptions.filter((option) =>\n isAllowedPath(option.value, allowedFieldPaths),\n );\n }\n if (disallowedFieldPaths?.length) {\n filteredOptions = filteredOptions.filter(\n (option) => !isDisallowedPath(option.value, disallowedFieldPaths),\n );\n }\n if (allowedTypes?.length) {\n filteredOptions = filteredOptions.filter((option) =>\n isTypeMatch({\n fieldJsonSchema: option.schema,\n types: allowedTypes,\n platformObjectJsonSchema,\n arrayTypes: allowedArrayTypes,\n }),\n );\n }\n }\n\n // Add a recursive function to check if schema or any nested schema has the required properties\n if (requiredPropertyShape?.length) {\n filteredOptions = filteredOptions.filter((option) =>\n hasRequiredPropertyShape(option.schema, requiredPropertyShape, platformObjectJsonSchema),\n );\n }\n\n return filteredOptions;\n};\n\nexport const getOptionForValue = ({\n value,\n jsonSchema,\n schemaForFieldPath,\n}: {\n value: string;\n jsonSchema: JsonSchema;\n schemaForFieldPath: (\n path: string,\n initialSchema: JsonSchema,\n ) => { schema: JsonSchema | null; propertyName: string | null };\n}): Option | null => {\n const { schema, propertyName } = schemaForFieldPath(value, jsonSchema);\n if (!schema || !propertyName) {\n return null;\n }\n\n const methodChain = parseMethodChainForJSS(value);\n return {\n label: methodChain ? methodChainToString(methodChain) : value,\n value: methodChain ? methodChainToString(methodChain) : value,\n property: propertyName,\n schema,\n methodChain,\n };\n};\n\nexport const validatePath = ({\n path,\n jsonSchema,\n platformObjectJsonSchema = {},\n primitiveUtilities = {},\n optionFilters,\n}: {\n path: string;\n jsonSchema: JsonSchema;\n platformObjectJsonSchema: ObjectSchemaMap;\n primitiveUtilities: ObjectSchemaMap;\n optionFilters?: OptionFilters;\n}) => {\n const schemaOptions = getSchemaOptions({\n option: { schema: jsonSchema, methodChain: parseMethodChainForJSS('') },\n optionFilters,\n platformObjectJsonSchema,\n primitiveUtilities,\n });\n const { methodChain, partial } = parseWithPartialOption(path);\n\n const matchedSchemaOptions = methodChain.links.reduce<Option[]>((currentSchema, link) => {\n if (currentSchema.length === 0) {\n return [];\n }\n const optionMatch = currentSchema.find((option) => option.property === link.name);\n if (optionMatch) {\n return getSchemaOptions({\n option: optionMatch,\n optionFilters,\n platformObjectJsonSchema,\n primitiveUtilities,\n });\n }\n return [];\n }, schemaOptions);\n\n const optionsWithPartiallyMatchedFinalLink = matchedSchemaOptions.filter((option) =>\n option.property.includes(partial),\n );\n return {\n valid: optionsWithPartiallyMatchedFinalLink.length > 0,\n schemaOptions: optionsWithPartiallyMatchedFinalLink,\n partial,\n };\n};\n\n/**\n * Given a method chain that corresponds to the passed schema, find the right-most indentifier that\n * is a platform object and split the method chain on that identifier, with the platform object on\n * the left side.\n *\n * This function is used to optimize a method chain into two parts, left side for server resolution\n * and right side for client resolution.\n *\n * For example:\n * current_case.fields.field_a -> ['current_case', 'fields.field_a']\n * current_case.inquiries.first.id -> ['current_case.inquiries.first', 'id']\n * current_case.account.fields.field_b -> ['current_case.account', 'fields.field_b']\n */\nexport const splitAtNearestParentObject = (\n chain: Chain,\n currentSchema: JsonSchemaObject,\n platformSchemaMap: ObjectSchemaMap,\n primitiveUtilities: ObjectSchemaMap,\n): [leftChain: Chain, rightChain: Chain] => {\n // Create a list of schemas that match each link in the method chain.\n // The list is reversed such that the first schema matches the last link of the method chain\n // for the next step.\n const leafUpLinkSchemas: (JsonSchema | null)[] = [currentSchema];\n for (const link of chain.links) {\n const nextSchema = nextLinkSchema({\n currentSchema: leafUpLinkSchemas[0],\n nextLink: link,\n platformObjectJsonSchema: platformSchemaMap,\n primitiveUtilities,\n });\n leafUpLinkSchemas.unshift(nextSchema);\n }\n\n // List of links that correspond to the left and right sides of the split.\n // As we walk the schema from leaf to root, we move links to the right side.\n const leafUpLeftLinks = [...chain.links].reverse();\n const leafUpRightLinks: typeof leafUpLeftLinks = [];\n\n for (const [i, linkSchema] of leafUpLinkSchemas.entries()) {\n if (!linkSchema) {\n // When the schema is unknown, check if the current link is an identifier accessing a\n // property on an unresolvable platform object ref. If any remaining schema in the\n // ancestor chain is a $ref (or array of $refs), we're within a platform object whose\n // schema couldn't be resolved — push the identifier to the client (right) side.\n if (isIdentifierNode(leafUpLeftLinks[0])) {\n const nearestPlatformAncestor = leafUpLinkSchemas\n .slice(i + 1)\n .find(\n (s) => s && (isJsonSchemaRef(s) || (isJsonSchemaArray(s) && isJsonSchemaRef(s.items))),\n );\n if (nearestPlatformAncestor) {\n leafUpRightLinks.push(leafUpLeftLinks.shift()!);\n continue;\n }\n }\n // If we are missing schema, break out asap to keep links on the left.\n break;\n } else if ('$id' in linkSchema || isJsonSchemaRef(linkSchema)) {\n break;\n } else if (isJsonSchemaArray(linkSchema)) {\n if ('$id' in linkSchema.items || isJsonSchemaRef(linkSchema.items)) {\n break;\n }\n // Array-returning functions (filter, sort, etc.) on platform object arrays\n // must be resolved server-side even when the items ref cannot be resolved.\n if (isFunctionNode(leafUpLeftLinks[0])) {\n break;\n }\n } else if (isFunctionNode(leafUpLeftLinks[0])) {\n break;\n } else if (isIdentifierNode(leafUpLeftLinks[0])) {\n const nextSchema = leafUpLinkSchemas[i + 1];\n // If the preceding schema has a primitive schema ID in the utilities, the identifier\n // was resolved via primitive utilities (e.g. 'trim' on a string, 'count' on an array).\n // The server handles these inline, so keep the whole chain server-side.\n if (nextSchema) {\n const primitiveId = getPrimitiveSchemaId(nextSchema);\n if (primitiveId && primitiveId in primitiveUtilities) {\n break;\n }\n }\n // Real special case here. If:\n // - The current link is an identifier\n // - The next schema is an array\n // = break out, because we don't want to load the whole array into the client\n if (nextSchema && isJsonSchemaArray(nextSchema)) {\n break;\n }\n }\n\n leafUpRightLinks.push(leafUpLeftLinks.shift()!);\n }\n\n const leftChain: Chain = {\n type: MethodChainNodeTypes.Chain,\n links: leafUpLeftLinks.reverse(),\n };\n const rightChain: Chain = {\n type: MethodChainNodeTypes.Chain,\n links: leafUpRightLinks.reverse(),\n };\n return [leftChain, rightChain];\n};\n"],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;;AAOJ,OAAI,cAAc,kBAAkB,WAAW,CAC7C;;AAIJ,mBAAiB,KAAK,gBAAgB,OAAO,CAAE;;AAWjD,QAAO,CAAC;EAPN,MAAM,qBAAqB;EAC3B,OAAO,gBAAgB,SAAS;EAMjB,EAAE;EAHjB,MAAM,qBAAqB;EAC3B,OAAO,iBAAiB,SAAS;EAEN,CAAC"}
|
package/dist/lib/useChain.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useChain, r as useChainSchema, t as chainRootsFromSchemaProperties } from "../useChain-
|
|
1
|
+
import { n as useChain, r as useChainSchema, t as chainRootsFromSchemaProperties } from "../useChain-x9fd9Fyq.mjs";
|
|
2
2
|
export { chainRootsFromSchemaProperties, useChain as default, useChainSchema };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region src/lib/useModalInsetRight.d.ts
|
|
2
|
-
declare const SIDEBAR_OPEN_TRANSITION_MS
|
|
3
|
-
declare const SIDEBAR_CLOSE_TRANSITION_MS
|
|
2
|
+
declare const SIDEBAR_OPEN_TRANSITION_MS: number;
|
|
3
|
+
declare const SIDEBAR_CLOSE_TRANSITION_MS: number;
|
|
4
|
+
declare const SIDEBAR_TRANSITION_EASING = "ease-out";
|
|
4
5
|
type PanelInsetState = 'closed' | 'opening' | 'open' | 'closing';
|
|
5
6
|
interface ModalInsetRight {
|
|
6
7
|
/** Animated inset value — starts at 0px on panel open so CSS transition fires */
|
|
@@ -17,5 +18,5 @@ interface ModalInsetRight {
|
|
|
17
18
|
*/
|
|
18
19
|
declare const useModalInsetRight: () => ModalInsetRight;
|
|
19
20
|
//#endregion
|
|
20
|
-
export { ModalInsetRight, PanelInsetState, SIDEBAR_CLOSE_TRANSITION_MS, SIDEBAR_OPEN_TRANSITION_MS, useModalInsetRight as default };
|
|
21
|
+
export { ModalInsetRight, PanelInsetState, SIDEBAR_CLOSE_TRANSITION_MS, SIDEBAR_OPEN_TRANSITION_MS, SIDEBAR_TRANSITION_EASING, useModalInsetRight as default };
|
|
21
22
|
//# sourceMappingURL=useModalInsetRight.d.mts.map
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import "../variables/transitions.mjs";
|
|
1
2
|
import { useEffect, useRef, useState } from "react";
|
|
2
3
|
//#region src/lib/useModalInsetRight.ts
|
|
3
4
|
const CSS_VAR = "--modal-inset-right";
|
|
4
|
-
const SIDEBAR_OPEN_TRANSITION_MS =
|
|
5
|
-
const SIDEBAR_CLOSE_TRANSITION_MS =
|
|
5
|
+
const SIDEBAR_OPEN_TRANSITION_MS = parseInt("400ms", 10);
|
|
6
|
+
const SIDEBAR_CLOSE_TRANSITION_MS = parseInt("300ms", 10);
|
|
7
|
+
const SIDEBAR_TRANSITION_EASING = "ease-out";
|
|
6
8
|
const getModalInsetRight = () => getComputedStyle(document.documentElement).getPropertyValue(CSS_VAR).trim() || "0px";
|
|
7
9
|
const prefersReducedMotion = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
8
10
|
/**
|
|
@@ -33,7 +35,7 @@ const useModalInsetRight = () => {
|
|
|
33
35
|
setInsetRight("0px");
|
|
34
36
|
setPanelState("opening");
|
|
35
37
|
rafRef.current = requestAnimationFrame(() => setInsetRight(next));
|
|
36
|
-
transitionTimerRef.current = setTimeout(() => setPanelState("open"),
|
|
38
|
+
transitionTimerRef.current = setTimeout(() => setPanelState("open"), SIDEBAR_OPEN_TRANSITION_MS);
|
|
37
39
|
}
|
|
38
40
|
else if (prev !== "0px" && next === "0px") if (prefersReducedMotion()) {
|
|
39
41
|
setInsetRight("0px");
|
|
@@ -44,7 +46,7 @@ const useModalInsetRight = () => {
|
|
|
44
46
|
setInsetRight(prev);
|
|
45
47
|
setPanelState("closing");
|
|
46
48
|
rafRef.current = requestAnimationFrame(() => setInsetRight("0px"));
|
|
47
|
-
transitionTimerRef.current = setTimeout(() => setPanelState("closed"),
|
|
49
|
+
transitionTimerRef.current = setTimeout(() => setPanelState("closed"), SIDEBAR_CLOSE_TRANSITION_MS);
|
|
48
50
|
}
|
|
49
51
|
else setInsetRight(next);
|
|
50
52
|
});
|
|
@@ -64,6 +66,6 @@ const useModalInsetRight = () => {
|
|
|
64
66
|
};
|
|
65
67
|
};
|
|
66
68
|
//#endregion
|
|
67
|
-
export { SIDEBAR_CLOSE_TRANSITION_MS, SIDEBAR_OPEN_TRANSITION_MS, useModalInsetRight as default };
|
|
69
|
+
export { SIDEBAR_CLOSE_TRANSITION_MS, SIDEBAR_OPEN_TRANSITION_MS, SIDEBAR_TRANSITION_EASING, useModalInsetRight as default };
|
|
68
70
|
|
|
69
71
|
//# sourceMappingURL=useModalInsetRight.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModalInsetRight.mjs","names":[],"sources":["../../src/lib/useModalInsetRight.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nconst CSS_VAR = '--modal-inset-right';\n\n//
|
|
1
|
+
{"version":3,"file":"useModalInsetRight.mjs","names":[],"sources":["../../src/lib/useModalInsetRight.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport { TransitionDuration } from '#src/variables/transitions';\n\nconst CSS_VAR = '--modal-inset-right';\n\n// Must equal the agents panel's open and close durations in persona-web, or the modal's edge and the panel's drift apart.\nexport const SIDEBAR_OPEN_TRANSITION_MS = parseInt(TransitionDuration.Medium, 10);\nexport const SIDEBAR_CLOSE_TRANSITION_MS = parseInt(TransitionDuration.MediumFast, 10);\n// The agents panel slides on framer-motion's `easeOut`; switch with it to `TransitionEasing.Enter`/`Exit`.\nexport const SIDEBAR_TRANSITION_EASING = 'ease-out';\n\nconst getModalInsetRight = () =>\n getComputedStyle(document.documentElement).getPropertyValue(CSS_VAR).trim() || '0px';\n\nconst prefersReducedMotion = () =>\n typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n\nexport type PanelInsetState = 'closed' | 'opening' | 'open' | 'closing';\n\nexport interface ModalInsetRight {\n /** Animated inset value — starts at 0px on panel open so CSS transition fires */\n insetRight: string;\n panelState: PanelInsetState;\n}\n\n/**\n * Returns the current value of --modal-inset-right from :root, reactively updating\n * as the agents side panel animates open/closed or is resized. Also tracks whether\n * the panel is opening, open, closing, or closed.\n *\n * panelState stays 'opening'/'closing' for the full transition duration so that\n * CSS transitions on consumers have time to animate.\n */\nconst useModalInsetRight = (): ModalInsetRight => {\n const [insetRight, setInsetRight] = useState(getModalInsetRight);\n const [panelState, setPanelState] = useState<PanelInsetState>(() =>\n getModalInsetRight() !== '0px' ? 'open' : 'closed',\n );\n const prevInsetRight = useRef(getModalInsetRight());\n const transitionTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const rafRef = useRef<number | null>(null);\n\n useEffect(() => {\n const observer = new MutationObserver(() => {\n const prev = prevInsetRight.current;\n const next = getModalInsetRight();\n prevInsetRight.current = next;\n\n if (prev === '0px' && next !== '0px') {\n if (prefersReducedMotion()) {\n setInsetRight(next);\n setPanelState('open');\n } else {\n if (rafRef.current) {\n cancelAnimationFrame(rafRef.current);\n }\n if (transitionTimerRef.current) {\n clearTimeout(transitionTimerRef.current);\n }\n setInsetRight('0px');\n setPanelState('opening');\n rafRef.current = requestAnimationFrame(() => setInsetRight(next));\n transitionTimerRef.current = setTimeout(\n () => setPanelState('open'),\n SIDEBAR_OPEN_TRANSITION_MS,\n );\n }\n } else if (prev !== '0px' && next === '0px') {\n if (prefersReducedMotion()) {\n setInsetRight('0px');\n setPanelState('closed');\n } else {\n if (rafRef.current) {\n cancelAnimationFrame(rafRef.current);\n }\n if (transitionTimerRef.current) {\n clearTimeout(transitionTimerRef.current);\n }\n setInsetRight(prev);\n setPanelState('closing');\n rafRef.current = requestAnimationFrame(() => setInsetRight('0px'));\n transitionTimerRef.current = setTimeout(\n () => setPanelState('closed'),\n SIDEBAR_CLOSE_TRANSITION_MS,\n );\n }\n } else {\n setInsetRight(next);\n }\n });\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['style'],\n });\n\n return () => {\n observer.disconnect();\n if (transitionTimerRef.current) {\n clearTimeout(transitionTimerRef.current);\n }\n if (rafRef.current) {\n cancelAnimationFrame(rafRef.current);\n }\n };\n }, []);\n\n return { insetRight, panelState };\n};\n\nexport default useModalInsetRight;\n"],"mappings":";;;AAIA,MAAM,UAAU;AAGhB,MAAa,6BAA6B,SAAA,SAAoC,GAAG;AACjF,MAAa,8BAA8B,SAAA,SAAwC,GAAG;AAEtF,MAAa,4BAA4B;AAEzC,MAAM,2BACJ,iBAAiB,SAAS,gBAAgB,CAAC,iBAAiB,QAAQ,CAAC,MAAM,IAAI;AAEjF,MAAM,6BACJ,OAAO,WAAW,eAAe,OAAO,WAAW,mCAAmC,CAAC;;;;;;;;;AAkBzF,MAAM,2BAA4C;CAChD,MAAM,CAAC,YAAY,iBAAiB,SAAS,mBAAmB;CAChE,MAAM,CAAC,YAAY,iBAAiB,eAClC,oBAAoB,KAAK,QAAQ,SAAS,SAC3C;CACD,MAAM,iBAAiB,OAAO,oBAAoB,CAAC;CACnD,MAAM,qBAAqB,OAA6C,KAAK;CAC7E,MAAM,SAAS,OAAsB,KAAK;AAE1C,iBAAgB;EACd,MAAM,WAAW,IAAI,uBAAuB;GAC1C,MAAM,OAAO,eAAe;GAC5B,MAAM,OAAO,oBAAoB;AACjC,kBAAe,UAAU;AAEzB,OAAI,SAAS,SAAS,SAAS,MAC7B,KAAI,sBAAsB,EAAE;AAC1B,kBAAc,KAAK;AACnB,kBAAc,OAAO;UAChB;AACL,QAAI,OAAO,QACT,sBAAqB,OAAO,QAAQ;AAEtC,QAAI,mBAAmB,QACrB,cAAa,mBAAmB,QAAQ;AAE1C,kBAAc,MAAM;AACpB,kBAAc,UAAU;AACxB,WAAO,UAAU,4BAA4B,cAAc,KAAK,CAAC;AACjE,uBAAmB,UAAU,iBACrB,cAAc,OAAO,EAC3B,2BACD;;YAEM,SAAS,SAAS,SAAS,MACpC,KAAI,sBAAsB,EAAE;AAC1B,kBAAc,MAAM;AACpB,kBAAc,SAAS;UAClB;AACL,QAAI,OAAO,QACT,sBAAqB,OAAO,QAAQ;AAEtC,QAAI,mBAAmB,QACrB,cAAa,mBAAmB,QAAQ;AAE1C,kBAAc,KAAK;AACnB,kBAAc,UAAU;AACxB,WAAO,UAAU,4BAA4B,cAAc,MAAM,CAAC;AAClE,uBAAmB,UAAU,iBACrB,cAAc,SAAS,EAC7B,4BACD;;OAGH,eAAc,KAAK;IAErB;AAEF,WAAS,QAAQ,SAAS,iBAAiB;GACzC,YAAY;GACZ,iBAAiB,CAAC,QAAQ;GAC3B,CAAC;AAEF,eAAa;AACX,YAAS,YAAY;AACrB,OAAI,mBAAmB,QACrB,cAAa,mBAAmB,QAAQ;AAE1C,OAAI,OAAO,QACT,sBAAqB,OAAO,QAAQ;;IAGvC,EAAE,CAAC;AAEN,QAAO;EAAE;EAAY;EAAY"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
The `pds/duration-token`, `pds/exit-motion`, `pds/motion-origin`, `pds/no-layout-motion`,
|
|
4
|
+
`pds/no-transition-all` and `pds/overlay-motion` rules adapt checks from the transitions.dev Motion
|
|
5
|
+
Agent (<https://github.com/Jakubantalik/transitions.dev>, `agent/lib/rules.mjs`,
|
|
6
|
+
`agent/lib/components.mjs` and `agent/lib/catalog.mjs`), used under the MIT License that the
|
|
7
|
+
repository's `LICENSE` grants its tooling (section 2, covering `agent/`). Nothing is taken from its
|
|
8
|
+
`transitions/` or `skills/` directories, which are under a different licence.
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
Copyright (c) 2026 Jakub Antalik / Transitions.dev
|
|
12
|
+
|
|
13
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
in the Software without restriction, including without limitation the rights
|
|
16
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
furnished to do so, subject to the following conditions:
|
|
19
|
+
|
|
20
|
+
The above copyright notice and this permission notice shall be included in
|
|
21
|
+
all copies or substantial portions of the Software.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
SOFTWARE.
|
|
30
|
+
```
|