{#if arg != undefined}
{#if isStaticTemplate(inputCat)}
{'${...}'}
{/if}
{#if !noDynamicToggle}
{#if enableAi}
0} on:showExpr={(e) => { setTimeout(() => { if (monaco && propertyType === 'javascript') { monaco.setSuggestion(e.detail) } }, 0) }} on:setExpr={(e) => { arg = { type: 'javascript', expr: e.detail } propertyType = 'javascript' monaco?.setCode('') monaco?.insertAtCursor(e.detail) }} {pickableProperties} {argName} /> {/if}
{ if (e.detail == propertyType) return const staticTemplate = isStaticTemplate(inputCat) if (e.detail === 'javascript') { if (arg.expr == undefined) { arg.expr = getDefaultExpr( argName, previousModuleId, staticTemplate ? `\`${arg?.value?.toString().replaceAll('`', '\\`') ?? ''}\`` : arg.value ? '(' + JSON.stringify(arg?.value, null, 4) + ')' : '' ) } if (arg) { arg.value = undefined arg.type = 'javascript' } propertyType = 'javascript' } else { if (staticTemplate) { if (arg) { arg.value = codeToStaticTemplate(arg.expr) arg.expr = undefined } setPropertyType(arg?.value) } else if (inputCat == 'list' || inputCat == 'object') { if (arg) { try { let newExpr = arg.expr if (newExpr.startsWith('(') && newExpr.endsWith(')')) { newExpr = newExpr.slice(1, -1) } arg.value = JSON.parse(newExpr) } catch (e) { arg.value = undefined } arg.expr = undefined arg.type = 'static' } } else { if (arg) { arg.type = 'static' arg.value = undefined arg.expr = undefined } } propertyType = 'static' } }} > {#if isStaticTemplate(inputCat)}
{:else}
{/if} {#if codeInjectionDetected && propertyType == 'static'}
setJavaScriptExpr(arg.value)} >
detected -
TAB
{:else}
{/if}
{ focusProp(argName, 'connect', (path) => { connectProperty(path) dispatch('change', { argName }) return true }) }} />
{/if}
{#if isStaticTemplate(inputCat) && propertyType == 'static' && !noDynamicToggle} {#if argName && schema?.properties?.[argName]?.description}
{schema.properties[argName].description}
{/if}
{#if arg}
{ focused = false }} bind:code={arg.value} fontSize={14} on:change={() => { dispatch('change', { argName }) }} /> {/if}
{:else if (propertyType === undefined || propertyType == 'static') && schema?.properties?.[argName]}
{ focused = false }} shouldDispatchChanges on:change={() => { dispatch('change', { argName }) }} label={argName} bind:editor={monaco} bind:description={schema.properties[argName].description} bind:value={arg.value} type={schema.properties[argName].type} oneOf={schema.properties[argName].oneOf} required={schema.required?.includes(argName)} bind:pattern={schema.properties[argName].pattern} bind:valid={inputCheck} defaultValue={schema.properties[argName].default} bind:enum_={schema.properties[argName].enum} bind:format={schema.properties[argName].format} contentEncoding={schema.properties[argName].contentEncoding} bind:itemsType={schema.properties[argName].items} properties={schema.properties[argName].properties} nestedRequired={schema.properties[argName].required} displayHeader={false} extra={argExtra} {variableEditor} {itemPicker} bind:pickForField showSchemaExplorer nullable={schema.properties[argName].nullable} bind:title={schema.properties[argName].title} bind:placeholder={schema.properties[argName].placeholder} /> {:else if arg.expr != undefined}
{ dispatch('change', { argName }) }} {extraLib} lang="javascript" shouldBindKey={false} on:focus={() => { focused = true focusProp(argName, 'insert', (path) => { monaco?.insertAtCursor(path) return false }) }} on:change={() => { dispatch('change', { argName }) }} on:blur={() => { focused = false }} autoHeight />
{:else} Not recognized input type {argName} ({arg.expr}, {propertyType})
{ arg.expr = '' }}>Set expr to empty string
{/if}
{#if $propPickerConfig?.propName == argName}
{:else}
{/if}
{/if}