|
@@ -369,18 +369,11 @@
|
|
|
(set-up-key-down! repo state format)
|
|
(set-up-key-down! repo state format)
|
|
|
(set-up-key-up! state input input-id search-timeout)))
|
|
(set-up-key-up! state input input-id search-timeout)))
|
|
|
|
|
|
|
|
-(defn- get-editor-style
|
|
|
|
|
|
|
+(defn- get-editor-heading-class
|
|
|
[content heading-level]
|
|
[content heading-level]
|
|
|
(if (string/includes? content "\n")
|
|
(if (string/includes? content "\n")
|
|
|
nil
|
|
nil
|
|
|
- (case heading-level
|
|
|
|
|
- 1 {:font-size "2em" :font-weight "bold" :margin "0.67em 0"}
|
|
|
|
|
- 2 {:font-size "1.5em" :font-weight "bold" :margin "0.75em 0"}
|
|
|
|
|
- 3 {:font-size "1.17em" :font-weight "bold" :margin "0.83em 0"}
|
|
|
|
|
- 4 {:font-weight "bold" :margin "1.12em 0"}
|
|
|
|
|
- 5 {:font-size "0.83em" :font-weight "bold" :margin "1.5em 0"}
|
|
|
|
|
- 6 {:font-size "0.75em" :font-weight "bold" :margin "1.67em 0"}
|
|
|
|
|
- nil)))
|
|
|
|
|
|
|
+ (if heading-level (str "h" heading-level))))
|
|
|
|
|
|
|
|
|
|
|
|
|
(rum/defc mock-textarea
|
|
(rum/defc mock-textarea
|
|
@@ -436,7 +429,7 @@
|
|
|
:on-change (editor-handler/editor-on-change! block id search-timeout)
|
|
:on-change (editor-handler/editor-on-change! block id search-timeout)
|
|
|
:on-paste (editor-handler/editor-on-paste! id)
|
|
:on-paste (editor-handler/editor-on-paste! id)
|
|
|
:auto-focus false
|
|
:auto-focus false
|
|
|
- :style (get-editor-style content heading-level)})
|
|
|
|
|
|
|
+ :class (get-editor-heading-class content heading-level)})
|
|
|
|
|
|
|
|
(mock-textarea)
|
|
(mock-textarea)
|
|
|
|
|
|