File tree Expand file tree Collapse file tree
deps/publish/src/logseq/publish Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 [logseq.publish.model :as publish-model]))
1111
1212; ; Timestamp in milliseconds used for cache busting static assets.
13- (defonce version 1767105766059 )
13+ (defonce version 1767194868810 )
1414
1515(def ref-regex
1616 (js/RegExp. " \\ [\\ [([0-9a-fA-F-]{36})\\ ]\\ ]|\\ (\\ (([0-9a-fA-F-]{36})\\ )\\ )" " g" ))
Original file line number Diff line number Diff line change 3232 (p/finally (fn []
3333 (set-publishing! false )
3434 (shui/dialog-close! ))))))]
35- [:div.flex.flex-col.gap-4.p-2
35+ [:form.flex.flex-col.gap-4.p-2
36+ {:on-submit (fn [e]
37+ (.preventDefault e)
38+ (submit! ))}
3639 [:div.text-lg.font-medium " Publish page" ]
3740 [:div.text-sm.opacity-70
3841 " Optionally protect this page with a password. Leave empty for public access." ]
4447 [:div.flex.justify-end.gap-2
4548 (shui/button
4649 {:variant " ghost"
50+ :type " button"
4751 :on-click #(shui/dialog-close! )}
4852 " Cancel" )
4953 (shui/button
50- {:on-click submit!
54+ {:type " submit"
55+ :auto-focus true
5156 :disabled publishing?}
5257 (if publishing?
5358 " Publishing..."
Original file line number Diff line number Diff line change 55 [frontend.components.assets :as assets]
66 [frontend.components.cmdk.core :as cmdk]
77 [frontend.components.page :as component-page]
8+ [frontend.components.page-menu :as page-menu]
89 [frontend.components.plugins :as plugin]
910 [frontend.components.property.dialog :as property-dialog]
1011 [frontend.components.quick-add :as quick-add]
100101 (plugin/open-select-theme! )
101102 (route-handler/go-to-search! :themes )))
102103
104+ (defmethod events /handle :publish/open-dialog [_]
105+ (when-not config/publishing?
106+ (when-let [page-name (state/get-current-page )]
107+ (when-let [page (db/get-page page-name)]
108+ (when (db/page? page)
109+ (shui/dialog-open!
110+ (fn [] (page-menu/publish-page-dialog page))
111+ {:class " w-auto max-w-md" }))))))
112+
103113(defmethod events /handle :ui/toggle-appearance [_]
104114 (let [popup-id " appearance_settings" ]
105115 (if (gdom/getElement popup-id)
Original file line number Diff line number Diff line change 376376 :inactive (not (util/electron? ))
377377 :binding " mod+s" }
378378
379+ :publish/open-dialog {:binding " mod+m"
380+ :inactive config/publishing?
381+ :fn #(state/pub-event! [:publish/open-dialog ])}
382+
379383 :command/run {:binding " mod+shift+1"
380384 :inactive (not (util/electron? ))
381385 :fn #(do
667671 :sidebar/open-today-page
668672 :sidebar/clear
669673 :command/run
674+ :publish/open-dialog
670675 :command-palette/toggle
671676 :editor/add-property
672677 :window/close ])
847852 :ui/customize-appearance ]
848853
849854 :shortcut.category/others
850- [:pdf/previous-page
855+ [:publish/open-dialog
856+ :pdf/previous-page
851857 :pdf/next-page
852858 :pdf/close
853859 :pdf/find
Original file line number Diff line number Diff line change 515515 :sidebar/close-top " Closes the top item in the right sidebar"
516516 :sidebar/clear " Clear all in the right sidebar"
517517 :misc/copy " Copy"
518+ :publish/open-dialog " Open publish dialog for current page"
518519 :graph/export-as-html " Export public graph pages as html"
519520 :graph/open " Select graph to open"
520521 :graph/remove " Remove a graph"
You can’t perform that action at this time.
0 commit comments