diff --git a/playwright.config.ts b/playwright.config.ts index 4928370..b3339ed 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -5,5 +5,6 @@ export default defineConfig({ command: "npm run build && npm run preview", port: 4173, }, + fullyParallel: true, testDir: "src/tests/e2e", }); diff --git a/src/lib/components/modals/CustomSourceModal.svelte b/src/lib/components/modals/CustomSourceModal.svelte index 855e1a6..b7efd73 100644 --- a/src/lib/components/modals/CustomSourceModal.svelte +++ b/src/lib/components/modals/CustomSourceModal.svelte @@ -402,7 +402,7 @@

Sprite

+ import { tooltip } from "$lib/tooltip"; + import IconShadow from "~icons/tabler/shadow"; + + interface Props { + /** DOM element of the label wrapper */ + labelElement: HTMLLabelElement | undefined; + /** hex color */ + hex: string | null; + /** input label */ + label: string; + /** input name, useful in a native form */ + name?: string | undefined; + /** directionality left to right, or right to left*/ + dir: "ltr" | "rtl"; + small?: boolean; + } + + let { + labelElement = $bindable(), + hex, + label, + name = undefined, + dir, + small, + }: Props = $props(); + + + diff --git a/src/lib/components/text/TextStyleButtons.svelte b/src/lib/components/text/TextStyleButtons.svelte index 8662730..b7c2793 100644 --- a/src/lib/components/text/TextStyleButtons.svelte +++ b/src/lib/components/text/TextStyleButtons.svelte @@ -1,5 +1,5 @@ -
-{#if editor.isActive("shadowColor")} - + +{#if !editor.isActive("shadowColor") || isColorPickerOpen} + { + if (isColorPickerOpen) { + c.hex && editor.chain().focus().setShadowColor(c.hex).run(); + } + }} + swatches={Object.values(colorMap).map((c) => c.value)} + components={{ input: ShadowColorButton }} /> {:else} {/if} - - c.value)} - label="" /> -
\ No newline at end of file diff --git a/src/lib/text/nbt/nbt_or_json.ts b/src/lib/text/nbt/export.ts similarity index 99% rename from src/lib/text/nbt/nbt_or_json.ts rename to src/lib/text/nbt/export.ts index c6de796..33cc321 100644 --- a/src/lib/text/nbt/nbt_or_json.ts +++ b/src/lib/text/nbt/export.ts @@ -67,7 +67,9 @@ export function addTypeSpecificValues( case "atlas_object": if (exportVersion.index >= 2) { current.object = "atlas"; - current.atlas = c.attrs?.atlas; + if(current.atlas) { + current.atlas = c.attrs?.atlas; + } current.sprite = c.attrs?.sprite; current.bold = undefined; diff --git a/src/lib/text/nbt/nbt.ts b/src/lib/text/nbt/import.ts similarity index 100% rename from src/lib/text/nbt/nbt.ts rename to src/lib/text/nbt/import.ts diff --git a/src/lib/text/nbt/optimiser.ts b/src/lib/text/nbt/optimiser.ts index 92337ed..f4e4529 100644 --- a/src/lib/text/nbt/optimiser.ts +++ b/src/lib/text/nbt/optimiser.ts @@ -232,12 +232,10 @@ function mergeTextComponents(output: StringyMCText[]) { // Find shared style/interactivity properties between consecutive objects if (typeof current === "object" && typeof next === "object") { const sharedProperties = getSharedStyleProps(current, next); - console.log("Shared Properties:", sharedProperties); if (Object.keys(sharedProperties).length > 0) { let group = [current]; collectAllFromIndex(i, group, output, sharedProperties); - console.log("Group Collected:", group); if (group.length < 1) { continue; diff --git a/src/lib/tiptap/extensions/index.ts b/src/lib/tiptap/extensions/index.ts index 74d2e2c..e87cb8d 100644 --- a/src/lib/tiptap/extensions/index.ts +++ b/src/lib/tiptap/extensions/index.ts @@ -44,7 +44,7 @@ export interface SelectorAttributes { } export interface AtlasObjectAttributes { - atlas: string; + atlas?: string; sprite: string; } diff --git a/src/lib/tiptap/extensions/nodes/AtlasObjectNode.ts b/src/lib/tiptap/extensions/nodes/AtlasObjectNode.ts index b5c16ae..8a93148 100644 --- a/src/lib/tiptap/extensions/nodes/AtlasObjectNode.ts +++ b/src/lib/tiptap/extensions/nodes/AtlasObjectNode.ts @@ -30,7 +30,10 @@ export const AtlasObjectNode = Node.create({ }, renderHTML({ HTMLAttributes, node }) { - const { atlas, sprite } = node.attrs; + let { atlas, sprite } = node.attrs; + if (!atlas) { + atlas = "minecraft:blocks" + } return [ "span", diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index d967355..d918636 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,5 +1,5 @@