Merge remote-tracking branch 'upstream/master' into whiteboards

This commit is contained in:
Peng Xiao
2022-08-18 11:57:48 +08:00
6 changed files with 85 additions and 93 deletions

View File

@@ -1771,19 +1771,11 @@
(defn close-autocomplete-if-outside
[input]
(when (and input
(state/get-editor-action)
(not (wrapped-by? input page-ref/left-brackets page-ref/right-brackets)))
(let [value (gobj/get input "value")
pos (state/get-editor-last-pos)
current-pos (cursor/pos input)
between (gp-util/safe-subs value (min pos current-pos) (max pos current-pos))]
(when (and between
(or
(string/includes? between "[")
(string/includes? between "]")
(string/includes? between "(")
(string/includes? between ")")))
(state/clear-editor-action!)))))
(contains? #{:page-search :page-search-hashtag :block-search} (state/get-editor-action))
(not (wrapped-by? input page-ref/left-brackets page-ref/right-brackets))
(not (wrapped-by? input block-ref/left-parens block-ref/right-parens))
(not (wrapped-by? input "#" "")))
(state/clear-editor-action!)))
(defn resize-image!
[block-id metadata full_text size]