Commit Graph
43 Commits
Author SHA1 Message Date
Zef Hemel d9ff98e050 Enhance Lua function handling with promise support and update global object exposure
- Modified `luaCall` and `luaValueToJS` functions to handle promises, allowing asynchronous execution of JavaScript functions from Lua.
- Updated the `jsApi` to expose the global `globalThis` object instead of `window`, improving compatibility across different environments.
2025-03-31 17:44:55 +02:00
Zef Hemel bf8646d89d Biting the bullet: exposing the JS window object to Lua
- Added a convenience function for creating HTML widgets, streamlining widget creation.
- Enhanced the key retrieval logic in the pairs function to ensure it captures prototype keys correctly.
- Exposed the global window object in the jsApi for better access to DOM functions.
2025-03-31 15:51:02 +02:00
Zef Hemel be86e53398 Implement new slash commands and enhance editor functionality
- Added slash commands for inserting today's, yesterday's, and tomorrow's dates.
- Introduced new admonition commands for notes and warnings.
- Implemented a table command for quick table insertion.
- Enhanced the `insertAtCursor` function to support a cursor placeholder option.
- Updated `getSelection` to return the selected text along with cursor positions.
- Added a new widget function to display linked tasks in the editor.
2025-03-30 13:03:57 +02:00
Zef Hemel f4de6a4b85 Migrating core use of queryObjects to queryLuaObjects 2025-03-18 18:22:17 +01:00
Zef Hemel 98befe3a33 Lua widget event support 2025-03-14 10:36:41 +01:00
Zef Hemel f514ef1b53 Lua: support passing Lua function callbacks to native JS functions 2025-03-14 10:02:25 +01:00
Zef Hemel 549b73c37d Lua: optimize returns to no longer leverage exception throwing in the common case 2025-03-07 12:42:12 +01:00
Zef Hemel 105908204b Fixes #1253
More accurate type classification and eager evaluation of left "and" operand.
2025-02-22 21:28:00 +01:00
Zef Hemel 9d3b9a8a22 Reduce code duplication 2025-02-13 20:11:08 +01:00
Zef Hemel cf81594b02 Fixes #1236 2025-02-13 20:11:08 +01:00
Zef Hemel 654151437c Lua: Set string as metatable of string values, allowing for strVal:upper() style invocations 2025-02-09 11:06:15 +01:00
Zef Hemel 9317d143b3 Fixes #1231 2025-02-08 16:51:31 +01:00
Zef Hemel 3344845d1f Better tostring for Lua functions 2025-02-06 08:34:38 +01:00
Zef Hemel 71a414d1d4 Lua fix truthiness test 2025-01-26 08:59:44 +01:00
Zef Hemel b8835a07e2 Lua truthiness fixes 2025-01-26 08:07:10 +01:00
Zef Hemel 236b2a7fdd Lua: tweaks and fixes 2025-01-25 08:29:11 +01:00
Zef Hemel fce78a22f8 More Lua template work 2025-01-22 20:26:37 +01:00
Zef Hemel 41d5743673 Load .lua files with dofile 2025-01-19 16:23:08 +01:00
Zef Hemel ae20b81126 Don't hang on using luaToString on recursive data structures 2025-01-17 18:30:29 +01:00
Zef Hemel 55f5a465c8 Lua query fixes 2025-01-16 15:33:18 +01:00
Zef Hemel ce18078480 Better string handling 2025-01-16 12:34:55 +01:00
Zef Hemel bd05ac206b Remove dead code 2025-01-15 20:49:05 +01:00
Zef Hemel bc1bdea396 Lua: refactored and extracted test approach 2025-01-15 20:47:58 +01:00
Zef Hemel 5604f6d8c2 Lua: tweaks and docs 2025-01-14 20:26:47 +01:00
Zef Hemel bf6a34f82c Lua Integrated Query 2025-01-13 20:25:39 +01:00
Zef Hemel 15ad6f3129 Lua: language fixes, and new space_lua APIs 2025-01-09 18:22:12 +01:00
Zef Hemel c2fea2d25b Lua work 2025-01-08 17:09:09 +01:00
Zef Hemel ec6db8c766 Lua vararg testing 2025-01-08 11:04:33 +01:00
Zef Hemel c70f8fef1a Lua scope fixes 2025-01-08 10:00:46 +01:00
Zef Hemel 123309d791 Lua get and set now possibly async 2024-10-26 16:02:37 +02:00
Zef Hemel 8acb112e4e Lua stack frame refactor 2024-10-20 15:06:23 +02:00
Zef Hemel c1a20af981 Lua: widgets 2024-10-13 15:14:22 +02:00
Zef Hemel 64e398fd90 deno fmt 2024-10-11 15:34:27 +02:00
Zef Hemel 6a30284bab Migration to Deno 2.0 2024-10-10 12:52:28 +02:00
Zef Hemel 3319c7f21c More lua progress: JS Interop 2024-10-09 20:35:11 +02:00
Zef Hemel 899c2556cb Lua: more fixes and work on stdlib 2024-10-08 19:53:09 +02:00
Zef Hemel 1299d85e9a First simple Lua directive Live Preview 2024-10-05 15:37:36 +02:00
Zef Hemel 2c08cb1821 More lua features (some metatable support) and tests 2024-10-04 17:15:50 +02:00
Zef Hemel 3cf7b72ebb First integration of Lua into the core (via space-lua code blocks) 2024-10-03 17:55:51 +02:00
Zef Hemel c0a248daba deno fmt 2024-09-30 12:50:54 +02:00
Zef Hemel cdcce0d828 Lua work 2024-09-27 17:09:25 +02:00
Zef Hemel aa712ed8f4 More work on Lua 2024-09-27 09:11:06 +02:00
Zef Hemel 362b590ba3 Some more Lua progress 2024-09-24 10:15:22 +02:00