Commit Graph
51 Commits
Author SHA1 Message Date
MrMugameandGitHub 4cd12c8ae7 Set base inside of iframes (#1766)
* Set base inside of iframes

* Add `system.getURLPrefix` syscall
2026-01-09 15:30:34 +01:00
MrMugameandGitHub eb6b232444 Fix document editors on safari (#1710)
* Revert document editors to old model

Safari had issues with the previous "hacky" way

* Cleaup panel code
2025-11-28 14:40:05 +01:00
MrMugameandGitHub 00af994d69 Fix navigation for Autolinks and clean up code (#1607) 2025-10-10 08:42:25 +02:00
MrMugameandGitHub b343fe6baf Fix tag links in rendered markdown (#1565)
* Fix tag links in rendered markdown

* Remove unused import
2025-09-25 15:56:48 +02:00
MrMugameandGitHub 440cd8d144 Cleanup code around dark mode (#1542)
* Cleanup code around dark mode

* Fix lint
2025-09-15 08:59:49 +02:00
MrMugameandGitHub ad39158cd1 Separate plug name and file name (#1541)
* Separate plug name from file path

Plug name and plug path were very intertwined in the code. This could
cause problems, if the file path and plug name didn't align.
The plug manager also modified the plug path for some plugs, which could
be even more confusing.

* Code improvements for the plug manager

* Be more rigorous about failure

* Also allow `silverbullet-name` case again
2025-09-15 08:54:55 +02:00
MrMugameandGitHub 37024dd8ec Send Ref details to document editors (#1540) 2025-09-12 19:30:42 +02:00
MrMugameandGitHub 7460f26d7b Fix ![[]] not being indexed. (#1539)
We could also trigger on the `URL` type but this isn't quite as clear
and I'm unsure if that node type isn't used somewhere else
2025-09-12 16:05:26 +02:00
MrMugameandGitHub d4bd0dc982 Removes sandbox attributes from document editors (#1529)
This has two advantages
- I ran into a situation where I needed popus. I thought it was
reasonable to not allow specific stuff, but I think it's more annoying
than useful
- Removes the warning in the console
2025-09-10 17:14:37 +02:00
MrMugameandGitHub 4706be29e6 Update document editors (#1526)
* Remove old document editor skeleton

* Adjust image viewer to new api

* Add more documentation
2025-09-10 08:26:00 +02:00
MrMugameandGitHub 3aad24cc70 Fix the legacy support in editor.navigate (#1513) 2025-08-31 21:56:55 +02:00
MrMugameandGitHub fa8bfdeef7 Improve transclusions (#1505)
* Remove `documentUrlPrefix`

This seems to be a relic from the time SB used `fs/` as a file prefix on the server

* Move and rename files

* Factor out more code

* Make `expandMarkdown` and `renderMarkdownToHTML` handle transclusions properly

* Typo
2025-08-26 13:21:29 +02:00
MrMugameandGitHub 9faee069a9 Some fixes for #1496 (#1501)
* Fix navigate

When two navigations happen in quick succession (e.g. when using the index page navigation hack), one navigation could get stuck

* Fix headers with `from == 0`

Javascript things ahahah

* Fix `#boot` property for PWAs
2025-08-25 17:22:41 +02:00
aa0b95b31d The one about refs (#1496)
* [Major] Introduce a new `Ref` and `Path` type

This introduces a new `Ref` and `Path` type, which try to be as lightweight and rigorous as possible. More description in the PR

* [Minor] Updated Syntax

* [Minor] Updated Type

* [Minor] Renamed file

* [Minor] Updated type

* [Minor] Updated Syntax

* [Major] Rename css classes for wiki links

Previously all the parts of a wiki link were tagged with `sb-wiki-link-page`. This didn't make a whole lot of sense. Also the tag `sb-wiki-link` was could never render, because of the way `HighlightStyle` works. Now every part of a wiki link will be tagged with `sb-wiki-link` (i.e. the link, the alias, the dimensions). Invalid and missing links will be styled separately in a later commit.

* [Minor] Adjust to new API

* [Minor] Small changes

* [Minor] Function and file renames

* [Major] Syscall adjusments

Change behavior of `getCurrentPath` to actually return what's now considered a `Path`. `getCurrentPage(Meta)` now also correctly returns for documents. We could consider a rename to get rid of the `page` association

* [Major] Rework `Client`

Mostly minor adjustments for the new API. Some major changes in `navigateWithinPage` and some unecessary checks removed now

* [Major] Errors on navigate

This now throws an error when the user tries to navigate to a link that is invalid

* [Major] Minor adjustments and remove some old bulk

This does the typicall adjustments to the new API. A thing to consider is that invalid links aren't indexed. Also removed old code about template and query stuff. And reused a regex instead of copy pasting it.

* [Minor] Cleanup editor ui

* [Minor] Adjust to new API

* [Minor] Adjust to new API and reduce ugly regex

* [Minor] New API

* [Minor] Rework link cm plugin

* [Major] Rework wiki links

A lot of code cleanup, reworked for new APIs and also introduces "invalid links"

* [Minor] Part of the editor ui rework

* [Major] Adjust to new API

This also removes the `looksLikePathWithExtension` check. I don't think it was necessary.

* [Minor] PArt of editor ui rewrite

* [Minor] Adjust to new API

* [Major] Adjust renderer to new API

Invalid links now link to `#`

* [Major] Rewrite navigator

This still needs major rework, currently in a "got it working" state

* [Minor] Adjust file name

* [Minor] Mistake during rebase

* [Minor] Navigate to end of header

* [Minor] Remove `tweakEditorDOM` and use proper CM extensions

* [Major] Heavily clean up the navigation code

* [Minor] Make `PageNavigator` closable again

* [Minor] Small fixes to reduce errors bubbling up

* [Minor] Show error message if navigate fails

* [Major] Remove legacy `navigate({ kind = ` syntax

This removes the old navigation syntax. It's still supported but the user will be warned then using it. I also added some validation to editor.navigate for user provided refs.

* [Minor] Make notifications errors

* [Minor] Don't fail if header isn't found

* [Minor] Typo

* [Major] Remove cleanPageRef

* [Minor] Small bug

* [Minor] Align behavior between render and editor

* [Major] Remove `PageRef`. Pretty sure it's obsolete

* [Major] Remove pos from header as it's an invalid ref

* [Minor] Align with original behavior

* [Minor] Get tests working again

* [Minor] check that indexPage is valid

* [Major] Rewrite `resolve.ts` file

* [Minor] More tests, more fixes

* [Minor] Don't just append .md this is weird

* [Minor] More edge cases

* [Minor] Version bumping hono somehow fixes the `/` case

* [Minor] Smaller TODOs

* [Major] We can be a littler looser on the restrictions

* [Major] Change header indexing, to index with pos

* [Minor] More fixes for headers

* [Minor] Rename for clarity

* [Minor] Change more regexes to named groups

* [Major] Inline content rewrite

* [Minor] Fix TODO

* [Minor] Bump index version

* [Major] New Space Primitive to check paths

* [Minor] Fix #1214

* [Minor] Fix #1169

* [Minor] Remove TODO

This check is probably not needed anymore. Unsure. May look into it later

* [Minor] small bug

* [Minor] Not a good rebase without me needing to fix it afterwards

* [Minor] Improve fallback for file upload

* [Minor] Some fixes on the for resolving

* [Minor] Removed doubled test case

* [Minor] Resolve #860

* [Minor] Turn flash notification into an error

* [Minor] Change handling of `.` paths

* [Minor] Show empty URL for index page

* [Minor] Push correct ref to history

* [Major] Capture mini editor events in capture phase

This fixes the issue were when pressing arrowup or arrowdown changed the cursor position inside the editor

* [Major] Add prefix to `FilterList`

This now fixes issues were if you had a prefixed page you  con't properly search for it, because the search considered the prefix as part of the name

* [Minor] A little rigor for empty headers

* [Major] Fix #1404

* [Minor] `parseInt` returns `NaN` handle that

* [Minor] Use `fileName`

* [Minor] Fix comment

* [Minor] Fixes

* [Major] disallow `foo.png.md` and `/../`, etc. cases

* [Major] Change name of conflicted pages

* [Minor] Remove unecessary check

* [Minor] Remove some split code

* [Minor] Allow deletion of invalid files

* [Minor] Bug in the regex

* [Minor] Give some possibility of fixing incorrect names

* [Minor] Tiny bug with header completion

* [Major] Docs

* [Minor] Ignore errors for navigation inside of a page

This could be a problem when SB e.g. cached a scrollTop for a page, which, because e.g. the file is now deleted, doesn't exist anymore and thus CM throws an error, when trying to navigate

* Update conflicted copy regex in Maintenance.md

---------

Co-authored-by: Zef Hemel <zef@zef.me>
2025-08-24 16:16:19 +02:00
MrMugameandGitHub 6530a9a063 Make read only more robust (#1492) 2025-08-18 07:16:18 +02:00
MrMugameandGitHub 9b3ca93bbf Filter nullish values from dispatch (#1486) 2025-08-03 13:58:46 +02:00
MrMugameandGitHub 3518873c9e Allow multiple panel widgets (#1476)
* Return event results in order

* Remove a dispatch

* Allow multiple top and bottom widgets

* Add top instead of bottom margin for bottom widget

* Allow refreshing of widgets

* Revert "Remove a dispatch"

This reverts commit 88cc33ad57f2f664cdb597e2c7f7ec35816810fc.

* Copy whole selection as described in #1476
2025-08-02 14:15:28 +02:00
MrMugameandGitHub fe40041dc7 Fix inlined content (#1475) 2025-08-01 23:25:01 +02:00
MrMugameandGitHub be2b6bf09e Add a copy button (#1466)
* Add copy button to widgets

* Clean up codeWidget code

* Be more rigorous about choosing html
2025-07-26 20:43:01 +02:00
MrMugameandGitHub fd4408dad4 Parse wiki links more freely (#1472) 2025-07-26 20:41:28 +02:00
MrMugameandGitHub f8ce8d08a6 Only scrollIntoView when selection changes (#1470) 2025-07-26 20:38:52 +02:00
MrMugameandGitHub 6823e9c451 Add __call (#1471)
* Add support for `__call` method

* Add small test for `__call` method

* Remove unecessary error
2025-07-26 20:37:32 +02:00
MrMugameandGitHub 98cff15235 Make stripIndent an option for template.new (#1473) 2025-07-26 20:34:32 +02:00
MrMugameandGitHub 0e2906e8f7 Increase contrast for Filterlist descriptions (#1457) 2025-07-22 22:08:45 +02:00
MrMugameandGitHub 6a7a9ebc85 Adds missing doc for syscalls (#1452)
* Add missing syscall documentation

* Add missing space lua documentation
2025-07-09 10:37:34 +02:00
MrMugameandGitHub f338556acd Merge pull request #1437
* Remove unnecessary styles

* Be more rigorous about panels
2025-06-21 18:00:42 +02:00
MrMugameandZef Hemel d3e79ea4a7 Catch event in capturing phase instead of bubbling phase (#1315)
This is should be the default behaviour as silverbullet keybinds should always have priority over keybinds implemented by document editors
2025-03-26 19:43:00 +01:00
MrMugameandGitHub f3b0c358fd Don't spread page meta in navigator (#1301)
This fixes a bug where page attributes could overwrite internal
variables leading to unwanted behaviour
2025-03-20 09:11:23 +01:00
MrMugameandGitHub d3cc3e0d48 Add image viewer (#1289)
* Fix legacy support for navigation

* Fixes timing issue with document editors

If silverbullet was directly loaded into a document editor it would set
the darkmode after loading the editor, causing a wrong value to be
passed

* Add basic `image-viewer`

This add adds a basic image viewer using the panzoom library from Timmy
Willison

* Svgs somehow don't accept 100% width

* Make `internal` a property of a message

* Add `editor.sendMessage` syscall

* Update forgotten internal syscall

* Add small info command to image-viewer

* Change indent to two spaces

* Move zoom in button to the right

* Switch rotation direction

* Display mime type instead of file extension
2025-03-14 09:42:23 +01:00
MrMugameandGitHub 51b0fcd819 Combine reload functions in client (#1283) 2025-03-08 17:17:29 +01:00
MrMugameandGitHub 81d3732dd2 Update currentPath on file change (#1282) 2025-03-07 20:31:42 +01:00
MrMugameandGitHub e61a447d98 Implementing #913 (#1230)
Implemented custom editors
2025-03-06 15:11:17 +01:00
MrMugameandGitHub a6af94b9e3 Remove editor.setText syscall from client (#1263) 2025-02-25 20:02:59 +01:00
MrMugameandGitHub 606077b98a Uses the correct function map for index navigation (#1257) 2025-02-22 12:19:03 +01:00
MrMugameandGitHub f553c62950 Fix spell checking for code blocks and inline code (#1244) 2025-02-22 12:06:01 +01:00
MrMugameandGitHub f7cfe328b8 Fixes #1101 (#1102)
* Make all keywords use @specialize

* Rebuild the grammar

* Making it work in the later parsers
2024-09-29 13:26:44 +02:00
MrMugameandGitHub c412bed98e Add drawSelection() (#917) 2024-07-04 07:05:58 +02:00
MrMugameandGitHub 5c28b1a73f Change selection behaviour (#904)
* Change selection behaviour
* turn mouseup/mousedown events into click
* Remove `drawSelection()`
* Add custom cursor
2024-07-03 19:13:54 +02:00
MrMugameandGitHub 9ed493aa00 Makes the behaviour of logic expressions consistent in all cases (#898)
* Returned the value of a logic expression in all cases

* Remove legacy call syntax

* Correct test

* Remove old call syntax from docs/library

* Corrected docs for call syntax

* Add null coalescing operator
2024-07-02 19:12:40 +02:00
MrMugameandGitHub 1ea652a730 Hides the '\' from escaped characters (#901) 2024-06-26 15:55:56 +02:00
MrMugameandGitHub 513b9ef441 Recreate file list on every call of pageExists() (#900) 2024-06-24 06:21:57 +02:00
MrMugameandGitHub 7cb4ceb5d6 Fix double imports (#899) 2024-06-23 20:42:09 +02:00
MrMugameandGitHub 2a2cdef0f4 Added automatic quote insertion (#897) 2024-06-23 05:33:16 +02:00
MrMugameandGitHub b6d95ec632 Redirect to initial url after authentication (#893) 2024-06-22 12:45:23 +02:00
MrMugameandGitHub 0e2553839c Strip Markdown in TOC (#887) 2024-06-12 20:05:29 +02:00
MrMugameandGitHub 892849c30b Fixes the white flash for widget iframes & Make use of panel api (#882)
* Fix widget iframes flashing when loading

* Set the data-theme attribute for all panels
2024-06-08 13:32:35 +02:00
MrMugameandGitHub 442133ea2b Add subscript and superscript (#879)
* Added superscript and subscript to markdown

* Added docs for Superscript and subscript

* Remove leftover brace
2024-06-07 08:21:16 +02:00
MrMugameandGitHub 8524c0f96f Fix for flashing markdown preview (#880) 2024-06-07 08:19:26 +02:00
MrMugameandGitHub 99aaae23f1 Added erlang support (#878) 2024-06-05 12:23:12 +02:00
MrMugameandGitHub 63e3821646 Fixed greedy parsing of settings block (#876) 2024-06-04 20:27:10 +02:00
MrMugameandGitHub f683a4570a Fixed panel border (#863) 2024-05-14 09:22:52 +02:00