@persona/design-system 0.10.11 → 0.10.13
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 +52 -0
- package/dist/{Action-sLO73eKq.d.mts → Action-CHWYwpYR.d.mts} +2 -2
- package/dist/Action.d.mts +1 -1
- package/dist/AdvancedFilterRuleRow.d.mts +3 -0
- package/dist/AdvancedFilterRulesPopover.d.mts +4 -0
- package/dist/Attribute.d.mts +2 -2
- package/dist/{Badge-DZq6ByIU.mjs → Badge-B2AJMf3d.mjs} +2 -2
- package/dist/{Badge-DZq6ByIU.mjs.map → Badge-B2AJMf3d.mjs.map} +1 -1
- package/dist/{Breadcrumbs-DpsNZWF9.mjs → Breadcrumbs-DRs9eo1o.mjs} +8 -8
- package/dist/{Breadcrumbs-DpsNZWF9.mjs.map → Breadcrumbs-DRs9eo1o.mjs.map} +1 -1
- package/dist/{Button-C4a4BTjL.d.mts → Button-DjD8QxcY.d.mts} +2 -2
- package/dist/Button.d.mts +1 -1
- package/dist/CalendarBase.d.mts +1 -1
- package/dist/{Card-CPV4_mHk.d.mts → Card-DiUHtYg_.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-DCoDfEvr.mjs → CardV2-DO-8COfu.mjs} +12 -12
- package/dist/{CardV2-DCoDfEvr.mjs.map → CardV2-DO-8COfu.mjs.map} +1 -1
- package/dist/{Checkbox-C3z7UUSC.mjs → Checkbox-BAh-wF_F.mjs} +5 -5
- package/dist/{Checkbox-C3z7UUSC.mjs.map → Checkbox-BAh-wF_F.mjs.map} +1 -1
- package/dist/{CheckboxGroupField-BT87OVOF.d.mts → CheckboxGroupField-BW_BcW3L.d.mts} +2 -2
- package/dist/CheckboxGroupField.d.mts +1 -1
- package/dist/{Combobox-aOJDTjzC.d.mts → Combobox-DgYwerwd.d.mts} +3 -3
- package/dist/{Combobox-BkK_tosd.mjs → Combobox-DmFQ5cAy.mjs} +92 -89
- package/dist/Combobox-DmFQ5cAy.mjs.map +1 -0
- package/dist/Combobox.d.mts +2 -2
- package/dist/{ComboboxBase-Brgv5nxk.d.mts → ComboboxBase-DoKiRjgS.d.mts} +6 -6
- package/dist/ComboboxBase.d.mts +1 -1
- package/dist/{ComboboxMultiSelect-DJyAv0Eg.d.mts → ComboboxMultiSelect-DsoIMJiZ.d.mts} +2 -2
- package/dist/ComboboxMultiSelect.d.mts +1 -1
- package/dist/{ComboboxSingleSelect-CP8-HLKl.d.mts → ComboboxSingleSelect-CKsqOAGB.d.mts} +3 -3
- package/dist/ComboboxSingleSelect.d.mts +1 -1
- package/dist/{CompactBar-B0LhjrYV.d.mts → CompactBar-tNtY2EhN.d.mts} +3 -3
- package/dist/CompactBar.d.mts +1 -1
- package/dist/{ConfigFormGroup-DAUqAhJW.mjs → ConfigFormGroup-BCTWCws5.mjs} +2 -2
- package/dist/{ConfigFormGroup-DAUqAhJW.mjs.map → ConfigFormGroup-BCTWCws5.mjs.map} +1 -1
- package/dist/{ControlBar-B3Jn8G0k.d.mts → ControlBar-CDb6b1_6.d.mts} +5 -3
- package/dist/ControlBar.d.mts +1 -1
- package/dist/{DataTable-DiwzhNMt.mjs → DataTable-DZ0B2Zm9.mjs} +159 -90
- package/dist/DataTable-DZ0B2Zm9.mjs.map +1 -0
- package/dist/{DataTable-CSl5Jn3E.d.mts → DataTable-on3vGhyi.d.mts} +32 -8
- package/dist/DataTable.d.mts +1 -1
- package/dist/{DatePicker-BK7ioKBm.mjs → DatePicker-CHVYVKB-.mjs} +375 -375
- package/dist/DatePicker-CHVYVKB-.mjs.map +1 -0
- package/dist/{DropdownButton-Dp-MZ5tA.mjs → DropdownButton-BxZ5hn0X.mjs} +3 -3
- package/dist/{DropdownButton-Dp-MZ5tA.mjs.map → DropdownButton-BxZ5hn0X.mjs.map} +1 -1
- package/dist/DropdownButton.d.mts +2 -2
- package/dist/{DropdownMenu-jJSHQaih.mjs → DropdownMenu-Ip75l4Th.mjs} +21 -4
- package/dist/DropdownMenu-Ip75l4Th.mjs.map +1 -0
- package/dist/{DropdownMenu-BnHPeHOm.d.mts → DropdownMenu-eVY-Yjpq.d.mts} +3 -3
- package/dist/DropdownMenu.d.mts +1 -1
- package/dist/{FilterBar-DDyk14sx.d.mts → FilterBar-CA4mDAXK.d.mts} +10 -2
- package/dist/FilterBar.d.mts +1 -1
- package/dist/{FloatingActionBar-BUgSKimy.d.mts → FloatingActionBar-CfgjHs81.d.mts} +5 -1
- package/dist/FloatingActionBar.d.mts +1 -1
- package/dist/{FloatingToolbar-rfKurDs8.mjs → FloatingToolbar-BA8Fqmrz.mjs} +4 -4
- package/dist/{FloatingToolbar-rfKurDs8.mjs.map → FloatingToolbar-BA8Fqmrz.mjs.map} +1 -1
- package/dist/{FormControl-DPYbLcBK.d.mts → FormControl-BQe3GRhi.d.mts} +2 -2
- package/dist/{FormControl--pbTH3bY.mjs → FormControl-BoKGiWdQ.mjs} +3 -3
- package/dist/{FormControl--pbTH3bY.mjs.map → FormControl-BoKGiWdQ.mjs.map} +1 -1
- package/dist/FormControl.d.mts +1 -1
- package/dist/FormControlLabel.d.mts +2 -2
- package/dist/{FormField-CYNGm2bJ.d.mts → FormField-BW5uMzId.d.mts} +2 -2
- package/dist/{FormField-DMxjftFw.mjs → FormField-BfVrDOY0.mjs} +13 -13
- package/dist/{FormField-DMxjftFw.mjs.map → FormField-BfVrDOY0.mjs.map} +1 -1
- package/dist/FormField.d.mts +1 -1
- package/dist/{Grid-DVC0SSEZ.mjs → Grid-CYpOqTUu.mjs} +2 -2
- package/dist/{Grid-DVC0SSEZ.mjs.map → Grid-CYpOqTUu.mjs.map} +1 -1
- package/dist/{Header-DaaUprCL.d.mts → Header-CV0Lcf0C.d.mts} +2 -2
- package/dist/Header.d.mts +1 -1
- package/dist/{HelperTooltip-C5BDdJSI.d.mts → HelperTooltip-BNM3pTM-.d.mts} +2 -2
- package/dist/HelperTooltip.d.mts +1 -1
- package/dist/HighlightedText.d.mts +1 -1
- package/dist/{HoverCopyableField-B2-xlwUt.mjs → HoverCopyableField-CJ_p3llp.mjs} +5 -5
- package/dist/{HoverCopyableField-B2-xlwUt.mjs.map → HoverCopyableField-CJ_p3llp.mjs.map} +1 -1
- package/dist/{IconButton-kSjnfhWt.mjs → IconButton-Bj1fry_K.mjs} +8 -8
- package/dist/{IconButton-kSjnfhWt.mjs.map → IconButton-Bj1fry_K.mjs.map} +1 -1
- package/dist/{IconButton-7k-wjvH3.d.mts → IconButton-C_ReZm8v.d.mts} +2 -2
- package/dist/IconButton.d.mts +1 -1
- package/dist/ImageTile.d.mts +1 -1
- package/dist/IndexTableLayout.d.mts +12 -4
- package/dist/InlineCombobox.d.mts +1 -1
- package/dist/InlineInput.d.mts +1 -1
- package/dist/{Input-CwvrBsiS.d.mts → Input-DH-5dKor.d.mts} +3 -3
- package/dist/{Input-TRmTBEav.mjs → Input-DcbzPaax.mjs} +5 -5
- package/dist/{Input-TRmTBEav.mjs.map → Input-DcbzPaax.mjs.map} +1 -1
- package/dist/Input.d.mts +1 -1
- package/dist/{Link-XvzUN8sY.mjs → Link-Df3zJrj2.mjs} +4 -4
- package/dist/{Link-XvzUN8sY.mjs.map → Link-Df3zJrj2.mjs.map} +1 -1
- package/dist/{ListBox-DahM1PgU.mjs → ListBox-BRgjgUSp.mjs} +12 -12
- package/dist/{ListBox-DahM1PgU.mjs.map → ListBox-BRgjgUSp.mjs.map} +1 -1
- package/dist/{ListBox-BePQBYR7.d.mts → ListBox-Bgug8YZF.d.mts} +3 -3
- package/dist/ListBox.d.mts +1 -1
- package/dist/{ListBoxField-lj7JN1BX.d.mts → ListBoxField-Cc1sX2bo.d.mts} +4 -4
- package/dist/ListBoxField.d.mts +1 -1
- package/dist/{LoadingShimmer-CpfKTSUs.mjs → LoadingShimmer-BVVdBeN-.mjs} +18 -21
- package/dist/LoadingShimmer-BVVdBeN-.mjs.map +1 -0
- package/dist/LoadingShimmer.d.mts +1 -1
- package/dist/{LogicRow-Do7t7Suf.d.mts → LogicRow-B1_35ZJT.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-BvMzSH2I.mjs → Menu-BVn1jh46.mjs} +5 -5
- package/dist/{Menu-BvMzSH2I.mjs.map → Menu-BVn1jh46.mjs.map} +1 -1
- package/dist/{Menu-Ca5ftvo6.d.mts → Menu-keVl-eKm.d.mts} +4 -4
- package/dist/Menu.d.mts +1 -1
- package/dist/{MiddleTruncatedText--jzGTD00.mjs → MiddleTruncatedText-DicQsLDG.mjs} +2 -2
- package/dist/{MiddleTruncatedText--jzGTD00.mjs.map → MiddleTruncatedText-DicQsLDG.mjs.map} +1 -1
- package/dist/{Modal-BPfFyzkw.d.mts → Modal-CujB7DuB.d.mts} +3 -3
- package/dist/{Modal-B6X5AgWj.mjs → Modal-SnCo7ecm.mjs} +8 -7
- package/dist/Modal-SnCo7ecm.mjs.map +1 -0
- package/dist/Modal.d.mts +1 -1
- package/dist/{PageHeader-bhQTjuZF.mjs → PageHeader-6KvtGED-.mjs} +2 -2
- package/dist/{PageHeader-bhQTjuZF.mjs.map → PageHeader-6KvtGED-.mjs.map} +1 -1
- package/dist/{PageHeader-BeBmYmUX.d.mts → PageHeader-UPiqJpIF.d.mts} +2 -2
- package/dist/PageHeader.d.mts +1 -1
- package/dist/{PageLayout-BXM_pyrU.d.mts → PageLayout-BdVM37bV.d.mts} +2 -2
- package/dist/{PageLayout-DgEGcZgB.mjs → PageLayout-CPiVnS_r.mjs} +5 -3
- package/dist/PageLayout-CPiVnS_r.mjs.map +1 -0
- package/dist/PageLayout.d.mts +1 -1
- package/dist/{PageSelector-C14ABZVL.d.mts → PageSelector-B5CcAzss.d.mts} +2 -2
- package/dist/PageSelector.d.mts +1 -1
- package/dist/{Pagination-DE8wT55m.mjs → Pagination-CqFvnlXc.mjs} +5 -5
- package/dist/{Pagination-DE8wT55m.mjs.map → Pagination-CqFvnlXc.mjs.map} +1 -1
- package/dist/{Pii-C42ZY88Y.mjs → Pii-BYPkrBuT.mjs} +2 -2
- package/dist/{Pii-C42ZY88Y.mjs.map → Pii-BYPkrBuT.mjs.map} +1 -1
- package/dist/{Popover-DuFjaSoq.mjs → Popover-DP9DXReH.mjs} +48 -20
- package/dist/Popover-DP9DXReH.mjs.map +1 -0
- package/dist/Popover.d.mts +1 -1
- package/dist/ProgressBar.d.mts +1 -1
- package/dist/{ProgressIndicator-hy1P-RG1.mjs → ProgressIndicator-zt3ndT9U.mjs} +3 -3
- package/dist/{ProgressIndicator-hy1P-RG1.mjs.map → ProgressIndicator-zt3ndT9U.mjs.map} +1 -1
- package/dist/{Radio-B4TBAho6.mjs → Radio-B1H_S-Qj.mjs} +4 -4
- package/dist/{Radio-B4TBAho6.mjs.map → Radio-B1H_S-Qj.mjs.map} +1 -1
- package/dist/{RadioGroup-Bf24GKOb.mjs → RadioGroup-7hdcVhsp.mjs} +3 -3
- package/dist/{RadioGroup-Bf24GKOb.mjs.map → RadioGroup-7hdcVhsp.mjs.map} +1 -1
- package/dist/RichTextEditor.d.mts +1 -1
- package/dist/SectionHeading.d.mts +1 -1
- package/dist/{SegmentedControl-BpR7sUWO.mjs → SegmentedControl-BNOJ1FYQ.mjs} +3 -3
- package/dist/{SegmentedControl-BpR7sUWO.mjs.map → SegmentedControl-BNOJ1FYQ.mjs.map} +1 -1
- package/dist/{Select-DYdn73Nh.d.mts → Select-CiofH5-f.d.mts} +2 -2
- package/dist/{Select-RdTT2KoH.mjs → Select-DbWEgH5c.mjs} +9 -9
- package/dist/{Select-RdTT2KoH.mjs.map → Select-DbWEgH5c.mjs.map} +1 -1
- 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/SmartTextInputListbox.d.mts +8 -3
- package/dist/SmartTextInputPopover.d.mts +1 -1
- package/dist/{Spinner-vcApnJzv.mjs → Spinner-k9ZiOdTr.mjs} +2 -2
- package/dist/{Spinner-vcApnJzv.mjs.map → Spinner-k9ZiOdTr.mjs.map} +1 -1
- package/dist/{Stack-B6MrjJeW.d.mts → Stack-CODxfzhl.d.mts} +2 -2
- package/dist/Stack.d.mts +1 -1
- package/dist/{StatusIndicator-lwt35J6B.mjs → StatusIndicator-CzRaEFSz.mjs} +3 -3
- package/dist/{StatusIndicator-lwt35J6B.mjs.map → StatusIndicator-CzRaEFSz.mjs.map} +1 -1
- package/dist/{Sticker-jfOM4Yi6.mjs → Sticker-4VdGEFAu.mjs} +5 -5
- package/dist/{Sticker-jfOM4Yi6.mjs.map → Sticker-4VdGEFAu.mjs.map} +1 -1
- package/dist/{Sticker-C7Wv3Obx.d.mts → Sticker-CLvRB8V5.d.mts} +4 -4
- package/dist/Sticker.d.mts +1 -1
- package/dist/Tab.d.mts +2 -2
- package/dist/{TabBar-DwHgbIQ6.mjs → TabBar-d4sdknti.mjs} +6 -6
- package/dist/{TabBar-DwHgbIQ6.mjs.map → TabBar-d4sdknti.mjs.map} +1 -1
- package/dist/{Table-SMJAWqoe.mjs → Table-9mNn8Q-d.mjs} +10 -10
- package/dist/{Table-SMJAWqoe.mjs.map → Table-9mNn8Q-d.mjs.map} +1 -1
- package/dist/{TableBox-DS8mpN3-.mjs → TableBox-RxpwflEb.mjs} +14 -14
- package/dist/{TableBox-DS8mpN3-.mjs.map → TableBox-RxpwflEb.mjs.map} +1 -1
- package/dist/TableBox.d.mts +1 -1
- package/dist/{TableBoxCell-Bo5xYEmR.d.mts → TableBoxCell-C65YFYqj.d.mts} +6 -6
- package/dist/TableBoxCell.d.mts +1 -1
- package/dist/{TableBoxField-CdgjSGLK.d.mts → TableBoxField-CHpClgsE.d.mts} +5 -5
- package/dist/TableBoxField.d.mts +1 -1
- package/dist/{TableBoxRow-DuWS2iRC.d.mts → TableBoxRow-CK-b79uD.d.mts} +2 -2
- package/dist/TableBoxRow.d.mts +1 -1
- package/dist/{TableBoxRowActions-zW74DkXt.d.mts → TableBoxRowActions-CRaabjaY.d.mts} +2 -2
- package/dist/TableBoxRowActions.d.mts +1 -1
- package/dist/{TableCell-uv_jqT5e.d.mts → TableCell-CQsF7t4e.d.mts} +2 -2
- package/dist/TableCell.d.mts +1 -1
- package/dist/{TableControls-CX7BvgD2.mjs → TableControls-DM4RddQ_.mjs} +77 -36
- package/dist/TableControls-DM4RddQ_.mjs.map +1 -0
- package/dist/{TableControls-9vz-HfDu.d.mts → TableControls-v1NmlFTW.d.mts} +5 -5
- package/dist/TableControls.d.mts +1 -1
- package/dist/{TableControlsContext-D0Hn3rwL.d.mts → TableControlsContext-DHYICXxy.d.mts} +2 -2
- package/dist/TableControlsContext.d.mts +1 -1
- package/dist/{TableViewConfigurationDropdown-CZcLH8uR.d.mts → TableViewConfigurationDropdown-1nT8wneI.d.mts} +2 -2
- package/dist/TableViewConfigurationDropdown.d.mts +1 -1
- package/dist/{TechnicalSticker-DrN45Vut.mjs → TechnicalSticker-DtV7Gawf.mjs} +7 -7
- package/dist/{TechnicalSticker-DrN45Vut.mjs.map → TechnicalSticker-DtV7Gawf.mjs.map} +1 -1
- package/dist/{Text-CdHeSHCc.d.mts → Text-CvaqognH.d.mts} +2 -2
- package/dist/Text.d.mts +1 -1
- package/dist/{TextUnderlineTooltip-By1VVsSs.d.mts → TextUnderlineTooltip-Bd5e8KH3.d.mts} +3 -3
- package/dist/TextUnderlineTooltip.d.mts +1 -1
- package/dist/Tile.d.mts +1 -1
- package/dist/{Toggle-DjmkjJlw.mjs → Toggle-CzHoIR-n.mjs} +6 -6
- package/dist/{Toggle-DjmkjJlw.mjs.map → Toggle-CzHoIR-n.mjs.map} +1 -1
- package/dist/{Tooltip-C2VB8I6y.mjs → Tooltip-CVBxc1yf.mjs} +4 -4
- package/dist/{Tooltip-C2VB8I6y.mjs.map → Tooltip-CVBxc1yf.mjs.map} +1 -1
- package/dist/{Tooltip-OxVvOfn8.d.mts → Tooltip-Ddy2Jq0K.d.mts} +3 -3
- package/dist/Tooltip.d.mts +1 -1
- package/dist/{TruncatedText-Dqj94BFK.d.mts → TruncatedText-sr9Fhm3N.d.mts} +2 -2
- package/dist/WizardModal.d.mts +1 -1
- package/dist/{clientFilterUtils-CMLuN8kK.d.mts → clientFilterUtils-CaF2QZBy.d.mts} +2 -2
- package/dist/clientFilterUtils.d.mts +1 -1
- package/dist/components/Accordion/index.mjs +5 -5
- package/dist/components/Attribute/index.mjs +6 -6
- package/dist/components/Badge/index.mjs +1 -1
- package/dist/components/Banner/index.mjs +3 -3
- package/dist/components/BottomPanel/index.mjs +7 -7
- 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/Checkbox/index.mjs +1 -1
- package/dist/components/CodeHighlight/index.mjs +4 -4
- package/dist/components/Combobox/index.d.mts +4 -4
- package/dist/components/Combobox/index.mjs +1 -1
- package/dist/components/ConfigFormGroup/index.mjs +1 -1
- package/dist/components/DataTable/TableControls/index.d.mts +9 -9
- package/dist/components/DataTable/TableControls/index.mjs +1 -1
- package/dist/components/DataTable/index.d.mts +6 -6
- 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 +8 -8
- 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 +8 -8
- 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 +2 -2
- 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 +4 -4
- 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 +4 -4
- package/dist/components/SmartTextInput/index.mjs +112 -118
- package/dist/components/SmartTextInput/index.mjs.map +1 -1
- package/dist/{safe-parse.d.mts → components/SmartTextInput/parser/safe-parse.d.mts} +1 -1
- package/dist/components/SmartTextInput/parser/safe-parse.mjs +30 -0
- package/dist/components/SmartTextInput/parser/safe-parse.mjs.map +1 -0
- package/dist/{tree.d.mts → components/SmartTextInput/parser/tree.d.mts} +1 -1
- package/dist/components/SmartTextInput/parser/tree.mjs +42 -0
- package/dist/components/SmartTextInput/parser/tree.mjs.map +1 -0
- 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 +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/Tile/index.mjs +2 -2
- package/dist/components/Toast/index.mjs +4 -4
- 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 +7 -7
- package/dist/fieldPickerOptions.d.mts +1 -1
- package/dist/{filters-By_TYKAZ.d.mts → filters-CShP0Jag.d.mts} +3 -3
- package/dist/filters.d.mts +1 -1
- package/dist/{helpers-BIHsqdyX.d.mts → helpers-Bbi1LyMW.d.mts} +5 -3
- package/dist/helpers.d.mts +1 -1
- package/dist/{index-CZJp4Af6.d.mts → index-3-eDlpcj.d.mts} +3 -3
- package/dist/{index-BozzRwby.d.mts → index-DTM_t7OG.d.mts} +2 -2
- package/dist/index2.d.mts +1 -1
- package/dist/index4.d.mts +2 -2
- package/dist/index6.d.mts +2 -2
- package/dist/{inputFields-BqO2H-Kj.d.mts → inputFields-Dobwb4kT.d.mts} +6 -6
- package/dist/inputFields.d.mts +1 -1
- package/dist/lib/MiddleTruncatedText.mjs +1 -1
- package/dist/lib/PDSProvider.d.mts +2 -1
- package/dist/lib/PDSProvider.mjs +8 -3
- package/dist/lib/PDSProvider.mjs.map +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 +19 -8
- package/dist/lib/colorMode.mjs +47 -13
- package/dist/lib/colorMode.mjs.map +1 -1
- package/dist/lib/schemaOptions.mjs +1 -1
- package/dist/lib/schemaOptions.mjs.map +1 -1
- package/dist/lib/useChain.d.mts +1 -1
- package/dist/lib/useCloseFocus.d.mts +45 -0
- package/dist/lib/useCloseFocus.mjs +123 -0
- package/dist/lib/useCloseFocus.mjs.map +1 -0
- package/dist/mixins/focus.mjs +1 -1
- package/dist/mixins/hoverable.mjs +1 -1
- package/dist/mixins/input.mjs +2 -2
- package/dist/mixins/motion.d.mts +6 -2
- package/dist/mixins/motion.mjs +25 -3
- package/dist/mixins/motion.mjs.map +1 -1
- package/dist/patterns/CardGrouping/index.mjs +8 -8
- package/dist/patterns/IndexTableLayout/index.mjs +23 -16
- package/dist/patterns/IndexTableLayout/index.mjs.map +1 -1
- package/dist/patterns/LayoutLoadingShimmer/index.mjs +4 -4
- package/dist/patterns/LayoutLoadingSpinner/index.mjs +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/tone.d.mts +1 -1
- package/dist/{types-C_CncajO.d.mts → types-BTaKBrxG.d.mts} +2 -2
- package/dist/{types-D5txFacG.d.mts → types-CUnL8JJj.d.mts} +7 -5
- package/dist/types5.d.mts +1 -1
- package/dist/{useChain-x9fd9Fyq.d.mts → useChain-B--KAtdN.d.mts} +2 -2
- package/dist/useChainAtCursor.d.mts +1 -1
- package/dist/useColumnConfiguration.d.mts +2 -2
- package/dist/useComboboxFooterAction.d.mts +1 -1
- package/dist/{useTableColumns-BEKJNrb1.d.mts → useTableColumns-BuxN7Usm.d.mts} +17 -2
- package/dist/useTableColumns.d.mts +1 -1
- package/dist/useTruncation.d.mts +1 -1
- package/dist/utils4.d.mts +1 -1
- package/dist/value-labels.d.mts +12 -0
- package/dist/withDisabledReason.d.mts +19 -0
- package/llms.txt +5 -4
- package/package.json +10 -12
- package/skills/ui-authoring/COMPONENTS.md +1 -2
- package/skills/ui-authoring/PATTERNS.md +6 -66
- package/skills/ui-authoring/STANDARD.md +11 -1
- package/skills/ui-authoring/TOKENS.md +14 -25
- package/dist/ChartFrame.d.mts +0 -61
- package/dist/ChartLegend.d.mts +0 -60
- package/dist/ChartPopover.d.mts +0 -155
- package/dist/Combobox-BkK_tosd.mjs.map +0 -1
- package/dist/DataTable-DiwzhNMt.mjs.map +0 -1
- package/dist/DatePicker-BK7ioKBm.mjs.map +0 -1
- package/dist/DropdownMenu-jJSHQaih.mjs.map +0 -1
- package/dist/LoadingShimmer-CpfKTSUs.mjs.map +0 -1
- package/dist/Modal-B6X5AgWj.mjs.map +0 -1
- package/dist/PageLayout-DgEGcZgB.mjs.map +0 -1
- package/dist/Popover-DuFjaSoq.mjs.map +0 -1
- package/dist/TableControls-CX7BvgD2.mjs.map +0 -1
- package/dist/chartColors.d.mts +0 -92
- package/dist/chartFrameLayout.d.mts +0 -46
- package/dist/components/Chart/index.d.mts +0 -9
- package/dist/components/Chart/index.mjs +0 -680
- package/dist/components/Chart/index.mjs.map +0 -1
- package/dist/useChartColors.d.mts +0 -30
- package/dist/useChartSeriesVisibility.d.mts +0 -22
- package/dist/useChartStyles.d.mts +0 -108
package/dist/lib/colorMode.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as styled, n as createGlobalStyle, o as useTheme, t as ThemeProvider } from "../styledComponentsInterop-Cs5CCPRy.mjs";
|
|
2
2
|
import { semanticDark, semanticLight } from "../variables/semantic.mjs";
|
|
3
3
|
import defaultTheme, { withPdsTheming } from "../theme.mjs";
|
|
4
|
-
import { useMemo } from "react";
|
|
4
|
+
import { createContext, useContext, useMemo } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/lib/colorMode.tsx
|
|
7
7
|
/**
|
|
@@ -13,7 +13,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
13
13
|
* plain stylesheets resolve the same colours as PDS components.
|
|
14
14
|
*
|
|
15
15
|
* Most apps only need `PDSProvider colorMode={readDocumentColorMode()}`. `ColorModeScope` renders
|
|
16
|
-
* part of a page in the other mode.
|
|
16
|
+
* part of a page in the other mode, and `useColorMode()` reads the mode in effect.
|
|
17
17
|
*
|
|
18
18
|
* Portals: PDS overlays portal to `document.body`. styled-components context crosses the portal, so
|
|
19
19
|
* a PDS overlay opened inside a `ColorModeScope` renders in the scope's mode. CSS custom properties
|
|
@@ -39,33 +39,67 @@ const semanticCss = {
|
|
|
39
39
|
light: semanticCssDeclarations(semanticLight),
|
|
40
40
|
dark: semanticCssDeclarations(semanticDark)
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
const semanticPalettes = {
|
|
43
|
+
light: semanticLight,
|
|
44
|
+
dark: semanticDark
|
|
45
|
+
};
|
|
46
|
+
const ColorModeContext = createContext(void 0);
|
|
47
|
+
/** The mode of the nearest `PDSProvider colorMode` or `ColorModeScope`; `'light'` outside both. */
|
|
48
|
+
function useColorMode() {
|
|
49
|
+
return useContext(ColorModeContext) ?? "light";
|
|
50
|
+
}
|
|
51
|
+
const printAsLight = `
|
|
52
|
+
@media print {
|
|
53
|
+
color-scheme: light;
|
|
54
|
+
${semanticCss.light}
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
57
|
+
/**
|
|
58
|
+
* Global style: publishes the palette and `color-scheme` for `mode` on `:root`. Print always uses
|
|
59
|
+
* the light palette.
|
|
60
|
+
*/
|
|
43
61
|
const SemanticCssVariables = createGlobalStyle`
|
|
44
62
|
:root {
|
|
63
|
+
color-scheme: ${({ mode }) => mode};
|
|
45
64
|
${({ mode }) => semanticCss[mode]}
|
|
65
|
+
${printAsLight}
|
|
46
66
|
}
|
|
47
67
|
`;
|
|
48
68
|
const ColorModeScopeRoot = styled.div`
|
|
49
69
|
display: contents;
|
|
70
|
+
color-scheme: ${({ $mode }) => $mode};
|
|
71
|
+
color: ${({ $mode }) => semanticPalettes[$mode].FgPrimary};
|
|
50
72
|
${({ $mode }) => semanticCss[$mode]}
|
|
73
|
+
${printAsLight}
|
|
74
|
+
|
|
75
|
+
@media print {
|
|
76
|
+
color: ${semanticLight.FgPrimary};
|
|
77
|
+
}
|
|
51
78
|
`;
|
|
52
79
|
/**
|
|
53
80
|
* Renders `children` in `mode`, whatever the surrounding mode is: a nested `ThemeProvider` with
|
|
54
|
-
* `withPdsTheming(outerTheme, mode)` and a `display: contents` wrapper carrying
|
|
55
|
-
* and the `--pds-*`
|
|
81
|
+
* `withPdsTheming(theme ?? outerTheme, mode)` and a `display: contents` wrapper carrying
|
|
82
|
+
* `data-color-mode`, `color-scheme`, the mode's `FgPrimary` text colour and the `--pds-*`
|
|
83
|
+
* declarations for `mode`. Changing `mode` re-themes the subtree without remounting it. Print always
|
|
84
|
+
* uses the light palette.
|
|
56
85
|
*/
|
|
57
|
-
const ColorModeScope = ({ children, mode }) => {
|
|
86
|
+
const ColorModeScope = ({ children, mode, theme }) => {
|
|
58
87
|
const outerTheme = useTheme();
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
88
|
+
const baseTheme = theme ?? outerTheme ?? defaultTheme;
|
|
89
|
+
const scopedTheme = useMemo(() => withPdsTheming(baseTheme, mode), [baseTheme, mode]);
|
|
90
|
+
return /* @__PURE__ */ jsx(ColorModeContext.Provider, {
|
|
91
|
+
value: mode,
|
|
92
|
+
children: /* @__PURE__ */ jsx(ThemeProvider, {
|
|
93
|
+
theme: scopedTheme,
|
|
94
|
+
children: /* @__PURE__ */ jsx(ColorModeScopeRoot, {
|
|
95
|
+
$mode: mode,
|
|
96
|
+
"data-color-mode": mode,
|
|
97
|
+
children
|
|
98
|
+
})
|
|
65
99
|
})
|
|
66
100
|
});
|
|
67
101
|
};
|
|
68
102
|
//#endregion
|
|
69
|
-
export { ColorModeScope, SemanticCssVariables, createPdsTheme, readDocumentColorMode, semanticCssDeclarations, semanticCssVariable };
|
|
103
|
+
export { ColorModeContext, ColorModeScope, SemanticCssVariables, createPdsTheme, readDocumentColorMode, semanticCssDeclarations, semanticCssVariable, useColorMode };
|
|
70
104
|
|
|
71
105
|
//# sourceMappingURL=colorMode.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorMode.mjs","names":[],"sources":["../../src/lib/colorMode.tsx"],"sourcesContent":["/**\n * Colour-mode helpers for apps embedded in the Persona dashboard.\n *\n * The host stamps the dashboard's mode on `<html data-color-mode>` before first paint (an inline\n * script in each app's `index.html`). These helpers read it, install the matching semantic palette\n * on the styled-components theme, and publish that palette as `--pds-*` CSS custom properties so\n * plain stylesheets resolve the same colours as PDS components.\n *\n * Most apps only need `PDSProvider colorMode={readDocumentColorMode()}`. `ColorModeScope` renders\n * part of a page in the other mode.\n *\n * Portals: PDS overlays portal to `document.body`. styled-components context crosses the portal, so\n * a PDS overlay opened inside a `ColorModeScope` renders in the scope's mode. CSS custom properties\n * don't: plain CSS inside a portaled overlay resolves the `:root` palette, not the scope's.\n */\nimport { type FC, type PropsWithChildren, useMemo } from 'react';\nimport styled, { createGlobalStyle, ThemeProvider, useTheme } from 'styled-components';\n\nimport defaultTheme, { type PdsThemingMode, type PersonaTheme, withPdsTheming } from '#src/theme';\nimport { semanticDark, semanticLight, type SemanticTokens } from '#src/variables/semantic';\n\nexport type ColorMode = Exclude<PdsThemingMode, 'off'>;\n\n/** `'dark'` only when `<html data-color-mode=\"dark\">`; anything else (absent, `DARK`, junk) is light. */\nexport function readDocumentColorMode(doc: Document = document): ColorMode {\n return doc.documentElement.dataset.colorMode === 'dark' ? 'dark' : 'light';\n}\n\n/** `withPdsTheming(baseTheme, mode)`; `baseTheme` defaults to the PDS default theme. */\nexport function createPdsTheme(\n mode: ColorMode,\n baseTheme: PersonaTheme = defaultTheme,\n): PersonaTheme {\n return withPdsTheming(baseTheme, mode);\n}\n\n/** `FgPrimary` -> `--pds-fg-primary`, `FeedbackDanger1` -> `--pds-feedback-danger-1`. */\nexport function semanticCssVariable(token: keyof SemanticTokens): string {\n return `--pds-${token\n .replace(/([a-z])([A-Z0-9])/g, '$1-$2')\n .replace(/([0-9])([A-Z])/g, '$1-$2')\n .toLowerCase()}`;\n}\n\n/** `--pds-*: value;` for every semantic token. */\nexport function semanticCssDeclarations(semantic: SemanticTokens): string {\n return (Object.keys(semantic) as (keyof SemanticTokens)[])\n .map((token) => `${semanticCssVariable(token)}: ${semantic[token]};`)\n .join('\\n');\n}\n\nconst semanticCss: Record<ColorMode, string> = {\n light: semanticCssDeclarations(semanticLight),\n dark: semanticCssDeclarations(semanticDark),\n};\n\n/** Global style: publishes the palette for `mode` on `:root`. */\nexport const SemanticCssVariables = createGlobalStyle<{ mode: ColorMode }>`\n :root {\n ${({ mode }) => semanticCss[mode]}\n }\n`;\n\nconst ColorModeScopeRoot = styled.div<{ $mode: ColorMode }>`\n display: contents;\n ${({ $mode }) => semanticCss[$mode]}\n`;\n\n/**\n * Renders `children` in `mode`, whatever the surrounding mode is: a nested `ThemeProvider` with\n * `withPdsTheming(outerTheme, mode)` and a `display: contents` wrapper carrying `data-color-mode
|
|
1
|
+
{"version":3,"file":"colorMode.mjs","names":[],"sources":["../../src/lib/colorMode.tsx"],"sourcesContent":["/**\n * Colour-mode helpers for apps embedded in the Persona dashboard.\n *\n * The host stamps the dashboard's mode on `<html data-color-mode>` before first paint (an inline\n * script in each app's `index.html`). These helpers read it, install the matching semantic palette\n * on the styled-components theme, and publish that palette as `--pds-*` CSS custom properties so\n * plain stylesheets resolve the same colours as PDS components.\n *\n * Most apps only need `PDSProvider colorMode={readDocumentColorMode()}`. `ColorModeScope` renders\n * part of a page in the other mode, and `useColorMode()` reads the mode in effect.\n *\n * Portals: PDS overlays portal to `document.body`. styled-components context crosses the portal, so\n * a PDS overlay opened inside a `ColorModeScope` renders in the scope's mode. CSS custom properties\n * don't: plain CSS inside a portaled overlay resolves the `:root` palette, not the scope's.\n */\nimport { createContext, type FC, type PropsWithChildren, useContext, useMemo } from 'react';\nimport styled, { createGlobalStyle, ThemeProvider, useTheme } from 'styled-components';\n\nimport defaultTheme, { type PdsThemingMode, type PersonaTheme, withPdsTheming } from '#src/theme';\nimport { semanticDark, semanticLight, type SemanticTokens } from '#src/variables/semantic';\n\nexport type ColorMode = Exclude<PdsThemingMode, 'off'>;\n\n/** `'dark'` only when `<html data-color-mode=\"dark\">`; anything else (absent, `DARK`, junk) is light. */\nexport function readDocumentColorMode(doc: Document = document): ColorMode {\n return doc.documentElement.dataset.colorMode === 'dark' ? 'dark' : 'light';\n}\n\n/** `withPdsTheming(baseTheme, mode)`; `baseTheme` defaults to the PDS default theme. */\nexport function createPdsTheme(\n mode: ColorMode,\n baseTheme: PersonaTheme = defaultTheme,\n): PersonaTheme {\n return withPdsTheming(baseTheme, mode);\n}\n\n/** `FgPrimary` -> `--pds-fg-primary`, `FeedbackDanger1` -> `--pds-feedback-danger-1`. */\nexport function semanticCssVariable(token: keyof SemanticTokens): string {\n return `--pds-${token\n .replace(/([a-z])([A-Z0-9])/g, '$1-$2')\n .replace(/([0-9])([A-Z])/g, '$1-$2')\n .toLowerCase()}`;\n}\n\n/** `--pds-*: value;` for every semantic token. */\nexport function semanticCssDeclarations(semantic: SemanticTokens): string {\n return (Object.keys(semantic) as (keyof SemanticTokens)[])\n .map((token) => `${semanticCssVariable(token)}: ${semantic[token]};`)\n .join('\\n');\n}\n\nconst semanticCss: Record<ColorMode, string> = {\n light: semanticCssDeclarations(semanticLight),\n dark: semanticCssDeclarations(semanticDark),\n};\n\nconst semanticPalettes: Record<ColorMode, SemanticTokens> = {\n light: semanticLight,\n dark: semanticDark,\n};\n\nexport const ColorModeContext = createContext<ColorMode | undefined>(undefined);\n\n/** The mode of the nearest `PDSProvider colorMode` or `ColorModeScope`; `'light'` outside both. */\nexport function useColorMode(): ColorMode {\n return useContext(ColorModeContext) ?? 'light';\n}\n\nconst printAsLight = `\n @media print {\n color-scheme: light;\n ${semanticCss.light}\n }\n`;\n\n/**\n * Global style: publishes the palette and `color-scheme` for `mode` on `:root`. Print always uses\n * the light palette.\n */\nexport const SemanticCssVariables = createGlobalStyle<{ mode: ColorMode }>`\n :root {\n color-scheme: ${({ mode }) => mode};\n ${({ mode }) => semanticCss[mode]}\n ${printAsLight}\n }\n`;\n\nconst ColorModeScopeRoot = styled.div<{ $mode: ColorMode }>`\n display: contents;\n color-scheme: ${({ $mode }) => $mode};\n color: ${({ $mode }) => semanticPalettes[$mode].FgPrimary};\n ${({ $mode }) => semanticCss[$mode]}\n ${printAsLight}\n\n @media print {\n color: ${semanticLight.FgPrimary};\n }\n`;\n\ninterface ColorModeScopeProps {\n mode: ColorMode;\n theme?: PersonaTheme;\n}\n\n/**\n * Renders `children` in `mode`, whatever the surrounding mode is: a nested `ThemeProvider` with\n * `withPdsTheming(theme ?? outerTheme, mode)` and a `display: contents` wrapper carrying\n * `data-color-mode`, `color-scheme`, the mode's `FgPrimary` text colour and the `--pds-*`\n * declarations for `mode`. Changing `mode` re-themes the subtree without remounting it. Print always\n * uses the light palette.\n */\nexport const ColorModeScope: FC<PropsWithChildren<ColorModeScopeProps>> = ({\n children,\n mode,\n theme,\n}) => {\n const outerTheme = useTheme() as PersonaTheme | undefined;\n const baseTheme = theme ?? outerTheme ?? defaultTheme;\n const scopedTheme = useMemo(() => withPdsTheming(baseTheme, mode), [baseTheme, mode]);\n\n return (\n <ColorModeContext.Provider value={mode}>\n <ThemeProvider theme={scopedTheme}>\n <ColorModeScopeRoot $mode={mode} data-color-mode={mode}>\n {children}\n </ColorModeScopeRoot>\n </ThemeProvider>\n </ColorModeContext.Provider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAgB,sBAAsB,MAAgB,UAAqB;AACzE,QAAO,IAAI,gBAAgB,QAAQ,cAAc,SAAS,SA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|
|
@@ -425,7 +425,7 @@ const validatePath = ({ path, jsonSchema, platformObjectJsonSchema = {}, primiti
|
|
|
425
425
|
const { methodChain, partial } = parseWithPartialOption(path);
|
|
426
426
|
const optionsWithPartiallyMatchedFinalLink = methodChain.links.reduce((currentSchema, link) => {
|
|
427
427
|
if (currentSchema.length === 0) return [];
|
|
428
|
-
const optionMatch = currentSchema.find((option) => option.property === link
|
|
428
|
+
const optionMatch = currentSchema.find((option) => option.property === fullNodeName(link));
|
|
429
429
|
if (optionMatch) return getSchemaOptions({
|
|
430
430
|
option: optionMatch,
|
|
431
431
|
optionFilters,
|
|
@@ -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 // 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"],"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,eA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EO,eAAe,gBAAgB,GAAG,CAC3C;WACS,iBAAiB,gBAAgB,GAAG,EAAE;GAC/C,MAAM,aAAa,kBAAkB,IAAI;AAIzC,OAAI,YAAY;IACd,MAAM,cAAc,qBAAqB,WAAW;AACpD,QAAI,eAAe,eAAe,mBAChC;;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"}
|
|
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 === fullNodeName(link));\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,aA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e,gBAAgB,GAAG,CACpC;aAEO,eAAe,gBAAgB,GAAG,CAC3C;WACS,iBAAiB,gBAAgB,GAAG,EAAE;GAC/C,MAAM,aAAa,kBAAkB,IAAI;AAIzC,OAAI,YAAY;IACd,MAAM,cAAc,qBAAqB,WAAW;AACpD,QAAI,eAAe,eAAe,mBAChC;;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-B--KAtdN.mjs";
|
|
2
2
|
export { chainRootsFromSchemaProperties, useChain as default, useChainSchema };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Ref, RefObject } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/useCloseFocus.d.ts
|
|
4
|
+
type OutsideEvent = CustomEvent<{
|
|
5
|
+
originalEvent: PointerEvent | FocusEvent;
|
|
6
|
+
}>;
|
|
7
|
+
interface CloseFocusOptions {
|
|
8
|
+
/** Runs once, when the close starts. `preventDefault` keeps focus where it is. */
|
|
9
|
+
onCloseAutoFocus?: (event: Event) => void;
|
|
10
|
+
/** Runs when the content reopens before its exit ends; Radix doesn't run it again then. */
|
|
11
|
+
onOpenAutoFocus?: (event: Event) => void;
|
|
12
|
+
onInteractOutside?: (event: OutsideEvent) => void;
|
|
13
|
+
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Modal content closes at once (it has no exit), so Radix's own focus handling is left alone:
|
|
16
|
+
* until unmount Radix hides the rest of the page from assistive technology.
|
|
17
|
+
*/
|
|
18
|
+
modal?: boolean;
|
|
19
|
+
/** Where focus returns. Falls back to the element whose `aria-controls` names the content. */
|
|
20
|
+
triggerRef?: RefObject<HTMLElement | null>;
|
|
21
|
+
/** What takes focus on a reopen mid-exit: the first tabbable element, or the content itself. */
|
|
22
|
+
reopenFocus?: 'first-tabbable' | 'content';
|
|
23
|
+
}
|
|
24
|
+
interface CloseFocus {
|
|
25
|
+
ref: (node: HTMLElement | null) => void;
|
|
26
|
+
onCloseAutoFocus?: (event: Event) => void;
|
|
27
|
+
onInteractOutside?: (event: OutsideEvent) => void;
|
|
28
|
+
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
29
|
+
'data-modal'?: '';
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Returns focus when a Radix popover or menu starts to close, instead of when its exit animation
|
|
33
|
+
* ends and it unmounts, and stops the closing content taking input. Spread the result onto the
|
|
34
|
+
* Radix `Content`, after the consumer's props.
|
|
35
|
+
*
|
|
36
|
+
* At close start it calls `onCloseAutoFocus` and, unless that's prevented or the close came from
|
|
37
|
+
* an interaction outside, focuses the trigger, as Radix would. Radix's own call at unmount is then
|
|
38
|
+
* prevented. Content that unmounts at once (no exit running) is left to Radix.
|
|
39
|
+
*/
|
|
40
|
+
declare function useCloseFocus(options: CloseFocusOptions): CloseFocus;
|
|
41
|
+
/** Sets every ref to the node. Memoize the result, or React re-attaches it on every render. */
|
|
42
|
+
declare function mergeRefs<T>(...refs: (Ref<T> | undefined)[]): (node: T | null) => void;
|
|
43
|
+
//#endregion
|
|
44
|
+
export { CloseFocus, CloseFocusOptions, mergeRefs, useCloseFocus };
|
|
45
|
+
//# sourceMappingURL=useCloseFocus.d.mts.map
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { useCallback, useRef } from "react";
|
|
2
|
+
//#region src/lib/useCloseFocus.ts
|
|
3
|
+
const TABBABLE = "button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
4
|
+
/**
|
|
5
|
+
* Returns focus when a Radix popover or menu starts to close, instead of when its exit animation
|
|
6
|
+
* ends and it unmounts, and stops the closing content taking input. Spread the result onto the
|
|
7
|
+
* Radix `Content`, after the consumer's props.
|
|
8
|
+
*
|
|
9
|
+
* At close start it calls `onCloseAutoFocus` and, unless that's prevented or the close came from
|
|
10
|
+
* an interaction outside, focuses the trigger, as Radix would. Radix's own call at unmount is then
|
|
11
|
+
* prevented. Content that unmounts at once (no exit running) is left to Radix.
|
|
12
|
+
*/
|
|
13
|
+
function useCloseFocus(options) {
|
|
14
|
+
const latest = useRef(options);
|
|
15
|
+
latest.current = options;
|
|
16
|
+
const state = useRef({
|
|
17
|
+
open: true,
|
|
18
|
+
interactedOutside: false,
|
|
19
|
+
trigger: null,
|
|
20
|
+
handled: /* @__PURE__ */ new WeakSet(),
|
|
21
|
+
observer: null,
|
|
22
|
+
node: null
|
|
23
|
+
});
|
|
24
|
+
const findTrigger = (node) => {
|
|
25
|
+
return (node.id ? node.ownerDocument.querySelector(`[aria-controls="${node.id.replace(/["\\]/g, "\\$&")}"]`) : null) ?? latest.current.triggerRef?.current ?? state.current.trigger;
|
|
26
|
+
};
|
|
27
|
+
const opened = (node) => {
|
|
28
|
+
const s = state.current;
|
|
29
|
+
s.open = true;
|
|
30
|
+
s.interactedOutside = false;
|
|
31
|
+
s.trigger = findTrigger(node);
|
|
32
|
+
if (!s.handled.has(node)) return;
|
|
33
|
+
s.handled.delete(node);
|
|
34
|
+
node.removeAttribute("inert");
|
|
35
|
+
const event = new CustomEvent("focusScope.autoFocusOnMount", { cancelable: true });
|
|
36
|
+
latest.current.onOpenAutoFocus?.(event);
|
|
37
|
+
if (!event.defaultPrevented) (latest.current.reopenFocus === "content" ? node : node.querySelector(TABBABLE) ?? node).focus({ preventScroll: true });
|
|
38
|
+
};
|
|
39
|
+
const closed = (node) => {
|
|
40
|
+
const s = state.current;
|
|
41
|
+
s.open = false;
|
|
42
|
+
if (!node.isConnected) return;
|
|
43
|
+
s.handled.add(node);
|
|
44
|
+
const active = node.ownerDocument.activeElement;
|
|
45
|
+
const focusInside = active == null || active === node.ownerDocument.body || node.contains(active) || !!active.closest("[data-radix-popper-content-wrapper] [data-state=\"closed\"]");
|
|
46
|
+
const interactedOutside = s.interactedOutside;
|
|
47
|
+
const restore = () => {
|
|
48
|
+
if (s.open) return;
|
|
49
|
+
const event = new CustomEvent("focusScope.autoFocusOnUnmount", { cancelable: true });
|
|
50
|
+
latest.current.onCloseAutoFocus?.(event);
|
|
51
|
+
if (!event.defaultPrevented && focusInside && !interactedOutside) findTrigger(node)?.focus({ preventScroll: true });
|
|
52
|
+
};
|
|
53
|
+
if (node.ownerDocument.defaultView?.event?.type === "keydown") setTimeout(restore, 0);
|
|
54
|
+
else restore();
|
|
55
|
+
node.setAttribute("inert", "");
|
|
56
|
+
};
|
|
57
|
+
const ref = useCallback((node) => {
|
|
58
|
+
const s = state.current;
|
|
59
|
+
if (!node || node === s.node) return;
|
|
60
|
+
s.observer?.disconnect();
|
|
61
|
+
s.observer = null;
|
|
62
|
+
s.node = node;
|
|
63
|
+
if (latest.current.modal) return;
|
|
64
|
+
s.open = node.getAttribute("data-state") !== "closed";
|
|
65
|
+
s.interactedOutside = false;
|
|
66
|
+
const active = node.ownerDocument.activeElement;
|
|
67
|
+
s.trigger = active && active !== node.ownerDocument.body ? active : null;
|
|
68
|
+
s.trigger = findTrigger(node);
|
|
69
|
+
s.observer = new MutationObserver(() => {
|
|
70
|
+
const isOpen = node.getAttribute("data-state") !== "closed";
|
|
71
|
+
if (isOpen && !s.open) opened(node);
|
|
72
|
+
else if (!isOpen && s.open) closed(node);
|
|
73
|
+
});
|
|
74
|
+
s.observer.observe(node, {
|
|
75
|
+
attributes: true,
|
|
76
|
+
attributeFilter: ["data-state"]
|
|
77
|
+
});
|
|
78
|
+
}, []);
|
|
79
|
+
if (options.modal) return {
|
|
80
|
+
ref,
|
|
81
|
+
onCloseAutoFocus: options.onCloseAutoFocus,
|
|
82
|
+
onInteractOutside: options.onInteractOutside,
|
|
83
|
+
onEscapeKeyDown: options.onEscapeKeyDown,
|
|
84
|
+
"data-modal": ""
|
|
85
|
+
};
|
|
86
|
+
return {
|
|
87
|
+
ref,
|
|
88
|
+
onCloseAutoFocus: (event) => {
|
|
89
|
+
if (event.currentTarget && state.current.handled.has(event.currentTarget)) {
|
|
90
|
+
state.current.handled.delete(event.currentTarget);
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
latest.current.onCloseAutoFocus?.(event);
|
|
95
|
+
},
|
|
96
|
+
onInteractOutside: (event) => {
|
|
97
|
+
if (!state.current.open) {
|
|
98
|
+
event.preventDefault();
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
latest.current.onInteractOutside?.(event);
|
|
102
|
+
if (!event.defaultPrevented) state.current.interactedOutside = true;
|
|
103
|
+
},
|
|
104
|
+
onEscapeKeyDown: (event) => {
|
|
105
|
+
if (!state.current.open) {
|
|
106
|
+
event.preventDefault();
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
latest.current.onEscapeKeyDown?.(event);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/** Sets every ref to the node. Memoize the result, or React re-attaches it on every render. */
|
|
114
|
+
function mergeRefs(...refs) {
|
|
115
|
+
return (node) => {
|
|
116
|
+
for (const ref of refs) if (typeof ref === "function") ref(node);
|
|
117
|
+
else if (ref) ref.current = node;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
export { mergeRefs, useCloseFocus };
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=useCloseFocus.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCloseFocus.mjs","names":[],"sources":["../../src/lib/useCloseFocus.ts"],"sourcesContent":["import { type Ref, type RefObject, useCallback, useRef } from 'react';\n\ntype OutsideEvent = CustomEvent<{ originalEvent: PointerEvent | FocusEvent }>;\n\nexport interface CloseFocusOptions {\n /** Runs once, when the close starts. `preventDefault` keeps focus where it is. */\n onCloseAutoFocus?: (event: Event) => void;\n /** Runs when the content reopens before its exit ends; Radix doesn't run it again then. */\n onOpenAutoFocus?: (event: Event) => void;\n onInteractOutside?: (event: OutsideEvent) => void;\n onEscapeKeyDown?: (event: KeyboardEvent) => void;\n /**\n * Modal content closes at once (it has no exit), so Radix's own focus handling is left alone:\n * until unmount Radix hides the rest of the page from assistive technology.\n */\n modal?: boolean;\n /** Where focus returns. Falls back to the element whose `aria-controls` names the content. */\n triggerRef?: RefObject<HTMLElement | null>;\n /** What takes focus on a reopen mid-exit: the first tabbable element, or the content itself. */\n reopenFocus?: 'first-tabbable' | 'content';\n}\n\nexport interface CloseFocus {\n ref: (node: HTMLElement | null) => void;\n onCloseAutoFocus?: (event: Event) => void;\n onInteractOutside?: (event: OutsideEvent) => void;\n onEscapeKeyDown?: (event: KeyboardEvent) => void;\n 'data-modal'?: '';\n}\n\nconst TABBABLE =\n 'button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Returns focus when a Radix popover or menu starts to close, instead of when its exit animation\n * ends and it unmounts, and stops the closing content taking input. Spread the result onto the\n * Radix `Content`, after the consumer's props.\n *\n * At close start it calls `onCloseAutoFocus` and, unless that's prevented or the close came from\n * an interaction outside, focuses the trigger, as Radix would. Radix's own call at unmount is then\n * prevented. Content that unmounts at once (no exit running) is left to Radix.\n */\nexport function useCloseFocus(options: CloseFocusOptions): CloseFocus {\n const latest = useRef(options);\n latest.current = options;\n const state = useRef({\n open: true,\n interactedOutside: false,\n trigger: null as HTMLElement | null,\n handled: new WeakSet<EventTarget>(),\n observer: null as MutationObserver | null,\n node: null as HTMLElement | null,\n });\n\n const findTrigger = (node: HTMLElement): HTMLElement | null => {\n // The `aria-controls` match wins: a raw Root nested in a PDS Popover inherits its triggerRef.\n const controlled = node.id\n ? node.ownerDocument.querySelector<HTMLElement>(\n `[aria-controls=\"${node.id.replace(/[\"\\\\]/g, '\\\\$&')}\"]`,\n )\n : null;\n return controlled ?? latest.current.triggerRef?.current ?? state.current.trigger;\n };\n\n const opened = (node: HTMLElement) => {\n const s = state.current;\n s.open = true;\n s.interactedOutside = false;\n s.trigger = findTrigger(node);\n if (!s.handled.has(node)) {\n return;\n }\n s.handled.delete(node);\n node.removeAttribute('inert');\n const event = new CustomEvent('focusScope.autoFocusOnMount', { cancelable: true });\n latest.current.onOpenAutoFocus?.(event);\n if (!event.defaultPrevented) {\n const target =\n latest.current.reopenFocus === 'content'\n ? node\n : (node.querySelector<HTMLElement>(TABBABLE) ?? node);\n target.focus({ preventScroll: true });\n }\n };\n\n const closed = (node: HTMLElement) => {\n const s = state.current;\n s.open = false;\n if (!node.isConnected) {\n return;\n }\n s.handled.add(node);\n const active = node.ownerDocument.activeElement;\n // A portaled child layer closing in the same commit (a menu item that closes its Popover)\n // holds focus outside `node`, and its own trigger is about to go inert with `node`.\n const focusInside =\n active == null ||\n active === node.ownerDocument.body ||\n node.contains(active) ||\n !!active.closest('[data-radix-popper-content-wrapper] [data-state=\"closed\"]');\n const interactedOutside = s.interactedOutside;\n const restore = () => {\n if (s.open) {\n return;\n }\n const event = new CustomEvent('focusScope.autoFocusOnUnmount', { cancelable: true });\n latest.current.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented && focusInside && !interactedOutside) {\n findTrigger(node)?.focus({ preventScroll: true });\n }\n };\n // Focus moved during a keydown takes that key's keypress, so an Enter that closes from a\n // field would click the trigger and reopen it. Radix restores after a task for the same reason.\n if (node.ownerDocument.defaultView?.event?.type === 'keydown') {\n setTimeout(restore, 0);\n } else {\n restore();\n }\n node.setAttribute('inert', '');\n };\n\n const ref = useCallback((node: HTMLElement | null) => {\n const s = state.current;\n // Radix composes its content refs afresh on every render, so React detaches (null) and\n // reattaches the same node each time; only a new node starts a new open.\n if (!node || node === s.node) {\n return;\n }\n s.observer?.disconnect();\n s.observer = null;\n s.node = node;\n if (latest.current.modal) {\n return;\n }\n s.open = node.getAttribute('data-state') !== 'closed';\n s.interactedOutside = false;\n const active = node.ownerDocument.activeElement;\n s.trigger = active && active !== node.ownerDocument.body ? (active as HTMLElement) : null;\n s.trigger = findTrigger(node);\n s.observer = new MutationObserver(() => {\n const isOpen = node.getAttribute('data-state') !== 'closed';\n if (isOpen && !s.open) {\n opened(node);\n } else if (!isOpen && s.open) {\n closed(node);\n }\n });\n s.observer.observe(node, { attributes: true, attributeFilter: ['data-state'] });\n }, []);\n\n if (options.modal) {\n return {\n ref,\n onCloseAutoFocus: options.onCloseAutoFocus,\n onInteractOutside: options.onInteractOutside,\n onEscapeKeyDown: options.onEscapeKeyDown,\n 'data-modal': '',\n };\n }\n\n return {\n ref,\n onCloseAutoFocus: (event) => {\n if (event.currentTarget && state.current.handled.has(event.currentTarget)) {\n state.current.handled.delete(event.currentTarget);\n event.preventDefault();\n return;\n }\n latest.current.onCloseAutoFocus?.(event);\n },\n onInteractOutside: (event) => {\n if (!state.current.open) {\n event.preventDefault();\n return;\n }\n latest.current.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n state.current.interactedOutside = true;\n }\n },\n onEscapeKeyDown: (event) => {\n if (!state.current.open) {\n event.preventDefault();\n return;\n }\n latest.current.onEscapeKeyDown?.(event);\n },\n };\n}\n\n/** Sets every ref to the node. Memoize the result, or React re-attaches it on every render. */\nexport function mergeRefs<T>(...refs: (Ref<T> | undefined)[]): (node: T | null) => void {\n return (node) => {\n for (const ref of refs) {\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n (ref as { current: T | null }).current = node;\n }\n }\n };\n}\n"],"mappings":";;AA8BA,MAAM,WACJ;;;;;;;;;;AAWF,SAAgB,cAAc,SAAwC;CACpE,MAAM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AAM,QAAQ,MAAM;AACvB,UAAM,gBAAgB;AACtB;;AAEF,UAAO,QAAQ,oBAAoB,MAAM;AACzC,OAAI,CAAC,MAAM,iBACT,OAAM,QAAQ,oBAAoB;;EAGtC,kBAAkB,UAAU;AAC1B,OAAI,CAAC,MAAM,QAAQ,MAAM;AACvB,UAAM,gBAAgB;AACtB;;AAEF,UAAO,QAAQ,kBAAkB,MAAM;;EAE1C;;;AAIH,SAAgB,UAAa,GAAG,MAAwD;AACtF,SAAQ,SAAS;AACf,OAAK,MAAM,OAAO,KAChB,KAAI,OAAO,QAAQ,WACjB,KAAI,KAAK;WACA,IACR,KAA8B,UAAU"}
|
package/dist/mixins/focus.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as css } from "../styledComponentsInterop-Cs5CCPRy.mjs";
|
|
2
|
-
import { isFocusedVisible, isNotDisabled } from "../lib/pseudoClass.mjs";
|
|
3
2
|
import { semanticColor } from "../lib/semanticColor.mjs";
|
|
3
|
+
import { isFocusedVisible, isNotDisabled } from "../lib/pseudoClass.mjs";
|
|
4
4
|
import { Color } from "@persona/design-tokens";
|
|
5
5
|
//#region src/mixins/focus.ts
|
|
6
6
|
const focusColor = (theme) => semanticColor(theme, "BorderFocus", Color.BorderFocus);
|