Skip to content

Commit a245d72

Browse files
committed
fix inconsistencies with object types
1 parent 9a481f3 commit a245d72

5 files changed

Lines changed: 34 additions & 13 deletions

File tree

src/app.css

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@
2121
}
2222

2323
/* Use MinecraftEnchantingBold if parent uses MinecraftEnchanting font */
24-
*[style*="font-family: MinecraftEnchanting"] strong,
25-
*[style*="font-family: 'MinecraftEnchanting'"] strong,
26-
*[style*='font-family: "MinecraftEnchanting"'] strong {
24+
*[style*="font-family: MinecraftEnchanting"] strong:not(:has([data-atlas-object-node],[data-player-object-node])),
25+
*[style*="font-family: 'MinecraftEnchanting'"] strong:not(:has([data-atlas-object-node],[data-player-object-node])),
26+
*[style*='font-family: "MinecraftEnchanting"'] strong:not(:has([data-atlas-object-node],[data-player-object-node])) {
2727
font-family: MinecraftEnchantingBold;
2828
font-weight: 100;
2929
}
3030

3131
/* Use MinecraftIllagerBold if parent uses MinecraftIllager font */
32-
*[style*="font-family: MinecraftIllager"] strong,
33-
*[style*="font-family: 'MinecraftIllager'"] strong,
34-
*[style*='font-family: "MinecraftIllager"'] strong {
32+
*[style*="font-family: MinecraftIllager"] strong:not(:has([data-atlas-object-node],[data-player-object-node])),
33+
*[style*="font-family: 'MinecraftIllager'"] strong:not(:has([data-atlas-object-node],[data-player-object-node])),
34+
*[style*='font-family: "MinecraftIllager"'] strong:not(:has([data-atlas-object-node],[data-player-object-node])) {
3535
font-family: MinecraftIllagerBold;
3636
font-weight: 100;
3737
}
3838

3939
/* Use MinecraftBold if not MinecraftEnchanting or MinecraftIllager */
40-
strong {
40+
strong:not(:has([data-atlas-object-node],[data-player-object-node])) {
4141
font-family: MinecraftBold;
4242
font-weight: 100;
4343
}
@@ -78,7 +78,7 @@ button {
7878
--custom-source-align: top;
7979
}
8080

81-
.obfuscated {
81+
.obfuscated:not(:has([data-atlas-object-node],[data-player-object-node])) {
8282
filter: blur(2px);
8383
}
8484

src/lib/components/modals/CustomSourceModal.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@
396396
<option value="player">Player Head</option>
397397
</select>
398398

399-
{#if customValues.object.object || customValues.object.object == "atlas"}
399+
{#if customValues.object.object == "atlas"}
400400
<p class="mt-2">Atlas</p>
401401
<Combobox
402402
items={defaultAtlases}

src/lib/text/nbt/export.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export function addTypeSpecificValues(
7373

7474
current.bold = undefined;
7575
current.italic = undefined;
76+
current.obfuscated = undefined;
7677
} else {
7778
current.text = "";
7879
}
@@ -87,6 +88,7 @@ export function addTypeSpecificValues(
8788

8889
current.bold = undefined;
8990
current.italic = undefined;
91+
current.obfuscated = undefined;
9092
} else {
9193
current.text = "";
9294
}

src/lib/tiptap/extensions/nodes/AtlasObjectNode.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
import { Node, mergeAttributes, type CommandProps } from "@tiptap/core";
2-
import type { NodeOptions, AtlasObjectAttributes } from "../index";
1+
import {
2+
ClickEventMark,
3+
FixedTextStyle,
4+
FontsExtension,
5+
HoverEventMark,
6+
Obfuscation,
7+
ShadowColorMark,
8+
} from "$lib/tiptap/extensions/index";
9+
import {
10+
Node,
11+
getSchema,
12+
mergeAttributes,
13+
type CommandProps,
14+
} from "@tiptap/core";
15+
import Color from "@tiptap/extension-color";
16+
import StarterKit from "@tiptap/starter-kit";
17+
import type { AtlasObjectAttributes, NodeOptions } from "../index";
318

419
export const AtlasObjectNode = Node.create<NodeOptions>({
520
name: "atlas_object",
@@ -38,7 +53,7 @@ export const AtlasObjectNode = Node.create<NodeOptions>({
3853
return [
3954
"span",
4055
mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
41-
"data-atlas-object-node": "true",
56+
"data-atlas-object-node": "",
4257
contenteditable: "false",
4358
style: `
4459
background-color: #18181b;
@@ -47,6 +62,8 @@ export const AtlasObjectNode = Node.create<NodeOptions>({
4762
font-size: 0.9rem;
4863
display: inline-block;
4964
vertical-align: var(--custom-source-align, middle);
65+
font-style: normal !important;
66+
font-weight: normal !important;
5067
text-decoration: inherit;
5168
`,
5269
}),

src/lib/tiptap/extensions/nodes/PlayerObjectNode.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const PlayerObjectNode = Node.create<NodeOptions>({
3737
return [
3838
"span",
3939
mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
40-
"data-player-object-node": "true",
40+
"data-player-object-node": "",
4141
contenteditable: "false",
4242
style: `
4343
background-color: #18181b;
@@ -46,6 +46,8 @@ export const PlayerObjectNode = Node.create<NodeOptions>({
4646
font-size: 0.9rem;
4747
display: inline-block;
4848
vertical-align: var(--custom-source-align, middle);
49+
font-style: normal !important;
50+
font-weight: normal !important;
4951
text-decoration: inherit;
5052
`,
5153
}),

0 commit comments

Comments
 (0)