fix: components not registered for property value

experiment/tanstack-table
Tienson Qin 2024-05-27 21:18:01 +08:00
parent d432bb1f71
commit c9461dd745
3 changed files with 16 additions and 1 deletions

View File

@ -810,7 +810,13 @@
[state block property v opts]
(ui/catch-error
(ui/block-error "Something wrong" {})
(let [dom-id (str "ls-property-" (:db/id block) "-" (:db/id property))
(let [opts (merge opts
{:page-cp (state/get-component :block/page-cp)
:inline-text (state/get-component :block/inline-text)
:editor-box (state/get-component :editor/box)
:block-cp (state/get-component :block/blocks-container)
:properties-cp (state/get-component :block/properties-cp)})
dom-id (str "ls-property-" (:db/id block) "-" (:db/id property))
editor-id (str dom-id "-editor")
schema (:block/schema property)
type (some-> schema (get :type :default))

View File

@ -147,8 +147,11 @@
(state/set-component! :whiteboard/tldraw-preview whiteboard/tldraw-preview)
(state/set-component! :block/single-block block/single-block-cp)
(state/set-component! :block/container block/block-container)
(state/set-component! :block/blocks-container block/blocks-container)
(state/set-component! :block/properties-cp block/db-properties-cp)
(state/set-component! :block/embed block/block-embed)
(state/set-component! :block/page-cp block/page-cp)
(state/set-component! :block/inline-text block/inline-text)
(state/set-component! :editor/box editor/box)
(command-palette/register-global-shortcut-commands))

View File

@ -91,6 +91,12 @@
(state/set-component! :block/linked-references reference/block-linked-references)
(state/set-component! :whiteboard/tldraw-preview whiteboard/tldraw-preview)
(state/set-component! :block/single-block block/single-block-cp)
(state/set-component! :block/container block/block-container)
(state/set-component! :block/blocks-container block/blocks-container)
(state/set-component! :block/properties-cp block/db-properties-cp)
(state/set-component! :block/embed block/block-embed)
(state/set-component! :block/page-cp block/page-cp)
(state/set-component! :block/inline-text block/inline-text)
(state/set-component! :editor/box editor/box)
(command-palette/register-global-shortcut-commands))