react-native-enriched-html 1.0.0 → 1.0.1
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/android/src/main/java/com/swmansion/enriched/common/EnrichedSpanFlags.kt +39 -0
- package/android/src/main/java/com/swmansion/enriched/common/parser/EnrichedParser.java +43 -20
- package/android/src/main/java/com/swmansion/enriched/common/parser/EnrichedSpanFactory.kt +1 -0
- package/android/src/main/java/com/swmansion/enriched/text/EnrichedTextSpanFactory.kt +1 -0
- package/android/src/main/java/com/swmansion/enriched/text/EnrichedTextView.kt +2 -1
- package/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputSpannableFactory.kt +2 -1
- package/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputView.kt +8 -5
- package/android/src/main/java/com/swmansion/enriched/textinput/events/MentionHandler.kt +12 -2
- package/android/src/main/java/com/swmansion/enriched/textinput/events/OnMentionEvent.kt +6 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/styles/AlignmentStyles.kt +6 -7
- package/android/src/main/java/com/swmansion/enriched/textinput/styles/InlineStyles.kt +13 -1
- package/android/src/main/java/com/swmansion/enriched/textinput/styles/ListStyles.kt +4 -3
- package/android/src/main/java/com/swmansion/enriched/textinput/styles/ParagraphStyles.kt +4 -3
- package/android/src/main/java/com/swmansion/enriched/textinput/styles/ParametrizedStyles.kt +38 -11
- package/android/src/main/java/com/swmansion/enriched/textinput/utils/EnrichedSelection.kt +2 -0
- package/android/src/main/java/com/swmansion/enriched/textinput/utils/EnrichedSpannable.kt +2 -1
- package/android/src/main/java/com/swmansion/enriched/textinput/utils/Utils.kt +2 -1
- package/cpp/parser/GumboNormalizer.c +61 -3
- package/cpp/tests/GumboParserTest.cpp +54 -0
- package/ios/EnrichedTextInputView.mm +37 -25
- package/ios/extensions/LayoutManagerExtension.mm +73 -62
- package/ios/extensions/StringExtension.mm +75 -0
- package/ios/htmlParser/HtmlParser.h +4 -1
- package/ios/htmlParser/HtmlParser.mm +23 -5
- package/ios/inputHtmlParser/InputHtmlParser.mm +6 -3
- package/ios/interfaces/StyleHeaders.h +4 -0
- package/ios/styles/LinkStyle.mm +20 -34
- package/ios/styles/MentionStyle.mm +55 -4
- package/ios/textHtmlParser/TextHtmlParser.mm +2 -1
- package/ios/utils/ParagraphAttributesUtils.mm +7 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/expandMentionStylesForIndicators.js +2 -3
- package/lib/module/utils/expandMentionStylesForIndicators.js.map +1 -1
- package/lib/module/utils/normalizeHtmlStyle.js +1 -1
- package/lib/module/utils/normalizeHtmlStyle.js.map +1 -1
- package/lib/module/web/EnrichedText.css +343 -0
- package/lib/module/web/EnrichedText.js +55 -0
- package/lib/module/web/EnrichedText.js.map +1 -0
- package/lib/module/web/EnrichedTextInput.js +54 -52
- package/lib/module/web/EnrichedTextInput.js.map +1 -1
- package/lib/module/web/constants/brokenImageGlyph.js +9 -0
- package/lib/module/web/constants/brokenImageGlyph.js.map +1 -0
- package/lib/module/web/constants/classNames.js +5 -0
- package/lib/module/web/constants/classNames.js.map +1 -0
- package/lib/module/web/emitLinkDetected.js +12 -0
- package/lib/module/web/emitLinkDetected.js.map +1 -0
- package/lib/module/web/formats/EnrichedBlockquote.js +1 -1
- package/lib/module/web/formats/EnrichedBlockquote.js.map +1 -1
- package/lib/module/web/formats/EnrichedCheckboxList.js +2 -2
- package/lib/module/web/formats/EnrichedCheckboxList.js.map +1 -1
- package/lib/module/web/formats/EnrichedCodeBlock.js +1 -1
- package/lib/module/web/formats/EnrichedCodeBlock.js.map +1 -1
- package/lib/module/web/formats/EnrichedHeading.js +1 -1
- package/lib/module/web/formats/EnrichedHeading.js.map +1 -1
- package/lib/module/web/formats/EnrichedImageNodeView.js +1 -1
- package/lib/module/web/formats/EnrichedImageNodeView.js.map +1 -1
- package/lib/module/web/formats/EnrichedLink.js +43 -3
- package/lib/module/web/formats/EnrichedLink.js.map +1 -1
- package/lib/module/web/formats/EnrichedOrderedList.js +2 -2
- package/lib/module/web/formats/EnrichedOrderedList.js.map +1 -1
- package/lib/module/web/formats/EnrichedTextAlign.js +82 -0
- package/lib/module/web/formats/EnrichedTextAlign.js.map +1 -0
- package/lib/module/web/formats/EnrichedUnorderedList.js +2 -2
- package/lib/module/web/formats/EnrichedUnorderedList.js.map +1 -1
- package/lib/module/web/formats/applyWrappingListToSelection.js +3 -2
- package/lib/module/web/formats/applyWrappingListToSelection.js.map +1 -1
- package/lib/module/web/formats/formatRules.js +39 -3
- package/lib/module/web/formats/formatRules.js.map +1 -1
- package/lib/module/web/formats/listKeyboard.js +4 -1
- package/lib/module/web/formats/listKeyboard.js.map +1 -1
- package/lib/module/web/normalization/checkboxHtmlNormalizer.js.map +1 -0
- package/lib/module/web/normalization/htmlNormalizer.js +514 -0
- package/lib/module/web/normalization/htmlNormalizer.js.map +1 -0
- package/lib/module/web/normalization/prepareHtmlForWeb.js +78 -0
- package/lib/module/web/normalization/prepareHtmlForWeb.js.map +1 -0
- package/lib/module/web/{tiptapHtmlNormalizer.js → normalization/tiptapHtmlNormalizer.js} +6 -2
- package/lib/module/web/normalization/tiptapHtmlNormalizer.js.map +1 -0
- package/lib/module/web/pmPlugins/AutolinkPlugin/autolinkRegex.js +27 -0
- package/lib/module/web/pmPlugins/AutolinkPlugin/autolinkRegex.js.map +1 -0
- package/lib/module/web/pmPlugins/AutolinkPlugin/index.js +178 -0
- package/lib/module/web/pmPlugins/AutolinkPlugin/index.js.map +1 -0
- package/lib/module/web/pmPlugins/MentionPlugin/index.js +1 -1
- package/lib/module/web/pmPlugins/MentionPlugin/index.js.map +1 -1
- package/lib/module/web/pmPlugins/MentionPlugin/makeMentionPluginState.js +23 -4
- package/lib/module/web/pmPlugins/MentionPlugin/makeMentionPluginState.js.map +1 -1
- package/lib/module/web/pmPlugins/MentionPlugin/setMention.js +17 -18
- package/lib/module/web/pmPlugins/MentionPlugin/setMention.js.map +1 -1
- package/lib/module/web/pmPlugins/MentionPlugin/useMentionEvents.js +105 -0
- package/lib/module/web/pmPlugins/MentionPlugin/useMentionEvents.js.map +1 -0
- package/lib/module/web/pmPlugins/ShortcutPlugin.js +11 -0
- package/lib/module/web/pmPlugins/ShortcutPlugin.js.map +1 -1
- package/lib/module/web/pmPlugins/StrictMarksPlugin.js +2 -0
- package/lib/module/web/pmPlugins/StrictMarksPlugin.js.map +1 -1
- package/lib/module/web/pmPlugins/StripBoldInStyledHeadingsPlugin.js.map +1 -1
- package/lib/module/web/sanitization/htmlSanitizer.js +10 -0
- package/lib/module/web/sanitization/htmlSanitizer.js.map +1 -0
- package/lib/module/web/styleConversion/buildMentionRulesCSS.js +12 -6
- package/lib/module/web/styleConversion/buildMentionRulesCSS.js.map +1 -1
- package/lib/module/web/styleConversion/enrichedBaseStyleToCSSProperties.js +159 -0
- package/lib/module/web/styleConversion/enrichedBaseStyleToCSSProperties.js.map +1 -0
- package/lib/module/web/styleConversion/enrichedInputStyleToCSSProperties.js +3 -155
- package/lib/module/web/styleConversion/enrichedInputStyleToCSSProperties.js.map +1 -1
- package/lib/module/web/styleConversion/enrichedTextStyleToCSSProperties.js +44 -0
- package/lib/module/web/styleConversion/enrichedTextStyleToCSSProperties.js.map +1 -0
- package/lib/module/web/styleConversion/{enrichedInputThemingToCSSProperties.js → enrichedThemingToCSSProperties.js} +3 -3
- package/lib/module/web/styleConversion/enrichedThemingToCSSProperties.js.map +1 -0
- package/lib/module/web/styleConversion/htmlStyleToCSSVariables.js +87 -64
- package/lib/module/web/styleConversion/htmlStyleToCSSVariables.js.map +1 -1
- package/lib/module/web/styleConversion/inlineImageCSSVariables.js +7 -0
- package/lib/module/web/styleConversion/inlineImageCSSVariables.js.map +1 -0
- package/lib/module/web/useImageErrorFallback.js +33 -0
- package/lib/module/web/useImageErrorFallback.js.map +1 -0
- package/lib/module/web/useOnChangeHtml.js +1 -1
- package/lib/module/web/useOnChangeHtml.js.map +1 -1
- package/lib/module/web/useOnChangeState.js +6 -3
- package/lib/module/web/useOnChangeState.js.map +1 -1
- package/lib/module/web/useOnLinkDetected.js +32 -45
- package/lib/module/web/useOnLinkDetected.js.map +1 -1
- package/lib/module/web/usePressInteractions.js +19 -0
- package/lib/module/web/usePressInteractions.js.map +1 -0
- package/lib/module/web/useStableRef.js +13 -0
- package/lib/module/web/useStableRef.js.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/native/EnrichedText.d.ts +1 -1
- package/lib/typescript/src/native/EnrichedText.d.ts.map +1 -1
- package/lib/typescript/src/native/EnrichedTextInput.d.ts +1 -1
- package/lib/typescript/src/native/EnrichedTextInput.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +1 -1
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/expandMentionStylesForIndicators.d.ts +1 -1
- package/lib/typescript/src/utils/expandMentionStylesForIndicators.d.ts.map +1 -1
- package/lib/typescript/src/utils/normalizeHtmlStyle.d.ts.map +1 -1
- package/lib/typescript/src/web/EnrichedText.d.ts +4 -0
- package/lib/typescript/src/web/EnrichedText.d.ts.map +1 -0
- package/lib/typescript/src/web/EnrichedTextInput.d.ts +2 -2
- package/lib/typescript/src/web/EnrichedTextInput.d.ts.map +1 -1
- package/lib/typescript/src/web/constants/brokenImageGlyph.d.ts +3 -0
- package/lib/typescript/src/web/constants/brokenImageGlyph.d.ts.map +1 -0
- package/lib/typescript/src/web/constants/classNames.d.ts +3 -0
- package/lib/typescript/src/web/constants/classNames.d.ts.map +1 -0
- package/lib/typescript/src/web/emitLinkDetected.d.ts +10 -0
- package/lib/typescript/src/web/emitLinkDetected.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedBlockquote.d.ts.map +1 -1
- package/lib/typescript/src/web/formats/EnrichedCheckboxList.d.ts.map +1 -1
- package/lib/typescript/src/web/formats/EnrichedCodeBlock.d.ts.map +1 -1
- package/lib/typescript/src/web/formats/EnrichedHeading.d.ts.map +1 -1
- package/lib/typescript/src/web/formats/EnrichedImageNodeView.d.ts +1 -1
- package/lib/typescript/src/web/formats/EnrichedImageNodeView.d.ts.map +1 -1
- package/lib/typescript/src/web/formats/EnrichedLink.d.ts +4 -1
- package/lib/typescript/src/web/formats/EnrichedLink.d.ts.map +1 -1
- package/lib/typescript/src/web/formats/EnrichedOrderedList.d.ts.map +1 -1
- package/lib/typescript/src/web/formats/EnrichedTextAlign.d.ts +2 -0
- package/lib/typescript/src/web/formats/EnrichedTextAlign.d.ts.map +1 -0
- package/lib/typescript/src/web/formats/EnrichedUnorderedList.d.ts.map +1 -1
- package/lib/typescript/src/web/formats/applyWrappingListToSelection.d.ts.map +1 -1
- package/lib/typescript/src/web/formats/formatRules.d.ts +3 -1
- package/lib/typescript/src/web/formats/formatRules.d.ts.map +1 -1
- package/lib/typescript/src/web/formats/listKeyboard.d.ts.map +1 -1
- package/lib/typescript/src/web/normalization/checkboxHtmlNormalizer.d.ts.map +1 -0
- package/lib/typescript/src/web/normalization/htmlNormalizer.d.ts +2 -0
- package/lib/typescript/src/web/normalization/htmlNormalizer.d.ts.map +1 -0
- package/lib/typescript/src/web/normalization/prepareHtmlForWeb.d.ts +2 -0
- package/lib/typescript/src/web/normalization/prepareHtmlForWeb.d.ts.map +1 -0
- package/lib/typescript/src/web/normalization/tiptapHtmlNormalizer.d.ts +3 -0
- package/lib/typescript/src/web/normalization/tiptapHtmlNormalizer.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/AutolinkPlugin/autolinkRegex.d.ts +7 -0
- package/lib/typescript/src/web/pmPlugins/AutolinkPlugin/autolinkRegex.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/AutolinkPlugin/index.d.ts +8 -0
- package/lib/typescript/src/web/pmPlugins/AutolinkPlugin/index.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/index.d.ts +1 -1
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/index.d.ts.map +1 -1
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/makeMentionPluginState.d.ts.map +1 -1
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/setMention.d.ts.map +1 -1
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/useMentionEvents.d.ts +4 -0
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/useMentionEvents.d.ts.map +1 -0
- package/lib/typescript/src/web/pmPlugins/ShortcutPlugin.d.ts.map +1 -1
- package/lib/typescript/src/web/pmPlugins/StrictMarksPlugin.d.ts.map +1 -1
- package/lib/typescript/src/web/pmPlugins/StripBoldInStyledHeadingsPlugin.d.ts +6 -1
- package/lib/typescript/src/web/pmPlugins/StripBoldInStyledHeadingsPlugin.d.ts.map +1 -1
- package/lib/typescript/src/web/sanitization/htmlSanitizer.d.ts +2 -0
- package/lib/typescript/src/web/sanitization/htmlSanitizer.d.ts.map +1 -0
- package/lib/typescript/src/web/styleConversion/buildMentionRulesCSS.d.ts +2 -2
- package/lib/typescript/src/web/styleConversion/buildMentionRulesCSS.d.ts.map +1 -1
- package/lib/typescript/src/web/styleConversion/enrichedBaseStyleToCSSProperties.d.ts +8 -0
- package/lib/typescript/src/web/styleConversion/enrichedBaseStyleToCSSProperties.d.ts.map +1 -0
- package/lib/typescript/src/web/styleConversion/enrichedInputStyleToCSSProperties.d.ts +2 -5
- package/lib/typescript/src/web/styleConversion/enrichedInputStyleToCSSProperties.d.ts.map +1 -1
- package/lib/typescript/src/web/styleConversion/enrichedTextStyleToCSSProperties.d.ts +4 -0
- package/lib/typescript/src/web/styleConversion/enrichedTextStyleToCSSProperties.d.ts.map +1 -0
- package/lib/typescript/src/web/styleConversion/{enrichedInputThemingToCSSProperties.d.ts → enrichedThemingToCSSProperties.d.ts} +1 -1
- package/lib/typescript/src/web/styleConversion/enrichedThemingToCSSProperties.d.ts.map +1 -0
- package/lib/typescript/src/web/styleConversion/htmlStyleToCSSVariables.d.ts +5 -4
- package/lib/typescript/src/web/styleConversion/htmlStyleToCSSVariables.d.ts.map +1 -1
- package/lib/typescript/src/web/styleConversion/inlineImageCSSVariables.d.ts +3 -0
- package/lib/typescript/src/web/styleConversion/inlineImageCSSVariables.d.ts.map +1 -0
- package/lib/typescript/src/web/useImageErrorFallback.d.ts +3 -0
- package/lib/typescript/src/web/useImageErrorFallback.d.ts.map +1 -0
- package/lib/typescript/src/web/useOnChangeState.d.ts.map +1 -1
- package/lib/typescript/src/web/useOnLinkDetected.d.ts +2 -2
- package/lib/typescript/src/web/useOnLinkDetected.d.ts.map +1 -1
- package/lib/typescript/src/web/usePressInteractions.d.ts +2 -0
- package/lib/typescript/src/web/usePressInteractions.d.ts.map +1 -0
- package/lib/typescript/src/web/useStableRef.d.ts +3 -0
- package/lib/typescript/src/web/useStableRef.d.ts.map +1 -0
- package/package.json +54 -28
- package/src/index.tsx +1 -0
- package/src/types.ts +5 -3
- package/src/utils/expandMentionStylesForIndicators.ts +3 -3
- package/src/utils/normalizeHtmlStyle.ts +2 -1
- package/src/web/EnrichedText.css +343 -0
- package/src/web/EnrichedText.tsx +82 -0
- package/src/web/EnrichedTextInput.tsx +69 -55
- package/src/web/constants/brokenImageGlyph.ts +7 -0
- package/src/web/constants/classNames.ts +2 -0
- package/src/web/emitLinkDetected.ts +29 -0
- package/src/web/formats/EnrichedBlockquote.ts +2 -1
- package/src/web/formats/EnrichedCheckboxList.ts +5 -2
- package/src/web/formats/EnrichedCodeBlock.ts +2 -1
- package/src/web/formats/EnrichedHeading.ts +2 -1
- package/src/web/formats/EnrichedImageNodeView.tsx +1 -3
- package/src/web/formats/EnrichedLink.ts +59 -4
- package/src/web/formats/EnrichedOrderedList.ts +5 -2
- package/src/web/formats/EnrichedTextAlign.ts +88 -0
- package/src/web/formats/EnrichedUnorderedList.ts +5 -2
- package/src/web/formats/applyWrappingListToSelection.ts +4 -4
- package/src/web/formats/formatRules.ts +48 -4
- package/src/web/formats/listKeyboard.ts +6 -1
- package/src/web/normalization/htmlNormalizer.ts +656 -0
- package/src/web/normalization/prepareHtmlForWeb.ts +93 -0
- package/src/web/{tiptapHtmlNormalizer.ts → normalization/tiptapHtmlNormalizer.ts} +12 -2
- package/src/web/pmPlugins/AutolinkPlugin/autolinkRegex.ts +43 -0
- package/src/web/pmPlugins/AutolinkPlugin/index.ts +274 -0
- package/src/web/pmPlugins/MentionPlugin/index.ts +1 -1
- package/src/web/pmPlugins/MentionPlugin/makeMentionPluginState.ts +32 -5
- package/src/web/pmPlugins/MentionPlugin/setMention.ts +19 -29
- package/src/web/pmPlugins/MentionPlugin/useMentionEvents.ts +114 -0
- package/src/web/pmPlugins/ShortcutPlugin.ts +7 -0
- package/src/web/pmPlugins/StrictMarksPlugin.ts +3 -0
- package/src/web/pmPlugins/StripBoldInStyledHeadingsPlugin.ts +41 -36
- package/src/web/sanitization/htmlSanitizer.ts +8 -0
- package/src/web/styleConversion/buildMentionRulesCSS.ts +30 -11
- package/src/web/styleConversion/enrichedBaseStyleToCSSProperties.ts +228 -0
- package/src/web/styleConversion/enrichedInputStyleToCSSProperties.ts +6 -217
- package/src/web/styleConversion/enrichedTextStyleToCSSProperties.ts +53 -0
- package/src/web/styleConversion/{enrichedInputThemingToCSSProperties.ts → enrichedThemingToCSSProperties.ts} +4 -4
- package/src/web/styleConversion/htmlStyleToCSSVariables.ts +121 -70
- package/src/web/styleConversion/inlineImageCSSVariables.ts +6 -0
- package/src/web/useImageErrorFallback.ts +37 -0
- package/src/web/useOnChangeHtml.ts +1 -1
- package/src/web/useOnChangeState.ts +7 -5
- package/src/web/useOnLinkDetected.ts +38 -50
- package/src/web/usePressInteractions.tsx +22 -0
- package/src/web/useStableRef.ts +12 -0
- package/lib/module/web/EnrichedTextInput.css +0 -201
- package/lib/module/web/checkboxHtmlNormalizer.js.map +0 -1
- package/lib/module/web/pmPlugins/MentionPlugin/subscribeMentionEvents.js +0 -100
- package/lib/module/web/pmPlugins/MentionPlugin/subscribeMentionEvents.js.map +0 -1
- package/lib/module/web/styleConversion/enrichedInputThemingToCSSProperties.js.map +0 -1
- package/lib/module/web/tiptapHtmlNormalizer.js.map +0 -1
- package/lib/typescript/src/web/checkboxHtmlNormalizer.d.ts.map +0 -1
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/subscribeMentionEvents.d.ts +0 -4
- package/lib/typescript/src/web/pmPlugins/MentionPlugin/subscribeMentionEvents.d.ts.map +0 -1
- package/lib/typescript/src/web/styleConversion/enrichedInputThemingToCSSProperties.d.ts.map +0 -1
- package/lib/typescript/src/web/tiptapHtmlNormalizer.d.ts +0 -3
- package/lib/typescript/src/web/tiptapHtmlNormalizer.d.ts.map +0 -1
- package/src/web/EnrichedTextInput.css +0 -201
- package/src/web/pmPlugins/MentionPlugin/subscribeMentionEvents.ts +0 -105
- /package/lib/module/web/{checkboxHtmlNormalizer.js → normalization/checkboxHtmlNormalizer.js} +0 -0
- /package/lib/typescript/src/web/{checkboxHtmlNormalizer.d.ts → normalization/checkboxHtmlNormalizer.d.ts} +0 -0
- /package/src/web/{checkboxHtmlNormalizer.ts → normalization/checkboxHtmlNormalizer.ts} +0 -0
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
.tiptap.ProseMirror p {
|
|
2
|
-
margin-top: 0;
|
|
3
|
-
margin-bottom: 0;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.tiptap.ProseMirror-focused {
|
|
7
|
-
outline: none;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.eti-editor p.is-editor-empty:first-child::before {
|
|
11
|
-
color: var(--eti-placeholder-text-color, #adb5bd);
|
|
12
|
-
content: attr(data-placeholder);
|
|
13
|
-
float: left;
|
|
14
|
-
height: 0;
|
|
15
|
-
pointer-events: none;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.eti-editor ::selection {
|
|
19
|
-
background-color: var(--eti-selection-color, Highlight);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.eti-editor code {
|
|
23
|
-
font-family: monospace;
|
|
24
|
-
background-color: var(--eti-code-bg-color);
|
|
25
|
-
color: var(--eti-code-color);
|
|
26
|
-
display: inline;
|
|
27
|
-
padding: 0;
|
|
28
|
-
line-height: inherit;
|
|
29
|
-
vertical-align: baseline;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.eti-editor h1 { font-size: var(--eti-h1-font-size); font-weight: var(--eti-h1-font-weight); margin: 0; line-height: normal; }
|
|
33
|
-
.eti-editor h2 { font-size: var(--eti-h2-font-size); font-weight: var(--eti-h2-font-weight); margin: 0; line-height: normal; }
|
|
34
|
-
.eti-editor h3 { font-size: var(--eti-h3-font-size); font-weight: var(--eti-h3-font-weight); margin: 0; line-height: normal; }
|
|
35
|
-
.eti-editor h4 { font-size: var(--eti-h4-font-size); font-weight: var(--eti-h4-font-weight); margin: 0; line-height: normal; }
|
|
36
|
-
.eti-editor h5 { font-size: var(--eti-h5-font-size); font-weight: var(--eti-h5-font-weight); margin: 0; line-height: normal; }
|
|
37
|
-
.eti-editor h6 { font-size: var(--eti-h6-font-size); font-weight: var(--eti-h6-font-weight); margin: 0; line-height: normal; }
|
|
38
|
-
|
|
39
|
-
.eti-editor blockquote {
|
|
40
|
-
border-left: var(--eti-blockquote-border-width) solid var(--eti-blockquote-border-color);
|
|
41
|
-
padding-left: var(--eti-blockquote-gap-width);
|
|
42
|
-
margin: 0;
|
|
43
|
-
color: var(--eti-blockquote-color);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.eti-editor blockquote p {
|
|
47
|
-
margin: 0;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.eti-editor codeblock {
|
|
51
|
-
display: block;
|
|
52
|
-
font-family: monospace;
|
|
53
|
-
background-color: var(--eti-codeblock-bg-color);
|
|
54
|
-
color: var(--eti-codeblock-color);
|
|
55
|
-
border-radius: var(--eti-codeblock-border-radius);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.eti-editor codeblock p {
|
|
59
|
-
margin: 0;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.eti-editor a {
|
|
63
|
-
color: var(--eti-link-color);
|
|
64
|
-
text-decoration-line: var(--eti-link-text-decoration-line);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.eti-editor ul:not([data-type]) {
|
|
68
|
-
margin: 0;
|
|
69
|
-
list-style: none;
|
|
70
|
-
padding-left: calc(
|
|
71
|
-
var(--eti-ul-margin-left, 16px) + var(--eti-ul-gap-width, 16px)
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.eti-editor ul:not([data-type]) > li {
|
|
76
|
-
position: relative;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.eti-editor ul:not([data-type]) > li::before {
|
|
80
|
-
content: '';
|
|
81
|
-
position: absolute;
|
|
82
|
-
left: calc(
|
|
83
|
-
-1 * var(--eti-ul-gap-width, 16px) - var(--eti-ul-bullet-size, 8px)
|
|
84
|
-
);
|
|
85
|
-
bottom: 0.4em;
|
|
86
|
-
@supports (bottom: 0.5lh) {
|
|
87
|
-
bottom: 0.5lh;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
transform: translateY(50%);
|
|
91
|
-
width: var(--eti-ul-bullet-size, 8px);
|
|
92
|
-
height: var(--eti-ul-bullet-size, 8px);
|
|
93
|
-
border-radius: 50%;
|
|
94
|
-
background-color: var(--eti-ul-bullet-color, currentColor);
|
|
95
|
-
pointer-events: none;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.eti-editor ol {
|
|
99
|
-
margin: 0;
|
|
100
|
-
list-style: none;
|
|
101
|
-
padding-left: calc(
|
|
102
|
-
var(--eti-ol-margin-left, 16px) + var(--eti-ol-gap-width, 16px)
|
|
103
|
-
);
|
|
104
|
-
counter-reset: eti-ol;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.eti-editor ol > li {
|
|
108
|
-
position: relative;
|
|
109
|
-
counter-increment: eti-ol;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.eti-editor ol > li::before {
|
|
113
|
-
content: counter(eti-ol) '.';
|
|
114
|
-
position: absolute;
|
|
115
|
-
left: calc(-1 * var(--eti-ol-gap-width, 16px));
|
|
116
|
-
bottom: 0;
|
|
117
|
-
transform: translateX(-50%);
|
|
118
|
-
color: var(--eti-ol-marker-color, currentColor);
|
|
119
|
-
font-weight: var(--eti-ol-marker-font-weight, inherit);
|
|
120
|
-
white-space: nowrap;
|
|
121
|
-
pointer-events: none;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.eti-editor li {
|
|
125
|
-
margin: 0;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.eti-editor li p {
|
|
129
|
-
margin: 0;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.eti-editor .eti-inline-image {
|
|
133
|
-
vertical-align: text-bottom;
|
|
134
|
-
line-height: 0;
|
|
135
|
-
display: inline-block;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.eti-editor .eti-inline-image-img {
|
|
139
|
-
object-fit: contain;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.eti-editor .eti-inline-image--placeholder {
|
|
143
|
-
display: inline-block;
|
|
144
|
-
overflow: hidden;
|
|
145
|
-
color: inherit;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.eti-editor .eti-inline-image-broken-glyph {
|
|
149
|
-
display: block;
|
|
150
|
-
width: 100%;
|
|
151
|
-
height: 100%;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
.eti-editor
|
|
156
|
-
.react-renderer.node-image.ProseMirror-selectednode
|
|
157
|
-
.eti-inline-image {
|
|
158
|
-
box-shadow: inset 0 0 0 999px Highlight;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
.eti-editor ul[data-type="checkboxList"] {
|
|
164
|
-
margin: 0;
|
|
165
|
-
list-style: none;
|
|
166
|
-
padding: 0;
|
|
167
|
-
padding-left: calc(
|
|
168
|
-
var(--eti-checkbox-margin-left, 16px) + var(--eti-checkbox-gap-width, 16px)
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.eti-editor ul[data-type="checkboxList"] > li {
|
|
173
|
-
position: relative;
|
|
174
|
-
list-style: none;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.eti-editor ul[data-type="checkboxList"] > li > label {
|
|
178
|
-
position: absolute;
|
|
179
|
-
left: calc(
|
|
180
|
-
-1 * var(--eti-checkbox-gap-width, 16px) - var(--eti-checkbox-box-size, 24px)
|
|
181
|
-
);
|
|
182
|
-
transform: translateY(50%);
|
|
183
|
-
display: inline-flex;
|
|
184
|
-
align-items: center;
|
|
185
|
-
gap: 0;
|
|
186
|
-
margin: 0;
|
|
187
|
-
padding: 0;
|
|
188
|
-
user-select: none;
|
|
189
|
-
bottom: 0.4em;
|
|
190
|
-
@supports (bottom: 0.5lh) {
|
|
191
|
-
bottom: 0.5lh;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.eti-editor ul[data-type="checkboxList"] > li > label input[type='checkbox'] {
|
|
196
|
-
width: var(--eti-checkbox-box-size, 24px);
|
|
197
|
-
height: var(--eti-checkbox-box-size, 24px);
|
|
198
|
-
margin: 0;
|
|
199
|
-
flex-shrink: 0;
|
|
200
|
-
accent-color: var(--eti-checkbox-box-color, #0000ff);
|
|
201
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["checkboxHtmlForTiptap","html","parser","DOMParser","doc","parseFromString","querySelectorAll","forEach","ul","setAttribute","li","hasAttribute","removeAttribute","innerContent","innerHTML","body","checkboxHtmlFromTiptap","getAttribute","pTag","querySelector","replace"],"sourceRoot":"../../../src","sources":["web/checkboxHtmlNormalizer.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,qBAAqBA,CAACC,IAA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E,CAACO,YAAY,CAAC,cAAc,CAAC,KAAK,MAAM,EAAE;QAC9CP,EAAE,CAACD,YAAY,CAAC,SAAS,EAAE,EAAE,CAAC;MAChC;MAEAC,EAAE,CAACE,eAAe,CAAC,WAAW,CAAC;MAC/BF,EAAE,CAACE,eAAe,CAAC,cAAc,CAAC;MAElC,MAAMM,IAAI,GAAGR,EAAE,CAACS,aAAa,CAAC,SAAS,CAAC;MACxCT,EAAE,CAACI,SAAS,GAAGI,IAAI,GAAGA,IAAI,CAACJ,SAAS,GAAG,EAAE;IAC3C,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOV,GAAG,CAACW,IAAI,CAACD,SAAS,CAACM,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC;AAC7D","ignoreList":[]}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { getMarkRange } from '@tiptap/core';
|
|
4
|
-
import { mentionPluginKey } from "./mentionPluginKey.js";
|
|
5
|
-
export function subscribeMentionEvents(editor, getCallbacks) {
|
|
6
|
-
let prevTriggerState = {
|
|
7
|
-
active: false
|
|
8
|
-
};
|
|
9
|
-
let prevMentionKey = null;
|
|
10
|
-
let wasInMention = false;
|
|
11
|
-
const handleTransaction = () => {
|
|
12
|
-
const cb = getCallbacks();
|
|
13
|
-
const curr = mentionPluginKey.getState(editor.state);
|
|
14
|
-
if (!curr) return;
|
|
15
|
-
if (!prevTriggerState.active && curr.active) {
|
|
16
|
-
cb.onStartMention?.(curr.indicator);
|
|
17
|
-
if (curr.query !== '') cb.onChangeMention?.({
|
|
18
|
-
indicator: curr.indicator,
|
|
19
|
-
text: curr.query
|
|
20
|
-
});
|
|
21
|
-
} else if (prevTriggerState.active && curr.active && curr.query !== prevTriggerState.query) {
|
|
22
|
-
cb.onChangeMention?.({
|
|
23
|
-
indicator: curr.indicator,
|
|
24
|
-
text: curr.query
|
|
25
|
-
});
|
|
26
|
-
} else if (prevTriggerState.active && !curr.active) {
|
|
27
|
-
cb.onEndMention?.(prevTriggerState.indicator);
|
|
28
|
-
}
|
|
29
|
-
prevTriggerState = curr;
|
|
30
|
-
if (!cb.onMentionDetected) return;
|
|
31
|
-
const mention = getActiveMention(editor);
|
|
32
|
-
if (!mention) {
|
|
33
|
-
if (wasInMention) {
|
|
34
|
-
wasInMention = false;
|
|
35
|
-
prevMentionKey = null;
|
|
36
|
-
cb.onMentionDetected({
|
|
37
|
-
text: '',
|
|
38
|
-
indicator: '',
|
|
39
|
-
attributes: {}
|
|
40
|
-
});
|
|
41
|
-
} else {
|
|
42
|
-
prevMentionKey = null;
|
|
43
|
-
}
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
wasInMention = true;
|
|
47
|
-
if (mention.key === prevMentionKey) return;
|
|
48
|
-
prevMentionKey = mention.key;
|
|
49
|
-
cb.onMentionDetected({
|
|
50
|
-
text: mention.text,
|
|
51
|
-
indicator: mention.indicator,
|
|
52
|
-
attributes: mention.attributes
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
const handleBlur = () => {
|
|
56
|
-
const cb = getCallbacks();
|
|
57
|
-
if (prevTriggerState.active) {
|
|
58
|
-
cb.onEndMention?.(prevTriggerState.indicator);
|
|
59
|
-
prevTriggerState = {
|
|
60
|
-
active: false
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
prevMentionKey = null;
|
|
64
|
-
};
|
|
65
|
-
editor.on('transaction', handleTransaction);
|
|
66
|
-
editor.on('blur', handleBlur);
|
|
67
|
-
return () => {
|
|
68
|
-
editor.off('transaction', handleTransaction);
|
|
69
|
-
editor.off('blur', handleBlur);
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
function getActiveMention(editor) {
|
|
73
|
-
const {
|
|
74
|
-
state
|
|
75
|
-
} = editor;
|
|
76
|
-
const mentionType = state.schema.marks.mention;
|
|
77
|
-
if (!mentionType) return null;
|
|
78
|
-
const {
|
|
79
|
-
from: selFrom,
|
|
80
|
-
to: selTo
|
|
81
|
-
} = state.selection;
|
|
82
|
-
const $from = state.doc.resolve(selFrom);
|
|
83
|
-
const mark = mentionType.isInSet($from.marks());
|
|
84
|
-
if (!mark) return null;
|
|
85
|
-
const range = getMarkRange($from, mentionType);
|
|
86
|
-
if (!range) return null;
|
|
87
|
-
if (selFrom < range.from || selTo > range.to) return null;
|
|
88
|
-
const {
|
|
89
|
-
text,
|
|
90
|
-
indicator,
|
|
91
|
-
attributes
|
|
92
|
-
} = mark.attrs;
|
|
93
|
-
return {
|
|
94
|
-
key: `${range.from}:${range.to}:${text}:${indicator}`,
|
|
95
|
-
text: text,
|
|
96
|
-
indicator: indicator,
|
|
97
|
-
attributes: attributes ?? {}
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
//# sourceMappingURL=subscribeMentionEvents.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["getMarkRange","mentionPluginKey","subscribeMentionEvents","editor","getCallbacks","prevTriggerState","active","prevMentionKey","wasInMention","handleTransaction","cb","curr","getState","state","onStartMention","indicator","query","onChangeMention","text","onEndMention","onMentionDetected","mention","getActiveMention","attributes","key","handleBlur","on","off","mentionType","schema","marks","from","selFrom","to","selTo","selection","$from","doc","resolve","mark","isInSet","range","attrs"],"sourceRoot":"../../../../../src","sources":["web/pmPlugins/MentionPlugin/subscribeMentionEvents.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,cAAc;AAG3C,SAASC,gBAAgB,QAAQ,uBAAoB;AAGrD,OAAO,SAASC,sBAAsBA,CACpCC,MAAc,EACdC,YAAoC,EACxB;EACZ,IAAIC,gBAA8B,GAAG;IAAEC,MAAM,EAAE;EAAM,CAAC;EACtD,IAAIC,cAA6B,GAAG,IAAI;EACxC,IAAIC,YAAY,GAAG,KAAK;EAExB,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;IAC9B,MAAMC,EAAE,GAAGN,YAAY,CAAC,CAAC;IACzB,MAAMO,IAAI,GAAGV,g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,KAAK,CAACN,KAAK,CAAC,CAAC,CAAC;EAC/C,IAAI,CAACS,IAAI,EAAE,OAAO,IAAI;EAEtB,MAAME,KAAK,GAAGzC,YAAY,CAACoC,KAAK,EAAER,WAAW,CAAC;EAC9C,IAAI,CAACa,KAAK,EAAE,OAAO,IAAI;EAEvB,IAAIT,OAAO,GAAGS,KAAK,CAACV,IAAI,IAAIG,KAAK,GAAGO,KAAK,CAACR,EAAE,EAAE,OAAO,IAAI;EAEzD,MAAM;IAAEf,IAAI;IAAEH,SAAS;IAAEQ;EAAW,CAAC,GAAGgB,IAAI,CAACG,KAAK;EAClD,OAAO;IACLlB,GAAG,EAAE,GAAGiB,KAAK,CAACV,IAAI,IAAIU,KAAK,CAACR,EAAE,IAAIf,IAAI,IAAIH,SAAS,EAAE;IACrDG,IAAI,EAAEA,IAAc;IACpBH,SAAS,EAAEA,SAAmB;IAC9BQ,UAAU,EAAGA,UAAU,IAAI,CAAC;EAC9B,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkboxHtmlNormalizer.d.ts","sourceRoot":"","sources":["../../../../src/web/checkboxHtmlNormalizer.ts"],"names":[],"mappings":"AAeA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAuB1D;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAqB3D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscribeMentionEvents.d.ts","sourceRoot":"","sources":["../../../../../../src/web/pmPlugins/MentionPlugin/subscribeMentionEvents.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,KAAK,EAAE,gBAAgB,EAAgB,MAAM,SAAS,CAAC;AAE9D,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,gBAAgB,GACnC,MAAM,IAAI,CAqEZ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"enrichedInputThemingToCSSProperties.d.ts","sourceRoot":"","sources":["../../../../../src/web/styleConversion/enrichedInputThemingToCSSProperties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAU/C,MAAM,WAAW,0BAA0B;IACzC,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,cAAc,CAAC,EAAE,UAAU,CAAC;CAC7B;AAED,wBAAgB,mCAAmC,CAAC,EAClD,WAAW,EACX,oBAAoB,EACpB,cAAc,GACf,EAAE,0BAA0B,GAAG,aAAa,CAY5C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tiptapHtmlNormalizer.d.ts","sourceRoot":"","sources":["../../../../src/web/tiptapHtmlNormalizer.ts"],"names":[],"mappings":"AAKA,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAqB5D"}
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
.tiptap.ProseMirror p {
|
|
2
|
-
margin-top: 0;
|
|
3
|
-
margin-bottom: 0;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.tiptap.ProseMirror-focused {
|
|
7
|
-
outline: none;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.eti-editor p.is-editor-empty:first-child::before {
|
|
11
|
-
color: var(--eti-placeholder-text-color, #adb5bd);
|
|
12
|
-
content: attr(data-placeholder);
|
|
13
|
-
float: left;
|
|
14
|
-
height: 0;
|
|
15
|
-
pointer-events: none;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.eti-editor ::selection {
|
|
19
|
-
background-color: var(--eti-selection-color, Highlight);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.eti-editor code {
|
|
23
|
-
font-family: monospace;
|
|
24
|
-
background-color: var(--eti-code-bg-color);
|
|
25
|
-
color: var(--eti-code-color);
|
|
26
|
-
display: inline;
|
|
27
|
-
padding: 0;
|
|
28
|
-
line-height: inherit;
|
|
29
|
-
vertical-align: baseline;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.eti-editor h1 { font-size: var(--eti-h1-font-size); font-weight: var(--eti-h1-font-weight); margin: 0; line-height: normal; }
|
|
33
|
-
.eti-editor h2 { font-size: var(--eti-h2-font-size); font-weight: var(--eti-h2-font-weight); margin: 0; line-height: normal; }
|
|
34
|
-
.eti-editor h3 { font-size: var(--eti-h3-font-size); font-weight: var(--eti-h3-font-weight); margin: 0; line-height: normal; }
|
|
35
|
-
.eti-editor h4 { font-size: var(--eti-h4-font-size); font-weight: var(--eti-h4-font-weight); margin: 0; line-height: normal; }
|
|
36
|
-
.eti-editor h5 { font-size: var(--eti-h5-font-size); font-weight: var(--eti-h5-font-weight); margin: 0; line-height: normal; }
|
|
37
|
-
.eti-editor h6 { font-size: var(--eti-h6-font-size); font-weight: var(--eti-h6-font-weight); margin: 0; line-height: normal; }
|
|
38
|
-
|
|
39
|
-
.eti-editor blockquote {
|
|
40
|
-
border-left: var(--eti-blockquote-border-width) solid var(--eti-blockquote-border-color);
|
|
41
|
-
padding-left: var(--eti-blockquote-gap-width);
|
|
42
|
-
margin: 0;
|
|
43
|
-
color: var(--eti-blockquote-color);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.eti-editor blockquote p {
|
|
47
|
-
margin: 0;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.eti-editor codeblock {
|
|
51
|
-
display: block;
|
|
52
|
-
font-family: monospace;
|
|
53
|
-
background-color: var(--eti-codeblock-bg-color);
|
|
54
|
-
color: var(--eti-codeblock-color);
|
|
55
|
-
border-radius: var(--eti-codeblock-border-radius);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.eti-editor codeblock p {
|
|
59
|
-
margin: 0;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.eti-editor a {
|
|
63
|
-
color: var(--eti-link-color);
|
|
64
|
-
text-decoration-line: var(--eti-link-text-decoration-line);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.eti-editor ul:not([data-type]) {
|
|
68
|
-
margin: 0;
|
|
69
|
-
list-style: none;
|
|
70
|
-
padding-left: calc(
|
|
71
|
-
var(--eti-ul-margin-left, 16px) + var(--eti-ul-gap-width, 16px)
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.eti-editor ul:not([data-type]) > li {
|
|
76
|
-
position: relative;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.eti-editor ul:not([data-type]) > li::before {
|
|
80
|
-
content: '';
|
|
81
|
-
position: absolute;
|
|
82
|
-
left: calc(
|
|
83
|
-
-1 * var(--eti-ul-gap-width, 16px) - var(--eti-ul-bullet-size, 8px)
|
|
84
|
-
);
|
|
85
|
-
bottom: 0.4em;
|
|
86
|
-
@supports (bottom: 0.5lh) {
|
|
87
|
-
bottom: 0.5lh;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
transform: translateY(50%);
|
|
91
|
-
width: var(--eti-ul-bullet-size, 8px);
|
|
92
|
-
height: var(--eti-ul-bullet-size, 8px);
|
|
93
|
-
border-radius: 50%;
|
|
94
|
-
background-color: var(--eti-ul-bullet-color, currentColor);
|
|
95
|
-
pointer-events: none;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.eti-editor ol {
|
|
99
|
-
margin: 0;
|
|
100
|
-
list-style: none;
|
|
101
|
-
padding-left: calc(
|
|
102
|
-
var(--eti-ol-margin-left, 16px) + var(--eti-ol-gap-width, 16px)
|
|
103
|
-
);
|
|
104
|
-
counter-reset: eti-ol;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.eti-editor ol > li {
|
|
108
|
-
position: relative;
|
|
109
|
-
counter-increment: eti-ol;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.eti-editor ol > li::before {
|
|
113
|
-
content: counter(eti-ol) '.';
|
|
114
|
-
position: absolute;
|
|
115
|
-
left: calc(-1 * var(--eti-ol-gap-width, 16px));
|
|
116
|
-
bottom: 0;
|
|
117
|
-
transform: translateX(-50%);
|
|
118
|
-
color: var(--eti-ol-marker-color, currentColor);
|
|
119
|
-
font-weight: var(--eti-ol-marker-font-weight, inherit);
|
|
120
|
-
white-space: nowrap;
|
|
121
|
-
pointer-events: none;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.eti-editor li {
|
|
125
|
-
margin: 0;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.eti-editor li p {
|
|
129
|
-
margin: 0;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.eti-editor .eti-inline-image {
|
|
133
|
-
vertical-align: text-bottom;
|
|
134
|
-
line-height: 0;
|
|
135
|
-
display: inline-block;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.eti-editor .eti-inline-image-img {
|
|
139
|
-
object-fit: contain;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.eti-editor .eti-inline-image--placeholder {
|
|
143
|
-
display: inline-block;
|
|
144
|
-
overflow: hidden;
|
|
145
|
-
color: inherit;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.eti-editor .eti-inline-image-broken-glyph {
|
|
149
|
-
display: block;
|
|
150
|
-
width: 100%;
|
|
151
|
-
height: 100%;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
.eti-editor
|
|
156
|
-
.react-renderer.node-image.ProseMirror-selectednode
|
|
157
|
-
.eti-inline-image {
|
|
158
|
-
box-shadow: inset 0 0 0 999px Highlight;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
.eti-editor ul[data-type="checkboxList"] {
|
|
164
|
-
margin: 0;
|
|
165
|
-
list-style: none;
|
|
166
|
-
padding: 0;
|
|
167
|
-
padding-left: calc(
|
|
168
|
-
var(--eti-checkbox-margin-left, 16px) + var(--eti-checkbox-gap-width, 16px)
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.eti-editor ul[data-type="checkboxList"] > li {
|
|
173
|
-
position: relative;
|
|
174
|
-
list-style: none;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.eti-editor ul[data-type="checkboxList"] > li > label {
|
|
178
|
-
position: absolute;
|
|
179
|
-
left: calc(
|
|
180
|
-
-1 * var(--eti-checkbox-gap-width, 16px) - var(--eti-checkbox-box-size, 24px)
|
|
181
|
-
);
|
|
182
|
-
transform: translateY(50%);
|
|
183
|
-
display: inline-flex;
|
|
184
|
-
align-items: center;
|
|
185
|
-
gap: 0;
|
|
186
|
-
margin: 0;
|
|
187
|
-
padding: 0;
|
|
188
|
-
user-select: none;
|
|
189
|
-
bottom: 0.4em;
|
|
190
|
-
@supports (bottom: 0.5lh) {
|
|
191
|
-
bottom: 0.5lh;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.eti-editor ul[data-type="checkboxList"] > li > label input[type='checkbox'] {
|
|
196
|
-
width: var(--eti-checkbox-box-size, 24px);
|
|
197
|
-
height: var(--eti-checkbox-box-size, 24px);
|
|
198
|
-
margin: 0;
|
|
199
|
-
flex-shrink: 0;
|
|
200
|
-
accent-color: var(--eti-checkbox-box-color, #0000ff);
|
|
201
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { getMarkRange } from '@tiptap/core';
|
|
2
|
-
import type { Editor } from '@tiptap/react';
|
|
3
|
-
import type { OnMentionDetected } from '../../../types';
|
|
4
|
-
import { mentionPluginKey } from './mentionPluginKey';
|
|
5
|
-
import type { MentionCallbacks, TriggerState } from './types';
|
|
6
|
-
|
|
7
|
-
export function subscribeMentionEvents(
|
|
8
|
-
editor: Editor,
|
|
9
|
-
getCallbacks: () => MentionCallbacks
|
|
10
|
-
): () => void {
|
|
11
|
-
let prevTriggerState: TriggerState = { active: false };
|
|
12
|
-
let prevMentionKey: string | null = null;
|
|
13
|
-
let wasInMention = false;
|
|
14
|
-
|
|
15
|
-
const handleTransaction = () => {
|
|
16
|
-
const cb = getCallbacks();
|
|
17
|
-
const curr = mentionPluginKey.getState(editor.state);
|
|
18
|
-
if (!curr) return;
|
|
19
|
-
|
|
20
|
-
if (!prevTriggerState.active && curr.active) {
|
|
21
|
-
cb.onStartMention?.(curr.indicator);
|
|
22
|
-
if (curr.query !== '')
|
|
23
|
-
cb.onChangeMention?.({ indicator: curr.indicator, text: curr.query });
|
|
24
|
-
} else if (
|
|
25
|
-
prevTriggerState.active &&
|
|
26
|
-
curr.active &&
|
|
27
|
-
curr.query !== prevTriggerState.query
|
|
28
|
-
) {
|
|
29
|
-
cb.onChangeMention?.({ indicator: curr.indicator, text: curr.query });
|
|
30
|
-
} else if (prevTriggerState.active && !curr.active) {
|
|
31
|
-
cb.onEndMention?.(prevTriggerState.indicator);
|
|
32
|
-
}
|
|
33
|
-
prevTriggerState = curr;
|
|
34
|
-
|
|
35
|
-
if (!cb.onMentionDetected) return;
|
|
36
|
-
|
|
37
|
-
const mention = getActiveMention(editor);
|
|
38
|
-
if (!mention) {
|
|
39
|
-
if (wasInMention) {
|
|
40
|
-
wasInMention = false;
|
|
41
|
-
prevMentionKey = null;
|
|
42
|
-
cb.onMentionDetected({
|
|
43
|
-
text: '',
|
|
44
|
-
indicator: '',
|
|
45
|
-
attributes: {},
|
|
46
|
-
});
|
|
47
|
-
} else {
|
|
48
|
-
prevMentionKey = null;
|
|
49
|
-
}
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
wasInMention = true;
|
|
54
|
-
if (mention.key === prevMentionKey) return;
|
|
55
|
-
prevMentionKey = mention.key;
|
|
56
|
-
cb.onMentionDetected({
|
|
57
|
-
text: mention.text,
|
|
58
|
-
indicator: mention.indicator,
|
|
59
|
-
attributes: mention.attributes,
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const handleBlur = () => {
|
|
64
|
-
const cb = getCallbacks();
|
|
65
|
-
if (prevTriggerState.active) {
|
|
66
|
-
cb.onEndMention?.(prevTriggerState.indicator);
|
|
67
|
-
prevTriggerState = { active: false };
|
|
68
|
-
}
|
|
69
|
-
prevMentionKey = null;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
editor.on('transaction', handleTransaction);
|
|
73
|
-
editor.on('blur', handleBlur);
|
|
74
|
-
|
|
75
|
-
return () => {
|
|
76
|
-
editor.off('transaction', handleTransaction);
|
|
77
|
-
editor.off('blur', handleBlur);
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function getActiveMention(
|
|
82
|
-
editor: Editor
|
|
83
|
-
): (OnMentionDetected & { key: string }) | null {
|
|
84
|
-
const { state } = editor;
|
|
85
|
-
const mentionType = state.schema.marks.mention;
|
|
86
|
-
if (!mentionType) return null;
|
|
87
|
-
|
|
88
|
-
const { from: selFrom, to: selTo } = state.selection;
|
|
89
|
-
const $from = state.doc.resolve(selFrom);
|
|
90
|
-
const mark = mentionType.isInSet($from.marks());
|
|
91
|
-
if (!mark) return null;
|
|
92
|
-
|
|
93
|
-
const range = getMarkRange($from, mentionType);
|
|
94
|
-
if (!range) return null;
|
|
95
|
-
|
|
96
|
-
if (selFrom < range.from || selTo > range.to) return null;
|
|
97
|
-
|
|
98
|
-
const { text, indicator, attributes } = mark.attrs;
|
|
99
|
-
return {
|
|
100
|
-
key: `${range.from}:${range.to}:${text}:${indicator}`,
|
|
101
|
-
text: text as string,
|
|
102
|
-
indicator: indicator as string,
|
|
103
|
-
attributes: (attributes ?? {}) as Record<string, string>,
|
|
104
|
-
};
|
|
105
|
-
}
|
/package/lib/module/web/{checkboxHtmlNormalizer.js → normalization/checkboxHtmlNormalizer.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|