@code0-tech/pictor 0.0.0-mvp.3 → 0.0.0-mvp.30
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/_virtual/_commonjsHelpers.js +6 -0
- package/dist/_virtual/compiler-runtime.js +5 -0
- package/dist/_virtual/compiler-runtime2.js +4 -0
- package/dist/_virtual/index.js +4 -0
- package/dist/_virtual/index2.js +4 -0
- package/dist/_virtual/react-compiler-runtime.development.js +4 -0
- package/dist/_virtual/react-compiler-runtime.production.js +4 -0
- package/dist/_virtual/react-contenteditable.js +7 -0
- package/dist/_virtual/react-contenteditable2.js +4 -0
- package/dist/_virtual/react-dom-server-legacy.browser.development.js +4 -0
- package/dist/_virtual/react-dom-server-legacy.browser.production.js +4 -0
- package/dist/_virtual/react-dom-server.browser.development.js +4 -0
- package/dist/_virtual/react-dom-server.browser.production.js +4 -0
- package/dist/_virtual/react-is.development.js +4 -0
- package/dist/_virtual/react-is.production.min.js +4 -0
- package/dist/_virtual/server.browser.js +5 -0
- package/dist/_virtual/server.browser2.js +4 -0
- package/dist/assets/components/alert/Alert.style.css +1 -0
- package/dist/assets/components/aurora/Aurora.style.css +1 -0
- package/dist/assets/components/avatar/Avatar.style.css +1 -0
- package/dist/assets/components/badge/Badge.style.css +1 -0
- package/dist/assets/{Breadcrumb.css → components/breadcrumb/Breadcrumb.style.css} +1 -1
- package/dist/assets/components/button/Button.style.css +1 -0
- package/dist/assets/components/button-group/ButtonGroup.style.css +1 -0
- package/dist/assets/components/card/Card.style.css +1 -0
- package/dist/assets/components/command/Command.style.css +1 -0
- package/dist/assets/components/context-menu/ContextMenu.style.css +1 -0
- package/dist/assets/components/d-flow/DFlow.style.css +1 -0
- package/dist/assets/components/d-flow-folder/DFlowFolder.style.css +1 -0
- package/dist/assets/components/d-flow-function/DFlowFunctionDefaultCard.style.css +1 -0
- package/dist/assets/components/d-flow-input/DFlowInputDataType.style.css +1 -0
- 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-flow-validation/DFlowValidation.style.css +1 -0
- package/dist/assets/components/d-layout/DLayout.style.css +1 -0
- package/dist/assets/components/d-resizable/DResizable.style.css +1 -0
- package/dist/assets/components/dialog/Dialog.style.css +1 -0
- package/dist/assets/components/file-tabs/FileTabs.style.css +1 -0
- package/dist/assets/components/form/Input.style.css +1 -0
- package/dist/assets/components/menu/Menu.style.css +1 -0
- package/dist/assets/{ScrollArea.css → components/scroll-area/ScrollArea.style.css} +1 -1
- package/dist/assets/components/segmented-control/SegmentedControl.style.css +1 -0
- package/dist/assets/components/spacing/Spacing.style.css +1 -0
- package/dist/assets/components/tab/Tab.style.css +1 -0
- package/dist/assets/components/text/Text.style.css +1 -0
- package/dist/assets/components/toast/Toast.style.css +1 -0
- package/dist/assets/components/tooltip/Tooltip.style.css +1 -0
- package/dist/assets/{DFlow.css → node_modules/@xyflow/react/dist/style.css} +1 -1
- package/dist/components/alert/Alert.d.ts +7 -0
- package/dist/components/alert/Alert.js +38 -0
- package/dist/components/aurora/Aurora.d.ts +5 -0
- package/dist/components/aurora/Aurora.js +23 -0
- package/dist/components/avatar/Avatar.js +9 -9
- package/dist/components/badge/Badge.d.ts +2 -1
- package/dist/components/badge/Badge.js +58 -17
- package/dist/components/breadcrumb/Breadcrumb.js +16 -28
- package/dist/components/button/Button.d.ts +3 -2
- package/dist/components/button/Button.js +23 -20
- package/dist/components/button-group/ButtonGroup.js +12 -11
- package/dist/components/card/Card.d.ts +2 -1
- package/dist/components/card/Card.js +25 -22
- package/dist/components/card/CardSection.d.ts +1 -0
- package/dist/components/card/CardSection.js +18 -12
- package/dist/components/col/Col.js +9 -8
- package/dist/components/command/Command.js +19 -18
- package/dist/components/container/Container.js +12 -11
- 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 +7 -3
- package/dist/components/d-flow/DFlow.edges.hook.d.ts +3 -2
- package/dist/components/d-flow/DFlow.edges.hook.js +100 -136
- package/dist/components/d-flow/DFlow.js +313 -258
- package/dist/components/d-flow/DFlow.nodes.hook.d.ts +6 -2
- package/dist/components/d-flow/DFlow.nodes.hook.js +102 -121
- package/dist/components/d-flow/DFlow.service.d.ts +17 -7
- package/dist/components/d-flow/DFlow.service.js +132 -7
- package/dist/components/d-flow/DFlow.util.d.ts +4 -0
- package/dist/components/d-flow/DFlow.util.js +63 -0
- 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 +14 -0
- package/dist/components/d-flow-data-type/DFlowDataType.service.js +96 -0
- package/dist/components/{d-flow/data-type → d-flow-data-type}/DFlowDataType.view.d.ts +13 -4
- package/dist/components/d-flow-data-type/DFlowDataType.view.js +76 -0
- package/dist/components/{d-flow/data-type → d-flow-data-type}/index.js +1 -1
- package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeContainsKeyRule.d.ts +2 -3
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.js +222 -0
- package/dist/components/{d-flow/data-type → d-flow-data-type}/rules/DFlowDataTypeContainsTypeRule.d.ts +2 -3
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.js +229 -0
- 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-data-type/rules/DFlowDataTypeRules.js +10 -0
- package/dist/components/d-flow-file/DFlowTabDefault.d.ts +7 -0
- package/dist/components/d-flow-file/DFlowTabDefault.js +104 -0
- package/dist/components/{d-flow/tab → d-flow-file}/DFlowTabTrigger.d.ts +2 -2
- package/dist/components/d-flow-file/DFlowTabTrigger.js +64 -0
- package/dist/components/d-flow-file/DFlowTabs.d.ts +8 -0
- package/dist/components/d-flow-file/DFlowTabs.js +132 -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/DFlowFolder.d.ts +33 -0
- package/dist/components/d-flow-folder/DFlowFolder.js +208 -0
- package/dist/components/d-flow-folder/DFlowFolderContextMenu.d.ts +18 -0
- package/dist/components/d-flow-folder/DFlowFolderContextMenu.js +45 -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/DFlowFolderDeleteDialog.d.ts +10 -0
- package/dist/components/d-flow-folder/DFlowFolderDeleteDialog.js +55 -0
- package/dist/components/d-flow-folder/DFlowFolderItemPathInput.d.ts +5 -0
- package/dist/components/d-flow-folder/DFlowFolderItemPathInput.js +50 -0
- package/dist/components/d-flow-folder/DFlowFolderRenameDialog.d.ts +10 -0
- package/dist/components/d-flow-folder/DFlowFolderRenameDialog.js +55 -0
- package/dist/components/d-flow-folder/index.d.ts +4 -0
- package/dist/components/d-flow-folder/index.js +12 -0
- package/dist/components/{d-flow/function → d-flow-function}/DFlowFunction.input.hook.d.ts +1 -1
- package/dist/components/d-flow-function/DFlowFunction.input.hook.js +8 -0
- 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/DFlowFunction.service.d.ts +11 -0
- package/dist/components/d-flow-function/DFlowFunction.service.js +12 -0
- package/dist/components/{d-flow/function → d-flow-function}/DFlowFunction.view.d.ts +24 -9
- package/dist/components/d-flow-function/DFlowFunction.view.js +139 -0
- package/dist/components/{d-flow/function → d-flow-function}/DFlowFunctionDefaultCard.d.ts +4 -4
- package/dist/components/d-flow-function/DFlowFunctionDefaultCard.js +117 -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 +43 -0
- package/dist/components/{d-flow/function → d-flow-function}/DFlowFunctionTriggerCard.d.ts +3 -3
- package/dist/components/d-flow-function/DFlowFunctionTriggerCard.js +78 -0
- package/dist/components/{d-flow/input → d-flow-input}/DFlowInputDataType.d.ts +1 -1
- package/dist/components/d-flow-input/DFlowInputDataType.js +437 -0
- package/dist/components/d-flow-input/DFlowInputDefault.d.ts +10 -0
- package/dist/components/d-flow-input/DFlowInputDefault.js +128 -0
- package/dist/components/d-flow-input/DFlowInputLiteralBadge.d.ts +7 -0
- package/dist/components/d-flow-input/DFlowInputLiteralBadge.js +24 -0
- package/dist/components/d-flow-input/DFlowInputNodeBadge.d.ts +11 -0
- package/dist/components/d-flow-input/DFlowInputNodeBadge.js +44 -0
- package/dist/components/d-flow-input/DFlowInputReferenceBadge.d.ts +11 -0
- package/dist/components/d-flow-input/DFlowInputReferenceBadge.js +33 -0
- package/dist/components/d-flow-panel/DFlowExport.d.ts +6 -0
- 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 +72 -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/DFlowDataTypeSuggestions.hook.d.ts +3 -0
- package/dist/components/d-flow-suggestion/DFlowDataTypeSuggestions.hook.js +34 -0
- package/dist/components/d-flow-suggestion/DFlowFunctionSuggestions.hook.d.ts +3 -0
- package/dist/components/d-flow-suggestion/DFlowFunctionSuggestions.hook.js +50 -0
- package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.d.ts +3 -0
- package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.js +133 -0
- package/dist/components/d-flow-suggestion/DFlowSuggestion.hook.d.ts +3 -0
- package/dist/components/d-flow-suggestion/DFlowSuggestion.hook.js +24 -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 +72 -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 +12 -11
- 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/DFlowValueSuggestions.hook.d.ts +3 -0
- package/dist/components/d-flow-suggestion/DFlowValueSuggestions.hook.js +44 -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/DFlowType.service.d.ts +11 -0
- package/dist/components/d-flow-type/DFlowType.service.js +12 -0
- package/dist/components/{d-flow/type → d-flow-type}/DFlowType.view.d.ts +10 -4
- package/dist/components/d-flow-type/DFlowType.view.js +85 -0
- 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 +58 -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.d.ts +1 -2
- package/dist/components/d-fullscreen/DFullScreen.js +24 -18
- package/dist/components/d-layout/DLayout.js +27 -26
- package/dist/components/d-license/DNamespaceLicense.service.d.ts +11 -0
- package/dist/components/d-license/DNamespaceLicense.service.js +12 -0
- package/dist/components/d-license/index.d.ts +2 -0
- package/dist/components/d-license/index.js +6 -0
- package/dist/components/d-member/DNamespaceMember.service.d.ts +13 -0
- package/dist/components/d-member/DNamespaceMember.service.js +17 -0
- package/dist/components/{d-namespace/member → d-member}/DNamespaceMember.view.d.ts +4 -1
- package/dist/components/{d-namespace/member → d-member}/DNamespaceMember.view.js +16 -11
- package/dist/components/d-member/DNamespaceMemberCard.d.ts +10 -0
- package/dist/components/d-member/DNamespaceMemberCard.js +16 -0
- package/dist/components/d-member/DNamespaceMemberContent.d.ts +10 -0
- package/dist/components/d-member/DNamespaceMemberContent.js +224 -0
- package/dist/components/d-member/DNamespaceMemberList.d.ts +12 -0
- package/dist/components/d-member/DNamespaceMemberList.js +23 -0
- package/dist/components/d-member/index.d.ts +4 -0
- package/dist/components/d-member/index.js +10 -0
- package/dist/components/d-namespace/DNamespace.service.d.ts +1 -1
- package/dist/components/d-namespace/DNamespace.service.js +7 -6
- package/dist/components/d-namespace/index.d.ts +0 -10
- package/dist/components/d-namespace/index.js +4 -33
- package/dist/components/d-organization/DOrganization.service.d.ts +3 -3
- package/dist/components/d-organization/DOrganization.service.js +8 -7
- package/dist/components/d-organization/DOrganization.view.d.ts +4 -1
- package/dist/components/d-organization/DOrganization.view.js +21 -18
- package/dist/components/d-organization/DOrganizationCard.d.ts +4 -3
- package/dist/components/d-organization/DOrganizationCard.js +13 -60
- package/dist/components/d-organization/DOrganizationList.d.ts +10 -0
- package/dist/components/d-organization/DOrganizationList.js +23 -0
- package/dist/components/d-organization/DOrganizationMenu.js +5 -5
- package/dist/components/d-organization/DOrganizatonContent.d.ts +10 -0
- package/dist/components/d-organization/DOrganizatonContent.js +101 -0
- package/dist/components/d-organization/index.d.ts +1 -0
- package/dist/components/d-organization/index.js +30 -10
- package/dist/components/d-project/DNamespaceProject.service.d.ts +12 -0
- package/dist/components/d-project/DNamespaceProject.service.js +12 -0
- package/dist/components/{d-namespace/project → d-project}/DNamespaceProject.view.d.ts +4 -1
- package/dist/components/{d-namespace/project → d-project}/DNamespaceProject.view.js +13 -10
- package/dist/components/d-project/DNamespaceProjectCard.d.ts +9 -0
- package/dist/components/d-project/DNamespaceProjectCard.js +17 -0
- package/dist/components/d-project/DNamespaceProjectContent.d.ts +10 -0
- package/dist/components/d-project/DNamespaceProjectContent.js +71 -0
- package/dist/components/d-project/DNamespaceProjectList.d.ts +11 -0
- package/dist/components/d-project/DNamespaceProjectList.js +25 -0
- package/dist/components/d-project/DNamespaceProjectMenu.d.ts +13 -0
- package/dist/components/d-project/DNamespaceProjectMenu.js +57 -0
- package/dist/components/d-project/index.d.ts +5 -0
- package/dist/components/d-project/index.js +26 -0
- package/dist/components/d-resizable/DResizable.d.ts +4 -4
- package/dist/components/d-resizable/DResizable.js +26 -23
- package/dist/components/d-role/DNamespaceRole.service.d.ts +13 -0
- package/dist/components/d-role/DNamespaceRole.service.js +12 -0
- package/dist/components/{d-namespace/role → d-role}/DNamespaceRole.view.d.ts +4 -1
- package/dist/components/{d-namespace/role → d-role}/DNamespaceRole.view.js +8 -4
- package/dist/components/d-role/DNamespaceRoleCard.d.ts +11 -0
- package/dist/components/d-role/DNamespaceRoleCard.js +17 -0
- package/dist/components/d-role/DNamespaceRoleContent.d.ts +10 -0
- package/dist/components/d-role/DNamespaceRoleContent.js +162 -0
- package/dist/components/d-role/DNamespaceRoleList.d.ts +12 -0
- package/dist/components/d-role/DNamespaceRoleList.js +24 -0
- package/dist/components/d-role/DNamespaceRolePermissions.d.ts +5 -0
- package/dist/components/d-role/DNamespaceRolePermissions.js +123 -0
- package/dist/components/d-role/index.d.ts +4 -0
- package/dist/components/d-role/index.js +10 -0
- package/dist/components/d-runtime/DRuntime.service.d.ts +5 -2
- package/dist/components/d-runtime/DRuntime.service.js +2 -4
- package/dist/components/d-runtime/DRuntime.view.d.ts +4 -1
- package/dist/components/d-runtime/DRuntime.view.js +6 -3
- package/dist/components/d-runtime/DRuntimeCard.d.ts +9 -0
- package/dist/components/d-runtime/DRuntimeCard.js +18 -0
- package/dist/components/d-runtime/DRuntimeContent.d.ts +9 -0
- package/dist/components/d-runtime/DRuntimeContent.js +45 -0
- package/dist/components/d-runtime/DRuntimeList.d.ts +12 -0
- package/dist/components/d-runtime/DRuntimeList.js +28 -0
- package/dist/components/d-runtime/index.d.ts +2 -0
- package/dist/components/d-runtime/index.js +6 -2
- package/dist/components/d-user/DUser.service.d.ts +3 -4
- package/dist/components/d-user/DUser.service.js +9 -9
- package/dist/components/d-user/DUser.session.hook.d.ts +3 -0
- package/dist/components/d-user/DUser.session.hook.js +16 -0
- package/dist/components/d-user/DUser.view.d.ts +4 -1
- package/dist/components/d-user/DUser.view.js +13 -10
- package/dist/components/d-user/DUserCard.d.ts +8 -0
- package/dist/components/d-user/DUserCard.js +15 -0
- package/dist/components/d-user/DUserContent.d.ts +8 -0
- package/dist/components/d-user/DUserContent.js +84 -0
- package/dist/components/d-user/DUserInput.d.ts +7 -0
- package/dist/components/d-user/DUserInput.js +100 -0
- package/dist/components/d-user/DUserList.d.ts +9 -0
- package/dist/components/d-user/DUserList.js +22 -0
- package/dist/components/d-user/DUserMenu.js +20 -19
- package/dist/components/d-user/index.d.ts +4 -0
- package/dist/components/d-user/index.js +17 -8
- package/dist/components/dialog/Dialog.d.ts +2 -1
- package/dist/components/dialog/Dialog.js +69 -60
- package/dist/components/file-tabs/FileTabs.js +41 -40
- package/dist/components/file-tabs/FileTabs.service.d.ts +5 -1
- package/dist/components/file-tabs/FileTabs.service.js +74 -26
- package/dist/components/file-tabs/FileTabs.view.d.ts +1 -0
- package/dist/components/flex/Flex.js +2 -2
- package/dist/components/form/CheckboxInput.js +62 -53
- package/dist/components/form/EmailInput.js +11 -10
- package/dist/components/form/Input.d.ts +18 -5
- package/dist/components/form/Input.js +333 -139
- package/dist/components/form/Input.syntax.hook.d.ts +10 -0
- package/dist/components/form/Input.syntax.hook.js +14 -0
- package/dist/components/form/Input.utils.d.ts +10 -0
- package/dist/components/form/Input.utils.js +38 -0
- package/dist/components/form/InputContentEditable.hook.d.ts +40 -0
- package/dist/components/form/InputContentEditable.hook.js +471 -0
- package/dist/components/form/InputDescription.js +1 -1
- package/dist/components/form/InputLabel.js +1 -1
- package/dist/components/form/InputMessage.js +1 -1
- package/dist/components/form/InputSuggestion.d.ts +16 -8
- package/dist/components/form/InputSuggestion.js +189 -73
- package/dist/components/form/NumberInput.js +9 -9
- package/dist/components/form/PasswordInput.js +11 -10
- package/dist/components/form/PinInput.js +2 -2
- package/dist/components/form/RadioGroup.js +2 -2
- package/dist/components/form/RadioInput.js +2 -2
- package/dist/components/form/SwitchInput.js +7 -7
- package/dist/components/form/TextInput.js +12 -11
- package/dist/components/form/index.js +26 -27
- package/dist/components/form/useForm.d.ts +3 -1
- package/dist/components/form/useForm.js +53 -33
- package/dist/components/menu/Menu.d.ts +7 -3
- package/dist/components/menu/Menu.js +24 -24
- package/dist/components/quote/Quote.js +32 -36
- package/dist/components/row/Row.js +10 -9
- package/dist/components/scroll-area/ScrollArea.js +18 -17
- package/dist/components/segmented-control/SegmentedControl.d.ts +1 -1
- package/dist/components/segmented-control/SegmentedControl.js +19 -16
- package/dist/components/spacing/Spacing.d.ts +6 -0
- package/dist/components/spacing/Spacing.js +23 -0
- package/dist/components/tab/Tab.d.ts +11 -0
- package/dist/components/tab/Tab.js +40 -0
- package/dist/components/text/Text.js +2 -2
- package/dist/components/toast/Toast.d.ts +13 -0
- package/dist/components/toast/Toast.js +62 -0
- package/dist/components/tooltip/Tooltip.js +36 -35
- package/dist/index.d.ts +17 -0
- package/dist/index.js +264 -216
- 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/fast-deep-equal/index.js +31 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.js +7 -0
- package/dist/node_modules/object-assign/index.js +49 -0
- package/dist/node_modules/prop-types/checkPropTypes.js +54 -0
- package/dist/node_modules/prop-types/factoryWithThrowingShims.js +52 -0
- package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +329 -0
- package/dist/node_modules/prop-types/index.js +17 -0
- package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +10 -0
- package/dist/node_modules/prop-types/lib/has.js +7 -0
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +87 -0
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +70 -0
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +10 -0
- package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +21 -0
- package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +14 -0
- package/dist/node_modules/react/compiler-runtime.js +10 -0
- package/dist/node_modules/react-contenteditable/lib/react-contenteditable.js +132 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +6235 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +4096 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server.browser.development.js +6753 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server.browser.production.js +4645 -0
- package/dist/node_modules/react-dom/server.browser.js +15 -0
- 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/arrayService.d.ts +2 -2
- package/dist/utils/contextStore.js +1 -1
- package/dist/utils/generics.d.ts +7 -6
- package/dist/utils/generics.js +136 -124
- package/dist/utils/index.js +22 -21
- package/dist/utils/inspection.d.ts +4 -2
- package/dist/utils/inspection.js +27 -2
- package/dist/utils/objectStore.js +15 -15
- package/dist/utils/reactiveArrayService.d.ts +3 -3
- package/dist/utils/reactiveArrayService.js +53 -43
- package/dist/utils/types.d.ts +2 -2
- package/package.json +38 -33
- package/dist/DFlowDataType.service-Dz8pQUeO.js +0 -793
- package/dist/assets/Avatar.css +0 -1
- package/dist/assets/Badge.css +0 -1
- package/dist/assets/Button.css +0 -1
- package/dist/assets/ButtonGroup.css +0 -1
- package/dist/assets/Card.css +0 -1
- package/dist/assets/Command.css +0 -1
- package/dist/assets/DFlowFolder.css +0 -1
- package/dist/assets/DFlowFunctionDefaultCard.css +0 -1
- package/dist/assets/DFlowInputDataType.css +0 -1
- package/dist/assets/DFlowMiniMap.css +0 -1
- package/dist/assets/DFlowSuggestionSearchInput.css +0 -1
- package/dist/assets/DFlowValidation.css +0 -1
- package/dist/assets/DLayout.css +0 -1
- package/dist/assets/DResizable.css +0 -1
- package/dist/assets/Dialog.css +0 -1
- package/dist/assets/FileTabs.css +0 -1
- package/dist/assets/Input.css +0 -1
- package/dist/assets/Menu.css +0 -1
- package/dist/assets/SegmentedControl.css +0 -1
- package/dist/assets/Text.css +0 -1
- package/dist/assets/Tooltip.css +0 -1
- package/dist/compiler-runtime-BNHg76kC.js +0 -36
- package/dist/components/d-flow/DFlow.view.d.ts +0 -109
- package/dist/components/d-flow/DFlow.view.js +0 -213
- package/dist/components/d-flow/control/DFlowControl.d.ts +0 -2
- package/dist/components/d-flow/control/DFlowControl.js +0 -77
- 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.service.js +0 -7
- 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 -6
- package/dist/components/d-flow/data-type/DFlowDataType.view.js +0 -65
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeContainsKeyRule.js +0 -6
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeContainsTypeRule.js +0 -6
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeReturnTypeRule.js +0 -7
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeRules.js +0 -8
- package/dist/components/d-flow/edge/DFlowEdge.js +0 -48
- package/dist/components/d-flow/folder/DFlowFolder.d.ts +0 -19
- package/dist/components/d-flow/folder/DFlowFolder.js +0 -118
- package/dist/components/d-flow/folder/index.d.ts +0 -1
- package/dist/components/d-flow/folder/index.js +0 -6
- package/dist/components/d-flow/function/DFlowFunction.input.hook.js +0 -9
- package/dist/components/d-flow/function/DFlowFunction.return.hook.js +0 -11
- package/dist/components/d-flow/function/DFlowFunction.service.d.ts +0 -6
- 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 -75
- 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 -97
- package/dist/components/d-flow/input/DFlowInputDataType.js +0 -422
- package/dist/components/d-flow/minimap/DFlowMiniMap.js +0 -21
- 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.d.ts +0 -33
- package/dist/components/d-flow/suggestion/DFlowSuggestion.hook.js +0 -151
- 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 -21
- 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.d.ts +0 -11
- package/dist/components/d-flow/tab/DFlowTabDefault.js +0 -97
- 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.d.ts +0 -6
- package/dist/components/d-flow/type/DFlowType.service.js +0 -9
- package/dist/components/d-flow/type/DFlowType.view.js +0 -69
- 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 -59
- package/dist/components/d-namespace/license/DNamespaceLicense.service.d.ts +0 -8
- package/dist/components/d-namespace/license/DNamespaceLicense.service.js +0 -11
- package/dist/components/d-namespace/member/DNamespaceMember.service.d.ts +0 -9
- package/dist/components/d-namespace/member/DNamespaceMember.service.js +0 -11
- package/dist/components/d-namespace/project/DNamespaceProject.service.d.ts +0 -9
- package/dist/components/d-namespace/project/DNamespaceProject.service.js +0 -11
- package/dist/components/d-namespace/project/DNamespaceProjectCard.d.ts +0 -9
- package/dist/components/d-namespace/project/DNamespaceProjectCard.js +0 -57
- package/dist/components/d-namespace/project/DNamespaceProjectMenu.d.ts +0 -9
- package/dist/components/d-namespace/project/DNamespaceProjectMenu.js +0 -18
- package/dist/components/d-namespace/role/DNamespaceRole.service.d.ts +0 -10
- package/dist/components/d-namespace/role/DNamespaceRole.service.js +0 -11
- /package/dist/assets/{Col.css → components/col/Col.style.css} +0 -0
- /package/dist/assets/{Container.css → components/container/Container.style.css} +0 -0
- /package/dist/assets/{DFullScreen.css → components/d-fullscreen/DFullScreen.style.css} +0 -0
- /package/dist/assets/{Flex.css → components/flex/Flex.style.css} +0 -0
- /package/dist/assets/{Quote.css → components/quote/Quote.style.css} +0 -0
- /package/dist/assets/{Row.css → components/row/Row.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}/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/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/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
- /package/dist/components/{d-namespace/license → d-license}/DNamespaceLicense.view.d.ts +0 -0
- /package/dist/components/{d-namespace/license → d-license}/DNamespaceLicense.view.js +0 -0
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import { default as React
|
|
2
|
-
import { Code0Component } from '../../utils
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Code0Component } from '../../utils';
|
|
3
3
|
import { ValidationProps } from './useForm';
|
|
4
4
|
import { InputSuggestion } from './InputSuggestion';
|
|
5
|
-
|
|
5
|
+
import { InputSyntaxSegment } from './Input.syntax.hook';
|
|
6
6
|
export type Code0Input = Omit<Omit<Omit<Code0Component<HTMLInputElement>, "left">, "right">, "title">;
|
|
7
7
|
export interface InputProps<T> extends Code0Input, ValidationProps<T> {
|
|
8
8
|
suggestions?: InputSuggestion[];
|
|
9
9
|
suggestionsHeader?: React.ReactNode;
|
|
10
10
|
suggestionsFooter?: React.ReactNode;
|
|
11
11
|
onSuggestionSelect?: (suggestion: InputSuggestion) => void;
|
|
12
|
-
|
|
12
|
+
transformSyntax?: (value: T, appliedSyntaxParts?: (InputSuggestion | any)[]) => InputSyntaxSegment[];
|
|
13
|
+
validationUsesSyntax?: boolean;
|
|
13
14
|
disableOnValue?: (value: T) => boolean;
|
|
15
|
+
filterSuggestionsByLastToken?: boolean;
|
|
16
|
+
onLastTokenChange?: (token: string | null) => void;
|
|
17
|
+
enforceUniqueSuggestions?: boolean;
|
|
18
|
+
suggestionsEmptyState?: React.ReactNode;
|
|
14
19
|
wrapperComponent?: Code0Component<HTMLDivElement>;
|
|
15
20
|
right?: React.ReactNode;
|
|
16
21
|
left?: React.ReactNode;
|
|
@@ -19,4 +24,12 @@ export interface InputProps<T> extends Code0Input, ValidationProps<T> {
|
|
|
19
24
|
title?: React.ReactNode;
|
|
20
25
|
description?: React.ReactNode;
|
|
21
26
|
}
|
|
22
|
-
export
|
|
27
|
+
export type InputElement = HTMLInputElement | HTMLDivElement;
|
|
28
|
+
export type InputActiveSuggestionSpan = {
|
|
29
|
+
id: number;
|
|
30
|
+
suggestion: InputSuggestion;
|
|
31
|
+
text: string;
|
|
32
|
+
start: number;
|
|
33
|
+
end: number;
|
|
34
|
+
};
|
|
35
|
+
export declare const Input: React.FC<InputProps<any>>;
|
|
@@ -1,153 +1,347 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import { jsx as f, jsxs as z } from "react/jsx-runtime";
|
|
2
|
+
import i, { useRef as y, useState as K, useMemo as L, useEffect as x } from "react";
|
|
3
|
+
import Qe from "../../_virtual/react-contenteditable.js";
|
|
4
|
+
import "../../utils/contextStore.js";
|
|
5
|
+
import { mergeCode0Props as le } from "../../utils/utils.js";
|
|
6
|
+
import '../../assets/components/form/Input.style.css';/* empty css */
|
|
7
|
+
import { InputLabel as Xe } from "./InputLabel.js";
|
|
8
|
+
import { InputDescription as Ye } from "./InputDescription.js";
|
|
9
|
+
import { InputMessage as Ze } from "./InputMessage.js";
|
|
10
|
+
import { Menu as _e, MenuTrigger as et, MenuPortal as tt } from "../menu/Menu.js";
|
|
11
|
+
import { InputSuggestionMenuContent as nt, InputSuggestionMenuContentItems as rt } from "./InputSuggestion.js";
|
|
12
|
+
import { getSelectionMetrics as ot, setElementKey as st, setSelectionRangeSafe as at } from "./Input.utils.js";
|
|
13
|
+
import { Card as ut } from "../card/Card.js";
|
|
14
|
+
import { useContentEditableController as it } from "./InputContentEditable.hook.js";
|
|
15
|
+
const X = (u) => {
|
|
16
|
+
const k = u ?? "";
|
|
17
|
+
return typeof k == "string" ? k : String(k);
|
|
18
|
+
}, $e = (u) => {
|
|
19
|
+
if (u == null) return "";
|
|
20
|
+
if (typeof u == "string") return u;
|
|
21
|
+
try {
|
|
22
|
+
return JSON.stringify(u);
|
|
23
|
+
} catch {
|
|
24
|
+
return String(u ?? "");
|
|
25
|
+
}
|
|
26
|
+
}, Fe = (u) => {
|
|
27
|
+
if (!u) return null;
|
|
28
|
+
const k = u.value ?? "", Y = u.selectionStart ?? k.length, E = k.slice(0, Y).match(/\S+$/);
|
|
29
|
+
if (!E || E.index === void 0) return null;
|
|
30
|
+
const g = E[0], $ = E.index, N = $ + g.length;
|
|
31
|
+
return {
|
|
32
|
+
token: g,
|
|
33
|
+
start: $,
|
|
34
|
+
end: N
|
|
35
|
+
};
|
|
36
|
+
}, lt = i.forwardRef((u, k) => {
|
|
37
|
+
const {
|
|
38
|
+
wrapperComponent: Y = {},
|
|
39
|
+
title: Z,
|
|
40
|
+
description: E,
|
|
41
|
+
disabled: g = !1,
|
|
42
|
+
left: $,
|
|
43
|
+
right: N,
|
|
44
|
+
leftType: Be = "icon",
|
|
45
|
+
rightType: Ae = "action",
|
|
46
|
+
formValidation: V = {
|
|
34
47
|
valid: !0,
|
|
35
48
|
notValidMessage: null,
|
|
36
49
|
setValue: null
|
|
37
50
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
suggestions: l,
|
|
52
|
+
suggestionsHeader: ce,
|
|
53
|
+
suggestionsFooter: fe,
|
|
54
|
+
onSuggestionSelect: de,
|
|
55
|
+
disableOnValue: pe = () => !1,
|
|
56
|
+
transformSyntax: P,
|
|
57
|
+
validationUsesSyntax: j = !1,
|
|
58
|
+
filterSuggestionsByLastToken: h = !1,
|
|
59
|
+
enforceUniqueSuggestions: ge = !1,
|
|
60
|
+
onLastTokenChange: he,
|
|
61
|
+
suggestionsEmptyState: me,
|
|
62
|
+
...ze
|
|
63
|
+
} = u, {
|
|
64
|
+
onFocus: Se,
|
|
65
|
+
onBlur: _,
|
|
66
|
+
onKeyDown: q,
|
|
67
|
+
onKeyDownCapture: ee,
|
|
68
|
+
onChange: F,
|
|
69
|
+
onInput: B,
|
|
49
70
|
...m
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
71
|
+
} = ze, W = y(null), d = y(null), H = y(null), M = y(null), te = y(null), D = y(!1), Ne = y(0), Ce = y(null), ne = m.value ?? u.initialValue ?? u.defaultValue, [ye, je] = K(!1), R = y(!1), a = i.useCallback((e) => {
|
|
72
|
+
R.current = e, je(e);
|
|
73
|
+
}, []), [w, re] = K(ne), [ve, be] = K([]), [ke, oe] = K([]), [we, qe] = K(null), [xe, Ee] = K(null), o = !!P, I = L(() => pe(w), [pe, w]), v = L(() => o ? H : d, [o]);
|
|
74
|
+
i.useImperativeHandle(k, () => v.current ?? null, [v]);
|
|
75
|
+
const We = L(() => ({
|
|
76
|
+
...m,
|
|
77
|
+
onChange: F,
|
|
78
|
+
onInput: B
|
|
79
|
+
}), [m, F, B]), He = L(() => {
|
|
80
|
+
const {
|
|
81
|
+
value: e,
|
|
82
|
+
defaultValue: t,
|
|
83
|
+
...n
|
|
84
|
+
} = m;
|
|
85
|
+
return le("input__control", n);
|
|
86
|
+
}, [m]), U = i.useCallback(() => {
|
|
87
|
+
const e = v.current;
|
|
88
|
+
!e || g || I || e.focus({
|
|
89
|
+
preventScroll: !0
|
|
90
|
+
});
|
|
91
|
+
}, [v, g, I]), T = i.useCallback(() => {
|
|
92
|
+
l && a(!0);
|
|
93
|
+
}, [l, a]), se = i.useCallback((e) => {
|
|
94
|
+
h && (qe(e), e && a(!0), he?.(e));
|
|
95
|
+
}, [h, he, a]), ae = i.useCallback((e, t) => {
|
|
96
|
+
if (!V?.setValue) return;
|
|
97
|
+
const n = m.type !== "checkbox" ? X(e) : e, r = j ? t : n;
|
|
98
|
+
Object.is(Ce.current, r) || (Ce.current = r, V.setValue(r));
|
|
99
|
+
}, [V?.setValue, m.type, j]), p = it({
|
|
100
|
+
editorRef: H,
|
|
101
|
+
transformSyntax: P,
|
|
102
|
+
filterSuggestionsByLastToken: h,
|
|
103
|
+
onLastTokenChange: se,
|
|
104
|
+
onStateChange: ({
|
|
105
|
+
value: e,
|
|
106
|
+
tokens: t,
|
|
107
|
+
segments: n
|
|
108
|
+
}) => {
|
|
109
|
+
re(e), oe(t), Ee(n ?? null), ae(e, n ?? null);
|
|
110
|
+
}
|
|
111
|
+
}), Ve = y(!1);
|
|
112
|
+
x(() => {
|
|
113
|
+
if (!o || !P || Ve.current) return;
|
|
114
|
+
const e = X(ne);
|
|
115
|
+
re(e), p.initializeFromExternalValue(e), j && P && Ee(P(e, [])), Ve.current = !0;
|
|
116
|
+
}, [o, P, ne, j, p]), x(() => {
|
|
117
|
+
o || m.value !== void 0 && re(m.value);
|
|
118
|
+
}, [m.value, o]), x(() => {
|
|
119
|
+
ae(w, xe);
|
|
120
|
+
}, [ae, xe, w]), x(() => {
|
|
121
|
+
if (!l) return;
|
|
122
|
+
const e = (t) => {
|
|
123
|
+
const n = t.target, r = !!H.current?.contains(n), s = !!d.current?.contains(n), c = !!te.current?.contains(n), S = !!W.current?.contains(n), C = r || s || c || S;
|
|
124
|
+
D.current = C, !C && R.current && a(!1);
|
|
64
125
|
};
|
|
65
126
|
return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
|
|
66
|
-
}, [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
127
|
+
}, [l, a]), x(() => {
|
|
128
|
+
const e = W.current;
|
|
129
|
+
if (!e) return;
|
|
130
|
+
const t = () => T();
|
|
131
|
+
return e.addEventListener("focusin", t), () => e.removeEventListener("focusin", t);
|
|
132
|
+
}, [T]);
|
|
133
|
+
const De = i.useCallback((e, t, n) => {
|
|
134
|
+
if (e.length === 0) return t <= n.length ? t : null;
|
|
135
|
+
let r = n.indexOf(e);
|
|
136
|
+
if (r === -1) return null;
|
|
137
|
+
let s = r;
|
|
138
|
+
for (; s !== -1; )
|
|
139
|
+
Math.abs(s - t) < Math.abs(r - t) && (r = s), s = n.indexOf(e, s + 1);
|
|
140
|
+
return r;
|
|
141
|
+
}, []), J = i.useCallback((e, t) => {
|
|
142
|
+
const n = [];
|
|
143
|
+
return e.forEach((r) => {
|
|
144
|
+
const s = De(r.text, r.start, t);
|
|
145
|
+
if (s === null) return;
|
|
146
|
+
const c = s + r.text.length;
|
|
147
|
+
t.slice(s, c) === r.text && n.push({
|
|
148
|
+
...r,
|
|
149
|
+
start: s,
|
|
150
|
+
end: c
|
|
151
|
+
});
|
|
152
|
+
}), n;
|
|
153
|
+
}, [De]);
|
|
154
|
+
x(() => {
|
|
155
|
+
if (o) return;
|
|
156
|
+
const e = X(d.current?.value ?? w);
|
|
157
|
+
be((t) => {
|
|
158
|
+
const n = J(t, e);
|
|
159
|
+
return oe(n.map((r) => r.suggestion)), n;
|
|
160
|
+
});
|
|
161
|
+
}, [o, J, w]), x(() => {
|
|
162
|
+
if (!h || o) return;
|
|
163
|
+
const e = d.current;
|
|
164
|
+
if (!e) return;
|
|
165
|
+
const t = () => se(Fe(e)?.token ?? null);
|
|
166
|
+
return e.addEventListener("input", t), e.addEventListener("keyup", t), e.addEventListener("mouseup", t), t(), () => {
|
|
167
|
+
e.removeEventListener("input", t), e.removeEventListener("keyup", t), e.removeEventListener("mouseup", t);
|
|
168
|
+
};
|
|
169
|
+
}, [h, o, se]);
|
|
170
|
+
const O = L(() => {
|
|
171
|
+
if (!h || !l) return l;
|
|
172
|
+
const e = we?.trim();
|
|
173
|
+
return e?.length ? l.filter((t) => String(t?.value ?? "").toLowerCase().startsWith(e.toLowerCase())) : l;
|
|
174
|
+
}, [h, we, l]), G = L(() => {
|
|
175
|
+
if (!ge || !O) return O;
|
|
176
|
+
if (o) {
|
|
177
|
+
const t = new Set((ke ?? []).map((n) => $e(n?.value ?? n)));
|
|
178
|
+
return O.filter((n) => !t.has($e(n?.value ?? n)));
|
|
179
|
+
}
|
|
180
|
+
const e = new Set(ve.map((t) => t.suggestion));
|
|
181
|
+
return O.filter((t) => !e.has(t));
|
|
182
|
+
}, [ve, ke, ge, O, o]), Ie = i.useCallback((e) => {
|
|
183
|
+
if (!d.current) return;
|
|
184
|
+
const t = typeof w == "object" ? JSON.stringify(e.value) : e.value, n = t == null ? "" : String(t), r = e.insertMode ?? "replace", s = d.current.value ?? "";
|
|
185
|
+
let c = s, S = null, C = 0;
|
|
186
|
+
const A = h ? Fe(d.current) : null;
|
|
187
|
+
if (h && A)
|
|
188
|
+
c = `${s.slice(0, A.start)}${n}${s.slice(A.end)}`, S = A.start + n.length, C = A.start;
|
|
189
|
+
else
|
|
190
|
+
switch (r) {
|
|
191
|
+
case "append":
|
|
192
|
+
c = `${s}${n}`, S = c.length, C = s.length;
|
|
193
|
+
break;
|
|
194
|
+
case "prepend":
|
|
195
|
+
c = `${n}${s}`, S = n.length, C = 0;
|
|
196
|
+
break;
|
|
197
|
+
case "insert": {
|
|
198
|
+
const {
|
|
199
|
+
rawStart: b,
|
|
200
|
+
rawEnd: ie
|
|
201
|
+
} = ot(d.current);
|
|
202
|
+
c = `${s.slice(0, b)}${n}${s.slice(ie)}`, S = b + n.length, C = b;
|
|
203
|
+
break;
|
|
87
204
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
205
|
+
case "replace":
|
|
206
|
+
default:
|
|
207
|
+
c = n, S = n.length, C = 0;
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
st(d.current, "value", c, "change"), be((b) => {
|
|
211
|
+
const ie = X(c), Te = J(b, ie), Oe = n.length ? {
|
|
212
|
+
id: Ne.current++,
|
|
213
|
+
suggestion: e,
|
|
214
|
+
text: n,
|
|
215
|
+
start: C,
|
|
216
|
+
end: C + n.length
|
|
217
|
+
} : null, Ke = Oe ? [...Te, Oe] : Te;
|
|
218
|
+
return oe(Ke.map((Ge) => Ge.suggestion)), Ke;
|
|
219
|
+
}), S !== null && requestAnimationFrame(() => {
|
|
220
|
+
const b = d.current;
|
|
221
|
+
b && (b.focus({
|
|
222
|
+
preventScroll: !0
|
|
223
|
+
}), at(b, S, S));
|
|
224
|
+
});
|
|
225
|
+
}, [h, J, w]), Le = i.useCallback((e) => {
|
|
226
|
+
if (o ? p.applySuggestionValueSyntax(e) : Ie(e), de?.(e), o) {
|
|
227
|
+
const t = v.current;
|
|
228
|
+
requestAnimationFrame(() => {
|
|
229
|
+
if (!t) return;
|
|
230
|
+
const n = {
|
|
231
|
+
type: "change",
|
|
232
|
+
target: t,
|
|
233
|
+
currentTarget: t
|
|
234
|
+
};
|
|
235
|
+
t.dispatchEvent(new Event("input", {
|
|
236
|
+
bubbles: !0
|
|
237
|
+
})), B?.(n), F?.(n);
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
a(!1), D.current = !1, requestAnimationFrame(() => {
|
|
241
|
+
U();
|
|
242
|
+
});
|
|
243
|
+
}, [v, Ie, p, U, o, de, a, F, B]), Pe = i.useCallback((e) => {
|
|
244
|
+
T(), Se?.(e);
|
|
245
|
+
}, [T, Se]), Q = i.useCallback((e) => {
|
|
246
|
+
if (D.current) {
|
|
247
|
+
_?.(e);
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
a(!1), _?.(e);
|
|
251
|
+
}, [_, a]), Me = i.useCallback((e) => {
|
|
252
|
+
if (o) {
|
|
253
|
+
p.handleKeyDownCapture(e), ee?.(e);
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
(e.key === " " || e.code === "Space") && (e.stopPropagation(), e.nativeEvent?.stopImmediatePropagation?.()), ee?.(e);
|
|
257
|
+
}, [p, o, ee]), Re = i.useCallback((e) => {
|
|
258
|
+
if (l) {
|
|
259
|
+
if (e.key === "ArrowDown") {
|
|
260
|
+
e.preventDefault(), e.stopPropagation(), R.current ? M.current?.highlightNextItem?.() : (a(!0), setTimeout(() => M.current?.focusFirstItem?.(), 0));
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
if (e.key === "ArrowUp") {
|
|
264
|
+
e.preventDefault(), e.stopPropagation(), R.current ? M.current?.highlightPreviousItem?.() : (a(!0), setTimeout(() => M.current?.focusLastItem?.(), 0));
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
if (e.key === "Enter" && R.current) {
|
|
268
|
+
e.preventDefault(), e.stopPropagation(), M.current?.selectActiveItem?.() && a(!1);
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
if (e.key === "Escape" && R.current) {
|
|
272
|
+
e.preventDefault(), e.stopPropagation(), a(!1);
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
if (o && p.handleKeyDown(e)) {
|
|
277
|
+
q?.(e);
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
if (o && e.key === "Enter") {
|
|
281
|
+
e.preventDefault(), q?.(e);
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
q?.(e);
|
|
285
|
+
}, [p, o, l, a, q]), ue = o ? /* @__PURE__ */ f(Qe, { innerRef: H, html: p.editorHtml, ...He, disabled: g || I, onChange: (e) => {
|
|
286
|
+
p.handleChange(e), F?.(e), B?.(e);
|
|
287
|
+
}, onPaste: p.handlePaste, onFocus: Pe, onBlur: Q, onKeyDownCapture: Me, onKeyDown: Re, spellCheck: !1, contentEditable: !g && !I }) : /* @__PURE__ */ f("input", { ref: d, ...le("input__control", We), onFocus: Pe, onBlur: Q, onKeyDownCapture: Me, onKeyDown: Re, spellCheck: !1, disabled: g || I }), Ue = i.useCallback((e) => {
|
|
288
|
+
if (g || I) return;
|
|
289
|
+
const t = e.target;
|
|
290
|
+
te.current?.contains(t) || (D.current = !0, U(), T());
|
|
291
|
+
}, [g, I, U, T]);
|
|
292
|
+
x(() => {
|
|
293
|
+
const e = W.current;
|
|
294
|
+
if (!e) return;
|
|
295
|
+
const t = (n) => {
|
|
296
|
+
const r = n.relatedTarget;
|
|
297
|
+
r && e.contains(r) || Q(n);
|
|
298
|
+
};
|
|
299
|
+
return e.addEventListener("focusout", t), () => e.removeEventListener("focusout", t);
|
|
300
|
+
}, [Q]);
|
|
301
|
+
const Je = L(() => /* @__PURE__ */ z(_e, { open: ye, modal: !1, onOpenChange: (e) => {
|
|
302
|
+
!e && D.current || a(e);
|
|
303
|
+
}, children: [
|
|
304
|
+
/* @__PURE__ */ f(et, { asChild: !0, children: /* @__PURE__ */ f("button", { type: "button", tabIndex: -1, "aria-hidden": !0, style: {
|
|
305
|
+
position: "absolute",
|
|
306
|
+
inset: 0,
|
|
307
|
+
opacity: 0,
|
|
308
|
+
pointerEvents: "none"
|
|
309
|
+
}, onMouseDown: (e) => e.preventDefault() }) }),
|
|
310
|
+
ue,
|
|
311
|
+
/* @__PURE__ */ f(tt, { children: /* @__PURE__ */ f("div", { ref: te, onPointerDownCapture: () => {
|
|
312
|
+
D.current = !0;
|
|
313
|
+
}, onMouseDownCapture: (e) => {
|
|
314
|
+
e.preventDefault(), D.current = !0;
|
|
315
|
+
}, children: /* @__PURE__ */ z(nt, { color: "secondary", inputRef: v, children: [
|
|
316
|
+
ce,
|
|
317
|
+
/* @__PURE__ */ z(ut, { paddingSize: "xxs", mt: -0.35, mx: -0.35, style: {
|
|
318
|
+
borderWidth: "2px"
|
|
319
|
+
}, children: [
|
|
320
|
+
G?.length === 0 && me,
|
|
321
|
+
!!G?.length && /* @__PURE__ */ f(
|
|
322
|
+
rt,
|
|
93
323
|
{
|
|
94
|
-
ref:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
e.key === "ArrowDown" ? (e.preventDefault(), a.current?.focusFirstItem()) : e.key === "ArrowUp" && (e.preventDefault(), a.current?.focusLastItem());
|
|
99
|
-
},
|
|
100
|
-
disabled: w || p
|
|
324
|
+
ref: M,
|
|
325
|
+
inputRef: v,
|
|
326
|
+
suggestions: G,
|
|
327
|
+
onSuggestionSelect: Le
|
|
101
328
|
}
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
),
|
|
116
|
-
O,
|
|
117
|
-
" "
|
|
118
|
-
] }) })
|
|
119
|
-
]
|
|
120
|
-
}
|
|
121
|
-
), [o, d, S, O]);
|
|
122
|
-
return /* @__PURE__ */ f(T, { children: [
|
|
123
|
-
b && /* @__PURE__ */ r(A, { children: b }),
|
|
124
|
-
" ",
|
|
125
|
-
M && /* @__PURE__ */ r(K, { children: M }),
|
|
126
|
-
" ",
|
|
127
|
-
/* @__PURE__ */ f("div", { ...y(
|
|
128
|
-
`input ${u?.valid ? "" : "input--not-valid"}`,
|
|
129
|
-
// Add error class if invalid
|
|
130
|
-
P
|
|
131
|
-
), children: [
|
|
132
|
-
E && /* @__PURE__ */ r("div", { className: `input__left input__left--${j}`, children: E }),
|
|
133
|
-
" ",
|
|
134
|
-
d ? F : /* @__PURE__ */ r(
|
|
135
|
-
"input",
|
|
136
|
-
{
|
|
137
|
-
tabIndex: 2,
|
|
138
|
-
ref: n,
|
|
139
|
-
disabled: w,
|
|
140
|
-
...y(`input__control ${t.transformValue ? "input__control--syntax" : ""}`, m)
|
|
141
|
-
}
|
|
142
|
-
),
|
|
143
|
-
$,
|
|
144
|
-
I && /* @__PURE__ */ r("div", { className: `input__right input__right--${R}`, children: I }),
|
|
145
|
-
" "
|
|
329
|
+
)
|
|
330
|
+
] }),
|
|
331
|
+
fe
|
|
332
|
+
] }) }) })
|
|
333
|
+
] }), [ye, ue, o, G, ce, fe, me, Le, v, a]);
|
|
334
|
+
return /* @__PURE__ */ z("div", { children: [
|
|
335
|
+
Z && /* @__PURE__ */ f(Xe, { children: Z }),
|
|
336
|
+
E && /* @__PURE__ */ f(Ye, { children: E }),
|
|
337
|
+
/* @__PURE__ */ z("div", { ref: W, ...le(`input ${V?.valid ? "" : "input--not-valid"}`, Y), onPointerDown: Ue, children: [
|
|
338
|
+
$ && /* @__PURE__ */ f("div", { className: `input__left input__left--${Be}`, children: $ }),
|
|
339
|
+
l ? Je : ue,
|
|
340
|
+
N && /* @__PURE__ */ f("div", { className: `input__right input__right--${Ae}`, children: N })
|
|
146
341
|
] }),
|
|
147
|
-
!
|
|
342
|
+
!V?.valid && V?.notValidMessage && /* @__PURE__ */ f(Ze, { children: V.notValidMessage })
|
|
148
343
|
] });
|
|
149
|
-
});
|
|
344
|
+
}), xt = lt;
|
|
150
345
|
export {
|
|
151
|
-
|
|
152
|
-
G as setElementKey
|
|
346
|
+
xt as Input
|
|
153
347
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type InputSyntaxSegment = {
|
|
3
|
+
type: "text" | "block";
|
|
4
|
+
value?: any;
|
|
5
|
+
start: number;
|
|
6
|
+
end: number;
|
|
7
|
+
visualLength?: number;
|
|
8
|
+
content?: string | React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export declare const buildDefaultSyntax: (value: any) => InputSyntaxSegment[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const setElementKey: (element: HTMLElement, key: string, value: any, event: string) => void;
|
|
2
|
+
export declare const clearInputElement: (element: HTMLElement | null) => void;
|
|
3
|
+
export declare const setSelectionRangeSafe: (target: HTMLInputElement, start: number, end: number, direction?: "forward" | "backward" | "none") => void;
|
|
4
|
+
export declare const getSelectionMetrics: (target: HTMLInputElement) => {
|
|
5
|
+
selectionStart: number;
|
|
6
|
+
selectionEnd: number;
|
|
7
|
+
rawStart: number;
|
|
8
|
+
rawEnd: number;
|
|
9
|
+
direction: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const a = (t, e, n, c) => {
|
|
2
|
+
const r = Object.getOwnPropertyDescriptor(t, e)?.set, s = Object.getPrototypeOf(t), o = Object.getOwnPropertyDescriptor(s, e)?.set;
|
|
3
|
+
r && r !== o ? o?.call(t, n) : r?.call(t, n), t.dispatchEvent(new Event(c, {
|
|
4
|
+
bubbles: !0
|
|
5
|
+
}));
|
|
6
|
+
}, i = (t) => {
|
|
7
|
+
if (t) {
|
|
8
|
+
if (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement) {
|
|
9
|
+
a(t, "value", "", "change");
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
t.isContentEditable && (t.innerHTML = "", t.dispatchEvent(new Event("input", {
|
|
13
|
+
bubbles: !0
|
|
14
|
+
})), t.dispatchEvent(new Event("change", {
|
|
15
|
+
bubbles: !0
|
|
16
|
+
})));
|
|
17
|
+
}
|
|
18
|
+
}, p = (t, e, n, c) => {
|
|
19
|
+
try {
|
|
20
|
+
t.setSelectionRange(e, n, c);
|
|
21
|
+
} catch {
|
|
22
|
+
}
|
|
23
|
+
}, b = (t) => {
|
|
24
|
+
const e = t.selectionStart ?? 0, n = t.selectionEnd ?? e;
|
|
25
|
+
return {
|
|
26
|
+
selectionStart: e,
|
|
27
|
+
selectionEnd: n,
|
|
28
|
+
rawStart: Math.min(e, n),
|
|
29
|
+
rawEnd: Math.max(e, n),
|
|
30
|
+
direction: t.selectionDirection === "backward" ? "backward" : "forward"
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
i as clearInputElement,
|
|
35
|
+
b as getSelectionMetrics,
|
|
36
|
+
a as setElementKey,
|
|
37
|
+
p as setSelectionRangeSafe
|
|
38
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { InputSuggestion } from './InputSuggestion';
|
|
3
|
+
import { InputSyntaxSegment } from './Input.syntax.hook';
|
|
4
|
+
import { ContentEditableEvent } from 'react-contenteditable';
|
|
5
|
+
/**
|
|
6
|
+
* =========================
|
|
7
|
+
* Types
|
|
8
|
+
* =========================
|
|
9
|
+
*/
|
|
10
|
+
type EditorPart = string | InputSuggestion | any;
|
|
11
|
+
export type UseContentEditableControllerProps = {
|
|
12
|
+
editorRef: React.RefObject<HTMLElement>;
|
|
13
|
+
transformSyntax?: ((value: any, appliedSyntaxParts?: (InputSuggestion | any)[]) => InputSyntaxSegment[]) | undefined;
|
|
14
|
+
filterSuggestionsByLastToken?: boolean;
|
|
15
|
+
onLastTokenChange?: (token: string | null) => void;
|
|
16
|
+
onStateChange?: (payload: {
|
|
17
|
+
value: string;
|
|
18
|
+
tokens: InputSuggestion[];
|
|
19
|
+
segments?: InputSyntaxSegment[] | null;
|
|
20
|
+
}) => void;
|
|
21
|
+
};
|
|
22
|
+
export type UseContentEditableControllerReturn = {
|
|
23
|
+
editorHtml: string;
|
|
24
|
+
setEditorHtml: React.Dispatch<React.SetStateAction<string>>;
|
|
25
|
+
initializeFromExternalValue: (externalValue: string) => string;
|
|
26
|
+
updateEditorState: (rootEl: HTMLElement | null) => void;
|
|
27
|
+
applySuggestionValueSyntax: (suggestion: InputSuggestion) => void;
|
|
28
|
+
handlePaste: (event: React.ClipboardEvent<HTMLDivElement>) => void;
|
|
29
|
+
handleChange: (event: ContentEditableEvent) => void;
|
|
30
|
+
handleKeyDownCapture: (event: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
31
|
+
handleKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => boolean;
|
|
32
|
+
};
|
|
33
|
+
export declare const serializeEditorParts: (rootEl: HTMLElement | null) => EditorPart[];
|
|
34
|
+
/**
|
|
35
|
+
* =========================
|
|
36
|
+
* Hook
|
|
37
|
+
* =========================
|
|
38
|
+
*/
|
|
39
|
+
export declare const useContentEditableController: (props: UseContentEditableControllerProps) => UseContentEditableControllerReturn;
|
|
40
|
+
export {};
|