@micromerce/formbuilder-react 1.0.651 → 1.0.656
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/components/Checkbox/Checkbox.module.scss +10 -0
- package/dist/components/FormBuilder/FormBuilder.module.scss +94 -0
- package/dist/components/FormFooter/FormFooter.module.scss +65 -0
- package/dist/components/FormGroup/FormGroup.module.scss +69 -0
- package/dist/components/FormList/FormList.module.scss +173 -0
- package/dist/components/Group/Group.module.scss +28 -0
- package/dist/components/Input/Input.module.scss +3 -0
- package/dist/components/InputFreeSolo/InputFreeSolo.module.scss +29 -0
- package/dist/components/MrnInput/MrnInput.module.scss +31 -0
- package/dist/components/MultiSelect/MultiSelect.module.scss +13 -0
- package/dist/components/PasswordInput/PasswordInput.module.scss +26 -0
- package/dist/components/Select/Select.module.scss +15 -0
- package/dist/components/Textarea/Textarea.module.scss +14 -0
- package/dist/components/addressGroup/AddressGroup.module.scss +72 -0
- package/dist/src/assets/icons/error/Error.d.ts +2 -0
- package/dist/src/assets/icons/error/Error.js +6 -0
- package/dist/src/assets/icons/error/Error.js.map +1 -0
- package/dist/src/components/Checkbox/Checkbox.d.ts +10 -0
- package/dist/src/components/Checkbox/Checkbox.js +37 -0
- package/dist/src/components/Checkbox/Checkbox.js.map +1 -0
- package/dist/src/components/Checkbox/index.d.ts +1 -0
- package/dist/src/components/Checkbox/index.js +2 -0
- package/dist/src/components/Checkbox/index.js.map +1 -0
- package/dist/src/components/ControlWrapper/ControlWrapper.d.ts +11 -0
- package/dist/src/components/ControlWrapper/ControlWrapper.js +37 -0
- package/dist/src/components/ControlWrapper/ControlWrapper.js.map +1 -0
- package/dist/src/components/ControlWrapper/index.d.ts +1 -0
- package/dist/src/components/ControlWrapper/index.js +2 -0
- package/dist/src/components/ControlWrapper/index.js.map +1 -0
- package/dist/src/components/DateRangeGroup/DateRangeGroup.d.ts +10 -0
- package/dist/src/components/DateRangeGroup/DateRangeGroup.js +69 -0
- package/dist/src/components/DateRangeGroup/DateRangeGroup.js.map +1 -0
- package/dist/src/components/DateRangeGroup/DateRangeGroup.styles.d.ts +3 -0
- package/dist/src/components/DateRangeGroup/DateRangeGroup.styles.js +59 -0
- package/dist/src/components/DateRangeGroup/DateRangeGroup.styles.js.map +1 -0
- package/dist/src/components/DateRangeGroup/components/CalendarModal.d.ts +14 -0
- package/dist/src/components/DateRangeGroup/components/CalendarModal.js +90 -0
- package/dist/src/components/DateRangeGroup/components/CalendarModal.js.map +1 -0
- package/dist/src/components/DateRangeGroup/index.d.ts +1 -0
- package/dist/src/components/DateRangeGroup/index.js +2 -0
- package/dist/src/components/DateRangeGroup/index.js.map +1 -0
- package/dist/src/components/ErrorBoundary/ErrorBoundary.d.ts +14 -0
- package/dist/src/components/ErrorBoundary/ErrorBoundary.js +22 -0
- package/dist/src/components/ErrorBoundary/ErrorBoundary.js.map +1 -0
- package/dist/src/components/FileUploader/FileUploader.d.ts +9 -0
- package/dist/src/components/FileUploader/FileUploader.js +30 -0
- package/dist/src/components/FileUploader/FileUploader.js.map +1 -0
- package/dist/src/components/FileUploader/index.d.ts +1 -0
- package/dist/src/components/FileUploader/index.js +2 -0
- package/dist/src/components/FileUploader/index.js.map +1 -0
- package/dist/src/components/FormBuilder/FormBuilder.d.ts +25 -0
- package/dist/src/components/FormBuilder/FormBuilder.js +74 -0
- package/dist/src/components/FormBuilder/FormBuilder.js.map +1 -0
- package/dist/src/components/FormBuilder/index.d.ts +1 -0
- package/dist/src/components/FormBuilder/index.js +2 -0
- package/dist/src/components/FormBuilder/index.js.map +1 -0
- package/dist/src/components/FormBuilder/utils/extractFormControlValues/extractFormControlValues.d.ts +6 -0
- package/dist/src/components/FormBuilder/utils/extractFormControlValues/extractFormControlValues.js +50 -0
- package/dist/src/components/FormBuilder/utils/extractFormControlValues/extractFormControlValues.js.map +1 -0
- package/dist/src/components/FormBuilder/utils/extractFormControlValues/index.d.ts +1 -0
- package/dist/src/components/FormBuilder/utils/extractFormControlValues/index.js +2 -0
- package/dist/src/components/FormBuilder/utils/extractFormControlValues/index.js.map +1 -0
- package/dist/src/components/FormBuilder/utils/jsonToUrlEncoded/index.d.ts +1 -0
- package/dist/src/components/FormBuilder/utils/jsonToUrlEncoded/index.js +2 -0
- package/dist/src/components/FormBuilder/utils/jsonToUrlEncoded/index.js.map +1 -0
- package/dist/src/components/FormBuilder/utils/jsonToUrlEncoded/jsonToUrlEncoded.d.ts +5 -0
- package/dist/src/components/FormBuilder/utils/jsonToUrlEncoded/jsonToUrlEncoded.js +15 -0
- package/dist/src/components/FormBuilder/utils/jsonToUrlEncoded/jsonToUrlEncoded.js.map +1 -0
- package/dist/src/components/FormFooter/FormFooter.d.ts +15 -0
- package/dist/src/components/FormFooter/FormFooter.js +46 -0
- package/dist/src/components/FormFooter/FormFooter.js.map +1 -0
- package/dist/src/components/FormFooter/components/Switch.d.ts +1 -0
- package/dist/src/components/FormFooter/components/Switch.js +15 -0
- package/dist/src/components/FormFooter/components/Switch.js.map +1 -0
- package/dist/src/components/FormFooter/index.d.ts +1 -0
- package/dist/src/components/FormFooter/index.js +2 -0
- package/dist/src/components/FormFooter/index.js.map +1 -0
- package/dist/src/components/FormGroup/FormGroup.d.ts +15 -0
- package/dist/src/components/FormGroup/FormGroup.js +18 -0
- package/dist/src/components/FormGroup/FormGroup.js.map +1 -0
- package/dist/src/components/FormGroup/index.d.ts +1 -0
- package/dist/src/components/FormGroup/index.js +2 -0
- package/dist/src/components/FormGroup/index.js.map +1 -0
- package/dist/src/components/FormList/FormList.d.ts +11 -0
- package/dist/src/components/FormList/FormList.js +66 -0
- package/dist/src/components/FormList/FormList.js.map +1 -0
- package/dist/src/components/FormList/index.d.ts +1 -0
- package/dist/src/components/FormList/index.js +2 -0
- package/dist/src/components/FormList/index.js.map +1 -0
- package/dist/src/components/GeneralFormGroup/GeneralFormGroup.d.ts +5 -0
- package/dist/src/components/GeneralFormGroup/GeneralFormGroup.js +4 -0
- package/dist/src/components/GeneralFormGroup/GeneralFormGroup.js.map +1 -0
- package/dist/src/components/GeneralFormGroup/index.d.ts +1 -0
- package/dist/src/components/GeneralFormGroup/index.js +2 -0
- package/dist/src/components/GeneralFormGroup/index.js.map +1 -0
- package/dist/src/components/Group/Group.d.ts +12 -0
- package/dist/src/components/Group/Group.js +32 -0
- package/dist/src/components/Group/Group.js.map +1 -0
- package/dist/src/components/Group/index.d.ts +1 -0
- package/dist/src/components/Group/index.js +2 -0
- package/dist/src/components/Group/index.js.map +1 -0
- package/dist/src/components/Input/Input.d.ts +14 -0
- package/dist/src/components/Input/Input.js +57 -0
- package/dist/src/components/Input/Input.js.map +1 -0
- package/dist/src/components/Input/index.d.ts +1 -0
- package/dist/src/components/Input/index.js +2 -0
- package/dist/src/components/Input/index.js.map +1 -0
- package/dist/src/components/Input/input.styles.d.ts +9 -0
- package/dist/src/components/Input/input.styles.js +24 -0
- package/dist/src/components/Input/input.styles.js.map +1 -0
- package/dist/src/components/InputFreeSolo/InputFreeSolo.d.ts +10 -0
- package/dist/src/components/InputFreeSolo/InputFreeSolo.js +67 -0
- package/dist/src/components/InputFreeSolo/InputFreeSolo.js.map +1 -0
- package/dist/src/components/InputFreeSolo/index.d.ts +1 -0
- package/dist/src/components/InputFreeSolo/index.js +2 -0
- package/dist/src/components/InputFreeSolo/index.js.map +1 -0
- package/dist/src/components/MrnInput/MrnInput.d.ts +11 -0
- package/dist/src/components/MrnInput/MrnInput.js +64 -0
- package/dist/src/components/MrnInput/MrnInput.js.map +1 -0
- package/dist/src/components/MrnInput/hooks/useMrn.d.ts +21 -0
- package/dist/src/components/MrnInput/hooks/useMrn.js +92 -0
- package/dist/src/components/MrnInput/hooks/useMrn.js.map +1 -0
- package/dist/src/components/MrnInput/index.d.ts +1 -0
- package/dist/src/components/MrnInput/index.js +2 -0
- package/dist/src/components/MrnInput/index.js.map +1 -0
- package/dist/src/components/MrnInput/services/fetchMrn.d.ts +3 -0
- package/dist/src/components/MrnInput/services/fetchMrn.js +30 -0
- package/dist/src/components/MrnInput/services/fetchMrn.js.map +1 -0
- package/dist/src/components/MrnInput/ui-helper/Link/Link.d.ts +3 -0
- package/dist/src/components/MrnInput/ui-helper/Link/Link.js +15 -0
- package/dist/src/components/MrnInput/ui-helper/Link/Link.js.map +1 -0
- package/dist/src/components/MrnInput/utils/mrnUtils/mrnUtils.d.ts +8 -0
- package/dist/src/components/MrnInput/utils/mrnUtils/mrnUtils.js +35 -0
- package/dist/src/components/MrnInput/utils/mrnUtils/mrnUtils.js.map +1 -0
- package/dist/src/components/MrnInput/utils/resolveMrnLinks/resolveMrnLink.d.ts +2 -0
- package/dist/src/components/MrnInput/utils/resolveMrnLinks/resolveMrnLink.js +11 -0
- package/dist/src/components/MrnInput/utils/resolveMrnLinks/resolveMrnLink.js.map +1 -0
- package/dist/src/components/MrnInput/utils/resolveNestedQueryLink/resolveNestedQueryLink.d.ts +2 -0
- package/dist/src/components/MrnInput/utils/resolveNestedQueryLink/resolveNestedQueryLink.js +19 -0
- package/dist/src/components/MrnInput/utils/resolveNestedQueryLink/resolveNestedQueryLink.js.map +1 -0
- package/dist/src/components/MrnInput/utils/urlSearchParam/urlSearchParam.d.ts +1 -0
- package/dist/src/components/MrnInput/utils/urlSearchParam/urlSearchParam.js +8 -0
- package/dist/src/components/MrnInput/utils/urlSearchParam/urlSearchParam.js.map +1 -0
- package/dist/src/components/MultiSelect/MultiSelect.d.ts +17 -0
- package/dist/src/components/MultiSelect/MultiSelect.js +61 -0
- package/dist/src/components/MultiSelect/MultiSelect.js.map +1 -0
- package/dist/src/components/MultiSelect/index.d.ts +1 -0
- package/dist/src/components/MultiSelect/index.js +2 -0
- package/dist/src/components/MultiSelect/index.js.map +1 -0
- package/dist/src/components/MultiSelect/utils/extractSelectedOptionValues/extractSelectedOptionValues.d.ts +24 -0
- package/dist/src/components/MultiSelect/utils/extractSelectedOptionValues/extractSelectedOptionValues.js +21 -0
- package/dist/src/components/MultiSelect/utils/extractSelectedOptionValues/extractSelectedOptionValues.js.map +1 -0
- package/dist/src/components/MultiSelect/utils/extractSelectedOptionValues/index.d.ts +1 -0
- package/dist/src/components/MultiSelect/utils/extractSelectedOptionValues/index.js +2 -0
- package/dist/src/components/MultiSelect/utils/extractSelectedOptionValues/index.js.map +1 -0
- package/dist/src/components/PasswordInput/PasswordInput.d.ts +12 -0
- package/dist/src/components/PasswordInput/PasswordInput.js +21 -0
- package/dist/src/components/PasswordInput/PasswordInput.js.map +1 -0
- package/dist/src/components/PasswordInput/index.d.ts +1 -0
- package/dist/src/components/PasswordInput/index.js +2 -0
- package/dist/src/components/PasswordInput/index.js.map +1 -0
- package/dist/src/components/QueryControl/QueryControl.d.ts +13 -0
- package/dist/src/components/QueryControl/QueryControl.js +95 -0
- package/dist/src/components/QueryControl/QueryControl.js.map +1 -0
- package/dist/src/components/QueryControl/data/defaultControls.d.ts +9 -0
- package/dist/src/components/QueryControl/data/defaultControls.js +95 -0
- package/dist/src/components/QueryControl/data/defaultControls.js.map +1 -0
- package/dist/src/components/QueryControl/index.d.ts +1 -0
- package/dist/src/components/QueryControl/index.js +2 -0
- package/dist/src/components/QueryControl/index.js.map +1 -0
- package/dist/src/components/QueryControl/ui-helper/Wrapper/QueryControlWrapper.d.ts +8 -0
- package/dist/src/components/QueryControl/ui-helper/Wrapper/QueryControlWrapper.js +8 -0
- package/dist/src/components/QueryControl/ui-helper/Wrapper/QueryControlWrapper.js.map +1 -0
- package/dist/src/components/QueryControl/ui-helper/Wrapper/QueryControlWrapper.styles.d.ts +6 -0
- package/dist/src/components/QueryControl/ui-helper/Wrapper/QueryControlWrapper.styles.js +14 -0
- package/dist/src/components/QueryControl/ui-helper/Wrapper/QueryControlWrapper.styles.js.map +1 -0
- package/dist/src/components/QueryControl/ui-helper/Wrapper/index.d.ts +1 -0
- package/dist/src/components/QueryControl/ui-helper/Wrapper/index.js +2 -0
- package/dist/src/components/QueryControl/ui-helper/Wrapper/index.js.map +1 -0
- package/dist/src/components/QueryControl/utils/allControlsHidden/allControlsHidden.d.ts +3 -0
- package/dist/src/components/QueryControl/utils/allControlsHidden/allControlsHidden.js +39 -0
- package/dist/src/components/QueryControl/utils/allControlsHidden/allControlsHidden.js.map +1 -0
- package/dist/src/components/QueryControl/utils/allControlsHidden/index.d.ts +1 -0
- package/dist/src/components/QueryControl/utils/allControlsHidden/index.js +2 -0
- package/dist/src/components/QueryControl/utils/allControlsHidden/index.js.map +1 -0
- package/dist/src/components/QueryControl/utils/getMatchingControls.d.ts +9 -0
- package/dist/src/components/QueryControl/utils/getMatchingControls.js +19 -0
- package/dist/src/components/QueryControl/utils/getMatchingControls.js.map +1 -0
- package/dist/src/components/QueryControl/utils/hasExpertControl/hasExpertControl.d.ts +3 -0
- package/dist/src/components/QueryControl/utils/hasExpertControl/hasExpertControl.js +38 -0
- package/dist/src/components/QueryControl/utils/hasExpertControl/hasExpertControl.js.map +1 -0
- package/dist/src/components/QueryControl/utils/hasExpertControl/index.d.ts +1 -0
- package/dist/src/components/QueryControl/utils/hasExpertControl/index.js +2 -0
- package/dist/src/components/QueryControl/utils/hasExpertControl/index.js.map +1 -0
- package/dist/src/components/QueryControl/utils/hideGroup/hideGroup.d.ts +3 -0
- package/dist/src/components/QueryControl/utils/hideGroup/hideGroup.js +9 -0
- package/dist/src/components/QueryControl/utils/hideGroup/hideGroup.js.map +1 -0
- package/dist/src/components/QueryControl/utils/hideGroup/index.d.ts +1 -0
- package/dist/src/components/QueryControl/utils/hideGroup/index.js +2 -0
- package/dist/src/components/QueryControl/utils/hideGroup/index.js.map +1 -0
- package/dist/src/components/Select/Select.d.ts +12 -0
- package/dist/src/components/Select/Select.js +67 -0
- package/dist/src/components/Select/Select.js.map +1 -0
- package/dist/src/components/Select/index.d.ts +1 -0
- package/dist/src/components/Select/index.js +2 -0
- package/dist/src/components/Select/index.js.map +1 -0
- package/dist/src/components/Select/utils/getSelectedOption.d.ts +3 -0
- package/dist/src/components/Select/utils/getSelectedOption.js +8 -0
- package/dist/src/components/Select/utils/getSelectedOption.js.map +1 -0
- package/dist/src/components/Textarea/Textarea.d.ts +10 -0
- package/dist/src/components/Textarea/Textarea.js +55 -0
- package/dist/src/components/Textarea/Textarea.js.map +1 -0
- package/dist/src/components/Textarea/Textarea.types.d.ts +12 -0
- package/dist/src/components/Textarea/Textarea.types.js +2 -0
- package/dist/src/components/Textarea/Textarea.types.js.map +1 -0
- package/dist/src/components/Textarea/aiWrapper/aiAction.d.ts +12 -0
- package/dist/src/components/Textarea/aiWrapper/aiAction.js +21 -0
- package/dist/src/components/Textarea/aiWrapper/aiAction.js.map +1 -0
- package/dist/src/components/Textarea/aiWrapper/aiLayout.d.ts +10 -0
- package/dist/src/components/Textarea/aiWrapper/aiLayout.js +21 -0
- package/dist/src/components/Textarea/aiWrapper/aiLayout.js.map +1 -0
- package/dist/src/components/Textarea/aiWrapper/index.d.ts +11 -0
- package/dist/src/components/Textarea/aiWrapper/index.js +29 -0
- package/dist/src/components/Textarea/aiWrapper/index.js.map +1 -0
- package/dist/src/components/Textarea/aiWrapper/useAi.d.ts +21 -0
- package/dist/src/components/Textarea/aiWrapper/useAi.js +74 -0
- package/dist/src/components/Textarea/aiWrapper/useAi.js.map +1 -0
- package/dist/src/components/Textarea/editors/Default.d.ts +13 -0
- package/dist/src/components/Textarea/editors/Default.js +26 -0
- package/dist/src/components/Textarea/editors/Default.js.map +1 -0
- package/dist/src/components/Textarea/editors/Html.d.ts +10 -0
- package/dist/src/components/Textarea/editors/Html.js +9 -0
- package/dist/src/components/Textarea/editors/Html.js.map +1 -0
- package/dist/src/components/Textarea/editors/Json.d.ts +10 -0
- package/dist/src/components/Textarea/editors/Json.js +9 -0
- package/dist/src/components/Textarea/editors/Json.js.map +1 -0
- package/dist/src/components/Textarea/editors/Markdown.d.ts +10 -0
- package/dist/src/components/Textarea/editors/Markdown.js +20 -0
- package/dist/src/components/Textarea/editors/Markdown.js.map +1 -0
- package/dist/src/components/Textarea/editors/Richtext.d.ts +12 -0
- package/dist/src/components/Textarea/editors/Richtext.js +13 -0
- package/dist/src/components/Textarea/editors/Richtext.js.map +1 -0
- package/dist/src/components/Textarea/index.d.ts +1 -0
- package/dist/src/components/Textarea/index.js +2 -0
- package/dist/src/components/Textarea/index.js.map +1 -0
- package/dist/src/components/addressGroup/AddressGroup.d.ts +12 -0
- package/dist/src/components/addressGroup/AddressGroup.js +39 -0
- package/dist/src/components/addressGroup/AddressGroup.js.map +1 -0
- package/dist/src/components/addressGroup/index.d.ts +1 -0
- package/dist/src/components/addressGroup/index.js +2 -0
- package/dist/src/components/addressGroup/index.js.map +1 -0
- package/dist/src/components/addressGroup/utils/Countries.d.ts +3 -0
- package/dist/src/components/addressGroup/utils/Countries.js +1249 -0
- package/dist/src/components/addressGroup/utils/Countries.js.map +1 -0
- package/dist/src/components/plate/PlateEditor.d.ts +10 -0
- package/dist/src/components/plate/PlateEditor.js +38 -0
- package/dist/src/components/plate/PlateEditor.js.map +1 -0
- package/dist/src/components/plate/PlateEditorContent.d.ts +24 -0
- package/dist/src/components/plate/PlateEditorContent.js +45 -0
- package/dist/src/components/plate/PlateEditorContent.js.map +1 -0
- package/dist/src/components/plate/components/align-dropdown-menu.d.ts +2 -0
- package/dist/src/components/plate/components/align-dropdown-menu.js +33 -0
- package/dist/src/components/plate/components/align-dropdown-menu.js.map +1 -0
- package/dist/src/components/plate/components/blockquote-element.d.ts +21 -0
- package/dist/src/components/plate/components/blockquote-element.js +8 -0
- package/dist/src/components/plate/components/blockquote-element.js.map +1 -0
- package/dist/src/components/plate/components/button.d.ts +14 -0
- package/dist/src/components/plate/components/button.js +38 -0
- package/dist/src/components/plate/components/button.js.map +1 -0
- package/dist/src/components/plate/components/caption.d.ts +43 -0
- package/dist/src/components/plate/components/caption.js +25 -0
- package/dist/src/components/plate/components/caption.js.map +1 -0
- package/dist/src/components/plate/components/checkbox.d.ts +3 -0
- package/dist/src/components/plate/components/checkbox.js +7 -0
- package/dist/src/components/plate/components/checkbox.js.map +1 -0
- package/dist/src/components/plate/components/code-block-combobox.d.ts +48 -0
- package/dist/src/components/plate/components/code-block-combobox.js +131 -0
- package/dist/src/components/plate/components/code-block-combobox.js.map +1 -0
- package/dist/src/components/plate/components/code-block-element.d.ts +22 -0
- package/dist/src/components/plate/components/code-block-element.js +13 -0
- package/dist/src/components/plate/components/code-block-element.js.map +1 -0
- package/dist/src/components/plate/components/code-leaf.d.ts +19 -0
- package/dist/src/components/plate/components/code-leaf.js +8 -0
- package/dist/src/components/plate/components/code-leaf.js.map +1 -0
- package/dist/src/components/plate/components/code-line-element.d.ts +21 -0
- package/dist/src/components/plate/components/code-line-element.js +6 -0
- package/dist/src/components/plate/components/code-line-element.js.map +1 -0
- package/dist/src/components/plate/components/code-syntax-leaf.d.ts +19 -0
- package/dist/src/components/plate/components/code-syntax-leaf.js +11 -0
- package/dist/src/components/plate/components/code-syntax-leaf.js.map +1 -0
- package/dist/src/components/plate/components/color-constants.d.ts +10 -0
- package/dist/src/components/plate/components/color-constants.js +430 -0
- package/dist/src/components/plate/components/color-constants.js.map +1 -0
- package/dist/src/components/plate/components/color-dropdown-menu-items.d.ts +18 -0
- package/dist/src/components/plate/components/color-dropdown-menu-items.js +21 -0
- package/dist/src/components/plate/components/color-dropdown-menu-items.js.map +1 -0
- package/dist/src/components/plate/components/color-dropdown-menu.d.ts +12 -0
- package/dist/src/components/plate/components/color-dropdown-menu.js +18 -0
- package/dist/src/components/plate/components/color-dropdown-menu.js.map +1 -0
- package/dist/src/components/plate/components/color-input.d.ts +2 -0
- package/dist/src/components/plate/components/color-input.js +15 -0
- package/dist/src/components/plate/components/color-input.js.map +1 -0
- package/dist/src/components/plate/components/color-picker.d.ts +18 -0
- package/dist/src/components/plate/components/color-picker.js +19 -0
- package/dist/src/components/plate/components/color-picker.js.map +1 -0
- package/dist/src/components/plate/components/colors-custom.d.ts +10 -0
- package/dist/src/components/plate/components/colors-custom.js +21 -0
- package/dist/src/components/plate/components/colors-custom.js.map +1 -0
- package/dist/src/components/plate/components/command.d.ts +76 -0
- package/dist/src/components/plate/components/command.js +18 -0
- package/dist/src/components/plate/components/command.js.map +1 -0
- package/dist/src/components/plate/components/comment-leaf.d.ts +3 -0
- package/dist/src/components/plate/components/comment-leaf.js +23 -0
- package/dist/src/components/plate/components/comment-leaf.js.map +1 -0
- package/dist/src/components/plate/components/dialog.d.ts +12 -0
- package/dist/src/components/plate/components/dialog.js +16 -0
- package/dist/src/components/plate/components/dialog.js.map +1 -0
- package/dist/src/components/plate/components/dropdown-menu.d.ts +29 -0
- package/dist/src/components/plate/components/dropdown-menu.js +51 -0
- package/dist/src/components/plate/components/dropdown-menu.js.map +1 -0
- package/dist/src/components/plate/components/excalidraw-element.d.ts +21 -0
- package/dist/src/components/plate/components/excalidraw-element.js +12 -0
- package/dist/src/components/plate/components/excalidraw-element.js.map +1 -0
- package/dist/src/components/plate/components/fixed-toolbar-buttons.d.ts +1 -0
- package/dist/src/components/plate/components/fixed-toolbar-buttons.js +25 -0
- package/dist/src/components/plate/components/fixed-toolbar-buttons.js.map +1 -0
- package/dist/src/components/plate/components/fixed-toolbar.d.ts +1 -0
- package/dist/src/components/plate/components/fixed-toolbar.js +4 -0
- package/dist/src/components/plate/components/fixed-toolbar.js.map +1 -0
- package/dist/src/components/plate/components/heading-element.d.ts +24 -0
- package/dist/src/components/plate/components/heading-element.js +30 -0
- package/dist/src/components/plate/components/heading-element.js.map +1 -0
- package/dist/src/components/plate/components/highlight-leaf.d.ts +19 -0
- package/dist/src/components/plate/components/highlight-leaf.js +5 -0
- package/dist/src/components/plate/components/highlight-leaf.js.map +1 -0
- package/dist/src/components/plate/components/hr-element.d.ts +21 -0
- package/dist/src/components/plate/components/hr-element.js +11 -0
- package/dist/src/components/plate/components/hr-element.js.map +1 -0
- package/dist/src/components/plate/components/image-element.d.ts +21 -0
- package/dist/src/components/plate/components/image-element.js +19 -0
- package/dist/src/components/plate/components/image-element.js.map +1 -0
- package/dist/src/components/plate/components/indent-list-toolbar-button.d.ts +18 -0
- package/dist/src/components/plate/components/indent-list-toolbar-button.js +12 -0
- package/dist/src/components/plate/components/indent-list-toolbar-button.js.map +1 -0
- package/dist/src/components/plate/components/indent-todo-marker-component.d.ts +3 -0
- package/dist/src/components/plate/components/indent-todo-marker-component.js +14 -0
- package/dist/src/components/plate/components/indent-todo-marker-component.js.map +1 -0
- package/dist/src/components/plate/components/indent-todo-toolbar-button.d.ts +15 -0
- package/dist/src/components/plate/components/indent-todo-toolbar-button.js +11 -0
- package/dist/src/components/plate/components/indent-todo-toolbar-button.js.map +1 -0
- package/dist/src/components/plate/components/indent-toolbar-button.d.ts +15 -0
- package/dist/src/components/plate/components/indent-toolbar-button.js +10 -0
- package/dist/src/components/plate/components/indent-toolbar-button.js.map +1 -0
- package/dist/src/components/plate/components/inline-combobox.d.ts +29 -0
- package/dist/src/components/plate/components/inline-combobox.js +156 -0
- package/dist/src/components/plate/components/inline-combobox.js.map +1 -0
- package/dist/src/components/plate/components/input.d.ts +8 -0
- package/dist/src/components/plate/components/input.js +20 -0
- package/dist/src/components/plate/components/input.js.map +1 -0
- package/dist/src/components/plate/components/insert-dropdown-menu.d.ts +12 -0
- package/dist/src/components/plate/components/insert-dropdown-menu.js +179 -0
- package/dist/src/components/plate/components/insert-dropdown-menu.js.map +1 -0
- package/dist/src/components/plate/components/kbd-leaf.d.ts +19 -0
- package/dist/src/components/plate/components/kbd-leaf.js +5 -0
- package/dist/src/components/plate/components/kbd-leaf.js.map +1 -0
- package/dist/src/components/plate/components/line-height-dropdown-menu.d.ts +2 -0
- package/dist/src/components/plate/components/line-height-dropdown-menu.js +12 -0
- package/dist/src/components/plate/components/line-height-dropdown-menu.js.map +1 -0
- package/dist/src/components/plate/components/link-element.d.ts +21 -0
- package/dist/src/components/plate/components/link-element.js +10 -0
- package/dist/src/components/plate/components/link-element.js.map +1 -0
- package/dist/src/components/plate/components/link-floating-toolbar.d.ts +5 -0
- package/dist/src/components/plate/components/link-floating-toolbar.js +54 -0
- package/dist/src/components/plate/components/link-floating-toolbar.js.map +1 -0
- package/dist/src/components/plate/components/link-toolbar-button.d.ts +15 -0
- package/dist/src/components/plate/components/link-toolbar-button.js +11 -0
- package/dist/src/components/plate/components/link-toolbar-button.js.map +1 -0
- package/dist/src/components/plate/components/mark-toolbar-button.d.ts +18 -0
- package/dist/src/components/plate/components/mark-toolbar-button.js +11 -0
- package/dist/src/components/plate/components/mark-toolbar-button.js.map +1 -0
- package/dist/src/components/plate/components/media-embed-element.d.ts +21 -0
- package/dist/src/components/plate/components/media-embed-element.js +23 -0
- package/dist/src/components/plate/components/media-embed-element.js.map +1 -0
- package/dist/src/components/plate/components/media-popover.d.ts +7 -0
- package/dist/src/components/plate/components/media-popover.js +30 -0
- package/dist/src/components/plate/components/media-popover.js.map +1 -0
- package/dist/src/components/plate/components/mention-element.d.ts +26 -0
- package/dist/src/components/plate/components/mention-element.js +12 -0
- package/dist/src/components/plate/components/mention-element.js.map +1 -0
- package/dist/src/components/plate/components/mention-input-element.d.ts +25 -0
- package/dist/src/components/plate/components/mention-input-element.js +89 -0
- package/dist/src/components/plate/components/mention-input-element.js.map +1 -0
- package/dist/src/components/plate/components/outdent-toolbar-button.d.ts +15 -0
- package/dist/src/components/plate/components/outdent-toolbar-button.js +10 -0
- package/dist/src/components/plate/components/outdent-toolbar-button.js.map +1 -0
- package/dist/src/components/plate/components/paragraph-element.d.ts +20 -0
- package/dist/src/components/plate/components/paragraph-element.js +4 -0
- package/dist/src/components/plate/components/paragraph-element.js.map +1 -0
- package/dist/src/components/plate/components/placeholder.d.ts +6 -0
- package/dist/src/components/plate/components/placeholder.js +37 -0
- package/dist/src/components/plate/components/placeholder.js.map +1 -0
- package/dist/src/components/plate/components/popover.d.ts +7 -0
- package/dist/src/components/plate/components/popover.js +11 -0
- package/dist/src/components/plate/components/popover.js.map +1 -0
- package/dist/src/components/plate/components/resizable.d.ts +40 -0
- package/dist/src/components/plate/components/resizable.js +38 -0
- package/dist/src/components/plate/components/resizable.js.map +1 -0
- package/dist/src/components/plate/components/separator.d.ts +4 -0
- package/dist/src/components/plate/components/separator.js +20 -0
- package/dist/src/components/plate/components/separator.js.map +1 -0
- package/dist/src/components/plate/components/slash-input-element.d.ts +22 -0
- package/dist/src/components/plate/components/slash-input-element.js +64 -0
- package/dist/src/components/plate/components/slash-input-element.js.map +1 -0
- package/dist/src/components/plate/components/table-cell-element.d.ts +47 -0
- package/dist/src/components/plate/components/table-cell-element.js +35 -0
- package/dist/src/components/plate/components/table-cell-element.js.map +1 -0
- package/dist/src/components/plate/components/table-element.d.ts +24 -0
- package/dist/src/components/plate/components/table-element.js +46 -0
- package/dist/src/components/plate/components/table-element.js.map +1 -0
- package/dist/src/components/plate/components/table-row-element.d.ts +23 -0
- package/dist/src/components/plate/components/table-row-element.js +7 -0
- package/dist/src/components/plate/components/table-row-element.js.map +1 -0
- package/dist/src/components/plate/components/todo-list-element.d.ts +21 -0
- package/dist/src/components/plate/components/todo-list-element.js +12 -0
- package/dist/src/components/plate/components/todo-list-element.js.map +1 -0
- package/dist/src/components/plate/components/toolbar.d.ts +29 -0
- package/dist/src/components/plate/components/toolbar.js +51 -0
- package/dist/src/components/plate/components/toolbar.js.map +1 -0
- package/dist/src/components/plate/components/tooltip.d.ts +12 -0
- package/dist/src/components/plate/components/tooltip.js +26 -0
- package/dist/src/components/plate/components/tooltip.js.map +1 -0
- package/dist/src/components/plate/components/turn-into-dropdown-menu.d.ts +2 -0
- package/dist/src/components/plate/components/turn-into-dropdown-menu.js +93 -0
- package/dist/src/components/plate/components/turn-into-dropdown-menu.js.map +1 -0
- package/dist/src/components/plate/icons.d.ts +85 -0
- package/dist/src/components/plate/icons.js +101 -0
- package/dist/src/components/plate/icons.js.map +1 -0
- package/dist/src/components/plate/lib/autoformat-rules.d.ts +10 -0
- package/dist/src/components/plate/lib/autoformat-rules.js +271 -0
- package/dist/src/components/plate/lib/autoformat-rules.js.map +1 -0
- package/dist/src/components/plate/usePlateEditor.d.ts +4 -0
- package/dist/src/components/plate/usePlateEditor.js +384 -0
- package/dist/src/components/plate/usePlateEditor.js.map +1 -0
- package/dist/src/components/states/error/index.d.ts +5 -0
- package/dist/src/components/states/error/index.js +15 -0
- package/dist/src/components/states/error/index.js.map +1 -0
- package/dist/src/context/FormData.d.ts +33 -0
- package/dist/src/context/FormData.js +109 -0
- package/dist/src/context/FormData.js.map +1 -0
- package/dist/src/hooks/useDependent/enhanced/useInputDependent/useInputDependent.d.ts +12 -0
- package/dist/src/hooks/useDependent/enhanced/useInputDependent/useInputDependent.js +36 -0
- package/dist/src/hooks/useDependent/enhanced/useInputDependent/useInputDependent.js.map +1 -0
- package/dist/src/hooks/useDependent/enhanced/useOptionsGenerator/useOptionsGenerator.d.ts +15 -0
- package/dist/src/hooks/useDependent/enhanced/useOptionsGenerator/useOptionsGenerator.js +16 -0
- package/dist/src/hooks/useDependent/enhanced/useOptionsGenerator/useOptionsGenerator.js.map +1 -0
- package/dist/src/hooks/useDependent/useDependent.d.ts +11 -0
- package/dist/src/hooks/useDependent/useDependent.js +86 -0
- package/dist/src/hooks/useDependent/useDependent.js.map +1 -0
- package/dist/src/hooks/useValueGenerator/useValueGenerator.d.ts +18 -0
- package/dist/src/hooks/useValueGenerator/useValueGenerator.js +99 -0
- package/dist/src/hooks/useValueGenerator/useValueGenerator.js.map +1 -0
- package/dist/src/index.d.ts +18 -0
- package/dist/src/index.js +19 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/styles/Hidden.styles.d.ts +7 -0
- package/dist/src/styles/Hidden.styles.js +16 -0
- package/dist/src/styles/Hidden.styles.js.map +1 -0
- package/dist/src/styles/Skeleton.d.ts +7 -0
- package/dist/src/styles/Skeleton.js +40 -0
- package/dist/src/styles/Skeleton.js.map +1 -0
- package/dist/src/styles/Textfield.styles.d.ts +5 -0
- package/dist/src/styles/Textfield.styles.js +34 -0
- package/dist/src/styles/Textfield.styles.js.map +1 -0
- package/dist/src/testutils.d.ts +14 -0
- package/dist/src/testutils.js +22 -0
- package/dist/src/testutils.js.map +1 -0
- package/dist/src/types/controlProps.d.ts +70 -0
- package/dist/src/types/controlProps.js +2 -0
- package/dist/src/types/controlProps.js.map +1 -0
- package/dist/src/types/index.d.ts +166 -0
- package/dist/src/types/index.js +2 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/ui/menu/hooks/useMenu.d.ts +13 -0
- package/dist/src/ui/menu/hooks/useMenu.js +41 -0
- package/dist/src/ui/menu/hooks/useMenu.js.map +1 -0
- package/dist/src/ui/menu/index.d.ts +13 -0
- package/dist/src/ui/menu/index.js +13 -0
- package/dist/src/ui/menu/index.js.map +1 -0
- package/dist/src/ui/menu/test/createControl.d.ts +15 -0
- package/dist/src/ui/menu/test/createControl.js +30 -0
- package/dist/src/ui/menu/test/createControl.js.map +1 -0
- package/dist/src/ui/menu/utils/detemineSubmenuTabs/index.d.ts +14 -0
- package/dist/src/ui/menu/utils/detemineSubmenuTabs/index.js +82 -0
- package/dist/src/ui/menu/utils/detemineSubmenuTabs/index.js.map +1 -0
- package/dist/src/ui-helper/HeaderCollapseButton/index.d.ts +7 -0
- package/dist/src/ui-helper/HeaderCollapseButton/index.js +9 -0
- package/dist/src/ui-helper/HeaderCollapseButton/index.js.map +1 -0
- package/dist/src/ui-helper/notifications/Error.d.ts +6 -0
- package/dist/src/ui-helper/notifications/Error.js +77 -0
- package/dist/src/ui-helper/notifications/Error.js.map +1 -0
- package/dist/src/ui-helper/notifications/images/background.d.ts +2 -0
- package/dist/src/ui-helper/notifications/images/background.js +7 -0
- package/dist/src/ui-helper/notifications/images/background.js.map +1 -0
- package/dist/src/ui-helper/notifications/images/spinner.d.ts +2 -0
- package/dist/src/ui-helper/notifications/images/spinner.js +6 -0
- package/dist/src/ui-helper/notifications/images/spinner.js.map +1 -0
- package/dist/src/ui-helper/notifications/images/under-improvement.d.ts +2 -0
- package/dist/src/ui-helper/notifications/images/under-improvement.js +6 -0
- package/dist/src/ui-helper/notifications/images/under-improvement.js.map +1 -0
- package/dist/src/utils/findFormControlError/index.d.ts +4 -0
- package/dist/src/utils/findFormControlError/index.js +24 -0
- package/dist/src/utils/findFormControlError/index.js.map +1 -0
- package/dist/src/utils/hasGroupRequiredFieldsWithValues/index.d.ts +6 -0
- package/dist/src/utils/hasGroupRequiredFieldsWithValues/index.js +22 -0
- package/dist/src/utils/hasGroupRequiredFieldsWithValues/index.js.map +1 -0
- package/dist/styles/formControl.module.scss +59 -0
- package/dist/tailwind.config.d.ts +1 -0
- package/dist/tailwind.config.js +17 -0
- package/dist/tailwind.config.js.map +1 -0
- package/dist/webpack.common.d.ts +63 -0
- package/dist/webpack.common.js +76 -0
- package/dist/webpack.common.js.map +1 -0
- package/dist/webpack.dev.d.ts +65 -0
- package/dist/webpack.dev.js +11 -0
- package/dist/webpack.dev.js.map +1 -0
- package/dist/webpack.prod.d.ts +65 -0
- package/dist/webpack.prod.js +10 -0
- package/dist/webpack.prod.js.map +1 -0
- package/package.json +39 -2
- package/dist/formbuilder.js +0 -521
- package/dist/formbuilder.js.LICENSE.txt +0 -60
- package/dist/formbuilder.js.map +0 -1
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { BlockquotePlugin } from "@udecode/plate-block-quote/react";
|
|
3
|
+
import { insertEmptyElement } from "@udecode/plate-common";
|
|
4
|
+
import { focusEditor, ParagraphPlugin, useEditorRef, } from "@udecode/plate-common/react";
|
|
5
|
+
import { HEADING_KEYS } from "@udecode/plate-heading";
|
|
6
|
+
import { HorizontalRulePlugin } from "@udecode/plate-horizontal-rule/react";
|
|
7
|
+
import { TodoListPlugin } from "@udecode/plate-list/react";
|
|
8
|
+
import { TablePlugin } from "@udecode/plate-table/react";
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { Icons } from "../icons";
|
|
11
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, useOpenState, } from "./dropdown-menu";
|
|
12
|
+
import { ToolbarButton } from "./toolbar";
|
|
13
|
+
export const insertItems = [
|
|
14
|
+
{
|
|
15
|
+
items: [
|
|
16
|
+
{
|
|
17
|
+
description: "Paragraph",
|
|
18
|
+
icon: Icons.paragraph,
|
|
19
|
+
label: "Paragraph",
|
|
20
|
+
value: ParagraphPlugin.key,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
description: "Heading 1",
|
|
24
|
+
icon: Icons.h1,
|
|
25
|
+
label: "Heading 1",
|
|
26
|
+
value: HEADING_KEYS.h1,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
description: "Heading 2",
|
|
30
|
+
icon: Icons.h2,
|
|
31
|
+
label: "Heading 2",
|
|
32
|
+
value: HEADING_KEYS.h2,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
description: "Heading 3",
|
|
36
|
+
icon: Icons.h3,
|
|
37
|
+
label: "Heading 3",
|
|
38
|
+
value: HEADING_KEYS.h3,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
description: "Quote (⌘+⇧+.)",
|
|
42
|
+
icon: Icons.blockquote,
|
|
43
|
+
label: "Quote",
|
|
44
|
+
value: BlockquotePlugin.key,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
value: TablePlugin.key,
|
|
48
|
+
label: "Table",
|
|
49
|
+
description: "Table",
|
|
50
|
+
icon: Icons.table,
|
|
51
|
+
},
|
|
52
|
+
// {
|
|
53
|
+
// value: BulletedListPlugin.key,
|
|
54
|
+
// label: "Bulleted list",
|
|
55
|
+
// description: "Bulleted list",
|
|
56
|
+
// icon: Icons.ul,
|
|
57
|
+
// },
|
|
58
|
+
// {
|
|
59
|
+
// value: NumberedListPlugin.key,
|
|
60
|
+
// label: "Numbered list",
|
|
61
|
+
// description: "Numbered list",
|
|
62
|
+
// icon: Icons.ol,
|
|
63
|
+
// },
|
|
64
|
+
{
|
|
65
|
+
value: TodoListPlugin.key,
|
|
66
|
+
label: "Todo list",
|
|
67
|
+
description: "Todo list",
|
|
68
|
+
icon: Icons.todo,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
value: HorizontalRulePlugin.key,
|
|
72
|
+
label: "Divider",
|
|
73
|
+
description: "Divider (---)",
|
|
74
|
+
icon: Icons.hr,
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
label: "Basic blocks",
|
|
78
|
+
},
|
|
79
|
+
// {
|
|
80
|
+
// label: 'Media',
|
|
81
|
+
// items: [
|
|
82
|
+
// {
|
|
83
|
+
// value: CodeBlockPlugin.key,
|
|
84
|
+
// label: 'Code',
|
|
85
|
+
// description: 'Code (```)',
|
|
86
|
+
// icon: Icons.codeblock,
|
|
87
|
+
// },
|
|
88
|
+
// {
|
|
89
|
+
// value: ImagePlugin.key,
|
|
90
|
+
// label: 'Image',
|
|
91
|
+
// description: 'Image',
|
|
92
|
+
// icon: Icons.image,
|
|
93
|
+
// },
|
|
94
|
+
// {
|
|
95
|
+
// value: MediaEmbedPlugin.key,
|
|
96
|
+
// label: 'Embed',
|
|
97
|
+
// description: 'Embed',
|
|
98
|
+
// icon: Icons.embed,
|
|
99
|
+
// },
|
|
100
|
+
// {
|
|
101
|
+
// value: ExcalidrawPlugin.key,
|
|
102
|
+
// label: 'Excalidraw',
|
|
103
|
+
// description: 'Excalidraw',
|
|
104
|
+
// icon: Icons.excalidraw,
|
|
105
|
+
// },
|
|
106
|
+
// ],
|
|
107
|
+
// },
|
|
108
|
+
// {
|
|
109
|
+
// label: 'Inline',
|
|
110
|
+
// items: [
|
|
111
|
+
// {
|
|
112
|
+
// value: LinkPlugin.key,
|
|
113
|
+
// label: 'Link',
|
|
114
|
+
// description: 'Link',
|
|
115
|
+
// icon: Icons.link,
|
|
116
|
+
// },
|
|
117
|
+
// ],
|
|
118
|
+
// },
|
|
119
|
+
];
|
|
120
|
+
export function InsertDropdownMenu(props) {
|
|
121
|
+
const editor = useEditorRef();
|
|
122
|
+
const openState = useOpenState();
|
|
123
|
+
return (_jsxs(DropdownMenu, { modal: false, ...openState, ...props, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(ToolbarButton, { isDropdown: true, pressed: openState.open, tooltip: "Insert", children: _jsx(Icons.add, {}) }) }), _jsx(DropdownMenuContent, { align: "start", className: "flex max-h-[500px] min-w-0 flex-col gap-0.5 overflow-y-auto bg-white", children: insertItems.map(({ items: nestedItems, label }, index) => (_jsxs(React.Fragment, { children: [index !== 0 && _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuLabel, { children: label }), nestedItems.map(({ icon: Icon, label: itemLabel, value: type }) => (_jsxs(DropdownMenuItem, { className: "min-w-[180px]", onSelect: () => {
|
|
124
|
+
switch (type) {
|
|
125
|
+
// case CodeBlockPlugin.key: {
|
|
126
|
+
// insertEmptyCodeBlock(editor);
|
|
127
|
+
//
|
|
128
|
+
// break;
|
|
129
|
+
// }
|
|
130
|
+
// case ImagePlugin.key: {
|
|
131
|
+
// await insertMedia(editor, { type: ImagePlugin.key });
|
|
132
|
+
//
|
|
133
|
+
// break;
|
|
134
|
+
// }
|
|
135
|
+
// case MediaEmbedPlugin.key: {
|
|
136
|
+
// await insertMedia(editor, {
|
|
137
|
+
// type: MediaEmbedPlugin.key,
|
|
138
|
+
// });
|
|
139
|
+
//
|
|
140
|
+
// break;
|
|
141
|
+
// }
|
|
142
|
+
// case 'ul':
|
|
143
|
+
// case 'ol': {
|
|
144
|
+
// insertEmptyElement(editor, ParagraphPlugin.key, {
|
|
145
|
+
// select: true,
|
|
146
|
+
// nextBlock: true,
|
|
147
|
+
// });
|
|
148
|
+
//
|
|
149
|
+
// if (settingsStore.get.checkedId(IndentListPlugin.key)) {
|
|
150
|
+
// toggleIndentList(editor, {
|
|
151
|
+
// listStyleType: type === 'ul' ? 'disc' : 'decimal',
|
|
152
|
+
// });
|
|
153
|
+
// } else if (settingsStore.get.checkedId('list')) {
|
|
154
|
+
// toggleList(editor, { type });
|
|
155
|
+
// }
|
|
156
|
+
//
|
|
157
|
+
// break;
|
|
158
|
+
// }
|
|
159
|
+
// case TablePlugin.key: {
|
|
160
|
+
// insertTable(editor);
|
|
161
|
+
//
|
|
162
|
+
// break;
|
|
163
|
+
// }
|
|
164
|
+
// case LinkPlugin.key: {
|
|
165
|
+
// triggerFloatingLink(editor, { focused: true });
|
|
166
|
+
//
|
|
167
|
+
// break;
|
|
168
|
+
// }
|
|
169
|
+
default: {
|
|
170
|
+
insertEmptyElement(editor, type, {
|
|
171
|
+
nextBlock: true,
|
|
172
|
+
select: true,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
focusEditor(editor);
|
|
177
|
+
}, children: [_jsx(Icon, { className: "mr-2 size-5" }), itemLabel] }, type)))] }, label))) })] }));
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=insert-dropdown-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insert-dropdown-menu.js","sourceRoot":"","sources":["../../../../../src/components/plate/components/insert-dropdown-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,WAAW,EACX,eAAe,EACf,YAAY,GACb,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,GACb,MAAM,iBAAiB,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,IAAI,IAAC,SAAS,EAAC,aAAa,GAAG,EAC/B,SAAS,KA3DL,IAAI,CA4DQ,CACpB,CACF,KAtEkB,KAAK,CAuET,CAClB,CAAC,GACkB,IACT,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const KbdLeaf: React.ForwardRefExoticComponent<Omit<{
|
|
3
|
+
leafToAttributes?: (leaf: import("@udecode/plate-common").TText) => any;
|
|
4
|
+
} & import("@udecode/plate-common").BasePluginContext<import("@udecode/plate-common/react").AnyPlatePlugin> & {
|
|
5
|
+
useOption: {
|
|
6
|
+
<K extends string | number | symbol, F extends any, Args extends Parameters<F & ((...args: any[]) => any)>>(optionKey: K, ...args: Args): F extends (...args: any[]) => any ? ReturnType<F> : F;
|
|
7
|
+
<K extends string | number | symbol, F extends any>(optionKey: K): F extends (...args: any[]) => any ? never : F;
|
|
8
|
+
};
|
|
9
|
+
editor: import("@udecode/plate-common/react").PlateEditor;
|
|
10
|
+
plugin: import("@udecode/plate-common/react").EditorPlatePlugin<import("@udecode/plate-common/react").AnyPlatePlugin>;
|
|
11
|
+
} & {
|
|
12
|
+
className?: string;
|
|
13
|
+
nodeProps?: import("@udecode/plate-common").AnyObject;
|
|
14
|
+
} & import("@udecode/slate-react").TRenderLeafProps<import("@udecode/plate-common").TText> & Omit<{
|
|
15
|
+
as?: React.ElementType;
|
|
16
|
+
asChild?: boolean;
|
|
17
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
18
|
+
ref?: React.Ref<any>;
|
|
19
|
+
} & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<never>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn, withRef } from "@udecode/cn";
|
|
3
|
+
import { PlateLeaf } from "@udecode/plate-common/react";
|
|
4
|
+
export const KbdLeaf = withRef(({ children, className, ...props }, ref) => (_jsx(PlateLeaf, { asChild: true, className: cn("rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-sm shadow-[rgba(255,_255,_255,_0.1)_0px_0.5px_0px_0px_inset,_rgb(248,_249,_250)_0px_1px_5px_0px_inset,_rgb(193,_200,_205)_0px_0px_0px_0.5px,_rgb(193,_200,_205)_0px_2px_1px_-1px,_rgb(193,_200,_205)_0px_1px_0px_0px] dark:shadow-[rgba(255,_255,_255,_0.1)_0px_0.5px_0px_0px_inset,_rgb(26,_29,_30)_0px_1px_5px_0px_inset,_rgb(76,_81,_85)_0px_0px_0px_0.5px,_rgb(76,_81,_85)_0px_2px_1px_-1px,_rgb(76,_81,_85)_0px_1px_0px_0px]", className), ref: ref, ...props, children: _jsx("kbd", { children: children }) })));
|
|
5
|
+
//# sourceMappingURL=kbd-leaf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kbd-leaf.js","sourceRoot":"","sources":["../../../../../src/components/plate/components/kbd-leaf.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAC5B,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC1C,KAAC,SAAS,IACR,OAAO,QACP,SAAS,EAAE,EAAE,CACX,seAAse,EACte,SAAS,CACV,EACD,GAAG,EAAE,GAAG,KACJ,KAAK,YAET,wBAAM,QAAQ,GAAO,GACX,CACb,CACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useLineHeightDropdownMenu, useLineHeightDropdownMenuState, } from "@udecode/plate-line-height/react";
|
|
3
|
+
import { Icons } from "../icons";
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger, useOpenState, } from "./dropdown-menu";
|
|
5
|
+
import { ToolbarButton } from "./toolbar";
|
|
6
|
+
export function LineHeightDropdownMenu({ ...props }) {
|
|
7
|
+
const openState = useOpenState();
|
|
8
|
+
const state = useLineHeightDropdownMenuState();
|
|
9
|
+
const { radioGroupProps } = useLineHeightDropdownMenu(state);
|
|
10
|
+
return (_jsxs(DropdownMenu, { modal: false, ...openState, ...props, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(ToolbarButton, { isDropdown: true, pressed: openState.open, tooltip: "Line height", children: _jsx(Icons.lineHeight, {}) }) }), _jsx(DropdownMenuContent, { align: "start", className: "min-w-0", children: _jsx(DropdownMenuRadioGroup, { className: "flex flex-col gap-0.5", ...radioGroupProps, children: state.values.map((_value) => (_jsx(DropdownMenuRadioItem, { className: "min-w-[180px]", value: _value, children: _value }, _value))) }) })] }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=line-height-dropdown-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-height-dropdown-menu.js","sourceRoot":"","sources":["../../../../../src/components/plate/components/line-height-dropdown-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,yBAAyB,EACzB,8BAA8B,GAC/B,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAI1C,MAAM,UAAU,sBAAsB,CAAC,EAAE,GAAG,KAAK,EAAqB;IACpE,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,8BAA8B,EAAE,CAAC;IAC/C,MAAM,EAAE,eAAe,EAAE,GAAG,yBAAyB,CAAC,KAAK,CAAC,CAAC;IAE7D,OAAO,CACL,MAAC,YAAY,IAAC,KAAK,EAAE,KAAK,KAAM,SAAS,KAAM,KAAK,aAClD,KAAC,mBAAmB,IAAC,OAAO,kBAC1B,KAAC,aAAa,IACZ,UAAU,QACV,OAAO,EAAE,SAAS,CAAC,IAAI,EACvB,OAAO,EAAC,aAAa,YAErB,KAAC,KAAK,CAAC,UAAU,KAAG,GACN,GACI,EAEtB,KAAC,mBAAmB,IAAC,KAAK,EAAC,OAAO,EAAC,SAAS,EAAC,SAAS,YACpD,KAAC,sBAAsB,IACrB,SAAS,EAAC,uBAAuB,KAC7B,eAAe,YAElB,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC5B,KAAC,qBAAqB,IACpB,SAAS,EAAC,eAAe,EAEzB,KAAK,EAAE,MAAM,YAEZ,MAAM,IAHF,MAAM,CAIW,CACzB,CAAC,GACqB,GACL,IACT,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const LinkElement: React.ForwardRefExoticComponent<Omit<{
|
|
3
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
4
|
+
} & Omit<{
|
|
5
|
+
as?: React.ElementType;
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
8
|
+
ref?: React.Ref<any>;
|
|
9
|
+
} & import("@udecode/plate-common").BasePluginContext<import("@udecode/plate-common/react").AnyPlatePlugin> & {
|
|
10
|
+
useOption: {
|
|
11
|
+
<K extends string | number | symbol, F extends any, Args extends Parameters<F & ((...args: any[]) => any)>>(optionKey: K, ...args: Args): F extends (...args: any[]) => any ? ReturnType<F> : F;
|
|
12
|
+
<K extends string | number | symbol, F extends any>(optionKey: K): F extends (...args: any[]) => any ? never : F;
|
|
13
|
+
};
|
|
14
|
+
editor: import("@udecode/plate-common/react").PlateEditor;
|
|
15
|
+
plugin: import("@udecode/plate-common/react").EditorPlatePlugin<import("@udecode/plate-common/react").AnyPlatePlugin>;
|
|
16
|
+
} & {
|
|
17
|
+
className?: string;
|
|
18
|
+
nodeProps?: import("@udecode/plate-common").AnyObject;
|
|
19
|
+
} & import("@udecode/slate-react").TRenderElementProps<import("@udecode/plate-common").TElement> & {
|
|
20
|
+
path: import("slate").Path;
|
|
21
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<never>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn, withRef } from "@udecode/cn";
|
|
3
|
+
import { PlateElement, useElement } from "@udecode/plate-common/react";
|
|
4
|
+
import { useLink } from "@udecode/plate-link/react";
|
|
5
|
+
export const LinkElement = withRef(({ children, className, ...props }, ref) => {
|
|
6
|
+
const element = useElement();
|
|
7
|
+
const { props: linkProps } = useLink({ element });
|
|
8
|
+
return (_jsx(PlateElement, { asChild: true, className: cn("font-medium text-primary underline decoration-primary underline-offset-4", className), ref: ref, ...linkProps, ...props, children: _jsx("a", { children: children }) }));
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=link-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-element.js","sourceRoot":"","sources":["../../../../../src/components/plate/components/link-element.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAIpD,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAChC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACzC,MAAM,OAAO,GAAG,UAAU,EAAgB,CAAC;IAC3C,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAElD,OAAO,CACL,KAAC,YAAY,IACX,OAAO,QACP,SAAS,EAAE,EAAE,CACX,0EAA0E,EAC1E,SAAS,CACV,EACD,GAAG,EAAE,GAAG,KACH,SAAiB,KAClB,KAAK,YAET,sBAAI,QAAQ,GAAK,GACJ,CAChB,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LinkFloatingToolbarState } from "@udecode/plate-link/react";
|
|
2
|
+
export interface LinkFloatingToolbarProps {
|
|
3
|
+
state?: LinkFloatingToolbarState;
|
|
4
|
+
}
|
|
5
|
+
export declare function LinkFloatingToolbar({ state }: LinkFloatingToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@udecode/cn";
|
|
4
|
+
import { useFormInputProps } from "@udecode/plate-common/react";
|
|
5
|
+
import { flip, offset } from "@udecode/plate-floating";
|
|
6
|
+
import { FloatingLinkUrlInput, LinkOpenButton, useFloatingLinkEdit, useFloatingLinkEditState, useFloatingLinkInsert, useFloatingLinkInsertState, } from "@udecode/plate-link/react";
|
|
7
|
+
import { Icons } from "../icons";
|
|
8
|
+
import { buttonVariants } from "./button";
|
|
9
|
+
import { inputVariants } from "./input";
|
|
10
|
+
import { popoverVariants } from "./popover";
|
|
11
|
+
import { Separator } from "./separator";
|
|
12
|
+
const floatingOptions = {
|
|
13
|
+
middleware: [
|
|
14
|
+
offset(12),
|
|
15
|
+
flip({
|
|
16
|
+
fallbackPlacements: ["bottom-end", "top-start", "top-end"],
|
|
17
|
+
padding: 12,
|
|
18
|
+
}),
|
|
19
|
+
],
|
|
20
|
+
placement: "bottom-start",
|
|
21
|
+
};
|
|
22
|
+
export function LinkFloatingToolbar({ state }) {
|
|
23
|
+
const insertState = useFloatingLinkInsertState({
|
|
24
|
+
...state,
|
|
25
|
+
floatingOptions: {
|
|
26
|
+
...floatingOptions,
|
|
27
|
+
...state?.floatingOptions,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const { hidden, props: insertProps, ref: insertRef, textInputProps, } = useFloatingLinkInsert(insertState);
|
|
31
|
+
const editState = useFloatingLinkEditState({
|
|
32
|
+
...state,
|
|
33
|
+
floatingOptions: {
|
|
34
|
+
...floatingOptions,
|
|
35
|
+
...state?.floatingOptions,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
const { editButtonProps, props: editProps, ref: editRef, unlinkButtonProps, } = useFloatingLinkEdit(editState);
|
|
39
|
+
const inputProps = useFormInputProps({
|
|
40
|
+
preventDefaultOnEnterKeydown: true,
|
|
41
|
+
});
|
|
42
|
+
if (hidden)
|
|
43
|
+
return null;
|
|
44
|
+
const input = (_jsxs("div", { className: "flex w-[330px] flex-col bg-white", ...inputProps, children: [_jsxs("div", { className: "flex items-center", children: [_jsx("div", { className: "flex items-center pl-3 text-muted-foreground", children: _jsx(Icons.link, { className: "size-4" }) }), _jsx(FloatingLinkUrlInput, { className: inputVariants({ h: "sm", variant: "ghost" }), placeholder: "Paste link" })] }), _jsx(Separator, {}), _jsxs("div", { className: "flex items-center", children: [_jsx("div", { className: "flex items-center pl-3 text-muted-foreground", children: _jsx(Icons.text, { className: "size-4" }) }), _jsx("input", { className: inputVariants({ h: "sm", variant: "ghost" }), placeholder: "Text to display", ...textInputProps })] })] }));
|
|
45
|
+
const editContent = editState.isEditing ? (input) : (_jsxs("div", { className: "box-content flex items-center gap-1 h-9", children: [_jsx("button", { className: buttonVariants({ size: "sm", variant: "ghost" }), type: "button", ...editButtonProps, children: "Edit link" }), _jsx(Separator, { orientation: "vertical" }), _jsx(LinkOpenButton, { className: buttonVariants({
|
|
46
|
+
size: "sms",
|
|
47
|
+
variant: "ghost",
|
|
48
|
+
}), children: _jsx(Icons.externalLink, { width: 18 }) }), _jsx(Separator, { orientation: "vertical" }), _jsx("button", { className: buttonVariants({
|
|
49
|
+
size: "sms",
|
|
50
|
+
variant: "ghost",
|
|
51
|
+
}), type: "button", ...unlinkButtonProps, children: _jsx(Icons.unlink, { width: 18 }) })] }));
|
|
52
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: cn(popoverVariants(), "w-auto p-1"), ref: insertRef, ...insertProps, children: input }), _jsx("div", { className: cn(popoverVariants(), "w-auto p-1"), ref: editRef, ...editProps, children: editContent })] }));
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=link-floating-toolbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-floating-toolbar.js","sourceRoot":"","sources":["../../../../../src/components/plate/components/link-floating-toolbar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC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AE,EAAE,CAAC,eAAe,EAAE,EAAE,YAAY,CAAC,EAC9C,GAAG,EAAE,SAAS,KACV,WAAW,YAEd,KAAK,GACF,EAEN,cACE,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,EAAE,YAAY,CAAC,EAC9C,GAAG,EAAE,OAAO,KACR,SAAS,YAEZ,WAAW,GACR,IACL,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const LinkToolbarButton: React.ForwardRefExoticComponent<Omit<{
|
|
3
|
+
tooltip?: React.ReactNode;
|
|
4
|
+
tooltipContentProps?: Omit<React.ComponentPropsWithoutRef<React.ForwardRefExoticComponent<import("@radix-ui/react-tooltip").TooltipContentProps & React.RefAttributes<HTMLDivElement>>>, "children">;
|
|
5
|
+
tooltipProps?: Omit<React.ComponentPropsWithoutRef<React.FC<import("@radix-ui/react-tooltip").TooltipProps>>, "children">;
|
|
6
|
+
} & Omit<{
|
|
7
|
+
isDropdown?: boolean;
|
|
8
|
+
pressed?: boolean;
|
|
9
|
+
} & Omit<Omit<Omit<import("@radix-ui/react-toolbar").ToolbarToggleItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & import("class-variance-authority").VariantProps<(props?: {
|
|
10
|
+
size?: "default" | "sm" | "lg";
|
|
11
|
+
variant?: "outline" | "default";
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref">, "value" | "asChild"> & import("class-variance-authority").VariantProps<(props?: {
|
|
13
|
+
size?: "default" | "sm" | "lg";
|
|
14
|
+
variant?: "outline" | "default";
|
|
15
|
+
} & import("class-variance-authority/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { withRef } from "@udecode/cn";
|
|
3
|
+
import { useLinkToolbarButton, useLinkToolbarButtonState, } from "@udecode/plate-link/react";
|
|
4
|
+
import { Icons } from "../icons";
|
|
5
|
+
import { ToolbarButton } from "./toolbar";
|
|
6
|
+
export const LinkToolbarButton = withRef((rest, ref) => {
|
|
7
|
+
const state = useLinkToolbarButtonState();
|
|
8
|
+
const { props } = useLinkToolbarButton(state);
|
|
9
|
+
return (_jsx(ToolbarButton, { ref: ref, tooltip: "Link", ...props, ...rest, children: _jsx(Icons.link, {}) }));
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=link-toolbar-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-toolbar-button.js","sourceRoot":"","sources":["../../../../../src/components/plate/components/link-toolbar-button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EACL,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAuB,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IAC3E,MAAM,KAAK,GAAG,yBAAyB,EAAE,CAAC;IAC1C,MAAM,EAAE,KAAK,EAAE,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAE9C,OAAO,CACL,KAAC,aAAa,IAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAC,MAAM,KAAK,KAAK,KAAM,IAAI,YACzD,KAAC,KAAK,CAAC,IAAI,KAAG,GACA,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const MarkToolbarButton: React.ForwardRefExoticComponent<Omit<{
|
|
3
|
+
tooltip?: React.ReactNode;
|
|
4
|
+
tooltipContentProps?: Omit<React.ComponentPropsWithoutRef<React.ForwardRefExoticComponent<import("@radix-ui/react-tooltip").TooltipContentProps & React.RefAttributes<HTMLDivElement>>>, "children">;
|
|
5
|
+
tooltipProps?: Omit<React.ComponentPropsWithoutRef<React.FC<import("@radix-ui/react-tooltip").TooltipProps>>, "children">;
|
|
6
|
+
} & Omit<{
|
|
7
|
+
isDropdown?: boolean;
|
|
8
|
+
pressed?: boolean;
|
|
9
|
+
} & Omit<Omit<Omit<import("@radix-ui/react-toolbar").ToolbarToggleItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & import("class-variance-authority").VariantProps<(props?: {
|
|
10
|
+
size?: "default" | "sm" | "lg";
|
|
11
|
+
variant?: "outline" | "default";
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref">, "value" | "asChild"> & import("class-variance-authority").VariantProps<(props?: {
|
|
13
|
+
size?: "default" | "sm" | "lg";
|
|
14
|
+
variant?: "outline" | "default";
|
|
15
|
+
} & import("class-variance-authority/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
16
|
+
clear?: string | string[];
|
|
17
|
+
nodeType: string;
|
|
18
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { withRef } from "@udecode/cn";
|
|
4
|
+
import { useMarkToolbarButton, useMarkToolbarButtonState, } from "@udecode/plate-common/react";
|
|
5
|
+
import { ToolbarButton } from "./toolbar";
|
|
6
|
+
export const MarkToolbarButton = withRef(({ clear, nodeType, ...rest }, ref) => {
|
|
7
|
+
const state = useMarkToolbarButtonState({ clear, nodeType });
|
|
8
|
+
const { props } = useMarkToolbarButton(state);
|
|
9
|
+
return _jsx(ToolbarButton, { ref: ref, ...props, ...rest });
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=mark-toolbar-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mark-toolbar-button.js","sourceRoot":"","sources":["../../../../../src/components/plate/components/mark-toolbar-button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EACL,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAMtC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;IACtC,MAAM,KAAK,GAAG,yBAAyB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC7D,MAAM,EAAE,KAAK,EAAE,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAE9C,OAAO,KAAC,aAAa,IAAC,GAAG,EAAE,GAAG,KAAM,KAAK,KAAM,IAAI,GAAI,CAAC;AAC1D,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const MediaEmbedElement: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
3
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
4
|
+
} & Omit<{
|
|
5
|
+
as?: React.ElementType;
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
8
|
+
ref?: React.Ref<any>;
|
|
9
|
+
} & import("@udecode/plate-common").BasePluginContext<import("@udecode/plate-common/react").AnyPlatePlugin> & {
|
|
10
|
+
useOption: {
|
|
11
|
+
<K extends string | number | symbol, F extends any, Args extends Parameters<F & ((...args: any[]) => any)>>(optionKey: K, ...args: Args): F extends (...args: any[]) => any ? ReturnType<F> : F;
|
|
12
|
+
<K extends string | number | symbol, F extends any>(optionKey: K): F extends (...args: any[]) => any ? never : F;
|
|
13
|
+
};
|
|
14
|
+
editor: import("@udecode/plate-common/react").PlateEditor;
|
|
15
|
+
plugin: import("@udecode/plate-common/react").EditorPlatePlugin<import("@udecode/plate-common/react").AnyPlatePlugin>;
|
|
16
|
+
} & {
|
|
17
|
+
className?: string;
|
|
18
|
+
nodeProps?: import("@udecode/plate-common").AnyObject;
|
|
19
|
+
} & import("@udecode/slate-react").TRenderElementProps<import("@udecode/plate-common").TElement> & {
|
|
20
|
+
path: import("slate").Path;
|
|
21
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<never>, "ref"> & React.RefAttributes<unknown>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn, withRef } from "@udecode/cn";
|
|
3
|
+
import { PlateElement, withHOC } from "@udecode/plate-common/react";
|
|
4
|
+
import { parseTwitterUrl, parseVideoUrl } from "@udecode/plate-media";
|
|
5
|
+
import { MediaEmbedPlugin, useMediaState } from "@udecode/plate-media/react";
|
|
6
|
+
import { ResizableProvider, useResizableStore } from "@udecode/plate-resizable";
|
|
7
|
+
import LiteYouTubeEmbed from "react-lite-youtube-embed";
|
|
8
|
+
import { Caption, CaptionTextarea } from "./caption";
|
|
9
|
+
import { MediaPopover } from "./media-popover";
|
|
10
|
+
import { mediaResizeHandleVariants, Resizable, ResizeHandle, } from "./resizable";
|
|
11
|
+
export const MediaEmbedElement = withHOC(ResizableProvider, withRef(({ children, className, ...props }, ref) => {
|
|
12
|
+
const { align = "center", embed, focused, isTweet, isVideo, isYoutube, selected, } = useMediaState({
|
|
13
|
+
urlParsers: [parseTwitterUrl, parseVideoUrl],
|
|
14
|
+
});
|
|
15
|
+
const width = useResizableStore().get.width();
|
|
16
|
+
const provider = embed?.provider;
|
|
17
|
+
return (_jsx(MediaPopover, { plugin: MediaEmbedPlugin, children: _jsxs(PlateElement, { className: cn("relative py-2.5", className), ref: ref, ...props, children: [_jsxs("figure", { className: "relative w-full m-0 group", contentEditable: false, children: [_jsxs(Resizable, { align: align, options: {
|
|
18
|
+
align,
|
|
19
|
+
maxWidth: isTweet ? 550 : "100%",
|
|
20
|
+
minWidth: isTweet ? 300 : 100,
|
|
21
|
+
}, children: [_jsx(ResizeHandle, { className: mediaResizeHandleVariants({ direction: "left" }), options: { direction: "left" } }), isVideo ? (isYoutube ? (_jsx(LiteYouTubeEmbed, { id: embed.id, title: "youtube", wrapperClass: cn("rounded-sm", focused && selected && "ring-2 ring-ring ring-offset-2", "relative block cursor-pointer bg-black bg-cover bg-center [contain:content]", "[&.lyt-activated]:before:absolute [&.lyt-activated]:before:top-0 [&.lyt-activated]:before:h-[60px] [&.lyt-activated]:before:w-full [&.lyt-activated]:before:bg-top [&.lyt-activated]:before:bg-repeat-x [&.lyt-activated]:before:pb-[50px] [&.lyt-activated]:before:[transition:all_0.2s_cubic-bezier(0,_0,_0.2,_1)]", "[&.lyt-activated]:before:bg-[url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==)]", 'after:block after:pb-[var(--aspect-ratio)] after:content-[""]', "[&_>_iframe]:absolute [&_>_iframe]:left-0 [&_>_iframe]:top-0 [&_>_iframe]:size-full", "[&_>_.lty-playbtn]:z-[1] [&_>_.lty-playbtn]:h-[46px] [&_>_.lty-playbtn]:w-[70px] [&_>_.lty-playbtn]:rounded-[14%] [&_>_.lty-playbtn]:bg-[#212121] [&_>_.lty-playbtn]:opacity-80 [&_>_.lty-playbtn]:[transition:all_0.2s_cubic-bezier(0,_0,_0.2,_1)]", "[&:hover_>_.lty-playbtn]:bg-[red] [&:hover_>_.lty-playbtn]:opacity-100", '[&_>_.lty-playbtn]:before:border-y-[11px] [&_>_.lty-playbtn]:before:border-l-[19px] [&_>_.lty-playbtn]:before:border-r-0 [&_>_.lty-playbtn]:before:border-[transparent_transparent_transparent_#fff] [&_>_.lty-playbtn]:before:content-[""]', "[&_>_.lty-playbtn]:absolute [&_>_.lty-playbtn]:left-1/2 [&_>_.lty-playbtn]:top-1/2 [&_>_.lty-playbtn]:[transform:translate3d(-50%,-50%,0)]", "[&_>_.lty-playbtn]:before:absolute [&_>_.lty-playbtn]:before:left-1/2 [&_>_.lty-playbtn]:before:top-1/2 [&_>_.lty-playbtn]:before:[transform:translate3d(-50%,-50%,0)]", "[&.lyt-activated]:cursor-[unset]", "[&.lyt-activated]:before:pointer-events-none [&.lyt-activated]:before:opacity-0", "[&.lyt-activated_>_.lty-playbtn]:pointer-events-none [&.lyt-activated_>_.lty-playbtn]:!opacity-0") })) : (_jsx("div", { className: cn(provider === "vimeo" && "pb-[75%]", provider === "youku" && "pb-[56.25%]", provider === "dailymotion" && "pb-[56.0417%]", provider === "coub" && "pb-[51.25%]"), children: _jsx("iframe", { allowFullScreen: true, className: cn("absolute left-0 top-0 size-full rounded-sm", isVideo && "border-0", focused && selected && "ring-2 ring-ring ring-offset-2"), src: embed.url, title: "embed" }) }))) : null, _jsx(ResizeHandle, { className: mediaResizeHandleVariants({ direction: "right" }), options: { direction: "right" } })] }), _jsx(Caption, { align: align, style: { width }, children: _jsx(CaptionTextarea, { placeholder: "Write a caption..." }) })] }), children] }) }));
|
|
22
|
+
}));
|
|
23
|
+
//# sourceMappingURL=media-embed-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-embed-element.js","sourceRoot":"","sources":["../../../../../src/components/plate/components/media-embed-element.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAEhF,OAAO,gBAAgB,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EACL,yBAAyB,EACzB,SAAS,EACT,YAAY,GACb,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CACtC,iBAAiB,EACjB,OAAO,CAAsB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACtE,MAAM,EACJ,KAAK,GAAG,QAAQ,EAChB,KAAK,EACL,OAAO,EACP,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,GACT,GAAG,aAAa,CAAC;QAChB,UAAU,EAAE,CAAC,eAAe,EAAE,aAAa,CAAC;KAC7C,CAAC,CAAC;IACH,MAAM,KAAK,GAAG,iBAAiB,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;IAC9C,MAAM,QAAQ,GAAG,KAAK,EAAE,QAAQ,CAAC;IAEjC,OAAO,CACL,KAAC,YAAY,IAAC,MAAM,EAAE,gBAAgB,YACpC,MAAC,YAAY,IACX,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,SAAS,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,CAAC,GAAG,EACf,KAAK,EAAC,OAAO,GACb,GACE,CACP,CACF,CAAC,CAAC,CAAC,IAAI,EAER,KAAC,YAAY,IACX,SAAS,EAAE,yBAAyB,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAC5D,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,GAC/B,IACQ,EAEZ,KAAC,OAAO,IAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,YACrC,KAAC,eAAe,IAAC,WAAW,EAAC,oBAAoB,GAAG,GAC5C,IACH,EAER,QAAQ,IACI,GACF,CAChB,CAAC;AACJ,CAAC,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { WithRequiredKey } from "@udecode/plate-common";
|
|
3
|
+
export interface MediaPopoverProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
plugin: WithRequiredKey;
|
|
6
|
+
}
|
|
7
|
+
export declare function MediaPopover({ children, plugin }: MediaPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { isSelectionExpanded } from "@udecode/plate-common";
|
|
3
|
+
import { useEditorSelector, useElement, useRemoveNodeButton, } from "@udecode/plate-common/react";
|
|
4
|
+
import { floatingMediaActions, FloatingMedia as FloatingMediaPrimitive, useFloatingMediaSelectors, } from "@udecode/plate-media/react";
|
|
5
|
+
import { useEffect } from "react";
|
|
6
|
+
import { useReadOnly, useSelected } from "slate-react";
|
|
7
|
+
import { Icons } from "../icons";
|
|
8
|
+
import { Button, buttonVariants } from "./button";
|
|
9
|
+
import { CaptionButton } from "./caption";
|
|
10
|
+
import { inputVariants } from "./input";
|
|
11
|
+
import { Popover, PopoverAnchor, PopoverContent } from "./popover";
|
|
12
|
+
import { Separator } from "./separator";
|
|
13
|
+
export function MediaPopover({ children, plugin }) {
|
|
14
|
+
const readOnly = useReadOnly();
|
|
15
|
+
const selected = useSelected();
|
|
16
|
+
const selectionCollapsed = useEditorSelector((editor) => !isSelectionExpanded(editor), []);
|
|
17
|
+
const isOpen = !readOnly && selected && selectionCollapsed;
|
|
18
|
+
const isEditing = useFloatingMediaSelectors().isEditing();
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (!isOpen && isEditing) {
|
|
21
|
+
floatingMediaActions.isEditing(false);
|
|
22
|
+
}
|
|
23
|
+
}, [isOpen]);
|
|
24
|
+
const element = useElement();
|
|
25
|
+
const { props: buttonProps } = useRemoveNodeButton({ element });
|
|
26
|
+
if (readOnly)
|
|
27
|
+
return _jsx(_Fragment, { children: children });
|
|
28
|
+
return (_jsxs(Popover, { modal: false, open: isOpen, children: [_jsx(PopoverAnchor, { children: children }), _jsx(PopoverContent, { className: "w-auto p-1", onOpenAutoFocus: (e) => e.preventDefault(), children: isEditing ? (_jsx("div", { className: "flex w-[330px] flex-col", children: _jsxs("div", { className: "flex items-center", children: [_jsx("div", { className: "flex items-center pl-3 text-muted-foreground", children: _jsx(Icons.link, { className: "size-4" }) }), _jsx(FloatingMediaPrimitive.UrlInput, { className: inputVariants({ h: "sm", variant: "ghost" }), options: { plugin }, placeholder: "Paste the embed link..." })] }) })) : (_jsxs("div", { className: "box-content flex items-center gap-1 h-9", children: [_jsx(FloatingMediaPrimitive.EditButton, { className: buttonVariants({ size: "sm", variant: "ghost" }), children: "Edit link" }), _jsx(CaptionButton, { variant: "ghost", children: "Caption" }), _jsx(Separator, { className: "my-1", orientation: "vertical" }), _jsx(Button, { size: "sms", variant: "ghost", ...buttonProps, children: _jsx(Icons.delete, { className: "size-4" }) })] })) })] }));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=media-popover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-popover.js","sourceRoot":"","sources":["../../../../../src/components/plate/components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K,EAAC,OAAO,EAAC,OAAO,KAAK,WAAW,YAChD,KAAC,KAAK,CAAC,MAAM,IAAC,SAAS,EAAC,QAAQ,GAAG,GAC5B,IACL,CACP,GACc,IACT,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { TMentionElement } from "@udecode/plate-mention";
|
|
3
|
+
export declare const MentionElement: React.ForwardRefExoticComponent<Omit<{
|
|
4
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
5
|
+
} & Omit<{
|
|
6
|
+
as?: React.ElementType;
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
9
|
+
ref?: React.Ref<any>;
|
|
10
|
+
} & import("@udecode/plate-common").BasePluginContext<import("@udecode/plate-common/react").AnyPlatePlugin> & {
|
|
11
|
+
useOption: {
|
|
12
|
+
<K extends string | number | symbol, F extends any, Args extends Parameters<F & ((...args: any[]) => any)>>(optionKey: K, ...args: Args): F extends (...args: any[]) => any ? ReturnType<F> : F;
|
|
13
|
+
<K extends string | number | symbol, F extends any>(optionKey: K): F extends (...args: any[]) => any ? never : F;
|
|
14
|
+
};
|
|
15
|
+
editor: import("@udecode/plate-common/react").PlateEditor;
|
|
16
|
+
plugin: import("@udecode/plate-common/react").EditorPlatePlugin<import("@udecode/plate-common/react").AnyPlatePlugin>;
|
|
17
|
+
} & {
|
|
18
|
+
className?: string;
|
|
19
|
+
nodeProps?: import("@udecode/plate-common").AnyObject;
|
|
20
|
+
} & import("@udecode/slate-react").TRenderElementProps<import("@udecode/plate-common").TElement> & {
|
|
21
|
+
path: import("slate").Path;
|
|
22
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
23
|
+
onClick?: (mentionNode: any) => void;
|
|
24
|
+
prefix?: string;
|
|
25
|
+
renderLabel?: (mentionable: TMentionElement) => string;
|
|
26
|
+
} & React.RefAttributes<never>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn, withRef } from "@udecode/cn";
|
|
3
|
+
import { getHandler } from "@udecode/plate-common";
|
|
4
|
+
import { PlateElement, useElement } from "@udecode/plate-common/react";
|
|
5
|
+
import { useFocused, useSelected } from "slate-react";
|
|
6
|
+
export const MentionElement = withRef(({ children, className, onClick, prefix, renderLabel, ...props }, ref) => {
|
|
7
|
+
const element = useElement();
|
|
8
|
+
const selected = useSelected();
|
|
9
|
+
const focused = useFocused();
|
|
10
|
+
return (_jsxs(PlateElement, { className: cn("inline-block cursor-pointer rounded-md bg-muted px-1.5 py-0.5 align-baseline text-sm font-medium", selected && focused && "ring-2 ring-ring", element.children[0].bold === true && "font-bold", element.children[0].italic === true && "italic", element.children[0].underline === true && "underline", className), contentEditable: false, "data-slate-value": element.value, onClick: getHandler(onClick, element), ref: ref, ...props, children: [prefix, renderLabel ? renderLabel(element) : element.value, children] }));
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=mention-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mention-element.js","sourceRoot":"","sources":["../../../../../src/components/plate/components/mention-element.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAItD,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAOnC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,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