mirror of
https://github.com/penpot/penpot.git
synced 2025-06-04 00:21:37 +02:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
f554de8859
12 changed files with 69 additions and 20 deletions
|
@ -467,6 +467,7 @@
|
|||
(defn create-file
|
||||
[{:keys [project-id name] :as params}]
|
||||
(dm/assert! (uuid? project-id))
|
||||
|
||||
(ptk/reify ::create-file
|
||||
ev/Event
|
||||
(-data [_] {:project-id project-id})
|
||||
|
|
|
@ -169,7 +169,7 @@
|
|||
(let [mdata {:on-success on-file-created}
|
||||
params {:project-id (:id project)}]
|
||||
(st/emit! (-> (dd/create-file (with-meta params mdata))
|
||||
(with-meta {::ev/origin origin}))))))]
|
||||
(with-meta {::ev/origin origin :has-files (> file-count 0)}))))))]
|
||||
|
||||
(mf/with-effect [project]
|
||||
(when project
|
||||
|
|
|
@ -20,7 +20,10 @@
|
|||
(mf/use-fn
|
||||
(mf/deps create-fn)
|
||||
(fn [_]
|
||||
(create-fn "dashboard:empty-folder-placeholder")))]
|
||||
(create-fn "dashboard:empty-folder-placeholder")))
|
||||
show-text (mf/use-state nil)
|
||||
on-mouse-enter (mf/use-fn #(reset! show-text true))
|
||||
on-mouse-leave (mf/use-fn #(reset! show-text nil))]
|
||||
(cond
|
||||
(true? dragging?)
|
||||
[:ul
|
||||
|
@ -43,9 +46,15 @@
|
|||
|
||||
:else
|
||||
[:div {:class (stl/css :grid-empty-placeholder)}
|
||||
[:button {:class (stl/css :create-new)
|
||||
:on-click on-click}
|
||||
(if (cf/external-feature-flag "add-file-01" "test") (tr "dashboard.add-file") i/add)]])))
|
||||
(if (cf/external-feature-flag "add-file-01" "test")
|
||||
[:button {:class (stl/css :create-new)
|
||||
:on-click on-click
|
||||
:on-mouse-enter on-mouse-enter
|
||||
:on-mouse-leave on-mouse-leave}
|
||||
(if @show-text (tr "dashboard.add-file") i/add)]
|
||||
[:button {:class (stl/css :create-new)
|
||||
:on-click on-click}
|
||||
i/add])])))
|
||||
|
||||
(mf/defc loading-placeholder
|
||||
[]
|
||||
|
|
|
@ -181,7 +181,7 @@
|
|||
(let [mdata {:on-success on-file-created}
|
||||
params {:project-id project-id}]
|
||||
(st/emit! (-> (dd/create-file (with-meta params mdata))
|
||||
(with-meta {::ev/origin origin}))))))
|
||||
(with-meta {::ev/origin origin :has-files (> file-count 0)}))))))
|
||||
|
||||
on-create-click
|
||||
(mf/use-fn
|
||||
|
|
|
@ -358,6 +358,16 @@ export class SelectionController extends EventTarget {
|
|||
detail: this.#currentStyle,
|
||||
})
|
||||
);
|
||||
} else {
|
||||
const firstInline = this.#textEditor.root?.firstElementChild?.firstElementChild;
|
||||
if (firstInline) {
|
||||
this.#updateCurrentStyle(firstInline);
|
||||
this.dispatchEvent(
|
||||
new CustomEvent("stylechange", {
|
||||
detail: this.#currentStyle,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue