|
62 | 62 | } from "@budibase/types"
|
63 | 63 | import PropField from "./PropField.svelte"
|
64 | 64 | import { utils } from "@budibase/shared-core"
|
65 |
| - import { encodeJSBinding } from "@budibase/string-templates" |
66 |
| - import CodeEditorField from "@/components/common/bindings/CodeEditorField.svelte" |
| 65 | + import DrawerBindableCodeEditorField from "@/components/common/bindings/DrawerBindableCodeEditorField.svelte" |
67 | 66 |
|
68 | 67 | export let automation
|
69 | 68 | export let block
|
|
908 | 907 | />
|
909 | 908 | {:else if value.customType === "code" && stepId === ActionStepID.EXECUTE_SCRIPT_V2}
|
910 | 909 | <div class="scriptv2-wrapper">
|
911 |
| - <DrawerBindableSlot |
912 |
| - title={"Edit Code"} |
913 |
| - panel={AutomationBindingPanel} |
914 |
| - type={"longform"} |
| 910 | + <DrawerBindableCodeEditorField |
| 911 | + {bindings} |
915 | 912 | {schema}
|
| 913 | + panel={AutomationBindingPanel} |
916 | 914 | on:change={e => onChange({ [key]: e.detail })}
|
917 |
| - value={inputData[key]} |
918 |
| - {bindings} |
919 |
| - allowJS={true} |
920 |
| - allowHBS={false} |
921 |
| - updateOnChange={false} |
922 | 915 | context={$memoContext}
|
923 |
| - > |
924 |
| - <div class="field-wrap code-editor"> |
925 |
| - <CodeEditorField |
926 |
| - value={inputData[key]} |
927 |
| - {bindings} |
928 |
| - context={$memoContext} |
929 |
| - allowHBS={false} |
930 |
| - allowJS |
931 |
| - placeholder={"Add bindings by typing $"} |
932 |
| - on:blur={e => |
933 |
| - onChange({ [key]: encodeJSBinding(e.detail) })} |
934 |
| - /> |
935 |
| - </div> |
936 |
| - </DrawerBindableSlot> |
| 916 | + value={inputData[key]} |
| 917 | + /> |
937 | 918 | </div>
|
938 | 919 | {:else if value.customType === "code" && stepId === ActionStepID.EXECUTE_SCRIPT}
|
939 | 920 | <!-- DEPRECATED -->
|
|
1086 | 1067 | flex: 3;
|
1087 | 1068 | margin-top: calc((var(--spacing-xl) * -1) + 1px);
|
1088 | 1069 | }
|
1089 |
| -
|
1090 |
| - .field-wrap :global(.cm-editor), |
1091 |
| - .field-wrap :global(.cm-scroller) { |
1092 |
| - border-radius: 4px; |
1093 |
| - } |
1094 |
| - .field-wrap { |
1095 |
| - box-sizing: border-box; |
1096 |
| - border: 1px solid var(--spectrum-global-color-gray-400); |
1097 |
| - border-radius: 4px; |
1098 |
| - } |
1099 |
| - .field-wrap.code-editor { |
1100 |
| - height: 180px; |
1101 |
| - } |
1102 |
| - .scriptv2-wrapper :global(.icon.slot-icon) { |
1103 |
| - top: 1px; |
1104 |
| - border-bottom-left-radius: var(--spectrum-alias-border-radius-regular); |
1105 |
| - border-right: 0px; |
1106 |
| - border-bottom: 1px solid var(--spectrum-alias-border-color); |
1107 |
| - } |
1108 | 1070 | </style>
|
0 commit comments