fix: update TextEditor references to use V13+ namespaced API
This commit is contained in:
parent
3284b132b4
commit
372a2f718c
4 changed files with 26 additions and 6 deletions
|
@ -19,7 +19,7 @@ export class DS4CharacterActorSheet extends DS4ActorSheet {
|
||||||
|
|
||||||
// Enrich biography HTML content
|
// Enrich biography HTML content
|
||||||
if (context.data.system.profile.biography) {
|
if (context.data.system.profile.biography) {
|
||||||
context.data.system.profile.biography = await TextEditor.enrichHTML(
|
context.data.system.profile.biography = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
|
||||||
context.data.system.profile.biography,
|
context.data.system.profile.biography,
|
||||||
{
|
{
|
||||||
async: true,
|
async: true,
|
||||||
|
|
|
@ -19,7 +19,7 @@ export class DS4CreatureActorSheet extends DS4ActorSheet {
|
||||||
|
|
||||||
// Enrich description HTML content
|
// Enrich description HTML content
|
||||||
if (context.data.system.baseInfo.description) {
|
if (context.data.system.baseInfo.description) {
|
||||||
context.data.system.baseInfo.description = await TextEditor.enrichHTML(
|
context.data.system.baseInfo.description = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
|
||||||
context.data.system.baseInfo.description,
|
context.data.system.baseInfo.description,
|
||||||
{
|
{
|
||||||
async: true,
|
async: true,
|
||||||
|
|
|
@ -97,9 +97,18 @@ export class DS4ItemSheet extends foundry.applications.sheets.ItemSheetV2 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Provide raw description content to editor (let editor handle enrichment)
|
// Enrich description content for display
|
||||||
// Don't pre-enrich the HTML as it interferes with editor activation
|
if (this.item.system.description) {
|
||||||
// The editor will handle enrichment internally
|
context.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
|
||||||
|
this.item.system.description,
|
||||||
|
{
|
||||||
|
secrets: this.item.isOwner,
|
||||||
|
relativeTo: this.item
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
context.enrichedDescription = "";
|
||||||
|
}
|
||||||
|
|
||||||
console.log("DS4ItemSheet: _prepareContext completed for item:", this.item.name);
|
console.log("DS4ItemSheet: _prepareContext completed for item:", this.item.name);
|
||||||
return context;
|
return context;
|
||||||
|
|
|
@ -5,5 +5,16 @@ SPDX-License-Identifier: MIT
|
||||||
--}}
|
--}}
|
||||||
|
|
||||||
<div class="ds4-sheet-tab tab description" data-group="primary" data-tab="description">
|
<div class="ds4-sheet-tab tab description" data-group="primary" data-tab="description">
|
||||||
<prose-mirror name="system.description" toggled="{{editable}}" value="{{data.system.description}}"></prose-mirror>
|
{{#if editable}}
|
||||||
|
<prose-mirror
|
||||||
|
name="system.description"
|
||||||
|
button="true"
|
||||||
|
editable="{{editable}}"
|
||||||
|
toggled="false"
|
||||||
|
value="{{data.system.description}}">
|
||||||
|
{{{enrichedDescription}}}
|
||||||
|
</prose-mirror>
|
||||||
|
{{else}}
|
||||||
|
{{{enrichedDescription}}}
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue