react-native-enriched-html 0.0.0 → 1.1.0-nightly-20260617-3dfd09072
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/LICENSE +20 -0
- package/README.md +402 -0
- package/ReactNativeEnrichedHtml.podspec +31 -0
- package/android/build.gradle +106 -0
- package/android/generated/java/com/facebook/react/viewmanagers/EnrichedTextInputViewManagerDelegate.java +203 -0
- package/android/generated/java/com/facebook/react/viewmanagers/EnrichedTextInputViewManagerInterface.java +74 -0
- package/android/generated/java/com/facebook/react/viewmanagers/EnrichedTextViewManagerDelegate.java +70 -0
- package/android/generated/java/com/facebook/react/viewmanagers/EnrichedTextViewManagerInterface.java +31 -0
- package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/ComponentDescriptors.cpp +22 -0
- package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/ComponentDescriptors.h +24 -0
- package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/EventEmitters.cpp +456 -0
- package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/EventEmitters.h +410 -0
- package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/Props.cpp +272 -0
- package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/Props.h +1595 -0
- package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/ShadowNodes.cpp +17 -0
- package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/ShadowNodes.h +23 -0
- package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/States.cpp +16 -0
- package/android/generated/jni/react/renderer/components/ReactNativeEnrichedSpec/States.h +20 -0
- package/android/gradle.properties +5 -0
- package/android/lint.gradle +70 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/swmansion/enriched/ReactNativeEnrichedPackage.kt +22 -0
- package/android/src/main/java/com/swmansion/enriched/common/AllowFontScaling.kt +36 -0
- package/android/src/main/java/com/swmansion/enriched/common/AsyncDrawable.kt +126 -0
- package/android/src/main/java/com/swmansion/enriched/common/CheckboxDrawable.kt +81 -0
- package/android/src/main/java/com/swmansion/enriched/common/EnrichedConstants.kt +16 -0
- package/android/src/main/java/com/swmansion/enriched/common/EnrichedStyle.kt +57 -0
- package/android/src/main/java/com/swmansion/enriched/common/ForceRedrawSpan.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/common/GumboNormalizer.kt +5 -0
- package/android/src/main/java/com/swmansion/enriched/common/MentionStyle.kt +9 -0
- package/android/src/main/java/com/swmansion/enriched/common/ResourceManager.kt +26 -0
- package/android/src/main/java/com/swmansion/enriched/common/parser/EnrichedParser.java +1034 -0
- package/android/src/main/java/com/swmansion/enriched/common/parser/EnrichedSpanFactory.kt +82 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedAlignmentSpan.kt +19 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedBlockQuoteSpan.kt +53 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedBoldSpan.kt +12 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedCheckboxListSpan.kt +92 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedCodeBlockSpan.kt +81 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedH1Span.kt +20 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedH2Span.kt +20 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedH3Span.kt +20 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedH4Span.kt +21 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedH5Span.kt +20 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedH6Span.kt +20 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedImageSpan.kt +185 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedInlineCodeSpan.kt +24 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedItalicSpan.kt +12 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedLinkSpan.kt +29 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedMentionSpan.kt +35 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedOrderedListSpan.kt +79 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedStrikeThroughSpan.kt +11 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedUnderlineSpan.kt +11 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/EnrichedUnorderedListSpan.kt +62 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/interfaces/EnrichedBlockSpan.kt +5 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/interfaces/EnrichedHeadingSpan.kt +3 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/interfaces/EnrichedInlineSpan.kt +3 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/interfaces/EnrichedParagraphSpan.kt +5 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/interfaces/EnrichedSpan.kt +3 -0
- package/android/src/main/java/com/swmansion/enriched/common/spans/interfaces/EnrichedZeroWidthSpaceSpan.kt +4 -0
- package/android/src/main/java/com/swmansion/enriched/text/EnrichedTextMovementMethod.kt +75 -0
- package/android/src/main/java/com/swmansion/enriched/text/EnrichedTextSpanFactory.kt +83 -0
- package/android/src/main/java/com/swmansion/enriched/text/EnrichedTextStyle.kt +202 -0
- package/android/src/main/java/com/swmansion/enriched/text/EnrichedTextView.kt +361 -0
- package/android/src/main/java/com/swmansion/enriched/text/EnrichedTextViewManager.kt +157 -0
- package/android/src/main/java/com/swmansion/enriched/text/MeasurementStore.kt +170 -0
- package/android/src/main/java/com/swmansion/enriched/text/events/OnLinkPressEvent.kt +23 -0
- package/android/src/main/java/com/swmansion/enriched/text/events/OnMentionPressEvent.kt +32 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextAlignmentSpan.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextBlockQuoteSpan.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextBoldSpan.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextCheckboxListSpan.kt +15 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextCodeBlockSpan.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextH1Span.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextH2Span.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextH3Span.kt +15 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextH4Span.kt +15 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextH5Span.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextH6Span.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextImageSpan.kt +57 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextInlineCodeSpan.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextItalicSpan.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextLinkSpan.kt +41 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextMentionSpan.kt +63 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextOrderedListSpan.kt +16 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextStrikeThroughSpan.kt +15 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextUnderlineSpan.kt +15 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/EnrichedTextUnorderedListSpan.kt +15 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/interfaces/EnrichedTextClickableSpan.kt +9 -0
- package/android/src/main/java/com/swmansion/enriched/text/spans/interfaces/EnrichedTextSpan.kt +10 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputConnectionWrapper.kt +140 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputSpannableFactory.kt +85 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputView.kt +1141 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputViewLayoutManager.kt +27 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputViewManager.kt +500 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/MeasurementStore.kt +230 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/events/MentionHandler.kt +55 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/events/OnChangeHtmlEvent.kt +27 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/events/OnChangeSelectionEvent.kt +30 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/events/OnChangeStateEvent.kt +21 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/events/OnChangeTextEvent.kt +30 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/events/OnContextMenuItemPressEvent.kt +35 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/events/OnInputBlurEvent.kt +25 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/events/OnInputFocusEvent.kt +25 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/events/OnInputKeyPressEvent.kt +27 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/events/OnLinkDetectedEvent.kt +32 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/events/OnMentionDetectedEvent.kt +30 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/events/OnMentionEvent.kt +34 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/events/OnPasteImagesEvent.kt +47 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/events/OnRequestHtmlResultEvent.kt +32 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/events/OnSubmitEditingEvent.kt +29 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputAlignmentSpan.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputBlockQuoteSpan.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputBoldSpan.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputCheckboxListSpan.kt +15 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputCodeBlockSpan.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputH1Span.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputH2Span.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputH3Span.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputH4Span.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputH5Span.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputH6Span.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputImageSpan.kt +36 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputInlineCodeSpan.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputItalicSpan.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputLinkSpan.kt +16 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputMentionSpan.kt +18 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputOrderedListSpan.kt +21 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputStrikeThroughSpan.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputUnderlineSpan.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedInputUnorderedListSpan.kt +14 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedLineHeightSpan.kt +45 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/EnrichedSpans.kt +240 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/spans/interfaces/EnrichedInputSpan.kt +10 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/styles/AlignmentStyles.kt +367 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/styles/HtmlStyle.kt +371 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/styles/InlineStyles.kt +232 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/styles/ListStyles.kt +260 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/styles/ParagraphStyles.kt +439 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/styles/ParametrizedStyles.kt +408 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/utils/EnrichedEditableFactory.kt +17 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/utils/EnrichedSelection.kt +340 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/utils/EnrichedSpanState.kt +318 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/utils/EnrichedSpannable.kt +156 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/utils/EnrichedSpannableStringBuilder.kt +59 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/utils/RichContentReceiver.kt +127 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/utils/ShortcutsHandler.kt +150 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/utils/StyleUtils.kt +51 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/utils/Utils.kt +106 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/watchers/EnrichedSpanWatcher.kt +109 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/watchers/EnrichedTextWatcher.kt +106 -0
- package/android/src/main/new_arch/CMakeLists.txt +62 -0
- package/android/src/main/new_arch/GumboNormalizerJni.cpp +14 -0
- package/android/src/main/new_arch/ReactNativeEnrichedSpec.cpp +11 -0
- package/android/src/main/new_arch/ReactNativeEnrichedSpec.h +16 -0
- package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextComponentDescriptor.h +32 -0
- package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextInputComponentDescriptor.h +35 -0
- package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextInputMeasurementManager.cpp +53 -0
- package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextInputMeasurementManager.h +25 -0
- package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextInputShadowNode.cpp +35 -0
- package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextInputShadowNode.h +53 -0
- package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextInputState.cpp +9 -0
- package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextInputState.h +24 -0
- package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextMeasurementManager.cpp +45 -0
- package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextMeasurementManager.h +25 -0
- package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextShadowNode.cpp +21 -0
- package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/EnrichedTextShadowNode.h +39 -0
- package/android/src/main/new_arch/react/renderer/components/ReactNativeEnrichedSpec/conversions.h +44 -0
- package/android/src/main/res/drawable/broken_image.xml +10 -0
- package/cpp/CMakeLists.txt +50 -0
- package/cpp/GumboParser/GumboParser.h +34043 -0
- package/cpp/README.md +59 -0
- package/cpp/parser/GumboNormalizer.c +915 -0
- package/cpp/parser/GumboParser.cpp +16 -0
- package/cpp/parser/GumboParser.hpp +23 -0
- package/cpp/tests/GumboParserTest.cpp +457 -0
- package/ios/EnrichedTextInputView.h +54 -0
- package/ios/EnrichedTextInputView.mm +2170 -0
- package/ios/EnrichedTextInputViewManager.mm +13 -0
- package/ios/EnrichedTextView.h +35 -0
- package/ios/EnrichedTextView.mm +806 -0
- package/ios/EnrichedTextViewManager.mm +13 -0
- package/ios/config/EnrichedConfig.h +114 -0
- package/ios/config/EnrichedConfig.mm +727 -0
- package/ios/enrichedInputTextView/EnrichedInputTextView.h +6 -0
- package/ios/enrichedInputTextView/EnrichedInputTextView.mm +334 -0
- package/ios/enrichedTextTextView/EnrichedTextTextView.h +16 -0
- package/ios/enrichedTextTextView/EnrichedTextTextView.mm +71 -0
- package/ios/extensions/ColorExtension.h +8 -0
- package/ios/extensions/ColorExtension.mm +48 -0
- package/ios/extensions/FontExtension.h +11 -0
- package/ios/extensions/FontExtension.mm +72 -0
- package/ios/extensions/ImageExtension.h +33 -0
- package/ios/extensions/ImageExtension.mm +176 -0
- package/ios/extensions/LayoutManagerExtension.h +6 -0
- package/ios/extensions/LayoutManagerExtension.mm +454 -0
- package/ios/extensions/StringExtension.h +15 -0
- package/ios/extensions/StringExtension.mm +69 -0
- package/ios/generated/ReactNativeEnrichedSpec/ComponentDescriptors.cpp +22 -0
- package/ios/generated/ReactNativeEnrichedSpec/ComponentDescriptors.h +24 -0
- package/ios/generated/ReactNativeEnrichedSpec/EventEmitters.cpp +456 -0
- package/ios/generated/ReactNativeEnrichedSpec/EventEmitters.h +410 -0
- package/ios/generated/ReactNativeEnrichedSpec/Props.cpp +272 -0
- package/ios/generated/ReactNativeEnrichedSpec/Props.h +1595 -0
- package/ios/generated/ReactNativeEnrichedSpec/RCTComponentViewHelpers.h +570 -0
- package/ios/generated/ReactNativeEnrichedSpec/ShadowNodes.cpp +17 -0
- package/ios/generated/ReactNativeEnrichedSpec/ShadowNodes.h +23 -0
- package/ios/generated/ReactNativeEnrichedSpec/States.cpp +16 -0
- package/ios/generated/ReactNativeEnrichedSpec/States.h +20 -0
- package/ios/htmlParser/HtmlParser.h +11 -0
- package/ios/htmlParser/HtmlParser.mm +1468 -0
- package/ios/inputAttributesManager/InputAttributesManager.h +18 -0
- package/ios/inputAttributesManager/InputAttributesManager.mm +222 -0
- package/ios/inputHtmlParser/InputHtmlParser.h +10 -0
- package/ios/inputHtmlParser/InputHtmlParser.mm +225 -0
- package/ios/interfaces/AlignmentEntry.h +9 -0
- package/ios/interfaces/AlignmentEntry.mm +4 -0
- package/ios/interfaces/AttributeEntry.h +9 -0
- package/ios/interfaces/AttributeEntry.mm +4 -0
- package/ios/interfaces/BaseStyleProtocol.h +17 -0
- package/ios/interfaces/EnrichedTextStyleHeaders.h +62 -0
- package/ios/interfaces/EnrichedViewHost.h +26 -0
- package/ios/interfaces/ImageAttachment.h +11 -0
- package/ios/interfaces/ImageAttachment.mm +107 -0
- package/ios/interfaces/ImageData.h +10 -0
- package/ios/interfaces/ImageData.mm +4 -0
- package/ios/interfaces/LinkData.h +11 -0
- package/ios/interfaces/LinkData.mm +43 -0
- package/ios/interfaces/LinkRegexConfig.h +19 -0
- package/ios/interfaces/LinkRegexConfig.mm +37 -0
- package/ios/interfaces/MediaAttachment.h +23 -0
- package/ios/interfaces/MediaAttachment.mm +31 -0
- package/ios/interfaces/MentionParams.h +8 -0
- package/ios/interfaces/MentionParams.mm +4 -0
- package/ios/interfaces/MentionStyleProps.h +17 -0
- package/ios/interfaces/MentionStyleProps.mm +80 -0
- package/ios/interfaces/StyleBase.h +38 -0
- package/ios/interfaces/StyleBase.mm +279 -0
- package/ios/interfaces/StyleHeaders.h +110 -0
- package/ios/interfaces/StylePair.h +9 -0
- package/ios/interfaces/StylePair.mm +4 -0
- package/ios/interfaces/StyleTypeEnum.h +27 -0
- package/ios/interfaces/TextDecorationLineEnum.h +6 -0
- package/ios/interfaces/TextDecorationLineEnum.mm +4 -0
- package/ios/internals/EnrichedTextComponentDescriptor.h +19 -0
- package/ios/internals/EnrichedTextInputViewComponentDescriptor.h +19 -0
- package/ios/internals/EnrichedTextInputViewShadowNode.h +44 -0
- package/ios/internals/EnrichedTextInputViewShadowNode.mm +103 -0
- package/ios/internals/EnrichedTextInputViewState.cpp +10 -0
- package/ios/internals/EnrichedTextInputViewState.h +22 -0
- package/ios/internals/EnrichedTextViewShadowNode.h +34 -0
- package/ios/internals/EnrichedTextViewShadowNode.mm +72 -0
- package/ios/internals/EnrichedTextViewState.cpp +7 -0
- package/ios/internals/EnrichedTextViewState.h +18 -0
- package/ios/styles/AlignmentStyle.mm +203 -0
- package/ios/styles/BlockQuoteStyle.mm +54 -0
- package/ios/styles/BoldStyle.mm +37 -0
- package/ios/styles/CheckboxListStyle.mm +154 -0
- package/ios/styles/CodeBlockStyle.mm +49 -0
- package/ios/styles/EnrichedTextStyles.mm +61 -0
- package/ios/styles/H1Style.mm +20 -0
- package/ios/styles/H2Style.mm +20 -0
- package/ios/styles/H3Style.mm +20 -0
- package/ios/styles/H4Style.mm +20 -0
- package/ios/styles/H5Style.mm +20 -0
- package/ios/styles/H6Style.mm +20 -0
- package/ios/styles/HeadingStyleBase.mm +96 -0
- package/ios/styles/ImageStyle.mm +150 -0
- package/ios/styles/InlineCodeStyle.mm +65 -0
- package/ios/styles/ItalicStyle.mm +37 -0
- package/ios/styles/LinkStyle.mm +532 -0
- package/ios/styles/MentionStyle.mm +541 -0
- package/ios/styles/OrderedListStyle.mm +48 -0
- package/ios/styles/StrikethroughStyle.mm +25 -0
- package/ios/styles/UnderlineStyle.mm +24 -0
- package/ios/styles/UnorderedListStyle.mm +48 -0
- package/ios/textHtmlParser/TextHtmlParser.h +10 -0
- package/ios/textHtmlParser/TextHtmlParser.mm +181 -0
- package/ios/utils/AlignmentUtils.h +20 -0
- package/ios/utils/AlignmentUtils.mm +111 -0
- package/ios/utils/AttachmentLayoutUtils.h +24 -0
- package/ios/utils/AttachmentLayoutUtils.mm +144 -0
- package/ios/utils/CheckboxHitTestUtils.h +10 -0
- package/ios/utils/CheckboxHitTestUtils.mm +122 -0
- package/ios/utils/DotReplacementUtils.h +10 -0
- package/ios/utils/DotReplacementUtils.mm +68 -0
- package/ios/utils/EnrichedTextTouchHandler.h +14 -0
- package/ios/utils/EnrichedTextTouchHandler.mm +152 -0
- package/ios/utils/KeyboardUtils.h +7 -0
- package/ios/utils/KeyboardUtils.mm +30 -0
- package/ios/utils/OccurenceUtils.h +44 -0
- package/ios/utils/OccurenceUtils.mm +185 -0
- package/ios/utils/ParagraphAttributesUtils.h +18 -0
- package/ios/utils/ParagraphAttributesUtils.mm +289 -0
- package/ios/utils/RangeUtils.h +12 -0
- package/ios/utils/RangeUtils.mm +183 -0
- package/ios/utils/ShortcutsUtils.h +21 -0
- package/ios/utils/ShortcutsUtils.mm +486 -0
- package/ios/utils/StyleUtils.h +33 -0
- package/ios/utils/StyleUtils.mm +290 -0
- package/ios/utils/TextBlockTapGestureRecognizer.h +17 -0
- package/ios/utils/TextBlockTapGestureRecognizer.mm +56 -0
- package/ios/utils/TextInsertionUtils.h +17 -0
- package/ios/utils/TextInsertionUtils.mm +60 -0
- package/ios/utils/TextListsUtils.h +40 -0
- package/ios/utils/TextListsUtils.mm +93 -0
- package/ios/utils/WeakBox.h +3 -0
- package/ios/utils/WeakBox.m +4 -0
- package/ios/utils/WordsUtils.h +7 -0
- package/ios/utils/WordsUtils.mm +98 -0
- package/ios/utils/ZeroWidthSpaceUtils.h +14 -0
- package/ios/utils/ZeroWidthSpaceUtils.mm +310 -0
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/index.native.js +7 -0
- package/lib/module/index.native.js.map +1 -0
- package/lib/module/native/EnrichedText.js +76 -0
- package/lib/module/native/EnrichedText.js.map +1 -0
- package/lib/module/native/EnrichedTextInput.js +306 -0
- package/lib/module/native/EnrichedTextInput.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/spec/EnrichedTextInputNativeComponent.ts +524 -0
- package/lib/module/spec/EnrichedTextNativeComponent.ts +110 -0
- package/lib/module/types.js +4 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utils/EnrichedTextInputDefaultProps.js +20 -0
- package/lib/module/utils/EnrichedTextInputDefaultProps.js.map +1 -0
- package/lib/module/utils/defaultHtmlStyle.js +83 -0
- package/lib/module/utils/defaultHtmlStyle.js.map +1 -0
- package/lib/module/utils/expandMentionStylesForIndicators.js +15 -0
- package/lib/module/utils/expandMentionStylesForIndicators.js.map +1 -0
- package/lib/module/utils/isMentionStyleRecord.js +10 -0
- package/lib/module/utils/isMentionStyleRecord.js.map +1 -0
- package/lib/module/utils/normalizeHtmlStyle.js +126 -0
- package/lib/module/utils/normalizeHtmlStyle.js.map +1 -0
- package/lib/module/utils/nullthrows.js +9 -0
- package/lib/module/utils/nullthrows.js.map +1 -0
- package/lib/module/utils/regexParser.js +46 -0
- package/lib/module/utils/regexParser.js.map +1 -0
- package/lib/module/web/EnrichedTextInput.css +201 -0
- package/lib/module/web/EnrichedTextInput.js +314 -0
- package/lib/module/web/EnrichedTextInput.js.map +1 -0
- package/lib/module/web/adaptWebToNativeEvent.js +34 -0
- package/lib/module/web/adaptWebToNativeEvent.js.map +1 -0
- package/lib/module/web/checkboxHtmlNormalizer.js +54 -0
- package/lib/module/web/checkboxHtmlNormalizer.js.map +1 -0
- package/lib/module/web/formats/EnrichedBlockquote.js +32 -0
- package/lib/module/web/formats/EnrichedBlockquote.js.map +1 -0
- package/lib/module/web/formats/EnrichedBold.js +22 -0
- package/lib/module/web/formats/EnrichedBold.js.map +1 -0
- package/lib/module/web/formats/EnrichedCheckboxItem.js +32 -0
- package/lib/module/web/formats/EnrichedCheckboxItem.js.map +1 -0
- package/lib/module/web/formats/EnrichedCheckboxList.js +35 -0
- package/lib/module/web/formats/EnrichedCheckboxList.js.map +1 -0
- package/lib/module/web/formats/EnrichedCode.js +15 -0
- package/lib/module/web/formats/EnrichedCode.js.map +1 -0
- package/lib/module/web/formats/EnrichedCodeBlock.js +43 -0
- package/lib/module/web/formats/EnrichedCodeBlock.js.map +1 -0
- package/lib/module/web/formats/EnrichedHeading.js +27 -0
- package/lib/module/web/formats/EnrichedHeading.js.map +1 -0
- package/lib/module/web/formats/EnrichedImage.js +57 -0
- package/lib/module/web/formats/EnrichedImage.js.map +1 -0
- package/lib/module/web/formats/EnrichedImageNodeView.js +90 -0
- package/lib/module/web/formats/EnrichedImageNodeView.js.map +1 -0
- package/lib/module/web/formats/EnrichedItalic.js +22 -0
- package/lib/module/web/formats/EnrichedItalic.js.map +1 -0
- package/lib/module/web/formats/EnrichedLink.js +140 -0
- package/lib/module/web/formats/EnrichedLink.js.map +1 -0
- package/lib/module/web/formats/EnrichedListItem.js +19 -0
- package/lib/module/web/formats/EnrichedListItem.js.map +1 -0
- package/lib/module/web/formats/EnrichedMention.js +50 -0
- package/lib/module/web/formats/EnrichedMention.js.map +1 -0
- package/lib/module/web/formats/EnrichedOrderedList.js +32 -0
- package/lib/module/web/formats/EnrichedOrderedList.js.map +1 -0
- package/lib/module/web/formats/EnrichedStrike.js +22 -0
- package/lib/module/web/formats/EnrichedStrike.js.map +1 -0
- package/lib/module/web/formats/EnrichedUnderline.js +22 -0
- package/lib/module/web/formats/EnrichedUnderline.js.map +1 -0
- package/lib/module/web/formats/EnrichedUnorderedList.js +33 -0
- package/lib/module/web/formats/EnrichedUnorderedList.js.map +1 -0
- package/lib/module/web/formats/applyWrappingListToSelection.js +63 -0
- package/lib/module/web/formats/applyWrappingListToSelection.js.map +1 -0
- package/lib/module/web/formats/formatRules.js +48 -0
- package/lib/module/web/formats/formatRules.js.map +1 -0
- package/lib/module/web/formats/listKeyboard.js +50 -0
- package/lib/module/web/formats/listKeyboard.js.map +1 -0
- package/lib/module/web/formats/wrappedBlockKeyboard.js +58 -0
- package/lib/module/web/formats/wrappedBlockKeyboard.js.map +1 -0
- package/lib/module/web/pasteImages.js +78 -0
- package/lib/module/web/pasteImages.js.map +1 -0
- package/lib/module/web/pastedImageDimensions.js +49 -0
- package/lib/module/web/pastedImageDimensions.js.map +1 -0
- package/lib/module/web/pmPlugins/MentionPlugin/index.js +36 -0
- package/lib/module/web/pmPlugins/MentionPlugin/index.js.map +1 -0
- package/lib/module/web/pmPlugins/MentionPlugin/isCaretInBlockedContext.js +11 -0
- package/lib/module/web/pmPlugins/MentionPlugin/isCaretInBlockedContext.js.map +1 -0
- package/lib/module/web/pmPlugins/MentionPlugin/makeMentionPluginState.js +67 -0
- package/lib/module/web/pmPlugins/MentionPlugin/makeMentionPluginState.js.map +1 -0
- package/lib/module/web/pmPlugins/MentionPlugin/mentionPluginKey.js +5 -0
- package/lib/module/web/pmPlugins/MentionPlugin/mentionPluginKey.js.map +1 -0
- package/lib/module/web/pmPlugins/MentionPlugin/removeMentionMarksIfSpansResized.js +56 -0
- package/lib/module/web/pmPlugins/MentionPlugin/removeMentionMarksIfSpansResized.js.map +1 -0
- package/lib/module/web/pmPlugins/MentionPlugin/setMention.js +58 -0
- package/lib/module/web/pmPlugins/MentionPlugin/setMention.js.map +1 -0
- package/lib/module/web/pmPlugins/MentionPlugin/startMention.js +9 -0
- package/lib/module/web/pmPlugins/MentionPlugin/startMention.js.map +1 -0
- package/lib/module/web/pmPlugins/MentionPlugin/stripPartialMentionMarks.js +9 -0
- package/lib/module/web/pmPlugins/MentionPlugin/stripPartialMentionMarks.js.map +1 -0
- package/lib/module/web/pmPlugins/MentionPlugin/subscribeMentionEvents.js +100 -0
- package/lib/module/web/pmPlugins/MentionPlugin/subscribeMentionEvents.js.map +1 -0
- package/lib/module/web/pmPlugins/MentionPlugin/types.js +4 -0
- package/lib/module/web/pmPlugins/MentionPlugin/types.js.map +1 -0
- package/lib/module/web/pmPlugins/MergeAdjacentSameKindBlocksPlugin.js +42 -0
- package/lib/module/web/pmPlugins/MergeAdjacentSameKindBlocksPlugin.js.map +1 -0
- package/lib/module/web/pmPlugins/ShortcutPlugin.js +123 -0
- package/lib/module/web/pmPlugins/ShortcutPlugin.js.map +1 -0
- package/lib/module/web/pmPlugins/StrictMarksPlugin.js +98 -0
- package/lib/module/web/pmPlugins/StrictMarksPlugin.js.map +1 -0
- package/lib/module/web/pmPlugins/StripBoldInStyledHeadingsPlugin.js +56 -0
- package/lib/module/web/pmPlugins/StripBoldInStyledHeadingsPlugin.js.map +1 -0
- package/lib/module/web/pmPlugins/StripMarksInCodeBlockPlugin.js +28 -0
- package/lib/module/web/pmPlugins/StripMarksInCodeBlockPlugin.js.map +1 -0
- package/lib/module/web/pmPlugins/StripMarksOnImagePlugin.js +29 -0
- package/lib/module/web/pmPlugins/StripMarksOnImagePlugin.js.map +1 -0
- package/lib/module/web/positionMapping.js +76 -0
- package/lib/module/web/positionMapping.js.map +1 -0
- package/lib/module/web/returnKeyTypeToEnterKeyHint.js +20 -0
- package/lib/module/web/returnKeyTypeToEnterKeyHint.js.map +1 -0
- package/lib/module/web/styleConversion/buildMentionRulesCSS.js +33 -0
- package/lib/module/web/styleConversion/buildMentionRulesCSS.js.map +1 -0
- package/lib/module/web/styleConversion/enrichedInputStyleToCSSProperties.js +159 -0
- package/lib/module/web/styleConversion/enrichedInputStyleToCSSProperties.js.map +1 -0
- package/lib/module/web/styleConversion/enrichedInputThemingToCSSProperties.js +18 -0
- package/lib/module/web/styleConversion/enrichedInputThemingToCSSProperties.js.map +1 -0
- package/lib/module/web/styleConversion/htmlStyleToCSSVariables.js +145 -0
- package/lib/module/web/styleConversion/htmlStyleToCSSVariables.js.map +1 -0
- package/lib/module/web/styleConversion/mentionIndicatorCssKey.js +15 -0
- package/lib/module/web/styleConversion/mentionIndicatorCssKey.js.map +1 -0
- package/lib/module/web/styleConversion/toColor.js +18 -0
- package/lib/module/web/styleConversion/toColor.js.map +1 -0
- package/lib/module/web/tiptapHtmlNormalizer.js +30 -0
- package/lib/module/web/tiptapHtmlNormalizer.js.map +1 -0
- package/lib/module/web/useOnChangeHtml.js +8 -0
- package/lib/module/web/useOnChangeHtml.js.map +1 -0
- package/lib/module/web/useOnChangeState.js +88 -0
- package/lib/module/web/useOnChangeState.js.map +1 -0
- package/lib/module/web/useOnChangeText.js +11 -0
- package/lib/module/web/useOnChangeText.js.map +1 -0
- package/lib/module/web/useOnEditorChange.js +25 -0
- package/lib/module/web/useOnEditorChange.js.map +1 -0
- package/lib/module/web/useOnLinkDetected.js +68 -0
- package/lib/module/web/useOnLinkDetected.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/index.native.d.ts +5 -0
- package/lib/typescript/src/index.native.d.ts.map +1 -0
- package/lib/typescript/src/native/EnrichedText.d.ts +3 -0
- package/lib/typescript/src/native/EnrichedText.d.ts.map +1 -0
- package/lib/typescript/src/native/EnrichedTextInput.d.ts +3 -0
- package/lib/typescript/src/native/EnrichedTextInput.d.ts.map +1 -0
- package/lib/typescript/src/spec/EnrichedTextInputNativeComponent.d.ts +405 -0
- package/lib/typescript/src/spec/EnrichedTextInputNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/spec/EnrichedTextNativeComponent.d.ts +88 -0
- package/lib/typescript/src/spec/EnrichedTextNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +721 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/utils/EnrichedTextInputDefaultProps.d.ts +13 -0
- package/lib/typescript/src/utils/EnrichedTextInputDefaultProps.d.ts.map +1 -0
- package/lib/typescript/src/utils/defaultHtmlStyle.d.ts +4 -0
- package/lib/typescript/src/utils/defaultHtmlStyle.d.ts.map +1 -0
- package/lib/typescript/src/utils/expandMentionStylesForIndicators.d.ts +3 -0
- package/lib/typescript/src/utils/expandMentionStylesForIndicators.d.ts.map +1 -0
- package/lib/typescript/src/utils/isMentionStyleRecord.d.ts +3 -0
- package/lib/typescript/src/utils/isMentionStyleRecord.d.ts.map +1 -0
- package/lib/typescript/src/utils/normalizeHtmlStyle.d.ts +6 -0
- package/lib/typescript/src/utils/normalizeHtmlStyle.d.ts.map +1 -0
- package/lib/typescript/src/utils/nullthrows.d.ts +2 -0
- package/lib/typescript/src/utils/nullthrows.d.ts.map +1 -0
- package/lib/typescript/src/utils/regexParser.d.ts +3 -0
- package/lib/typescript/src/utils/regexParser.d.ts.map +1 -0
- package/lib/typescript/src/web/EnrichedTextInput.d.ts +4 -0
- package/lib/typescript/src/web/EnrichedTextInput.d.ts.map +1 -0
- package/lib/typescript/src/web/adaptWebToNativeEvent.d.ts +3 -0
- package/lib/typescript/src/web/adaptWebToNativeEvent.d.ts.map +1 -0
- package/lib/typescript/src/web/checkboxHtmlNormalizer.d.ts +3 -0
- package/lib/typescript/src/web/checkboxHtmlNormalizer.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedBlockquote.d.ts +2 -0
- package/lib/typescript/src/web/formats/EnrichedBlockquote.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedBold.d.ts +2 -0
- package/lib/typescript/src/web/formats/EnrichedBold.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedCheckboxItem.d.ts +2 -0
- package/lib/typescript/src/web/formats/EnrichedCheckboxItem.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedCheckboxList.d.ts +9 -0
- package/lib/typescript/src/web/formats/EnrichedCheckboxList.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedCode.d.ts +2 -0
- package/lib/typescript/src/web/formats/EnrichedCode.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedCodeBlock.d.ts +9 -0
- package/lib/typescript/src/web/formats/EnrichedCodeBlock.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedHeading.d.ts +5 -0
- package/lib/typescript/src/web/formats/EnrichedHeading.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedImage.d.ts +2 -0
- package/lib/typescript/src/web/formats/EnrichedImage.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedImageNodeView.d.ts +3 -0
- package/lib/typescript/src/web/formats/EnrichedImageNodeView.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedItalic.d.ts +2 -0
- package/lib/typescript/src/web/formats/EnrichedItalic.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedLink.d.ts +5 -0
- package/lib/typescript/src/web/formats/EnrichedLink.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedListItem.d.ts +2 -0
- package/lib/typescript/src/web/formats/EnrichedListItem.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedMention.d.ts +4 -0
- package/lib/typescript/src/web/formats/EnrichedMention.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedOrderedList.d.ts +2 -0
- package/lib/typescript/src/web/formats/EnrichedOrderedList.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedStrike.d.ts +2 -0
- package/lib/typescript/src/web/formats/EnrichedStrike.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedUnderline.d.ts +2 -0
- package/lib/typescript/src/web/formats/EnrichedUnderline.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedUnorderedList.d.ts +9 -0
- package/lib/typescript/src/web/formats/EnrichedUnorderedList.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/applyWrappingListToSelection.d.ts +18 -0
- package/lib/typescript/src/web/formats/applyWrappingListToSelection.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/formatRules.d.ts +10 -0
- package/lib/typescript/src/web/formats/formatRules.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/listKeyboard.d.ts +4 -0
- package/lib/typescript/src/web/formats/listKeyboard.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/wrappedBlockKeyboard.d.ts +12 -0
- package/lib/typescript/src/web/formats/wrappedBlockKeyboard.d.ts.map +1 -0
- package/lib/typescript/src/web/pasteImages.d.ts +10 -0
- package/lib/typescript/src/web/pasteImages.d.ts.map +1 -0
- package/lib/typescript/src/web/pastedImageDimensions.d.ts +9 -0
- package/lib/typescript/src/web/pastedImageDimensions.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/index.d.ts +9 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/index.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/isCaretInBlockedContext.d.ts +3 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/isCaretInBlockedContext.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/makeMentionPluginState.d.ts +4 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/makeMentionPluginState.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/mentionPluginKey.d.ts +4 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/mentionPluginKey.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/removeMentionMarksIfSpansResized.d.ts +9 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/removeMentionMarksIfSpansResized.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/setMention.d.ts +3 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/setMention.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/startMention.d.ts +3 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/startMention.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/stripPartialMentionMarks.d.ts +3 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/stripPartialMentionMarks.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/subscribeMentionEvents.d.ts +4 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/subscribeMentionEvents.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/types.d.ts +20 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/types.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/MergeAdjacentSameKindBlocksPlugin.d.ts +3 -0
- package/lib/typescript/src/web/pmPlugins/MergeAdjacentSameKindBlocksPlugin.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/ShortcutPlugin.d.ts +7 -0
- package/lib/typescript/src/web/pmPlugins/ShortcutPlugin.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/StrictMarksPlugin.d.ts +3 -0
- package/lib/typescript/src/web/pmPlugins/StrictMarksPlugin.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/StripBoldInStyledHeadingsPlugin.d.ts +10 -0
- package/lib/typescript/src/web/pmPlugins/StripBoldInStyledHeadingsPlugin.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/StripMarksInCodeBlockPlugin.d.ts +3 -0
- package/lib/typescript/src/web/pmPlugins/StripMarksInCodeBlockPlugin.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/StripMarksOnImagePlugin.d.ts +3 -0
- package/lib/typescript/src/web/pmPlugins/StripMarksOnImagePlugin.d.ts.map +1 -0
- package/lib/typescript/src/web/positionMapping.d.ts +39 -0
- package/lib/typescript/src/web/positionMapping.d.ts.map +1 -0
- package/lib/typescript/src/web/returnKeyTypeToEnterKeyHint.d.ts +4 -0
- package/lib/typescript/src/web/returnKeyTypeToEnterKeyHint.d.ts.map +1 -0
- package/lib/typescript/src/web/styleConversion/buildMentionRulesCSS.d.ts +3 -0
- package/lib/typescript/src/web/styleConversion/buildMentionRulesCSS.d.ts.map +1 -0
- package/lib/typescript/src/web/styleConversion/enrichedInputStyleToCSSProperties.d.ts +8 -0
- package/lib/typescript/src/web/styleConversion/enrichedInputStyleToCSSProperties.d.ts.map +1 -0
- package/lib/typescript/src/web/styleConversion/enrichedInputThemingToCSSProperties.d.ts +9 -0
- package/lib/typescript/src/web/styleConversion/enrichedInputThemingToCSSProperties.d.ts.map +1 -0
- package/lib/typescript/src/web/styleConversion/htmlStyleToCSSVariables.d.ts +10 -0
- package/lib/typescript/src/web/styleConversion/htmlStyleToCSSVariables.d.ts.map +1 -0
- package/lib/typescript/src/web/styleConversion/mentionIndicatorCssKey.d.ts +3 -0
- package/lib/typescript/src/web/styleConversion/mentionIndicatorCssKey.d.ts.map +1 -0
- package/lib/typescript/src/web/styleConversion/toColor.d.ts +3 -0
- package/lib/typescript/src/web/styleConversion/toColor.d.ts.map +1 -0
- package/lib/typescript/src/web/tiptapHtmlNormalizer.d.ts +3 -0
- package/lib/typescript/src/web/tiptapHtmlNormalizer.d.ts.map +1 -0
- package/lib/typescript/src/web/useOnChangeHtml.d.ts +5 -0
- package/lib/typescript/src/web/useOnChangeHtml.d.ts.map +1 -0
- package/lib/typescript/src/web/useOnChangeState.d.ts +6 -0
- package/lib/typescript/src/web/useOnChangeState.d.ts.map +1 -0
- package/lib/typescript/src/web/useOnChangeText.d.ts +5 -0
- package/lib/typescript/src/web/useOnChangeText.d.ts.map +1 -0
- package/lib/typescript/src/web/useOnEditorChange.d.ts +6 -0
- package/lib/typescript/src/web/useOnEditorChange.d.ts.map +1 -0
- package/lib/typescript/src/web/useOnLinkDetected.d.ts +4 -0
- package/lib/typescript/src/web/useOnLinkDetected.d.ts.map +1 -0
- package/package.json +232 -1
- package/react-native.config.js +16 -0
- package/src/index.native.tsx +34 -0
- package/src/index.tsx +24 -0
- package/src/native/EnrichedText.tsx +115 -0
- package/src/native/EnrichedTextInput.tsx +374 -0
- package/src/spec/EnrichedTextInputNativeComponent.ts +524 -0
- package/src/spec/EnrichedTextNativeComponent.ts +110 -0
- package/src/types.ts +864 -0
- package/src/utils/EnrichedTextInputDefaultProps.ts +16 -0
- package/src/utils/defaultHtmlStyle.ts +83 -0
- package/src/utils/expandMentionStylesForIndicators.ts +19 -0
- package/src/utils/isMentionStyleRecord.ts +22 -0
- package/src/utils/normalizeHtmlStyle.ts +181 -0
- package/src/utils/nullthrows.ts +7 -0
- package/src/utils/regexParser.ts +56 -0
- package/src/web/EnrichedTextInput.css +201 -0
- package/src/web/EnrichedTextInput.tsx +403 -0
- package/src/web/adaptWebToNativeEvent.ts +37 -0
- package/src/web/checkboxHtmlNormalizer.ts +62 -0
- package/src/web/formats/EnrichedBlockquote.ts +36 -0
- package/src/web/formats/EnrichedBold.ts +16 -0
- package/src/web/formats/EnrichedCheckboxItem.ts +35 -0
- package/src/web/formats/EnrichedCheckboxList.ts +47 -0
- package/src/web/formats/EnrichedCode.ts +13 -0
- package/src/web/formats/EnrichedCodeBlock.ts +53 -0
- package/src/web/formats/EnrichedHeading.ts +36 -0
- package/src/web/formats/EnrichedImage.ts +59 -0
- package/src/web/formats/EnrichedImageNodeView.tsx +89 -0
- package/src/web/formats/EnrichedItalic.ts +16 -0
- package/src/web/formats/EnrichedLink.ts +149 -0
- package/src/web/formats/EnrichedListItem.ts +17 -0
- package/src/web/formats/EnrichedMention.ts +55 -0
- package/src/web/formats/EnrichedOrderedList.ts +40 -0
- package/src/web/formats/EnrichedStrike.ts +16 -0
- package/src/web/formats/EnrichedUnderline.ts +16 -0
- package/src/web/formats/EnrichedUnorderedList.ts +50 -0
- package/src/web/formats/applyWrappingListToSelection.ts +76 -0
- package/src/web/formats/formatRules.ts +84 -0
- package/src/web/formats/listKeyboard.ts +58 -0
- package/src/web/formats/wrappedBlockKeyboard.ts +76 -0
- package/src/web/pasteImages.ts +96 -0
- package/src/web/pastedImageDimensions.ts +40 -0
- package/src/web/pmPlugins/MentionPlugin/index.ts +45 -0
- package/src/web/pmPlugins/MentionPlugin/isCaretInBlockedContext.ts +17 -0
- package/src/web/pmPlugins/MentionPlugin/makeMentionPluginState.ts +75 -0
- package/src/web/pmPlugins/MentionPlugin/mentionPluginKey.ts +4 -0
- package/src/web/pmPlugins/MentionPlugin/removeMentionMarksIfSpansResized.ts +68 -0
- package/src/web/pmPlugins/MentionPlugin/setMention.ts +83 -0
- package/src/web/pmPlugins/MentionPlugin/startMention.ts +14 -0
- package/src/web/pmPlugins/MentionPlugin/stripPartialMentionMarks.ts +20 -0
- package/src/web/pmPlugins/MentionPlugin/subscribeMentionEvents.ts +105 -0
- package/src/web/pmPlugins/MentionPlugin/types.ts +22 -0
- package/src/web/pmPlugins/MergeAdjacentSameKindBlocksPlugin.ts +57 -0
- package/src/web/pmPlugins/ShortcutPlugin.ts +98 -0
- package/src/web/pmPlugins/StrictMarksPlugin.ts +131 -0
- package/src/web/pmPlugins/StripBoldInStyledHeadingsPlugin.ts +79 -0
- package/src/web/pmPlugins/StripMarksInCodeBlockPlugin.ts +34 -0
- package/src/web/pmPlugins/StripMarksOnImagePlugin.ts +33 -0
- package/src/web/positionMapping.ts +81 -0
- package/src/web/returnKeyTypeToEnterKeyHint.ts +29 -0
- package/src/web/styleConversion/buildMentionRulesCSS.ts +42 -0
- package/src/web/styleConversion/enrichedInputStyleToCSSProperties.ts +224 -0
- package/src/web/styleConversion/enrichedInputThemingToCSSProperties.ts +34 -0
- package/src/web/styleConversion/htmlStyleToCSSVariables.ts +226 -0
- package/src/web/styleConversion/mentionIndicatorCssKey.ts +14 -0
- package/src/web/styleConversion/toColor.ts +17 -0
- package/src/web/tiptapHtmlNormalizer.ts +33 -0
- package/src/web/useOnChangeHtml.ts +14 -0
- package/src/web/useOnChangeState.ts +125 -0
- package/src/web/useOnChangeText.ts +15 -0
- package/src/web/useOnEditorChange.ts +33 -0
- package/src/web/useOnLinkDetected.ts +82 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { isMentionStyleRecord } from "../../utils/isMentionStyleRecord.js";
|
|
4
|
+
import { ETI_MENTION_CSS_VARS } from "./htmlStyleToCSSVariables.js";
|
|
5
|
+
import { MENTION_STYLE_DEFAULT_KEY } from "./mentionIndicatorCssKey.js";
|
|
6
|
+
function escapeIndicatorForCssAttributeSelector(indicator) {
|
|
7
|
+
if (typeof CSS !== 'undefined' && typeof CSS.escape === 'function') {
|
|
8
|
+
return CSS.escape(indicator);
|
|
9
|
+
}
|
|
10
|
+
return indicator.replace(/["\\]/g, '\\$&');
|
|
11
|
+
}
|
|
12
|
+
export function buildMentionRulesCSS(htmlStyle) {
|
|
13
|
+
const mapRaw = htmlStyle?.mention;
|
|
14
|
+
if (!mapRaw || typeof mapRaw !== 'object' || !isMentionStyleRecord(mapRaw)) {
|
|
15
|
+
return '';
|
|
16
|
+
}
|
|
17
|
+
const map = mapRaw;
|
|
18
|
+
const keys = Object.keys(map);
|
|
19
|
+
if (keys.length === 0) {
|
|
20
|
+
return '';
|
|
21
|
+
}
|
|
22
|
+
const lines = [];
|
|
23
|
+
for (const indicator of keys) {
|
|
24
|
+
const selector = indicator === MENTION_STYLE_DEFAULT_KEY ? '.eti-editor mention' : `.eti-editor mention[indicator="${escapeIndicatorForCssAttributeSelector(indicator)}"]`;
|
|
25
|
+
lines.push(`${selector} {
|
|
26
|
+
color: var(${ETI_MENTION_CSS_VARS.color(indicator)});
|
|
27
|
+
background-color: var(${ETI_MENTION_CSS_VARS.backgroundColor(indicator)});
|
|
28
|
+
text-decoration-line: var(${ETI_MENTION_CSS_VARS.textDecorationLine(indicator)});
|
|
29
|
+
}`.trim());
|
|
30
|
+
}
|
|
31
|
+
return lines.join('\n');
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=buildMentionRulesCSS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isMentionStyleRecord","ETI_MENTION_CSS_VARS","MENTION_STYLE_DEFAULT_KEY","escapeIndicatorForCssAttributeSelector","indicator","CSS","escape","replace","buildMentionRulesCSS","htmlStyle","mapRaw","mention","map","keys","Object","length","lines","selector","push","color","backgroundColor","textDecorationLine","trim","join"],"sourceRoot":"../../../../src","sources":["web/styleConversion/buildMentionRulesCSS.ts"],"mappings":";;AACA,SAASA,oBAAoB,QAAQ,qCAAkC;AACvE,SAASC,oBAAoB,QAAQ,8BAA2B;AAChE,SAASC,yBAAyB,QAAQ,6BAA0B;AAEpE,SAASC,sCAAsCA,CAACC,SAAiB,EAAU;EACzE,IAAI,OAAOC,GAAG,KAAK,WAAW,IAAI,OAAOA,GAAG,CAACC,MAAM,KAAK,UAAU,EAAE;IAClE,OAAOD,GAAG,CAACC,MAAM,CAACF,SAAS,CAAC;EAC9B;EACA,OAAOA,SAAS,CAACG,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC;AAC5C;AAEA,OAAO,SAASC,oBAAoBA,CAACC,SAAqB,EAAU;EAClE,MAAMC,MAAM,GAAGD,SAAS,EAAEE,OAAO;EACjC,IAAI,CAACD,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,IAAI,CAACV,oBAAoB,CAACU,MAAM,CAAC,EAAE;IAC1E,OAAO,EAAE;EACX;EAEA,MAAME,GAA2C,GAAGF,MAAM;EAC1D,MAAMG,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACD,GAAG,CAAC;EAC7B,IAAIC,IAAI,CAACE,MAAM,KAAK,CAAC,EAAE;IACrB,OAAO,EAAE;EACX;EAEA,MAAMC,KAAe,GAAG,EAAE;EAC1B,KAAK,MAAMZ,SAAS,IAAIS,IAAI,EAAE;IAC5B,MAAMI,QAAQ,GACZb,SAAS,KAAKF,yBAAyB,GACnC,qBAAqB,GACrB,kCAAkCC,sCAAsC,CAACC,SAAS,CAAC,IAAI;IAE7FY,KAAK,CAACE,IAAI,CACR,GAAGD,QAAQ;AACjB,eAAehB,oBAAoB,CAACkB,KAAK,CAACf,SAAS,CAAC;AACpD,0BAA0BH,oBAAoB,CAACmB,eAAe,CAAChB,SAAS,CAAC;AACzE,8BAA8BH,oBAAoB,CAACoB,kBAAkB,CAACjB,SAAS,CAAC;AAChF,EAAE,CAACkB,IAAI,CAAC,CACJ,CAAC;EACH;EAEA,OAAON,KAAK,CAACO,IAAI,CAAC,IAAI,CAAC;AACzB","ignoreList":[]}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { toColor } from "./toColor.js";
|
|
4
|
+
export function enrichedInputStyleToCSSProperties(style, extraOptions = {}) {
|
|
5
|
+
const css = {
|
|
6
|
+
// Dimensions
|
|
7
|
+
width: toPx(style.width),
|
|
8
|
+
height: toPx(style.height),
|
|
9
|
+
minWidth: toPx(style.minWidth),
|
|
10
|
+
maxWidth: toPx(style.maxWidth),
|
|
11
|
+
minHeight: toPx(style.minHeight),
|
|
12
|
+
maxHeight: toPx(style.maxHeight),
|
|
13
|
+
top: toPx(style.top),
|
|
14
|
+
bottom: toPx(style.bottom),
|
|
15
|
+
left: toPx(style.left),
|
|
16
|
+
right: toPx(style.right),
|
|
17
|
+
inset: toPx(style.inset),
|
|
18
|
+
insetBlock: toPx(style.insetBlock),
|
|
19
|
+
insetBlockEnd: toPx(style.insetBlockEnd),
|
|
20
|
+
insetBlockStart: toPx(style.insetBlockStart),
|
|
21
|
+
insetInline: toPx(style.insetInline),
|
|
22
|
+
insetInlineEnd: toPx(style.insetInlineEnd ?? style.end),
|
|
23
|
+
insetInlineStart: toPx(style.insetInlineStart ?? style.start),
|
|
24
|
+
// Margin - specific properties take precedence over shorthands (RN behavior)
|
|
25
|
+
margin: toPx(style.margin),
|
|
26
|
+
marginTop: toPx(style.marginTop ?? style.marginVertical),
|
|
27
|
+
marginBottom: toPx(style.marginBottom ?? style.marginVertical),
|
|
28
|
+
marginLeft: toPx(style.marginLeft ?? style.marginHorizontal),
|
|
29
|
+
marginRight: toPx(style.marginRight ?? style.marginHorizontal),
|
|
30
|
+
marginBlock: toPx(style.marginBlock),
|
|
31
|
+
marginBlockEnd: toPx(style.marginBlockEnd),
|
|
32
|
+
marginBlockStart: toPx(style.marginBlockStart),
|
|
33
|
+
marginInline: toPx(style.marginInline),
|
|
34
|
+
marginInlineEnd: toPx(style.marginInlineEnd ?? style.marginEnd),
|
|
35
|
+
marginInlineStart: toPx(style.marginInlineStart ?? style.marginStart),
|
|
36
|
+
// Padding - specific properties take precedence over shorthands (RN behavior)
|
|
37
|
+
padding: toPx(style.padding),
|
|
38
|
+
paddingTop: toPx(style.paddingTop ?? style.paddingVertical),
|
|
39
|
+
paddingBottom: toPx(style.paddingBottom ?? style.paddingVertical),
|
|
40
|
+
paddingLeft: toPx(style.paddingLeft ?? style.paddingHorizontal),
|
|
41
|
+
paddingRight: toPx(style.paddingRight ?? style.paddingHorizontal),
|
|
42
|
+
paddingBlock: toPx(style.paddingBlock),
|
|
43
|
+
paddingBlockEnd: toPx(style.paddingBlockEnd),
|
|
44
|
+
paddingBlockStart: toPx(style.paddingBlockStart),
|
|
45
|
+
paddingInline: toPx(style.paddingInline),
|
|
46
|
+
paddingInlineEnd: toPx(style.paddingInlineEnd ?? style.paddingEnd),
|
|
47
|
+
paddingInlineStart: toPx(style.paddingInlineStart ?? style.paddingStart),
|
|
48
|
+
// Border widths
|
|
49
|
+
borderInlineStartWidth: toPx(style.borderStartWidth),
|
|
50
|
+
borderInlineEndWidth: toPx(style.borderEndWidth),
|
|
51
|
+
borderWidth: toPx(style.borderWidth),
|
|
52
|
+
borderTopWidth: toPx(style.borderTopWidth),
|
|
53
|
+
borderBottomWidth: toPx(style.borderBottomWidth),
|
|
54
|
+
borderLeftWidth: toPx(style.borderLeftWidth),
|
|
55
|
+
borderRightWidth: toPx(style.borderRightWidth),
|
|
56
|
+
// Border radius (physical)
|
|
57
|
+
borderRadius: toPx(style.borderRadius),
|
|
58
|
+
borderTopLeftRadius: toPx(style.borderTopLeftRadius),
|
|
59
|
+
borderTopRightRadius: toPx(style.borderTopRightRadius),
|
|
60
|
+
borderBottomLeftRadius: toPx(style.borderBottomLeftRadius),
|
|
61
|
+
borderBottomRightRadius: toPx(style.borderBottomRightRadius),
|
|
62
|
+
// Border radius (logical)
|
|
63
|
+
borderStartStartRadius: toPx(style.borderStartStartRadius ?? style.borderTopStartRadius),
|
|
64
|
+
borderStartEndRadius: toPx(style.borderStartEndRadius ?? style.borderTopEndRadius),
|
|
65
|
+
borderEndStartRadius: toPx(style.borderEndStartRadius ?? style.borderBottomStartRadius),
|
|
66
|
+
borderEndEndRadius: toPx(style.borderEndEndRadius ?? style.borderBottomEndRadius),
|
|
67
|
+
// Border colors
|
|
68
|
+
borderColor: toColor(style.borderColor),
|
|
69
|
+
borderBlockColor: toColor(style.borderBlockColor),
|
|
70
|
+
borderBlockEndColor: toColor(style.borderBlockEndColor),
|
|
71
|
+
borderBlockStartColor: toColor(style.borderBlockStartColor),
|
|
72
|
+
borderBottomColor: toColor(style.borderBottomColor),
|
|
73
|
+
borderInlineEndColor: toColor(style.borderEndColor),
|
|
74
|
+
borderLeftColor: toColor(style.borderLeftColor),
|
|
75
|
+
borderRightColor: toColor(style.borderRightColor),
|
|
76
|
+
borderInlineStartColor: toColor(style.borderStartColor),
|
|
77
|
+
borderTopColor: toColor(style.borderTopColor),
|
|
78
|
+
borderStyle: style.borderStyle ?? (style.borderWidth != null || style.borderTopWidth != null || style.borderBottomWidth != null || style.borderLeftWidth != null || style.borderRightWidth != null || style.borderStartWidth != null || style.borderEndWidth != null || style.borderColor != null ? 'solid' : undefined),
|
|
79
|
+
// Typography
|
|
80
|
+
color: toColor(style.color),
|
|
81
|
+
fontFamily: style.fontFamily,
|
|
82
|
+
fontSize: toPx(style.fontSize),
|
|
83
|
+
fontStyle: style.fontStyle,
|
|
84
|
+
fontWeight: style.fontWeight,
|
|
85
|
+
lineHeight: toPx(style.lineHeight),
|
|
86
|
+
letterSpacing: toPx(style.letterSpacing),
|
|
87
|
+
// View appearance
|
|
88
|
+
backgroundColor: toColor(style.backgroundColor),
|
|
89
|
+
// boxShadow/filter: RN accepts arrays, CSS only strings
|
|
90
|
+
boxShadow: typeof style.boxShadow === 'string' ? style.boxShadow : undefined,
|
|
91
|
+
display: style.display,
|
|
92
|
+
position: style.position,
|
|
93
|
+
alignSelf: style.alignSelf,
|
|
94
|
+
backfaceVisibility: style.backfaceVisibility,
|
|
95
|
+
cursor: style.cursor,
|
|
96
|
+
filter: typeof style.filter === 'string' ? style.filter : undefined,
|
|
97
|
+
mixBlendMode: style.mixBlendMode,
|
|
98
|
+
boxSizing: style.boxSizing,
|
|
99
|
+
// pointerEvents: RN 'box-none'/'box-only' have no CSS equivalent
|
|
100
|
+
pointerEvents: style.pointerEvents === 'auto' || style.pointerEvents === 'none' ? style.pointerEvents : undefined,
|
|
101
|
+
// Outline
|
|
102
|
+
outlineColor: toColor(style.outlineColor),
|
|
103
|
+
outlineStyle: style.outlineStyle ?? (style.outlineWidth != null ? 'solid' : undefined),
|
|
104
|
+
outlineOffset: toPx(style.outlineOffset),
|
|
105
|
+
outlineWidth: toPx(style.outlineWidth),
|
|
106
|
+
// Transforms
|
|
107
|
+
transform: resolveTransform(style.transform),
|
|
108
|
+
// transformOrigin: RN accepts strings or arrays, CSS only strings
|
|
109
|
+
transformOrigin: typeof style.transformOrigin === 'string' ? style.transformOrigin : undefined,
|
|
110
|
+
// Flex
|
|
111
|
+
flex: style.flex,
|
|
112
|
+
flexGrow: style.flexGrow,
|
|
113
|
+
flexShrink: style.flexShrink,
|
|
114
|
+
flexBasis: toPx(style.flexBasis),
|
|
115
|
+
// Misc
|
|
116
|
+
zIndex: style.zIndex,
|
|
117
|
+
// opacity: RN AnimatableNumericValue includes AnimatedNode; CSS only number
|
|
118
|
+
opacity: typeof style.opacity === 'number' ? style.opacity : undefined,
|
|
119
|
+
aspectRatio: style.aspectRatio,
|
|
120
|
+
// Extra options
|
|
121
|
+
overflowY: extraOptions.scrollEnabled != null ? extraOptions.scrollEnabled ? 'auto' : 'hidden' : undefined
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
// Clean undefined values
|
|
125
|
+
return Object.fromEntries(Object.entries(css).filter(([, v]) => v !== undefined));
|
|
126
|
+
}
|
|
127
|
+
function toPx(value) {
|
|
128
|
+
if (value == null) return undefined;
|
|
129
|
+
if (typeof value === 'number') return `${value}px`;
|
|
130
|
+
if (typeof value === 'string') return value;
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
function resolveTransform(transform) {
|
|
134
|
+
if (typeof transform === 'string') return transform;
|
|
135
|
+
if (!Array.isArray(transform)) return undefined;
|
|
136
|
+
const parts = transform.map(item => {
|
|
137
|
+
if ('translateX' in item) return `translateX(${item.translateX}px)`;
|
|
138
|
+
if ('translateY' in item) return `translateY(${item.translateY}px)`;
|
|
139
|
+
if ('translateZ' in item) return `translateZ(${item.translateZ}px)`;
|
|
140
|
+
if ('scale' in item) return `scale(${item.scale})`;
|
|
141
|
+
if ('scaleX' in item) return `scaleX(${item.scaleX})`;
|
|
142
|
+
if ('scaleY' in item) return `scaleY(${item.scaleY})`;
|
|
143
|
+
if ('scaleZ' in item) return `scaleZ(${item.scaleZ})`;
|
|
144
|
+
if ('rotate' in item) return `rotate(${item.rotate})`;
|
|
145
|
+
if ('rotateX' in item) return `rotateX(${item.rotateX})`;
|
|
146
|
+
if ('rotateY' in item) return `rotateY(${item.rotateY})`;
|
|
147
|
+
if ('rotateZ' in item) return `rotateZ(${item.rotateZ})`;
|
|
148
|
+
if ('skewX' in item) return `skewX(${item.skewX})`;
|
|
149
|
+
if ('skewY' in item) return `skewY(${item.skewY})`;
|
|
150
|
+
if ('perspective' in item) return `perspective(${item.perspective}px)`;
|
|
151
|
+
if ('matrix' in item) {
|
|
152
|
+
return item.matrix.length === 16 ? `matrix3d(${item.matrix.join(', ')})` : `matrix(${item.matrix.join(', ')})`;
|
|
153
|
+
}
|
|
154
|
+
return null;
|
|
155
|
+
});
|
|
156
|
+
const css = parts.filter(Boolean).join(' ');
|
|
157
|
+
return css || undefined;
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=enrichedInputStyleToCSSProperties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["toColor","enrichedInputStyleToCSSProperties","style","extraOptions","css","width","toPx","height","minWidth","maxWidth","minHeight","maxHeight","top","bottom","left","right","inset","insetBlock","insetBlockEnd","insetBlockStart","insetInline","insetInlineEnd","end","insetInlineStart","start","margin","marginTop","marginVertical","marginBottom","marginLeft","marginHorizontal","marginRight","marginBlock","marginBlockEnd","marginBlockStart","marginInline","marginInlineEnd","marginEnd","marginInlineStart","marginStart","padding","paddingTop","paddingVertical","paddingBottom","paddingLeft","paddingHorizontal","paddingRight","paddingBlock","paddingBlockEnd","paddingBlockStart","paddingInline","paddingInlineEnd","paddingEnd","paddingInlineStart","paddingStart","borderInlineStartWidth","borderStartWidth","borderInlineEndWidth","borderEndWidth","borderWidth","borderTopWidth","borderBottomWidth","borderLeftWidth","borderRightWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderStartStartRadius","borderTopStartRadius","borderStartEndRadius","borderTopEndRadius","borderEndStartRadius","borderBottomStartRadius","borderEndEndRadius","borderBottomEndRadius","borderColor","borderBlockColor","borderBlockEndColor","borderBlockStartColor","borderBottomColor","borderInlineEndColor","borderEndColor","borderLeftColor","borderRightColor","borderInlineStartColor","borderStartColor","borderTopColor","borderStyle","undefined","color","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","letterSpacing","backgroundColor","boxShadow","display","position","alignSelf","backfaceVisibility","cursor","filter","mixBlendMode","boxSizing","pointerEvents","outlineColor","outlineStyle","outlineWidth","outlineOffset","transform","resolveTransform","transformOrigin","flex","flexGrow","flexShrink","flexBasis","zIndex","opacity","aspectRatio","overflowY","scrollEnabled","Object","fromEntries","entries","v","value","Array","isArray","parts","map","item","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skewX","skewY","perspective","matrix","length","join","Boolean"],"sourceRoot":"../../../../src","sources":["web/styleConversion/enrichedInputStyleToCSSProperties.ts"],"mappings":";;AAGA,SAASA,OAAO,QAAQ,cAAW;AAMnC,OAAO,SAASC,iCAAiCA,CAC/CC,KAAyB,EACzBC,YAA0B,GAAG,CAAC,CAAC,EAChB;EACf,MAAMC,GAAkB,GAAG;IACzB;IACAC,KAAK,EAAEC,IAAI,CAACJ,KAAK,CAACG,KAAK,CAAC;IACxBE,MAAM,EAAED,IAAI,CAACJ,KAAK,CAAC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,aAAa,IAAIb,IAAI,EAAE,OAAO,eAAeA,IAAI,CAACc,WAAW,KAAK;IACtE,IAAI,QAAQ,IAAId,IAAI,EAAE;MACpB,OAAOA,IAAI,CAACe,MAAM,CAACC,MAAM,KAAK,EAAE,GAC5B,YAAYhB,IAAI,CAACe,MAAM,CAACE,IAAI,CAAC,IAAI,CAAC,GAAG,GACrC,UAAUjB,IAAI,CAACe,MAAM,CAACE,IAAI,CAAC,IAAI,CAAC,GAAG;IACzC;IACA,OAAO,IAAI;EACb,CAAC,CAAC;EAEF,MAAMnJ,GAAG,GAAGgI,KAAK,CAAC3B,MAAM,CAAC+C,OAAO,CAAC,CAACD,IAAI,CAAC,GAAG,CAAC;EAC3C,OAAOnJ,GAAG,IAAIsF,SAAS;AACzB","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { toColor } from "./toColor.js";
|
|
4
|
+
export function enrichedInputThemingToCSSProperties({
|
|
5
|
+
cursorColor,
|
|
6
|
+
placeholderTextColor,
|
|
7
|
+
selectionColor
|
|
8
|
+
}) {
|
|
9
|
+
const extra = {};
|
|
10
|
+
const caret = toColor(cursorColor);
|
|
11
|
+
if (caret) extra.caretColor = caret;
|
|
12
|
+
const placeholderCss = toColor(placeholderTextColor);
|
|
13
|
+
if (placeholderCss) extra['--eti-placeholder-text-color'] = placeholderCss;
|
|
14
|
+
const selectionCss = toColor(selectionColor);
|
|
15
|
+
if (selectionCss) extra['--eti-selection-color'] = selectionCss;
|
|
16
|
+
return extra;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=enrichedInputThemingToCSSProperties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["toColor","enrichedInputThemingToCSSProperties","cursorColor","placeholderTextColor","selectionColor","extra","caret","caretColor","placeholderCss","selectionCss"],"sourceRoot":"../../../../src","sources":["web/styleConversion/enrichedInputThemingToCSSProperties.ts"],"mappings":";;AAEA,SAASA,OAAO,QAAQ,cAAW;AAenC,OAAO,SAASC,mCAAmCA,CAAC;EAClDC,WAAW;EACXC,oBAAoB;EACpBC;AAC0B,CAAC,EAAiB;EAC5C,MAAMC,KAAgC,GAAG,CAAC,CAAC;EAC3C,MAAMC,KAAK,GAAGN,OAAO,CAACE,WAAW,CAAC;EAClC,IAAII,KAAK,EAAED,KAAK,CAACE,UAAU,GAAGD,KAAK;EAEnC,MAAME,cAAc,GAAGR,OAAO,CAACG,oBAAoB,CAAC;EACpD,IAAIK,cAAc,EAAEH,KAAK,CAAC,8BAA8B,CAAC,GAAGG,cAAc;EAE1E,MAAMC,YAAY,GAAGT,OAAO,CAACI,cAAc,CAAC;EAC5C,IAAIK,YAAY,EAAEJ,KAAK,CAAC,uBAAuB,CAAC,GAAGI,YAAY;EAE/D,OAAOJ,KAAK;AACd","ignoreList":[]}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { DEFAULT_HTML_STYLE } from "../../utils/defaultHtmlStyle.js";
|
|
4
|
+
import { expandMentionStylesForIndicators } from "../../utils/expandMentionStylesForIndicators.js";
|
|
5
|
+
import { HEADING_TAGS } from "../formats/EnrichedHeading.js";
|
|
6
|
+
import { indicatorToMentionCssKey, MENTION_STYLE_DEFAULT_KEY } from "./mentionIndicatorCssKey.js";
|
|
7
|
+
import { toColor } from "./toColor.js";
|
|
8
|
+
import { isMentionStyleRecord } from "../../utils/isMentionStyleRecord.js";
|
|
9
|
+
export function mergeWithDefaultHtmlStyle(htmlStyle) {
|
|
10
|
+
const style = htmlStyle ?? {};
|
|
11
|
+
const mentionMap = expandMentionStylesForIndicatorsIncludeDefault(style);
|
|
12
|
+
const converted = {
|
|
13
|
+
...style,
|
|
14
|
+
mention: mentionMap
|
|
15
|
+
};
|
|
16
|
+
const merged = {
|
|
17
|
+
...DEFAULT_HTML_STYLE
|
|
18
|
+
};
|
|
19
|
+
for (const key in converted) {
|
|
20
|
+
if (key === 'mention') {
|
|
21
|
+
merged[key] = {
|
|
22
|
+
...converted.mention
|
|
23
|
+
};
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
merged[key] = {
|
|
27
|
+
...DEFAULT_HTML_STYLE[key],
|
|
28
|
+
...converted[key]
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return merged;
|
|
32
|
+
}
|
|
33
|
+
const ETI_CSS_VARS = {
|
|
34
|
+
codeColor: '--eti-code-color',
|
|
35
|
+
codeBgColor: '--eti-code-bg-color',
|
|
36
|
+
blockquoteBorderColor: '--eti-blockquote-border-color',
|
|
37
|
+
blockquoteBorderWidth: '--eti-blockquote-border-width',
|
|
38
|
+
blockquoteGapWidth: '--eti-blockquote-gap-width',
|
|
39
|
+
blockquoteColor: '--eti-blockquote-color',
|
|
40
|
+
codeblockBgColor: '--eti-codeblock-bg-color',
|
|
41
|
+
codeblockColor: '--eti-codeblock-color',
|
|
42
|
+
codeblockBorderRadius: '--eti-codeblock-border-radius',
|
|
43
|
+
linkColor: '--eti-link-color',
|
|
44
|
+
linkTextDecorationLine: '--eti-link-text-decoration-line',
|
|
45
|
+
ulBulletColor: '--eti-ul-bullet-color',
|
|
46
|
+
ulBulletSize: '--eti-ul-bullet-size',
|
|
47
|
+
ulMarginLeft: '--eti-ul-margin-left',
|
|
48
|
+
ulGapWidth: '--eti-ul-gap-width',
|
|
49
|
+
olMarginLeft: '--eti-ol-margin-left',
|
|
50
|
+
olGapWidth: '--eti-ol-gap-width',
|
|
51
|
+
olMarkerColor: '--eti-ol-marker-color',
|
|
52
|
+
olMarkerFontWeight: '--eti-ol-marker-font-weight',
|
|
53
|
+
checkboxBoxSize: '--eti-checkbox-box-size',
|
|
54
|
+
checkboxGapWidth: '--eti-checkbox-gap-width',
|
|
55
|
+
checkboxMarginLeft: '--eti-checkbox-margin-left',
|
|
56
|
+
checkboxBoxColor: '--eti-checkbox-box-color'
|
|
57
|
+
};
|
|
58
|
+
export const ETI_MENTION_CSS_VARS = {
|
|
59
|
+
color: indicator => `--eti-mention-${indicatorToMentionCssKey(indicator)}-color`,
|
|
60
|
+
backgroundColor: indicator => `--eti-mention-${indicatorToMentionCssKey(indicator)}-background-color`,
|
|
61
|
+
textDecorationLine: indicator => `--eti-mention-${indicatorToMentionCssKey(indicator)}-text-decoration-line`
|
|
62
|
+
};
|
|
63
|
+
function setColorVar(vars, name, value) {
|
|
64
|
+
const c = toColor(value);
|
|
65
|
+
if (c) vars[name] = c;
|
|
66
|
+
}
|
|
67
|
+
function setPxVar(vars, name, n) {
|
|
68
|
+
if (n != null) vars[name] = `${n}px`;
|
|
69
|
+
}
|
|
70
|
+
function applyCodeVars(vars, code) {
|
|
71
|
+
setColorVar(vars, ETI_CSS_VARS.codeColor, code?.color);
|
|
72
|
+
setColorVar(vars, ETI_CSS_VARS.codeBgColor, code?.backgroundColor);
|
|
73
|
+
}
|
|
74
|
+
function applyHeadingVars(vars, htmlStyle) {
|
|
75
|
+
for (const level of HEADING_TAGS) {
|
|
76
|
+
const h = htmlStyle?.[level];
|
|
77
|
+
if (h?.fontSize != null) vars[`--eti-${level}-font-size`] = `${h.fontSize}px`;
|
|
78
|
+
if (h?.bold != null) vars[`--eti-${level}-font-weight`] = h.bold ? 'bold' : 'normal';
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function applyBlockquoteVars(vars, bq) {
|
|
82
|
+
setColorVar(vars, ETI_CSS_VARS.blockquoteBorderColor, bq?.borderColor);
|
|
83
|
+
setPxVar(vars, ETI_CSS_VARS.blockquoteBorderWidth, bq?.borderWidth);
|
|
84
|
+
setPxVar(vars, ETI_CSS_VARS.blockquoteGapWidth, bq?.gapWidth);
|
|
85
|
+
setColorVar(vars, ETI_CSS_VARS.blockquoteColor, bq?.color);
|
|
86
|
+
}
|
|
87
|
+
function applyCodeblockVars(vars, cb) {
|
|
88
|
+
setColorVar(vars, ETI_CSS_VARS.codeblockBgColor, cb?.backgroundColor);
|
|
89
|
+
setColorVar(vars, ETI_CSS_VARS.codeblockColor, cb?.color);
|
|
90
|
+
setPxVar(vars, ETI_CSS_VARS.codeblockBorderRadius, cb?.borderRadius);
|
|
91
|
+
}
|
|
92
|
+
function applyLinkVars(vars, anchor) {
|
|
93
|
+
setColorVar(vars, ETI_CSS_VARS.linkColor, anchor?.color);
|
|
94
|
+
if (anchor?.textDecorationLine != null) {
|
|
95
|
+
vars[ETI_CSS_VARS.linkTextDecorationLine] = anchor.textDecorationLine;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function applyUnorderedListVars(vars, ul) {
|
|
99
|
+
setColorVar(vars, ETI_CSS_VARS.ulBulletColor, ul?.bulletColor);
|
|
100
|
+
setPxVar(vars, ETI_CSS_VARS.ulBulletSize, ul?.bulletSize);
|
|
101
|
+
setPxVar(vars, ETI_CSS_VARS.ulMarginLeft, ul?.marginLeft);
|
|
102
|
+
setPxVar(vars, ETI_CSS_VARS.ulGapWidth, ul?.gapWidth);
|
|
103
|
+
}
|
|
104
|
+
function applyOrderedListVars(vars, ol) {
|
|
105
|
+
setPxVar(vars, ETI_CSS_VARS.olMarginLeft, ol?.marginLeft);
|
|
106
|
+
setPxVar(vars, ETI_CSS_VARS.olGapWidth, ol?.gapWidth);
|
|
107
|
+
setColorVar(vars, ETI_CSS_VARS.olMarkerColor, ol?.markerColor);
|
|
108
|
+
if (ol?.markerFontWeight != null) {
|
|
109
|
+
vars[ETI_CSS_VARS.olMarkerFontWeight] = String(ol.markerFontWeight);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function applyCheckboxListVars(vars, ulCheckbox) {
|
|
113
|
+
setPxVar(vars, ETI_CSS_VARS.checkboxBoxSize, ulCheckbox?.boxSize);
|
|
114
|
+
setPxVar(vars, ETI_CSS_VARS.checkboxGapWidth, ulCheckbox?.gapWidth);
|
|
115
|
+
setPxVar(vars, ETI_CSS_VARS.checkboxMarginLeft, ulCheckbox?.marginLeft);
|
|
116
|
+
setColorVar(vars, ETI_CSS_VARS.checkboxBoxColor, ulCheckbox?.boxColor);
|
|
117
|
+
}
|
|
118
|
+
function applyMentionVars(vars, mention) {
|
|
119
|
+
for (const [indicator, mentionStyle] of Object.entries(mention)) {
|
|
120
|
+
setColorVar(vars, ETI_MENTION_CSS_VARS.color(indicator), mentionStyle.color);
|
|
121
|
+
setColorVar(vars, ETI_MENTION_CSS_VARS.backgroundColor(indicator), mentionStyle.backgroundColor);
|
|
122
|
+
if (mentionStyle.textDecorationLine != null) {
|
|
123
|
+
vars[ETI_MENTION_CSS_VARS.textDecorationLine(indicator)] = mentionStyle.textDecorationLine;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function expandMentionStylesForIndicatorsIncludeDefault(htmlStyle) {
|
|
128
|
+
const mentionIndicators = isMentionStyleRecord(htmlStyle?.mention) ? Object.keys(htmlStyle?.mention) : [];
|
|
129
|
+
if (!mentionIndicators.includes(MENTION_STYLE_DEFAULT_KEY)) mentionIndicators.push(MENTION_STYLE_DEFAULT_KEY);
|
|
130
|
+
return expandMentionStylesForIndicators(htmlStyle?.mention, mentionIndicators);
|
|
131
|
+
}
|
|
132
|
+
export function htmlStyleToCSSVariables(htmlStyle) {
|
|
133
|
+
const vars = {};
|
|
134
|
+
applyCodeVars(vars, htmlStyle?.code);
|
|
135
|
+
applyHeadingVars(vars, htmlStyle);
|
|
136
|
+
applyBlockquoteVars(vars, htmlStyle?.blockquote);
|
|
137
|
+
applyCodeblockVars(vars, htmlStyle?.codeblock);
|
|
138
|
+
applyLinkVars(vars, htmlStyle?.a);
|
|
139
|
+
applyUnorderedListVars(vars, htmlStyle?.ul);
|
|
140
|
+
applyOrderedListVars(vars, htmlStyle?.ol);
|
|
141
|
+
applyCheckboxListVars(vars, htmlStyle?.ulCheckbox);
|
|
142
|
+
applyMentionVars(vars, expandMentionStylesForIndicatorsIncludeDefault(htmlStyle));
|
|
143
|
+
return vars;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=htmlStyleToCSSVariables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DEFAULT_HTML_STYLE","expandMentionStylesForIndicators","HEADING_TAGS","indicatorToMentionCssKey","MENTION_STYLE_DEFAULT_KEY","toColor","isMentionStyleRecord","mergeWithDefaultHtmlStyle","htmlStyle","style","mentionMap","expandMentionStylesForIndicatorsIncludeDefault","converted","mention","merged","key","ETI_CSS_VARS","codeColor","codeBgColor","blockquoteBorderColor","blockquoteBorderWidth","blockquoteGapWidth","blockquoteColor","codeblockBgColor","codeblockColor","codeblockBorderRadius","linkColor","linkTextDecorationLine","ulBulletColor","ulBulletSize","ulMarginLeft","ulGapWidth","olMarginLeft","olGapWidth","olMarkerColor","olMarkerFontWeight","checkboxBoxSize","checkboxGapWidth","checkboxMarginLeft","checkboxBoxColor","ETI_MENTION_CSS_VARS","color","indicator","backgroundColor","textDecorationLine","setColorVar","vars","name","value","c","setPxVar","n","applyCodeVars","code","applyHeadingVars","level","h","fontSize","bold","applyBlockquoteVars","bq","borderColor","borderWidth","gapWidth","applyCodeblockVars","cb","borderRadius","applyLinkVars","anchor","applyUnorderedListVars","ul","bulletColor","bulletSize","marginLeft","applyOrderedListVars","ol","markerColor","markerFontWeight","String","applyCheckboxListVars","ulCheckbox","boxSize","boxColor","applyMentionVars","mentionStyle","Object","entries","mentionIndicators","keys","includes","push","htmlStyleToCSSVariables","blockquote","codeblock","a"],"sourceRoot":"../../../../src","sources":["web/styleConversion/htmlStyleToCSSVariables.ts"],"mappings":";;AAGA,SAASA,kBAAkB,QAAQ,iCAA8B;AACjE,SAASC,gCAAgC,QAAQ,iDAA8C;AAC/F,SAASC,YAAY,QAAQ,+BAA4B;AACzD,SACEC,wBAAwB,EACxBC,yBAAyB,QACpB,6BAA0B;AACjC,SAASC,OAAO,QAAQ,cAAW;AACnC,SAASC,oBAAoB,QAAQ,qCAAkC;AAEvE,OAAO,SAASC,yBAAyBA,CACvCC,SAAqB,EACA;EACrB,M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EqF,SAAS,CAAC;EAC9C1B,aAAa,CAACrB,IAAI,EAAEtC,SAAS,EAAEsF,CAAC,CAAC;EACjCzB,sBAAsB,CAACvB,IAAI,EAAEtC,SAAS,EAAE8D,EAAE,CAAC;EAC3CI,oBAAoB,CAAC5B,IAAI,EAAEtC,SAAS,EAAEmE,EAAE,CAAC;EACzCI,qBAAqB,CAACjC,IAAI,EAAEtC,SAAS,EAAEwE,UAAU,CAAC;EAClDG,gBAAgB,CACdrC,IAAI,EACJnC,8CAA8C,CAACH,SAAS,CAC1D,CAAC;EACD,OAAOsC,IAAI;AACb","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export const MENTION_STYLE_DEFAULT_KEY = 'default';
|
|
4
|
+
export function indicatorToMentionCssKey(indicator) {
|
|
5
|
+
if (indicator === MENTION_STYLE_DEFAULT_KEY) {
|
|
6
|
+
return MENTION_STYLE_DEFAULT_KEY;
|
|
7
|
+
}
|
|
8
|
+
const cp = indicator.codePointAt(0);
|
|
9
|
+
if (cp === undefined) {
|
|
10
|
+
return 'u0000';
|
|
11
|
+
}
|
|
12
|
+
const hex = cp.toString(16).toUpperCase();
|
|
13
|
+
return 'u' + hex.padStart(Math.max(4, hex.length), '0');
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=mentionIndicatorCssKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MENTION_STYLE_DEFAULT_KEY","indicatorToMentionCssKey","indicator","cp","codePointAt","undefined","hex","toString","toUpperCase","padStart","Math","max","length"],"sourceRoot":"../../../../src","sources":["web/styleConversion/mentionIndicatorCssKey.ts"],"mappings":";;AAAA,OAAO,MAAMA,yBAAyB,GAAG,SAAS;AAElD,OAAO,SAASC,wBAAwBA,CAACC,SAAiB,EAAU;EAClE,IAAIA,SAAS,KAAKF,yBAAyB,EAAE;IAC3C,OAAOA,yBAAyB;EAClC;EAEA,MAAMG,EAAE,GAAGD,SAAS,CAACE,WAAW,CAAC,CAAC,CAAC;EACnC,IAAID,EAAE,KAAKE,SAAS,EAAE;IACpB,OAAO,OAAO;EAChB;EACA,MAAMC,GAAG,GAAGH,EAAE,CAACI,QAAQ,CAAC,EAAE,CAAC,CAACC,WAAW,CAAC,CAAC;EACzC,OAAO,GAAG,GAAGF,GAAG,CAACG,QAAQ,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEL,GAAG,CAACM,MAAM,CAAC,EAAE,GAAG,CAAC;AACzD","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function toColor(value) {
|
|
4
|
+
if (typeof value === 'string') return value;
|
|
5
|
+
if (typeof value === 'number') {
|
|
6
|
+
// eslint-disable-next-line no-bitwise
|
|
7
|
+
const r = value >>> 24 & 0xff;
|
|
8
|
+
// eslint-disable-next-line no-bitwise
|
|
9
|
+
const g = value >>> 16 & 0xff;
|
|
10
|
+
// eslint-disable-next-line no-bitwise
|
|
11
|
+
const b = value >>> 8 & 0xff;
|
|
12
|
+
// eslint-disable-next-line no-bitwise
|
|
13
|
+
const a = (value & 0xff) / 255;
|
|
14
|
+
return `rgba(${r}, ${g}, ${b}, ${a})`;
|
|
15
|
+
}
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=toColor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["toColor","value","r","g","b","a","undefined"],"sourceRoot":"../../../../src","sources":["web/styleConversion/toColor.ts"],"mappings":";;AAEA,OAAO,SAASA,OAAOA,CAACC,KAAkB,EAAsB;EAC9D,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE,OAAOA,KAAK;EAC3C,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B;IACA,MAAMC,CAAC,GAAID,KAAK,KAAK,EAAE,GAAI,IAAI;IAC/B;IACA,MAAME,CAAC,GAAIF,KAAK,KAAK,EAAE,GAAI,IAAI;IAC/B;IACA,MAAMG,CAAC,GAAIH,KAAK,KAAK,CAAC,GAAI,IAAI;IAC9B;IACA,MAAMI,CAAC,GAAG,CAACJ,KAAK,GAAG,IAAI,IAAI,GAAG;IAC9B,OAAO,QAAQC,CAAC,KAAKC,CAAC,KAAKC,CAAC,KAAKC,CAAC,GAAG;EACvC;EACA,OAAOC,SAAS;AAClB","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { checkboxHtmlForTiptap, checkboxHtmlFromTiptap } from "./checkboxHtmlNormalizer.js";
|
|
4
|
+
export function prepareHtmlForTiptap(html) {
|
|
5
|
+
html = checkboxHtmlForTiptap(html);
|
|
6
|
+
html = html.replace(/<br\s*\/?>/gi, '<p></p>');
|
|
7
|
+
return html;
|
|
8
|
+
}
|
|
9
|
+
export function normalizeHtmlFromTiptap(html) {
|
|
10
|
+
html = checkboxHtmlFromTiptap(html);
|
|
11
|
+
|
|
12
|
+
// Strip <p> wrappers inside <li> elements.
|
|
13
|
+
// TipTap renders <li><p>text</p></li> but native expects <li>text</li>.
|
|
14
|
+
// This regex is safe because EnrichedListItem.content is 'paragraph', which
|
|
15
|
+
// prevents TipTap from ever emitting nested lists
|
|
16
|
+
html = html.replace(/<li([^>]*)><p>(.*?)<\/p><\/li>/gs, '<li$1>$2</li>');
|
|
17
|
+
|
|
18
|
+
// Convert remaining empty <p></p> to <br> (outside of lists)
|
|
19
|
+
html = html.replace(/<p><\/p>/g, '<br>');
|
|
20
|
+
|
|
21
|
+
// Convert <img> tags to self-closing tags
|
|
22
|
+
html = html.replace(/<img\b([^>]*)>/gi, (_, attrs) => {
|
|
23
|
+
if (attrs.trimEnd().endsWith('/')) {
|
|
24
|
+
return `<img${attrs}>`;
|
|
25
|
+
}
|
|
26
|
+
return `<img${attrs}/>`;
|
|
27
|
+
});
|
|
28
|
+
return `<html>${html}</html>`;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=tiptapHtmlNormalizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["checkboxHtmlForTiptap","checkboxHtmlFromTiptap","prepareHtmlForTiptap","html","replace","normalizeHtmlFromTiptap","_","attrs","trimEnd","endsWith"],"sourceRoot":"../../../src","sources":["web/tiptapHtmlNormalizer.ts"],"mappings":";;AAAA,SACEA,qBAAqB,EACrBC,sBAAsB,QACjB,6BAA0B;AAEjC,OAAO,SAASC,oBAAoBA,CAACC,IAAY,EAAU;EACzDA,IAAI,GAAGH,qBAAqB,CAACG,IAAI,CAAC;EAClCA,IAAI,GAAGA,IAAI,CAACC,OAAO,CAAC,cAAc,EAAE,SAAS,CAAC;EAC9C,OAAOD,IAAI;AACb;AAEA,OAAO,SAASE,uBAAuBA,CAACF,IAAY,EAAU;EAC5DA,IAAI,GAAGF,sBAAsB,CAACE,IAAI,CAAC;;EAEnC;EACA;EACA;EACA;EACAA,IAAI,GAAGA,IAAI,CAACC,OAAO,CAAC,kCAAkC,EAAE,eAAe,CAAC;;EAExE;EACAD,IAAI,GAAGA,IAAI,CAACC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC;;EAExC;EACAD,IAAI,GAAGA,IAAI,CAACC,OAAO,CAAC,kBAAkB,EAAE,CAACE,CAAC,EAAEC,KAAa,KAAK;IAC5D,IAAIA,KAAK,CAACC,OAAO,CAAC,CAAC,CAACC,QAAQ,CAAC,GAAG,CAAC,EAAE;MACjC,OAAO,OAAOF,KAAK,GAAG;IACxB;IACA,OAAO,OAAOA,KAAK,IAAI;EACzB,CAAC,CAAC;EAEF,OAAO,SAASJ,IAAI,SAAS;AAC/B","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useOnEditorChange } from "./useOnEditorChange.js";
|
|
4
|
+
import { normalizeHtmlFromTiptap } from "./tiptapHtmlNormalizer.js";
|
|
5
|
+
export const useOnChangeHtml = (editor, onChangeHtml) => {
|
|
6
|
+
useOnEditorChange(editor, onChangeHtml, e => normalizeHtmlFromTiptap(e.getHTML()));
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=useOnChangeHtml.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useOnEditorChange","normalizeHtmlFromTiptap","useOnChangeHtml","editor","onChangeHtml","e","getHTML"],"sourceRoot":"../../../src","sources":["web/useOnChangeHtml.ts"],"mappings":";;AAGA,SAASA,iBAAiB,QAAQ,wBAAqB;AACvD,SAASC,uBAAuB,QAAQ,2BAAwB;AAEhE,OAAO,MAAMC,eAAe,GAAGA,CAC7BC,MAAc,EACdC,YAAmE,KAChE;EACHJ,iBAAiB,CAACG,MAAM,EAAEC,YAAY,EAAGC,CAAC,IACxCJ,uBAAuB,CAACI,CAAC,CAACC,OAAO,CAAC,CAAC,CACrC,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { adaptWebToNativeEvent } from "./adaptWebToNativeEvent.js";
|
|
5
|
+
import { isAnyParagraphFormatActive, isFormatBlocked } from "./formats/formatRules.js";
|
|
6
|
+
export const useOnChangeState = (editor, htmlStyle, onChangeState) => {
|
|
7
|
+
const lastStateHashRef = useRef(null);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (!editor || !onChangeState) return;
|
|
10
|
+
const handleUpdate = () => {
|
|
11
|
+
const state = buildState(editor, htmlStyle);
|
|
12
|
+
const stateHash = hashState(state);
|
|
13
|
+
if (lastStateHashRef.current === stateHash) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
lastStateHashRef.current = stateHash;
|
|
17
|
+
onChangeState(adaptWebToNativeEvent(null, state));
|
|
18
|
+
};
|
|
19
|
+
handleUpdate();
|
|
20
|
+
editor.on('transaction', handleUpdate);
|
|
21
|
+
return () => {
|
|
22
|
+
editor.off('transaction', handleUpdate);
|
|
23
|
+
};
|
|
24
|
+
}, [editor, onChangeState, htmlStyle]);
|
|
25
|
+
};
|
|
26
|
+
function buildState(editor, htmlStyle) {
|
|
27
|
+
const isAnyBlockActive = isAnyParagraphFormatActive(editor);
|
|
28
|
+
function inlineFormat(tiptapName, isConflicting) {
|
|
29
|
+
return {
|
|
30
|
+
isActive: editor.isActive(tiptapName),
|
|
31
|
+
isConflicting,
|
|
32
|
+
isBlocking: isFormatBlocked(tiptapName, editor, htmlStyle)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function paragraphFormat(isActive, additionalIsConflicting = false) {
|
|
36
|
+
return {
|
|
37
|
+
isActive,
|
|
38
|
+
isConflicting: !isActive && isAnyBlockActive || additionalIsConflicting,
|
|
39
|
+
isBlocking: false
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
bold: inlineFormat('bold', false),
|
|
44
|
+
italic: inlineFormat('italic', false),
|
|
45
|
+
underline: inlineFormat('underline', false),
|
|
46
|
+
strikeThrough: inlineFormat('strike', false),
|
|
47
|
+
inlineCode: inlineFormat('code', editor.isActive('link')),
|
|
48
|
+
h1: paragraphFormat(editor.isActive('heading', {
|
|
49
|
+
level: 1
|
|
50
|
+
})),
|
|
51
|
+
h2: paragraphFormat(editor.isActive('heading', {
|
|
52
|
+
level: 2
|
|
53
|
+
})),
|
|
54
|
+
h3: paragraphFormat(editor.isActive('heading', {
|
|
55
|
+
level: 3
|
|
56
|
+
})),
|
|
57
|
+
h4: paragraphFormat(editor.isActive('heading', {
|
|
58
|
+
level: 4
|
|
59
|
+
})),
|
|
60
|
+
h5: paragraphFormat(editor.isActive('heading', {
|
|
61
|
+
level: 5
|
|
62
|
+
})),
|
|
63
|
+
h6: paragraphFormat(editor.isActive('heading', {
|
|
64
|
+
level: 6
|
|
65
|
+
})),
|
|
66
|
+
blockQuote: paragraphFormat(editor.isActive('blockquote')),
|
|
67
|
+
codeBlock: paragraphFormat(editor.isActive('codeBlock'), editor.isActive('link')),
|
|
68
|
+
orderedList: paragraphFormat(editor.isActive('orderedList')),
|
|
69
|
+
unorderedList: paragraphFormat(editor.isActive('unorderedList')),
|
|
70
|
+
checkboxList: paragraphFormat(editor.isActive('checkboxList')),
|
|
71
|
+
link: inlineFormat('link', editor.isActive('code') || editor.isActive('link') || editor.isActive('codeBlock')),
|
|
72
|
+
mention: inlineFormat('mention', editor.isActive('code') || editor.isActive('codeBlock')),
|
|
73
|
+
image: {
|
|
74
|
+
isActive: editor.isActive('image'),
|
|
75
|
+
isConflicting: editor.isActive('link'),
|
|
76
|
+
isBlocking: isFormatBlocked('image', editor, htmlStyle)
|
|
77
|
+
},
|
|
78
|
+
alignment: 'left'
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function hashState(state) {
|
|
82
|
+
return Object.values(state).map(formatState => String(getFormatHash(formatState.isActive, formatState.isConflicting, formatState.isBlocking))).join('');
|
|
83
|
+
}
|
|
84
|
+
function getFormatHash(isActive, isConflicting, isBlocking) {
|
|
85
|
+
// eslint-disable-next-line no-bitwise
|
|
86
|
+
return +isActive << 2 | +isConflicting << 1 | +isBlocking << 0;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=useOnChangeState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","adaptWebToNativeEvent","isAnyParagraphFormatActive","isFormatBlocked","useOnChangeState","editor","htmlStyle","onChangeState","lastStateHashRef","handleUpdate","state","buildState","stateHash","hashState","current","on","off","isAnyBlockActive","inlineFormat","tiptapName","isConflicting","isActive","isBlocking","paragraphFormat","additionalIsConflicting","bold","italic","underline","strikeThrough","inlineCode","h1","level","h2","h3","h4","h5","h6","blockQuote","codeBlock","orderedList","unorderedList","checkboxList","link","mention","image","alignment","Object","values","map","formatState","String","getFormatHash","join"],"sourceRoot":"../../../src","sources":["web/useOnChangeState.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4B,WAAW,CAAC7B,aAAa,EACzB6B,WAAW,CAAC3B,UACd,CACF,CACF,CAAC,CACA8B,IAAI,CAAC,EAAE,CAAC;AACb;AAEA,SAASD,aAAaA,CACpB9B,QAAiB,EACjBD,aAAsB,EACtBE,UAAmB,EACX;EACR;EACA,OAAQ,CAACD,QAAQ,IAAI,CAAC,GAAK,CAACD,aAAa,IAAI,CAAE,GAAI,CAACE,UAAU,IAAI,CAAE;AACtE","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { nativeLeafText } from "./positionMapping.js";
|
|
4
|
+
import { useOnEditorChange } from "./useOnEditorChange.js";
|
|
5
|
+
export const useOnChangeText = (editor, onChangeText) => {
|
|
6
|
+
useOnEditorChange(editor, onChangeText, e => {
|
|
7
|
+
const doc = e.state.doc;
|
|
8
|
+
return nativeLeafText(doc, 0, doc.content.size);
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=useOnChangeText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["nativeLeafText","useOnEditorChange","useOnChangeText","editor","onChangeText","e","doc","state","content","size"],"sourceRoot":"../../../src","sources":["web/useOnChangeText.ts"],"mappings":";;AAGA,SAASA,cAAc,QAAQ,sBAAmB;AAClD,SAASC,iBAAiB,QAAQ,wBAAqB;AAEvD,OAAO,MAAMC,eAAe,GAAGA,CAC7BC,MAAc,EACdC,YAAmE,KAChE;EACHH,iBAAiB,CAACE,MAAM,EAAEC,YAAY,EAAGC,CAAC,IAAK;IAC7C,MAAMC,GAAG,GAAGD,CAAC,CAACE,KAAK,CAACD,GAAG;IACvB,OAAON,cAAc,CAACM,GAAG,EAAE,CAAC,EAAEA,GAAG,CAACE,OAAO,CAACC,IAAI,CAAC;EACjD,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|