Skip to content

Commit

Permalink
shui/table introduction
Browse files Browse the repository at this point in the history
  • Loading branch information
bendyorke authored and logseq-cldwalker committed May 12, 2023
1 parent 42dd084 commit 928742e
Show file tree
Hide file tree
Showing 37 changed files with 1,883 additions and 187 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,8 @@ android/app/src/main/assets/capacitor.config.json
/public/static
.yarn/
.yarnrc.yml

deps/shui/.lsp
deps/shui/.lsp-cache
deps/shui/.clj-kondo
deps/shui/shui-graph/logseq/bak
5 changes: 3 additions & 2 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.2"}
instaparse/instaparse {:mvn/version "1.4.10"}
org.clojars.mmb90/cljs-cache {:mvn/version "0.1.4"}
fipp/fipp {:mvn/version "0.6.26"}
logseq/common {:local/root "deps/common"}
logseq/graph-parser {:local/root "deps/graph-parser"}
logseq/publishing {:local/root "deps/publishing"}
metosin/malli {:mvn/version "0.10.0"}
fipp/fipp {:mvn/version "0.6.26"}}
logseq/shui {:local/root "deps/shui"}
metosin/malli {:mvn/version "0.10.0"}}

:aliases {:cljs {:extra-paths ["src/dev-cljs/" "src/test/" "src/electron/"]
:extra-deps {org.clojure/clojurescript {:mvn/version "1.11.54"}
Expand Down
7 changes: 6 additions & 1 deletion deps/graph-parser/src/logseq/graph_parser/property.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@
"Properties used by logseq that user can edit"
[]
(into #{:title :icon :template :template-including-parent :public :filters :exclude-from-graph-view
:logseq.query/nlp-date
:logseq.query/nlp-date
;; view props
:logseq.color
;; table props
:logseq.table.version :logseq.table.compact :logseq.table.headers :logseq.table.hover
:logseq.table.borders :logseq.table.stripes :logseq.table.max-width
;; org-mode only
:macro :filetags}
editable-linkable-built-in-properties))
Expand Down
17 changes: 17 additions & 0 deletions deps/shui/.clj-kondo/config.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ :config-in-ns
;; :used-underscored-binding is turned off for components because of false positive
;; for rum/defcs and _state.
{all-components {:linters {:used-underscored-binding {:level :off}}}}

:linters
{;; Disable until it doesn't trigger false positives on rum/defcontext
:earmuffed-var-not-dynamic {:level :off}}
:hooks {:analyze-call {rum.core/defc hooks.rum/defc
rum.core/defcs hooks.rum/defcs
clojure.string/join hooks.path-invalid-construct/string-join}}
:lint-as {rum.core/defcc rum.core/defc
rum.core/with-context clojure.core/let
rum.core/defcontext clojure.core/def
rum.core/defc clojure.core/defn
rum.core/defcs clojure.core/defn
frontend.react/defc clojure.core/defn}}
29 changes: 29 additions & 0 deletions deps/shui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## Description

This library provides a set of UI components for use within logseq.

## API

This library is under the parent namespace `logseq.shui`. This library provides
several namespaces, all of which will be versioned, with the exception of `logseq.shui.context`.

An example of a versioned namespace is the table namespace:

`logseq.shui.table.v2`

`root` components are exported from each versioned file to indicate the root component to be rendered:

`logseq.shui.table.v2/root`

Each root component should expect two arguments, `props` and `context`.

## `props`

Ultimately, components in shui will need to be used by JavaScript. While it is idiomatic in clojure to
use a list of properties, it is idiomatic in react to use a single props map. Shui components should therefore
stick to this convention when possible to ease the conversion between the two languages.

## `context`

Context is a set of functions that call back to the main application. These are abstracted out into a context
object to make it clear what is used internally, and what is used externally.
1 change: 1 addition & 0 deletions deps/shui/deps.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{:paths ["src"]}
2 changes: 2 additions & 0 deletions deps/shui/shui-graph/journals/2023_03_27.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-
-
Loading

0 comments on commit 928742e

Please sign in to comment.