pkg update and first config fix

org-brain not working, add org-roam
This commit is contained in:
2022-12-19 23:02:34 +01:00
parent 02b3e07185
commit 82f05baffe
885 changed files with 356098 additions and 36993 deletions
+11
View File
@@ -0,0 +1,11 @@
(define-package "org-roam-ui" "20221105.1040" "User Interface for Org-roam"
'((emacs "27.1")
(org-roam "2.0.0")
(simple-httpd "20191103.1446")
(websocket "1.13"))
:commit "5ac74960231db0bf7783c2ba7a19a60f582e91ab" :keywords
'("files" "outlines")
:url "https://github.com/org-roam/org-roam-ui")
;; Local Variables:
;; no-byte-compile: t
;; End:
+746
View File
@@ -0,0 +1,746 @@
;;; org-roam-ui.el --- User Interface for Org-roam -*- coding: utf-8; lexical-binding: t; -*-
;; Copyright © 2021 Kirill Rogovoy, Thomas F. K. Jorna
;; author: Kirill Rogovoy, Thomas Jorna
;; URL: https://github.com/org-roam/org-roam-ui
;; Keywords: files outlines
;; Version: 0.1
;; Package-Requires: ((emacs "27.1") (org-roam "2.0.0") (simple-httpd "20191103.1446") (websocket "1.13"))
;; This file is NOT part of GNU Emacs.
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Commentary:
;;
;; Org-roam-ui provides a web interface for navigating around notes created
;; within Org-roam.
;;
;;; Code:
;;;; Dependencies
(require 'json)
(require 'simple-httpd)
(require 'org-roam)
(require 'websocket)
(require 'org-roam-dailies)
(defgroup org-roam-ui nil
"UI in Org-roam."
:group 'org-roam
:prefix "org-roam-ui-"
:link '(url-link :tag "Github" "https://github.com/org-roam/org-roam-ui"))
(defvar org-roam-ui-root-dir
(concat (file-name-directory
(expand-file-name (or
load-file-name
buffer-file-name)))
".")
"Root directory of the org-roam-ui project.")
(defvar org-roam-ui-app-build-dir
(expand-file-name "./out/" org-roam-ui-root-dir)
"Directory containing org-roam-ui's web build.")
;; TODO: make into defcustom
(defvar org-roam-ui-port
35901
"Port to serve the org-roam-ui interface.")
(defcustom org-roam-ui-sync-theme t
"If true, sync your current Emacs theme with `org-roam-ui'.
Works best with doom-themes.
Ignored if a custom theme is provied for variable 'org-roam-ui-custom-theme'."
:group 'org-roam-ui
:type 'boolean)
(defcustom org-roam-ui-custom-theme nil
"Custom theme for `org-roam-ui'.
Blocks 'org-roam-ui-sync-theme from syncing your current theme,
instead sync this theme.
Provide a list of cons with the following values:
bg, bg-alt, fg, fg-alt, red, orange, yellow, green, cyan, blue, violet, magenta.
E.g. '((bg . \"#1E2029\")
\(bg-alt . \"#282a36\")
\(fg . \"#f8f8f2\")
\(fg-alt . \"#6272a\")
\(red . \"#ff5555\")
\(orange . \"#f1fa8c\")
\(yellow .\"#ffb86c\")
\(green . \"#50fa7b\")
\(cyan . \"#8be9fd\")
\(blue . \"#ff79c6\")
\(violet . \"#8be9fd\")
\(magenta . \"#bd93f9\"))."
:group 'org-roam-ui
:type 'list)
(defcustom org-roam-ui-follow t
"If true, `org-roam-ui' will follow you around in the graph."
:group 'org-roam-ui
:type 'boolean)
(defcustom org-roam-ui-update-on-save t
"If true, `org-roam-ui' will send new data when you save an `org-roam' buffer.
This can lead to some jank."
:group 'org-roam-ui
:type 'boolean)
(defcustom org-roam-ui-open-on-start t
"Whether to open your default browser when `org-roam-ui' launces."
:group 'org-roam-ui
:type 'boolean)
(defcustom org-roam-ui-find-ref-title t
"Should `org-roam-ui' use `org-roam-bibtex' to find a reference's title?"
:group 'org-roam-ui
:type 'boolean)
(defcustom org-roam-ui-retitle-ref-nodes t
"Should `org-roam-ui' use `org-roam-bibtex' try to retitle reference nodes?"
:group 'org-roam-ui
:type 'boolean)
(defcustom org-roam-ui-ref-title-template
"%^{author-abbrev} (%^{year}) %^{title}"
"A template for title creation, used for references without associated nodes.
This uses `orb--pre-expand-template' under the hood and therefore only org-style
capture `%^{...}' are supported."
:group 'org-roam-ui
:type 'string)
(defcustom org-roam-ui-browser-function #'browse-url
"When non-nil launch org-roam-ui with a different browser function.
Takes a function name, such as #'browse-url-chromium.
Defaults to #'browse-url."
:group 'org-roam-ui
:type 'function)
;;Hooks
(defcustom org-roam-ui-before-open-node-functions nil
"Functions to run before a node is opened through org-roam-ui.
Take ID as string as sole argument."
:group 'org-roam-ui
:type 'hook)
(defcustom org-roam-ui-after-open-node-functions nil
"Functions to run after a node is opened through org-roam-ui.
Take ID as string as sole argument."
:group 'org-roam-ui
:type 'hook)
(defcustom org-roam-ui-latex-macros nil
"Alist of LaTeX macros to be passed to org-roam-ui.
Format as, i.e. with double backslashes for a single backslash:
'((\"\\macro\".\"\\something{#1}\"))"
:group 'org-roam-ui
:type 'alist)
;; Internal vars
(defvar org-roam-ui--ws-current-node nil
"Var to keep track of which node you are looking at.")
(defvar org-roam-ui-ws-socket nil
"The websocket for org-roam-ui.")
(defvar org-roam-ui--window nil
"The window for displaying nodes opened from within ORUI.
This is mostly to prevent issues with EXWM and the Webkit browser.")
(defvar org-roam-ui-ws-server nil
"The websocket server for org-roam-ui.")
;;;###autoload
(define-minor-mode
org-roam-ui-mode
"Enable org-roam-ui.
This serves the web-build and API over HTTP."
:lighter " org-roam-ui"
:global t
:group 'org-roam-ui
:init-value nil
(cond
(org-roam-ui-mode
;;; check if the default keywords actually exist on `orb-preformat-keywords'
;;; else add them
(setq-local httpd-port org-roam-ui-port)
(setq httpd-root org-roam-ui-app-build-dir)
(httpd-start)
(setq org-roam-ui-ws-server
(websocket-server
35903
:host 'local
:on-open #'org-roam-ui--ws-on-open
:on-message #'org-roam-ui--ws-on-message
:on-close #'org-roam-ui--ws-on-close))
(when org-roam-ui-open-on-start (org-roam-ui-open)))
(t
(progn
(websocket-server-close org-roam-ui-ws-server)
(httpd-stop)
(remove-hook 'after-save-hook #'org-roam-ui--on-save)
(org-roam-ui-follow-mode -1)))))
(defun org-roam-ui--ws-on-open (ws)
"Open the websocket WS to org-roam-ui and send initial data."
(progn
(setq org-roam-ui-ws-socket ws)
(org-roam-ui--send-variables org-roam-ui-ws-socket)
(org-roam-ui--send-graphdata)
(when org-roam-ui-update-on-save
(add-hook 'after-save-hook #'org-roam-ui--on-save))
(message "Connection established with org-roam-ui")
(when org-roam-ui-follow
(org-roam-ui-follow-mode 1))))
(defun org-roam-ui--ws-on-message (_ws frame)
"Functions to run when the org-roam-ui server receives a message.
Takes _WS and FRAME as arguments."
(let* ((msg (json-parse-string
(websocket-frame-text frame) :object-type 'alist))
(command (alist-get 'command msg))
(data (alist-get 'data msg)))
(cond ((string= command "open")
(org-roam-ui--on-msg-open-node data))
((string= command "delete")
(org-roam-ui--on-msg-delete-node data))
((string= command "create")
(org-roam-ui--on-msg-create-node data))
(t
(message
"Something went wrong when receiving a message from org-roam-ui")))))
(defun org-roam-ui--on-msg-open-node (data)
"Open a node when receiving DATA from the websocket."
(let* ((id (alist-get 'id data))
(node (org-roam-node-from-id id))
(pos (org-roam-node-point node))
(buf (find-file-noselect (org-roam-node-file node))))
(run-hook-with-args 'org-roam-ui-before-open-node-functions id)
(unless (window-live-p org-roam-ui--window)
(if-let ((windows (window-list))
(or-windows (seq-filter
(lambda (window)
(org-roam-buffer-p
(window-buffer window))) windows))
(newest-window (car
(seq-sort-by
#'window-use-time #'> or-windows))))
(setq org-roam-ui--window newest-window)
(split-window-horizontally)
(setq org-roam-ui--window (frame-selected-window))))
(set-window-buffer org-roam-ui--window buf)
(select-window org-roam-ui--window)
(goto-char pos)
(run-hook-with-args 'org-roam-ui-after-open-node-functions id)))
(defun org-roam-ui--on-msg-delete-node (data)
"Delete a node when receiving DATA from the websocket.
TODO: Be able to delete individual nodes."
(progn
(message "Deleted %s" (alist-get 'file data))
(delete-file (alist-get 'file data))
(org-roam-db-sync)
(org-roam-ui--send-graphdata)))
(defun org-roam-ui--on-msg-create-node (data)
"Create a node when receiving DATA from the websocket."
(progn
(if (and (fboundp #'orb-edit-note) (alist-get 'ROAM_REFS data))
(orb-edit-note (alist-get 'id data)))
(org-roam-capture-
:node (org-roam-node-create :title (alist-get 'title data))
:props '(:finalize find-file))))
(defun org-roam-ui--ws-on-close (_websocket)
"What to do when _WEBSOCKET to org-roam-ui is closed."
(remove-hook 'after-save-hook #'org-roam-ui--on-save)
(org-roam-ui-follow-mode -1)
(message "Connection with org-roam-ui closed."))
(defun org-roam-ui--get-text (id)
"Retrieve the text from org-node ID."
(let*
((node (org-roam-populate (org-roam-node-create
:id id)))
(file (org-roam-node-file node)))
(org-roam-with-temp-buffer
file
(when (> (org-roam-node-level node) 0)
;; Heading nodes have level 1 and greater.
(goto-char (org-roam-node-point node))
(org-narrow-to-element))
(buffer-substring-no-properties (buffer-end -1) (buffer-end 1)))))
(defun org-roam-ui--send-text (id ws)
"Send the text from org-node ID through the websocket WS."
(let ((text (org-roam-ui--get-text id)))
(websocket-send-text ws
(json-encode
`((type . "orgText")
(data . ,text))))))
(defservlet* node/:id text/plain ()
"Servlet for accessing node content."
(insert (org-roam-ui--get-text (org-link-decode id)))
(httpd-send-header t "text/plain" 200 :Access-Control-Allow-Origin "*"))
(defservlet* img/:file text/plain ()
"Servlet for accessing images found in org-roam files."
(progn
(httpd-send-file t (org-link-decode file))
(httpd-send-header t "text/plain" 200 :Access-Control-Allow-Origin "*")))
(defun org-roam-ui--on-save ()
"Send graphdata on saving an org-roam buffer.
TODO: Make this only send the changes to the graph data, not the complete graph."
(when (org-roam-buffer-p)
(org-roam-ui--send-variables org-roam-ui-ws-socket)
(org-roam-ui--send-graphdata)))
(defun org-roam-ui--check-orb-keywords ()
"Check if the default keywords are in `orb-preformat-keywords', if not, add them."
(when (and org-roam-ui-retitle-ref-nodes (boundp 'orb-preformat-keywords))
(dolist (keyword '("author-abbrev" "year" "title"))
(unless (seq-contains-p orb-preformat-keywords keyword)
(setq orb-preformat-keywords
(append orb-preformat-keywords (list keyword)))))))
(defun org-roam-ui--find-ref-title (ref)
"Find the title of the bibtex entry keyed by `REF'.
Requires `org-roam-bibtex' and `bibtex-completion' (a dependency of `orb') to be
loaded. Returns `ref' if an entry could not be found."
(if (and org-roam-ui-find-ref-title
(fboundp 'bibtex-completion-get-entry)
(fboundp 'orb--pre-expand-template)
(boundp 'orb-preformat-keywords))
(if-let ((entry (bibtex-completion-get-entry ref))
(orb-preformat-keywords
(append orb-preformat-keywords
'("author-abbrev" "year" "title"))))
;; Create a fake capture template list, only the actual capture at 3
;; matters. Interpolate the bibtex entries, and extract the filled
;; template from the return value.
(nth 3 (orb--pre-expand-template
`("" "" plain ,org-roam-ui-ref-title-template) entry))
ref)
ref))
(defun org-roam-ui--replace-nth (el n lst)
"Non-destructively replace the `N'th element of `LST' with `EL'."
(let ((head (butlast lst (- (length lst) n)))
(tail (nthcdr (+ n 1) lst)))
(append head (list el) tail)))
(defun org-roam-ui--citekey-to-ref (citekey)
"Convert a CITEKEY property (most likely with a `cite:' prefix) to just a key.
This method is mostly taken from `org-roam-bibtex'
see https://github.com/org-roam/org-roam-bibtex/blob/919ec8d837a7a3bd25232bdba17a0208efaefb2a/orb-utils.el#L289
but is has been adapted to operate on a sting instead of a node. Requires
`org-ref' to be loaded. Returns the `key' or nil if the format does not match
the `org-ref-cite-re'"
(if-let ((boundp 'org-ref-cite-re)
(citekey-list (split-string-and-unquote citekey)))
(catch 'found
(dolist (c citekey-list)
(when (string-match org-ref-cite-re c)
(throw 'found (match-string 2 c)))))))
(defun org-roam-ui--retitle-node (node)
"Replace the title of citation NODE with associated notes.
A new title is created using information from the bibliography and formatted
according to `org-roam-ui-ref-title-template', just like the citation nodes with
a note are. It requires `org-roam-bibtex' and it's dependencies
\(`bibtex-completion' and `org-ref'\) to be loaded.
Returns the node with an updated title if the current node is a reference node
and the key was found in the bibliography, otherwise the node is returned
unchanged."
(if-let* (org-roam-ui-retitle-ref-nodes
;; set a fake var because if-let(((boundp 'fake-var))) returns true
(orcr (boundp 'org-ref-cite-re))
(citekey (cdr (assoc "ROAM_REFS" (nth 5 node))))
(ref (org-roam-ui--citekey-to-ref citekey))
(title (org-roam-ui--find-ref-title ref)))
(org-roam-ui--replace-nth title 2 node)
node))
(defun org-roam-ui--create-fake-node (ref)
"Create a fake node for REF without a source note."
(list
ref
ref
(org-roam-ui--find-ref-title ref)
0
0
'nil
`(("ROAM_REFS" . ,(format "cite:%s" ref))
("FILELESS" . t))
'nil))
(defun org-roam-ui--send-graphdata ()
"Get roam data, make JSON, send through websocket to org-roam-ui."
(let* ((nodes-names
[id
file
title
level
pos
olp
properties
tags])
(old (not (fboundp 'org-roam-db-map-citations)))
(links-db-rows (if old
(org-roam-ui--separate-ref-links
(org-roam-ui--get-links old))
(seq-concatenate
'list
(org-roam-ui--separate-ref-links
(org-roam-ui--get-cites))
(org-roam-ui--get-links))))
(links-with-empty-refs (org-roam-ui--filter-citations links-db-rows))
(empty-refs (delete-dups (seq-map
(lambda (link)
(nth 1 link))
links-with-empty-refs)))
(nodes-db-rows (org-roam-ui--get-nodes))
(fake-nodes (seq-map #'org-roam-ui--create-fake-node empty-refs))
;; Try to update real nodes that are reference with a title build
;; from their bibliography entry. Check configuration here for avoid
;; unneeded iteration though nodes.
(retitled-nodes-db-rows (if org-roam-ui-retitle-ref-nodes
(seq-map #'org-roam-ui--retitle-node
nodes-db-rows)
nodes-db-rows))
(complete-nodes-db-rows (append retitled-nodes-db-rows fake-nodes))
(response `((nodes . ,(mapcar
(apply-partially
#'org-roam-ui-sql-to-alist
(append nodes-names nil))
complete-nodes-db-rows))
(links . ,(mapcar
(apply-partially
#'org-roam-ui-sql-to-alist
'(source target type))
links-db-rows))
(tags . ,(seq-mapcat
#'seq-reverse
(org-roam-db-query
[:select :distinct tag :from tags]))))))
(when old
(message "[org-roam-ui] You are not using the latest version of org-roam.
This database model won't be supported in the future, please consider upgrading."))
(websocket-send-text org-roam-ui-ws-socket (json-encode
`((type . "graphdata")
(data . ,response))))))
(defun org-roam-ui--filter-citations (links)
"Filter out the citations from LINKS."
(seq-filter
(lambda (link)
(string-match-p "cite" (nth 2 link)))
links))
(defun org-roam-ui--get-nodes ()
"."
(org-roam-db-query [:select [id
file
title
level
pos
olp
properties
(funcall group-concat tag
(emacsql-escape-raw \, ))]
:as tags
:from nodes
:left-join tags
:on (= id node_id)
:group :by id]))
(defun org-roam-ui--get-links (&optional old)
"Get the cites and links tables as rows from the org-roam db.
Optionally set OLD to t to use the old db model (where the cites
were in the same table as the links)."
(if (not old)
(org-roam-db-query
`[:select [links:source
links:dest
links:type]
:from links
:where (= links:type "id")])
;; Left outer join on refs means any id link (or cite link without a
;; corresponding node) will have 'nil for the `refs:node-id' value. Any
;; cite link where a node has that `:ROAM_REFS:' will have a value.
(org-roam-db-query
`[:select [links:source
links:dest
links:type
refs:node-id]
:from links
:left :outer :join refs :on (= links:dest refs:ref)
:where (or
(= links:type "id")
(like links:type "%cite%"))])))
(defun org-roam-ui--get-cites ()
"Get the citations when using the new db-model."
(org-roam-db-query
`[:select [citations:node-id citations:cite-key refs:node-id]
:from citations
:left :outer :join refs :on (= citations:cite-key refs:ref)]))
(defun org-roam-ui--separate-ref-links (links &optional old)
"Create separate entries for LINKS with existing reference nodes.
Optionally set OLD to t to support old citations db-model.
Convert any cite links that have nodes with associated refs to an
id based link of type `ref' while removing the 'nil `refs:node-id'
from all other links."
(if (not old)
(seq-map
(lambda (link)
(pcase-let ((`(,source ,dest ,node-id) link))
(if node-id
(list source node-id "ref")
(list source dest "cite"))))
links)
(seq-map
(lambda (link)
(pcase-let ((`(,source ,dest ,type ,node-id) link))
(if node-id
(list source node-id "ref")
(list source dest type))))
links)))
(defun org-roam-ui--update-current-node ()
"Send the current node data to the web-socket."
(when (and (websocket-openp org-roam-ui-ws-socket)
(org-roam-buffer-p)
(buffer-file-name (buffer-base-buffer)))
(let* ((node (org-roam-id-at-point)))
(unless (string= org-roam-ui--ws-current-node node)
(setq org-roam-ui--ws-current-node node)
(websocket-send-text org-roam-ui-ws-socket
(json-encode `((type . "command")
(data . ((commandName . "follow")
(id . ,node))))))))))
(defun org-roam-ui--update-theme ()
"Send the current theme data to the websocket."
(let ((ui-theme (list nil)))
(if org-roam-ui-sync-theme
(if (boundp 'doom-themes--colors)
(let*
((colors (butlast doom-themes--colors
(- (length doom-themes--colors) 25)))
doom-theme)
(progn
(dolist (color colors)
(push
(cons (car color) (car (cdr color)))
doom-theme)))
(setq ui-theme doom-theme))
(setq ui-theme (org-roam-ui-get-theme)))
(when org-roam-ui-custom-theme
(setq ui-theme org-roam-ui-custom-theme)))
ui-theme))
(defun org-roam-ui--send-variables (ws)
"Send miscellaneous org-roam variables through the websocket WS."
(let ((daily-dir (if (boundp 'org-roam-dailies-directory)
(if (file-name-absolute-p org-roam-dailies-directory)
(expand-file-name org-roam-dailies-directory)
(expand-file-name
org-roam-dailies-directory
org-roam-directory))
"/dailies"))
(attach-dir (if (boundp 'org-attach-id-dir)
org-attach-id-dir
(expand-file-name ".attach/" org-directory)))
(use-inheritance (if (boundp 'org-attach-use-inheritance)
org-attach-use-inheritance
nil))
(sub-dirs (org-roam-ui-find-subdirectories)))
(websocket-send-text org-roam-ui-ws-socket
(json-encode
`((type . "variables")
(data .
(("subDirs".
,sub-dirs)
("dailyDir" .
,daily-dir)
("attachDir" .
,attach-dir)
("useInheritance" .
,use-inheritance)
("roamDir" . ,org-roam-directory)
("katexMacros" . ,org-roam-ui-latex-macros))))))))
(defun org-roam-ui-sql-to-alist (column-names rows)
"Convert sql result to alist for json encoding.
ROWS is the sql result, while COLUMN-NAMES is the columns to use."
(let (res)
(while rows
;; I don't know how to get the tags as a simple list, so we post process it
(if (not (string= (car column-names) "tags"))
(push (cons (pop column-names) (pop rows)) res)
(push (cons (pop column-names)
(seq-remove
(lambda (elt) (string= elt ","))
rows))
res)
(setq rows nil)))
res))
(defun org-roam-ui-get-theme ()
"Attempt to bring the current theme into a standardized format."
(list `(bg . ,(face-background hl-line-face))
`(bg-alt . ,(face-background 'default))
`(fg . ,(face-foreground 'default))
`(fg-alt . ,(face-foreground font-lock-comment-face))
`(red . ,(face-foreground 'error))
`(orange . ,(face-foreground 'warning))
`(yellow . ,(face-foreground font-lock-builtin-face))
`(green . ,(face-foreground 'success))
`(cyan . ,(face-foreground font-lock-constant-face))
`(blue . ,(face-foreground font-lock-keyword-face))
`(violet . ,(face-foreground font-lock-constant-face))
`(magenta . ,(face-foreground font-lock-preprocessor-face))))
(defun org-roam-ui-find-subdirectories ()
"Find all the subdirectories in the org-roam directory.
TODO: Exclude org-attach dirs."
(seq-filter
(lambda (file) (and (file-directory-p file) (org-roam-ui-allowed-directory-p file)))
(directory-files-recursively org-roam-directory
".*" t #'org-roam-ui-allowed-directory-p)))
(defun org-roam-ui-allowed-directory-p (dir)
"Check whether a DIR should be listed as a filterable dir.
Hides . directories."
(not (string-match-p "\\(\/\\|\\\\\\)\\..*?" dir)))
;;;; interactive commands
;;;###autoload
(defun org-roam-ui-open ()
"Ensure `org-roam-ui' is running, then open the `org-roam-ui' webpage."
(interactive)
(unless org-roam-ui-mode (org-roam-ui-mode))
(funcall org-roam-ui-browser-function
(format "http://localhost:%d" org-roam-ui-port)))
;;;###autoload
(defun org-roam-ui-node-zoom (&optional id speed padding)
"Move the view of the graph to current node.
or optionally a node of your choosing.
Optionally takes three arguments:
The ID of the node you want to travel to.
The SPEED in ms it takes to make the transition.
The PADDING around the nodes in the viewport."
(interactive)
(if-let ((node (or id (org-roam-id-at-point))))
(websocket-send-text org-roam-ui-ws-socket
(json-encode `((type . "command")
(data . ((commandName . "zoom")
(id . ,node)
(speed . ,speed)
(padding . ,padding))))))
(message "No node found.")))
;;;###autoload
(defun org-roam-ui-node-local (&optional id speed padding)
"Open the local graph view of the current node.
Optionally with ID (string), SPEED (number, ms) and PADDING (number, px)."
(interactive)
(if-let ((node (or id (org-roam-id-at-point))))
(websocket-send-text org-roam-ui-ws-socket
(json-encode `((type . "command")
(data . ((commandName . "local")
(id . ,node)
(speed . ,speed)
(padding . ,padding))))))
(message "No node found.")))
(defun org-roam-ui-change-local-graph (&optional id manipulation)
"Add or remove current node to the local graph. If not in local mode, open local-graph for this node."
(interactive)
(if-let ((node (or id (org-roam-id-at-point))))
(websocket-send-text org-roam-ui-ws-socket
(json-encode `((type . "command")
(data . ((commandName . "change-local-graph")
(id . ,node)
(manipulation . ,(or manipulation "add")))))))
(message "No node found.")))
;;;###autoload
(defun org-roam-ui-add-to-local-graph (&optional id)
"Add current node to the local graph. If not in local mode, open local-graph for this node."
(interactive)
(org-roam-ui-change-local-graph id "add"))
;;;###autoload
(defun org-roam-ui-remove-from-local-graph (&optional id)
"Remove current node from the local graph. If not in local mode, open local-graph for this node."
(interactive)
(org-roam-ui-change-local-graph id "remove"))
;;;###autoload
(defun org-roam-ui-sync-theme ()
"Sync your current Emacs theme with org-roam-ui."
(interactive)
(websocket-send-text org-roam-ui-ws-socket
(json-encode `((type . "theme")
(data . ,(org-roam-ui--update-theme))))))
;;; Obsolete commands
(define-obsolete-function-alias #'orui-open #'org-roam-ui-open "0.1")
(define-obsolete-function-alias #'orui-node-local #'org-roam-ui-node-local "0.1")
(define-obsolete-function-alias #'orui-node-zoom #'org-roam-ui-node-zoom "0.1")
(define-obsolete-function-alias #'orui-sync-theme #'org-roam-ui-sync-theme "0.1")
;;;###autoload
(define-minor-mode org-roam-ui-follow-mode
"Set whether ORUI should follow your every move in Emacs."
:lighter " org-roam-ui"
:global t
:group 'org-roam-ui
:init-value nil
(if org-roam-ui-follow-mode
(progn
(add-hook 'post-command-hook #'org-roam-ui--update-current-node)
(message "org-roam-ui will now follow you around."))
(remove-hook 'post-command-hook #'org-roam-ui--update-current-node)
(message "org-roam-ui will now leave you alone.")))
(provide 'org-roam-ui)
;;; org-roam-ui.el ends here
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
self.__BUILD_MANIFEST={__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":["static/chunks/fb7d5399-9c00dff9225b87a317ed.js","static/chunks/17007de1-7d8b9c17ee7cc8107af3.js","static/chunks/252f366e-54a484ebfe8fe95dfdbb.js","static/chunks/95b64a6e-860b8751a48619de0c76.js","static/chunks/0c428ae2-753f1ebbec24c403674c.js","static/chunks/1a48c3c1-648f6631a5e9a5f8e954.js","static/chunks/b5f2ed29-b8c45246e6f61610d91f.js","static/chunks/d25bd147-2c59edc357c0e2372258.js","static/css/bdf775d76e641698f02f.css","static/chunks/879-09bfd8a9d59d1f41b6f4.js","static/chunks/pages/index-f97770bc257e872f8c86.js"],"/_error":["static/chunks/pages/_error-ea939aab753d9e9db3bd.js"],sortedPages:["/","/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
@@ -0,0 +1 @@
self.__SSG_MANIFEST=new Set,self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB();
@@ -0,0 +1 @@
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[13],{63750:function(a,t,r){r.d(t,{iBV:function(){return h}});var n=r(44405);function h(a){return(0,n.w_)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M2 2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H2zm12-1a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h12z"}},{tag:"path",attr:{d:"M13 4a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V4z"}}]})(a)}}}]);
@@ -0,0 +1 @@
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[876],{14578:function(t,a,n){n.d(a,{O6Y:function(){return e},zOz:function(){return u}});var r=n(44405);function e(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M8 4c.367 0 .721.048 1.063.145a3.943 3.943 0 0 1 1.762 1.031 3.944 3.944 0 0 1 1.03 1.762c.097.34.145.695.145 1.062 0 .367-.048.721-.145 1.063a3.94 3.94 0 0 1-1.03 1.765 4.017 4.017 0 0 1-1.762 1.031C8.72 11.953 8.367 12 8 12s-.721-.047-1.063-.14a4.056 4.056 0 0 1-1.765-1.032A4.055 4.055 0 0 1 4.14 9.062 3.992 3.992 0 0 1 4 8c0-.367.047-.721.14-1.063a4.02 4.02 0 0 1 .407-.953A4.089 4.089 0 0 1 5.98 4.546a3.94 3.94 0 0 1 .957-.401A3.89 3.89 0 0 1 8 4z"}}]})(t)}function u(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm2.61-4a2.61 2.61 0 1 1-5.22 0 2.61 2.61 0 0 1 5.22 0zM8 5.246z"}}]})(t)}}}]);
@@ -0,0 +1 @@
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[874],{47516:function(t,n,r){r.d(n,{v9V:function(){return h},YSr:function(){return v},tr_:function(){return c},RXA:function(){return u},T41:function(){return z},DvO:function(){return i}});var a=r(44405);function h(t){return(0,a.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 7h16v2H4zm0-4h16v2H4zm0 8h16v2H4zm0 4h16v2H4zm2 4h12v2H6z"}}]})(t)}function v(t){return(0,a.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"}}]})(t)}function c(t){return(0,a.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"}}]})(t)}function u(t){return(0,a.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"}}]})(t)}function z(t){return(0,a.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 12c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}}]})(t)}function i(t){return(0,a.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19 3c-1.654 0-3 1.346-3 3 0 .502.136.968.354 1.385l-1.116 1.302A3.976 3.976 0 0 0 13 8c-.739 0-1.425.216-2.02.566L9.566 7.152A3.449 3.449 0 0 0 10 5.5C10 3.57 8.43 2 6.5 2S3 3.57 3 5.5 4.57 9 6.5 9c.601 0 1.158-.166 1.652-.434L9.566 9.98A3.972 3.972 0 0 0 9 12c0 .997.38 1.899.985 2.601l-1.692 1.692.025.025A2.962 2.962 0 0 0 7 16c-1.654 0-3 1.346-3 3s1.346 3 3 3 3-1.346 3-3c0-.476-.121-.919-.318-1.318l.025.025 1.954-1.954c.421.15.867.247 1.339.247 2.206 0 4-1.794 4-4a3.96 3.96 0 0 0-.439-1.785l1.253-1.462c.364.158.764.247 1.186.247 1.654 0 3-1.346 3-3s-1.346-3-3-3zM7 20a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM5 5.5C5 4.673 5.673 4 6.5 4S8 4.673 8 5.5 7.327 7 6.5 7 5 6.327 5 5.5zm8 8.5c-1.103 0-2-.897-2-2s.897-2 2-2 2 .897 2 2-.897 2-2 2zm6-7a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"}}]})(t)}}}]);
@@ -0,0 +1 @@
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[228],{5434:function(t,n,a){a.d(n,{egf:function(){return l},omV:function(){return r}});var h=a(44405);function l(t){return(0,h.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M4 9v2h16V9H4zm12-5l-1.41-1.41L13 4.17V1h-2v3.19L9.39 2.61 8 4l4 4 4-4zM4 14h16v-2H4v2zm4 5l1.39 1.39L11 18.81V22h2v-3.17l1.59 1.59L16 19l-4-4-4 4z"}}]})(t)}function r(t){return(0,h.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M4 20h16v2H4zM4 2h16v2H4zM9.41 13.59L8 15l4 4 4-4-1.41-1.41L13 15.17V8.83l1.59 1.58L16 9l-4-4-4 4 1.41 1.41L11 8.83v6.34z"}}]})(t)}}}]);
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[907],{99907:function(n,t,r){r.r(t),r.d(t,{forceCenter:function(){return i.Z},forceCollide:function(){return y},forceLink:function(){return h.Z},forceManyBody:function(){return Z.Z},forceRadial:function(){return g.Z},forceSimulation:function(){return s.Z},forceX:function(){return d},forceY:function(){return p},forceZ:function(){return x}});var i=r(54625),e=r(65574),f=r(29052),u=r(15145),o=r(12282),c=r(14286);function a(n){return n.x+n.vx}function l(n){return n.y+n.vy}function v(n){return n.z+n.vz}function y(n){var t,r,i,y,h=1,Z=1;function g(){for(var n,o,g,d,p,x,z,w,A=t.length,N=0;N<Z;++N)for(o=(1===r?(0,e.Z)(t,a):2===r?(0,f.Z)(t,a,l):3===r?(0,u.Z)(t,a,l,v):null).visitAfter(s),n=0;n<A;++n)g=t[n],z=i[g.index],w=z*z,d=g.x+g.vx,r>1&&(p=g.y+g.vy),r>2&&(x=g.z+g.vz),o.visit(k);function k(n,t,i,e,f,u,o){var a=[t,i,e,f,u,o],l=a[0],v=a[1],Z=a[2],s=a[r],A=a[r+1],N=a[r+2],k=n.data,C=n.r,M=z+C;if(!k)return l>d+M||s<d-M||r>1&&(v>p+M||A<p-M)||r>2&&(Z>x+M||N<x-M);if(k.index>g.index){var _=d-k.x-k.vx,b=r>1?p-k.y-k.vy:0,m=r>2?x-k.z-k.vz:0,E=_*_+b*b+m*m;E<M*M&&(0===_&&(E+=(_=(0,c.Z)(y))*_),r>1&&0===b&&(E+=(b=(0,c.Z)(y))*b),r>2&&0===m&&(E+=(m=(0,c.Z)(y))*m),E=(M-(E=Math.sqrt(E)))/E*h,g.vx+=(_*=E)*(M=(C*=C)/(w+C)),r>1&&(g.vy+=(b*=E)*M),r>2&&(g.vz+=(m*=E)*M),k.vx-=_*(M=1-M),r>1&&(k.vy-=b*M),r>2&&(k.vz-=m*M))}}}function s(n){if(n.data)return n.r=i[n.data.index];for(var t=n.r=0;t<Math.pow(2,r);++t)n[t]&&n[t].r>n.r&&(n.r=n[t].r)}function d(){if(t){var r,e,f=t.length;for(i=new Array(f),r=0;r<f;++r)e=t[r],i[e.index]=+n(e,r,t)}}return"function"!==typeof n&&(n=(0,o.Z)(null==n?1:+n)),g.initialize=function(n){t=n;for(var i=arguments.length,e=new Array(i>1?i-1:0),f=1;f<i;f++)e[f-1]=arguments[f];y=e.find((function(n){return"function"===typeof n}))||Math.random,r=e.find((function(n){return[1,2,3].includes(n)}))||2,d()},g.iterations=function(n){return arguments.length?(Z=+n,g):Z},g.strength=function(n){return arguments.length?(h=+n,g):h},g.radius=function(t){return arguments.length?(n="function"===typeof t?t:(0,o.Z)(+t),d(),g):n},g}var h=r(66252),Z=r(3286),g=r(77729),s=r(55061);function d(n){var t,r,i,e=(0,o.Z)(.1);function f(n){for(var e,f=0,u=t.length;f<u;++f)(e=t[f]).vx+=(i[f]-e.x)*r[f]*n}function u(){if(t){var f,u=t.length;for(r=new Array(u),i=new Array(u),f=0;f<u;++f)r[f]=isNaN(i[f]=+n(t[f],f,t))?0:+e(t[f],f,t)}}return"function"!==typeof n&&(n=(0,o.Z)(null==n?0:+n)),f.initialize=function(n){t=n,u()},f.strength=function(n){return arguments.length?(e="function"===typeof n?n:(0,o.Z)(+n),u(),f):e},f.x=function(t){return arguments.length?(n="function"===typeof t?t:(0,o.Z)(+t),u(),f):n},f}function p(n){var t,r,i,e=(0,o.Z)(.1);function f(n){for(var e,f=0,u=t.length;f<u;++f)(e=t[f]).vy+=(i[f]-e.y)*r[f]*n}function u(){if(t){var f,u=t.length;for(r=new Array(u),i=new Array(u),f=0;f<u;++f)r[f]=isNaN(i[f]=+n(t[f],f,t))?0:+e(t[f],f,t)}}return"function"!==typeof n&&(n=(0,o.Z)(null==n?0:+n)),f.initialize=function(n){t=n,u()},f.strength=function(n){return arguments.length?(e="function"===typeof n?n:(0,o.Z)(+n),u(),f):e},f.y=function(t){return arguments.length?(n="function"===typeof t?t:(0,o.Z)(+t),u(),f):n},f}function x(n){var t,r,i,e=(0,o.Z)(.1);function f(n){for(var e,f=0,u=t.length;f<u;++f)(e=t[f]).vz+=(i[f]-e.z)*r[f]*n}function u(){if(t){var f,u=t.length;for(r=new Array(u),i=new Array(u),f=0;f<u;++f)r[f]=isNaN(i[f]=+n(t[f],f,t))?0:+e(t[f],f,t)}}return"function"!==typeof n&&(n=(0,o.Z)(null==n?0:+n)),f.initialize=function(n){t=n,u()},f.strength=function(n){return arguments.length?(e="function"===typeof n?n:(0,o.Z)(+n),u(),f):e},f.z=function(t){return arguments.length?(n="function"===typeof t?t:(0,o.Z)(+t),u(),f):n},f}}}]);
@@ -0,0 +1 @@
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[866],{51649:function(c,t,h){h.d(t,{XQM:function(){return r},JfF:function(){return a}});var n=h(44405);function r(c){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M48 82.7v346.7c0 19.1 15.5 34.7 34.7 34.7h346.7c19.1 0 34.7-15.5 34.7-34.7V82.7c0-19.1-15.5-34.7-34.7-34.7H82.7C63.5 48 48 63.5 48 82.7zm89.3 297.1c-13.1 1.7-24.1-9.3-22.4-22.4 1.1-8.9 8.3-16.1 17.2-17.2 13.1-1.7 24.1 9.3 22.4 22.4-1.1 8.9-8.3 16.1-17.2 17.2zm0-104c-13.1 1.7-24.1-9.3-22.4-22.4 1.1-8.9 8.3-16.1 17.2-17.2 13.1-1.7 24.1 9.3 22.4 22.4-1.1 8.9-8.3 16.1-17.2 17.2zm0-104c-13.1 1.7-24.1-9.3-22.4-22.4 1.1-8.9 8.3-16.1 17.2-17.2 13.1-1.7 24.1 9.3 22.4 22.4-1.1 8.9-8.3 16.1-17.2 17.2zM384.7 374h-180c-7.7 0-14-6.3-14-14s6.3-14 14-14h180c7.7 0 14 6.3 14 14s-6.3 14-14 14zm0-104h-180c-7.7 0-14-6.3-14-14s6.3-14 14-14h180c7.7 0 14 6.3 14 14s-6.3 14-14 14zm0-104h-180c-7.7 0-14-6.3-14-14s6.3-14 14-14h180c7.7 0 14 6.3 14 14s-6.3 14-14 14z"}}]})(c)}function a(c){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M408 64H104c-22.091 0-40 17.908-40 40v304c0 22.092 17.909 40 40 40h304c22.092 0 40-17.908 40-40V104c0-22.092-17.908-40-40-40zM304 368H144v-48h160v48zm64-88H144v-48h224v48zm0-88H144v-48h224v48z"}}]})(c)}}}]);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[820],{14977:function(n,_,u){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_error",function(){return u(3359)}])}},function(n){n.O(0,[774,888,179],(function(){return _=14977,n(n.s=_);var _}));var _=n.O();_N_E=_}]);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
!function(){"use strict";var e={},n={};function t(r){var o=n[r];if(void 0!==o)return o.exports;var i=n[r]={id:r,loaded:!1,exports:{}},u=!0;try{e[r].call(i.exports,i,i.exports,t),u=!1}finally{u&&delete n[r]}return i.loaded=!0,i.exports}t.m=e,function(){var e=[];t.O=function(n,r,o,i){if(!r){var u=1/0;for(l=0;l<e.length;l++){r=e[l][0],o=e[l][1],i=e[l][2];for(var a=!0,c=0;c<r.length;c++)(!1&i||u>=i)&&Object.keys(t.O).every((function(e){return t.O[e](r[c])}))?r.splice(c--,1):(a=!1,i<u&&(u=i));if(a){e.splice(l--,1);var f=o();void 0!==f&&(n=f)}}return n}i=i||0;for(var l=e.length;l>0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[r,o,i]}}(),t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,{a:n}),n},t.d=function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.f={},t.e=function(e){return Promise.all(Object.keys(t.f).reduce((function(n,r){return t.f[r](e,n),n}),[]))},t.u=function(e){return"static/chunks/"+e+".06370254df2573a8d372.js"},t.miniCssF=function(e){return"static/css/"+{879:"bdf775d76e641698f02f",888:"a37ded5ec4cf14937ec5"}[e]+".css"},t.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},function(){var e={},n="_N_E:";t.l=function(r,o,i,u){if(e[r])e[r].push(o);else{var a,c;if(void 0!==i)for(var f=document.getElementsByTagName("script"),l=0;l<f.length;l++){var s=f[l];if(s.getAttribute("src")==r||s.getAttribute("data-webpack")==n+i){a=s;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,t.nc&&a.setAttribute("nonce",t.nc),a.setAttribute("data-webpack",n+i),a.src=r),e[r]=[o];var d=function(n,t){a.onerror=a.onload=null,clearTimeout(p);var o=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((function(e){return e(t)})),n)return n(t)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),c&&document.head.appendChild(a)}}}(),t.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},t.p="/_next/",function(){var e={272:0};t.f.j=function(n,r){var o=t.o(e,n)?e[n]:void 0;if(0!==o)if(o)r.push(o[2]);else if(272!=n){var i=new Promise((function(t,r){o=e[n]=[t,r]}));r.push(o[2]=i);var u=t.p+t.u(n),a=new Error;t.l(u,(function(r){if(t.o(e,n)&&(0!==(o=e[n])&&(e[n]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;a.message="Loading chunk "+n+" failed.\n("+i+": "+u+")",a.name="ChunkLoadError",a.type=i,a.request=u,o[1](a)}}),"chunk-"+n,n)}else e[n]=0},t.O.j=function(n){return 0===e[n]};var n=function(n,r){var o,i,u=r[0],a=r[1],c=r[2],f=0;if(u.some((function(n){return 0!==e[n]}))){for(o in a)t.o(a,o)&&(t.m[o]=a[o]);if(c)var l=c(t)}for(n&&n(r);f<u.length;f++)i=u[f],t.o(e,i)&&e[i]&&e[i][0](),e[u[f]]=0;return t.O(l)},r=self.webpackChunk_N_E=self.webpackChunk_N_E||[];r.forEach(n.bind(null,0)),r.push=n.bind(null,r.push.bind(r))}()}();
@@ -0,0 +1 @@
body,html{padding:0;margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;overflow:hidden}h1{font-weight:700}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

File diff suppressed because one or more lines are too long
+9
View File
@@ -0,0 +1,9 @@
{
"name": "Org Roam UI",
"short_name": "ORUI",
"display": "standalone",
"orientation": "portrait",
"theme_color": "#227a40",
"background_color": "#fff",
"start_url": "/"
}
+268
View File
@@ -0,0 +1,268 @@
if (!self.define) {
const e = (e) => {
'require' !== e && (e += '.js')
let s = Promise.resolve()
return (
n[e] ||
(s = new Promise(async (s) => {
if ('document' in self) {
const n = document.createElement('script')
;(n.src = e), document.head.appendChild(n), (n.onload = s)
} else importScripts(e), s()
})),
s.then(() => {
if (!n[e]) throw new Error(`Module ${e} didnt register its module`)
return n[e]
})
)
},
s = (s, n) => {
Promise.all(s.map(e)).then((e) => n(1 === e.length ? e[0] : e))
},
n = { require: Promise.resolve(s) }
self.define = (s, i, t) => {
n[s] ||
(n[s] = Promise.resolve().then(() => {
let n = {}
const r = { uri: location.origin + s.slice(1) }
return Promise.all(
i.map((s) => {
switch (s) {
case 'exports':
return n
case 'module':
return r
default:
return e(s)
}
}),
).then((e) => {
const s = t(...e)
return n.default || (n.default = s), n
})
}))
}
}
define('./sw.js', ['./workbox-ea903bce'], function (e) {
'use strict'
importScripts(),
self.skipWaiting(),
e.clientsClaim(),
e.precacheAndRoute(
[
{
url: '/_next/static/chunks/4.2dee5d830195ddd06029.js',
revision: 'iq9sQ07m6d_SiAb-0HX08',
},
{
url: '/_next/static/chunks/906-7b9696c9b17c64b94384.js',
revision: 'iq9sQ07m6d_SiAb-0HX08',
},
{
url: '/_next/static/chunks/d25bd147-65fcc4c92edba8b370fb.js',
revision: 'iq9sQ07m6d_SiAb-0HX08',
},
{
url: '/_next/static/chunks/fb7d5399-0d6001c72a29ebec41eb.js',
revision: 'iq9sQ07m6d_SiAb-0HX08',
},
{
url: '/_next/static/chunks/framework-2191d16384373197bc0a.js',
revision: 'iq9sQ07m6d_SiAb-0HX08',
},
{
url: '/_next/static/chunks/main-1b0f1fd287f08bad6012.js',
revision: 'iq9sQ07m6d_SiAb-0HX08',
},
{
url: '/_next/static/chunks/pages/_app-6ba3a11e93bdf6a85175.js',
revision: 'iq9sQ07m6d_SiAb-0HX08',
},
{
url: '/_next/static/chunks/pages/_error-a0e21b9b223f827fe1f2.js',
revision: 'iq9sQ07m6d_SiAb-0HX08',
},
{
url: '/_next/static/chunks/pages/index-5cea1a6a4f484642ff08.js',
revision: 'iq9sQ07m6d_SiAb-0HX08',
},
{
url: '/_next/static/chunks/polyfills-a54b4f32bdc1ef890ddd.js',
revision: 'iq9sQ07m6d_SiAb-0HX08',
},
{
url: '/_next/static/chunks/webpack-a1ea085630ce50807058.js',
revision: 'iq9sQ07m6d_SiAb-0HX08',
},
{ url: '/_next/static/css/331301db207a91d407e5.css', revision: 'iq9sQ07m6d_SiAb-0HX08' },
{
url: '/_next/static/iq9sQ07m6d_SiAb-0HX08/_buildManifest.js',
revision: 'iq9sQ07m6d_SiAb-0HX08',
},
{
url: '/_next/static/iq9sQ07m6d_SiAb-0HX08/_ssgManifest.js',
revision: 'iq9sQ07m6d_SiAb-0HX08',
},
{ url: '/favicon.ico', revision: 'c30c7d42707a47a3f4591831641e50dc' },
{ url: '/manifest.json', revision: '6fefee72ca361eb4dfafb128818c8424' },
{ url: '/vercel.svg', revision: '4b4f1876502eb6721764637fe5c41702' },
],
{ ignoreURLParametersMatching: [] },
),
e.cleanupOutdatedCaches(),
e.registerRoute(
'/',
new e.NetworkFirst({
cacheName: 'start-url',
plugins: [
{
cacheWillUpdate: async ({ request: e, response: s, event: n, state: i }) =>
s && 'opaqueredirect' === s.type
? new Response(s.body, { status: 200, statusText: 'OK', headers: s.headers })
: s,
},
],
}),
'GET',
),
e.registerRoute(
/^https:\/\/fonts\.(?:gstatic)\.com\/.*/i,
new e.CacheFirst({
cacheName: 'google-fonts-webfonts',
plugins: [
new e.ExpirationPlugin({ maxEntries: 4, maxAgeSeconds: 31536e3, purgeOnQuotaError: !0 }),
],
}),
'GET',
),
e.registerRoute(
/^https:\/\/fonts\.(?:googleapis)\.com\/.*/i,
new e.StaleWhileRevalidate({
cacheName: 'google-fonts-stylesheets',
plugins: [
new e.ExpirationPlugin({ maxEntries: 4, maxAgeSeconds: 604800, purgeOnQuotaError: !0 }),
],
}),
'GET',
),
e.registerRoute(
/\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,
new e.StaleWhileRevalidate({
cacheName: 'static-font-assets',
plugins: [
new e.ExpirationPlugin({ maxEntries: 4, maxAgeSeconds: 604800, purgeOnQuotaError: !0 }),
],
}),
'GET',
),
e.registerRoute(
/\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,
new e.StaleWhileRevalidate({
cacheName: 'static-image-assets',
plugins: [
new e.ExpirationPlugin({ maxEntries: 64, maxAgeSeconds: 86400, purgeOnQuotaError: !0 }),
],
}),
'GET',
),
e.registerRoute(
/\/_next\/image\?url=.+$/i,
new e.StaleWhileRevalidate({
cacheName: 'next-image',
plugins: [
new e.ExpirationPlugin({ maxEntries: 64, maxAgeSeconds: 86400, purgeOnQuotaError: !0 }),
],
}),
'GET',
),
e.registerRoute(
/\.(?:mp3|mp4)$/i,
new e.StaleWhileRevalidate({
cacheName: 'static-media-assets',
plugins: [
new e.ExpirationPlugin({ maxEntries: 32, maxAgeSeconds: 86400, purgeOnQuotaError: !0 }),
],
}),
'GET',
),
e.registerRoute(
/\.(?:js)$/i,
new e.StaleWhileRevalidate({
cacheName: 'static-js-assets',
plugins: [
new e.ExpirationPlugin({ maxEntries: 32, maxAgeSeconds: 86400, purgeOnQuotaError: !0 }),
],
}),
'GET',
),
e.registerRoute(
/\.(?:css|less)$/i,
new e.StaleWhileRevalidate({
cacheName: 'static-style-assets',
plugins: [
new e.ExpirationPlugin({ maxEntries: 32, maxAgeSeconds: 86400, purgeOnQuotaError: !0 }),
],
}),
'GET',
),
e.registerRoute(
/\/_next\/data\/.+\/.+\.json$/i,
new e.StaleWhileRevalidate({
cacheName: 'next-data',
plugins: [
new e.ExpirationPlugin({ maxEntries: 32, maxAgeSeconds: 86400, purgeOnQuotaError: !0 }),
],
}),
'GET',
),
e.registerRoute(
/\.(?:json|xml|csv)$/i,
new e.NetworkFirst({
cacheName: 'static-data-assets',
plugins: [
new e.ExpirationPlugin({ maxEntries: 32, maxAgeSeconds: 86400, purgeOnQuotaError: !0 }),
],
}),
'GET',
),
e.registerRoute(
({ url: e }) => {
if (!(self.origin === e.origin)) return !1
const s = e.pathname
return !s.startsWith('/api/auth/') && !!s.startsWith('/api/')
},
new e.NetworkFirst({
cacheName: 'apis',
networkTimeoutSeconds: 10,
plugins: [
new e.ExpirationPlugin({ maxEntries: 16, maxAgeSeconds: 86400, purgeOnQuotaError: !0 }),
],
}),
'GET',
),
e.registerRoute(
({ url: e }) => {
if (!(self.origin === e.origin)) return !1
return !e.pathname.startsWith('/api/')
},
new e.NetworkFirst({
cacheName: 'others',
networkTimeoutSeconds: 10,
plugins: [
new e.ExpirationPlugin({ maxEntries: 32, maxAgeSeconds: 86400, purgeOnQuotaError: !0 }),
],
}),
'GET',
),
e.registerRoute(
({ url: e }) => !(self.origin === e.origin),
new e.NetworkFirst({
cacheName: 'cross-origin',
networkTimeoutSeconds: 10,
plugins: [
new e.ExpirationPlugin({ maxEntries: 32, maxAgeSeconds: 3600, purgeOnQuotaError: !0 }),
],
}),
'GET',
)
})
+4
View File
@@ -0,0 +1,4 @@
<svg width="283" height="64" viewBox="0 0 283 64" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path d="M141.04 16c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.46 14.5c1.25-3.99 4.67-6.5 9.45-6.5 4.79 0 8.21 2.51 9.45 6.5h-18.9zM248.72 16c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.45 14.5c1.25-3.99 4.67-6.5 9.45-6.5 4.79 0 8.21 2.51 9.45 6.5h-18.9zM200.24 34c0 6 3.92 10 10 10 4.12 0 7.21-1.87 8.8-4.92l7.68 4.43c-3.18 5.3-9.14 8.49-16.48 8.49-11.05 0-19-7.2-19-18s7.96-18 19-18c7.34 0 13.29 3.19 16.48 8.49l-7.68 4.43c-1.59-3.05-4.68-4.92-8.8-4.92-6.07 0-10 4-10 10zm82.48-29v46h-9V5h9zM36.95 0L73.9 64H0L36.95 0zm92.38 5l-27.71 48L73.91 5H84.3l17.32 30 17.32-30h10.39zm58.91 12v9.69c-1-.29-2.06-.49-3.2-.49-5.81 0-10 4-10 10V51h-9V17h9v9.2c0-5.08 5.91-9.2 13.2-9.2z" fill="#000"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because it is too large Load Diff