Enhance/plugin APIs x (#10022)

* fix(apis): validate non-empty uuid input for query block

* fix(plugin): missing block data for the nested renderer macro hook

* fix(plugin): incorrect block config for the query table block items
pull/10078/head
Charlie 2023-08-22 21:36:38 +08:00 committed by GitHub
parent 6ce6b1933c
commit 583a3d5dc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View File

@ -952,7 +952,7 @@
(if (and (not paragraph?)
(mldoc/block-with-title? (ffirst ast)))
(markup-elements-cp (assoc config :block/format format) ast)
(inline-text format macro-content)))
(inline-text config format macro-content)))
[:span.warning {:title (str "Unsupported macro name: " name)}
(macro->text name arguments)])])

View File

@ -118,7 +118,7 @@
(defn- build-column-value
"Builds a column's tuple value for a query table given a row, column and
options"
[row column {:keys [page? ->elem map-inline config comma-separated-property?]}]
[row column {:keys [page? ->elem map-inline comma-separated-property?]}]
(case column
:page
[:string (if page?
@ -129,13 +129,14 @@
:block ; block title
(let [content (:block/content row)
uuid (:block/uuid row)
{:block/keys [title]} (block/parse-title-and-body
(:block/uuid row)
(:block/format row)
(:block/pre-block? row)
content)]
(if (seq title)
[:element (->elem :div (map-inline config title))]
[:element (->elem :div (map-inline {:block/uuid uuid} title))]
[:string content]))
:created-at

View File

@ -12,7 +12,7 @@
[id-or-uuid ^js opts]
(when-let [block (if (number? id-or-uuid)
(db-utils/pull id-or-uuid)
(db-model/query-block-by-uuid (sdk-utils/uuid-or-throw-error id-or-uuid)))]
(and id-or-uuid (db-model/query-block-by-uuid (sdk-utils/uuid-or-throw-error id-or-uuid))))]
(when-not (contains? block :block/name)
(when-let [uuid (:block/uuid block)]
(let [{:keys [includeChildren]} (bean/->clj opts)