Skip to content

Commit

Permalink
upgrade deps; use js regex; bump 0.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Oct 3, 2021
1 parent cda8baa commit 16401e5
Show file tree
Hide file tree
Showing 6 changed files with 2,598 additions and 1,481 deletions.
3,676 changes: 2,353 additions & 1,323 deletions calcit.cirru

Large diffs are not rendered by default.

165 changes: 77 additions & 88 deletions compact.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,27 @@
{} (:package |calcit-theme)
:configs $ {} (:init-fn |calcit-theme.main/main!) (:reload-fn |calcit-theme.main/reload!)
:modules $ [] |memof/compact.cirru |lilac/compact.cirru |respo.calcit/compact.cirru |respo-ui.calcit/compact.cirru |reel.calcit/compact.cirru
:version |0.2.2
:version |0.2.3
:files $ {}
|calcit-theme.config $ {}
:ns $ quote (ns calcit-theme.config)
:defs $ {}
|cdn? $ quote
def cdn? $ cond
exists? js/window
, false
(exists? js/process) (= "\"true" js/process.env.cdn)
:else false
|dev? $ quote (def dev? true)
|site $ quote
def site $ {} (:dev-ui "\"http://localhost:8100/main.css") (:release-ui "\"http://cdn.tiye.me/favored-fonts/main.css") (:cdn-url "\"http://cdn.tiye.me/calcit-theme/") (:cdn-folder "\"tiye.me:cdn/calcit-theme") (:title "\"Calcit Theme") (:icon "\"http://cdn.tiye.me/logo/cirru.png") (:storage-key "\"calcit-theme") (:upload-folder "\"tiye.me:repo/Cirru/calcit-theme/")
|calcit-theme.schema $ {}
:ns $ quote (ns calcit-theme.schema)
:defs $ {}
|store $ quote
def store $ {}
:states $ {}
:content |
|calcit-theme.comp.expr $ {}
:ns $ quote
ns calcit-theme.comp.expr $ :require
Expand All @@ -14,6 +33,8 @@
[] calcit-theme.config :refer $ [] dev?
[] calcit-theme.theme :as theme
:defs $ {}
|render-expr $ quote
defn render-expr (data) (comp-expr data false true false)
|comp-expr $ quote
defcomp comp-expr (expr tailing? root? inline?)
assert "\"expr in list" $ list? expr
Expand Down Expand Up @@ -57,56 +78,13 @@
rest xs
inc idx
, layout-kind
|render-expr $ quote
defn render-expr (data) (comp-expr data false true false)
|comp-leaf $ quote
defcomp comp-leaf (x head?)
assert "\"string for leaf" $ string? x
div
{} $ :style
merge theme/style-leaf $ theme/decorate-leaf x head?
<> x
:proc $ quote ()
|calcit-theme.updater $ {}
:ns $ quote
ns calcit-theme.updater $ :require
[] respo.cursor :refer $ [] update-states
:defs $ {}
|updater $ quote
defn updater (store op op-data op-id op-time)
case op
:states $ update-states store op-data
:content $ assoc store :content op-data
:hydrate-storage op-data
op store
:proc $ quote ()
:configs $ {} (:extension nil)
|calcit-theme.comp.container $ {}
:ns $ quote
ns calcit-theme.comp.container $ :require
[] respo.util.format :refer $ [] hsl
[] respo-ui.core :as ui
[] respo.core :refer $ [] defcomp >> <> div button textarea span
[] respo.comp.space :refer $ [] =<
[] reel.comp.reel :refer $ [] comp-reel
[] calcit-theme.config :refer $ [] dev?
[] calcit-theme.comp.expr :refer $ [] comp-expr render-expr
:defs $ {}
|comp-container $ quote
defcomp comp-container (reel)
let
store $ :store reel
states $ :states store
data $ to-calcit-data
js/JSON.parse $ slurp "\"demo.json"
div
{} $ :style
merge ui/global ui/fullscreen $ {} (:background-color :black)
render-expr data
when dev? $ comp-reel (>> states :reel) reel ({})
|slurp $ quote
defmacro slurp (file) (read-file file)
:proc $ quote ()
|calcit-theme.theme $ {}
:ns $ quote
ns calcit-theme.theme $ :require ([] respo-ui.core :as ui)
Expand Down Expand Up @@ -139,8 +117,8 @@
{} $ :color (hsl 250 50 60)
(= text "\"nil")
{} $ :color (hsl 310 60 40)
(re-matches text "\"^-?\\d")
{} $ :color (hsl 0 70 40)
(.!match text (new js/RegExp "\"^-?\\d"))
{} $ :color (hsl 300 70 40)
leading? $ {}
:color $ hsl 40 85 60
true $ {}
Expand All @@ -159,7 +137,6 @@
|style-leaf $ quote
def style-leaf $ {} (:display :inline-block) (:text-align :top) (:font-family ui/font-code) (:margin "\"0 4px") (:padding "\"0 4px")
:color $ hsl 200 14 60
:proc $ quote ()
|calcit-theme.main $ {}
:ns $ quote
ns calcit-theme.main $ :require
Expand All @@ -172,20 +149,19 @@
[] reel.schema :as reel-schema
[] calcit-theme.config :as config
:defs $ {}
|ssr? $ quote
def ssr? $ some? (js/document.querySelector |meta.respo-ssr)
|repeat! $ quote
defn repeat! (duration cb)
js/setTimeout
fn () (cb) (repeat! duration cb)
* duration 1000
|dispatch! $ quote
defn dispatch! (op op-data) (; println |Dispatch: op)
reset! *reel $ reel-updater updater @*reel op op-data
|render-app! $ quote
defn render-app! (renderer)
renderer mount-target (comp-container @*reel) (\ dispatch! % %2)
|persist-storage! $ quote
defn persist-storage! () $ .setItem js/localStorage (:storage-key config/site)
js/JSON.stringify $ to-cirru-edn (:store @*reel)
|mount-target $ quote
def mount-target $ .querySelector js/document |.app
|*reel $ quote
defatom *reel $ -> reel-schema/reel (assoc :base schema/store) (assoc :store schema/store)
|main! $ quote
defn main! ()
println "\"Running mode:" $ if config/dev? "\"dev" "\"release"
if ssr? $ render-app! realize-ssr!
render-app! render!
add-watch *reel :changes $ fn (reel prev) (render-app! render!)
listen-devtools! |a dispatch!
Expand All @@ -196,40 +172,53 @@
when (some? raw)
dispatch! :hydrate-storage $ extract-cirru-edn (js/JSON.parse raw)
println "|App started."
|persist-storage! $ quote
defn persist-storage! () $ .setItem js/localStorage (:storage-key config/site)
js/JSON.stringify $ to-cirru-edn (:store @*reel)
|*reel $ quote
defatom *reel $ -> reel-schema/reel (assoc :base schema/store) (assoc :store schema/store)
|render-app! $ quote
defn render-app! (renderer)
renderer mount-target (comp-container @*reel) (\ dispatch! % %2)
|dispatch! $ quote
defn dispatch! (op op-data) (; println |Dispatch: op)
reset! *reel $ reel-updater updater @*reel op op-data
|reload! $ quote
defn reload! () (clear-cache!) (remove-watch *reel :changes)
add-watch *reel :changes $ fn (reel prev) (render-app! render!)
reset! *reel $ refresh-reel @*reel schema/store updater
println "|Code updated."
|mount-target $ quote
def mount-target $ .querySelector js/document |.app
:proc $ quote ()
|calcit-theme.schema $ {}
:ns $ quote (ns calcit-theme.schema)
|repeat! $ quote
defn repeat! (duration cb)
js/setTimeout
fn () (cb) (repeat! duration cb)
* duration 1000
|calcit-theme.updater $ {}
:ns $ quote
ns calcit-theme.updater $ :require
[] respo.cursor :refer $ [] update-states
:defs $ {}
|store $ quote
def store $ {}
:states $ {}
:content |
:proc $ quote ()
|calcit-theme.config $ {}
:ns $ quote (ns calcit-theme.config)
|updater $ quote
defn updater (store op op-data op-id op-time)
case op
:states $ update-states store op-data
:content $ assoc store :content op-data
:hydrate-storage op-data
op store
|calcit-theme.comp.container $ {}
:ns $ quote
ns calcit-theme.comp.container $ :require
[] respo.util.format :refer $ [] hsl
[] respo-ui.core :as ui
[] respo.core :refer $ [] defcomp >> <> div button textarea span
[] respo.comp.space :refer $ [] =<
[] reel.comp.reel :refer $ [] comp-reel
[] calcit-theme.config :refer $ [] dev?
[] calcit-theme.comp.expr :refer $ [] comp-expr render-expr
:defs $ {}
|cdn? $ quote
def cdn? $ cond
exists? js/window
, false
(exists? js/process) (= "\"true" js/process.env.cdn)
:else false
|dev? $ quote (def dev? true)
|site $ quote
def site $ {} (:dev-ui "\"http://localhost:8100/main.css") (:release-ui "\"http://cdn.tiye.me/favored-fonts/main.css") (:cdn-url "\"http://cdn.tiye.me/calcit-theme/") (:cdn-folder "\"tiye.me:cdn/calcit-theme") (:title "\"Calcit Theme") (:icon "\"http://cdn.tiye.me/logo/cirru.png") (:storage-key "\"calcit-theme") (:upload-folder "\"tiye.me:repo/Cirru/calcit-theme/")
:proc $ quote ()
|comp-container $ quote
defcomp comp-container (reel)
let
store $ :store reel
states $ :states store
data $ to-calcit-data
js/JSON.parse $ slurp "\"demo.json"
div
{} $ :style
merge ui/global ui/fullscreen $ {} (:background-color :black)
render-expr data
when dev? $ comp-reel (>> states :reel) reel ({})
|slurp $ quote
defmacro slurp (file) (read-file file)
3 changes: 2 additions & 1 deletion demo.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
[
"|:else",
[
"{}"
"{}",
"1"
]
]
]
Expand Down
6 changes: 3 additions & 3 deletions main.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

import { main_BANG_ } from "./js-out/calcit-theme.main.js"
import { main_$x_ } from "./js-out/calcit-theme.main.js"

main_BANG_()
main_$x_()

if (import.meta.hot) {
import.meta.hot.accept('./js-out/calcit-theme.main.js', (main) => {
main.reload_BANG_()
main.reload_$x_()
})
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"dependencies": {
"@calcit/procs": "^0.3.0-a11"
"@calcit/procs": "^0.4.37-a1"
},
"devDependencies": {
"vite": "^2.2.3"
"vite": "^2.6.2"
},
"version": "0.2.2"
"version": "0.2.3"
}
Loading

0 comments on commit 16401e5

Please sign in to comment.