@code0-tech/pictor 0.0.0-mvp.26 → 0.0.0-mvp.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/components/badge/Badge.style.css +1 -1
- package/dist/assets/components/button/Button.style.css +1 -1
- package/dist/assets/components/context-menu/ContextMenu.style.css +1 -0
- package/dist/assets/components/d-flow-folder/DFlowFolder.style.css +1 -0
- package/dist/assets/components/{d-flow/function → d-flow-function}/DFlowFunctionDefaultCard.style.css +1 -1
- package/dist/assets/components/d-flow-panel/DFlowMiniMap.style.css +1 -0
- package/dist/assets/components/d-flow-suggestion/DFlowSuggestionSearchInput.style.css +1 -0
- package/dist/assets/components/d-layout/DLayout.style.css +1 -1
- package/dist/assets/components/d-resizable/DResizable.style.css +1 -1
- package/dist/assets/components/file-tabs/FileTabs.style.css +1 -1
- package/dist/assets/components/form/Input.style.css +1 -1
- package/dist/assets/components/segmented-control/SegmentedControl.style.css +1 -1
- package/dist/components/avatar/Avatar.js +7 -7
- package/dist/components/badge/Badge.d.ts +1 -1
- package/dist/components/badge/Badge.js +57 -17
- package/dist/components/breadcrumb/Breadcrumb.js +5 -5
- package/dist/components/button/Button.js +8 -8
- package/dist/components/context-menu/ContextMenu.d.ts +31 -0
- package/dist/components/context-menu/ContextMenu.js +191 -0
- package/dist/components/d-application/DApplication.service.d.ts +5 -0
- package/dist/components/d-application/DApplication.service.js +9 -0
- package/dist/components/d-flow/DFlow.d.ts +5 -3
- package/dist/components/d-flow/DFlow.edges.hook.d.ts +2 -1
- package/dist/components/d-flow/DFlow.edges.hook.js +98 -136
- package/dist/components/d-flow/DFlow.js +214 -199
- package/dist/components/d-flow/DFlow.nodes.hook.d.ts +5 -1
- package/dist/components/d-flow/DFlow.nodes.hook.js +101 -123
- package/dist/components/d-flow/DFlow.service.d.ts +12 -7
- package/dist/components/d-flow/DFlow.service.js +117 -7
- package/dist/components/d-flow/{edge/DFlowEdge.d.ts → DFlowEdge.d.ts} +5 -3
- package/dist/components/d-flow/DFlowEdge.js +69 -0
- package/dist/components/d-flow/index.d.ts +1 -10
- package/dist/components/d-flow/index.js +9 -44
- package/dist/components/d-flow-data-type/DFlowDataType.service.d.ts +9 -0
- package/dist/components/{d-flow/data-type → d-flow-data-type}/DFlowDataType.service.js +12 -10
- package/dist/components/{d-flow/data-type → d-flow-data-type}/DFlowDataType.view.d.ts +8 -2
- package/dist/components/d-flow-data-type/DFlowDataType.view.js +71 -0
- package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeContainsKeyRule.d.ts +2 -3
- package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeContainsKeyRule.js +3 -3
- package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeContainsTypeRule.d.ts +2 -3
- package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeContainsTypeRule.js +4 -4
- package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeParentRule.d.ts +2 -3
- package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeParentRule.js +3 -3
- package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeReturnTypeRule.d.ts +2 -3
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.js +246 -0
- package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeRule.d.ts +2 -3
- package/dist/components/{d-flow/tab → d-flow-file}/DFlowTabDefault.d.ts +2 -3
- package/dist/components/d-flow-file/DFlowTabDefault.js +139 -0
- package/dist/components/{d-flow/tab → d-flow-file}/DFlowTabTrigger.d.ts +2 -2
- package/dist/components/d-flow-file/DFlowTabTrigger.js +75 -0
- package/dist/components/d-flow-file/DFlowTabs.d.ts +6 -0
- package/dist/components/d-flow-file/DFlowTabs.js +128 -0
- package/dist/components/d-flow-file/index.d.ts +1 -0
- package/dist/components/d-flow-file/index.js +4 -0
- package/dist/components/{d-flow/folder → d-flow-folder}/DFlowFolder.d.ts +11 -5
- package/dist/components/d-flow-folder/DFlowFolder.js +158 -0
- package/dist/components/d-flow-folder/DFlowFolderContextMenu.d.ts +18 -0
- package/dist/components/d-flow-folder/DFlowFolderContextMenu.js +69 -0
- package/dist/components/d-flow-folder/DFlowFolderCreateDialog.d.ts +9 -0
- package/dist/components/d-flow-folder/DFlowFolderCreateDialog.js +76 -0
- package/dist/components/d-flow-folder/DFlowFolderItemPathInput.d.ts +5 -0
- package/dist/components/d-flow-folder/DFlowFolderItemPathInput.js +49 -0
- package/dist/components/d-flow-folder/DFlowFolderRenameDialog.d.ts +9 -0
- package/dist/components/d-flow-folder/DFlowFolderRenameDialog.js +55 -0
- package/dist/components/{d-flow/function → d-flow-function}/DFlowFunction.input.hook.d.ts +1 -1
- package/dist/components/{d-flow/function → d-flow-function}/DFlowFunction.input.hook.js +1 -1
- package/dist/components/{d-flow/function → d-flow-function}/DFlowFunction.return.hook.d.ts +2 -2
- package/dist/components/d-flow-function/DFlowFunction.return.hook.js +9 -0
- package/dist/components/{d-flow/function → d-flow-function}/DFlowFunction.service.d.ts +1 -1
- package/dist/components/d-flow-function/DFlowFunction.service.js +12 -0
- package/dist/components/{d-flow/function → d-flow-function}/DFlowFunction.view.d.ts +12 -0
- package/dist/components/d-flow-function/DFlowFunction.view.js +132 -0
- package/dist/components/{d-flow/function → d-flow-function}/DFlowFunctionDefaultCard.d.ts +4 -4
- package/dist/components/d-flow-function/DFlowFunctionDefaultCard.js +120 -0
- package/dist/components/d-flow-function/DFlowFunctionGroupCard.d.ts +13 -0
- package/dist/components/d-flow-function/DFlowFunctionGroupCard.js +68 -0
- package/dist/components/{d-flow/function → d-flow-function}/DFlowFunctionSuggestionCard.d.ts +3 -4
- package/dist/components/d-flow-function/DFlowFunctionSuggestionCard.js +48 -0
- package/dist/components/{d-flow/function → d-flow-function}/DFlowFunctionTriggerCard.d.ts +3 -3
- package/dist/components/d-flow-function/DFlowFunctionTriggerCard.js +71 -0
- package/dist/components/{d-flow/input → d-flow-input}/DFlowInputDataType.d.ts +1 -1
- package/dist/components/{d-flow/input → d-flow-input}/DFlowInputDataType.js +175 -165
- package/dist/components/d-flow-panel/DFlowExport.js +32 -0
- package/dist/components/d-flow-panel/DFlowMiniMap.js +33 -0
- package/dist/components/d-flow-panel/DFlowPanelControl.d.ts +6 -0
- package/dist/components/d-flow-panel/DFlowPanelControl.js +70 -0
- package/dist/components/d-flow-panel/DFlowPanelLayout.d.ts +4 -0
- package/dist/components/d-flow-panel/DFlowPanelLayout.js +47 -0
- package/dist/components/d-flow-panel/DFlowPanelSize.d.ts +2 -0
- package/dist/components/d-flow-panel/DFlowPanelSize.js +94 -0
- package/dist/components/d-flow-panel/index.d.ts +5 -0
- package/dist/components/d-flow-panel/index.js +12 -0
- package/dist/components/{d-flow/suggestion → d-flow-suggestion}/DFlowSuggestion.hook.d.ts +0 -15
- package/dist/components/d-flow-suggestion/DFlowSuggestion.hook.js +161 -0
- package/dist/components/d-flow-suggestion/DFlowSuggestion.view.d.ts +14 -0
- package/dist/components/d-flow-suggestion/DFlowSuggestion.view.js +4 -0
- package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.js +83 -0
- package/dist/components/{d-flow/suggestion → d-flow-suggestion}/DFlowSuggestionMenu.util.d.ts +1 -1
- package/dist/components/{d-flow/suggestion → d-flow-suggestion}/DFlowSuggestionMenu.util.js +1 -1
- package/dist/components/{d-flow/suggestion → d-flow-suggestion}/DFlowSuggestionMenuFooter.js +5 -5
- package/dist/components/{d-flow/suggestion → d-flow-suggestion}/DFlowSuggestionMenuSearchBar.d.ts +1 -1
- package/dist/components/{d-flow/suggestion → d-flow-suggestion}/DFlowSuggestionMenuSearchBar.js +1 -1
- package/dist/components/{d-flow/suggestion → d-flow-suggestion}/DFlowSuggestionSearchInput.d.ts +1 -1
- package/dist/components/d-flow-suggestion/DFlowSuggestionSearchInput.js +35 -0
- package/dist/components/d-flow-suggestion/index.d.ts +1 -0
- package/dist/components/d-flow-suggestion/index.js +4 -0
- package/dist/components/{d-flow/type → d-flow-type}/DFlowType.service.d.ts +1 -1
- package/dist/components/d-flow-type/DFlowType.service.js +12 -0
- package/dist/components/{d-flow/type → d-flow-type}/DFlowType.view.d.ts +6 -0
- package/dist/components/{d-flow/type → d-flow-type}/DFlowType.view.js +16 -10
- package/dist/components/d-flow-validation/DDataTypeValidation.hook.d.ts +2 -0
- package/dist/components/d-flow-validation/DDataTypeValidation.hook.js +18 -0
- package/dist/components/d-flow-validation/DFlowValidation.hook.d.ts +3 -0
- package/dist/components/d-flow-validation/DFlowValidation.hook.js +22 -0
- package/dist/components/d-flow-validation/DFlowValidation.js +66 -0
- package/dist/components/d-flow-validation/DNodeValidation.hook.d.ts +3 -0
- package/dist/components/d-flow-validation/DNodeValidation.hook.js +62 -0
- package/dist/components/d-flow-validation/DValueValidation.hook.d.ts +3 -0
- package/dist/components/d-flow-validation/DValueValidation.hook.js +8 -0
- package/dist/components/{d-flow/validation → d-flow-validation}/index.js +2 -2
- package/dist/components/d-fullscreen/DFullScreen.js +2 -2
- package/dist/components/d-member/DNamespaceMemberList.js +5 -5
- package/dist/components/d-organization/DOrganizationList.js +7 -7
- package/dist/components/d-organization/DOrganizationMenu.js +5 -5
- package/dist/components/d-organization/DOrganizatonContent.js +22 -22
- package/dist/components/d-project/DNamespaceProjectContent.js +6 -6
- package/dist/components/d-project/DNamespaceProjectList.js +5 -5
- package/dist/components/d-project/DNamespaceProjectMenu.js +2 -2
- package/dist/components/d-resizable/DResizable.js +18 -17
- package/dist/components/d-role/DNamespaceRolePermissions.js +5 -5
- package/dist/components/d-runtime/DRuntimeList.js +7 -7
- package/dist/components/d-user/DUser.session.hook.js +2 -2
- package/dist/components/d-user/DUserContent.js +13 -13
- package/dist/components/d-user/DUserInput.js +9 -9
- package/dist/components/d-user/DUserList.js +9 -9
- package/dist/components/file-tabs/FileTabs.js +2 -2
- package/dist/components/file-tabs/FileTabs.service.d.ts +5 -0
- package/dist/components/file-tabs/FileTabs.service.js +68 -16
- package/dist/components/file-tabs/FileTabs.view.d.ts +1 -0
- package/dist/components/form/CheckboxInput.js +4 -4
- package/dist/components/form/EmailInput.js +12 -12
- package/dist/components/form/Input.js +220 -206
- package/dist/components/form/Input.selection.hook.js +9 -9
- package/dist/components/form/Input.syntax.hook.js +7 -7
- package/dist/components/form/NumberInput.js +9 -9
- package/dist/components/form/PasswordInput.js +6 -6
- package/dist/components/form/SwitchInput.js +7 -7
- package/dist/components/form/TextInput.js +10 -10
- package/dist/components/segmented-control/SegmentedControl.d.ts +1 -1
- package/dist/components/segmented-control/SegmentedControl.js +14 -12
- package/dist/index.d.ts +8 -0
- package/dist/index.js +117 -117
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +527 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +402 -0
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +208 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +130 -0
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +9 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +48 -0
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +29 -0
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +53 -0
- package/dist/node_modules/@radix-ui/react-context-menu/dist/index.js +222 -0
- package/dist/node_modules/@radix-ui/react-direction/dist/index.js +10 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +127 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +17 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +136 -0
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +13 -0
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +636 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +219 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +15 -0
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +70 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +36 -0
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +183 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +10 -0
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +52 -0
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +14 -0
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +6 -0
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +27 -0
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +52 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.js +7 -0
- package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +2 -2
- package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +8 -8
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +11 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +112 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +31 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +16 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +68 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +71 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +7 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +25 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +11 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +15 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +30 -0
- package/dist/node_modules/tslib/tslib.es6.js +27 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +6 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +26 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +25 -0
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +18 -0
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +67 -0
- package/dist/utils/generics.d.ts +5 -6
- package/dist/utils/generics.js +2 -2
- package/dist/utils/objectStore.js +15 -15
- package/dist/utils/reactiveArrayService.js +5 -5
- package/package.json +7 -4
- package/dist/assets/components/d-flow/folder/DFlowFolder.style.css +0 -1
- package/dist/assets/components/d-flow/minimap/DFlowMiniMap.style.css +0 -1
- package/dist/assets/components/d-flow/suggestion/DFlowSuggestionSearchInput.style.css +0 -1
- package/dist/components/d-flow/DFlow.view.d.ts +0 -113
- package/dist/components/d-flow/DFlow.view.js +0 -248
- package/dist/components/d-flow/control/DFlowControl.d.ts +0 -2
- package/dist/components/d-flow/control/DFlowControl.js +0 -81
- package/dist/components/d-flow/control/index.d.ts +0 -1
- package/dist/components/d-flow/control/index.js +0 -4
- package/dist/components/d-flow/data-type/DFlowDataType.service.d.ts +0 -10
- package/dist/components/d-flow/data-type/DFlowDataType.validation.type.d.ts +0 -2
- package/dist/components/d-flow/data-type/DFlowDataType.validation.type.js +0 -18
- package/dist/components/d-flow/data-type/DFlowDataType.validation.value.d.ts +0 -4
- package/dist/components/d-flow/data-type/DFlowDataType.validation.value.js +0 -20
- package/dist/components/d-flow/data-type/DFlowDataType.view.js +0 -65
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeReturnTypeRule.js +0 -243
- package/dist/components/d-flow/edge/DFlowEdge.js +0 -48
- package/dist/components/d-flow/export/DFlowExport.js +0 -24
- package/dist/components/d-flow/folder/DFlowFolder.js +0 -119
- package/dist/components/d-flow/function/DFlowFunction.return.hook.js +0 -11
- package/dist/components/d-flow/function/DFlowFunction.service.js +0 -9
- package/dist/components/d-flow/function/DFlowFunction.vaildation.hook.d.ts +0 -10
- package/dist/components/d-flow/function/DFlowFunction.vaildation.hook.js +0 -74
- package/dist/components/d-flow/function/DFlowFunction.view.js +0 -117
- package/dist/components/d-flow/function/DFlowFunctionDefaultCard.js +0 -158
- package/dist/components/d-flow/function/DFlowFunctionGroupCard.d.ts +0 -5
- package/dist/components/d-flow/function/DFlowFunctionGroupCard.js +0 -55
- package/dist/components/d-flow/function/DFlowFunctionSuggestionCard.js +0 -26
- package/dist/components/d-flow/function/DFlowFunctionTriggerCard.js +0 -93
- package/dist/components/d-flow/minimap/DFlowMiniMap.js +0 -22
- package/dist/components/d-flow/minimap/index.d.ts +0 -1
- package/dist/components/d-flow/minimap/index.js +0 -4
- package/dist/components/d-flow/suggestion/DFlowSuggestion.hook.js +0 -150
- package/dist/components/d-flow/suggestion/DFlowSuggestion.service.d.ts +0 -5
- package/dist/components/d-flow/suggestion/DFlowSuggestion.service.js +0 -18
- package/dist/components/d-flow/suggestion/DFlowSuggestion.view.d.ts +0 -21
- package/dist/components/d-flow/suggestion/DFlowSuggestion.view.js +0 -25
- package/dist/components/d-flow/suggestion/DFlowSuggestionMenu.js +0 -67
- package/dist/components/d-flow/suggestion/DFlowSuggestionSearchInput.js +0 -35
- package/dist/components/d-flow/suggestion/index.d.ts +0 -2
- package/dist/components/d-flow/suggestion/index.js +0 -7
- package/dist/components/d-flow/tab/DFlowTabDefault.js +0 -103
- package/dist/components/d-flow/tab/DFlowTabTrigger.js +0 -51
- package/dist/components/d-flow/tab/DFlowTabs.d.ts +0 -2
- package/dist/components/d-flow/tab/DFlowTabs.js +0 -105
- package/dist/components/d-flow/type/DFlowType.service.js +0 -9
- package/dist/components/d-flow/validation/DFlowValidation.hook.d.ts +0 -3
- package/dist/components/d-flow/validation/DFlowValidation.hook.js +0 -10
- package/dist/components/d-flow/validation/DFlowValidation.js +0 -60
- /package/dist/assets/components/{d-flow/input → d-flow-input}/DFlowInputDataType.style.css +0 -0
- /package/dist/assets/components/{d-flow/validation → d-flow-validation}/DFlowValidation.style.css +0 -0
- /package/dist/components/{d-flow/data-type → d-flow-data-type}/index.d.ts +0 -0
- /package/dist/components/{d-flow/data-type → d-flow-data-type}/index.js +0 -0
- /package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeItemOfCollectionRule.d.ts +0 -0
- /package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeItemOfCollectionRule.js +0 -0
- /package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeNumberRangeRule.d.ts +0 -0
- /package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeNumberRangeRule.js +0 -0
- /package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeRegexRule.d.ts +0 -0
- /package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeRegexRule.js +0 -0
- /package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeRule.js +0 -0
- /package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeRules.d.ts +0 -0
- /package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeRules.js +0 -0
- /package/dist/components/{d-flow/folder → d-flow-folder}/index.d.ts +0 -0
- /package/dist/components/{d-flow/folder → d-flow-folder}/index.js +0 -0
- /package/dist/components/{d-flow/function → d-flow-function}/index.d.ts +0 -0
- /package/dist/components/{d-flow/function → d-flow-function}/index.js +0 -0
- /package/dist/components/{d-flow/export → d-flow-panel}/DFlowExport.d.ts +0 -0
- /package/dist/components/{d-flow/minimap → d-flow-panel}/DFlowMiniMap.d.ts +0 -0
- /package/dist/components/{d-flow/suggestion → d-flow-suggestion}/DFlowSuggestionMenu.d.ts +0 -0
- /package/dist/components/{d-flow/suggestion → d-flow-suggestion}/DFlowSuggestionMenuFooter.d.ts +0 -0
- /package/dist/components/{d-flow/type → d-flow-type}/index.d.ts +0 -0
- /package/dist/components/{d-flow/type → d-flow-type}/index.js +0 -0
- /package/dist/components/{d-flow/validation → d-flow-validation}/DFlowValidation.d.ts +0 -0
- /package/dist/components/{d-flow/validation → d-flow-validation}/index.d.ts +0 -0
|
@@ -1,121 +1,133 @@
|
|
|
1
|
-
import { jsx as y, jsxs as z, Fragment as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as y, jsxs as z, Fragment as lt } from "react/jsx-runtime";
|
|
2
|
+
import d, { useRef as A, useState as L, useEffect as k, useMemo as Je } from "react";
|
|
3
3
|
import "../../utils/contextStore.js";
|
|
4
|
-
import { mergeCode0Props as
|
|
4
|
+
import { mergeCode0Props as ge } from "../../utils/utils.js";
|
|
5
5
|
import '../../assets/components/form/Input.style.css';/* empty css */
|
|
6
|
-
import { InputLabel as
|
|
7
|
-
import { InputDescription as
|
|
8
|
-
import { InputMessage as
|
|
9
|
-
import { Menu as
|
|
10
|
-
import { InputSuggestionMenuContent as
|
|
11
|
-
import { InputSyntax as
|
|
12
|
-
import { useSyntaxModel as
|
|
13
|
-
import { useSelectionVisibility as
|
|
14
|
-
import { setSelectionRangeSafe as T, getSelectionMetrics as U, setElementKey as
|
|
15
|
-
import { Card as
|
|
16
|
-
const
|
|
6
|
+
import { InputLabel as ut } from "./InputLabel.js";
|
|
7
|
+
import { InputDescription as ct } from "./InputDescription.js";
|
|
8
|
+
import { InputMessage as dt } from "./InputMessage.js";
|
|
9
|
+
import { Menu as ft, MenuTrigger as gt, MenuPortal as mt } from "../menu/Menu.js";
|
|
10
|
+
import { InputSuggestionMenuContent as pt, InputSuggestionMenuContentItems as ht } from "./InputSuggestion.js";
|
|
11
|
+
import { InputSyntax as xt } from "./InputSyntax.js";
|
|
12
|
+
import { useSyntaxModel as St } from "./Input.syntax.hook.js";
|
|
13
|
+
import { useSelectionVisibility as vt, useSelectionNormalization as kt, useSelectionResolution as wt } from "./Input.selection.hook.js";
|
|
14
|
+
import { setSelectionRangeSafe as T, getSelectionMetrics as U, setElementKey as Xe } from "./Input.utils.js";
|
|
15
|
+
import { Card as yt } from "../card/Card.js";
|
|
16
|
+
const It = d.forwardRef((te, Ye) => {
|
|
17
17
|
const {
|
|
18
|
-
wrapperComponent:
|
|
19
|
-
title:
|
|
20
|
-
description:
|
|
21
|
-
disabled:
|
|
22
|
-
left:
|
|
23
|
-
right:
|
|
24
|
-
leftType:
|
|
25
|
-
rightType:
|
|
26
|
-
formValidation:
|
|
18
|
+
wrapperComponent: Ge = {},
|
|
19
|
+
title: me,
|
|
20
|
+
description: pe,
|
|
21
|
+
disabled: he = !1,
|
|
22
|
+
left: xe,
|
|
23
|
+
right: Se,
|
|
24
|
+
leftType: Qe = "icon",
|
|
25
|
+
rightType: Ze = "action",
|
|
26
|
+
formValidation: I = {
|
|
27
27
|
valid: !0,
|
|
28
28
|
notValidMessage: null,
|
|
29
29
|
setValue: null
|
|
30
30
|
},
|
|
31
31
|
suggestions: x,
|
|
32
|
-
suggestionsHeader:
|
|
33
|
-
suggestionsFooter:
|
|
32
|
+
suggestionsHeader: ve,
|
|
33
|
+
suggestionsFooter: ke,
|
|
34
34
|
onSuggestionSelect: W,
|
|
35
|
-
disableOnValue:
|
|
35
|
+
disableOnValue: we = () => !1,
|
|
36
36
|
transformSyntax: ne,
|
|
37
37
|
validationUsesSuggestions: j = !1,
|
|
38
|
-
filterSuggestionsByLastToken:
|
|
39
|
-
enforceUniqueSuggestions:
|
|
38
|
+
filterSuggestionsByLastToken: C = !1,
|
|
39
|
+
enforceUniqueSuggestions: ye = !1,
|
|
40
40
|
onLastTokenChange: re,
|
|
41
|
-
suggestionsEmptyState:
|
|
42
|
-
...
|
|
43
|
-
} = te,
|
|
41
|
+
suggestionsEmptyState: Ie,
|
|
42
|
+
...et
|
|
43
|
+
} = te, {
|
|
44
|
+
onFocus: be,
|
|
45
|
+
onBlur: Me,
|
|
46
|
+
onKeyDown: Ce,
|
|
47
|
+
onKeyDownCapture: Ve,
|
|
48
|
+
onChange: Ee,
|
|
49
|
+
onInput: De,
|
|
50
|
+
...P
|
|
51
|
+
} = et, a = Ye || A(null), N = A(null), _ = A(null), H = A(!0), V = A(null), tt = A(0), Re = A([]), Ae = A(null), [E, F] = L(!1), [m, nt] = L(te.defaultValue || te.initialValue), [J, Te] = L([]), [X, Fe] = L([]), [Le, O] = L(null), [se, $] = L(null), [Pe, Ne] = L(!1), Y = d.useMemo(() => we(m), [m, we]), ae = d.useMemo(() => ({
|
|
52
|
+
...P,
|
|
53
|
+
onChange: Ee,
|
|
54
|
+
onInput: De
|
|
55
|
+
}), [P, Ee, De]), b = d.useCallback((e) => {
|
|
44
56
|
const t = e ?? "";
|
|
45
57
|
return typeof t == "string" ? t : String(t);
|
|
46
|
-
}, []),
|
|
58
|
+
}, []), Oe = d.useCallback((e, t, n) => {
|
|
47
59
|
if (e.length === 0) return t <= n.length ? t : null;
|
|
48
60
|
let r = n.indexOf(e);
|
|
49
61
|
if (r === -1) return null;
|
|
50
|
-
let
|
|
51
|
-
for (;
|
|
52
|
-
Math.abs(
|
|
62
|
+
let s = r;
|
|
63
|
+
for (; s !== -1; )
|
|
64
|
+
Math.abs(s - t) < Math.abs(r - t) && (r = s), s = n.indexOf(e, s + 1);
|
|
53
65
|
return r;
|
|
54
|
-
}, []), G =
|
|
66
|
+
}, []), G = d.useCallback((e, t) => {
|
|
55
67
|
const n = [];
|
|
56
68
|
return e.forEach((r) => {
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
59
|
-
const i =
|
|
60
|
-
t.slice(
|
|
69
|
+
const s = Oe(r.text, r.start, t);
|
|
70
|
+
if (s === null) return;
|
|
71
|
+
const i = s + r.text.length;
|
|
72
|
+
t.slice(s, i) === r.text && n.push({
|
|
61
73
|
...r,
|
|
62
|
-
start:
|
|
74
|
+
start: s,
|
|
63
75
|
end: i
|
|
64
76
|
});
|
|
65
77
|
}), n;
|
|
66
|
-
}, [
|
|
78
|
+
}, [Oe]);
|
|
67
79
|
k(() => {
|
|
68
|
-
|
|
80
|
+
Re.current = X;
|
|
69
81
|
}, [X]), k(() => {
|
|
70
|
-
const e =
|
|
71
|
-
if (!e || !
|
|
82
|
+
const e = a.current;
|
|
83
|
+
if (!e || !I?.setValue) return;
|
|
72
84
|
const t = (n) => {
|
|
73
|
-
const r =
|
|
74
|
-
|
|
85
|
+
const r = P.type !== "checkbox" ? n.target.value : n.target.checked, s = j ? Re.current : r;
|
|
86
|
+
I.setValue?.(s);
|
|
75
87
|
};
|
|
76
88
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
77
|
-
}, [
|
|
89
|
+
}, [I?.setValue, P.type, a, j]), k(() => {
|
|
78
90
|
if (!x) return;
|
|
79
91
|
const e = (t) => {
|
|
80
|
-
const n = t.target, r = !!
|
|
81
|
-
H.current = r ||
|
|
92
|
+
const n = t.target, r = !!a.current?.contains(n), s = !!_.current?.contains(n);
|
|
93
|
+
H.current = r || s;
|
|
82
94
|
};
|
|
83
95
|
return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
|
|
84
|
-
}, [
|
|
85
|
-
const e =
|
|
96
|
+
}, [a, x]), k(() => {
|
|
97
|
+
const e = a.current;
|
|
86
98
|
if (!e) return;
|
|
87
99
|
const t = (n) => {
|
|
88
|
-
Y ||
|
|
100
|
+
Y || nt(n.target.value);
|
|
89
101
|
};
|
|
90
102
|
return e.addEventListener("change", t), e.addEventListener("input", t), () => {
|
|
91
103
|
e.removeEventListener("change", t), e.removeEventListener("input", t);
|
|
92
104
|
};
|
|
93
|
-
}, [Y,
|
|
94
|
-
const e =
|
|
95
|
-
|
|
105
|
+
}, [Y, a]), k(() => {
|
|
106
|
+
const e = b(a.current?.value ?? m);
|
|
107
|
+
Te((t) => {
|
|
96
108
|
const n = G(t, e);
|
|
97
|
-
return
|
|
109
|
+
return Fe(n.map((r) => r.suggestion)), n;
|
|
98
110
|
});
|
|
99
|
-
}, [
|
|
100
|
-
const
|
|
101
|
-
const n =
|
|
111
|
+
}, [b, G, m]);
|
|
112
|
+
const $e = d.useCallback((e, t) => {
|
|
113
|
+
const n = b(e), r = [...t].sort((l, o) => l.start - o.start), s = [];
|
|
102
114
|
let i = 0;
|
|
103
115
|
return r.forEach((l) => {
|
|
104
116
|
if (l.start < i) return;
|
|
105
117
|
const o = Math.min(l.end, n.length);
|
|
106
|
-
i < l.start &&
|
|
118
|
+
i < l.start && s.push(n.slice(i, l.start));
|
|
107
119
|
const c = l.suggestion?.value ?? l.text ?? "", g = c == null ? "" : String(c), u = Math.max(o - l.start, g.length);
|
|
108
|
-
u > 0 ? (
|
|
109
|
-
}), i < n.length &&
|
|
110
|
-
}, [
|
|
120
|
+
u > 0 ? (s.push(l.suggestion), i = l.start + u) : i = l.start;
|
|
121
|
+
}), i < n.length && s.push(n.slice(i)), s.length ? s : [n];
|
|
122
|
+
}, [b]);
|
|
111
123
|
k(() => {
|
|
112
|
-
if (!
|
|
113
|
-
const e =
|
|
114
|
-
Object.is(
|
|
115
|
-
}, [X,
|
|
116
|
-
const
|
|
124
|
+
if (!I?.setValue) return;
|
|
125
|
+
const e = P.type !== "checkbox" ? b(a.current?.value ?? m) : m, t = j ? X : e;
|
|
126
|
+
Object.is(Ae.current, t) || (Ae.current = t, I.setValue(t));
|
|
127
|
+
}, [X, I?.setValue, P.type, a, b, j, m]);
|
|
128
|
+
const Be = d.useCallback(() => {
|
|
117
129
|
setTimeout(() => {
|
|
118
|
-
const e =
|
|
130
|
+
const e = a.current;
|
|
119
131
|
if (!e) return;
|
|
120
132
|
e.focus({
|
|
121
133
|
preventScroll: !0
|
|
@@ -123,24 +135,24 @@ const pt = f.forwardRef((te, Ue) => {
|
|
|
123
135
|
const t = e.value.length;
|
|
124
136
|
T(e, t, t), e.scrollLeft = e.scrollWidth;
|
|
125
137
|
}, 0);
|
|
126
|
-
}, [
|
|
138
|
+
}, [a]), oe = d.useMemo(() => $e(m, J), [J, $e, m]), f = d.useMemo(() => {
|
|
127
139
|
if (ne)
|
|
128
|
-
return (e, t =
|
|
129
|
-
}, [
|
|
130
|
-
syntaxSegments:
|
|
140
|
+
return (e, t = oe) => ne(e, t);
|
|
141
|
+
}, [oe, ne]), {
|
|
142
|
+
syntaxSegments: ie,
|
|
131
143
|
visualizedSyntaxSegments: M,
|
|
132
|
-
expandSelectionRangeToBlockBoundaries:
|
|
133
|
-
mapVisualIndexToRawIndex:
|
|
134
|
-
mapRawIndexToVisualIndex:
|
|
135
|
-
totalVisualLength:
|
|
136
|
-
} =
|
|
137
|
-
const e =
|
|
138
|
-
if (!
|
|
139
|
-
const t = [...
|
|
144
|
+
expandSelectionRangeToBlockBoundaries: B,
|
|
145
|
+
mapVisualIndexToRawIndex: K,
|
|
146
|
+
mapRawIndexToVisualIndex: D,
|
|
147
|
+
totalVisualLength: le
|
|
148
|
+
} = St(m, f, a, oe), w = d.useMemo(() => {
|
|
149
|
+
const e = b(a.current?.value ?? m);
|
|
150
|
+
if (!C || !ie?.length) return null;
|
|
151
|
+
const t = [...ie].reverse().find((h) => h?.type === "text" && h?.end === e.length);
|
|
140
152
|
if (!t) return null;
|
|
141
153
|
const n = e.slice(t.start, t.end), r = n.trim();
|
|
142
154
|
if (!r.length) return null;
|
|
143
|
-
const
|
|
155
|
+
const s = r.split(/\s+/), i = s[s.length - 1]?.trim();
|
|
144
156
|
if (!i) return null;
|
|
145
157
|
const l = n.search(/\S/), o = l === -1 ? 0 : l, c = r.lastIndexOf(i), g = t.start + o + c, u = g + i.length;
|
|
146
158
|
return {
|
|
@@ -148,27 +160,27 @@ const pt = f.forwardRef((te, Ue) => {
|
|
|
148
160
|
start: g,
|
|
149
161
|
end: u
|
|
150
162
|
};
|
|
151
|
-
}, [
|
|
163
|
+
}, [C, a, b, ie, m]);
|
|
152
164
|
k(() => {
|
|
153
|
-
|
|
154
|
-
}, [
|
|
155
|
-
const
|
|
156
|
-
if (!
|
|
165
|
+
C && re && (w?.token && F(!0), re(w?.token ?? null));
|
|
166
|
+
}, [C, re, w?.token]);
|
|
167
|
+
const q = d.useMemo(() => {
|
|
168
|
+
if (!C || !x) return x;
|
|
157
169
|
const e = w?.token?.trim();
|
|
158
170
|
return e?.length ? x.filter((t) => {
|
|
159
171
|
const n = t?.value ?? "";
|
|
160
172
|
return (n == null ? "" : String(n)).toLowerCase().startsWith(e.toLowerCase());
|
|
161
173
|
}) : x;
|
|
162
|
-
}, [
|
|
163
|
-
if (!
|
|
174
|
+
}, [C, w?.token, x]), Q = d.useMemo(() => {
|
|
175
|
+
if (!ye || !q) return q;
|
|
164
176
|
const e = new Set(J.map((t) => t.suggestion));
|
|
165
|
-
return
|
|
166
|
-
}, [J,
|
|
177
|
+
return q.filter((t) => !e.has(t));
|
|
178
|
+
}, [J, ye, q]), {
|
|
167
179
|
ensureVisualIndexVisible: Z,
|
|
168
180
|
syncSyntaxScroll: S
|
|
169
|
-
} =
|
|
170
|
-
if (!
|
|
171
|
-
const e =
|
|
181
|
+
} = vt(a, _), Ke = kt(f, B), p = d.useCallback(() => {
|
|
182
|
+
if (!f) return;
|
|
183
|
+
const e = a.current;
|
|
172
184
|
if (!e) return;
|
|
173
185
|
const {
|
|
174
186
|
rawStart: t,
|
|
@@ -177,25 +189,25 @@ const pt = f.forwardRef((te, Ue) => {
|
|
|
177
189
|
if (r && t === n) {
|
|
178
190
|
const u = t - r.start, h = r.end - t, v = u <= h ? r.start : r.end;
|
|
179
191
|
T(e, v, v);
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
S(), Z(
|
|
192
|
+
const R = v === r.start ? r.visualStart : r.visualEnd;
|
|
193
|
+
O(null), $(R), requestAnimationFrame(() => {
|
|
194
|
+
S(), Z(R);
|
|
183
195
|
});
|
|
184
196
|
return;
|
|
185
197
|
}
|
|
186
198
|
if (t === n) {
|
|
187
|
-
const u = Math.round(
|
|
188
|
-
|
|
199
|
+
const u = Math.round(D(t));
|
|
200
|
+
O(null), $(Number.isFinite(u) ? u : null), requestAnimationFrame(() => {
|
|
189
201
|
S(), Z(u);
|
|
190
202
|
});
|
|
191
203
|
return;
|
|
192
204
|
}
|
|
193
|
-
let
|
|
205
|
+
let s = D(t), i = D(n);
|
|
194
206
|
M.forEach((u) => {
|
|
195
|
-
u?.type !== "block" || !(t < u?.end && n > u?.start) || (
|
|
207
|
+
u?.type !== "block" || !(t < u?.end && n > u?.start) || (s = Math.min(s, u?.visualStart), i = Math.max(i, u?.visualEnd));
|
|
196
208
|
});
|
|
197
|
-
const l = Math.min(
|
|
198
|
-
|
|
209
|
+
const l = Math.min(s, i), o = Math.max(s, i);
|
|
210
|
+
$(null), O({
|
|
199
211
|
start: l,
|
|
200
212
|
end: o
|
|
201
213
|
});
|
|
@@ -203,49 +215,49 @@ const pt = f.forwardRef((te, Ue) => {
|
|
|
203
215
|
requestAnimationFrame(() => {
|
|
204
216
|
S(), Z(g);
|
|
205
217
|
});
|
|
206
|
-
}, [Z,
|
|
218
|
+
}, [Z, a, D, S, f, M]), qe = wt(f, a, Le, M, D), ze = d.useCallback((e) => {
|
|
207
219
|
if (!e) return null;
|
|
208
|
-
const t = e.dataset.rawIndex, n = e.dataset.visualIndex || e.dataset.visualStart || e.dataset.visualEnd, r = t ? Number(t) : void 0,
|
|
209
|
-
return !Number.isNaN(r) && r !== void 0 ? r :
|
|
210
|
-
}, [
|
|
220
|
+
const t = e.dataset.rawIndex, n = e.dataset.visualIndex || e.dataset.visualStart || e.dataset.visualEnd, r = t ? Number(t) : void 0, s = n ? Number(n) : void 0;
|
|
221
|
+
return !Number.isNaN(r) && r !== void 0 ? r : s !== void 0 ? K(s) : null;
|
|
222
|
+
}, [K]), ee = d.useCallback((e) => {
|
|
211
223
|
const t = document.elementFromPoint(e.clientX, e.clientY);
|
|
212
|
-
return
|
|
213
|
-
}, [
|
|
214
|
-
if (!
|
|
224
|
+
return ze(t ?? e.target);
|
|
225
|
+
}, [ze]), Ue = d.useCallback((e) => {
|
|
226
|
+
if (!a.current) return;
|
|
215
227
|
const t = ee(e);
|
|
216
228
|
if (t === null || Number.isNaN(t)) return;
|
|
217
229
|
e.preventDefault(), H.current = !0;
|
|
218
|
-
const n = Math.min(Math.max(t, 0),
|
|
230
|
+
const n = Math.min(Math.max(t, 0), a.current.value.length), {
|
|
219
231
|
selectionStart: r
|
|
220
|
-
} = U(
|
|
221
|
-
|
|
232
|
+
} = U(a.current), s = e.shiftKey && Number.isFinite(r) ? r : n;
|
|
233
|
+
V.current = s, a.current.focus({
|
|
222
234
|
preventScroll: !0
|
|
223
|
-
}), T(
|
|
224
|
-
}, [
|
|
225
|
-
if (!
|
|
235
|
+
}), T(a.current, s, n), _.current?.setPointerCapture(e.pointerId), p();
|
|
236
|
+
}, [a, ee, p]), We = d.useCallback((e) => {
|
|
237
|
+
if (!a.current || V.current === null) return;
|
|
226
238
|
if (!(e.buttons & 1)) {
|
|
227
|
-
|
|
239
|
+
V.current = null;
|
|
228
240
|
return;
|
|
229
241
|
}
|
|
230
242
|
const t = ee(e);
|
|
231
243
|
if (t === null || Number.isNaN(t)) return;
|
|
232
244
|
e.preventDefault();
|
|
233
|
-
const n =
|
|
234
|
-
|
|
245
|
+
const n = V.current, r = Math.min(Math.max(t, 0), a.current.value.length);
|
|
246
|
+
a.current.focus({
|
|
235
247
|
preventScroll: !0
|
|
236
|
-
}), T(
|
|
237
|
-
}, [
|
|
238
|
-
|
|
239
|
-
}, []),
|
|
240
|
-
if (!
|
|
248
|
+
}), T(a.current, n, r), p();
|
|
249
|
+
}, [a, ee, p]), je = d.useCallback(() => {
|
|
250
|
+
V.current = null;
|
|
251
|
+
}, []), _e = d.useCallback((e) => {
|
|
252
|
+
if (!f) return !1;
|
|
241
253
|
const t = e.target, {
|
|
242
254
|
rawStart: n,
|
|
243
255
|
rawEnd: r
|
|
244
|
-
} = U(t),
|
|
256
|
+
} = U(t), s = (o, c) => {
|
|
245
257
|
if (o === c) return !1;
|
|
246
258
|
e.preventDefault();
|
|
247
259
|
const g = `${t.value.slice(0, o)}${t.value.slice(c)}`;
|
|
248
|
-
return
|
|
260
|
+
return Xe(t, "value", g, "input"), requestAnimationFrame(() => {
|
|
249
261
|
T(t, o, o), p();
|
|
250
262
|
}), !0;
|
|
251
263
|
};
|
|
@@ -254,37 +266,37 @@ const pt = f.forwardRef((te, Ue) => {
|
|
|
254
266
|
start: o,
|
|
255
267
|
end: c,
|
|
256
268
|
hasBlockOverlap: g
|
|
257
|
-
} =
|
|
258
|
-
return g ?
|
|
269
|
+
} = B(n, r);
|
|
270
|
+
return g ? s(o, c) : !1;
|
|
259
271
|
}
|
|
260
272
|
const i = M.find((o) => o?.type !== "block" ? !1 : n === o?.end || n > o?.start && n < o?.end);
|
|
261
273
|
if (e.key === "Backspace" && i)
|
|
262
|
-
return
|
|
274
|
+
return s(i.start, i.end);
|
|
263
275
|
const l = M.find((o) => o?.type !== "block" ? !1 : n === o?.start || n > o?.start && n < o?.end);
|
|
264
|
-
return e.key === "Delete" && l ?
|
|
265
|
-
}, [
|
|
266
|
-
if (
|
|
276
|
+
return e.key === "Delete" && l ? s(l.start, l.end) : !1;
|
|
277
|
+
}, [B, f, p, M]), ue = d.useCallback((e) => {
|
|
278
|
+
if (f && Ke(e.target), f && (e.key === "ArrowLeft" || e.key === "ArrowRight")) {
|
|
267
279
|
const t = e.target, {
|
|
268
280
|
selectionStart: n,
|
|
269
281
|
selectionEnd: r,
|
|
270
|
-
rawStart:
|
|
282
|
+
rawStart: s,
|
|
271
283
|
rawEnd: i,
|
|
272
284
|
direction: l
|
|
273
285
|
} = U(t), o = e.key === "ArrowLeft" ? -1 : 1;
|
|
274
286
|
if (e.shiftKey) {
|
|
275
|
-
const c =
|
|
276
|
-
|
|
277
|
-
const u = Math.round(
|
|
287
|
+
const c = V.current ?? (l === "backward" ? r : n);
|
|
288
|
+
V.current = c;
|
|
289
|
+
const u = Math.round(D(c === n ? r : n)), h = Math.max(0, Math.min(u + o, le)), v = K(h);
|
|
278
290
|
if (!Number.isNaN(v)) {
|
|
279
291
|
e.preventDefault();
|
|
280
|
-
const
|
|
281
|
-
T(t,
|
|
292
|
+
const R = Math.min(Math.max(Math.round(v), 0), t.value.length), at = R < c ? "backward" : "forward", ot = Math.min(c, R), it = Math.max(c, R);
|
|
293
|
+
T(t, ot, it, at), requestAnimationFrame(() => {
|
|
282
294
|
S(), p();
|
|
283
295
|
});
|
|
284
296
|
}
|
|
285
297
|
} else {
|
|
286
|
-
|
|
287
|
-
const c = e.key === "ArrowLeft" ?
|
|
298
|
+
V.current = null;
|
|
299
|
+
const c = e.key === "ArrowLeft" ? s : i, g = Math.round(D(c)), u = Math.max(0, Math.min(g + o, le)), h = K(u);
|
|
288
300
|
if (!Number.isNaN(h)) {
|
|
289
301
|
e.preventDefault();
|
|
290
302
|
const v = Math.min(Math.max(Math.round(h), 0), t.value.length);
|
|
@@ -295,78 +307,80 @@ const pt = f.forwardRef((te, Ue) => {
|
|
|
295
307
|
}
|
|
296
308
|
if (e.defaultPrevented) return;
|
|
297
309
|
}
|
|
298
|
-
if (!(
|
|
310
|
+
if (!(f && (e.key === "Backspace" || e.key === "Delete") && _e(e)) && x) {
|
|
299
311
|
if (e.key === "ArrowDown") {
|
|
300
312
|
e.preventDefault();
|
|
301
|
-
const t =
|
|
302
|
-
F(!0), t ?
|
|
313
|
+
const t = E;
|
|
314
|
+
F(!0), t ? N.current?.highlightNextItem() : setTimeout(() => N.current?.focusFirstItem(), 0);
|
|
303
315
|
} else if (e.key === "ArrowUp") {
|
|
304
316
|
e.preventDefault();
|
|
305
|
-
const t =
|
|
306
|
-
F(!0), t ?
|
|
307
|
-
} else e.key === "Enter" &&
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
}, []), ce =
|
|
311
|
-
|
|
317
|
+
const t = E;
|
|
318
|
+
F(!0), t ? N.current?.highlightPreviousItem() : setTimeout(() => N.current?.focusLastItem(), 0);
|
|
319
|
+
} else e.key === "Enter" && E && N.current?.selectActiveItem() && F(!1);
|
|
320
|
+
Ce?.(e);
|
|
321
|
+
}
|
|
322
|
+
}, [_e, D, K, Ke, E, x, S, le, f, p, Ce]), ce = d.useCallback((e) => {
|
|
323
|
+
(e.key === " " || e.code === "Space") && (e.stopPropagation(), e.nativeEvent?.stopImmediatePropagation?.()), Ve?.(e);
|
|
324
|
+
}, [Ve]), de = d.useCallback((e) => {
|
|
325
|
+
Ne(!0), requestAnimationFrame(() => {
|
|
312
326
|
p(), S();
|
|
313
|
-
}), x && !
|
|
314
|
-
}, [
|
|
315
|
-
|
|
316
|
-
}, []);
|
|
327
|
+
}), x && !E && F(!0), be?.(e);
|
|
328
|
+
}, [E, x, S, p, be]), fe = d.useCallback((e) => {
|
|
329
|
+
Ne(!1), $(null), O(null), Me?.(e);
|
|
330
|
+
}, [Me]);
|
|
317
331
|
k(() => {
|
|
318
|
-
const e =
|
|
319
|
-
if (!e || !
|
|
332
|
+
const e = a.current;
|
|
333
|
+
if (!e || !f) return;
|
|
320
334
|
const t = () => requestAnimationFrame(p);
|
|
321
335
|
t();
|
|
322
336
|
const n = ["select", "keyup", "mouseup", "input", "keydown"];
|
|
323
337
|
return n.forEach((r) => e.addEventListener(r, t)), () => {
|
|
324
338
|
n.forEach((r) => e.removeEventListener(r, t));
|
|
325
339
|
};
|
|
326
|
-
}, [
|
|
327
|
-
if (!
|
|
340
|
+
}, [a, f, p]), k(() => {
|
|
341
|
+
if (!f) return;
|
|
328
342
|
const e = () => {
|
|
329
|
-
document.activeElement ===
|
|
343
|
+
document.activeElement === a.current && p();
|
|
330
344
|
};
|
|
331
345
|
return document.addEventListener("selectionchange", e), () => document.removeEventListener("selectionchange", e);
|
|
332
|
-
}, [
|
|
333
|
-
const e =
|
|
346
|
+
}, [a, f, p]), k(() => {
|
|
347
|
+
const e = a.current;
|
|
334
348
|
if (!e) return;
|
|
335
349
|
const t = () => S();
|
|
336
350
|
return t(), e.addEventListener("scroll", t), () => e.removeEventListener("scroll", t);
|
|
337
|
-
}, [
|
|
351
|
+
}, [a, S]), k(() => {
|
|
338
352
|
S();
|
|
339
|
-
}, [S, m,
|
|
340
|
-
|
|
341
|
-
}, [
|
|
342
|
-
const
|
|
343
|
-
if (!
|
|
344
|
-
const t = typeof m == "object" ? JSON.stringify(e.value) : e.value, n = t == null ? "" : String(t), r = e.insertMode ?? "replace",
|
|
345
|
-
let i =
|
|
346
|
-
if (
|
|
347
|
-
i = `${
|
|
353
|
+
}, [S, m, se, Le]), k(() => {
|
|
354
|
+
f || (O(null), $(null));
|
|
355
|
+
}, [f]);
|
|
356
|
+
const He = d.useCallback((e) => {
|
|
357
|
+
if (!a.current) return;
|
|
358
|
+
const t = typeof m == "object" ? JSON.stringify(e.value) : e.value, n = t == null ? "" : String(t), r = e.insertMode ?? "replace", s = a.current.value ?? "";
|
|
359
|
+
let i = s, l = null, o = 0;
|
|
360
|
+
if (C && w)
|
|
361
|
+
i = `${s.slice(0, w.start)}${n}${s.slice(w.end)}`, l = w.start + n.length, o = w.start;
|
|
348
362
|
else
|
|
349
363
|
switch (r) {
|
|
350
364
|
case "append": {
|
|
351
|
-
i = `${
|
|
365
|
+
i = `${s}${n}`, l = i.length, o = s.length;
|
|
352
366
|
break;
|
|
353
367
|
}
|
|
354
368
|
case "prepend": {
|
|
355
|
-
i = `${n}${
|
|
369
|
+
i = `${n}${s}`, l = n.length, o = 0;
|
|
356
370
|
break;
|
|
357
371
|
}
|
|
358
372
|
case "insert": {
|
|
359
373
|
const {
|
|
360
374
|
rawStart: c,
|
|
361
375
|
rawEnd: g
|
|
362
|
-
} = U(
|
|
376
|
+
} = U(a.current), {
|
|
363
377
|
start: u,
|
|
364
378
|
end: h
|
|
365
|
-
} =
|
|
379
|
+
} = f ? B(c, g) : {
|
|
366
380
|
start: c,
|
|
367
381
|
end: g
|
|
368
382
|
};
|
|
369
|
-
i = `${
|
|
383
|
+
i = `${s.slice(0, u)}${n}${s.slice(h)}`, l = u + n.length, o = u;
|
|
370
384
|
break;
|
|
371
385
|
}
|
|
372
386
|
case "replace":
|
|
@@ -375,62 +389,62 @@ const pt = f.forwardRef((te, Ue) => {
|
|
|
375
389
|
break;
|
|
376
390
|
}
|
|
377
391
|
}
|
|
378
|
-
|
|
379
|
-
const g =
|
|
380
|
-
id:
|
|
392
|
+
Xe(a.current, "value", i, "change"), Te((c) => {
|
|
393
|
+
const g = b(i), u = G(c, g), h = n.length ? {
|
|
394
|
+
id: tt.current++,
|
|
381
395
|
suggestion: e,
|
|
382
396
|
text: n,
|
|
383
397
|
start: o,
|
|
384
398
|
end: o + n.length
|
|
385
399
|
} : null, v = h ? [...u, h] : u;
|
|
386
|
-
return
|
|
400
|
+
return Fe(v.map((R) => R.suggestion)), v;
|
|
387
401
|
}), l !== null && requestAnimationFrame(() => {
|
|
388
|
-
const c =
|
|
402
|
+
const c = a.current;
|
|
389
403
|
c && (c.focus({
|
|
390
404
|
preventScroll: !0
|
|
391
405
|
}), T(c, l, l));
|
|
392
406
|
});
|
|
393
|
-
}, [
|
|
407
|
+
}, [B, C, a, b, G, w, f, m]), rt = Je(() => /* @__PURE__ */ y(xt, { transformSyntax: f, syntaxRef: _, visualizedSyntaxSegments: M, resolvedVisualSelectionRange: qe, visualCaretIndex: se, isFocused: Pe, onPointerDown: Ue, onPointerMove: We, onPointerUp: je }), [Ue, je, We, Pe, qe, f, se, M]), st = Je(() => /* @__PURE__ */ z(ft, { open: E, modal: !1, onOpenChange: (e) => {
|
|
394
408
|
if (!e && H.current) {
|
|
395
409
|
H.current = !1;
|
|
396
410
|
return;
|
|
397
411
|
}
|
|
398
|
-
F(e), e && setTimeout(() =>
|
|
412
|
+
F(e), e && setTimeout(() => a.current?.focus(), 0);
|
|
399
413
|
}, children: [
|
|
400
|
-
/* @__PURE__ */ y(
|
|
401
|
-
/* @__PURE__ */ y(
|
|
402
|
-
|
|
403
|
-
/* @__PURE__ */ z(
|
|
414
|
+
/* @__PURE__ */ y(gt, { asChild: !0, children: /* @__PURE__ */ y("input", { ref: a, ...ge(`input__control ${f ? "input__control--syntax" : ""}`, ae), onFocus: de, onBlur: fe, onKeyDownCapture: ce, onKeyDown: ue, spellCheck: !1, disabled: he || Y }) }),
|
|
415
|
+
/* @__PURE__ */ y(mt, { children: /* @__PURE__ */ z(pt, { color: "secondary", inputRef: a, children: [
|
|
416
|
+
ve,
|
|
417
|
+
/* @__PURE__ */ z(yt, { paddingSize: "xxs", mt: -0.35, mx: -0.35, style: {
|
|
404
418
|
borderWidth: "2px"
|
|
405
419
|
}, children: [
|
|
406
|
-
Q?.length === 0 &&
|
|
420
|
+
Q?.length === 0 && Ie,
|
|
407
421
|
!!Q?.length && /* @__PURE__ */ y(
|
|
408
|
-
|
|
422
|
+
ht,
|
|
409
423
|
{
|
|
410
|
-
ref:
|
|
411
|
-
inputRef:
|
|
424
|
+
ref: N,
|
|
425
|
+
inputRef: a,
|
|
412
426
|
suggestions: Q,
|
|
413
427
|
onSuggestionSelect: (e) => {
|
|
414
|
-
W ? W?.(e) :
|
|
428
|
+
W ? W?.(e) : He(e), F(!1), W && Be();
|
|
415
429
|
}
|
|
416
430
|
}
|
|
417
431
|
)
|
|
418
432
|
] }),
|
|
419
|
-
|
|
433
|
+
ke
|
|
420
434
|
] }) })
|
|
421
|
-
] }), [
|
|
422
|
-
return /* @__PURE__ */ z(
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
/* @__PURE__ */ z("div", { ...
|
|
426
|
-
|
|
427
|
-
x ?
|
|
428
|
-
|
|
429
|
-
|
|
435
|
+
] }), [He, Q, Y, Be, fe, de, ue, ce, a, ae, W, E, Ie, ke, ve, f]);
|
|
436
|
+
return /* @__PURE__ */ z(lt, { children: [
|
|
437
|
+
me && /* @__PURE__ */ y(ut, { children: me }),
|
|
438
|
+
pe && /* @__PURE__ */ y(ct, { children: pe }),
|
|
439
|
+
/* @__PURE__ */ z("div", { ...ge(`input ${I?.valid ? "" : "input--not-valid"}`, Ge), children: [
|
|
440
|
+
xe && /* @__PURE__ */ y("div", { className: `input__left input__left--${Qe}`, children: xe }),
|
|
441
|
+
x ? st : /* @__PURE__ */ y("input", { tabIndex: 2, ref: a, disabled: he, onFocus: de, onBlur: fe, onKeyDownCapture: ce, onKeyDown: ue, ...ge(`input__control ${f ? "input__control--syntax" : ""}`, ae) }),
|
|
442
|
+
rt,
|
|
443
|
+
Se && /* @__PURE__ */ y("div", { className: `input__right input__right--${Ze}`, children: Se })
|
|
430
444
|
] }),
|
|
431
|
-
!
|
|
445
|
+
!I?.valid && I?.notValidMessage && /* @__PURE__ */ y(dt, { children: I.notValidMessage })
|
|
432
446
|
] });
|
|
433
|
-
}),
|
|
447
|
+
}), Bt = It;
|
|
434
448
|
export {
|
|
435
|
-
|
|
449
|
+
Bt as Input
|
|
436
450
|
};
|