TyphonJS

T

TyphonJS

Join the community to ask questions about TyphonJS and get answers from other members.

Join
Ggeoidesic7/10/2023

Update to ChatMessage outside of Svelte doesn't trigger reactivity on linked TJSDocument

I'm a bit confused about this... 1. When I render a ChatMessage via svelte, in the chat message svelte component I do: ```javascript let foundryChatMessageDocument = new TJSDocument(void 0, { delete: () => {} }),...
TMTyphonJS (Michael)7/10/2023

Release `TRL 0.1.0` - The journey to beta begins...

Greets @FVTT ▹ Developer, I am very excited to announce the release of TRL 0.1.0. This is a major release and begins the path toward a full "beta" launch. WARNING: This is a major breaking change release. Some of your cheese has been moved, but it is not gone. Now don't get too scared as this is not a change in the functional aspects of TRL, but a significant refinement to the API structure and locations of where various resources are located. This was necessary for API doc coherency and to move resources around in the library construction to aid future progress....
Ggeoidesic7/6/2023

How do I get the elementRoot of a ChatMessage?

SvelteApplication provides elementRoot prop to components that implement it, which is very useful. I'm looking to get something similar for my Svelte chat message templates. I'm using this in index.js ```javascript Hooks.on('renderChatMessage, (message, html) => {...
Cchimis7/5/2023

Getting started with the GUI and understanding element root

It's been a while, but I've been working on my Knowledge Recalled module since V11 is out, and my friend and I have made progress with getting and storing the data that we need. I'll be honest I'm struggling a little with Typhon for building my GUI. I'm not sure if I'm just lacking understanding of Svelte or what, but I think if I can get may data presented in the gui it'll be a lot easier for me to tinker around to figure out a little more of what is going on. If someone could maybe give me a suggestion or too. The approach I'm taking involves using my GMJournalAppShell as the place where I'm going to pull in all of the other svelte components. ``` <script>...
Ggeoidesic7/4/2023

Drag & Drop broke in v11

Ok so something that broke for me when moving to v11 is drag&drop from both the items tab of the sidebar and from compendiums isn't working. The code I have is: ```javascript export default class SvelteDocumentSheet extends SvelteApplication { async _onDropItem(event, data, actor) { console.log('_onDropItem');...
NDNekro Darkmoon6/28/2023

TJSDocument and Token Issues

```js const tokens = cardData.targets .map(t => [t, fromUuidSync(t)]) .filter(([_, t]) => t); const targets = new Map(...
TMTyphonJS (Michael)6/24/2023

SyrinControl & Svelte...

I gather there is a bit to discuss... 😄
TMTyphonJS (Michael)6/16/2023

Creating an interim TJSDocument / document attribute bridge

Hi @wasp... Just moving discussion here as it is a better forum post.
So I have made a system with TRL for my friend's homebrew game system, and I'm working on getting document updates to work. Binding values of inputs directly to the TJSDocument isn't yet supported, so this is what I cooked up thus far:
```js...
VVauxs6/13/2023

TJSGameSettings with not registered settings.

I am not sure what is happening in here. I have created an attachement to the existing Settings page. It works the first time I open it. However, when settings are saved, the window closes, and then subsequent opening of the settings causes these errors....
No description
Ggeoidesic6/8/2023

Storing a collection of Items in an Item?

Use cases would be: - containers could contain other Items - some items have prerequisites, which consist of other Items I'm trying to figure out the best way to represent that. It seems logical that adding Items to an item should be done via drag and drop from a compendium (or from the game items SideBar tab)....
Ggeoidesic5/26/2023

TJSDialog how to use buttons and callback or return value?

I'm planning to use TJSDialog to act as an intervening Application. So... player clicks a button that would normally generate a ChatMessage. However, a flag causes instead a dialog to appear with several options for the player. Once the decision is made between the options, that information needs to be used by the component that opened the dialog to allow the ChatMessage to be generated at that point. Option 1 I can see that TJSDialog has a mechanism for something along these lines, but I haven't been able to figure out how to use it - managedPromise - seems to be a private property of TJSDialog without a setter. ...
TMTyphonJS (Michael)5/25/2023

Release: `TRL 0.0.23` - "v11 hot patch"

Greets @FVTT ▹ Developer! I just released a hot patch of TRL for v11 support. The only thing changed is supporting the reactive embedded collections API of TJSDocument to take into account the changes of v11. This is not the next full update of TRL. It is just a hot patch. Everything else is the same as TRL 0.0.22 except for the v11 fix for embedded reactive collections. Outside of this one change there should be no other issues using TRL 0.0.23 on Foundry v10 & v11. Of general interest I recommend updating to the latest Vite: 4.3.8 as there are many improvements in the 4.3.x releases. Also, take note that if you update to a Svelte version 3.57.0 or greater there are new accessibility / a11y warnings depending on what you use in TRL / mainly the RTE editor components. I have already fixed that for TRL 0.0.24, but you will see new a11y warnings when building. This is not a problem and already fixed for the next official release....
TMTyphonJS (Michael)5/25/2023

v11 Debug embedded collection changes

Just a post to track the v11 changes to embedded collections and what needs to be updated in an interim TRL release to support this change.
Ggeoidesic5/8/2023

How can I create an embeddedCollection in a chat message?

I have this: ```javascript const messageDocument = game.messages.get(message._id); const doc = new TJSDocument(messageDocument); doc.embedded.create("Targets", targets);...
Ggeoidesic5/4/2023

Hooks in svelte component? (not really a typhon question but nowhere else to ask :)

In my foundry index.js I'm listening for hook:
Hooks.on('renderChatMessage', doSomething);
Hooks.on('renderChatMessage', doSomething);
However I want to also listen for that hook in a chat card svelte component (one that is already rendered to the Chat panel):...
RRyanWAnderson5/2/2023

Actor update error, TRL/Svelte Token interaction?

Ran into a bug I think, not sure if this is with Foundry or TRL. Related to the duplicate actor sheet issue Geoidesic ran into a few months back. Same issue, I'm getting duplicate character sheets when I try to run
actor.update()
actor.update()
. I traced the error back, looks like it's coming from
TokenDocument._onUpdateBaseActor()
TokenDocument._onUpdateBaseActor()
making a
this.actor.sheet.render(false)
this.actor.sheet.render(false)
call on line 565 in Foundry client/data/documents/token.js. I think this call to render is unnecessary for TRL and is causing SvelteApplication.js to throw a cannot read properties of null error on line 876 at
this.onSvelteMount({ element: this._element[0]...
this.onSvelteMount({ element: this._element[0]...
, _element[0] is undefined in this case. Looks like
TokenDocument._onUpdatedBaseActor()
TokenDocument._onUpdatedBaseActor()
isn't respecting the
{render: false}
{render: false}
context property, so passing render: false doesn't fix the issue. Not sure if that's intended behavior or not....
TMTyphonJS (Michael)4/30/2023

Debugging TJSMenu for Auto Animations on Level Up - 5e

Just a forum thread to discuss and explore an interesting phenomenon w/ TJSMenu not responding on the Level Up - 5e system. Both the module and system use TRL.
NDNekro Darkmoon4/19/2023

Z-index on TJSDialogs

For some reason TJSDialogs have an insane z-index value which makes them always appear on top of other dialogs. This leads to some dialogs opening up behind the TJSDialogs leading users to believe that a dialog hasn't been opened. Example dialog ```js export default class ActionConfigDialog extends TJSDialog {...
No description
TMTyphonJS (Michael)4/11/2023

Question: Modifying class list of SvelteApplication

A question from @dorako:
so, my module hooks into renderApplication and modifies the html[0].classList to add a .dorako-ui class to most Applications, but this strategy does not work for Svelte Applications. I had suspected this would be the case, but I'm not sure why or how to fix it.
Would I need to submit some sort of update to the SvelteApplication to push my dorako-ui class to the options.classes?...
SSolidor4/11/2023

Blur on moving elements

After a few months of being gone, this started showing up for me again. Not sure why. It seems that while an element is transitioning, it blurs, and sometimes doesn't unblur. Only happens when zoomed in larger than 100%. Only happens on Chromium browsers. Does not seem to consistently happen with the same elements from session to session....
No description