Skip to content

Commit

Permalink
various bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
JerryI committed Feb 24, 2025
1 parent a536ebe commit 9ffcd9e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
1 change: 1 addition & 0 deletions Components/Notifications/Components/Custom.wlx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ CreateType[Notifications`Custom(*`*), init, {"Topic"->"Title", "Icon" -> With[{}

(*/* Might be an issue since this component it imported multiple times, could rewrite definitions */*)

Echo["Notifications >> Created custom notifications type"];

init[n_] := With[{dom = CreateUUID[]},
Echo["Created! Spinner"];
Expand Down
2 changes: 2 additions & 0 deletions Components/Notifications/Components/Spinner.wlx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ CreateType[Notifications`Spinner(*`*), init, {"Topic"->"Title", "Promise"->Null,

(*/* Might be an issue since this component it imported multiple times, could rewrite definitions */*)

Echo["Notifications >> Created spinner notifications type"];

init[n_] := With[{dom = CreateUUID[]},
Echo["Created! Spinner"];
n["DOM"] = dom;
Expand Down
8 changes: 4 additions & 4 deletions Components/Notifications/Notifications.wlx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ CreateType[NotificationsDialog, initDialog, {"Message"->"Dummy", "Event"->Null}]

ImportComponent["Components/Types.wl"];

MessageList = ImportComponent["Components/MessagesList.wlx"];
{SpinnerTemplate, SpinnerScript} = ImportComponent["Components/Spinner.wlx"];
CustomTemplate = ImportComponent["Components/Custom.wlx"];
{GenericTemplate, GenericScript} = ImportComponent["Components/Generic.wlx"];
MessageList = Once[ImportComponent["Components/MessagesList.wlx"]];
{SpinnerTemplate, SpinnerScript} = Once[ImportComponent["Components/Spinner.wlx"]];
CustomTemplate = Once[ImportComponent["Components/Custom.wlx"]];
{GenericTemplate, GenericScript} = Once[ImportComponent["Components/Generic.wlx"]];


Filter[_] = False
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ Export entire notebooks as standalone `.html` files, retaining all embedded data
### **Wolfram Engine**
[Download Wolfram Engine](https://www.wolfram.com/engine/) (Version 13.3+ recommended). Activation is required after installation.

#### Tested
- Wolfram Engine 13.1 (no copilot)
- Wolfram Engine 13.2 (no copilot)
- Wolfram Engine 13.3 (no copilot)
- Wolfram Engine 13.4 (no copilot)
- Wolfram Engine 14.0
- Wolfram Engine 14.1
- Wolfram Engine 14.2

**macOS Installation via Homebrew:**
```shell
brew install --cask wolfram-engine
Expand All @@ -121,10 +130,6 @@ brew install --cask wolfram-engine
### **WLJS Notebook App ✨**
Download from the **[releases](https://github.com/JerryI/wolfram-js-frontend/releases)** section.

#### Normal vs Offline Version
- The __offline version__ includes fixed versions of modules, documentation, and examples.
- The __normal version__ fetches the latest updates from GitHub upon installation.

#### CLI Installation
WLJS Notebook provides a CLI tool. You can open a folder in WLJS Notebook with:
```bash
Expand Down
9 changes: 5 additions & 4 deletions Views/Notebook/Components/Dropdown.wlx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Component[OptionsPattern[]] := With[{Color = (If[StringQ[#], #, "teal"]&) @ OptionValue["Parameters"]["AccentColor"], Event = OptionValue["Event"], ExtesionInjector = OptionValue["ExtesionInjector"]},
Component[OptionsPattern[]] := With[{Messager = OptionValue["Messager"], Color = (If[StringQ[#], #, "teal"]&) @ OptionValue["Parameters"]["AccentColor"], Event = OptionValue["Event"], ExtesionInjector = OptionValue["ExtesionInjector"]},
EventHandler[Event, {
"CallDropdown" -> ((Print["CallDropdown!"]; WebUISubmit[Global`UICellsDropdown[#], Global`$Client])&)
}];
Expand All @@ -18,7 +18,7 @@ Component[OptionsPattern[]] := With[{Color = (If[StringQ[#], #, "teal"]&) @ Opti
</svg>
Project to a window
</button>
<ExtesionInjector Template={"CellDropdown-Section-1"} Event={Event}/>
<ExtesionInjector Template={"CellDropdown-Section-1"} Messager={Messager} Event={Event}/>
</div>
,
<div class="py-0 px-2" role="none">
Expand All @@ -29,7 +29,7 @@ Component[OptionsPattern[]] := With[{Color = (If[StringQ[#], #, "teal"]&) @ Opti
</svg>
Make initialization cell
</button>
<ExtesionInjector Template={"CellDropdown-Section-2"} Event={Event}/>
<ExtesionInjector Template={"CellDropdown-Section-2"} Messager={Messager} Event={Event}/>
</div>
,
<div class="py-0 px-2" role="none">
Expand Down Expand Up @@ -99,6 +99,7 @@ Component[OptionsPattern[]] := With[{Color = (If[StringQ[#], #, "teal"]&) @ Opti

for (let i=0; i<buttons.length; i++) {
const el = buttons[i];
if (!el.dataset.name) continue;
el.addEventListener('click', () => {
server.emitt('<Event/>', '"'+currentCell+'"', el.dataset.name);
});
Expand Down Expand Up @@ -126,7 +127,7 @@ Component[OptionsPattern[]] := With[{Color = (If[StringQ[#], #, "teal"]&) @ Opti
]
];

Options[Component] = {"Event"->"", "Parameters"->Null, "ExtesionInjector"->( "" &)};
Options[Component] = {"Event"->"", "Messager"->"", "Parameters"->Null, "ExtesionInjector"->( "" &)};

Script = "";

Expand Down
6 changes: 2 additions & 4 deletions Views/Notebook/Notebook.wlx
Original file line number Diff line number Diff line change
Expand Up @@ -891,9 +891,7 @@ Component[OptionsPattern[]] := With[{

],

"Evaluate" -> Function[celluid, evaluateCell[cell`HashMap[celluid](*`*), notebook, secret, log, kernels, $Client, modals, parameters, extensions]],

else_ :> (Echo[StringTemplate["Unknown notebook view event ``: ``"][else, #]]&)
"Evaluate" -> Function[celluid, evaluateCell[cell`HashMap[celluid](*`*), notebook, secret, log, kernels, $Client, modals, parameters, extensions]]
}];

With[{nid = notebook["Hash"]},
Expand All @@ -907,7 +905,7 @@ Component[OptionsPattern[]] := With[{
</ExtensionTemplateWrapper>
<ExtensionTemplateInjection Template={"Notebook-Epilog"} Notebook={notebook} Event={secret} />

<CellDropdown Parameters={parameters} Event={secret} ExtesionInjector={ExtensionTemplateInjection}/>
<CellDropdown Parameters={parameters} Messager={log} Event={secret} ExtesionInjector={ExtensionTemplateInjection}/>
<ElectronBinds Event={secret} Controls={controller}/>

<ExtensionTemplateInjection Template={"Footer"} Modals={modals} Messager={log} Notebook={notebook} Event={secret} Controls={controller}/>
Expand Down

0 comments on commit 9ffcd9e

Please sign in to comment.