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.
Files changed (272) hide show
  1. package/android/src/main/java/com/swmansion/enriched/common/EnrichedSpanFlags.kt +39 -0
  2. package/android/src/main/java/com/swmansion/enriched/common/parser/EnrichedParser.java +43 -20
  3. package/android/src/main/java/com/swmansion/enriched/common/parser/EnrichedSpanFactory.kt +1 -0
  4. package/android/src/main/java/com/swmansion/enriched/text/EnrichedTextSpanFactory.kt +1 -0
  5. package/android/src/main/java/com/swmansion/enriched/text/EnrichedTextView.kt +2 -1
  6. package/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputSpannableFactory.kt +2 -1
  7. package/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputView.kt +8 -5
  8. package/android/src/main/java/com/swmansion/enriched/textinput/events/MentionHandler.kt +12 -2
  9. package/android/src/main/java/com/swmansion/enriched/textinput/events/OnMentionEvent.kt +6 -0
  10. package/android/src/main/java/com/swmansion/enriched/textinput/styles/AlignmentStyles.kt +6 -7
  11. package/android/src/main/java/com/swmansion/enriched/textinput/styles/InlineStyles.kt +13 -1
  12. package/android/src/main/java/com/swmansion/enriched/textinput/styles/ListStyles.kt +4 -3
  13. package/android/src/main/java/com/swmansion/enriched/textinput/styles/ParagraphStyles.kt +4 -3
  14. package/android/src/main/java/com/swmansion/enriched/textinput/styles/ParametrizedStyles.kt +38 -11
  15. package/android/src/main/java/com/swmansion/enriched/textinput/utils/EnrichedSelection.kt +2 -0
  16. package/android/src/main/java/com/swmansion/enriched/textinput/utils/EnrichedSpannable.kt +2 -1
  17. package/android/src/main/java/com/swmansion/enriched/textinput/utils/Utils.kt +2 -1
  18. package/cpp/parser/GumboNormalizer.c +61 -3
  19. package/cpp/tests/GumboParserTest.cpp +54 -0
  20. package/ios/EnrichedTextInputView.mm +37 -25
  21. package/ios/extensions/LayoutManagerExtension.mm +73 -62
  22. package/ios/extensions/StringExtension.mm +75 -0
  23. package/ios/htmlParser/HtmlParser.h +4 -1
  24. package/ios/htmlParser/HtmlParser.mm +23 -5
  25. package/ios/inputHtmlParser/InputHtmlParser.mm +6 -3
  26. package/ios/interfaces/StyleHeaders.h +4 -0
  27. package/ios/styles/LinkStyle.mm +20 -34
  28. package/ios/styles/MentionStyle.mm +55 -4
  29. package/ios/textHtmlParser/TextHtmlParser.mm +2 -1
  30. package/ios/utils/ParagraphAttributesUtils.mm +7 -0
  31. package/lib/module/index.js +1 -0
  32. package/lib/module/index.js.map +1 -1
  33. package/lib/module/utils/expandMentionStylesForIndicators.js +2 -3
  34. package/lib/module/utils/expandMentionStylesForIndicators.js.map +1 -1
  35. package/lib/module/utils/normalizeHtmlStyle.js +1 -1
  36. package/lib/module/utils/normalizeHtmlStyle.js.map +1 -1
  37. package/lib/module/web/EnrichedText.css +343 -0
  38. package/lib/module/web/EnrichedText.js +55 -0
  39. package/lib/module/web/EnrichedText.js.map +1 -0
  40. package/lib/module/web/EnrichedTextInput.js +54 -52
  41. package/lib/module/web/EnrichedTextInput.js.map +1 -1
  42. package/lib/module/web/constants/brokenImageGlyph.js +9 -0
  43. package/lib/module/web/constants/brokenImageGlyph.js.map +1 -0
  44. package/lib/module/web/constants/classNames.js +5 -0
  45. package/lib/module/web/constants/classNames.js.map +1 -0
  46. package/lib/module/web/emitLinkDetected.js +12 -0
  47. package/lib/module/web/emitLinkDetected.js.map +1 -0
  48. package/lib/module/web/formats/EnrichedBlockquote.js +1 -1
  49. package/lib/module/web/formats/EnrichedBlockquote.js.map +1 -1
  50. package/lib/module/web/formats/EnrichedCheckboxList.js +2 -2
  51. package/lib/module/web/formats/EnrichedCheckboxList.js.map +1 -1
  52. package/lib/module/web/formats/EnrichedCodeBlock.js +1 -1
  53. package/lib/module/web/formats/EnrichedCodeBlock.js.map +1 -1
  54. package/lib/module/web/formats/EnrichedHeading.js +1 -1
  55. package/lib/module/web/formats/EnrichedHeading.js.map +1 -1
  56. package/lib/module/web/formats/EnrichedImageNodeView.js +1 -1
  57. package/lib/module/web/formats/EnrichedImageNodeView.js.map +1 -1
  58. package/lib/module/web/formats/EnrichedLink.js +43 -3
  59. package/lib/module/web/formats/EnrichedLink.js.map +1 -1
  60. package/lib/module/web/formats/EnrichedOrderedList.js +2 -2
  61. package/lib/module/web/formats/EnrichedOrderedList.js.map +1 -1
  62. package/lib/module/web/formats/EnrichedTextAlign.js +82 -0
  63. package/lib/module/web/formats/EnrichedTextAlign.js.map +1 -0
  64. package/lib/module/web/formats/EnrichedUnorderedList.js +2 -2
  65. package/lib/module/web/formats/EnrichedUnorderedList.js.map +1 -1
  66. package/lib/module/web/formats/applyWrappingListToSelection.js +3 -2
  67. package/lib/module/web/formats/applyWrappingListToSelection.js.map +1 -1
  68. package/lib/module/web/formats/formatRules.js +39 -3
  69. package/lib/module/web/formats/formatRules.js.map +1 -1
  70. package/lib/module/web/formats/listKeyboard.js +4 -1
  71. package/lib/module/web/formats/listKeyboard.js.map +1 -1
  72. package/lib/module/web/normalization/checkboxHtmlNormalizer.js.map +1 -0
  73. package/lib/module/web/normalization/htmlNormalizer.js +514 -0
  74. package/lib/module/web/normalization/htmlNormalizer.js.map +1 -0
  75. package/lib/module/web/normalization/prepareHtmlForWeb.js +78 -0
  76. package/lib/module/web/normalization/prepareHtmlForWeb.js.map +1 -0
  77. package/lib/module/web/{tiptapHtmlNormalizer.js → normalization/tiptapHtmlNormalizer.js} +6 -2
  78. package/lib/module/web/normalization/tiptapHtmlNormalizer.js.map +1 -0
  79. package/lib/module/web/pmPlugins/AutolinkPlugin/autolinkRegex.js +27 -0
  80. package/lib/module/web/pmPlugins/AutolinkPlugin/autolinkRegex.js.map +1 -0
  81. package/lib/module/web/pmPlugins/AutolinkPlugin/index.js +178 -0
  82. package/lib/module/web/pmPlugins/AutolinkPlugin/index.js.map +1 -0
  83. package/lib/module/web/pmPlugins/MentionPlugin/index.js +1 -1
  84. package/lib/module/web/pmPlugins/MentionPlugin/index.js.map +1 -1
  85. package/lib/module/web/pmPlugins/MentionPlugin/makeMentionPluginState.js +23 -4
  86. package/lib/module/web/pmPlugins/MentionPlugin/makeMentionPluginState.js.map +1 -1
  87. package/lib/module/web/pmPlugins/MentionPlugin/setMention.js +17 -18
  88. package/lib/module/web/pmPlugins/MentionPlugin/setMention.js.map +1 -1
  89. package/lib/module/web/pmPlugins/MentionPlugin/useMentionEvents.js +105 -0
  90. package/lib/module/web/pmPlugins/MentionPlugin/useMentionEvents.js.map +1 -0
  91. package/lib/module/web/pmPlugins/ShortcutPlugin.js +11 -0
  92. package/lib/module/web/pmPlugins/ShortcutPlugin.js.map +1 -1
  93. package/lib/module/web/pmPlugins/StrictMarksPlugin.js +2 -0
  94. package/lib/module/web/pmPlugins/StrictMarksPlugin.js.map +1 -1
  95. package/lib/module/web/pmPlugins/StripBoldInStyledHeadingsPlugin.js.map +1 -1
  96. package/lib/module/web/sanitization/htmlSanitizer.js +10 -0
  97. package/lib/module/web/sanitization/htmlSanitizer.js.map +1 -0
  98. package/lib/module/web/styleConversion/buildMentionRulesCSS.js +12 -6
  99. package/lib/module/web/styleConversion/buildMentionRulesCSS.js.map +1 -1
  100. package/lib/module/web/styleConversion/enrichedBaseStyleToCSSProperties.js +159 -0
  101. package/lib/module/web/styleConversion/enrichedBaseStyleToCSSProperties.js.map +1 -0
  102. package/lib/module/web/styleConversion/enrichedInputStyleToCSSProperties.js +3 -155
  103. package/lib/module/web/styleConversion/enrichedInputStyleToCSSProperties.js.map +1 -1
  104. package/lib/module/web/styleConversion/enrichedTextStyleToCSSProperties.js +44 -0
  105. package/lib/module/web/styleConversion/enrichedTextStyleToCSSProperties.js.map +1 -0
  106. package/lib/module/web/styleConversion/{enrichedInputThemingToCSSProperties.js → enrichedThemingToCSSProperties.js} +3 -3
  107. package/lib/module/web/styleConversion/enrichedThemingToCSSProperties.js.map +1 -0
  108. package/lib/module/web/styleConversion/htmlStyleToCSSVariables.js +87 -64
  109. package/lib/module/web/styleConversion/htmlStyleToCSSVariables.js.map +1 -1
  110. package/lib/module/web/styleConversion/inlineImageCSSVariables.js +7 -0
  111. package/lib/module/web/styleConversion/inlineImageCSSVariables.js.map +1 -0
  112. package/lib/module/web/useImageErrorFallback.js +33 -0
  113. package/lib/module/web/useImageErrorFallback.js.map +1 -0
  114. package/lib/module/web/useOnChangeHtml.js +1 -1
  115. package/lib/module/web/useOnChangeHtml.js.map +1 -1
  116. package/lib/module/web/useOnChangeState.js +6 -3
  117. package/lib/module/web/useOnChangeState.js.map +1 -1
  118. package/lib/module/web/useOnLinkDetected.js +32 -45
  119. package/lib/module/web/useOnLinkDetected.js.map +1 -1
  120. package/lib/module/web/usePressInteractions.js +19 -0
  121. package/lib/module/web/usePressInteractions.js.map +1 -0
  122. package/lib/module/web/useStableRef.js +13 -0
  123. package/lib/module/web/useStableRef.js.map +1 -0
  124. package/lib/typescript/src/index.d.ts +1 -0
  125. package/lib/typescript/src/index.d.ts.map +1 -1
  126. package/lib/typescript/src/native/EnrichedText.d.ts +1 -1
  127. package/lib/typescript/src/native/EnrichedText.d.ts.map +1 -1
  128. package/lib/typescript/src/native/EnrichedTextInput.d.ts +1 -1
  129. package/lib/typescript/src/native/EnrichedTextInput.d.ts.map +1 -1
  130. package/lib/typescript/src/types.d.ts +1 -1
  131. package/lib/typescript/src/types.d.ts.map +1 -1
  132. package/lib/typescript/src/utils/expandMentionStylesForIndicators.d.ts +1 -1
  133. package/lib/typescript/src/utils/expandMentionStylesForIndicators.d.ts.map +1 -1
  134. package/lib/typescript/src/utils/normalizeHtmlStyle.d.ts.map +1 -1
  135. package/lib/typescript/src/web/EnrichedText.d.ts +4 -0
  136. package/lib/typescript/src/web/EnrichedText.d.ts.map +1 -0
  137. package/lib/typescript/src/web/EnrichedTextInput.d.ts +2 -2
  138. package/lib/typescript/src/web/EnrichedTextInput.d.ts.map +1 -1
  139. package/lib/typescript/src/web/constants/brokenImageGlyph.d.ts +3 -0
  140. package/lib/typescript/src/web/constants/brokenImageGlyph.d.ts.map +1 -0
  141. package/lib/typescript/src/web/constants/classNames.d.ts +3 -0
  142. package/lib/typescript/src/web/constants/classNames.d.ts.map +1 -0
  143. package/lib/typescript/src/web/emitLinkDetected.d.ts +10 -0
  144. package/lib/typescript/src/web/emitLinkDetected.d.ts.map +1 -0
  145. package/lib/typescript/src/web/formats/EnrichedBlockquote.d.ts.map +1 -1
  146. package/lib/typescript/src/web/formats/EnrichedCheckboxList.d.ts.map +1 -1
  147. package/lib/typescript/src/web/formats/EnrichedCodeBlock.d.ts.map +1 -1
  148. package/lib/typescript/src/web/formats/EnrichedHeading.d.ts.map +1 -1
  149. package/lib/typescript/src/web/formats/EnrichedImageNodeView.d.ts +1 -1
  150. package/lib/typescript/src/web/formats/EnrichedImageNodeView.d.ts.map +1 -1
  151. package/lib/typescript/src/web/formats/EnrichedLink.d.ts +4 -1
  152. package/lib/typescript/src/web/formats/EnrichedLink.d.ts.map +1 -1
  153. package/lib/typescript/src/web/formats/EnrichedOrderedList.d.ts.map +1 -1
  154. package/lib/typescript/src/web/formats/EnrichedTextAlign.d.ts +2 -0
  155. package/lib/typescript/src/web/formats/EnrichedTextAlign.d.ts.map +1 -0
  156. package/lib/typescript/src/web/formats/EnrichedUnorderedList.d.ts.map +1 -1
  157. package/lib/typescript/src/web/formats/applyWrappingListToSelection.d.ts.map +1 -1
  158. package/lib/typescript/src/web/formats/formatRules.d.ts +3 -1
  159. package/lib/typescript/src/web/formats/formatRules.d.ts.map +1 -1
  160. package/lib/typescript/src/web/formats/listKeyboard.d.ts.map +1 -1
  161. package/lib/typescript/src/web/normalization/checkboxHtmlNormalizer.d.ts.map +1 -0
  162. package/lib/typescript/src/web/normalization/htmlNormalizer.d.ts +2 -0
  163. package/lib/typescript/src/web/normalization/htmlNormalizer.d.ts.map +1 -0
  164. package/lib/typescript/src/web/normalization/prepareHtmlForWeb.d.ts +2 -0
  165. package/lib/typescript/src/web/normalization/prepareHtmlForWeb.d.ts.map +1 -0
  166. package/lib/typescript/src/web/normalization/tiptapHtmlNormalizer.d.ts +3 -0
  167. package/lib/typescript/src/web/normalization/tiptapHtmlNormalizer.d.ts.map +1 -0
  168. package/lib/typescript/src/web/pmPlugins/AutolinkPlugin/autolinkRegex.d.ts +7 -0
  169. package/lib/typescript/src/web/pmPlugins/AutolinkPlugin/autolinkRegex.d.ts.map +1 -0
  170. package/lib/typescript/src/web/pmPlugins/AutolinkPlugin/index.d.ts +8 -0
  171. package/lib/typescript/src/web/pmPlugins/AutolinkPlugin/index.d.ts.map +1 -0
  172. package/lib/typescript/src/web/pmPlugins/MentionPlugin/index.d.ts +1 -1
  173. package/lib/typescript/src/web/pmPlugins/MentionPlugin/index.d.ts.map +1 -1
  174. package/lib/typescript/src/web/pmPlugins/MentionPlugin/makeMentionPluginState.d.ts.map +1 -1
  175. package/lib/typescript/src/web/pmPlugins/MentionPlugin/setMention.d.ts.map +1 -1
  176. package/lib/typescript/src/web/pmPlugins/MentionPlugin/useMentionEvents.d.ts +4 -0
  177. package/lib/typescript/src/web/pmPlugins/MentionPlugin/useMentionEvents.d.ts.map +1 -0
  178. package/lib/typescript/src/web/pmPlugins/ShortcutPlugin.d.ts.map +1 -1
  179. package/lib/typescript/src/web/pmPlugins/StrictMarksPlugin.d.ts.map +1 -1
  180. package/lib/typescript/src/web/pmPlugins/StripBoldInStyledHeadingsPlugin.d.ts +6 -1
  181. package/lib/typescript/src/web/pmPlugins/StripBoldInStyledHeadingsPlugin.d.ts.map +1 -1
  182. package/lib/typescript/src/web/sanitization/htmlSanitizer.d.ts +2 -0
  183. package/lib/typescript/src/web/sanitization/htmlSanitizer.d.ts.map +1 -0
  184. package/lib/typescript/src/web/styleConversion/buildMentionRulesCSS.d.ts +2 -2
  185. package/lib/typescript/src/web/styleConversion/buildMentionRulesCSS.d.ts.map +1 -1
  186. package/lib/typescript/src/web/styleConversion/enrichedBaseStyleToCSSProperties.d.ts +8 -0
  187. package/lib/typescript/src/web/styleConversion/enrichedBaseStyleToCSSProperties.d.ts.map +1 -0
  188. package/lib/typescript/src/web/styleConversion/enrichedInputStyleToCSSProperties.d.ts +2 -5
  189. package/lib/typescript/src/web/styleConversion/enrichedInputStyleToCSSProperties.d.ts.map +1 -1
  190. package/lib/typescript/src/web/styleConversion/enrichedTextStyleToCSSProperties.d.ts +4 -0
  191. package/lib/typescript/src/web/styleConversion/enrichedTextStyleToCSSProperties.d.ts.map +1 -0
  192. package/lib/typescript/src/web/styleConversion/{enrichedInputThemingToCSSProperties.d.ts → enrichedThemingToCSSProperties.d.ts} +1 -1
  193. package/lib/typescript/src/web/styleConversion/enrichedThemingToCSSProperties.d.ts.map +1 -0
  194. package/lib/typescript/src/web/styleConversion/htmlStyleToCSSVariables.d.ts +5 -4
  195. package/lib/typescript/src/web/styleConversion/htmlStyleToCSSVariables.d.ts.map +1 -1
  196. package/lib/typescript/src/web/styleConversion/inlineImageCSSVariables.d.ts +3 -0
  197. package/lib/typescript/src/web/styleConversion/inlineImageCSSVariables.d.ts.map +1 -0
  198. package/lib/typescript/src/web/useImageErrorFallback.d.ts +3 -0
  199. package/lib/typescript/src/web/useImageErrorFallback.d.ts.map +1 -0
  200. package/lib/typescript/src/web/useOnChangeState.d.ts.map +1 -1
  201. package/lib/typescript/src/web/useOnLinkDetected.d.ts +2 -2
  202. package/lib/typescript/src/web/useOnLinkDetected.d.ts.map +1 -1
  203. package/lib/typescript/src/web/usePressInteractions.d.ts +2 -0
  204. package/lib/typescript/src/web/usePressInteractions.d.ts.map +1 -0
  205. package/lib/typescript/src/web/useStableRef.d.ts +3 -0
  206. package/lib/typescript/src/web/useStableRef.d.ts.map +1 -0
  207. package/package.json +54 -28
  208. package/src/index.tsx +1 -0
  209. package/src/types.ts +5 -3
  210. package/src/utils/expandMentionStylesForIndicators.ts +3 -3
  211. package/src/utils/normalizeHtmlStyle.ts +2 -1
  212. package/src/web/EnrichedText.css +343 -0
  213. package/src/web/EnrichedText.tsx +82 -0
  214. package/src/web/EnrichedTextInput.tsx +69 -55
  215. package/src/web/constants/brokenImageGlyph.ts +7 -0
  216. package/src/web/constants/classNames.ts +2 -0
  217. package/src/web/emitLinkDetected.ts +29 -0
  218. package/src/web/formats/EnrichedBlockquote.ts +2 -1
  219. package/src/web/formats/EnrichedCheckboxList.ts +5 -2
  220. package/src/web/formats/EnrichedCodeBlock.ts +2 -1
  221. package/src/web/formats/EnrichedHeading.ts +2 -1
  222. package/src/web/formats/EnrichedImageNodeView.tsx +1 -3
  223. package/src/web/formats/EnrichedLink.ts +59 -4
  224. package/src/web/formats/EnrichedOrderedList.ts +5 -2
  225. package/src/web/formats/EnrichedTextAlign.ts +88 -0
  226. package/src/web/formats/EnrichedUnorderedList.ts +5 -2
  227. package/src/web/formats/applyWrappingListToSelection.ts +4 -4
  228. package/src/web/formats/formatRules.ts +48 -4
  229. package/src/web/formats/listKeyboard.ts +6 -1
  230. package/src/web/normalization/htmlNormalizer.ts +656 -0
  231. package/src/web/normalization/prepareHtmlForWeb.ts +93 -0
  232. package/src/web/{tiptapHtmlNormalizer.ts → normalization/tiptapHtmlNormalizer.ts} +12 -2
  233. package/src/web/pmPlugins/AutolinkPlugin/autolinkRegex.ts +43 -0
  234. package/src/web/pmPlugins/AutolinkPlugin/index.ts +274 -0
  235. package/src/web/pmPlugins/MentionPlugin/index.ts +1 -1
  236. package/src/web/pmPlugins/MentionPlugin/makeMentionPluginState.ts +32 -5
  237. package/src/web/pmPlugins/MentionPlugin/setMention.ts +19 -29
  238. package/src/web/pmPlugins/MentionPlugin/useMentionEvents.ts +114 -0
  239. package/src/web/pmPlugins/ShortcutPlugin.ts +7 -0
  240. package/src/web/pmPlugins/StrictMarksPlugin.ts +3 -0
  241. package/src/web/pmPlugins/StripBoldInStyledHeadingsPlugin.ts +41 -36
  242. package/src/web/sanitization/htmlSanitizer.ts +8 -0
  243. package/src/web/styleConversion/buildMentionRulesCSS.ts +30 -11
  244. package/src/web/styleConversion/enrichedBaseStyleToCSSProperties.ts +228 -0
  245. package/src/web/styleConversion/enrichedInputStyleToCSSProperties.ts +6 -217
  246. package/src/web/styleConversion/enrichedTextStyleToCSSProperties.ts +53 -0
  247. package/src/web/styleConversion/{enrichedInputThemingToCSSProperties.ts → enrichedThemingToCSSProperties.ts} +4 -4
  248. package/src/web/styleConversion/htmlStyleToCSSVariables.ts +121 -70
  249. package/src/web/styleConversion/inlineImageCSSVariables.ts +6 -0
  250. package/src/web/useImageErrorFallback.ts +37 -0
  251. package/src/web/useOnChangeHtml.ts +1 -1
  252. package/src/web/useOnChangeState.ts +7 -5
  253. package/src/web/useOnLinkDetected.ts +38 -50
  254. package/src/web/usePressInteractions.tsx +22 -0
  255. package/src/web/useStableRef.ts +12 -0
  256. package/lib/module/web/EnrichedTextInput.css +0 -201
  257. package/lib/module/web/checkboxHtmlNormalizer.js.map +0 -1
  258. package/lib/module/web/pmPlugins/MentionPlugin/subscribeMentionEvents.js +0 -100
  259. package/lib/module/web/pmPlugins/MentionPlugin/subscribeMentionEvents.js.map +0 -1
  260. package/lib/module/web/styleConversion/enrichedInputThemingToCSSProperties.js.map +0 -1
  261. package/lib/module/web/tiptapHtmlNormalizer.js.map +0 -1
  262. package/lib/typescript/src/web/checkboxHtmlNormalizer.d.ts.map +0 -1
  263. package/lib/typescript/src/web/pmPlugins/MentionPlugin/subscribeMentionEvents.d.ts +0 -4
  264. package/lib/typescript/src/web/pmPlugins/MentionPlugin/subscribeMentionEvents.d.ts.map +0 -1
  265. package/lib/typescript/src/web/styleConversion/enrichedInputThemingToCSSProperties.d.ts.map +0 -1
  266. package/lib/typescript/src/web/tiptapHtmlNormalizer.d.ts +0 -3
  267. package/lib/typescript/src/web/tiptapHtmlNormalizer.d.ts.map +0 -1
  268. package/src/web/EnrichedTextInput.css +0 -201
  269. package/src/web/pmPlugins/MentionPlugin/subscribeMentionEvents.ts +0 -105
  270. /package/lib/module/web/{checkboxHtmlNormalizer.js → normalization/checkboxHtmlNormalizer.js} +0 -0
  271. /package/lib/typescript/src/web/{checkboxHtmlNormalizer.d.ts → normalization/checkboxHtmlNormalizer.d.ts} +0 -0
  272. /package/src/web/{checkboxHtmlNormalizer.ts → normalization/checkboxHtmlNormalizer.ts} +0 -0
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  import { isMentionStyleRecord } from "../../utils/isMentionStyleRecord.js";
4
- import { ETI_MENTION_CSS_VARS } from "./htmlStyleToCSSVariables.js";
4
+ import { ENRICHED_TEXT_CLASSNAME, ENRICHED_TEXT_INPUT_CLASSNAME } from "../constants/classNames.js";
5
+ import { ET_MENTION_CSS_VARS } from "./htmlStyleToCSSVariables.js";
5
6
  import { MENTION_STYLE_DEFAULT_KEY } from "./mentionIndicatorCssKey.js";
6
7
  function escapeIndicatorForCssAttributeSelector(indicator) {
7
8
  if (typeof CSS !== 'undefined' && typeof CSS.escape === 'function') {
@@ -9,6 +10,9 @@ function escapeIndicatorForCssAttributeSelector(indicator) {
9
10
  }
10
11
  return indicator.replace(/["\\]/g, '\\$&');
11
12
  }
13
+ function mentionSelector(className, indicator) {
14
+ return indicator === MENTION_STYLE_DEFAULT_KEY ? `.${className} mention` : `.${className} mention[indicator="${escapeIndicatorForCssAttributeSelector(indicator)}"]`;
15
+ }
12
16
  export function buildMentionRulesCSS(htmlStyle) {
13
17
  const mapRaw = htmlStyle?.mention;
14
18
  if (!mapRaw || typeof mapRaw !== 'object' || !isMentionStyleRecord(mapRaw)) {
@@ -21,11 +25,13 @@ export function buildMentionRulesCSS(htmlStyle) {
21
25
  }
22
26
  const lines = [];
23
27
  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)});
28
+ const inputSelector = mentionSelector(ENRICHED_TEXT_INPUT_CLASSNAME, indicator);
29
+ const textSelector = mentionSelector(ENRICHED_TEXT_CLASSNAME, indicator);
30
+ lines.push(`${inputSelector},
31
+ ${textSelector} {
32
+ color: var(${ET_MENTION_CSS_VARS.color(indicator)});
33
+ background-color: var(${ET_MENTION_CSS_VARS.backgroundColor(indicator)});
34
+ text-decoration-line: var(${ET_MENTION_CSS_VARS.textDecorationLine(indicator)});
29
35
  }`.trim());
30
36
  }
31
37
  return lines.join('\n');
@@ -1 +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":[]}
1
+ {"version":3,"names":["isMentionStyleRecord","ENRICHED_TEXT_CLASSNAME","ENRICHED_TEXT_INPUT_CLASSNAME","ET_MENTION_CSS_VARS","MENTION_STYLE_DEFAULT_KEY","escapeIndicatorForCssAttributeSelector","indicator","CSS","escape","replace","mentionSelector","className","buildMentionRulesCSS","htmlStyle","mapRaw","mention","map","keys","Object","length","lines","inputSelector","textSelector","push","color","backgroundColor","textDecorationLine","trim","join"],"sourceRoot":"../../../../src","sources":["web/styleConversion/buildMentionRulesCSS.ts"],"mappings":";;AAKA,SAASA,oBAAoB,QAAQ,qCAAkC;AACvE,SACEC,uBAAuB,EACvBC,6BAA6B,QACxB,4BAAyB;AAChC,SAASC,mBAAmB,QAAQ,8BAA2B;AAC/D,SAASC,yBAAyB,QAAQ,6BAA0B;AAEpE,SAASC,sCAAsCA,CAACC,SAAiB,EAAU;EACzE,IAAI,OAAOC,GAAG,KAAK,WAAW,IAAI,OAAOA,GAAG,CAACC,MAAM,KAAK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I,CAAC,IAAI,CAAC;AACzB","ignoreList":[]}
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+
3
+ import { toColor } from "./toColor.js";
4
+ export function enrichedBaseStyleToCSSProperties(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=enrichedBaseStyleToCSSProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["toColor","enrichedBaseStyleToCSSProperties","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/enrichedBaseStyleToCSSProperties.ts"],"mappings":";;AAOA,SAASA,O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ACxD,IAAI,SAAS,IAAIV,IAAI,EAAE,OAAO,WAAWA,IAAI,CAACW,OAAO,GAAG;IACxD,IAAI,OAAO,IAAIX,IAAI,EAAE,OAAO,SAASA,IAAI,CAACY,KAAK,GAAG;IAClD,IAAI,OAAO,IAAIZ,IAAI,EAAE,OAAO,SAASA,IAAI,CAACa,KAAK,GAAG;IAClD,IAAI,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":[]}
@@ -1,159 +1,7 @@
1
1
  "use strict";
2
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;
3
+ import { enrichedBaseStyleToCSSProperties } from "./enrichedBaseStyleToCSSProperties.js";
4
+ export function enrichedInputStyleToCSSProperties(style, extraOptions) {
5
+ return enrichedBaseStyleToCSSProperties(style, extraOptions);
158
6
  }
159
7
  //# sourceMappingURL=enrichedInputStyleToCSSProperties.js.map
@@ -1 +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,CAACK,MAAM,CAAC;IAC1BC,QAAQ,EAAEF,IAAI,CAACJ,KAAK,CAACM,QAAQ,CAAC;IAC9BC,QAAQ,EAAEH,IAAI,CAACJ,KAAK,CAACO,QAAQ,CAAC;IAC9BC,SAAS,EAAEJ,IAAI,CAACJ,KAAK,CAACQ,SAAS,CAAC;IAChCC,SAAS,EAAEL,IAAI,CAACJ,KAAK,CAACS,SAAS,CAAC;IAChCC,GAAG,EAAEN,IAAI,CAACJ,KAAK,CAACU,GAAG,CAAC;IACpBC,MAAM,EAAEP,IAAI,CAACJ,KAAK,CAACW,MAAM,CA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K,CAAC3B,MAAM,CAAC+C,OAAO,CAAC,CAACD,IAAI,CAAC,GAAG,CAAC;EAC3C,OAAOnJ,GAAG,IAAIsF,SAAS;AACzB","ignoreList":[]}
1
+ {"version":3,"names":["enrichedBaseStyleToCSSProperties","enrichedInputStyleToCSSProperties","style","extraOptions"],"sourceRoot":"../../../../src","sources":["web/styleConversion/enrichedInputStyleToCSSProperties.ts"],"mappings":";;AAEA,SACEA,gCAAgC,QAE3B,uCAAoC;AAE3C,OAAO,SAASC,iCAAiCA,CAC/CC,KAAyB,EACzBC,YAA0C,EAC3B;EACf,OAAOH,gCAAgC,CAACE,KAAK,EAAEC,YAAY,CAAC;AAC9D","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ import { enrichedBaseStyleToCSSProperties } from "./enrichedBaseStyleToCSSProperties.js";
4
+ import { toColor } from "./toColor.js";
5
+ export function enrichedTextStyleToCSSProperties(style) {
6
+ const css = {
7
+ ...enrichedBaseStyleToCSSProperties(style, {
8
+ scrollEnabled: false
9
+ }),
10
+ // Text-only properties
11
+ // textAlign: RN 'auto' has no CSS equivalent
12
+ textAlign: style.textAlign !== 'auto' ? style.textAlign : undefined,
13
+ textTransform: style.textTransform,
14
+ textDecorationLine: style.textDecorationLine,
15
+ textDecorationStyle: style.textDecorationStyle,
16
+ textDecorationColor: toColor(style.textDecorationColor),
17
+ textShadow: resolveTextShadow(style),
18
+ // userSelect: RN 'contain' has no CSS equivalent
19
+ userSelect: style.userSelect !== 'contain' ? style.userSelect : undefined,
20
+ fontVariant: Array.isArray(style.fontVariant) ? style.fontVariant.join(' ') : undefined,
21
+ // writingDirection: RN 'auto' has no CSS equivalent
22
+ direction: style.writingDirection !== 'auto' ? style.writingDirection : undefined,
23
+ // verticalAlign: RN 'auto' has no CSS equivalent
24
+ verticalAlign: style.verticalAlign !== 'auto' ? style.verticalAlign : undefined
25
+ };
26
+ return Object.fromEntries(Object.entries(css).filter(([, v]) => v !== undefined));
27
+ }
28
+ function resolveTextShadow(style) {
29
+ const {
30
+ textShadowColor,
31
+ textShadowOffset,
32
+ textShadowRadius
33
+ } = style;
34
+ if (textShadowColor == null && textShadowOffset == null && textShadowRadius == null) {
35
+ return undefined;
36
+ }
37
+ const x = textShadowOffset?.width ?? 0;
38
+ const y = textShadowOffset?.height ?? 0;
39
+ const blur = textShadowRadius ?? 0;
40
+ const color = toColor(textShadowColor);
41
+ const offset = `${x}px ${y}px ${blur}px`;
42
+ return color ? `${offset} ${color}` : offset;
43
+ }
44
+ //# sourceMappingURL=enrichedTextStyleToCSSProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["enrichedBaseStyleToCSSProperties","toColor","enrichedTextStyleToCSSProperties","style","css","scrollEnabled","textAlign","undefined","textTransform","textDecorationLine","textDecorationStyle","textDecorationColor","textShadow","resolveTextShadow","userSelect","fontVariant","Array","isArray","join","direction","writingDirection","verticalAlign","Object","fromEntries","entries","filter","v","textShadowColor","textShadowOffset","textShadowRadius","x","width","y","height","blur","color","offset"],"sourceRoot":"../../../../src","sources":["web/styleConversion/enrichedTextStyleToCSSProperties.ts"],"mappings":";;AAEA,SAASA,gCAAgC,QAAQ,uCAAoC;AACrF,SAASC,OAAO,QAAQ,cAAW;AAEnC,OAAO,SAASC,gCAAgCA,CAC9CC,KAAgB,EACD;EACf,MAAMC,GAAkB,GAAG;IACzB,GAAGJ,gCAAgC,CAACG,KAAK,EAAE;MAAEE,aAAa,EAAE;IAAM,CAAC,CAAC;IAEpE;IACA;IACAC,SAAS,EAAEH,KAAK,CAACG,SAAS,KAAK,MAAM,GAAGH,KAAK,CAACG,SAAS,GAAGC,SAAS;IACnEC,aAAa,EAAEL,KAAK,CAACK,aAAa;IAClCC,kBAAkB,EAAEN,KAAK,CAACM,kBAAkB;IAC5CC,mBAAmB,EAAEP,KAAK,CAACO,mBAAmB;IAC9CC,mBAAmB,EAAEV,OAAO,CAACE,KAAK,CAACQ,mBAAmB,CAAC;IACvDC,UAAU,EAAE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AAC9C","ignoreList":[]}
@@ -10,9 +10,9 @@ export function enrichedInputThemingToCSSProperties({
10
10
  const caret = toColor(cursorColor);
11
11
  if (caret) extra.caretColor = caret;
12
12
  const placeholderCss = toColor(placeholderTextColor);
13
- if (placeholderCss) extra['--eti-placeholder-text-color'] = placeholderCss;
13
+ if (placeholderCss) extra['--et-placeholder-text-color'] = placeholderCss;
14
14
  const selectionCss = toColor(selectionColor);
15
- if (selectionCss) extra['--eti-selection-color'] = selectionCss;
15
+ if (selectionCss) extra['--et-selection-color'] = selectionCss;
16
16
  return extra;
17
17
  }
18
- //# sourceMappingURL=enrichedInputThemingToCSSProperties.js.map
18
+ //# sourceMappingURL=enrichedThemingToCSSProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["toColor","enrichedInputThemingToCSSProperties","cursorColor","placeholderTextColor","selectionColor","extra","caret","caretColor","placeholderCss","selectionCss"],"sourceRoot":"../../../../src","sources":["web/styleConversion/enrichedThemingToCSSProperties.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,6BAA6B,CAAC,GAAGG,cAAc;EAEzE,MAAMC,YAAY,GAAGT,OAAO,CAACI,cAAc,CAAC;EAC5C,IAAIK,YAAY,EAAEJ,KAAK,CAAC,sBAAsB,CAAC,GAAGI,YAAY;EAE9D,OAAOJ,KAAK;AACd","ignoreList":[]}