diff --git a/src/components/editor/TokenEditor.svelte b/src/components/editor/TokenEditor.svelte index 6b7acecd1..ed35dc51d 100644 --- a/src/components/editor/TokenEditor.svelte +++ b/src/components/editor/TokenEditor.svelte @@ -22,7 +22,7 @@ text = $bindable(), placeholder, validator, - creator + creator, }: Props = $props(); let view: HTMLInputElement | undefined = $state(undefined); @@ -114,7 +114,7 @@ {project.shares.output.Aura.names.getSymbolicName()} -
+
diff --git a/src/components/palette/BindColor.svelte b/src/components/palette/BindColor.svelte index cdbe28c28..204cd0ef5 100644 --- a/src/components/palette/BindColor.svelte +++ b/src/components/palette/BindColor.svelte @@ -15,9 +15,10 @@ property: OutputProperty; values: OutputPropertyValueSet; editable: boolean; + id?: string | undefined; } - let { property, values, editable }: Props = $props(); + let { property, values, editable, id = undefined }: Props = $props(); let project = getProject(); let selection = getSelectedOutput(); @@ -96,4 +97,11 @@ ); - + diff --git a/src/components/palette/BindOptions.svelte b/src/components/palette/BindOptions.svelte index 12164306d..48e632bc1 100644 --- a/src/components/palette/BindOptions.svelte +++ b/src/components/palette/BindOptions.svelte @@ -11,13 +11,15 @@ values: OutputPropertyValues; options: OutputPropertyOptions; editable: boolean; + id?: string | undefined; } let { property, values, options, - editable + editable, + id = undefined, }: Props = $props(); let project = getProject(); @@ -37,7 +39,7 @@ diff --git a/src/components/palette/BindText.svelte b/src/components/palette/BindText.svelte index 35ae33981..cf346da9b 100644 --- a/src/components/palette/BindText.svelte +++ b/src/components/palette/BindText.svelte @@ -22,13 +22,15 @@ values: OutputPropertyValues; validator: (text: string) => boolean; editable: boolean; + id?: string | undefined; } let { property, values, validator, - editable + editable, + id = undefined, }: Props = $props(); let project = getProject(); @@ -80,6 +82,7 @@ changed={handleChange} bind:view {editable} + {id} /> {isMarkup ? FORMATTED_SYMBOL diff --git a/src/components/palette/ContentEditor.svelte b/src/components/palette/ContentEditor.svelte index 3d477ad8b..243216518 100644 --- a/src/components/palette/ContentEditor.svelte +++ b/src/components/palette/ContentEditor.svelte @@ -14,9 +14,10 @@ project: Project; list: ListLiteral | undefined; editable: boolean; + id?: string | undefined; } - let { project, list, editable }: Props = $props(); + let { project, list, editable, id = undefined }: Props = $props(); const selection = getSelectedOutput(); @@ -50,7 +51,7 @@ } -
+
{#if list && valid} {#each list.values as content, index}
diff --git a/src/components/palette/MotionEditor.svelte b/src/components/palette/MotionEditor.svelte index c41130ba3..a0dc9f8f4 100644 --- a/src/components/palette/MotionEditor.svelte +++ b/src/components/palette/MotionEditor.svelte @@ -8,21 +8,26 @@ project: Project; motion: Evaluate; editable: boolean; + id?: string | undefined; } - let { project, motion, editable }: Props = $props(); + let { project, motion, editable, id = undefined }: Props = $props(); - let place = $derived(motion.getInput( - project.shares.input.Motion.inputs[0], - project.getNodeContext(motion) - )); - let velocity = $derived(motion.getInput( - project.shares.input.Motion.inputs[1], - project.getNodeContext(motion) - )); + let place = $derived( + motion.getInput( + project.shares.input.Motion.inputs[0], + project.getNodeContext(motion), + ), + ); + let velocity = $derived( + motion.getInput( + project.shares.input.Motion.inputs[1], + project.getNodeContext(motion), + ), + ); -
+
{project.shares.input.Motion.names.getPreferredNameString([], true)} {#if place instanceof Evaluate}
{/if} - {#if editable} @@ -81,11 +82,13 @@ {/snippet} {#snippet control()} {#if values.areMixed()} - {$locales.get((l) => l.ui.palette.labels.mixed)} + {$locales.get((l) => l.ui.palette.labels.mixed)} {:else if !values.areSet()} {@const expression = values.getExpression()} - {#if property.inherited}{$locales.get( (l) => l.ui.palette.labels.inherited, )}{:else if values.areDefault() && expression !== undefined} {:else if !values.areEditable(project)} - {$locales.get((l) => l.ui.palette.labels.computed)} + {$locales.get((l) => l.ui.palette.labels.computed)} {:else if property.type instanceof OutputPropertyRange} - + {:else if property.type instanceof OutputPropertyOptions} {:else if property.type instanceof OutputPropertyText} {:else if property.type === 'color'} - + {:else if property.type === 'bool'} - + {:else if property.type === 'pose'} {@const expression = values.getExpression()} {#if expression instanceof Evaluate && expression.is(project.shares.output.Pose, project.getNodeContext(expression))} {:else if expression instanceof Evaluate && expression.is(project.shares.output.Sequence, project.getNodeContext(expression))} {:else if property.type == 'poses'} - + {:else if property.type === 'content'} - + {:else if property.type === 'place'} {@const place = values.getEvaluationOf( project, @@ -153,11 +178,22 @@ project.shares.input.Placement, )} {#if place} - + {:else if motion} - + {:else if placement} - + {/if} {/if} {/snippet} diff --git a/src/components/palette/PlaceEditor.svelte b/src/components/palette/PlaceEditor.svelte index 4a6a5b403..17628ab87 100644 --- a/src/components/palette/PlaceEditor.svelte +++ b/src/components/palette/PlaceEditor.svelte @@ -20,13 +20,15 @@ place: Evaluate; editable: boolean; convertable: boolean; + id?: string | undefined; } let { project, place, editable, - convertable + convertable, + id = undefined, }: Props = $props(); let views: HTMLInputElement[] = $state([]); @@ -82,7 +84,7 @@ {project.shares.output.Place.names.getSymbolicName()} -
+
{#each project.shares.output.Place.inputs as dimension, index} {@const given = place?.getInput( dimension, diff --git a/src/components/palette/PlacementEditor.svelte b/src/components/palette/PlacementEditor.svelte index ab1f89691..4c4af191f 100644 --- a/src/components/palette/PlacementEditor.svelte +++ b/src/components/palette/PlacementEditor.svelte @@ -7,17 +7,20 @@ project: Project; placement: Evaluate; editable: boolean; + id?: string | undefined; } - let { project, placement, editable }: Props = $props(); + let { project, placement, editable, id = undefined }: Props = $props(); - let place = $derived(placement.getInput( - project.shares.input.Placement.inputs[0], - project.getNodeContext(placement) - )); + let place = $derived( + placement.getInput( + project.shares.input.Placement.inputs[0], + project.getNodeContext(placement), + ), + ); -
+
{project.shares.input.Placement.names.getPreferredNameString([], true)} {#if place instanceof Evaluate}
-
+
{#each Array.from(propertyValues.entries()) as [property, values]} {/each} diff --git a/src/components/palette/SequenceEditor.svelte b/src/components/palette/SequenceEditor.svelte index a81ebb286..133745002 100644 --- a/src/components/palette/SequenceEditor.svelte +++ b/src/components/palette/SequenceEditor.svelte @@ -12,9 +12,10 @@ project: Project; outputs: OutputExpression[]; editable: boolean; + id?: string | undefined; } - let { project, outputs, editable }: Props = $props(); + let { project, outputs, editable, id = undefined }: Props = $props(); let SequenceProperties = $derived(getSequenceProperties(project, $locales)); @@ -37,7 +38,7 @@ }); -
+
{#each Array.from(propertyValues.entries()) as [property, values]} {/each} diff --git a/src/components/palette/SequencePosesEditor.svelte b/src/components/palette/SequencePosesEditor.svelte index a1b7075d1..7ba3ff23f 100644 --- a/src/components/palette/SequencePosesEditor.svelte +++ b/src/components/palette/SequencePosesEditor.svelte @@ -18,23 +18,25 @@ project: Project; map: MapLiteral | undefined; editable: boolean; + id?: string | undefined; } - let { project, map, editable }: Props = $props(); + let { project, map, editable, id = undefined }: Props = $props(); // Get the map from the value set, unless its not a valid sequence or the maps of the selections aren't equal. - let valid = - $derived(map !== undefined && - map.values.every( - (kv) => - kv instanceof KeyValue && - kv.key instanceof NumberLiteral && - kv.value instanceof Evaluate && - kv.value.is( - project.shares.output.Pose, - project.getNodeContext(kv.value) - ) - )); + let valid = $derived( + map !== undefined && + map.values.every( + (kv) => + kv instanceof KeyValue && + kv.key instanceof NumberLiteral && + kv.value instanceof Evaluate && + kv.value.is( + project.shares.output.Pose, + project.getNodeContext(kv.value), + ), + ), + ); function revisePercent(kv: KeyValue | Expression, percent: string) { let text = percent.replace('%', ''); @@ -52,9 +54,9 @@ NumberLiteral.make( kv instanceof KeyValue && kv.key instanceof NumberLiteral ? kv.key.number.getText().replace('%', '') - : 0 + : 0, ), - createPoseLiteral(project, $locales) + createPoseLiteral(project, $locales), ), ...map.values.slice(index + 1), ] as KeyValue[]); @@ -89,7 +91,7 @@ } -
+
{#if map && valid} {#each map.values as pair, index} {#if pair instanceof KeyValue && pair.value instanceof Evaluate} @@ -98,7 +100,7 @@ > l.ui.palette.sequence.field + (l) => l.ui.palette.sequence.field, ).percent} placeholder="%" validator={(value) => { @@ -131,14 +133,14 @@ />
{#each Primary as primary}
{/each}
diff --git a/src/components/widgets/Note.svelte b/src/components/widgets/Note.svelte index 028d26058..ce1c3d36a 100644 --- a/src/components/widgets/Note.svelte +++ b/src/components/widgets/Note.svelte @@ -2,12 +2,13 @@ interface Props { center?: boolean; children?: import('svelte').Snippet; + id?: string | undefined; } - let { center = false, children }: Props = $props(); + let { center = false, id = undefined, children }: Props = $props(); -
{@render children?.()}
+
{@render children?.()}