forked from logseq/logseq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
434 changed files
with
34,554 additions
and
38,456 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
**/node_modules/* | ||
**/out/* | ||
**/.next/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], | ||
"ignorePatterns": ["*.js"], | ||
"overrides": [ | ||
{ | ||
// enable the rule specifically for TypeScript files | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": { | ||
"@typescript-eslint/explicit-module-boundary-types": [0] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
node_modules/ | ||
build/ | ||
dist/ | ||
docs/ | ||
.idea/* | ||
|
||
.DS_Store | ||
coverage | ||
*.log | ||
|
||
.vercel | ||
.next | ||
apps/www/public/workbox-* | ||
apps/www/public/worker-* | ||
apps/www/public/sw.js | ||
apps/www/public/sw.js.map | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/.github/ | ||
/.vscode/ | ||
/node_modules/ | ||
/build/ | ||
/tmp/ | ||
.idea/* | ||
/docs/ | ||
|
||
coverage | ||
*.log | ||
.gitlab-ci.yml | ||
|
||
package-lock.json | ||
/*.tgz | ||
/tmp* | ||
/mnt/ | ||
/package/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"singleQuote": true, | ||
"semi": false, | ||
"printWidth": 100, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"jsxSingleQuote": false, | ||
"jsxBracketSameLine": false, | ||
"arrowParens": "avoid" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 Stephen Ruiz Ltd | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = ctx => ({ | ||
plugins: [require('autoprefixer')()], | ||
}) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
tldraw/apps/tldraw-logseq/src/components/icons/LogseqIcon.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as React from 'react' | ||
|
||
// @ts-expect-error don't bother fix it ... | ||
import iconBase64 from './logseq-icon.png' | ||
|
||
export function LogseqIcon() { | ||
return ( | ||
<img | ||
style={{ borderRadius: '50%', width: '20px', height: '20px' }} | ||
src={'data:image/png;base64,' + iconBase64} | ||
alt="logseq" | ||
/> | ||
) | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{:hooks {:analyze-call {rum.core/defc hooks.rum/defc | ||
rum.core/defcs hooks.rum/defcs}} | ||
:lint-as {promesa.core/let clojure.core/let | ||
promesa.core/loop clojure.core/loop | ||
promesa.core/recur clojure.core/recur | ||
rum.core/defcc rum.core/defc | ||
rum.core/defcontext clojure.core/def | ||
clojure.test.check.clojure-test/defspec clojure.core/def | ||
clojure.test.check.properties/for-all clojure.core/for} | ||
:skip-comments true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
(ns hooks.rum | ||
(:require [clj-kondo.hooks-api :as api])) | ||
|
||
(defn fn-body? [x] | ||
(and (seq? x) | ||
(vector? (first x)))) | ||
|
||
(defn rewrite-body [mixins body defcs?] | ||
(if defcs? | ||
(let [[binding-vec & body] (:children body) | ||
[state-arg & rest-args] (:children binding-vec) | ||
;; the original vector without the state argument | ||
fn-args (assoc binding-vec :children rest-args) | ||
body (api/list-node | ||
(list* (api/token-node 'let*) | ||
(api/vector-node [state-arg (api/token-node nil)]) | ||
state-arg | ||
(concat mixins body))) | ||
body (api/list-node [fn-args body])] | ||
body) | ||
(let [[binding-vec & body] (:children body)] | ||
(api/list-node (cons binding-vec (concat mixins body)))))) | ||
|
||
(defn rewrite | ||
([node] (rewrite node false)) | ||
([node defcs?] | ||
(let [args (rest (:children node)) | ||
component-name (first args) | ||
?docstring (when (string? (api/sexpr (second args))) | ||
(second args)) | ||
args (if ?docstring | ||
(nnext args) | ||
(next args)) | ||
bodies | ||
(loop [args* (seq args) | ||
mixins [] | ||
bodies []] | ||
(if args* | ||
(let [a (first args*) | ||
a-sexpr (api/sexpr a)] | ||
(cond (vector? a-sexpr) ;; a-sexpr is a binding vec and the rest is the body of the function | ||
[(rewrite-body mixins (api/list-node args*) defcs?)] | ||
(fn-body? a-sexpr) | ||
(recur (next args*) | ||
mixins | ||
(conj bodies (rewrite-body mixins a defcs?))) | ||
;; assume mixin | ||
:else (recur (next args*) | ||
(conj mixins a) | ||
bodies))) | ||
bodies)) | ||
new-node (with-meta | ||
(api/list-node | ||
(list* (api/token-node 'defn) | ||
component-name | ||
(if ?docstring | ||
(cons ?docstring bodies) | ||
bodies))) | ||
(meta node))] | ||
new-node))) | ||
|
||
(defn defc [{:keys [:node]}] | ||
(let [new-node (rewrite node)] | ||
{:node new-node})) | ||
|
||
(defn defcs [{:keys [:node]}] | ||
(let [new-node (rewrite node true)] | ||
{:node new-node})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
node_modules/ | ||
public/js | ||
|
||
/target | ||
/checkouts | ||
/src/gen | ||
|
||
dist | ||
|
||
pom.xml | ||
pom.xml.asc | ||
*.iml | ||
*.jar | ||
*.log | ||
.shadow-cljs | ||
.idea | ||
.lein-* | ||
.nrepl-* | ||
.DS_Store | ||
|
||
.hgignore | ||
.hg/ | ||
|
||
.clj-kondo/.cache | ||
.lsp | ||
.calva | ||
.cpcache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{:paths ["src/main" "src/gen"] | ||
|
||
:deps | ||
{rum/rum {:mvn/version "0.12.9"} | ||
org.clojure/clojure {:mvn/version "1.10.0"} | ||
org.clojure/clojurescript {:mvn/version "1.11.4"} | ||
org.clojure/tools.namespace {:mvn/version "0.2.11"} | ||
cljs-bean/cljs-bean {:mvn/version "1.8.0"}} | ||
|
||
:aliases | ||
{:shadow-cljs | ||
{:extra-deps {thheller/shadow-cljs {:mvn/version "2.18.0"} | ||
binaryage/devtools {:mvn/version "1.0.6"} | ||
cider/cider-nrepl {:mvn/version "0.28.3"}}}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"version": "0.0.0-dev", | ||
"name": "tldraw-logseq-demo", | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "shadow-cljs watch frontend" | ||
}, | ||
"devDependencies": { | ||
"node-libs-browser": "^2.2.1", | ||
"react": ">=16.8", | ||
"react-dom": "^16.8 || ^17.0", | ||
"shadow-cljs": "^2.18.0" | ||
}, | ||
"dependencies": { | ||
"tldraw-logseq": "*" | ||
} | ||
} |
Oops, something went wrong.